uikit 3.17.8 → 3.17.9-dev.4104d2f00

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 (44) 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 +1 -1
  12. package/dist/js/components/filter.min.js +1 -1
  13. package/dist/js/components/lightbox-panel.js +10 -2
  14. package/dist/js/components/lightbox-panel.min.js +1 -1
  15. package/dist/js/components/lightbox.js +10 -2
  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 +2 -2
  20. package/dist/js/components/parallax.min.js +1 -1
  21. package/dist/js/components/slider-parallax.js +2 -2
  22. package/dist/js/components/slider-parallax.min.js +1 -1
  23. package/dist/js/components/slider.js +10 -2
  24. package/dist/js/components/slider.min.js +1 -1
  25. package/dist/js/components/slideshow-parallax.js +2 -2
  26. package/dist/js/components/slideshow-parallax.min.js +1 -1
  27. package/dist/js/components/slideshow.js +10 -2
  28. package/dist/js/components/slideshow.min.js +1 -1
  29. package/dist/js/components/sortable.js +1 -1
  30. package/dist/js/components/sortable.min.js +1 -1
  31. package/dist/js/components/tooltip.js +10 -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 +13 -7
  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 +13 -7
  40. package/dist/js/uikit.min.js +1 -1
  41. package/package.json +1 -1
  42. package/src/js/api/instance.js +5 -2
  43. package/src/js/api/props.js +20 -4
  44. package/src/js/util/lang.js +1 -1
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.17.8",
5
+ "version": "3.17.9-dev.4104d2f00",
6
6
  "main": "dist/js/uikit.js",
7
7
  "style": "dist/css/uikit.css",
8
8
  "sideEffects": [
@@ -1,4 +1,4 @@
1
- import { $, remove, within } from 'uikit-util';
1
+ import { remove, within } from 'uikit-util';
2
2
  import { attachToElement, createComponent, detachFromElement, getComponent } from './component';
3
3
  import { update } from './global';
4
4
  import { callConnected, callDisconnected, callHook } from './hooks';
@@ -60,6 +60,7 @@ export default function (App) {
60
60
  });
61
61
  }
62
62
 
63
+ const ids = Object.create(null);
63
64
  export function generateId(instance, el = instance.$el, postfix = '') {
64
65
  if (el.id) {
65
66
  return el.id;
@@ -67,9 +68,11 @@ export function generateId(instance, el = instance.$el, postfix = '') {
67
68
 
68
69
  let id = `${instance.$options.id}-${instance._uid}${postfix}`;
69
70
 
70
- if ($(`#${id}`)) {
71
+ if (ids[id]) {
71
72
  id = generateId(instance, el, `${postfix}-2`);
72
73
  }
73
74
 
75
+ ids[id] = true;
76
+
74
77
  return id;
75
78
  }
@@ -1,4 +1,12 @@
1
- import { camelize, data as getData, hasOwn, hyphenate, isUndefined, startsWith } from 'uikit-util';
1
+ import {
2
+ camelize,
3
+ data as getData,
4
+ hasOwn,
5
+ hyphenate,
6
+ isUndefined,
7
+ memoize,
8
+ startsWith,
9
+ } from 'uikit-util';
2
10
  import { registerObserver } from './observer';
3
11
  import { coerce, parseOptions } from './options';
4
12
 
@@ -60,6 +68,15 @@ function notIn(options, key) {
60
68
  return options.every((arr) => !arr || !hasOwn(arr, key));
61
69
  }
62
70
 
71
+ const getAttributes = memoize((id, props) => {
72
+ const attributes = Object.keys(props);
73
+ const filter = attributes
74
+ .concat(id)
75
+ .map((key) => [hyphenate(key), `data-${hyphenate(key)}`])
76
+ .flat();
77
+ return { attributes, filter };
78
+ });
79
+
63
80
  export function initPropsObserver(instance) {
64
81
  const { $options, $props } = instance;
65
82
  const { id, props, el } = $options;
@@ -68,8 +85,7 @@ export function initPropsObserver(instance) {
68
85
  return;
69
86
  }
70
87
 
71
- const attributes = Object.keys(props);
72
- const filter = attributes.map((key) => hyphenate(key)).concat(id);
88
+ const { attributes, filter } = getAttributes(id, props);
73
89
 
74
90
  const observer = new MutationObserver((records) => {
75
91
  const data = getProps($options);
@@ -87,7 +103,7 @@ export function initPropsObserver(instance) {
87
103
 
88
104
  observer.observe(el, {
89
105
  attributes: true,
90
- attributeFilter: filter.concat(filter.map((key) => `data-${key}`)),
106
+ attributeFilter: filter,
91
107
  });
92
108
 
93
109
  registerObserver(instance, observer);
@@ -276,5 +276,5 @@ export function getIndex(i, elements, current = 0, finite = false) {
276
276
 
277
277
  export function memoize(fn) {
278
278
  const cache = Object.create(null);
279
- return (key) => cache[key] || (cache[key] = fn(key));
279
+ return (key, ...args) => cache[key] || (cache[key] = fn(key, ...args));
280
280
  }