uikit 3.15.16-dev.8230e5aaa → 3.15.16-dev.dc520a80d
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 +1 -1
- 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 +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 +2 -2
- 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 +1 -1
- 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 +34 -33
- 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 +35 -34
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/components/internal/slider-transitioner.js +2 -1
- package/src/js/core/accordion.js +4 -4
- package/src/js/core/grid.js +2 -5
- package/src/js/core/sticky.js +3 -0
- package/src/js/util/dimensions.js +21 -24
- package/src/js/util/lang.js +7 -0
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.15.16-dev.
|
|
5
|
+
"version": "3.15.16-dev.dc520a80d",
|
|
6
6
|
"main": "dist/js/uikit.js",
|
|
7
7
|
"style": "dist/css/uikit.css",
|
|
8
8
|
"sideEffects": [
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
isRtl,
|
|
12
12
|
noop,
|
|
13
13
|
position,
|
|
14
|
+
sumBy,
|
|
14
15
|
Transition,
|
|
15
16
|
trigger,
|
|
16
17
|
} from 'uikit-util';
|
|
@@ -147,7 +148,7 @@ export function getMax(list) {
|
|
|
147
148
|
}
|
|
148
149
|
|
|
149
150
|
export function getWidth(list) {
|
|
150
|
-
return children(list)
|
|
151
|
+
return sumBy(children(list), (el) => dimensions(el).width);
|
|
151
152
|
}
|
|
152
153
|
|
|
153
154
|
function centerEl(el, list) {
|
package/src/js/core/accordion.js
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
includes,
|
|
13
13
|
index,
|
|
14
14
|
scrollParents,
|
|
15
|
+
sumBy,
|
|
15
16
|
toFloat,
|
|
16
17
|
toggleClass,
|
|
17
18
|
Transition,
|
|
@@ -168,10 +169,9 @@ async function transition(el, show, { content, duration, velocity, transition })
|
|
|
168
169
|
await Transition.cancel(wrapper);
|
|
169
170
|
hide(content, false);
|
|
170
171
|
|
|
171
|
-
const endHeight =
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
toFloat(css(content, 'marginBottom'));
|
|
172
|
+
const endHeight = sumBy(['height', 'paddingBottom', 'marginTop', 'marginBottom'], (prop) =>
|
|
173
|
+
css(content, prop)
|
|
174
|
+
);
|
|
175
175
|
const percent = currentHeight / endHeight;
|
|
176
176
|
duration = (velocity * endHeight + duration) * (show ? 1 - percent : percent);
|
|
177
177
|
css(wrapper, 'height', currentHeight);
|
package/src/js/core/grid.js
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
hasClass,
|
|
9
9
|
scrolledOver,
|
|
10
10
|
sortBy,
|
|
11
|
+
sumBy,
|
|
11
12
|
toFloat,
|
|
12
13
|
toggleClass,
|
|
13
14
|
} from 'uikit-util';
|
|
@@ -66,7 +67,7 @@ export default {
|
|
|
66
67
|
let translates = false;
|
|
67
68
|
|
|
68
69
|
const nodes = children(this.$el);
|
|
69
|
-
const columnHeights =
|
|
70
|
+
const columnHeights = columns.map((column) => sumBy(column, 'offsetHeight'));
|
|
70
71
|
const margin = getMarginTop(nodes, this.margin) * (rows.length - 1);
|
|
71
72
|
const elHeight = Math.max(...columnHeights) + margin;
|
|
72
73
|
|
|
@@ -158,7 +159,3 @@ function getMarginTop(nodes, cls) {
|
|
|
158
159
|
|
|
159
160
|
return toFloat(node ? css(node, 'marginTop') : css(nodes[0], 'paddingLeft'));
|
|
160
161
|
}
|
|
161
|
-
|
|
162
|
-
function getColumnHeights(columns) {
|
|
163
|
-
return columns.map((column) => column.reduce((sum, el) => sum + el.offsetHeight, 0));
|
|
164
|
-
}
|
package/src/js/core/sticky.js
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
isString,
|
|
18
18
|
isVisible,
|
|
19
19
|
noop,
|
|
20
|
+
observeResize,
|
|
20
21
|
offsetPosition,
|
|
21
22
|
parent,
|
|
22
23
|
query,
|
|
@@ -88,6 +89,8 @@ export default {
|
|
|
88
89
|
$('<div class="uk-sticky-placeholder"></div>');
|
|
89
90
|
this.isFixed = false;
|
|
90
91
|
this.setActive(false);
|
|
92
|
+
|
|
93
|
+
this.registerObserver(observeResize(this.$el, () => !this.isFixed && this.$emit('resize')));
|
|
91
94
|
},
|
|
92
95
|
|
|
93
96
|
disconnected() {
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
isUndefined,
|
|
10
10
|
isWindow,
|
|
11
11
|
memoize,
|
|
12
|
+
sumBy,
|
|
12
13
|
toFloat,
|
|
13
14
|
toNode,
|
|
14
15
|
toWindow,
|
|
@@ -149,15 +150,12 @@ function dimension(prop) {
|
|
|
149
150
|
|
|
150
151
|
export function boxModelAdjust(element, prop, sizing = 'border-box') {
|
|
151
152
|
return css(element, 'boxSizing') === sizing
|
|
152
|
-
?
|
|
153
|
-
.map(ucfirst)
|
|
154
|
-
|
|
155
|
-
(
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
toFloat(css(element, `border${prop}Width`)),
|
|
159
|
-
0
|
|
160
|
-
)
|
|
153
|
+
? sumBy(
|
|
154
|
+
dirs[prop].map(ucfirst),
|
|
155
|
+
(prop) =>
|
|
156
|
+
toFloat(css(element, `padding${prop}`)) +
|
|
157
|
+
toFloat(css(element, `border${prop}Width`))
|
|
158
|
+
)
|
|
161
159
|
: 0;
|
|
162
160
|
}
|
|
163
161
|
|
|
@@ -177,23 +175,22 @@ export function toPx(value, property = 'width', element = window, offsetDim = fa
|
|
|
177
175
|
return toFloat(value);
|
|
178
176
|
}
|
|
179
177
|
|
|
180
|
-
return parseCalc(value)
|
|
178
|
+
return sumBy(parseCalc(value), (value) => {
|
|
181
179
|
const unit = parseUnit(value);
|
|
182
|
-
if (unit) {
|
|
183
|
-
value = percent(
|
|
184
|
-
unit === 'vh'
|
|
185
|
-
? getViewportHeight()
|
|
186
|
-
: unit === 'vw'
|
|
187
|
-
? width(toWindow(element))
|
|
188
|
-
: offsetDim
|
|
189
|
-
? element[`offset${ucfirst(property)}`]
|
|
190
|
-
: dimensions(element)[property],
|
|
191
|
-
value
|
|
192
|
-
);
|
|
193
|
-
}
|
|
194
180
|
|
|
195
|
-
return
|
|
196
|
-
|
|
181
|
+
return unit
|
|
182
|
+
? percent(
|
|
183
|
+
unit === 'vh'
|
|
184
|
+
? getViewportHeight()
|
|
185
|
+
: unit === 'vw'
|
|
186
|
+
? width(toWindow(element))
|
|
187
|
+
: offsetDim
|
|
188
|
+
? element[`offset${ucfirst(property)}`]
|
|
189
|
+
: dimensions(element)[property],
|
|
190
|
+
value
|
|
191
|
+
)
|
|
192
|
+
: value;
|
|
193
|
+
});
|
|
197
194
|
}
|
|
198
195
|
|
|
199
196
|
const calcRe = /-?\d+(?:\.\d+)?(?:v[wh]|%|px)?/g;
|
package/src/js/util/lang.js
CHANGED
|
@@ -168,6 +168,13 @@ export function sortBy(array, prop) {
|
|
|
168
168
|
);
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
+
export function sumBy(array, iteratee) {
|
|
172
|
+
return array.reduce(
|
|
173
|
+
(sum, item) => sum + toFloat(isFunction(iteratee) ? iteratee(item) : item[iteratee]),
|
|
174
|
+
0
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
171
178
|
export function uniqueBy(array, prop) {
|
|
172
179
|
const seen = new Set();
|
|
173
180
|
return array.filter(({ [prop]: check }) => (seen.has(check) ? false : seen.add(check)));
|