uikit 3.11.2-dev.c7ed3c19b → 3.11.2-dev.d8c101f07

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 (62) hide show
  1. package/dist/css/uikit-core-rtl.css +1 -1
  2. package/dist/css/uikit-core-rtl.min.css +1 -1
  3. package/dist/css/uikit-core.css +1 -1
  4. package/dist/css/uikit-core.min.css +1 -1
  5. package/dist/css/uikit-rtl.css +1 -1
  6. package/dist/css/uikit-rtl.min.css +1 -1
  7. package/dist/css/uikit.css +1 -1
  8. package/dist/css/uikit.min.css +1 -1
  9. package/dist/js/components/countdown.js +1 -1
  10. package/dist/js/components/countdown.min.js +1 -1
  11. package/dist/js/components/filter.js +6 -8
  12. package/dist/js/components/filter.min.js +1 -1
  13. package/dist/js/components/lightbox-panel.js +26 -55
  14. package/dist/js/components/lightbox-panel.min.js +1 -1
  15. package/dist/js/components/lightbox.js +27 -57
  16. package/dist/js/components/lightbox.min.js +1 -1
  17. package/dist/js/components/notification.js +1 -1
  18. package/dist/js/components/notification.min.js +1 -1
  19. package/dist/js/components/parallax.js +1 -1
  20. package/dist/js/components/parallax.min.js +1 -1
  21. package/dist/js/components/slider-parallax.js +1 -1
  22. package/dist/js/components/slider-parallax.min.js +1 -1
  23. package/dist/js/components/slider.js +4 -11
  24. package/dist/js/components/slider.min.js +1 -1
  25. package/dist/js/components/slideshow-parallax.js +1 -1
  26. package/dist/js/components/slideshow-parallax.min.js +1 -1
  27. package/dist/js/components/slideshow.js +8 -14
  28. package/dist/js/components/slideshow.min.js +1 -1
  29. package/dist/js/components/sortable.js +5 -7
  30. package/dist/js/components/sortable.min.js +1 -1
  31. package/dist/js/components/tooltip.js +2 -2
  32. package/dist/js/components/tooltip.min.js +1 -1
  33. package/dist/js/components/upload.js +1 -1
  34. package/dist/js/components/upload.min.js +1 -1
  35. package/dist/js/uikit-core.js +20 -27
  36. package/dist/js/uikit-core.min.js +1 -1
  37. package/dist/js/uikit-icons.js +1 -1
  38. package/dist/js/uikit-icons.min.js +1 -1
  39. package/dist/js/uikit.js +54 -92
  40. package/dist/js/uikit.min.js +1 -1
  41. package/package.json +1 -1
  42. package/src/js/api/component.js +2 -11
  43. package/src/js/api/hooks.js +1 -1
  44. package/src/js/api/state.js +1 -1
  45. package/src/js/components/filter.js +2 -3
  46. package/src/js/components/internal/lightbox-animations.js +4 -3
  47. package/src/js/components/internal/slideshow-animations.js +4 -3
  48. package/src/js/components/lightbox-panel.js +34 -58
  49. package/src/js/components/lightbox.js +1 -2
  50. package/src/js/components/sortable.js +1 -1
  51. package/src/js/core/alert.js +1 -2
  52. package/src/js/core/modal.js +1 -2
  53. package/src/js/core/navbar.js +3 -3
  54. package/src/js/mixin/internal/animate-slide.js +9 -12
  55. package/src/js/mixin/slider.js +8 -16
  56. package/src/js/mixin/slideshow.js +2 -2
  57. package/src/js/mixin/togglable.js +1 -2
  58. package/src/js/util/ajax.js +9 -12
  59. package/src/js/util/animation.js +7 -12
  60. package/src/js/util/lang.js +1 -1
  61. package/src/js/util/options.js +2 -11
  62. package/src/js/util/player.js +2 -2
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "uikit",
3
3
  "title": "UIkit",
4
4
  "description": "UIkit is a lightweight and modular front-end framework for developing fast and powerful web interfaces.",
5
- "version": "3.11.2-dev.c7ed3c19b",
5
+ "version": "3.11.2-dev.d8c101f07",
6
6
  "main": "dist/js/uikit.js",
7
7
  "style": "dist/css/uikit.css",
8
8
  "sideEffects": [
@@ -1,13 +1,4 @@
1
- import {
2
- $$,
3
- assign,
4
- camelize,
5
- fastdom,
6
- hyphenate,
7
- isPlainObject,
8
- memoize,
9
- startsWith,
10
- } from 'uikit-util';
1
+ import { $$, camelize, fastdom, hyphenate, isPlainObject, memoize, startsWith } from 'uikit-util';
11
2
 
12
3
  export default function (UIkit) {
13
4
  const DATA = UIkit.data;
@@ -51,7 +42,7 @@ export default function (UIkit) {
51
42
  }
52
43
  };
53
44
 
54
- const opt = isPlainObject(options) ? assign({}, options) : options.options;
45
+ const opt = isPlainObject(options) ? { ...options } : options.options;
55
46
 
56
47
  opt.name = name;
57
48
 
@@ -105,7 +105,7 @@ export default function (UIkit) {
105
105
  const {
106
106
  $options: { computed },
107
107
  } = this;
108
- const values = assign({}, this._computeds);
108
+ const values = { ...this._computeds };
109
109
  this._computeds = {};
110
110
 
111
111
  for (const key in computed) {
@@ -187,7 +187,7 @@ export default function (UIkit) {
187
187
  el = isFunction(el) ? el.call(component) : el || component.$el;
188
188
 
189
189
  if (isArray(el)) {
190
- el.forEach((el) => registerEvent(component, assign({}, event, { el }), key));
190
+ el.forEach((el) => registerEvent(component, { ...event, el }, key));
191
191
  return;
192
192
  }
193
193
 
@@ -2,7 +2,6 @@ import Animate from '../mixin/animate';
2
2
  import {
3
3
  $$,
4
4
  append,
5
- assign,
6
5
  css,
7
6
  data,
8
7
  each,
@@ -105,7 +104,7 @@ export default {
105
104
  },
106
105
 
107
106
  setState(state, animate = true) {
108
- state = assign({ filter: { '': '' }, sort: [] }, state);
107
+ state = { filter: { '': '' }, sort: [], ...state };
109
108
 
110
109
  trigger(this.$el, 'beforeFilter', [this, state]);
111
110
 
@@ -205,7 +204,7 @@ function getSelector({ filter }) {
205
204
  }
206
205
 
207
206
  function sortItems(nodes, sort, order) {
208
- return assign([], nodes).sort(
207
+ return [...nodes].sort(
209
208
  (a, b) =>
210
209
  data(a, sort).localeCompare(data(b, sort), undefined, { numeric: true }) *
211
210
  (order === 'asc' || -1)
@@ -1,7 +1,8 @@
1
1
  import Animations, { scale3d } from '../../mixin/internal/slideshow-animations';
2
- import { assign, css } from 'uikit-util';
2
+ import { css } from 'uikit-util';
3
3
 
4
- export default assign({}, Animations, {
4
+ export default {
5
+ ...Animations,
5
6
  fade: {
6
7
  show() {
7
8
  return [{ opacity: 0 }, { opacity: 1 }];
@@ -35,4 +36,4 @@ export default assign({}, Animations, {
35
36
  ];
36
37
  },
37
38
  },
38
- });
39
+ };
@@ -3,9 +3,10 @@ import Animations, {
3
3
  translate,
4
4
  translated,
5
5
  } from '../../mixin/internal/slideshow-animations';
6
- import { assign, css } from 'uikit-util';
6
+ import { css } from 'uikit-util';
7
7
 
8
- export default assign({}, Animations, {
8
+ export default {
9
+ ...Animations,
9
10
  fade: {
10
11
  show() {
11
12
  return [{ opacity: 0, zIndex: 0 }, { zIndex: -1 }];
@@ -96,4 +97,4 @@ export default assign({}, Animations, {
96
97
  ];
97
98
  },
98
99
  },
99
- });
100
+ };
@@ -7,7 +7,6 @@ import {
7
7
  $,
8
8
  addClass,
9
9
  append,
10
- assign,
11
10
  attr,
12
11
  fragment,
13
12
  getImage,
@@ -219,29 +218,21 @@ export default {
219
218
  if (type === 'image' || src.match(/\.(avif|jpe?g|a?png|gif|svg|webp)($|\?)/i)) {
220
219
  try {
221
220
  const { width, height } = await getImage(src, attrs.srcset, attrs.size);
222
- this.setItem(
223
- item,
224
- createEl('img', assign({ src, width, height, alt }, attrs))
225
- );
221
+ this.setItem(item, createEl('img', { src, width, height, alt, ...attrs }));
226
222
  } catch (e) {
227
223
  this.setError(item);
228
224
  }
229
225
 
230
226
  // Video
231
227
  } else if (type === 'video' || src.match(/\.(mp4|webm|ogv)($|\?)/i)) {
232
- const video = createEl(
233
- 'video',
234
- assign(
235
- {
236
- src,
237
- poster,
238
- controls: '',
239
- playsinline: '',
240
- 'uk-video': `${this.videoAutoplay}`,
241
- },
242
- attrs
243
- )
244
- );
228
+ const video = createEl('video', {
229
+ src,
230
+ poster,
231
+ controls: '',
232
+ playsinline: '',
233
+ 'uk-video': `${this.videoAutoplay}`,
234
+ ...attrs,
235
+ });
245
236
 
246
237
  on(video, 'loadedmetadata', () => {
247
238
  attr(video, { width: video.videoWidth, height: video.videoHeight });
@@ -253,18 +244,13 @@ export default {
253
244
  } else if (type === 'iframe' || src.match(/\.(html|php)($|\?)/i)) {
254
245
  this.setItem(
255
246
  item,
256
- createEl(
257
- 'iframe',
258
- assign(
259
- {
260
- src,
261
- frameborder: '0',
262
- allowfullscreen: '',
263
- class: 'uk-lightbox-iframe',
264
- },
265
- attrs
266
- )
267
- )
247
+ createEl('iframe', {
248
+ src,
249
+ frameborder: '0',
250
+ allowfullscreen: '',
251
+ class: 'uk-lightbox-iframe',
252
+ ...attrs,
253
+ })
268
254
  );
269
255
 
270
256
  // YouTube
@@ -275,20 +261,15 @@ export default {
275
261
  ) {
276
262
  this.setItem(
277
263
  item,
278
- createEl(
279
- 'iframe',
280
- assign(
281
- {
282
- src: `https://www.youtube${matches[1] || ''}.com/embed/${
283
- matches[2]
284
- }${matches[3] ? `?${matches[3]}` : ''}`,
285
- width: 1920,
286
- height: 1080,
287
- },
288
- iframeAttrs,
289
- attrs
290
- )
291
- )
264
+ createEl('iframe', {
265
+ src: `https://www.youtube${matches[1] || ''}.com/embed/${matches[2]}${
266
+ matches[3] ? `?${matches[3]}` : ''
267
+ }`,
268
+ width: 1920,
269
+ height: 1080,
270
+ ...iframeAttrs,
271
+ ...attrs,
272
+ })
292
273
  );
293
274
 
294
275
  // Vimeo
@@ -307,20 +288,15 @@ export default {
307
288
 
308
289
  this.setItem(
309
290
  item,
310
- createEl(
311
- 'iframe',
312
- assign(
313
- {
314
- src: `https://player.vimeo.com/video/${matches[1]}${
315
- matches[2] ? `?${matches[2]}` : ''
316
- }`,
317
- width,
318
- height,
319
- },
320
- iframeAttrs,
321
- attrs
322
- )
323
- )
291
+ createEl('iframe', {
292
+ src: `https://player.vimeo.com/video/${matches[1]}${
293
+ matches[2] ? `?${matches[2]}` : ''
294
+ }`,
295
+ width,
296
+ height,
297
+ ...iframeAttrs,
298
+ ...attrs,
299
+ })
324
300
  );
325
301
  } catch (e) {
326
302
  this.setError(item);
@@ -48,8 +48,7 @@ export default {
48
48
  index = findIndex(items, ({ source: src }) => source === src);
49
49
  }
50
50
 
51
- this.panel =
52
- this.panel || this.$create('lightboxPanel', assign({}, this.$props, { items }));
51
+ this.panel = this.panel || this.$create('lightboxPanel', { ...this.$props, items });
53
52
 
54
53
  on(this.panel.$el, 'hidden', () => (this.panel = false));
55
54
 
@@ -205,7 +205,7 @@ export default {
205
205
 
206
206
  this.touched = new Set([this]);
207
207
  this.placeholder = placeholder;
208
- this.origin = assign({ target, index: index(placeholder) }, this.pos);
208
+ this.origin = { target, index: index(placeholder), ...this.pos };
209
209
 
210
210
  on(document, pointerMove, this.move);
211
211
  on(document, pointerUp, this.end);
@@ -1,6 +1,5 @@
1
1
  import Class from '../mixin/class';
2
2
  import Togglable from '../mixin/togglable';
3
- import { assign } from 'uikit-util';
4
3
 
5
4
  export default {
6
5
  mixins: [Class, Togglable],
@@ -15,7 +14,7 @@ export default {
15
14
  animation: [true],
16
15
  selClose: '.uk-alert-close',
17
16
  duration: 150,
18
- hideProps: assign({ opacity: 0 }, Togglable.data.hideProps),
17
+ hideProps: { opacity: 0, ...Togglable.data.hideProps },
19
18
  },
20
19
 
21
20
  events: [
@@ -2,7 +2,6 @@ import Modal from '../mixin/modal';
2
2
  import {
3
3
  $,
4
4
  addClass,
5
- assign,
6
5
  css,
7
6
  Deferred,
8
7
  hasClass,
@@ -136,7 +135,7 @@ function install({ modal }) {
136
135
  };
137
136
 
138
137
  function openDialog(tmpl, options, hideFn, submitFn) {
139
- options = assign({ bgClose: false, escClose: true, labels: modal.labels }, options);
138
+ options = { bgClose: false, escClose: true, labels: modal.labels, ...options };
140
139
 
141
140
  const dialog = modal.dialog(tmpl(options), options);
142
141
  const deferred = new Deferred();
@@ -6,7 +6,6 @@ import {
6
6
  $$,
7
7
  addClass,
8
8
  after,
9
- assign,
10
9
  css,
11
10
  findIndex,
12
11
  hasAttr,
@@ -126,11 +125,12 @@ export default {
126
125
  this.$create(
127
126
  'drop',
128
127
  dropdowns.filter((el) => !this.getDropdown(el)),
129
- assign({}, this.$props, {
128
+ {
129
+ ...this.$props,
130
130
  boundary: this.boundary,
131
131
  pos: this.pos,
132
132
  offset: this.dropbar || this.offset,
133
- })
133
+ }
134
134
  );
135
135
  },
136
136
 
@@ -1,5 +1,4 @@
1
1
  import {
2
- assign,
3
2
  children,
4
3
  css,
5
4
  fastdom,
@@ -44,7 +43,7 @@ export default function (action, target, duration) {
44
43
 
45
44
  // Reset to previous state
46
45
  nodes.forEach((el, i) => propsFrom[i] && css(el, propsFrom[i]));
47
- css(target, assign({ display: 'block' }, targetProps));
46
+ css(target, { display: 'block', ...targetProps });
48
47
 
49
48
  // Start transitions on next frame
50
49
  requestAnimationFrame(() => {
@@ -76,16 +75,14 @@ function getProps(el, opacity) {
76
75
  const zIndex = css(el, 'zIndex');
77
76
 
78
77
  return isVisible(el)
79
- ? assign(
80
- {
81
- display: '',
82
- opacity: opacity ? css(el, 'opacity') : '0',
83
- pointerEvents: 'none',
84
- position: 'absolute',
85
- zIndex: zIndex === 'auto' ? index(el) : zIndex,
86
- },
87
- getPositionWithMargin(el)
88
- )
78
+ ? {
79
+ display: '',
80
+ opacity: opacity ? css(el, 'opacity') : '0',
81
+ pointerEvents: 'none',
82
+ position: 'absolute',
83
+ zIndex: zIndex === 'auto' ? index(el) : zIndex,
84
+ ...getPositionWithMargin(el),
85
+ }
89
86
  : false;
90
87
  }
91
88
 
@@ -4,7 +4,6 @@ import SliderNav from './slider-nav';
4
4
  import {
5
5
  $,
6
6
  $$,
7
- assign,
8
7
  clamp,
9
8
  fastdom,
10
9
  getIndex,
@@ -170,21 +169,14 @@ export default {
170
169
  },
171
170
 
172
171
  _show(prev, next, force) {
173
- this._transitioner = this._getTransitioner(
174
- prev,
175
- next,
176
- this.dir,
177
- assign(
178
- {
179
- easing: force
180
- ? next.offsetWidth < 600
181
- ? 'cubic-bezier(0.25, 0.46, 0.45, 0.94)' /* easeOutQuad */
182
- : 'cubic-bezier(0.165, 0.84, 0.44, 1)' /* easeOutQuart */
183
- : this.easing,
184
- },
185
- this.transitionOptions
186
- )
187
- );
172
+ this._transitioner = this._getTransitioner(prev, next, this.dir, {
173
+ easing: force
174
+ ? next.offsetWidth < 600
175
+ ? 'cubic-bezier(0.25, 0.46, 0.45, 0.94)' /* easeOutQuad */
176
+ : 'cubic-bezier(0.165, 0.84, 0.44, 1)' /* easeOutQuart */
177
+ : this.easing,
178
+ ...this.transitionOptions,
179
+ });
188
180
 
189
181
  if (!force && !prev) {
190
182
  this._translate(1);
@@ -1,7 +1,7 @@
1
1
  import Animations from './internal/slideshow-animations';
2
2
  import Transitioner from './internal/slideshow-transitioner';
3
3
  import Slider from './slider.js';
4
- import { addClass, assign, removeClass } from 'uikit-util';
4
+ import { addClass, removeClass } from 'uikit-util';
5
5
 
6
6
  export default {
7
7
  mixins: [Slider],
@@ -19,7 +19,7 @@ export default {
19
19
 
20
20
  computed: {
21
21
  animation({ animation, Animations }) {
22
- return assign(Animations[animation] || Animations.slide, { name: animation });
22
+ return { ...(Animations[animation] || Animations.slide), name: animation };
23
23
  },
24
24
 
25
25
  transitionOptions() {
@@ -2,7 +2,6 @@ import {
2
2
  $$,
3
3
  addClass,
4
4
  Animation,
5
- assign,
6
5
  css,
7
6
  fastdom,
8
7
  hasClass,
@@ -175,7 +174,7 @@ export function toggleHeight({ isToggled, duration, initProps, hideProps, transi
175
174
  show
176
175
  ? Transition.start(
177
176
  el,
178
- assign({}, initProps, { overflow: 'hidden', height: endHeight }),
177
+ { ...initProps, overflow: 'hidden', height: endHeight },
179
178
  Math.round(duration * (1 - currentHeight / endHeight)),
180
179
  transition
181
180
  )
@@ -2,18 +2,15 @@ import { on } from './event';
2
2
  import { assign, noop } from './lang';
3
3
 
4
4
  export function ajax(url, options) {
5
- const env = assign(
6
- {
7
- data: null,
8
- method: 'GET',
9
- headers: {},
10
- xhr: new XMLHttpRequest(),
11
- beforeSend: noop,
12
- responseType: '',
13
- },
14
- options
15
- );
16
-
5
+ const env = {
6
+ data: null,
7
+ method: 'GET',
8
+ headers: {},
9
+ xhr: new XMLHttpRequest(),
10
+ beforeSend: noop,
11
+ responseType: '',
12
+ ...options,
13
+ };
17
14
  return Promise.resolve()
18
15
  .then(() => env.beforeSend(env))
19
16
  .then(() => send(url, env));
@@ -1,7 +1,7 @@
1
1
  import { attr } from './attr';
2
2
  import { once, trigger } from './event';
3
3
  import { css, propName } from './style';
4
- import { assign, startsWith, toNodes } from './lang';
4
+ import { startsWith, toNodes } from './lang';
5
5
  import { addClass, hasClass, removeClass, removeClasses } from './class';
6
6
 
7
7
  export function transition(element, props, duration = 400, timing = 'linear') {
@@ -35,17 +35,12 @@ export function transition(element, props, duration = 400, timing = 'linear') {
35
35
  );
36
36
 
37
37
  addClass(element, 'uk-transition');
38
- css(
39
- element,
40
- assign(
41
- {
42
- transitionProperty: Object.keys(props).map(propName).join(','),
43
- transitionDuration: `${duration}ms`,
44
- transitionTimingFunction: timing,
45
- },
46
- props
47
- )
48
- );
38
+ css(element, {
39
+ transitionProperty: Object.keys(props).map(propName).join(','),
40
+ transitionDuration: `${duration}ms`,
41
+ transitionTimingFunction: timing,
42
+ ...props,
43
+ });
49
44
  })
50
45
  )
51
46
  );
@@ -216,7 +216,7 @@ export const Dimensions = {
216
216
  },
217
217
 
218
218
  contain(dimensions, maxDimensions) {
219
- dimensions = assign({}, dimensions);
219
+ dimensions = { ...dimensions };
220
220
 
221
221
  each(
222
222
  dimensions,
@@ -1,13 +1,4 @@
1
- import {
2
- assign,
3
- hasOwn,
4
- includes,
5
- isArray,
6
- isFunction,
7
- isUndefined,
8
- sortBy,
9
- startsWith,
10
- } from './lang';
1
+ import { hasOwn, includes, isArray, isFunction, isUndefined, sortBy, startsWith } from './lang';
11
2
 
12
3
  const strats = {};
13
4
 
@@ -48,7 +39,7 @@ strats.props = function (parentVal, childVal) {
48
39
 
49
40
  // extend strategy
50
41
  strats.computed = strats.methods = function (parentVal, childVal) {
51
- return childVal ? (parentVal ? assign({}, parentVal, childVal) : childVal) : parentVal;
42
+ return childVal ? (parentVal ? { ...parentVal, ...childVal } : childVal) : parentVal;
52
43
  };
53
44
 
54
45
  // data strategy
@@ -1,5 +1,5 @@
1
1
  import { once } from './event';
2
- import { assign, includes, noop } from './lang';
2
+ import { includes, noop } from './lang';
3
3
 
4
4
  export function play(el) {
5
5
  if (isIFrame(el)) {
@@ -64,7 +64,7 @@ async function call(el, cmd) {
64
64
 
65
65
  function post(el, cmd) {
66
66
  try {
67
- el.contentWindow.postMessage(JSON.stringify(assign({ event: 'command' }, cmd)), '*');
67
+ el.contentWindow.postMessage(JSON.stringify({ event: 'command', ...cmd }), '*');
68
68
  } catch (e) {
69
69
  // noop
70
70
  }