uikit 3.15.16-dev.67856a2ee → 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.
Files changed (49) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/dist/css/uikit-core-rtl.css +1 -1
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +1 -1
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +1 -1
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +1 -1
  9. package/dist/css/uikit.min.css +1 -1
  10. package/dist/js/components/countdown.js +1 -1
  11. package/dist/js/components/countdown.min.js +1 -1
  12. package/dist/js/components/filter.js +1 -1
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +10 -19
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +10 -19
  17. package/dist/js/components/lightbox.min.js +1 -1
  18. package/dist/js/components/notification.js +1 -1
  19. package/dist/js/components/notification.min.js +1 -1
  20. package/dist/js/components/parallax.js +1 -1
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +1 -1
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +2 -2
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +1 -1
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +1 -1
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +1 -1
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +1 -1
  33. package/dist/js/components/tooltip.min.js +1 -1
  34. package/dist/js/components/upload.js +1 -1
  35. package/dist/js/components/upload.min.js +1 -1
  36. package/dist/js/uikit-core.js +43 -51
  37. package/dist/js/uikit-core.min.js +1 -1
  38. package/dist/js/uikit-icons.js +1 -1
  39. package/dist/js/uikit-icons.min.js +1 -1
  40. package/dist/js/uikit.js +44 -52
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/components/internal/slider-transitioner.js +2 -1
  44. package/src/js/core/accordion.js +4 -4
  45. package/src/js/core/grid.js +2 -5
  46. package/src/js/core/sticky.js +3 -0
  47. package/src/js/mixin/modal.js +6 -14
  48. package/src/js/util/dimensions.js +21 -24
  49. 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.67856a2ee",
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).reduce((right, el) => dimensions(el).width + right, 0);
151
+ return sumBy(children(list), (el) => dimensions(el).width);
151
152
  }
152
153
 
153
154
  function centerEl(el, list) {
@@ -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
- toFloat(css(content, 'height')) +
173
- toFloat(css(content, 'marginTop')) +
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);
@@ -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 = getColumnHeights(columns);
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
- }
@@ -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
  includes,
10
10
  isFocusable,
11
11
  last,
12
+ matches,
12
13
  noop,
13
14
  on,
14
15
  once,
@@ -72,23 +73,11 @@ export default {
72
73
  name: 'click',
73
74
 
74
75
  delegate() {
75
- return this.selClose;
76
+ return `${this.selClose},a[href*="#"]`;
76
77
  },
77
78
 
78
79
  handler(e) {
79
- e.preventDefault();
80
- this.hide();
81
- },
82
- },
83
-
84
- {
85
- name: 'click',
86
-
87
- delegate() {
88
- return 'a[href*="#"]';
89
- },
90
-
91
- handler({ current, defaultPrevented }) {
80
+ const { current, defaultPrevented } = e;
92
81
  const { hash } = current;
93
82
  if (
94
83
  !defaultPrevented &&
@@ -98,6 +87,9 @@ export default {
98
87
  $(hash, document.body)
99
88
  ) {
100
89
  this.hide();
90
+ } else if (matches(current, this.selClose)) {
91
+ e.preventDefault();
92
+ this.hide();
101
93
  }
102
94
  },
103
95
  },
@@ -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
- ? dirs[prop]
153
- .map(ucfirst)
154
- .reduce(
155
- (value, prop) =>
156
- value +
157
- toFloat(css(element, `padding${prop}`)) +
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).reduce((result, 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 result + toFloat(value);
196
- }, 0);
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;
@@ -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)));