uikit 3.11.2-dev.c2430c233 → 3.11.2-dev.c7ed3c19b

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 (154) 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 +5 -0
  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 +1 -1
  19. package/dist/css/uikit-core-rtl.min.css +1 -1
  20. package/dist/css/uikit-core.css +1 -1
  21. package/dist/css/uikit-core.min.css +1 -1
  22. package/dist/css/uikit-rtl.css +1 -1
  23. package/dist/css/uikit-rtl.min.css +1 -1
  24. package/dist/css/uikit.css +1 -1
  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 +5356 -6705
  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 +8116 -9909
  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 +65 -82
  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 +59 -58
  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 +44 -49
  147. package/src/js/util/player.js +40 -36
  148. package/src/js/util/position.js +54 -46
  149. package/src/js/util/selector.js +34 -49
  150. package/src/js/util/style.js +36 -46
  151. package/src/js/util/viewport.js +75 -64
  152. package/tests/js/index.js +114 -85
  153. package/src/js/mixin/flex-bug.js +0 -56
  154. package/src/js/util/promise.js +0 -191
@@ -1,7 +1,16 @@
1
- import {isIE} from './env';
2
- import {append, fragment, remove} from './dom';
3
- import {addClass} from './class';
4
- import {each, hyphenate, isArray, isNumber, isNumeric, isObject, isString, isUndefined, memoize, toNodes, toWindow} from './lang';
1
+ import {
2
+ each,
3
+ hyphenate,
4
+ isArray,
5
+ isNumber,
6
+ isNumeric,
7
+ isObject,
8
+ isString,
9
+ isUndefined,
10
+ memoize,
11
+ toNodes,
12
+ toWindow,
13
+ } from './lang';
5
14
 
6
15
  const cssNumber = {
7
16
  'animation-iteration-count': true,
@@ -11,22 +20,19 @@ const cssNumber = {
11
20
  'flex-shrink': true,
12
21
  'font-weight': true,
13
22
  'line-height': true,
14
- 'opacity': true,
15
- 'order': true,
16
- 'orphans': true,
23
+ opacity: true,
24
+ order: true,
25
+ orphans: true,
17
26
  'stroke-dasharray': true,
18
27
  'stroke-dashoffset': true,
19
- 'widows': true,
28
+ widows: true,
20
29
  'z-index': true,
21
- 'zoom': true
30
+ zoom: true,
22
31
  };
23
32
 
24
33
  export function css(element, property, value, priority = '') {
25
-
26
- return toNodes(element).map(element => {
27
-
34
+ return toNodes(element).map((element) => {
28
35
  if (isString(property)) {
29
-
30
36
  property = propName(property);
31
37
 
32
38
  if (isUndefined(value)) {
@@ -34,27 +40,26 @@ export function css(element, property, value, priority = '') {
34
40
  } else if (!value && !isNumber(value)) {
35
41
  element.style.removeProperty(property);
36
42
  } else {
37
- element.style.setProperty(property, isNumeric(value) && !cssNumber[property] ? `${value}px` : value, priority);
43
+ element.style.setProperty(
44
+ property,
45
+ isNumeric(value) && !cssNumber[property] ? `${value}px` : value,
46
+ priority
47
+ );
38
48
  }
39
-
40
49
  } else if (isArray(property)) {
41
-
42
50
  const styles = getStyles(element);
43
-
44
- return property.reduce((props, property) => {
45
- props[property] = styles[propName(property)];
46
- return props;
47
- }, {});
48
-
51
+ const props = {};
52
+ for (const prop of property) {
53
+ props[prop] = styles[propName(prop)];
54
+ }
55
+ return props;
49
56
  } else if (isObject(property)) {
50
57
  priority = value;
51
58
  each(property, (value, property) => css(element, property, value, priority));
52
59
  }
53
60
 
54
61
  return element;
55
-
56
62
  })[0];
57
-
58
63
  }
59
64
 
60
65
  function getStyles(element, pseudoElt) {
@@ -65,44 +70,29 @@ function getStyle(element, property, pseudoElt) {
65
70
  return getStyles(element, pseudoElt)[property];
66
71
  }
67
72
 
68
- const parseCssVar = memoize(name => {
69
- /* usage in css: .uk-name:before { content:"xyz" } */
70
-
71
- const element = append(document.documentElement, fragment('<div>'));
72
-
73
- addClass(element, `uk-${name}`);
74
-
75
- const value = getStyle(element, 'content', ':before');
76
-
77
- remove(element);
78
-
79
- return value;
80
- });
81
-
82
73
  const propertyRe = /^\s*(["'])?(.*?)\1\s*$/;
83
74
  export function getCssVar(name) {
84
- return (isIE
85
- ? parseCssVar(name)
86
- : getStyles(document.documentElement).getPropertyValue(`--uk-${name}`)
87
- ).replace(propertyRe, '$2');
75
+ return getStyles(document.documentElement)
76
+ .getPropertyValue(`--uk-${name}`)
77
+ .replace(propertyRe, '$2');
88
78
  }
89
79
 
90
80
  // https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setproperty
91
- export const propName = memoize(name => vendorPropName(name));
81
+ export const propName = memoize((name) => vendorPropName(name));
92
82
 
93
83
  const cssPrefixes = ['webkit', 'moz', 'ms'];
94
84
 
95
85
  function vendorPropName(name) {
96
-
97
86
  name = hyphenate(name);
98
87
 
99
- const {style} = document.documentElement;
88
+ const { style } = document.documentElement;
100
89
 
101
90
  if (name in style) {
102
91
  return name;
103
92
  }
104
93
 
105
- let i = cssPrefixes.length, prefixedName;
94
+ let i = cssPrefixes.length,
95
+ prefixedName;
106
96
 
107
97
  while (i--) {
108
98
  prefixedName = `-${cssPrefixes[i]}-${name}`;
@@ -1,30 +1,39 @@
1
- import {css} from './style';
2
- import {Promise} from './promise';
3
- import {isVisible, parents} from './filter';
4
- import {offset, offsetPosition} from './dimensions';
5
- import {clamp, findIndex, intersectRect, isDocument, isUndefined, isWindow, toNode, toWindow} from './lang';
1
+ import { css } from './style';
2
+ import { isVisible, parents } from './filter';
3
+ import { offset, offsetPosition } from './dimensions';
4
+ import {
5
+ clamp,
6
+ findIndex,
7
+ intersectRect,
8
+ isDocument,
9
+ isUndefined,
10
+ isWindow,
11
+ toNode,
12
+ toWindow,
13
+ } from './lang';
6
14
 
7
15
  export function isInView(element, offsetTop = 0, offsetLeft = 0) {
8
-
9
16
  if (!isVisible(element)) {
10
17
  return false;
11
18
  }
12
19
 
13
- return intersectRect(...scrollParents(element).map(parent => {
14
-
15
- const {top, left, bottom, right} = offset(getViewport(parent));
16
-
17
- return {
18
- top: top - offsetTop,
19
- left: left - offsetLeft,
20
- bottom: bottom + offsetTop,
21
- right: right + offsetLeft
22
- };
23
- }).concat(offset(element)));
20
+ return intersectRect(
21
+ ...scrollParents(element)
22
+ .map((parent) => {
23
+ const { top, left, bottom, right } = offset(getViewport(parent));
24
+
25
+ return {
26
+ top: top - offsetTop,
27
+ left: left - offsetLeft,
28
+ bottom: bottom + offsetTop,
29
+ right: right + offsetLeft,
30
+ };
31
+ })
32
+ .concat(offset(element))
33
+ );
24
34
  }
25
35
 
26
36
  export function scrollTop(element, top) {
27
-
28
37
  if (isWindow(element) || isDocument(element)) {
29
38
  element = getScrollingElement(element);
30
39
  } else {
@@ -38,49 +47,44 @@ export function scrollTop(element, top) {
38
47
  }
39
48
  }
40
49
 
41
- export function scrollIntoView(element, {offset: offsetBy = 0} = {}) {
42
-
50
+ export function scrollIntoView(element, { offset: offsetBy = 0 } = {}) {
43
51
  const parents = isVisible(element) ? scrollParents(element) : [];
44
- return parents.reduce((fn, scrollElement, i) => {
45
-
46
- const {scrollTop, scrollHeight, offsetHeight} = scrollElement;
47
- const maxScroll = scrollHeight - getViewportClientHeight(scrollElement);
48
- const {height: elHeight, top: elTop} = offset(parents[i - 1] || element);
49
-
50
- let top = Math.ceil(
51
- elTop
52
- - offset(getViewport(scrollElement)).top
53
- - offsetBy
54
- + scrollTop
55
- );
56
-
57
- if (offsetBy > 0 && offsetHeight < elHeight + offsetBy) {
58
- top += offsetBy;
59
- } else {
60
- offsetBy = 0;
61
- }
62
-
63
- if (top > maxScroll) {
64
- offsetBy -= top - maxScroll;
65
- top = maxScroll;
66
- } else if (top < 0) {
67
- offsetBy -= top;
68
- top = 0;
69
- }
70
-
71
- return () => scrollTo(scrollElement, top - scrollTop).then(fn);
72
-
73
- }, () => Promise.resolve())();
52
+ return parents.reduce(
53
+ (fn, scrollElement, i) => {
54
+ const { scrollTop, scrollHeight, offsetHeight } = scrollElement;
55
+ const maxScroll = scrollHeight - getViewportClientHeight(scrollElement);
56
+ const { height: elHeight, top: elTop } = offset(parents[i - 1] || element);
57
+
58
+ let top = Math.ceil(
59
+ elTop - offset(getViewport(scrollElement)).top - offsetBy + scrollTop
60
+ );
61
+
62
+ if (offsetBy > 0 && offsetHeight < elHeight + offsetBy) {
63
+ top += offsetBy;
64
+ } else {
65
+ offsetBy = 0;
66
+ }
67
+
68
+ if (top > maxScroll) {
69
+ offsetBy -= top - maxScroll;
70
+ top = maxScroll;
71
+ } else if (top < 0) {
72
+ offsetBy -= top;
73
+ top = 0;
74
+ }
75
+
76
+ return () => scrollTo(scrollElement, top - scrollTop).then(fn);
77
+ },
78
+ () => Promise.resolve()
79
+ )();
74
80
 
75
81
  function scrollTo(element, top) {
76
- return new Promise(resolve => {
77
-
82
+ return new Promise((resolve) => {
78
83
  const scroll = element.scrollTop;
79
84
  const duration = getDuration(Math.abs(top));
80
85
  const start = Date.now();
81
86
 
82
87
  (function step() {
83
-
84
88
  const percent = ease(clamp((Date.now() - start) / duration));
85
89
 
86
90
  scrollTop(element, scroll + top * percent);
@@ -91,29 +95,26 @@ export function scrollIntoView(element, {offset: offsetBy = 0} = {}) {
91
95
  } else {
92
96
  requestAnimationFrame(step);
93
97
  }
94
-
95
98
  })();
96
99
  });
97
100
  }
98
101
 
99
102
  function getDuration(dist) {
100
- return 40 * Math.pow(dist, .375);
103
+ return 40 * Math.pow(dist, 0.375);
101
104
  }
102
105
 
103
106
  function ease(k) {
104
107
  return 0.5 * (1 - Math.cos(Math.PI * k));
105
108
  }
106
-
107
109
  }
108
110
 
109
111
  export function scrolledOver(element, startOffset = 0, endOffset = 0) {
110
-
111
112
  if (!isVisible(element)) {
112
113
  return 0;
113
114
  }
114
115
 
115
116
  const [scrollElement] = scrollParents(element, /auto|scroll/, true);
116
- const {scrollHeight, scrollTop} = scrollElement;
117
+ const { scrollHeight, scrollTop } = scrollElement;
117
118
  const viewportHeight = getViewportClientHeight(scrollElement);
118
119
  const maxScroll = scrollHeight - viewportHeight;
119
120
  const elementOffsetTop = offsetPosition(element)[0] - offsetPosition(scrollElement)[0];
@@ -130,14 +131,20 @@ export function scrollParents(element, overflowRe = /auto|scroll|hidden/, scroll
130
131
  let ancestors = parents(element).reverse();
131
132
  ancestors = ancestors.slice(ancestors.indexOf(scrollEl) + 1);
132
133
 
133
- const fixedIndex = findIndex(ancestors, el => css(el, 'position') === 'fixed');
134
+ const fixedIndex = findIndex(ancestors, (el) => css(el, 'position') === 'fixed');
134
135
  if (~fixedIndex) {
135
136
  ancestors = ancestors.slice(fixedIndex);
136
137
  }
137
138
 
138
- return [scrollEl].concat(ancestors.filter(parent =>
139
- overflowRe.test(css(parent, 'overflow')) && (!scrollable || parent.scrollHeight > getViewportClientHeight(parent)))
140
- ).reverse();
139
+ return [scrollEl]
140
+ .concat(
141
+ ancestors.filter(
142
+ (parent) =>
143
+ overflowRe.test(css(parent, 'overflow')) &&
144
+ (!scrollable || parent.scrollHeight > getViewportClientHeight(parent))
145
+ )
146
+ )
147
+ .reverse();
141
148
  }
142
149
 
143
150
  export function getViewport(scrollElement) {
@@ -146,10 +153,14 @@ export function getViewport(scrollElement) {
146
153
 
147
154
  // iOS 12 returns <body> as scrollingElement
148
155
  export function getViewportClientHeight(scrollElement) {
149
- return (scrollElement === getScrollingElement(scrollElement) ? document.documentElement : scrollElement).clientHeight;
156
+ return (
157
+ scrollElement === getScrollingElement(scrollElement)
158
+ ? document.documentElement
159
+ : scrollElement
160
+ ).clientHeight;
150
161
  }
151
162
 
152
163
  export function getScrollingElement(element) {
153
- const {document} = toWindow(element);
164
+ const { document } = toWindow(element);
154
165
  return document.scrollingElement || document.documentElement;
155
166
  }
package/tests/js/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /* global UIkit, TESTS */
2
- import {addClass, css, fastdom, on, prepend, removeClass, ucfirst} from 'uikit-util';
2
+ import { addClass, css, fastdom, on, prepend, removeClass, ucfirst } from 'uikit-util';
3
3
 
4
4
  const tests = TESTS;
5
5
  const storage = window.sessionStorage;
@@ -14,10 +14,13 @@ request.send(null);
14
14
 
15
15
  const themes = request.status === 200 ? JSON.parse(request.responseText) : {};
16
16
  const styles = {
17
- core: {css: '../dist/css/uikit-core.css'},
18
- theme: {css: '../dist/css/uikit.css'}
17
+ core: { css: '../dist/css/uikit-core.css' },
18
+ theme: { css: '../dist/css/uikit.css' },
19
19
  };
20
- const component = location.pathname.split('/').pop().replace(/.html$/, '');
20
+ const component = location.pathname
21
+ .split('/')
22
+ .pop()
23
+ .replace(/.html$/, '');
21
24
 
22
25
  for (const theme in themes) {
23
26
  styles[theme] = themes[theme];
@@ -26,7 +29,7 @@ for (const theme in themes) {
26
29
  const variations = {
27
30
  '': 'Default',
28
31
  light: 'Dark',
29
- dark: 'Light'
32
+ dark: 'Light',
30
33
  };
31
34
 
32
35
  if (getParam('style') && getParam('style').match(/\.(json|css)$/)) {
@@ -44,102 +47,128 @@ docEl.dir = dir;
44
47
  const style = styles[storage[key]] || styles.theme;
45
48
 
46
49
  // add style
47
- document.writeln(`<link rel="stylesheet" href="${dir !== 'rtl' ? style.css : style.css.replace('.css', '-rtl.css')}">`);
50
+ document.writeln(
51
+ `<link rel="stylesheet" href="${
52
+ dir !== 'rtl' ? style.css : style.css.replace('.css', '-rtl.css')
53
+ }">`
54
+ );
48
55
 
49
56
  // add javascript
50
57
  document.writeln('<script src="../dist/js/uikit.js"></script>');
51
- document.writeln(`<script src="${style.icons ? style.icons : '../dist/js/uikit-icons.js'}"></script>`);
52
-
53
- on(window, 'load', () => setTimeout(() => fastdom.write(() => {
54
-
55
- const $body = document.body;
56
- const $container = prepend($body, `
58
+ document.writeln(
59
+ `<script src="${style.icons ? style.icons : '../dist/js/uikit-icons.js'}"></script>`
60
+ );
61
+
62
+ on(window, 'load', () =>
63
+ setTimeout(
64
+ () =>
65
+ fastdom.write(() => {
66
+ const $body = document.body;
67
+ const $container = prepend(
68
+ $body,
69
+ `
57
70
  <div class="uk-container">
58
71
  <select class="uk-select uk-form-width-small" style="margin: 20px 20px 20px 0">
59
72
  <option value="index.html">Overview</option>
60
- ${tests.map(name => `<option value="${name}.html">${name.split('-').map(ucfirst).join(' ')}</option>`).join('')}
73
+ ${tests
74
+ .map(
75
+ (name) =>
76
+ `<option value="${name}.html">${name
77
+ .split('-')
78
+ .map(ucfirst)
79
+ .join(' ')}</option>`
80
+ )
81
+ .join('')}
61
82
  </select>
62
83
  <select class="uk-select uk-form-width-small" style="margin: 20px">
63
- ${Object.keys(styles).map(style => `<option value="${style}">${ucfirst(style)}</option>`).join('')}
84
+ ${Object.keys(styles)
85
+ .map((style) => `<option value="${style}">${ucfirst(style)}</option>`)
86
+ .join('')}
64
87
  </select>
65
88
  <select class="uk-select uk-form-width-small" style="margin: 20px">
66
- ${Object.keys(variations).map(name => `<option value="${name}">${variations[name]}</option>`).join('')}
89
+ ${Object.keys(variations)
90
+ .map((name) => `<option value="${name}">${variations[name]}</option>`)
91
+ .join('')}
67
92
  </select>
68
93
  <label style="margin: 20px">
69
94
  <input type="checkbox" class="uk-checkbox"/>
70
95
  <span style="margin: 5px">RTL</span>
71
96
  </label>
72
97
  </div>
73
- `);
74
-
75
- const [$tests, $styles, $inverse, $rtl] = $container.children;
76
-
77
- // Tests
78
- // ------------------------------
79
-
80
- on($tests, 'change', () => {
81
- if ($tests.value) {
82
- location.href = `${$tests.value}${styles.custom ? `?style=${getParam('style')}` : ''}`;
83
- }
84
- });
85
- $tests.value = `${component || 'index'}.html`;
86
-
87
- // Styles
88
- // ------------------------------
89
-
90
- on($styles, 'change', () => {
91
- storage[key] = $styles.value;
92
- location.reload();
93
- });
94
- $styles.value = storage[key];
95
-
96
- // Variations
97
- // ------------------------------
98
-
99
- $inverse.value = storage[keyinverse];
100
-
101
- if ($inverse.value) {
102
-
103
- removeClass(document.querySelectorAll('*'),
104
- 'uk-navbar-container',
105
- 'uk-card-default',
106
- 'uk-card-muted',
107
- 'uk-card-primary',
108
- 'uk-card-secondary',
109
- 'uk-tile-default',
110
- 'uk-tile-muted',
111
- 'uk-tile-primary',
112
- 'uk-tile-secondary',
113
- 'uk-section-default',
114
- 'uk-section-muted',
115
- 'uk-section-primary',
116
- 'uk-section-secondary',
117
- 'uk-overlay-default',
118
- 'uk-overlay-primary'
119
- );
120
-
121
- css(docEl, 'background', $inverse.value === 'dark' ? '#fff' : '#222');
122
- addClass($body, `uk-${$inverse.value}`);
123
-
124
- }
125
-
126
- on($inverse, 'change', () => {
127
- storage[keyinverse] = $inverse.value;
128
- location.reload();
129
- });
130
-
131
- // RTL
132
- // ------------------------------
133
-
134
- on($rtl, 'change', ({target}) => {
135
- storage._uikit_dir = target.checked ? 'rtl' : 'ltr';
136
- location.reload();
137
- });
138
- $rtl.firstElementChild.checked = dir === 'rtl';
139
-
140
- css(docEl, 'paddingTop', '');
141
-
142
- }), 100));
98
+ `
99
+ );
100
+
101
+ const [$tests, $styles, $inverse, $rtl] = $container.children;
102
+
103
+ // Tests
104
+ // ------------------------------
105
+
106
+ on($tests, 'change', () => {
107
+ if ($tests.value) {
108
+ location.href = `${$tests.value}${
109
+ styles.custom ? `?style=${getParam('style')}` : ''
110
+ }`;
111
+ }
112
+ });
113
+ $tests.value = `${component || 'index'}.html`;
114
+
115
+ // Styles
116
+ // ------------------------------
117
+
118
+ on($styles, 'change', () => {
119
+ storage[key] = $styles.value;
120
+ location.reload();
121
+ });
122
+ $styles.value = storage[key];
123
+
124
+ // Variations
125
+ // ------------------------------
126
+
127
+ $inverse.value = storage[keyinverse];
128
+
129
+ if ($inverse.value) {
130
+ removeClass(
131
+ document.querySelectorAll('*'),
132
+ 'uk-navbar-container',
133
+ 'uk-card-default',
134
+ 'uk-card-muted',
135
+ 'uk-card-primary',
136
+ 'uk-card-secondary',
137
+ 'uk-tile-default',
138
+ 'uk-tile-muted',
139
+ 'uk-tile-primary',
140
+ 'uk-tile-secondary',
141
+ 'uk-section-default',
142
+ 'uk-section-muted',
143
+ 'uk-section-primary',
144
+ 'uk-section-secondary',
145
+ 'uk-overlay-default',
146
+ 'uk-overlay-primary'
147
+ );
148
+
149
+ css(docEl, 'background', $inverse.value === 'dark' ? '#fff' : '#222');
150
+ addClass($body, `uk-${$inverse.value}`);
151
+ }
152
+
153
+ on($inverse, 'change', () => {
154
+ storage[keyinverse] = $inverse.value;
155
+ location.reload();
156
+ });
157
+
158
+ // RTL
159
+ // ------------------------------
160
+
161
+ on($rtl, 'change', ({ target }) => {
162
+ storage._uikit_dir = target.checked ? 'rtl' : 'ltr';
163
+ location.reload();
164
+ });
165
+ $rtl.firstElementChild.checked = dir === 'rtl';
166
+
167
+ css(docEl, 'paddingTop', '');
168
+ }),
169
+ 100
170
+ )
171
+ );
143
172
 
144
173
  css(docEl, 'paddingTop', '80px');
145
174
 
@@ -1,56 +0,0 @@
1
- import {$$, boxModelAdjust, css, isIE, toFloat} from 'uikit-util';
2
-
3
- // IE 11 fix (min-height on a flex container won't apply to its flex items)
4
- export default isIE ? {
5
-
6
- props: {
7
- selMinHeight: String
8
- },
9
-
10
- data: {
11
- selMinHeight: false,
12
- forceHeight: false
13
- },
14
-
15
- computed: {
16
-
17
- elements({selMinHeight}, $el) {
18
- return selMinHeight ? $$(selMinHeight, $el) : [$el];
19
- }
20
-
21
- },
22
-
23
- update: [
24
-
25
- {
26
-
27
- read() {
28
- css(this.elements, 'height', '');
29
- },
30
-
31
- order: -5,
32
-
33
- events: ['resize']
34
-
35
- },
36
-
37
- {
38
-
39
- write() {
40
- this.elements.forEach(el => {
41
- const height = toFloat(css(el, 'minHeight'));
42
- if (height && (this.forceHeight || Math.round(height + boxModelAdjust(el, 'height', 'content-box')) >= el.offsetHeight)) {
43
- css(el, 'height', height);
44
- }
45
- });
46
- },
47
-
48
- order: 5,
49
-
50
- events: ['resize']
51
-
52
- }
53
-
54
- ]
55
-
56
- } : {};