uikit 3.11.2-dev.bbaa4362f → 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 (165) 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 +8 -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 +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 +5356 -6709
  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 -9913
  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 +107 -93
  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/src/less/components/flex.less +0 -9
  153. package/src/less/components/navbar.less +0 -7
  154. package/src/less/components/utility.less +22 -0
  155. package/src/scss/components/flex.scss +0 -9
  156. package/src/scss/components/form.scss +3 -3
  157. package/src/scss/components/icon.scss +2 -2
  158. package/src/scss/components/navbar.scss +0 -7
  159. package/src/scss/components/search.scss +1 -1
  160. package/src/scss/components/utility.scss +22 -0
  161. package/src/scss/variables-theme.scss +6 -6
  162. package/src/scss/variables.scss +6 -6
  163. package/tests/js/index.js +114 -85
  164. package/src/js/mixin/flex-bug.js +0 -56
  165. package/src/js/util/promise.js +0 -191
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
- } : {};
@@ -1,191 +0,0 @@
1
- /* global setImmediate */
2
- import {inBrowser} from './env';
3
- import {isFunction, isObject} from './lang';
4
-
5
- export const Promise = inBrowser && window.Promise || PromiseFn;
6
-
7
- export class Deferred {
8
- constructor() {
9
- this.promise = new Promise((resolve, reject) => {
10
- this.reject = reject;
11
- this.resolve = resolve;
12
- });
13
- }
14
- }
15
-
16
- /**
17
- * Promises/A+ polyfill v1.1.4 (https://github.com/bramstein/promis)
18
- */
19
-
20
- const RESOLVED = 0;
21
- const REJECTED = 1;
22
- const PENDING = 2;
23
-
24
- const async = inBrowser && window.setImmediate || setTimeout;
25
-
26
- function PromiseFn(executor) {
27
-
28
- this.state = PENDING;
29
- this.value = undefined;
30
- this.deferred = [];
31
-
32
- const promise = this;
33
-
34
- try {
35
- executor(
36
- x => {
37
- promise.resolve(x);
38
- },
39
- r => {
40
- promise.reject(r);
41
- }
42
- );
43
- } catch (e) {
44
- promise.reject(e);
45
- }
46
- }
47
-
48
- PromiseFn.reject = function (r) {
49
- return new PromiseFn((resolve, reject) => {
50
- reject(r);
51
- });
52
- };
53
-
54
- PromiseFn.resolve = function (x) {
55
- return new PromiseFn((resolve, reject) => {
56
- resolve(x);
57
- });
58
- };
59
-
60
- PromiseFn.all = function all(iterable) {
61
- return new PromiseFn((resolve, reject) => {
62
- const result = [];
63
- let count = 0;
64
-
65
- if (iterable.length === 0) {
66
- resolve(result);
67
- }
68
-
69
- function resolver(i) {
70
- return function (x) {
71
- result[i] = x;
72
- count += 1;
73
-
74
- if (count === iterable.length) {
75
- resolve(result);
76
- }
77
- };
78
- }
79
-
80
- for (let i = 0; i < iterable.length; i += 1) {
81
- PromiseFn.resolve(iterable[i]).then(resolver(i), reject);
82
- }
83
- });
84
- };
85
-
86
- PromiseFn.race = function race(iterable) {
87
- return new PromiseFn((resolve, reject) => {
88
- for (let i = 0; i < iterable.length; i += 1) {
89
- PromiseFn.resolve(iterable[i]).then(resolve, reject);
90
- }
91
- });
92
- };
93
-
94
- const p = PromiseFn.prototype;
95
-
96
- p.resolve = function resolve(x) {
97
- const promise = this;
98
-
99
- if (promise.state === PENDING) {
100
- if (x === promise) {
101
- throw new TypeError('Promise settled with itself.');
102
- }
103
-
104
- let called = false;
105
-
106
- try {
107
- const then = x && x.then;
108
-
109
- if (x !== null && isObject(x) && isFunction(then)) {
110
- then.call(
111
- x,
112
- x => {
113
- if (!called) {
114
- promise.resolve(x);
115
- }
116
- called = true;
117
- },
118
- r => {
119
- if (!called) {
120
- promise.reject(r);
121
- }
122
- called = true;
123
- }
124
- );
125
- return;
126
- }
127
- } catch (e) {
128
- if (!called) {
129
- promise.reject(e);
130
- }
131
- return;
132
- }
133
-
134
- promise.state = RESOLVED;
135
- promise.value = x;
136
- promise.notify();
137
- }
138
- };
139
-
140
- p.reject = function reject(reason) {
141
- const promise = this;
142
-
143
- if (promise.state === PENDING) {
144
- if (reason === promise) {
145
- throw new TypeError('Promise settled with itself.');
146
- }
147
-
148
- promise.state = REJECTED;
149
- promise.value = reason;
150
- promise.notify();
151
- }
152
- };
153
-
154
- p.notify = function notify() {
155
- async(() => {
156
- if (this.state !== PENDING) {
157
- while (this.deferred.length) {
158
- const [onResolved, onRejected, resolve, reject] = this.deferred.shift();
159
-
160
- try {
161
- if (this.state === RESOLVED) {
162
- if (isFunction(onResolved)) {
163
- resolve(onResolved.call(undefined, this.value));
164
- } else {
165
- resolve(this.value);
166
- }
167
- } else if (this.state === REJECTED) {
168
- if (isFunction(onRejected)) {
169
- resolve(onRejected.call(undefined, this.value));
170
- } else {
171
- reject(this.value);
172
- }
173
- }
174
- } catch (e) {
175
- reject(e);
176
- }
177
- }
178
- }
179
- });
180
- };
181
-
182
- p.then = function then(onResolved, onRejected) {
183
- return new PromiseFn((resolve, reject) => {
184
- this.deferred.push([onResolved, onRejected, resolve, reject]);
185
- this.notify();
186
- });
187
- };
188
-
189
- p.catch = function (onRejected) {
190
- return this.then(undefined, onRejected);
191
- };