uikit 3.14.1-dev.dadc910c0 → 3.14.1-dev.e15dd286c
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 +2 -0
- package/dist/css/uikit-core-rtl.css +1 -1
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +1 -1
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +1 -1
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +1 -1
- 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 +2 -2
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +1 -1
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +1 -1
- package/dist/js/components/lightbox.min.js +1 -1
- package/dist/js/components/notification.js +1 -1
- package/dist/js/components/notification.min.js +1 -1
- package/dist/js/components/parallax.js +60 -60
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +60 -60
- 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 +60 -60
- 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 +2 -2
- 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 +12 -9
- package/dist/js/uikit-core.min.js +1 -1
- package/dist/js/uikit-icons.js +1 -1
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +72 -69
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/components/filter.js +1 -1
- package/src/js/core/margin.js +1 -1
- package/src/js/core/scrollspy.js +9 -6
- package/src/js/mixin/parallax.js +59 -59
- package/src/js/mixin/position.js +1 -1
- package/tests/notification.html +1 -1
- package/tests/parallax.html +7 -7
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "uikit",
|
|
3
3
|
"title": "UIkit",
|
|
4
4
|
"description": "UIkit is a lightweight and modular front-end framework for developing fast and powerful web interfaces.",
|
|
5
|
-
"version": "3.14.1-dev.
|
|
5
|
+
"version": "3.14.1-dev.e15dd286c",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
|
@@ -194,7 +194,7 @@ function matchFilter(
|
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
function isEqualList(listA, listB) {
|
|
197
|
-
return listA.length === listB.length && listA.every((el) =>
|
|
197
|
+
return listA.length === listB.length && listA.every((el) => listB.includes(el));
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
function getSelector({ filter }) {
|
package/src/js/core/margin.js
CHANGED
|
@@ -47,7 +47,7 @@ export default {
|
|
|
47
47
|
for (const row of rows) {
|
|
48
48
|
for (const column of row) {
|
|
49
49
|
toggleClass(column, this.margin, rows[0] !== row);
|
|
50
|
-
toggleClass(column, this.firstColumn,
|
|
50
|
+
toggleClass(column, this.firstColumn, columns[0].includes(column));
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
},
|
package/src/js/core/scrollspy.js
CHANGED
|
@@ -45,13 +45,13 @@ export default {
|
|
|
45
45
|
return target ? $$(target, $el) : [$el];
|
|
46
46
|
},
|
|
47
47
|
|
|
48
|
-
watch(elements
|
|
48
|
+
watch(elements) {
|
|
49
49
|
if (this.hidden) {
|
|
50
50
|
css(filter(elements, `:not(.${this.inViewClass})`), 'visibility', 'hidden');
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
this
|
|
53
|
+
for (const element of elements) {
|
|
54
|
+
this._observer.observe(element);
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
|
|
@@ -61,9 +61,10 @@ export default {
|
|
|
61
61
|
|
|
62
62
|
connected() {
|
|
63
63
|
this._data.elements = new Map();
|
|
64
|
+
|
|
64
65
|
this.registerObserver(
|
|
65
|
-
observeIntersection(
|
|
66
|
-
|
|
66
|
+
(this._observer = observeIntersection(
|
|
67
|
+
[],
|
|
67
68
|
(records) => {
|
|
68
69
|
const elements = this._data.elements;
|
|
69
70
|
for (const { target: el, isIntersecting } of records) {
|
|
@@ -89,7 +90,7 @@ export default {
|
|
|
89
90
|
}px`,
|
|
90
91
|
},
|
|
91
92
|
false
|
|
92
|
-
)
|
|
93
|
+
))
|
|
93
94
|
);
|
|
94
95
|
},
|
|
95
96
|
|
|
@@ -97,6 +98,8 @@ export default {
|
|
|
97
98
|
for (const [el, state] of this._data.elements.entries()) {
|
|
98
99
|
removeClass(el, this.inViewClass, state?.cls || '');
|
|
99
100
|
}
|
|
101
|
+
|
|
102
|
+
this._observer = null;
|
|
100
103
|
},
|
|
101
104
|
|
|
102
105
|
update: [
|
package/src/js/mixin/parallax.js
CHANGED
|
@@ -79,39 +79,39 @@ export default {
|
|
|
79
79
|
},
|
|
80
80
|
};
|
|
81
81
|
|
|
82
|
-
function transformFn(prop, el,
|
|
83
|
-
let unit = getUnit(
|
|
82
|
+
function transformFn(prop, el, stops) {
|
|
83
|
+
let unit = getUnit(stops) || { x: 'px', y: 'px', rotate: 'deg' }[prop] || '';
|
|
84
84
|
let transformFn;
|
|
85
85
|
|
|
86
86
|
if (prop === 'x' || prop === 'y') {
|
|
87
87
|
prop = `translate${ucfirst(prop)}`;
|
|
88
|
-
transformFn = (
|
|
88
|
+
transformFn = (stop) => toFloat(toFloat(stop).toFixed(unit === 'px' ? 0 : 6));
|
|
89
89
|
} else if (prop === 'scale') {
|
|
90
90
|
unit = '';
|
|
91
|
-
transformFn = (
|
|
92
|
-
getUnit([
|
|
91
|
+
transformFn = (stop) =>
|
|
92
|
+
getUnit([stop]) ? toPx(stop, 'width', el, true) / el.offsetWidth : stop;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
if (
|
|
96
|
-
|
|
95
|
+
if (stops.length === 1) {
|
|
96
|
+
stops.unshift(prop === 'scale' ? 1 : 0);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
stops = parseStops(stops, transformFn);
|
|
100
100
|
|
|
101
101
|
return (css, percent) => {
|
|
102
|
-
css.transform += ` ${prop}(${getValue(
|
|
102
|
+
css.transform += ` ${prop}(${getValue(stops, percent)}${unit})`;
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
function colorFn(prop, el,
|
|
107
|
-
if (
|
|
108
|
-
|
|
106
|
+
function colorFn(prop, el, stops) {
|
|
107
|
+
if (stops.length === 1) {
|
|
108
|
+
stops.unshift(getCssValue(el, prop, ''));
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
stops = parseStops(stops, (stop) => parseColor(el, stop));
|
|
112
112
|
|
|
113
113
|
return (css, percent) => {
|
|
114
|
-
const [start, end, p] =
|
|
114
|
+
const [start, end, p] = getStop(stops, percent);
|
|
115
115
|
const value = start
|
|
116
116
|
.map((value, i) => {
|
|
117
117
|
value += p * (end[i] - value);
|
|
@@ -131,80 +131,80 @@ function parseColor(el, color) {
|
|
|
131
131
|
.map(toFloat);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
function filterFn(prop, el,
|
|
135
|
-
if (
|
|
136
|
-
|
|
134
|
+
function filterFn(prop, el, stops) {
|
|
135
|
+
if (stops.length === 1) {
|
|
136
|
+
stops.unshift(0);
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
const unit = getUnit(
|
|
139
|
+
const unit = getUnit(stops) || { blur: 'px', hue: 'deg' }[prop] || '%';
|
|
140
140
|
prop = { fopacity: 'opacity', hue: 'hue-rotate' }[prop] || prop;
|
|
141
|
-
|
|
141
|
+
stops = parseStops(stops);
|
|
142
142
|
|
|
143
143
|
return (css, percent) => {
|
|
144
|
-
const value = getValue(
|
|
144
|
+
const value = getValue(stops, percent);
|
|
145
145
|
css.filter += ` ${prop}(${value + unit})`;
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
function cssPropFn(prop, el,
|
|
150
|
-
if (
|
|
151
|
-
|
|
149
|
+
function cssPropFn(prop, el, stops) {
|
|
150
|
+
if (stops.length === 1) {
|
|
151
|
+
stops.unshift(getCssValue(el, prop, ''));
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
stops = parseStops(stops);
|
|
155
155
|
|
|
156
156
|
return (css, percent) => {
|
|
157
|
-
css[prop] = getValue(
|
|
157
|
+
css[prop] = getValue(stops, percent);
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
function strokeFn(prop, el,
|
|
162
|
-
if (
|
|
163
|
-
|
|
161
|
+
function strokeFn(prop, el, stops) {
|
|
162
|
+
if (stops.length === 1) {
|
|
163
|
+
stops.unshift(0);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
const unit = getUnit(
|
|
166
|
+
const unit = getUnit(stops);
|
|
167
167
|
const length = getMaxPathLength(el);
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
return unit === '%' ? (
|
|
168
|
+
stops = parseStops(stops.reverse(), (stop) => {
|
|
169
|
+
stop = toFloat(stop);
|
|
170
|
+
return unit === '%' ? (stop * length) / 100 : stop;
|
|
171
171
|
});
|
|
172
172
|
|
|
173
|
-
if (!
|
|
173
|
+
if (!stops.some(([value]) => value)) {
|
|
174
174
|
return noop;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
css(el, 'strokeDasharray', length);
|
|
178
178
|
|
|
179
179
|
return (css, percent) => {
|
|
180
|
-
css.strokeDashoffset = getValue(
|
|
180
|
+
css.strokeDashoffset = getValue(stops, percent);
|
|
181
181
|
};
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
function backgroundFn(prop, el,
|
|
185
|
-
if (
|
|
186
|
-
|
|
184
|
+
function backgroundFn(prop, el, stops) {
|
|
185
|
+
if (stops.length === 1) {
|
|
186
|
+
stops.unshift(0);
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
prop = prop.substr(-1);
|
|
190
190
|
const attr = prop === 'y' ? 'height' : 'width';
|
|
191
|
-
|
|
191
|
+
stops = parseStops(stops, (stop) => toPx(stop, attr, el));
|
|
192
192
|
|
|
193
193
|
const bgPos = getCssValue(el, `background-position-${prop}`, '');
|
|
194
194
|
|
|
195
195
|
return getCssValue(el, 'backgroundSize', '') === 'cover'
|
|
196
|
-
? backgroundCoverFn(prop, el,
|
|
197
|
-
: setBackgroundPosFn(prop,
|
|
196
|
+
? backgroundCoverFn(prop, el, stops, bgPos, attr)
|
|
197
|
+
: setBackgroundPosFn(prop, stops, bgPos);
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
function backgroundCoverFn(prop, el,
|
|
200
|
+
function backgroundCoverFn(prop, el, stops, bgPos, attr) {
|
|
201
201
|
const dimImage = getBackgroundImageDimensions(el);
|
|
202
202
|
|
|
203
203
|
if (!dimImage.width) {
|
|
204
204
|
return noop;
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
const values =
|
|
207
|
+
const values = stops.map(([value]) => value);
|
|
208
208
|
const min = Math.min(...values);
|
|
209
209
|
const max = Math.max(...values);
|
|
210
210
|
const down = values.indexOf(min) < values.indexOf(max);
|
|
@@ -232,7 +232,7 @@ function backgroundCoverFn(prop, el, steps, bgPos, attr) {
|
|
|
232
232
|
|
|
233
233
|
const dim = Dimensions.cover(dimImage, dimEl);
|
|
234
234
|
|
|
235
|
-
const fn = setBackgroundPosFn(prop,
|
|
235
|
+
const fn = setBackgroundPosFn(prop, stops, `${pos}px`);
|
|
236
236
|
return (css, percent) => {
|
|
237
237
|
fn(css, percent);
|
|
238
238
|
css.backgroundSize = `${dim.width}px ${dim.height}px`;
|
|
@@ -240,9 +240,9 @@ function backgroundCoverFn(prop, el, steps, bgPos, attr) {
|
|
|
240
240
|
};
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
-
function setBackgroundPosFn(prop,
|
|
243
|
+
function setBackgroundPosFn(prop, stops, pos) {
|
|
244
244
|
return function (css, percent) {
|
|
245
|
-
css[`background-position-${prop}`] = `calc(${pos} + ${getValue(
|
|
245
|
+
css[`background-position-${prop}`] = `calc(${pos} + ${getValue(stops, percent)}px)`;
|
|
246
246
|
};
|
|
247
247
|
}
|
|
248
248
|
|
|
@@ -277,12 +277,12 @@ function toDimensions(image) {
|
|
|
277
277
|
};
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
-
function
|
|
280
|
+
function parseStops(stops, fn = toFloat) {
|
|
281
281
|
const result = [];
|
|
282
|
-
const { length } =
|
|
282
|
+
const { length } = stops;
|
|
283
283
|
let nullIndex = 0;
|
|
284
284
|
for (let i = 0; i < length; i++) {
|
|
285
|
-
let [value, percent] = isString(
|
|
285
|
+
let [value, percent] = isString(stops[i]) ? stops[i].trim().split(' ') : [stops[i]];
|
|
286
286
|
value = fn(value);
|
|
287
287
|
percent = percent ? toFloat(percent) / 100 : null;
|
|
288
288
|
|
|
@@ -319,24 +319,24 @@ function parseSteps(steps, fn = toFloat) {
|
|
|
319
319
|
return result;
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
-
function
|
|
323
|
-
const index = findIndex(
|
|
322
|
+
function getStop(stops, percent) {
|
|
323
|
+
const index = findIndex(stops.slice(1), ([, targetPercent]) => percent <= targetPercent) + 1;
|
|
324
324
|
return [
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
(percent -
|
|
325
|
+
stops[index - 1][0],
|
|
326
|
+
stops[index][0],
|
|
327
|
+
(percent - stops[index - 1][1]) / (stops[index][1] - stops[index - 1][1]),
|
|
328
328
|
];
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
-
function getValue(
|
|
332
|
-
const [start, end, p] =
|
|
331
|
+
function getValue(stops, percent) {
|
|
332
|
+
const [start, end, p] = getStop(stops, percent);
|
|
333
333
|
return isNumber(start) ? start + Math.abs(start - end) * p * (start < end ? 1 : -1) : +end;
|
|
334
334
|
}
|
|
335
335
|
|
|
336
|
-
const unitRe = /^-?\d+(
|
|
337
|
-
function getUnit(
|
|
338
|
-
for (const
|
|
339
|
-
const match =
|
|
336
|
+
const unitRe = /^-?\d+(\S*)/;
|
|
337
|
+
function getUnit(stops, defaultUnit) {
|
|
338
|
+
for (const stop of stops) {
|
|
339
|
+
const match = stop.match?.(unitRe);
|
|
340
340
|
if (match) {
|
|
341
341
|
return match[1];
|
|
342
342
|
}
|
package/src/js/mixin/position.js
CHANGED
package/tests/notification.html
CHANGED
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
<td><code>timeout</code></td>
|
|
108
108
|
<td>Number</td>
|
|
109
109
|
<td>5000</td>
|
|
110
|
-
<td>Visibility duration before a notification disappears.</td>
|
|
110
|
+
<td>Visibility duration before a notification disappears. If set to `0`, notification will not hide automatically.</td>
|
|
111
111
|
</tr>
|
|
112
112
|
<tr>
|
|
113
113
|
<td><code>group</code></td>
|
package/tests/parallax.html
CHANGED
|
@@ -35,27 +35,27 @@
|
|
|
35
35
|
</div>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
|
-
<h2>Start and End
|
|
38
|
+
<h2>Start and End Stops</h2>
|
|
39
39
|
|
|
40
|
-
<div id="test-start-end-
|
|
40
|
+
<div id="test-start-end-stops" class="uk-height-large uk-background-cover uk-margin uk-overflow-hidden uk-light uk-flex" style="background-image: url('images/dark.jpg');" uk-parallax="bgy: -200">
|
|
41
41
|
<div class="uk-width-1-2@m uk-text-center uk-margin-auto uk-margin-auto-vertical">
|
|
42
42
|
<h1 uk-parallax="opacity: 0,1; y: -200,0; scale: 2,1;">Headline</h1>
|
|
43
43
|
<p uk-parallax="opacity: 0,1; y: 200,0; scale: 0,1;">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
46
46
|
|
|
47
|
-
<h2>Multiple
|
|
47
|
+
<h2>Multiple Stops</h2>
|
|
48
48
|
|
|
49
|
-
<div id="test-multiple-
|
|
49
|
+
<div id="test-multiple-stops" class="uk-height-large uk-background-cover uk-margin uk-overflow-hidden uk-light uk-flex" style="background-image: url('images/dark.jpg');" uk-parallax="bgx: 0,200,0,200">
|
|
50
50
|
<div class="uk-width-1-2@m uk-text-center uk-margin-auto uk-margin-auto-vertical">
|
|
51
51
|
<h1 uk-parallax="x: -200,200,-200,200; scale: 2,1,2,1;">Headline</h1>
|
|
52
52
|
<p uk-parallax="x: 200,-200,200,-200; scale: 1,0,1,0,1">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
|
|
53
53
|
</div>
|
|
54
54
|
</div>
|
|
55
55
|
|
|
56
|
-
<h2>
|
|
56
|
+
<h2>Stop Positions</h2>
|
|
57
57
|
|
|
58
|
-
<div id="test-
|
|
58
|
+
<div id="test-stop-positions" class="uk-height-large uk-background-cover uk-margin uk-overflow-hidden uk-light uk-flex" style="background-image: url('images/dark.jpg');" uk-parallax="bgx: 0,50 50%, 200">
|
|
59
59
|
<div class="uk-width-1-2@m uk-text-center uk-margin-auto uk-margin-auto-vertical">
|
|
60
60
|
<h1 uk-parallax="x: -200,200 20%,-200 80%,200; scale: 1,1 50%,2;">Headline</h1>
|
|
61
61
|
<p uk-parallax="x: 200,-200 20%,200 80%,-200; scale: 1,1 50%,2">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
|
|
191
191
|
<h2>Animated properties</h2>
|
|
192
192
|
|
|
193
|
-
<p>You can define multiple animation
|
|
193
|
+
<p>You can define multiple animation stops by using a comma separated list of values. (e.g. x: 0,50,150). A stop can be defined by a value and a position. If you don't specify the position of a stop, it is placed halfway between the one that precedes it and the one that follows it.</p>
|
|
194
194
|
|
|
195
195
|
<div class="uk-overflow-auto">
|
|
196
196
|
<table class="uk-table uk-table-striped">
|