uikit 3.15.7-dev.3ec9925a1 → 3.15.7-dev.70998e579

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 (47) 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 +2 -2
  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 +2 -2
  14. package/dist/js/components/lightbox-panel.min.js +1 -1
  15. package/dist/js/components/lightbox.js +2 -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 +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 +2 -2
  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 +2 -2
  28. package/dist/js/components/slideshow.min.js +1 -1
  29. package/dist/js/components/sortable.js +2 -2
  30. package/dist/js/components/sortable.min.js +1 -1
  31. package/dist/js/components/tooltip.js +4 -3
  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 +24 -20
  36. package/dist/js/uikit-core.min.js +2 -2
  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 +27 -22
  40. package/dist/js/uikit.min.js +2 -2
  41. package/package.json +1 -1
  42. package/src/js/api/component.js +0 -1
  43. package/src/js/api/instance.js +11 -6
  44. package/src/js/api/state.js +11 -11
  45. package/src/js/components/tooltip.js +3 -2
  46. package/src/js/core/icon.js +1 -1
  47. package/src/js/mixin/class.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.15.7-dev.3ec9925a1",
5
+ "version": "3.15.7-dev.70998e579",
6
6
  "main": "dist/js/uikit.js",
7
7
  "style": "dist/css/uikit.css",
8
8
  "sideEffects": [
@@ -44,7 +44,6 @@ export default function (UIkit) {
44
44
 
45
45
  const opt = isPlainObject(options) ? { ...options } : options.options;
46
46
 
47
- opt.id = id;
48
47
  opt.name = name;
49
48
 
50
49
  opt.install?.(UIkit, opt, name);
@@ -1,4 +1,4 @@
1
- import { isEmpty, remove, within } from 'uikit-util';
1
+ import { hyphenate, isEmpty, memoize, remove, within } from 'uikit-util';
2
2
 
3
3
  export default function (UIkit) {
4
4
  const DATA = UIkit.data;
@@ -66,9 +66,14 @@ export default function (UIkit) {
66
66
 
67
67
  UIkit.prototype.$getComponent = UIkit.getComponent;
68
68
 
69
- Object.defineProperty(
70
- UIkit.prototype,
71
- '$container',
72
- Object.getOwnPropertyDescriptor(UIkit, 'container')
73
- );
69
+ const componentName = memoize((name) => UIkit.prefix + hyphenate(name));
70
+ Object.defineProperties(UIkit.prototype, {
71
+ $container: Object.getOwnPropertyDescriptor(UIkit, 'container'),
72
+
73
+ $name: {
74
+ get() {
75
+ return componentName(this.$options.name);
76
+ },
77
+ },
78
+ });
74
79
  }
@@ -73,7 +73,7 @@ export default function (UIkit) {
73
73
  UIkit.prototype._initProps = function (props) {
74
74
  let key;
75
75
 
76
- props = props || getProps(this.$options);
76
+ props = props || getProps(this.$options, this.$name);
77
77
 
78
78
  for (key in props) {
79
79
  if (!isUndefined(props[key])) {
@@ -124,9 +124,9 @@ export default function (UIkit) {
124
124
  };
125
125
  }
126
126
 
127
- function getProps(opts) {
127
+ function getProps(opts, name) {
128
128
  const data = {};
129
- const { args = [], props = {}, el, id } = opts;
129
+ const { args = [], props = {}, el } = opts;
130
130
 
131
131
  if (!props) {
132
132
  return data;
@@ -149,7 +149,7 @@ function getProps(opts) {
149
149
  data[key] = value;
150
150
  }
151
151
 
152
- const options = parseOptions(getData(el, id), args);
152
+ const options = parseOptions(getData(el, name), args);
153
153
 
154
154
  for (const key in options) {
155
155
  const prop = camelize(key);
@@ -277,24 +277,24 @@ function initChildListObserver(component) {
277
277
  }
278
278
 
279
279
  function initPropsObserver(component) {
280
- const { $options, $props } = component;
281
- const { id, attrs, props, el } = $options;
280
+ const { $name, $options, $props } = component;
281
+ const { attrs, props, el } = $options;
282
282
 
283
283
  if (!props || attrs === false) {
284
284
  return;
285
285
  }
286
286
 
287
287
  const attributes = isArray(attrs) ? attrs : Object.keys(props);
288
- const filter = attributes.map((key) => hyphenate(key)).concat(id);
288
+ const filter = attributes.map((key) => hyphenate(key)).concat($name);
289
289
 
290
290
  const observer = new MutationObserver((records) => {
291
- const data = getProps($options);
291
+ const data = getProps($options, $name);
292
292
  if (
293
293
  records.some(({ attributeName }) => {
294
294
  const prop = attributeName.replace('data-', '');
295
- return (prop === id ? attributes : [camelize(prop), camelize(attributeName)]).some(
296
- (prop) => !isUndefined(data[prop]) && data[prop] !== $props[prop]
297
- );
295
+ return (
296
+ prop === $name ? attributes : [camelize(prop), camelize(attributeName)]
297
+ ).some((prop) => !isUndefined(data[prop]) && data[prop] !== $props[prop]);
298
298
  })
299
299
  ) {
300
300
  component.$reset();
@@ -59,12 +59,13 @@ export default {
59
59
 
60
60
  this._unbind = once(
61
61
  document,
62
- `keydown ${pointerDown}`,
62
+ `show keydown ${pointerDown}`,
63
63
  this.hide,
64
64
  false,
65
65
  (e) =>
66
66
  (e.type === pointerDown && !within(e.target, this.$el)) ||
67
- (e.type === 'keydown' && e.keyCode === 27)
67
+ (e.type === 'keydown' && e.keyCode === 27) ||
68
+ (e.type === 'show' && e.detail[0] !== this && e.detail[0].$name === this.$name)
68
69
  );
69
70
 
70
71
  clearTimeout(this.showTimer);
@@ -99,7 +99,7 @@ export const IconComponent = {
99
99
  }),
100
100
 
101
101
  beforeConnect() {
102
- addClass(this.$el, this.$options.id);
102
+ addClass(this.$el, this.$name);
103
103
  },
104
104
  };
105
105
 
@@ -1,7 +1,7 @@
1
- import { addClass } from 'uikit-util';
1
+ import { addClass, hasClass } from 'uikit-util';
2
2
 
3
3
  export default {
4
4
  connected() {
5
- addClass(this.$el, this.$options.id);
5
+ !hasClass(this.$el, this.$name) && addClass(this.$el, this.$name);
6
6
  },
7
7
  };