uikit 3.11.2-dev.31cd2ba38 → 3.11.2-dev.3dfa2c50b
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/.eslintrc.json +4 -49
- package/.prettierignore +14 -0
- package/.prettierrc.json +13 -0
- package/.webstorm.js +3 -3
- package/CHANGELOG.md +7 -11
- package/build/.eslintrc.json +1 -3
- package/build/build.js +26 -28
- package/build/icons.js +7 -11
- package/build/less.js +48 -36
- package/build/package.json +2 -2
- package/build/prefix.js +21 -18
- package/build/publishDev.js +6 -8
- package/build/release.js +20 -17
- package/build/scope.js +21 -11
- package/build/scss.js +72 -39
- package/build/util.js +71 -62
- package/build/wrapper/icons.js +0 -2
- package/dist/css/uikit-core-rtl.css +42 -17
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +42 -17
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +42 -17
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +42 -17
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +88 -133
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +409 -438
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +1116 -1305
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +1164 -1383
- package/dist/js/components/lightbox.min.js +1 -1
- package/dist/js/components/notification.js +94 -114
- package/dist/js/components/notification.min.js +1 -1
- package/dist/js/components/parallax.js +294 -345
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +292 -344
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +727 -850
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +292 -344
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +615 -799
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +588 -619
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +324 -356
- package/dist/js/components/tooltip.min.js +1 -1
- package/dist/js/components/upload.js +155 -167
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +5266 -6572
- package/dist/js/uikit-core.min.js +1 -1
- package/dist/js/uikit-icons.js +7 -9
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +8126 -9876
- package/dist/js/uikit.min.js +1 -1
- package/jsconfig.json +1 -1
- package/package.json +64 -60
- package/src/js/api/boot.js +25 -32
- package/src/js/api/component.js +23 -27
- package/src/js/api/global.js +6 -12
- package/src/js/api/hooks.js +13 -32
- package/src/js/api/instance.js +7 -15
- package/src/js/api/state.js +79 -100
- package/src/js/components/countdown.js +24 -50
- package/src/js/components/filter.js +71 -66
- package/src/js/components/index.js +13 -13
- package/src/js/components/internal/lightbox-animations.js +11 -23
- package/src/js/components/internal/slider-transitioner.js +66 -45
- package/src/js/components/internal/slideshow-animations.js +42 -61
- package/src/js/components/lightbox-panel.js +135 -109
- package/src/js/components/lightbox.js +18 -39
- package/src/js/components/notification.js +49 -43
- package/src/js/components/parallax.js +16 -30
- package/src/js/components/slider-parallax.js +13 -23
- package/src/js/components/slider.js +75 -64
- package/src/js/components/slideshow-parallax.js +1 -1
- package/src/js/components/slideshow.js +8 -13
- package/src/js/components/sortable.js +125 -106
- package/src/js/components/tooltip.js +41 -31
- package/src/js/components/upload.js +52 -63
- package/src/js/core/accordion.js +53 -48
- package/src/js/core/alert.js +10 -17
- package/src/js/core/core.js +74 -53
- package/src/js/core/cover.js +11 -15
- package/src/js/core/drop.js +106 -92
- package/src/js/core/form-custom.js +20 -25
- package/src/js/core/gif.js +3 -7
- package/src/js/core/grid.js +57 -58
- package/src/js/core/height-match.js +16 -29
- package/src/js/core/height-viewport.js +28 -35
- package/src/js/core/icon.js +38 -50
- package/src/js/core/img.js +130 -105
- package/src/js/core/index.js +39 -39
- package/src/js/core/leader.js +9 -18
- package/src/js/core/margin.js +21 -37
- package/src/js/core/modal.js +50 -36
- package/src/js/core/nav.js +2 -4
- package/src/js/core/navbar.js +112 -88
- package/src/js/core/offcanvas.js +49 -53
- package/src/js/core/overflow-auto.js +13 -17
- package/src/js/core/responsive.js +14 -12
- package/src/js/core/scroll.js +10 -20
- package/src/js/core/scrollspy-nav.js +34 -31
- package/src/js/core/scrollspy.js +37 -54
- package/src/js/core/sticky.js +130 -91
- package/src/js/core/svg.js +60 -79
- package/src/js/core/switcher.js +47 -46
- package/src/js/core/tab.js +7 -10
- package/src/js/core/toggle.js +64 -66
- package/src/js/core/video.js +11 -22
- package/src/js/mixin/animate.js +19 -20
- package/src/js/mixin/class.js +2 -4
- package/src/js/mixin/container.js +7 -11
- package/src/js/mixin/internal/animate-fade.js +73 -30
- package/src/js/mixin/internal/animate-slide.js +61 -41
- package/src/js/mixin/internal/slideshow-animations.js +7 -14
- package/src/js/mixin/internal/slideshow-transitioner.js +10 -17
- package/src/js/mixin/media.js +5 -10
- package/src/js/mixin/modal.js +89 -66
- package/src/js/mixin/parallax.js +53 -48
- package/src/js/mixin/position.js +26 -20
- package/src/js/mixin/slider-autoplay.js +12 -21
- package/src/js/mixin/slider-drag.js +64 -65
- package/src/js/mixin/slider-nav.js +26 -35
- package/src/js/mixin/slider-reactive.js +2 -8
- package/src/js/mixin/slider.js +51 -50
- package/src/js/mixin/slideshow.js +13 -19
- package/src/js/mixin/togglable.js +90 -63
- package/src/js/uikit-core.js +2 -4
- package/src/js/uikit.js +2 -4
- package/src/js/util/ajax.js +27 -43
- package/src/js/util/animation.js +82 -75
- package/src/js/util/attr.js +17 -21
- package/src/js/util/class.js +14 -52
- package/src/js/util/dimensions.js +56 -43
- package/src/js/util/dom.js +40 -73
- package/src/js/util/env.js +7 -12
- package/src/js/util/event.js +60 -59
- package/src/js/util/fastdom.js +1 -6
- package/src/js/util/filter.js +17 -34
- package/src/js/util/index.js +0 -1
- package/src/js/util/lang.js +79 -119
- package/src/js/util/mouse.js +19 -17
- package/src/js/util/options.js +42 -47
- package/src/js/util/player.js +40 -36
- package/src/js/util/position.js +54 -46
- package/src/js/util/promise.js +0 -191
- package/src/js/util/selector.js +39 -48
- package/src/js/util/style.js +36 -46
- package/src/js/util/viewport.js +75 -64
- package/src/less/components/flex.less +0 -9
- package/src/less/components/navbar.less +0 -7
- package/src/less/components/utility.less +22 -0
- package/src/scss/components/flex.scss +0 -9
- package/src/scss/components/form.scss +3 -3
- package/src/scss/components/icon.scss +2 -2
- package/src/scss/components/navbar.scss +0 -7
- package/src/scss/components/search.scss +1 -1
- package/src/scss/components/utility.scss +22 -0
- package/src/scss/variables-theme.scss +6 -6
- package/src/scss/variables.scss +6 -6
- package/tests/image.html +38 -22
- package/tests/js/index.js +114 -85
- package/src/js/mixin/flex-bug.js +0 -56
- package/tests/images/test.avif +0 -0
- package/tests/images/test.webp +0 -0
package/src/js/core/drop.js
CHANGED
|
@@ -1,12 +1,35 @@
|
|
|
1
1
|
import Container from '../mixin/container';
|
|
2
2
|
import Position from '../mixin/position';
|
|
3
3
|
import Togglable from '../mixin/togglable';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
addClass,
|
|
6
|
+
append,
|
|
7
|
+
apply,
|
|
8
|
+
attr,
|
|
9
|
+
css,
|
|
10
|
+
hasClass,
|
|
11
|
+
includes,
|
|
12
|
+
isTouch,
|
|
13
|
+
matches,
|
|
14
|
+
MouseTracker,
|
|
15
|
+
offset,
|
|
16
|
+
on,
|
|
17
|
+
once,
|
|
18
|
+
parent,
|
|
19
|
+
pointerCancel,
|
|
20
|
+
pointerDown,
|
|
21
|
+
pointerEnter,
|
|
22
|
+
pointerLeave,
|
|
23
|
+
pointerUp,
|
|
24
|
+
query,
|
|
25
|
+
removeClass,
|
|
26
|
+
toggleClass,
|
|
27
|
+
within,
|
|
28
|
+
} from 'uikit-util';
|
|
5
29
|
|
|
6
30
|
export let active;
|
|
7
31
|
|
|
8
32
|
export default {
|
|
9
|
-
|
|
10
33
|
mixins: [Container, Position, Togglable],
|
|
11
34
|
|
|
12
35
|
args: 'pos',
|
|
@@ -18,7 +41,7 @@ export default {
|
|
|
18
41
|
boundaryAlign: Boolean,
|
|
19
42
|
delayShow: Number,
|
|
20
43
|
delayHide: Number,
|
|
21
|
-
clsDrop: String
|
|
44
|
+
clsDrop: String,
|
|
22
45
|
},
|
|
23
46
|
|
|
24
47
|
data: {
|
|
@@ -31,23 +54,21 @@ export default {
|
|
|
31
54
|
clsDrop: false,
|
|
32
55
|
animation: ['uk-animation-fade'],
|
|
33
56
|
cls: 'uk-open',
|
|
34
|
-
container: false
|
|
57
|
+
container: false,
|
|
35
58
|
},
|
|
36
59
|
|
|
37
60
|
computed: {
|
|
38
|
-
|
|
39
|
-
boundary({boundary}, $el) {
|
|
61
|
+
boundary({ boundary }, $el) {
|
|
40
62
|
return boundary === true ? window : query(boundary, $el);
|
|
41
63
|
},
|
|
42
64
|
|
|
43
|
-
clsDrop({clsDrop}) {
|
|
65
|
+
clsDrop({ clsDrop }) {
|
|
44
66
|
return clsDrop || `uk-${this.$options.name}`;
|
|
45
67
|
},
|
|
46
68
|
|
|
47
69
|
clsPos() {
|
|
48
70
|
return this.clsDrop;
|
|
49
|
-
}
|
|
50
|
-
|
|
71
|
+
},
|
|
51
72
|
},
|
|
52
73
|
|
|
53
74
|
created() {
|
|
@@ -55,17 +76,15 @@ export default {
|
|
|
55
76
|
},
|
|
56
77
|
|
|
57
78
|
connected() {
|
|
58
|
-
|
|
59
79
|
addClass(this.$el, this.clsDrop);
|
|
60
80
|
|
|
61
81
|
if (this.toggle && !this.target) {
|
|
62
82
|
this.target = this.$create('toggle', query(this.toggle, this.$el), {
|
|
63
83
|
target: this.$el,
|
|
64
|
-
mode: this.mode
|
|
84
|
+
mode: this.mode,
|
|
65
85
|
}).$el;
|
|
66
86
|
attr(this.target, 'aria-haspopup', true);
|
|
67
87
|
}
|
|
68
|
-
|
|
69
88
|
},
|
|
70
89
|
|
|
71
90
|
disconnected() {
|
|
@@ -75,9 +94,7 @@ export default {
|
|
|
75
94
|
},
|
|
76
95
|
|
|
77
96
|
events: [
|
|
78
|
-
|
|
79
97
|
{
|
|
80
|
-
|
|
81
98
|
name: 'click',
|
|
82
99
|
|
|
83
100
|
delegate() {
|
|
@@ -87,44 +104,37 @@ export default {
|
|
|
87
104
|
handler(e) {
|
|
88
105
|
e.preventDefault();
|
|
89
106
|
this.hide(false);
|
|
90
|
-
}
|
|
91
|
-
|
|
107
|
+
},
|
|
92
108
|
},
|
|
93
109
|
|
|
94
110
|
{
|
|
95
|
-
|
|
96
111
|
name: 'click',
|
|
97
112
|
|
|
98
113
|
delegate() {
|
|
99
114
|
return 'a[href^="#"]';
|
|
100
115
|
},
|
|
101
116
|
|
|
102
|
-
handler({defaultPrevented, current: {hash}}) {
|
|
117
|
+
handler({ defaultPrevented, current: { hash } }) {
|
|
103
118
|
if (!defaultPrevented && hash && !within(hash, this.$el)) {
|
|
104
119
|
this.hide(false);
|
|
105
120
|
}
|
|
106
|
-
}
|
|
107
|
-
|
|
121
|
+
},
|
|
108
122
|
},
|
|
109
123
|
|
|
110
124
|
{
|
|
111
|
-
|
|
112
125
|
name: 'beforescroll',
|
|
113
126
|
|
|
114
127
|
handler() {
|
|
115
128
|
this.hide(false);
|
|
116
|
-
}
|
|
117
|
-
|
|
129
|
+
},
|
|
118
130
|
},
|
|
119
131
|
|
|
120
132
|
{
|
|
121
|
-
|
|
122
133
|
name: 'toggle',
|
|
123
134
|
|
|
124
135
|
self: true,
|
|
125
136
|
|
|
126
137
|
handler(e, toggle) {
|
|
127
|
-
|
|
128
138
|
e.preventDefault();
|
|
129
139
|
|
|
130
140
|
if (this.isToggled()) {
|
|
@@ -132,12 +142,10 @@ export default {
|
|
|
132
142
|
} else {
|
|
133
143
|
this.show(toggle.$el, false);
|
|
134
144
|
}
|
|
135
|
-
}
|
|
136
|
-
|
|
145
|
+
},
|
|
137
146
|
},
|
|
138
147
|
|
|
139
148
|
{
|
|
140
|
-
|
|
141
149
|
name: 'toggleshow',
|
|
142
150
|
|
|
143
151
|
self: true,
|
|
@@ -145,12 +153,10 @@ export default {
|
|
|
145
153
|
handler(e, toggle) {
|
|
146
154
|
e.preventDefault();
|
|
147
155
|
this.show(toggle.$el);
|
|
148
|
-
}
|
|
149
|
-
|
|
156
|
+
},
|
|
150
157
|
},
|
|
151
158
|
|
|
152
159
|
{
|
|
153
|
-
|
|
154
160
|
name: 'togglehide',
|
|
155
161
|
|
|
156
162
|
self: true,
|
|
@@ -160,12 +166,10 @@ export default {
|
|
|
160
166
|
if (!matches(this.$el, ':focus,:hover')) {
|
|
161
167
|
this.hide();
|
|
162
168
|
}
|
|
163
|
-
}
|
|
164
|
-
|
|
169
|
+
},
|
|
165
170
|
},
|
|
166
171
|
|
|
167
172
|
{
|
|
168
|
-
|
|
169
173
|
name: `${pointerEnter} focusin`,
|
|
170
174
|
|
|
171
175
|
filter() {
|
|
@@ -176,12 +180,10 @@ export default {
|
|
|
176
180
|
if (!isTouch(e)) {
|
|
177
181
|
this.clearTimers();
|
|
178
182
|
}
|
|
179
|
-
}
|
|
180
|
-
|
|
183
|
+
},
|
|
181
184
|
},
|
|
182
185
|
|
|
183
186
|
{
|
|
184
|
-
|
|
185
187
|
name: `${pointerLeave} focusout`,
|
|
186
188
|
|
|
187
189
|
filter() {
|
|
@@ -192,107 +194,114 @@ export default {
|
|
|
192
194
|
if (!isTouch(e) && e.relatedTarget) {
|
|
193
195
|
this.hide();
|
|
194
196
|
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
+
},
|
|
197
198
|
},
|
|
198
199
|
|
|
199
200
|
{
|
|
200
|
-
|
|
201
201
|
name: 'toggled',
|
|
202
202
|
|
|
203
203
|
self: true,
|
|
204
204
|
|
|
205
205
|
handler(e, toggled) {
|
|
206
|
-
|
|
207
206
|
if (!toggled) {
|
|
208
207
|
return;
|
|
209
208
|
}
|
|
210
209
|
|
|
211
210
|
this.clearTimers();
|
|
212
211
|
this.position();
|
|
213
|
-
}
|
|
214
|
-
|
|
212
|
+
},
|
|
215
213
|
},
|
|
216
214
|
|
|
217
215
|
{
|
|
218
|
-
|
|
219
216
|
name: 'show',
|
|
220
217
|
|
|
221
218
|
self: true,
|
|
222
219
|
|
|
223
220
|
handler() {
|
|
224
|
-
|
|
225
221
|
active = this;
|
|
226
222
|
|
|
227
223
|
this.tracker.init();
|
|
228
224
|
|
|
229
|
-
once(
|
|
230
|
-
|
|
231
|
-
|
|
225
|
+
once(
|
|
226
|
+
this.$el,
|
|
227
|
+
'hide',
|
|
228
|
+
on(
|
|
229
|
+
document,
|
|
230
|
+
pointerDown,
|
|
231
|
+
({ target }) =>
|
|
232
|
+
!within(target, this.$el) &&
|
|
233
|
+
once(
|
|
234
|
+
document,
|
|
235
|
+
`${pointerUp} ${pointerCancel} scroll`,
|
|
236
|
+
({ defaultPrevented, type, target: newTarget }) => {
|
|
237
|
+
if (
|
|
238
|
+
!defaultPrevented &&
|
|
239
|
+
type === pointerUp &&
|
|
240
|
+
target === newTarget &&
|
|
241
|
+
!(this.target && within(target, this.target))
|
|
242
|
+
) {
|
|
243
|
+
this.hide(false);
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
true
|
|
247
|
+
)
|
|
248
|
+
),
|
|
249
|
+
{ self: true }
|
|
250
|
+
);
|
|
251
|
+
|
|
252
|
+
once(
|
|
253
|
+
this.$el,
|
|
254
|
+
'hide',
|
|
255
|
+
on(document, 'keydown', (e) => {
|
|
256
|
+
if (e.keyCode === 27) {
|
|
232
257
|
this.hide(false);
|
|
233
258
|
}
|
|
234
|
-
},
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
if (e.keyCode === 27) {
|
|
239
|
-
this.hide(false);
|
|
240
|
-
}
|
|
241
|
-
}), {self: true});
|
|
242
|
-
|
|
243
|
-
}
|
|
244
|
-
|
|
259
|
+
}),
|
|
260
|
+
{ self: true }
|
|
261
|
+
);
|
|
262
|
+
},
|
|
245
263
|
},
|
|
246
264
|
|
|
247
265
|
{
|
|
248
|
-
|
|
249
266
|
name: 'beforehide',
|
|
250
267
|
|
|
251
268
|
self: true,
|
|
252
269
|
|
|
253
270
|
handler() {
|
|
254
271
|
this.clearTimers();
|
|
255
|
-
}
|
|
256
|
-
|
|
272
|
+
},
|
|
257
273
|
},
|
|
258
274
|
|
|
259
275
|
{
|
|
260
|
-
|
|
261
276
|
name: 'hide',
|
|
262
277
|
|
|
263
|
-
handler({target}) {
|
|
264
|
-
|
|
278
|
+
handler({ target }) {
|
|
265
279
|
if (this.$el !== target) {
|
|
266
|
-
active =
|
|
280
|
+
active =
|
|
281
|
+
active === null && within(target, this.$el) && this.isToggled()
|
|
282
|
+
? this
|
|
283
|
+
: active;
|
|
267
284
|
return;
|
|
268
285
|
}
|
|
269
286
|
|
|
270
287
|
active = this.isActive() ? null : active;
|
|
271
288
|
this.tracker.cancel();
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
|
|
289
|
+
},
|
|
290
|
+
},
|
|
276
291
|
],
|
|
277
292
|
|
|
278
293
|
update: {
|
|
279
|
-
|
|
280
294
|
write() {
|
|
281
|
-
|
|
282
295
|
if (this.isToggled() && !hasClass(this.$el, this.clsEnter)) {
|
|
283
296
|
this.position();
|
|
284
297
|
}
|
|
285
|
-
|
|
286
298
|
},
|
|
287
299
|
|
|
288
|
-
events: ['resize']
|
|
289
|
-
|
|
300
|
+
events: ['resize'],
|
|
290
301
|
},
|
|
291
302
|
|
|
292
303
|
methods: {
|
|
293
|
-
|
|
294
304
|
show(target = this.target, delay = true) {
|
|
295
|
-
|
|
296
305
|
if (this.isToggled() && target && this.target && target !== this.target) {
|
|
297
306
|
this.hide(false);
|
|
298
307
|
}
|
|
@@ -306,7 +315,6 @@ export default {
|
|
|
306
315
|
}
|
|
307
316
|
|
|
308
317
|
if (active) {
|
|
309
|
-
|
|
310
318
|
if (delay && active.isDelaying) {
|
|
311
319
|
this.showTimer = setTimeout(() => matches(target, ':hover') && this.show(), 10);
|
|
312
320
|
return;
|
|
@@ -317,24 +325,26 @@ export default {
|
|
|
317
325
|
prev = active;
|
|
318
326
|
active.hide(false);
|
|
319
327
|
}
|
|
320
|
-
|
|
321
328
|
}
|
|
322
329
|
|
|
323
330
|
if (this.container && parent(this.$el) !== this.container) {
|
|
324
331
|
append(this.container, this.$el);
|
|
325
332
|
}
|
|
326
333
|
|
|
327
|
-
this.showTimer = setTimeout(
|
|
328
|
-
|
|
334
|
+
this.showTimer = setTimeout(
|
|
335
|
+
() => this.toggleElement(this.$el, true),
|
|
336
|
+
(delay && this.delayShow) || 0
|
|
337
|
+
);
|
|
329
338
|
},
|
|
330
339
|
|
|
331
340
|
hide(delay = true) {
|
|
332
|
-
|
|
333
341
|
const hide = () => this.toggleElement(this.$el, false, false);
|
|
334
342
|
|
|
335
343
|
this.clearTimers();
|
|
336
344
|
|
|
337
|
-
this.isDelaying = getPositionedElements(this.$el).some(el =>
|
|
345
|
+
this.isDelaying = getPositionedElements(this.$el).some((el) =>
|
|
346
|
+
this.tracker.movesTo(el)
|
|
347
|
+
);
|
|
338
348
|
|
|
339
349
|
if (delay && this.isDelaying) {
|
|
340
350
|
this.hideTimer = setTimeout(this.hide, 50);
|
|
@@ -358,7 +368,6 @@ export default {
|
|
|
358
368
|
},
|
|
359
369
|
|
|
360
370
|
position() {
|
|
361
|
-
|
|
362
371
|
removeClass(this.$el, `${this.clsDrop}-stack`);
|
|
363
372
|
toggleClass(this.$el, `${this.clsDrop}-boundary`, this.boundaryAlign);
|
|
364
373
|
|
|
@@ -368,20 +377,25 @@ export default {
|
|
|
368
377
|
if (this.align === 'justify') {
|
|
369
378
|
const prop = this.getAxis() === 'y' ? 'width' : 'height';
|
|
370
379
|
css(this.$el, prop, alignTo[prop]);
|
|
371
|
-
} else if (
|
|
380
|
+
} else if (
|
|
381
|
+
this.boundary &&
|
|
382
|
+
this.$el.offsetWidth >
|
|
383
|
+
Math.max(boundary.right - alignTo.left, alignTo.right - boundary.left)
|
|
384
|
+
) {
|
|
372
385
|
addClass(this.$el, `${this.clsDrop}-stack`);
|
|
373
386
|
}
|
|
374
387
|
|
|
375
|
-
this.positionAt(
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
388
|
+
this.positionAt(
|
|
389
|
+
this.$el,
|
|
390
|
+
this.boundaryAlign ? this.boundary : this.target,
|
|
391
|
+
this.boundary
|
|
392
|
+
);
|
|
393
|
+
},
|
|
394
|
+
},
|
|
381
395
|
};
|
|
382
396
|
|
|
383
397
|
function getPositionedElements(el) {
|
|
384
398
|
const result = [];
|
|
385
|
-
apply(el, el => css(el, 'position') !== 'static' && result.push(el));
|
|
399
|
+
apply(el, (el) => css(el, 'position') !== 'static' && result.push(el));
|
|
386
400
|
return result;
|
|
387
401
|
}
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import Class from '../mixin/class';
|
|
2
|
-
import {$, $$, closest, isInput, matches, parent, query, selInput} from 'uikit-util';
|
|
2
|
+
import { $, $$, closest, isInput, matches, parent, query, selInput } from 'uikit-util';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
|
-
|
|
6
5
|
mixins: [Class],
|
|
7
6
|
|
|
8
7
|
args: 'target',
|
|
9
8
|
|
|
10
9
|
props: {
|
|
11
|
-
target: Boolean
|
|
10
|
+
target: Boolean,
|
|
12
11
|
},
|
|
13
12
|
|
|
14
13
|
data: {
|
|
15
|
-
target: false
|
|
14
|
+
target: false,
|
|
16
15
|
},
|
|
17
16
|
|
|
18
17
|
computed: {
|
|
19
|
-
|
|
20
18
|
input(_, $el) {
|
|
21
19
|
return $(selInput, $el);
|
|
22
20
|
},
|
|
@@ -25,18 +23,17 @@ export default {
|
|
|
25
23
|
return this.input.nextElementSibling;
|
|
26
24
|
},
|
|
27
25
|
|
|
28
|
-
target({target}, $el) {
|
|
29
|
-
return
|
|
30
|
-
&&
|
|
31
|
-
&& this.input.nextElementSibling
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
target({ target }, $el) {
|
|
27
|
+
return (
|
|
28
|
+
target &&
|
|
29
|
+
((target === true && parent(this.input) === $el && this.input.nextElementSibling) ||
|
|
30
|
+
query(target, $el))
|
|
31
|
+
);
|
|
32
|
+
},
|
|
35
33
|
},
|
|
36
34
|
|
|
37
35
|
update() {
|
|
38
|
-
|
|
39
|
-
const {target, input} = this;
|
|
36
|
+
const { target, input } = this;
|
|
40
37
|
|
|
41
38
|
if (!target) {
|
|
42
39
|
return;
|
|
@@ -45,26 +42,26 @@ export default {
|
|
|
45
42
|
let option;
|
|
46
43
|
const prop = isInput(target) ? 'value' : 'textContent';
|
|
47
44
|
const prev = target[prop];
|
|
48
|
-
const value =
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
const value =
|
|
46
|
+
input.files && input.files[0]
|
|
47
|
+
? input.files[0].name
|
|
48
|
+
: matches(input, 'select') &&
|
|
49
|
+
(option = $$('option', input).filter((el) => el.selected)[0]) // eslint-disable-line prefer-destructuring
|
|
51
50
|
? option.textContent
|
|
52
51
|
: input.value;
|
|
53
52
|
|
|
54
53
|
if (prev !== value) {
|
|
55
54
|
target[prop] = value;
|
|
56
55
|
}
|
|
57
|
-
|
|
58
56
|
},
|
|
59
57
|
|
|
60
58
|
events: [
|
|
61
|
-
|
|
62
59
|
{
|
|
63
60
|
name: 'change',
|
|
64
61
|
|
|
65
62
|
handler() {
|
|
66
63
|
this.$update();
|
|
67
|
-
}
|
|
64
|
+
},
|
|
68
65
|
},
|
|
69
66
|
|
|
70
67
|
{
|
|
@@ -76,9 +73,7 @@ export default {
|
|
|
76
73
|
|
|
77
74
|
handler() {
|
|
78
75
|
this.$update();
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
]
|
|
83
|
-
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
],
|
|
84
79
|
};
|
package/src/js/core/gif.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import {isInView} from 'uikit-util';
|
|
1
|
+
import { isInView } from 'uikit-util';
|
|
2
2
|
|
|
3
3
|
// Deprecated
|
|
4
4
|
export default {
|
|
5
|
-
|
|
6
5
|
update: {
|
|
7
|
-
|
|
8
6
|
read(data) {
|
|
9
|
-
|
|
10
7
|
const inview = isInView(this.$el);
|
|
11
8
|
|
|
12
9
|
if (!inview || data.isInView === inview) {
|
|
@@ -20,7 +17,6 @@ export default {
|
|
|
20
17
|
this.$el.src = '' + this.$el.src; // force self-assign
|
|
21
18
|
},
|
|
22
19
|
|
|
23
|
-
events: ['scroll', 'resize']
|
|
24
|
-
}
|
|
25
|
-
|
|
20
|
+
events: ['scroll', 'resize'],
|
|
21
|
+
},
|
|
26
22
|
};
|