uikit 3.11.2-dev.78e397546 → 3.11.2-dev.7dd548556

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 (167) 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 +13 -2
  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 +724 -846
  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 +586 -617
  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 +150 -162
  51. package/dist/js/components/upload.min.js +1 -1
  52. package/dist/js/uikit-core.js +5286 -6612
  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 +8110 -9879
  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 +80 -101
  66. package/src/js/components/countdown.js +23 -49
  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 +65 -44
  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 +17 -38
  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 +73 -61
  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 +121 -102
  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 +54 -49
  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 +15 -28
  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 +57 -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 -84
  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 +34 -51
  107. package/src/js/core/sticky.js +139 -94
  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 +63 -65
  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 +62 -63
  126. package/src/js/mixin/slider-nav.js +25 -34
  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 +9 -15
  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 +36 -54
  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 +53 -45
  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/js/index.js +114 -85
  165. package/tests/sticky-parallax.html +1 -1
  166. package/tests/sticky.html +14 -3
  167. package/src/js/mixin/flex-bug.js +0 -56
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
 
@@ -10,7 +10,7 @@
10
10
 
11
11
  <body style="padding-bottom: 100vh;">
12
12
 
13
- <div class="uk-section uk-section-primary uk-position-z-index-negative uk-flex uk-flex-center uk-flex-middle uk-text-center" uk-sticky="bottom: +* +*" uk-height-viewport>
13
+ <div class="uk-section uk-section-primary uk-position-z-index-negative uk-flex uk-flex-center uk-flex-middle uk-text-center" uk-sticky="position: auto; bottom: +* +*" uk-height-viewport>
14
14
  <div class="uk-container">
15
15
 
16
16
  <h1 class="uk-heading-2xlarge">Sticky Section</h1>
package/tests/sticky.html CHANGED
@@ -57,14 +57,25 @@
57
57
  </div>
58
58
 
59
59
  <p id="hash" class="uk-margin-large">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
60
+
61
+ <div class="viewport uk-margin">
62
+ <div class="uk-grid uk-child-width-1-6" uk-height-viewport>
63
+ <div>
64
+
65
+ <div class="uk-card uk-card-primary uk-card-body" uk-sticky="position: bottom; bottom: !.viewport">Sticky bottom</div>
66
+
67
+ </div>
68
+ </div>
69
+ </div>
70
+
60
71
  </div>
61
72
  <div class="uk-width-1-6">
62
73
  <div class="viewport" style="min-height: 200vh;">
63
74
  <div>
64
- <div class="uk-card uk-card-primary uk-card-body" style="height: 120vh" uk-sticky="bottom: !.viewport">
75
+ <div class="uk-card uk-card-primary uk-card-body" uk-sticky="bottom: !.viewport">
65
76
  <p>Oversized Content</p>
66
77
 
67
- <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
78
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</p>
68
79
  </div>
69
80
  </div>
70
81
  </div>
@@ -106,7 +117,7 @@
106
117
  <td><code>offset</code></td>
107
118
  <td>String</td>
108
119
  <td>0</td>
109
- <td>The offset the Sticky should be fixed to.</td>
120
+ <td>The offset the Sticky should be fixed to. It supports basic mathematics operands + and -. (e.g. 50vh + 50%)</td>
110
121
  </tr>
111
122
  <tr>
112
123
  <td><code>animation</code></td>
@@ -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
- } : {};