uikit 3.11.2-dev.31cd2ba38 → 3.11.2-dev.4274bc35b

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 (221) 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 +38 -28
  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 +121 -202
  19. package/dist/css/uikit-core-rtl.min.css +1 -1
  20. package/dist/css/uikit-core.css +121 -202
  21. package/dist/css/uikit-core.min.css +1 -1
  22. package/dist/css/uikit-rtl.css +123 -208
  23. package/dist/css/uikit-rtl.min.css +1 -1
  24. package/dist/css/uikit.css +123 -208
  25. package/dist/css/uikit.min.css +1 -1
  26. package/dist/js/components/countdown.js +88 -133
  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 +1098 -1316
  31. package/dist/js/components/lightbox-panel.min.js +1 -1
  32. package/dist/js/components/lightbox.js +1144 -1393
  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 +326 -358
  37. package/dist/js/components/parallax.min.js +1 -1
  38. package/dist/js/components/slider-parallax.js +324 -357
  39. package/dist/js/components/slider-parallax.min.js +1 -1
  40. package/dist/js/components/slider.js +768 -843
  41. package/dist/js/components/slider.min.js +1 -1
  42. package/dist/js/components/slideshow-parallax.js +324 -357
  43. package/dist/js/components/slideshow-parallax.min.js +1 -1
  44. package/dist/js/components/slideshow.js +645 -793
  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 +155 -167
  51. package/dist/js/components/upload.min.js +1 -1
  52. package/dist/js/uikit-core.js +5405 -6716
  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 +7997 -9703
  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 +79 -100
  66. package/src/js/components/countdown.js +24 -50
  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 +37 -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 +16 -30
  77. package/src/js/components/slider-parallax.js +13 -23
  78. package/src/js/components/slider.js +95 -64
  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 +52 -63
  84. package/src/js/core/accordion.js +53 -48
  85. package/src/js/core/alert.js +9 -17
  86. package/src/js/core/core.js +74 -53
  87. package/src/js/core/cover.js +11 -15
  88. package/src/js/core/drop.js +106 -92
  89. package/src/js/core/form-custom.js +20 -25
  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 +28 -35
  94. package/src/js/core/icon.js +38 -50
  95. package/src/js/core/img.js +127 -87
  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 +112 -88
  102. package/src/js/core/offcanvas.js +49 -53
  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 +130 -91
  109. package/src/js/core/svg.js +68 -83
  110. package/src/js/core/switcher.js +47 -46
  111. package/src/js/core/tab.js +7 -10
  112. package/src/js/core/toggle.js +66 -67
  113. package/src/js/core/video.js +11 -22
  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/media.js +5 -10
  122. package/src/js/mixin/modal.js +89 -66
  123. package/src/js/mixin/parallax.js +130 -106
  124. package/src/js/mixin/position.js +26 -20
  125. package/src/js/mixin/slider-autoplay.js +12 -21
  126. package/src/js/mixin/slider-drag.js +64 -65
  127. package/src/js/mixin/slider-nav.js +26 -35
  128. package/src/js/mixin/slider-reactive.js +2 -8
  129. package/src/js/mixin/slider.js +48 -55
  130. package/src/js/mixin/slideshow.js +13 -19
  131. package/src/js/mixin/togglable.js +89 -63
  132. package/src/js/uikit-core.js +2 -4
  133. package/src/js/uikit.js +2 -4
  134. package/src/js/util/ajax.js +20 -39
  135. package/src/js/util/animation.js +77 -75
  136. package/src/js/util/attr.js +17 -21
  137. package/src/js/util/class.js +14 -52
  138. package/src/js/util/dimensions.js +56 -43
  139. package/src/js/util/dom.js +44 -80
  140. package/src/js/util/env.js +7 -12
  141. package/src/js/util/event.js +60 -59
  142. package/src/js/util/fastdom.js +1 -6
  143. package/src/js/util/filter.js +17 -34
  144. package/src/js/util/index.js +0 -1
  145. package/src/js/util/lang.js +82 -121
  146. package/src/js/util/mouse.js +19 -17
  147. package/src/js/util/options.js +33 -47
  148. package/src/js/util/player.js +41 -36
  149. package/src/js/util/position.js +54 -46
  150. package/src/js/util/selector.js +43 -58
  151. package/src/js/util/style.js +39 -49
  152. package/src/js/util/viewport.js +75 -64
  153. package/src/less/components/base.less +10 -33
  154. package/src/less/components/flex.less +0 -9
  155. package/src/less/components/form-range.less +52 -97
  156. package/src/less/components/form.less +0 -1
  157. package/src/less/components/leader.less +0 -1
  158. package/src/less/components/lightbox.less +0 -1
  159. package/src/less/components/modal.less +3 -7
  160. package/src/less/components/navbar.less +0 -7
  161. package/src/less/components/progress.less +14 -36
  162. package/src/less/components/slider.less +0 -3
  163. package/src/less/components/slideshow.less +0 -3
  164. package/src/less/components/text.less +16 -32
  165. package/src/less/components/utility.less +22 -0
  166. package/src/scss/components/base.scss +10 -33
  167. package/src/scss/components/flex.scss +0 -9
  168. package/src/scss/components/form-range.scss +52 -97
  169. package/src/scss/components/form.scss +3 -4
  170. package/src/scss/components/icon.scss +2 -2
  171. package/src/scss/components/leader.scss +0 -1
  172. package/src/scss/components/lightbox.scss +0 -1
  173. package/src/scss/components/modal.scss +3 -7
  174. package/src/scss/components/navbar.scss +0 -7
  175. package/src/scss/components/progress.scss +14 -36
  176. package/src/scss/components/search.scss +1 -1
  177. package/src/scss/components/slider.scss +0 -3
  178. package/src/scss/components/slideshow.scss +0 -3
  179. package/src/scss/components/text.scss +16 -32
  180. package/src/scss/components/utility.scss +22 -0
  181. package/src/scss/mixins-theme.scss +1 -1
  182. package/src/scss/mixins.scss +1 -1
  183. package/src/scss/variables-theme.scss +9 -9
  184. package/src/scss/variables.scss +9 -9
  185. package/tests/align.html +10 -10
  186. package/tests/animation.html +2 -2
  187. package/tests/article.html +2 -2
  188. package/tests/base.html +3 -3
  189. package/tests/card.html +10 -10
  190. package/tests/column.html +3 -3
  191. package/tests/comment.html +9 -9
  192. package/tests/dotnav.html +3 -3
  193. package/tests/image.html +296 -48
  194. package/tests/images/image-type.avif +0 -0
  195. package/tests/images/image-type.jpeg +0 -0
  196. package/tests/images/image-type.webp +0 -0
  197. package/tests/index.html +8 -8
  198. package/tests/js/index.js +114 -85
  199. package/tests/lightbox.html +10 -10
  200. package/tests/marker.html +2 -2
  201. package/tests/modal.html +8 -9
  202. package/tests/navbar.html +2 -2
  203. package/tests/overlay.html +7 -7
  204. package/tests/parallax.html +14 -5
  205. package/tests/position.html +12 -12
  206. package/tests/slidenav.html +12 -12
  207. package/tests/slider.html +20 -20
  208. package/tests/sortable.html +1 -1
  209. package/tests/sticky-parallax.html +47 -62
  210. package/tests/svg.html +6 -6
  211. package/tests/table.html +11 -11
  212. package/tests/thumbnav.html +12 -12
  213. package/tests/transition.html +30 -30
  214. package/tests/utility.html +33 -33
  215. package/tests/video.html +1 -1
  216. package/tests/width.html +1 -1
  217. package/src/js/mixin/flex-bug.js +0 -56
  218. package/src/js/util/promise.js +0 -191
  219. package/tests/images/animated.gif +0 -0
  220. package/tests/images/test.avif +0 -0
  221. package/tests/images/test.webp +0 -0
@@ -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 {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';
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(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))) {
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
- }, 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
-
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 = active === null && within(target, this.$el) && this.isToggled() ? this : 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(() => this.toggleElement(this.$el, true), delay && this.delayShow || 0);
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 => this.tracker.movesTo(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 (this.boundary && this.$el.offsetWidth > Math.max(boundary.right - alignTo.left, alignTo.right - boundary.left)) {
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(this.$el, this.boundaryAlign ? this.boundary : this.target, this.boundary);
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 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
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
  };
@@ -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
  };