uikit 3.11.2-dev.f2970ffaa → 3.12.0

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