uikit 3.11.2-dev.31cd2ba38 → 3.11.2-dev.3dfa2c50b

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 (168) 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 +7 -11
  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 +42 -17
  19. package/dist/css/uikit-core-rtl.min.css +1 -1
  20. package/dist/css/uikit-core.css +42 -17
  21. package/dist/css/uikit-core.min.css +1 -1
  22. package/dist/css/uikit-rtl.css +42 -17
  23. package/dist/css/uikit-rtl.min.css +1 -1
  24. package/dist/css/uikit.css +42 -17
  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 +409 -438
  29. package/dist/js/components/filter.min.js +1 -1
  30. package/dist/js/components/lightbox-panel.js +1116 -1305
  31. package/dist/js/components/lightbox-panel.min.js +1 -1
  32. package/dist/js/components/lightbox.js +1164 -1383
  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 +294 -345
  37. package/dist/js/components/parallax.min.js +1 -1
  38. package/dist/js/components/slider-parallax.js +292 -344
  39. package/dist/js/components/slider-parallax.min.js +1 -1
  40. package/dist/js/components/slider.js +727 -850
  41. package/dist/js/components/slider.min.js +1 -1
  42. package/dist/js/components/slideshow-parallax.js +292 -344
  43. package/dist/js/components/slideshow-parallax.min.js +1 -1
  44. package/dist/js/components/slideshow.js +615 -799
  45. package/dist/js/components/slideshow.min.js +1 -1
  46. package/dist/js/components/sortable.js +588 -619
  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 +5266 -6572
  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 +8126 -9876
  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 +23 -27
  62. package/src/js/api/global.js +6 -12
  63. package/src/js/api/hooks.js +13 -32
  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 +71 -66
  68. package/src/js/components/index.js +13 -13
  69. package/src/js/components/internal/lightbox-animations.js +11 -23
  70. package/src/js/components/internal/slider-transitioner.js +66 -45
  71. package/src/js/components/internal/slideshow-animations.js +42 -61
  72. package/src/js/components/lightbox-panel.js +135 -109
  73. package/src/js/components/lightbox.js +18 -39
  74. package/src/js/components/notification.js +49 -43
  75. package/src/js/components/parallax.js +16 -30
  76. package/src/js/components/slider-parallax.js +13 -23
  77. package/src/js/components/slider.js +75 -64
  78. package/src/js/components/slideshow-parallax.js +1 -1
  79. package/src/js/components/slideshow.js +8 -13
  80. package/src/js/components/sortable.js +125 -106
  81. package/src/js/components/tooltip.js +41 -31
  82. package/src/js/components/upload.js +52 -63
  83. package/src/js/core/accordion.js +53 -48
  84. package/src/js/core/alert.js +10 -17
  85. package/src/js/core/core.js +74 -53
  86. package/src/js/core/cover.js +11 -15
  87. package/src/js/core/drop.js +106 -92
  88. package/src/js/core/form-custom.js +20 -25
  89. package/src/js/core/gif.js +3 -7
  90. package/src/js/core/grid.js +57 -58
  91. package/src/js/core/height-match.js +16 -29
  92. package/src/js/core/height-viewport.js +28 -35
  93. package/src/js/core/icon.js +38 -50
  94. package/src/js/core/img.js +130 -105
  95. package/src/js/core/index.js +39 -39
  96. package/src/js/core/leader.js +9 -18
  97. package/src/js/core/margin.js +21 -37
  98. package/src/js/core/modal.js +50 -36
  99. package/src/js/core/nav.js +2 -4
  100. package/src/js/core/navbar.js +112 -88
  101. package/src/js/core/offcanvas.js +49 -53
  102. package/src/js/core/overflow-auto.js +13 -17
  103. package/src/js/core/responsive.js +14 -12
  104. package/src/js/core/scroll.js +10 -20
  105. package/src/js/core/scrollspy-nav.js +34 -31
  106. package/src/js/core/scrollspy.js +37 -54
  107. package/src/js/core/sticky.js +130 -91
  108. package/src/js/core/svg.js +60 -79
  109. package/src/js/core/switcher.js +47 -46
  110. package/src/js/core/tab.js +7 -10
  111. package/src/js/core/toggle.js +64 -66
  112. package/src/js/core/video.js +11 -22
  113. package/src/js/mixin/animate.js +19 -20
  114. package/src/js/mixin/class.js +2 -4
  115. package/src/js/mixin/container.js +7 -11
  116. package/src/js/mixin/internal/animate-fade.js +73 -30
  117. package/src/js/mixin/internal/animate-slide.js +61 -41
  118. package/src/js/mixin/internal/slideshow-animations.js +7 -14
  119. package/src/js/mixin/internal/slideshow-transitioner.js +10 -17
  120. package/src/js/mixin/media.js +5 -10
  121. package/src/js/mixin/modal.js +89 -66
  122. package/src/js/mixin/parallax.js +53 -48
  123. package/src/js/mixin/position.js +26 -20
  124. package/src/js/mixin/slider-autoplay.js +12 -21
  125. package/src/js/mixin/slider-drag.js +64 -65
  126. package/src/js/mixin/slider-nav.js +26 -35
  127. package/src/js/mixin/slider-reactive.js +2 -8
  128. package/src/js/mixin/slider.js +51 -50
  129. package/src/js/mixin/slideshow.js +13 -19
  130. package/src/js/mixin/togglable.js +90 -63
  131. package/src/js/uikit-core.js +2 -4
  132. package/src/js/uikit.js +2 -4
  133. package/src/js/util/ajax.js +27 -43
  134. package/src/js/util/animation.js +82 -75
  135. package/src/js/util/attr.js +17 -21
  136. package/src/js/util/class.js +14 -52
  137. package/src/js/util/dimensions.js +56 -43
  138. package/src/js/util/dom.js +40 -73
  139. package/src/js/util/env.js +7 -12
  140. package/src/js/util/event.js +60 -59
  141. package/src/js/util/fastdom.js +1 -6
  142. package/src/js/util/filter.js +17 -34
  143. package/src/js/util/index.js +0 -1
  144. package/src/js/util/lang.js +79 -119
  145. package/src/js/util/mouse.js +19 -17
  146. package/src/js/util/options.js +42 -47
  147. package/src/js/util/player.js +40 -36
  148. package/src/js/util/position.js +54 -46
  149. package/src/js/util/promise.js +0 -191
  150. package/src/js/util/selector.js +39 -48
  151. package/src/js/util/style.js +36 -46
  152. package/src/js/util/viewport.js +75 -64
  153. package/src/less/components/flex.less +0 -9
  154. package/src/less/components/navbar.less +0 -7
  155. package/src/less/components/utility.less +22 -0
  156. package/src/scss/components/flex.scss +0 -9
  157. package/src/scss/components/form.scss +3 -3
  158. package/src/scss/components/icon.scss +2 -2
  159. package/src/scss/components/navbar.scss +0 -7
  160. package/src/scss/components/search.scss +1 -1
  161. package/src/scss/components/utility.scss +22 -0
  162. package/src/scss/variables-theme.scss +6 -6
  163. package/src/scss/variables.scss +6 -6
  164. package/tests/image.html +38 -22
  165. package/tests/js/index.js +114 -85
  166. package/src/js/mixin/flex-bug.js +0 -56
  167. package/tests/images/test.avif +0 -0
  168. package/tests/images/test.webp +0 -0
package/jsconfig.json CHANGED
@@ -6,4 +6,4 @@
6
6
  }
7
7
  },
8
8
  "exclude": ["node_modules"]
9
- }
9
+ }
package/package.json CHANGED
@@ -1,62 +1,66 @@
1
1
  {
2
- "name": "uikit",
3
- "title": "UIkit",
4
- "description": "UIkit is a lightweight and modular front-end framework for developing fast and powerful web interfaces.",
5
- "version": "3.11.2-dev.31cd2ba38",
6
- "main": "dist/js/uikit.js",
7
- "style": "dist/css/uikit.css",
8
- "sideEffects": [
9
- "*.css",
10
- "./src/js/*.js",
11
- "./dist/**/*.js"
12
- ],
13
- "scripts": {
14
- "build-scss": "node build/scss",
15
- "compile": "yarn compile-less && yarn compile-js",
16
- "compile-js": "node build/build",
17
- "compile-less": "yarn icons && node build/less",
18
- "compile-rtl": "yarn compile-less rtl",
19
- "icons": "node build/icons",
20
- "prefix": "node build/prefix",
21
- "scope": "node build/scope",
22
- "release": "node build/release",
23
- "watch": "watch-run -i -p '**/*.less' yarn compile-less",
24
- "eslint": "eslint src/js",
25
- "eslint-fix": "eslint --fix src/js"
26
- },
27
- "repository": {
28
- "type": "git",
29
- "url": "git+https://github.com/uikit/uikit.git"
30
- },
31
- "license": "MIT",
32
- "bugs": {
33
- "url": "https://github.com/uikit/uikit/issues"
34
- },
35
- "homepage": "https://getuikit.com",
36
- "devDependencies": {
37
- "@rollup/plugin-alias": "^3.1.9",
38
- "@rollup/plugin-buble": "^0.21.3",
39
- "@rollup/plugin-replace": "^3.0.1",
40
- "archiver": "^5.3.0",
41
- "camelcase": "^6.3.0",
42
- "clean-css": "^5.2.4",
43
- "dateformat": "^5.0.2",
44
- "esbuild": "^0.14.19",
45
- "eslint": "^8.8.0",
46
- "fs-extra": "^10.0.0",
47
- "glob": "^7.2.0",
48
- "inquirer": "^8.2.0",
49
- "less": "^4.1.2",
50
- "minimist": "^1.2.5",
51
- "number-precision": "^1.5.1",
52
- "p-limit": "^4.0.0",
53
- "rollup": "^2.67.1",
54
- "rollup-plugin-esbuild": "^4.8.2",
55
- "rollup-plugin-html": "^0.2.1",
56
- "rollup-plugin-modify": "^3.0.0",
57
- "rtlcss": "^3.5.0",
58
- "semver": "^7.3.2",
59
- "svgo": "^2.8.0",
60
- "watch-run": "^1.2.5"
61
- }
2
+ "name": "uikit",
3
+ "title": "UIkit",
4
+ "description": "UIkit is a lightweight and modular front-end framework for developing fast and powerful web interfaces.",
5
+ "version": "3.11.2-dev.3dfa2c50b",
6
+ "main": "dist/js/uikit.js",
7
+ "style": "dist/css/uikit.css",
8
+ "sideEffects": [
9
+ "*.css",
10
+ "./src/js/*.js",
11
+ "./dist/**/*.js"
12
+ ],
13
+ "scripts": {
14
+ "build-scss": "node build/scss",
15
+ "compile": "yarn compile-less && yarn compile-js",
16
+ "compile-js": "node build/build",
17
+ "compile-less": "yarn icons && node build/less",
18
+ "compile-rtl": "yarn compile-less rtl",
19
+ "icons": "node build/icons",
20
+ "prefix": "node build/prefix",
21
+ "scope": "node build/scope",
22
+ "release": "node build/release",
23
+ "watch": "watch-run -i -p '**/*.less' yarn compile-less",
24
+ "eslint": "eslint src/js",
25
+ "eslint-fix": "eslint --fix src/js"
26
+ },
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/uikit/uikit.git"
30
+ },
31
+ "license": "MIT",
32
+ "bugs": {
33
+ "url": "https://github.com/uikit/uikit/issues"
34
+ },
35
+ "homepage": "https://getuikit.com",
36
+ "devDependencies": {
37
+ "@babel/core": "^7.16.0",
38
+ "@babel/preset-env": "^7.16.4",
39
+ "@rollup/plugin-alias": "^3.1.9",
40
+ "@rollup/plugin-babel": "^5.3.0",
41
+ "@rollup/plugin-replace": "^3.0.1",
42
+ "archiver": "^5.3.0",
43
+ "camelcase": "^6.3.0",
44
+ "clean-css": "^5.2.4",
45
+ "dateformat": "^5.0.3",
46
+ "esbuild": "^0.14.23",
47
+ "eslint": "^8.9.0",
48
+ "eslint-config-prettier": "^8.3.0",
49
+ "fs-extra": "^10.0.0",
50
+ "glob": "^7.2.0",
51
+ "inquirer": "^8.2.0",
52
+ "less": "^4.1.2",
53
+ "minimist": "^1.2.5",
54
+ "number-precision": "^1.5.2",
55
+ "p-limit": "^4.0.0",
56
+ "prettier": "^2.5.1",
57
+ "rollup": "^2.68.0",
58
+ "rollup-plugin-esbuild": "^4.8.2",
59
+ "rollup-plugin-html": "^0.2.1",
60
+ "rollup-plugin-modify": "^3.0.0",
61
+ "rtlcss": "^3.5.0",
62
+ "semver": "^7.3.2",
63
+ "svgo": "^2.8.0",
64
+ "watch-run": "^1.2.5"
65
+ }
62
66
  }
@@ -1,49 +1,48 @@
1
- import {getComponentName} from './component';
2
- import {apply, fastdom, hasAttr, inBrowser} from 'uikit-util';
1
+ import { getComponentName } from './component';
2
+ import { apply, fastdom, hasAttr, inBrowser } from 'uikit-util';
3
3
 
4
4
  export default function (UIkit) {
5
-
6
- const {connect, disconnect} = UIkit;
5
+ const { connect, disconnect } = UIkit;
7
6
 
8
7
  if (!inBrowser || !window.MutationObserver) {
9
8
  return;
10
9
  }
11
10
 
12
11
  fastdom.read(function () {
13
-
14
12
  if (document.body) {
15
13
  apply(document.body, connect);
16
14
  }
17
15
 
18
- new MutationObserver(records =>
19
- records.forEach(applyChildListMutation)
20
- ).observe(document, {
21
- childList: true,
22
- subtree: true
23
- });
24
-
25
- new MutationObserver(records =>
26
- records.forEach(applyAttributeMutation)
27
- ).observe(document, {
28
- attributes: true,
29
- subtree: true
30
- });
16
+ new MutationObserver((records) => records.forEach(applyChildListMutation)).observe(
17
+ document,
18
+ {
19
+ childList: true,
20
+ subtree: true,
21
+ }
22
+ );
23
+
24
+ new MutationObserver((records) => records.forEach(applyAttributeMutation)).observe(
25
+ document,
26
+ {
27
+ attributes: true,
28
+ subtree: true,
29
+ }
30
+ );
31
31
 
32
32
  UIkit._initialized = true;
33
33
  });
34
34
 
35
- function applyChildListMutation({addedNodes, removedNodes}) {
36
- for (let i = 0; i < addedNodes.length; i++) {
37
- apply(addedNodes[i], connect);
35
+ function applyChildListMutation({ addedNodes, removedNodes }) {
36
+ for (const node of addedNodes) {
37
+ apply(node, connect);
38
38
  }
39
39
 
40
- for (let i = 0; i < removedNodes.length; i++) {
41
- apply(removedNodes[i], disconnect);
40
+ for (const node of removedNodes) {
41
+ apply(node, disconnect);
42
42
  }
43
43
  }
44
44
 
45
- function applyAttributeMutation({target, attributeName}) {
46
-
45
+ function applyAttributeMutation({ target, attributeName }) {
47
46
  const name = getComponentName(attributeName);
48
47
 
49
48
  if (!name || !(name in UIkit)) {
@@ -55,12 +54,6 @@ export default function (UIkit) {
55
54
  return;
56
55
  }
57
56
 
58
- const component = UIkit.getComponent(target, name);
59
-
60
- if (component) {
61
- component.$destroy();
62
- }
63
-
57
+ UIkit.getComponent(target, name)?.$destroy();
64
58
  }
65
-
66
59
  }
@@ -1,37 +1,42 @@
1
- import {$$, assign, camelize, fastdom, hyphenate, isPlainObject, memoize, startsWith} from 'uikit-util';
1
+ import {
2
+ $$,
3
+ assign,
4
+ camelize,
5
+ fastdom,
6
+ hyphenate,
7
+ isPlainObject,
8
+ memoize,
9
+ startsWith,
10
+ } from 'uikit-util';
2
11
 
3
12
  export default function (UIkit) {
4
-
5
13
  const DATA = UIkit.data;
6
14
 
7
15
  const components = {};
8
16
 
9
17
  UIkit.component = function (name, options) {
10
-
11
18
  const id = hyphenate(name);
12
19
 
13
20
  name = camelize(id);
14
21
 
15
22
  if (!options) {
16
-
17
23
  if (isPlainObject(components[name])) {
18
24
  components[name] = UIkit.extend(components[name]);
19
25
  }
20
26
 
21
27
  return components[name];
22
-
23
28
  }
24
29
 
25
30
  UIkit[name] = function (element, data) {
26
-
27
31
  const component = UIkit.component(name);
28
32
 
29
33
  return component.options.functional
30
- ? new component({data: isPlainObject(element) ? element : [...arguments]})
31
- : !element ? init(element) : $$(element).map(init)[0];
34
+ ? new component({ data: isPlainObject(element) ? element : [...arguments] })
35
+ : element
36
+ ? $$(element).map(init)[0]
37
+ : init();
32
38
 
33
39
  function init(element) {
34
-
35
40
  const instance = UIkit.getComponent(element, name);
36
41
 
37
42
  if (instance) {
@@ -42,59 +47,50 @@ export default function (UIkit) {
42
47
  }
43
48
  }
44
49
 
45
- return new component({el: element, data});
46
-
50
+ return new component({ el: element, data });
47
51
  }
48
-
49
52
  };
50
53
 
51
54
  const opt = isPlainObject(options) ? assign({}, options) : options.options;
52
55
 
53
56
  opt.name = name;
54
57
 
55
- if (opt.install) {
56
- opt.install(UIkit, opt, name);
57
- }
58
+ opt.install?.(UIkit, opt, name);
58
59
 
59
60
  if (UIkit._initialized && !opt.functional) {
60
61
  fastdom.read(() => UIkit[name](`[uk-${id}],[data-uk-${id}]`));
61
62
  }
62
63
 
63
- return components[name] = isPlainObject(options) ? opt : options;
64
+ return (components[name] = isPlainObject(options) ? opt : options);
64
65
  };
65
66
 
66
- UIkit.getComponents = element => element && element[DATA] || {};
67
+ UIkit.getComponents = (element) => element?.[DATA] || {};
67
68
  UIkit.getComponent = (element, name) => UIkit.getComponents(element)[name];
68
69
 
69
- UIkit.connect = node => {
70
-
70
+ UIkit.connect = (node) => {
71
71
  if (node[DATA]) {
72
72
  for (const name in node[DATA]) {
73
73
  node[DATA][name]._callConnected();
74
74
  }
75
75
  }
76
76
 
77
- for (let i = 0; i < node.attributes.length; i++) {
78
-
79
- const name = getComponentName(node.attributes[i].name);
77
+ for (const attribute of node.attributes) {
78
+ const name = getComponentName(attribute.name);
80
79
 
81
80
  if (name && name in components) {
82
81
  UIkit[name](node);
83
82
  }
84
-
85
83
  }
86
-
87
84
  };
88
85
 
89
- UIkit.disconnect = node => {
86
+ UIkit.disconnect = (node) => {
90
87
  for (const name in node[DATA]) {
91
88
  node[DATA][name]._callDisconnected();
92
89
  }
93
90
  };
94
-
95
91
  }
96
92
 
97
- export const getComponentName = memoize(attribute => {
93
+ export const getComponentName = memoize((attribute) => {
98
94
  return startsWith(attribute, 'uk-') || startsWith(attribute, 'data-uk-')
99
95
  ? camelize(attribute.replace('data-uk-', '').replace('uk-', ''))
100
96
  : false;
@@ -1,11 +1,9 @@
1
- import {$, apply, isString, mergeOptions, parents, toNode} from 'uikit-util';
1
+ import { $, apply, isString, mergeOptions, parents, toNode } from 'uikit-util';
2
2
 
3
3
  export default function (UIkit) {
4
-
5
4
  const DATA = UIkit.data;
6
5
 
7
6
  UIkit.use = function (plugin) {
8
-
9
7
  if (plugin.installed) {
10
8
  return;
11
9
  }
@@ -22,7 +20,6 @@ export default function (UIkit) {
22
20
  };
23
21
 
24
22
  UIkit.extend = function (options) {
25
-
26
23
  options = options || {};
27
24
 
28
25
  const Super = this;
@@ -41,29 +38,27 @@ export default function (UIkit) {
41
38
  };
42
39
 
43
40
  UIkit.update = function (element, e) {
44
-
45
41
  element = element ? toNode(element) : document.body;
46
42
 
47
- parents(element).reverse().forEach(element => update(element[DATA], e));
48
- apply(element, element => update(element[DATA], e));
43
+ for (const parentEl of parents(element).reverse()) {
44
+ update(parentEl[DATA], e);
45
+ }
49
46
 
47
+ apply(element, (element) => update(element[DATA], e));
50
48
  };
51
49
 
52
50
  let container;
53
51
  Object.defineProperty(UIkit, 'container', {
54
-
55
52
  get() {
56
53
  return container || document.body;
57
54
  },
58
55
 
59
56
  set(element) {
60
57
  container = $(element);
61
- }
62
-
58
+ },
63
59
  });
64
60
 
65
61
  function update(data, e) {
66
-
67
62
  if (!data) {
68
63
  return;
69
64
  }
@@ -73,6 +68,5 @@ export default function (UIkit) {
73
68
  data[name]._callUpdate(e);
74
69
  }
75
70
  }
76
-
77
71
  }
78
72
  }
@@ -1,18 +1,11 @@
1
- import {assign, fastdom, hasOwn, isEqual, isPlainObject} from 'uikit-util';
1
+ import { assign, fastdom, hasOwn, isEqual, isPlainObject } from 'uikit-util';
2
2
 
3
3
  export default function (UIkit) {
4
-
5
4
  UIkit.prototype._callHook = function (hook) {
6
-
7
- const handlers = this.$options[hook];
8
-
9
- if (handlers) {
10
- handlers.forEach(handler => handler.call(this));
11
- }
5
+ this.$options[hook]?.forEach((handler) => handler.call(this));
12
6
  };
13
7
 
14
8
  UIkit.prototype._callConnected = function () {
15
-
16
9
  if (this._connected) {
17
10
  return;
18
11
  }
@@ -33,7 +26,6 @@ export default function (UIkit) {
33
26
  };
34
27
 
35
28
  UIkit.prototype._callDisconnected = function () {
36
-
37
29
  if (!this._connected) {
38
30
  return;
39
31
  }
@@ -45,11 +37,9 @@ export default function (UIkit) {
45
37
 
46
38
  this._connected = false;
47
39
  delete this._watch;
48
-
49
40
  };
50
41
 
51
42
  UIkit.prototype._callUpdate = function (e = 'update') {
52
-
53
43
  if (!this._connected) {
54
44
  return;
55
45
  }
@@ -76,7 +66,6 @@ export default function (UIkit) {
76
66
  };
77
67
 
78
68
  UIkit.prototype._callWatches = function () {
79
-
80
69
  if (this._watch) {
81
70
  return;
82
71
  }
@@ -88,25 +77,17 @@ export default function (UIkit) {
88
77
  runWatches.call(this, initial);
89
78
  }
90
79
  this._watch = null;
91
-
92
80
  });
93
-
94
81
  };
95
82
 
96
83
  function runUpdates(types) {
97
-
98
- const updates = this.$options.update;
99
-
100
- for (let i = 0; i < updates.length; i++) {
101
- const {read, write, events} = updates[i];
102
-
103
- if (!types.has('update') && (!events || !events.some(type => types.has(type)))) {
84
+ for (const { read, write, events } of this.$options.update) {
85
+ if (!types.has('update') && (!events || !events.some((type) => types.has(type)))) {
104
86
  continue;
105
87
  }
106
88
 
107
89
  let result;
108
90
  if (read) {
109
-
110
91
  result = read.call(this, this._data, types);
111
92
 
112
93
  if (result && isPlainObject(result)) {
@@ -117,25 +98,25 @@ export default function (UIkit) {
117
98
  if (write && result !== false) {
118
99
  fastdom.write(() => write.call(this, this._data, types));
119
100
  }
120
-
121
101
  }
122
102
  }
123
103
 
124
104
  function runWatches(initial) {
125
-
126
- const {$options: {computed}} = this;
105
+ const {
106
+ $options: { computed },
107
+ } = this;
127
108
  const values = assign({}, this._computeds);
128
109
  this._computeds = {};
129
110
 
130
111
  for (const key in computed) {
131
- const {watch, immediate} = computed[key];
132
- if (watch && (
133
- initial && immediate
134
- || hasOwn(values, key) && !isEqual(values[key], this[key])
135
- )) {
112
+ const { watch, immediate } = computed[key];
113
+ if (
114
+ watch &&
115
+ ((initial && immediate) ||
116
+ (hasOwn(values, key) && !isEqual(values[key], this[key])))
117
+ ) {
136
118
  watch.call(this, this[key], values[key]);
137
119
  }
138
120
  }
139
-
140
121
  }
141
122
  }
@@ -1,7 +1,6 @@
1
- import {hyphenate, isEmpty, memoize, remove, within} from 'uikit-util';
1
+ import { hyphenate, isEmpty, memoize, remove, within } from 'uikit-util';
2
2
 
3
3
  export default function (UIkit) {
4
-
5
4
  const DATA = UIkit.data;
6
5
 
7
6
  UIkit.prototype.$create = function (component, element, data) {
@@ -9,8 +8,7 @@ export default function (UIkit) {
9
8
  };
10
9
 
11
10
  UIkit.prototype.$mount = function (el) {
12
-
13
- const {name} = this.$options;
11
+ const { name } = this.$options;
14
12
 
15
13
  if (!el[DATA]) {
16
14
  el[DATA] = {};
@@ -35,8 +33,7 @@ export default function (UIkit) {
35
33
  };
36
34
 
37
35
  UIkit.prototype.$destroy = function (removeEl = false) {
38
-
39
- const {el, name} = this.$options;
36
+ const { el, name } = this.$options;
40
37
 
41
38
  if (el) {
42
39
  this._callDisconnected();
@@ -44,7 +41,7 @@ export default function (UIkit) {
44
41
 
45
42
  this._callHook('destroy');
46
43
 
47
- if (!el || !el[DATA]) {
44
+ if (!el?.[DATA]) {
48
45
  return;
49
46
  }
50
47
 
@@ -69,19 +66,14 @@ export default function (UIkit) {
69
66
 
70
67
  UIkit.prototype.$getComponent = UIkit.getComponent;
71
68
 
72
- const componentName = memoize(name => UIkit.prefix + hyphenate(name));
69
+ const componentName = memoize((name) => UIkit.prefix + hyphenate(name));
73
70
  Object.defineProperties(UIkit.prototype, {
74
-
75
71
  $container: Object.getOwnPropertyDescriptor(UIkit, 'container'),
76
72
 
77
73
  $name: {
78
-
79
74
  get() {
80
75
  return componentName(this.$options.name);
81
- }
82
-
83
- }
84
-
76
+ },
77
+ },
85
78
  });
86
-
87
79
  }