uikit 3.25.22-dev.d02a9a6 → 3.25.23-dev.0ea1d51

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 (59) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/build/build.js +1 -2
  3. package/dist/css/uikit-core-rtl.css +1 -1
  4. package/dist/css/uikit-core-rtl.min.css +1 -1
  5. package/dist/css/uikit-core.css +1 -1
  6. package/dist/css/uikit-core.min.css +1 -1
  7. package/dist/css/uikit-rtl.css +1 -1
  8. package/dist/css/uikit-rtl.min.css +1 -1
  9. package/dist/css/uikit.css +1 -1
  10. package/dist/css/uikit.min.css +1 -1
  11. package/dist/js/components/countdown.js +2 -2
  12. package/dist/js/components/countdown.min.js +1 -1
  13. package/dist/js/components/filter.js +1 -1
  14. package/dist/js/components/filter.min.js +1 -1
  15. package/dist/js/components/lightbox-panel.js +4 -7
  16. package/dist/js/components/lightbox-panel.min.js +1 -1
  17. package/dist/js/components/lightbox.js +4 -7
  18. package/dist/js/components/lightbox.min.js +1 -1
  19. package/dist/js/components/notification.js +1 -1
  20. package/dist/js/components/notification.min.js +1 -1
  21. package/dist/js/components/parallax.js +1 -1
  22. package/dist/js/components/parallax.min.js +1 -1
  23. package/dist/js/components/slider-parallax.js +1 -1
  24. package/dist/js/components/slider-parallax.min.js +1 -1
  25. package/dist/js/components/slider.js +6 -6
  26. package/dist/js/components/slider.min.js +1 -1
  27. package/dist/js/components/slideshow-parallax.js +1 -1
  28. package/dist/js/components/slideshow-parallax.min.js +1 -1
  29. package/dist/js/components/slideshow.js +5 -10
  30. package/dist/js/components/slideshow.min.js +1 -1
  31. package/dist/js/components/sortable.js +1 -1
  32. package/dist/js/components/sortable.min.js +1 -1
  33. package/dist/js/components/tooltip.js +2 -2
  34. package/dist/js/components/tooltip.min.js +1 -1
  35. package/dist/js/components/upload.js +1 -1
  36. package/dist/js/components/upload.min.js +1 -1
  37. package/dist/js/uikit-core.js +23 -28
  38. package/dist/js/uikit-core.min.js +1 -1
  39. package/dist/js/uikit-icons.js +1 -1
  40. package/dist/js/uikit-icons.min.js +1 -1
  41. package/dist/js/uikit.js +26 -36
  42. package/dist/js/uikit.min.js +1 -1
  43. package/package.json +1 -1
  44. package/src/js/api/app.js +2 -4
  45. package/src/js/api/observables.js +2 -4
  46. package/src/js/api/props.js +1 -2
  47. package/src/js/components/countdown.js +1 -1
  48. package/src/js/components/slider.js +1 -1
  49. package/src/js/components/slideshow.js +0 -5
  50. package/src/js/core/form-custom.js +1 -1
  51. package/src/js/core/height-match.js +1 -2
  52. package/src/js/core/img.js +2 -7
  53. package/src/js/core/switcher.js +1 -1
  54. package/src/js/mixin/slider-nav.js +1 -1
  55. package/src/js/mixin/svg.js +1 -1
  56. package/src/js/util/class.js +1 -1
  57. package/src/js/util/event.js +1 -5
  58. package/src/js/util/lang.js +6 -2
  59. package/src/js/util/player.js +2 -4
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.25.22-dev.d02a9a6",
5
+ "version": "3.25.23-dev.0ea1d51",
6
6
  "main": "dist/js/uikit.js",
7
7
  "style": "dist/css/uikit.css",
8
8
  "sideEffects": [
package/src/js/api/app.js CHANGED
@@ -2,12 +2,10 @@ import * as util from 'uikit-util';
2
2
  import VERSION from 'virtual:version';
3
3
  import { init } from './state';
4
4
 
5
- const App = function (options) {
5
+ export default function App(options) {
6
6
  init(this, options);
7
- };
7
+ }
8
8
 
9
9
  App.util = util;
10
10
  App.options = {};
11
11
  App.version = VERSION;
12
-
13
- export default App;
@@ -43,10 +43,8 @@ export function lazyload(options = {}) {
43
43
  .forEach((el) => removeAttr(el, 'loading'));
44
44
  }
45
45
 
46
- for (const el of entries
47
- .filter(({ isIntersecting }) => isIntersecting)
48
- .map(({ target }) => target)) {
49
- observer.unobserve(el);
46
+ for (const { isIntersecting, target } of entries) {
47
+ isIntersecting && observer.unobserve(target);
50
48
  }
51
49
  },
52
50
  ...options,
@@ -69,8 +69,7 @@ const getAttributes = memoize((id, props) => {
69
69
  const attributes = Object.keys(props);
70
70
  const filter = attributes
71
71
  .concat(id)
72
- .map((key) => [hyphenate(key), `data-${hyphenate(key)}`])
73
- .flat();
72
+ .flatMap((key) => [hyphenate(key), `data-${hyphenate(key)}`]);
74
73
  return { attributes, filter };
75
74
  });
76
75
 
@@ -90,7 +90,7 @@ export default {
90
90
  digits = digits.split('');
91
91
 
92
92
  if (digits.length !== el.children.length) {
93
- html(el, digits.map(() => '<span></span>').join(''));
93
+ html(el, '<span></span>'.repeat(digits.length));
94
94
  }
95
95
 
96
96
  digits.forEach((digit, i) => (el.children[i].textContent = digit));
@@ -302,7 +302,7 @@ export default {
302
302
  slides.add(slide);
303
303
  } while (this.length > j && currentLeft > left && currentLeft < right);
304
304
  }
305
- return Array.from(slides);
305
+ return [...slides];
306
306
  },
307
307
 
308
308
  getIndexAt(percent) {
@@ -36,9 +36,4 @@ export default {
36
36
  },
37
37
  },
38
38
 
39
- methods: {
40
- getAdjacentSlides() {
41
- return [1, -1].map((i) => this.slides[this.getIndex(this.index + i)]);
42
- },
43
- },
44
39
  };
@@ -43,7 +43,7 @@ export default {
43
43
  const value = input.files?.[0]
44
44
  ? input.files[0].name
45
45
  : matches(input, 'select') &&
46
- (option = $$('option', input).filter((el) => el.selected)[0])
46
+ (option = $$('option', input).find((el) => el.selected))
47
47
  ? option.textContent
48
48
  : input.value;
49
49
 
@@ -20,8 +20,7 @@ export default {
20
20
  },
21
21
 
22
22
  observe: resize({
23
- target: ({ $el, elements }) =>
24
- elements.reduce((elements, el) => elements.concat(el, ...el.children), [$el]),
23
+ target: ({ $el, elements }) => [$el, ...elements.flatMap((el) => [el, ...el.children])],
25
24
  }),
26
25
 
27
26
  events: {
@@ -88,8 +88,7 @@ function setSrcAttrs(el, src) {
88
88
  const elements = isTag(parentNode, 'picture') ? children(parentNode) : [el];
89
89
  elements.forEach((el) => setSourceProps(el, el));
90
90
  } else if (src) {
91
- const change = !includes(el.style.backgroundImage, src);
92
- if (change) {
91
+ if (!includes(el.style.backgroundImage, src)) {
93
92
  css(el, 'backgroundImage', `url(${escape(src)})`);
94
93
  trigger(el, createEvent('load', false));
95
94
  }
@@ -145,11 +144,7 @@ function parseSources(sources) {
145
144
  sources = parseOptions(sources);
146
145
  }
147
146
 
148
- if (!isArray(sources)) {
149
- sources = [sources];
150
- }
151
-
152
- return sources.filter((source) => !isEmpty(source));
147
+ return (isArray(sources) ? sources : [sources]).filter((source) => !isEmpty(source));
153
148
  }
154
149
 
155
150
  function isImg(el) {
@@ -56,7 +56,7 @@ export default {
56
56
  },
57
57
 
58
58
  connectChildren() {
59
- return this.connects.map((el) => children(el)).flat();
59
+ return this.connects.flatMap((el) => children(el));
60
60
  },
61
61
 
62
62
  toggles: ({ toggle }, $el) => $$(toggle, $el),
@@ -35,7 +35,7 @@ export default {
35
35
  nav: ({ selNav }, $el) => $$(selNav, $el),
36
36
 
37
37
  navChildren() {
38
- return this.nav.map((nav) => children(nav)).flat();
38
+ return this.nav.flatMap((nav) => children(nav));
39
39
  },
40
40
 
41
41
  selNavItem: ({ attrItem }) => `[${attrItem}],[data-${attrItem}]`,
@@ -104,7 +104,7 @@ export function parseSVG(svg, icon) {
104
104
  svg = parseSymbols(svg)[icon] || svg;
105
105
  }
106
106
 
107
- return toNodes(fragment(svg)).filter(isElement)[0];
107
+ return toNodes(fragment(svg)).find(isElement);
108
108
  }
109
109
 
110
110
  const symbolRe = /<symbol([^]*?id=(['"])(.+?)\2[^]*?<\/)symbol>/g;
@@ -47,7 +47,7 @@ export function toggleClass(element, cls, force) {
47
47
  function toClasses(str) {
48
48
  return str
49
49
  ? isArray(str)
50
- ? str.map(toClasses).flat()
50
+ ? str.flatMap(toClasses)
51
51
  : String(str).split(' ').filter(Boolean)
52
52
  : [];
53
53
  }
@@ -60,11 +60,7 @@ export function trigger(targets, event, detail) {
60
60
  }
61
61
 
62
62
  export function createEvent(e, bubbles = true, cancelable = false, detail) {
63
- if (isString(e)) {
64
- e = new CustomEvent(e, { bubbles, cancelable, detail });
65
- }
66
-
67
- return e;
63
+ return isString(e) ? new CustomEvent(e, { bubbles, cancelable, detail }) : e;
68
64
  }
69
65
 
70
66
  function getArgs(args) {
@@ -173,11 +173,15 @@ export function sumBy(array, iteratee) {
173
173
 
174
174
  export function uniqueBy(array, prop) {
175
175
  const seen = new Set();
176
- return array.filter(({ [prop]: check }) => (seen.has(check) ? false : seen.add(check)));
176
+ return array.filter(({ [prop]: check }) => !seen.has(check) && seen.add(check));
177
177
  }
178
178
 
179
179
  export function pick(obj, props) {
180
- return props.reduce((res, prop) => ({ ...res, [prop]: obj[prop] }), {});
180
+ const result = {};
181
+ for (const prop of props) {
182
+ result[prop] = obj[prop];
183
+ }
184
+ return result;
181
185
  }
182
186
 
183
187
  export function clamp(number, min = 0, max = 1) {
@@ -42,13 +42,11 @@ function isIFrame(el) {
42
42
  }
43
43
 
44
44
  function isYoutube(el) {
45
- return !!el.src.match(
46
- /\/\/.*?youtube(-nocookie)?\.[a-z]+\/(watch\?v=[^&\s]+|embed)|youtu\.be\/.*/,
47
- );
45
+ return /\/\/.*?youtube(-nocookie)?\.[a-z]+\/(watch\?v=[^&\s]+|embed)|youtu\.be\//.test(el.src);
48
46
  }
49
47
 
50
48
  function isVimeo(el) {
51
- return !!el.src.match(/vimeo\.com\/video\/.*/);
49
+ return /vimeo\.com\/video\/.*/.test(el.src);
52
50
  }
53
51
 
54
52
  async function call(el, cmd) {