uikit 3.14.4-dev.fea9fd466 → 3.15.1-dev.f849bb0c8
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.
- package/CHANGELOG.md +32 -18
- package/build/util.js +1 -0
- package/dist/css/uikit-core-rtl.css +284 -63
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +284 -63
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +306 -92
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +306 -92
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +1 -1
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +1 -1
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +98 -131
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +98 -131
- package/dist/js/components/lightbox.min.js +1 -1
- package/dist/js/components/notification.js +4 -2
- package/dist/js/components/notification.min.js +1 -1
- package/dist/js/components/parallax.js +1 -1
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +1 -1
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +1 -1
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +1 -1
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +1 -1
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +1 -1
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +101 -136
- package/dist/js/components/tooltip.min.js +1 -1
- package/dist/js/components/upload.js +1 -1
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +518 -478
- package/dist/js/uikit-core.min.js +17 -1
- package/dist/js/uikit-icons.js +1 -1
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +521 -479
- package/dist/js/uikit.min.js +17 -1
- package/package.json +11 -11
- package/src/images/components/navbar-toggle-icon.svg +25 -3
- package/src/js/api/hooks.js +5 -1
- package/src/js/api/state.js +2 -2
- package/src/js/components/notification.js +3 -1
- package/src/js/core/accordion.js +9 -17
- package/src/js/core/alert.js +35 -14
- package/src/js/core/drop.js +110 -82
- package/src/js/core/navbar.js +33 -49
- package/src/js/core/offcanvas.js +8 -4
- package/src/js/core/scroll.js +37 -10
- package/src/js/core/toggle.js +3 -5
- package/src/js/mixin/modal.js +15 -12
- package/src/js/mixin/position.js +21 -22
- package/src/js/mixin/style.js +11 -0
- package/src/js/mixin/togglable.js +90 -124
- package/src/js/util/animation.js +9 -7
- package/src/js/util/class.js +3 -1
- package/src/js/util/filter.js +3 -7
- package/src/js/util/position.js +136 -130
- package/src/js/util/viewport.js +1 -1
- package/src/less/components/_import.less +1 -0
- package/src/less/components/drop.less +1 -18
- package/src/less/components/dropbar.less +126 -0
- package/src/less/components/dropdown.less +6 -20
- package/src/less/components/nav.less +214 -23
- package/src/less/components/navbar.less +26 -54
- package/src/less/theme/_import.less +1 -0
- package/src/less/theme/dropbar.less +44 -0
- package/src/less/theme/dropdown.less +0 -11
- package/src/less/theme/nav.less +46 -0
- package/src/less/theme/navbar.less +5 -36
- package/src/scss/components/_import.scss +1 -0
- package/src/scss/components/drop.scss +1 -18
- package/src/scss/components/dropbar.scss +126 -0
- package/src/scss/components/dropdown.scss +6 -20
- package/src/scss/components/nav.scss +163 -22
- package/src/scss/components/navbar.scss +26 -54
- package/src/scss/mixins-theme.scss +81 -35
- package/src/scss/mixins.scss +77 -3
- package/src/scss/theme/_import.scss +1 -0
- package/src/scss/theme/dropbar.scss +44 -0
- package/src/scss/theme/dropdown.scss +0 -8
- package/src/scss/theme/nav.scss +44 -0
- package/src/scss/theme/navbar.scss +4 -8
- package/src/scss/variables-theme.scss +58 -13
- package/src/scss/variables.scss +46 -8
- package/tests/accordion.html +2 -2
- package/tests/alert.html +2 -2
- package/tests/countdown.html +1 -1
- package/tests/drop.html +446 -416
- package/tests/dropbar.html +458 -0
- package/tests/dropdown.html +8 -470
- package/tests/filter.html +9 -12
- package/tests/flex.html +36 -36
- package/tests/form.html +1 -1
- package/tests/grid.html +22 -22
- package/tests/height.html +6 -6
- package/tests/index.html +127 -108
- package/tests/js/index.js +1 -4
- package/tests/lightbox.html +5 -5
- package/tests/list.html +8 -8
- package/tests/modal.html +13 -13
- package/tests/nav.html +121 -12
- package/tests/navbar.html +111 -220
- package/tests/offcanvas.html +10 -14
- package/tests/pagination.html +6 -6
- package/tests/parallax.html +1 -1
- package/tests/position.html +18 -16
- package/tests/progress.html +9 -9
- package/tests/scroll.html +7 -10
- package/tests/search.html +6 -6
- package/tests/slider.html +6 -5
- package/tests/slideshow.html +8 -8
- package/tests/sortable.html +6 -8
- package/tests/sticky-navbar.html +15 -15
- package/tests/sticky.html +8 -8
- package/tests/switcher.html +1 -1
- package/tests/tab.html +1 -1
- package/tests/table.html +7 -7
- package/tests/toggle.html +2 -2
- package/tests/tooltip.html +1 -1
- package/tests/upload.html +11 -11
- package/tests/utility.html +16 -16
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
addClass,
|
|
4
4
|
Animation,
|
|
5
5
|
css,
|
|
6
|
-
|
|
6
|
+
dimensions,
|
|
7
7
|
hasClass,
|
|
8
8
|
includes,
|
|
9
9
|
isBoolean,
|
|
@@ -11,13 +11,14 @@ import {
|
|
|
11
11
|
isVisible,
|
|
12
12
|
noop,
|
|
13
13
|
removeClass,
|
|
14
|
-
scrollParents,
|
|
15
14
|
startsWith,
|
|
16
15
|
toFloat,
|
|
17
16
|
toggleClass,
|
|
18
17
|
toNodes,
|
|
19
18
|
Transition,
|
|
20
19
|
trigger,
|
|
20
|
+
unwrap,
|
|
21
|
+
wrapInner,
|
|
21
22
|
} from 'uikit-util';
|
|
22
23
|
|
|
23
24
|
export default {
|
|
@@ -39,26 +40,6 @@ export default {
|
|
|
39
40
|
transition: 'ease',
|
|
40
41
|
clsEnter: 'uk-togglabe-enter',
|
|
41
42
|
clsLeave: 'uk-togglabe-leave',
|
|
42
|
-
|
|
43
|
-
initProps: {
|
|
44
|
-
overflow: '',
|
|
45
|
-
maxHeight: '',
|
|
46
|
-
paddingTop: '',
|
|
47
|
-
paddingBottom: '',
|
|
48
|
-
marginTop: '',
|
|
49
|
-
marginBottom: '',
|
|
50
|
-
boxShadow: '',
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
hideProps: {
|
|
54
|
-
overflow: 'hidden',
|
|
55
|
-
maxHeight: 0,
|
|
56
|
-
paddingTop: 0,
|
|
57
|
-
paddingBottom: 0,
|
|
58
|
-
marginTop: 0,
|
|
59
|
-
marginBottom: 0,
|
|
60
|
-
boxShadow: 'none',
|
|
61
|
-
},
|
|
62
43
|
},
|
|
63
44
|
|
|
64
45
|
computed: {
|
|
@@ -67,7 +48,7 @@ export default {
|
|
|
67
48
|
},
|
|
68
49
|
|
|
69
50
|
hasTransition({ animation }) {
|
|
70
|
-
return startsWith(animation[0],
|
|
51
|
+
return ['slide', 'reveal'].some((transition) => startsWith(animation[0], transition));
|
|
71
52
|
},
|
|
72
53
|
},
|
|
73
54
|
|
|
@@ -160,122 +141,107 @@ function toggleInstant({ _toggle }) {
|
|
|
160
141
|
};
|
|
161
142
|
}
|
|
162
143
|
|
|
163
|
-
function toggleTransition(cmp) {
|
|
164
|
-
|
|
165
|
-
case 'slide-left':
|
|
166
|
-
return slideHorizontal(cmp);
|
|
167
|
-
case 'slide-right':
|
|
168
|
-
return slideHorizontal(cmp, true);
|
|
169
|
-
}
|
|
170
|
-
return slide(cmp);
|
|
171
|
-
}
|
|
144
|
+
export function toggleTransition(cmp) {
|
|
145
|
+
const [mode = 'reveal', startProp = 'top'] = cmp.animation[0]?.split('-') || [];
|
|
172
146
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
const inProgress = Transition.inProgress(el);
|
|
184
|
-
const inner =
|
|
185
|
-
!inProgress && el.hasChildNodes()
|
|
186
|
-
? toFloat(css(el.firstElementChild, 'marginTop')) +
|
|
187
|
-
toFloat(css(el.lastElementChild, 'marginBottom'))
|
|
188
|
-
: 0;
|
|
189
|
-
const currentHeight = isVisible(el) ? toFloat(css(el, 'height')) + inner : 0;
|
|
147
|
+
const dirs = [
|
|
148
|
+
['left', 'right'],
|
|
149
|
+
['top', 'bottom'],
|
|
150
|
+
];
|
|
151
|
+
const dir = dirs[includes(dirs[0], startProp) ? 0 : 1];
|
|
152
|
+
const end = dir[1] === startProp;
|
|
153
|
+
const props = ['width', 'height'];
|
|
154
|
+
const dimProp = props[dirs.indexOf(dir)];
|
|
155
|
+
const marginProp = `margin-${dir[0]}`;
|
|
156
|
+
const marginStartProp = `margin-${startProp}`;
|
|
190
157
|
|
|
191
|
-
|
|
158
|
+
return async (el, show) => {
|
|
159
|
+
let { duration, velocity, transition, _toggle } = cmp;
|
|
192
160
|
|
|
193
|
-
|
|
161
|
+
let currentDim = dimensions(el)[dimProp];
|
|
162
|
+
|
|
163
|
+
const inProgress = Transition.inProgress(el);
|
|
164
|
+
await Transition.cancel(el);
|
|
194
165
|
|
|
195
|
-
if (
|
|
166
|
+
if (show) {
|
|
196
167
|
_toggle(el, true);
|
|
197
168
|
}
|
|
198
169
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
? Transition.start(
|
|
212
|
-
el,
|
|
213
|
-
{ ...initProps, overflow: 'hidden', maxHeight: endHeight },
|
|
214
|
-
duration * (1 - currentHeight / endHeight),
|
|
215
|
-
transition
|
|
216
|
-
)
|
|
217
|
-
: Transition.start(
|
|
218
|
-
el,
|
|
219
|
-
hideProps,
|
|
220
|
-
duration * (currentHeight / endHeight),
|
|
221
|
-
transition
|
|
222
|
-
).then(() => _toggle(el, false))
|
|
223
|
-
).then(() => css(el, initProps));
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
function slideHorizontal({ isToggled, duration, velocity, transition, _toggle }, right) {
|
|
228
|
-
return (el, show) => {
|
|
229
|
-
const visible = isVisible(el);
|
|
230
|
-
const marginLeft = toFloat(css(el, 'marginLeft'));
|
|
231
|
-
|
|
232
|
-
Transition.cancel(el);
|
|
170
|
+
const prevProps = Object.fromEntries(
|
|
171
|
+
[
|
|
172
|
+
'padding',
|
|
173
|
+
'border',
|
|
174
|
+
'width',
|
|
175
|
+
'height',
|
|
176
|
+
'overflowY',
|
|
177
|
+
'overflowX',
|
|
178
|
+
marginProp,
|
|
179
|
+
marginStartProp,
|
|
180
|
+
].map((key) => [key, el.style[key]])
|
|
181
|
+
);
|
|
233
182
|
|
|
234
|
-
const
|
|
235
|
-
css(
|
|
183
|
+
const dim = dimensions(el);
|
|
184
|
+
const currentMargin = toFloat(css(el, marginProp));
|
|
185
|
+
const marginStart = toFloat(css(el, marginStartProp));
|
|
186
|
+
const endDim = dim[dimProp] + marginStart;
|
|
236
187
|
|
|
237
|
-
if (!
|
|
238
|
-
|
|
188
|
+
if (!inProgress && !show) {
|
|
189
|
+
currentDim += marginStart;
|
|
239
190
|
}
|
|
240
191
|
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
192
|
+
const [wrapper] = wrapInner(el, '<div>');
|
|
193
|
+
css(wrapper, {
|
|
194
|
+
boxSizing: 'border-box',
|
|
195
|
+
height: dim.height,
|
|
196
|
+
width: dim.width,
|
|
197
|
+
...css(el, [
|
|
198
|
+
'overflow',
|
|
199
|
+
'padding',
|
|
200
|
+
'borderTop',
|
|
201
|
+
'borderRight',
|
|
202
|
+
'borderBottom',
|
|
203
|
+
'borderLeft',
|
|
204
|
+
'borderImage',
|
|
205
|
+
marginStartProp,
|
|
206
|
+
]),
|
|
207
|
+
});
|
|
245
208
|
|
|
246
209
|
css(el, {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
210
|
+
padding: 0,
|
|
211
|
+
border: 0,
|
|
212
|
+
minWidth: 0,
|
|
213
|
+
minHeight: 0,
|
|
214
|
+
[marginStartProp]: 0,
|
|
215
|
+
width: dim.width,
|
|
216
|
+
height: dim.height,
|
|
217
|
+
overflow: 'hidden',
|
|
218
|
+
[dimProp]: currentDim,
|
|
251
219
|
});
|
|
252
220
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
css(el, { clipPath: '', marginLeft: '' });
|
|
278
|
-
});
|
|
221
|
+
const percent = currentDim / endDim;
|
|
222
|
+
duration = (velocity * endDim + duration) * (show ? 1 - percent : percent);
|
|
223
|
+
const endProps = { [dimProp]: show ? endDim : 0 };
|
|
224
|
+
|
|
225
|
+
if (end) {
|
|
226
|
+
css(el, marginProp, endDim - currentDim + currentMargin);
|
|
227
|
+
endProps[marginProp] = show ? currentMargin : endDim + currentMargin;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if (!end ^ (mode === 'reveal')) {
|
|
231
|
+
css(wrapper, marginProp, -endDim + currentDim);
|
|
232
|
+
Transition.start(wrapper, { [marginProp]: show ? 0 : -endDim }, duration, transition);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
try {
|
|
236
|
+
await Transition.start(el, endProps, duration, transition);
|
|
237
|
+
} finally {
|
|
238
|
+
css(el, prevProps);
|
|
239
|
+
unwrap(wrapper.firstChild);
|
|
240
|
+
|
|
241
|
+
if (!show) {
|
|
242
|
+
_toggle(el, false);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
279
245
|
};
|
|
280
246
|
}
|
|
281
247
|
|
package/src/js/util/animation.js
CHANGED
|
@@ -4,7 +4,7 @@ import { css, propName } from './style';
|
|
|
4
4
|
import { startsWith, toNodes } from './lang';
|
|
5
5
|
import { addClass, hasClass, removeClass, removeClasses } from './class';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
function transition(element, props, duration = 400, timing = 'linear') {
|
|
8
8
|
duration = Math.round(duration);
|
|
9
9
|
return Promise.all(
|
|
10
10
|
toNodes(element).map(
|
|
@@ -50,13 +50,14 @@ export function transition(element, props, duration = 400, timing = 'linear') {
|
|
|
50
50
|
export const Transition = {
|
|
51
51
|
start: transition,
|
|
52
52
|
|
|
53
|
-
stop(element) {
|
|
53
|
+
async stop(element) {
|
|
54
54
|
trigger(element, 'transitionend');
|
|
55
|
-
|
|
55
|
+
await Promise.resolve();
|
|
56
56
|
},
|
|
57
57
|
|
|
58
|
-
cancel(element) {
|
|
58
|
+
async cancel(element) {
|
|
59
59
|
trigger(element, 'transitioncanceled');
|
|
60
|
+
await Promise.resolve();
|
|
60
61
|
},
|
|
61
62
|
|
|
62
63
|
inProgress(element) {
|
|
@@ -66,7 +67,7 @@ export const Transition = {
|
|
|
66
67
|
|
|
67
68
|
const animationPrefix = 'uk-animation-';
|
|
68
69
|
|
|
69
|
-
|
|
70
|
+
function animate(element, animation, duration = 200, origin, out) {
|
|
70
71
|
return Promise.all(
|
|
71
72
|
toNodes(element).map(
|
|
72
73
|
(element) =>
|
|
@@ -100,7 +101,8 @@ export function animate(element, animation, duration = 200, origin, out) {
|
|
|
100
101
|
);
|
|
101
102
|
}
|
|
102
103
|
|
|
103
|
-
const
|
|
104
|
+
const inProgressRe = new RegExp(`${animationPrefix}(enter|leave)`);
|
|
105
|
+
|
|
104
106
|
export const Animation = {
|
|
105
107
|
in: animate,
|
|
106
108
|
|
|
@@ -109,7 +111,7 @@ export const Animation = {
|
|
|
109
111
|
},
|
|
110
112
|
|
|
111
113
|
inProgress(element) {
|
|
112
|
-
return
|
|
114
|
+
return inProgressRe.test(attr(element, 'class'));
|
|
113
115
|
},
|
|
114
116
|
|
|
115
117
|
cancel(element) {
|
package/src/js/util/class.js
CHANGED
|
@@ -10,7 +10,9 @@ export function removeClass(element, ...args) {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export function removeClasses(element, cls) {
|
|
13
|
-
attr(element, 'class', (value) =>
|
|
13
|
+
attr(element, 'class', (value) =>
|
|
14
|
+
(value || '').replace(new RegExp(`\\b${cls}\\b\\s?`, 'g'), '')
|
|
15
|
+
);
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
export function replaceClass(element, ...args) {
|
package/src/js/util/filter.js
CHANGED
|
@@ -51,12 +51,8 @@ export function matches(element, selector) {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
export function closest(element, selector) {
|
|
54
|
-
if (startsWith(selector, '>')) {
|
|
55
|
-
selector = selector.slice(1);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
54
|
return isElement(element)
|
|
59
|
-
? element.closest(selector)
|
|
55
|
+
? element.closest(startsWith(selector, '>') ? selector.slice(1) : selector)
|
|
60
56
|
: toNodes(element)
|
|
61
57
|
.map((element) => closest(element, selector))
|
|
62
58
|
.filter(Boolean);
|
|
@@ -64,8 +60,8 @@ export function closest(element, selector) {
|
|
|
64
60
|
|
|
65
61
|
export function within(element, selector) {
|
|
66
62
|
return isString(selector)
|
|
67
|
-
?
|
|
68
|
-
:
|
|
63
|
+
? !!closest(element, selector)
|
|
64
|
+
: toNode(selector).contains(toNode(element));
|
|
69
65
|
}
|
|
70
66
|
|
|
71
67
|
export function parents(element, selector) {
|