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.
Files changed (49) hide show
  1. package/CHANGELOG.md +2 -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 +2 -2
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +1 -1
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +1 -1
  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 +60 -60
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +60 -60
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +1 -1
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +60 -60
  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 +2 -2
  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 +12 -9
  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 +72 -69
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/components/filter.js +1 -1
  44. package/src/js/core/margin.js +1 -1
  45. package/src/js/core/scrollspy.js +9 -6
  46. package/src/js/mixin/parallax.js +59 -59
  47. package/src/js/mixin/position.js +1 -1
  48. package/tests/notification.html +1 -1
  49. 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.dadc910c0",
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) => ~listB.indexOf(el));
197
+ return listA.length === listB.length && listA.every((el) => listB.includes(el));
198
198
  }
199
199
 
200
200
  function getSelector({ filter }) {
@@ -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, !!~columns[0].indexOf(column));
50
+ toggleClass(column, this.firstColumn, columns[0].includes(column));
51
51
  }
52
52
  }
53
53
  },
@@ -45,13 +45,13 @@ export default {
45
45
  return target ? $$(target, $el) : [$el];
46
46
  },
47
47
 
48
- watch(elements, prev) {
48
+ watch(elements) {
49
49
  if (this.hidden) {
50
50
  css(filter(elements, `:not(.${this.inViewClass})`), 'visibility', 'hidden');
51
51
  }
52
52
 
53
- if (prev) {
54
- this.$reset();
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
- this.elements,
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: [
@@ -79,39 +79,39 @@ export default {
79
79
  },
80
80
  };
81
81
 
82
- function transformFn(prop, el, steps) {
83
- let unit = getUnit(steps) || { x: 'px', y: 'px', rotate: 'deg' }[prop] || '';
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 = (step) => toFloat(toFloat(step).toFixed(unit === 'px' ? 0 : 6));
88
+ transformFn = (stop) => toFloat(toFloat(stop).toFixed(unit === 'px' ? 0 : 6));
89
89
  } else if (prop === 'scale') {
90
90
  unit = '';
91
- transformFn = (step) =>
92
- getUnit([step]) ? toPx(step, 'width', el, true) / el.offsetWidth : step;
91
+ transformFn = (stop) =>
92
+ getUnit([stop]) ? toPx(stop, 'width', el, true) / el.offsetWidth : stop;
93
93
  }
94
94
 
95
- if (steps.length === 1) {
96
- steps.unshift(prop === 'scale' ? 1 : 0);
95
+ if (stops.length === 1) {
96
+ stops.unshift(prop === 'scale' ? 1 : 0);
97
97
  }
98
98
 
99
- steps = parseSteps(steps, transformFn);
99
+ stops = parseStops(stops, transformFn);
100
100
 
101
101
  return (css, percent) => {
102
- css.transform += ` ${prop}(${getValue(steps, percent)}${unit})`;
102
+ css.transform += ` ${prop}(${getValue(stops, percent)}${unit})`;
103
103
  };
104
104
  }
105
105
 
106
- function colorFn(prop, el, steps) {
107
- if (steps.length === 1) {
108
- steps.unshift(getCssValue(el, prop, ''));
106
+ function colorFn(prop, el, stops) {
107
+ if (stops.length === 1) {
108
+ stops.unshift(getCssValue(el, prop, ''));
109
109
  }
110
110
 
111
- steps = parseSteps(steps, (step) => parseColor(el, step));
111
+ stops = parseStops(stops, (stop) => parseColor(el, stop));
112
112
 
113
113
  return (css, percent) => {
114
- const [start, end, p] = getStep(steps, percent);
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, steps) {
135
- if (steps.length === 1) {
136
- steps.unshift(0);
134
+ function filterFn(prop, el, stops) {
135
+ if (stops.length === 1) {
136
+ stops.unshift(0);
137
137
  }
138
138
 
139
- const unit = getUnit(steps) || { blur: 'px', hue: 'deg' }[prop] || '%';
139
+ const unit = getUnit(stops) || { blur: 'px', hue: 'deg' }[prop] || '%';
140
140
  prop = { fopacity: 'opacity', hue: 'hue-rotate' }[prop] || prop;
141
- steps = parseSteps(steps);
141
+ stops = parseStops(stops);
142
142
 
143
143
  return (css, percent) => {
144
- const value = getValue(steps, percent);
144
+ const value = getValue(stops, percent);
145
145
  css.filter += ` ${prop}(${value + unit})`;
146
146
  };
147
147
  }
148
148
 
149
- function cssPropFn(prop, el, steps) {
150
- if (steps.length === 1) {
151
- steps.unshift(getCssValue(el, prop, ''));
149
+ function cssPropFn(prop, el, stops) {
150
+ if (stops.length === 1) {
151
+ stops.unshift(getCssValue(el, prop, ''));
152
152
  }
153
153
 
154
- steps = parseSteps(steps);
154
+ stops = parseStops(stops);
155
155
 
156
156
  return (css, percent) => {
157
- css[prop] = getValue(steps, percent);
157
+ css[prop] = getValue(stops, percent);
158
158
  };
159
159
  }
160
160
 
161
- function strokeFn(prop, el, steps) {
162
- if (steps.length === 1) {
163
- steps.unshift(0);
161
+ function strokeFn(prop, el, stops) {
162
+ if (stops.length === 1) {
163
+ stops.unshift(0);
164
164
  }
165
165
 
166
- const unit = getUnit(steps);
166
+ const unit = getUnit(stops);
167
167
  const length = getMaxPathLength(el);
168
- steps = parseSteps(steps.reverse(), (step) => {
169
- step = toFloat(step);
170
- return unit === '%' ? (step * length) / 100 : step;
168
+ stops = parseStops(stops.reverse(), (stop) => {
169
+ stop = toFloat(stop);
170
+ return unit === '%' ? (stop * length) / 100 : stop;
171
171
  });
172
172
 
173
- if (!steps.some(([value]) => value)) {
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(steps, percent);
180
+ css.strokeDashoffset = getValue(stops, percent);
181
181
  };
182
182
  }
183
183
 
184
- function backgroundFn(prop, el, steps) {
185
- if (steps.length === 1) {
186
- steps.unshift(0);
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
- steps = parseSteps(steps, (step) => toPx(step, attr, el));
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, steps, bgPos, attr)
197
- : setBackgroundPosFn(prop, steps, bgPos);
196
+ ? backgroundCoverFn(prop, el, stops, bgPos, attr)
197
+ : setBackgroundPosFn(prop, stops, bgPos);
198
198
  }
199
199
 
200
- function backgroundCoverFn(prop, el, steps, bgPos, attr) {
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 = steps.map(([value]) => value);
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, steps, `${pos}px`);
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, steps, pos) {
243
+ function setBackgroundPosFn(prop, stops, pos) {
244
244
  return function (css, percent) {
245
- css[`background-position-${prop}`] = `calc(${pos} + ${getValue(steps, percent)}px)`;
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 parseSteps(steps, fn = toFloat) {
280
+ function parseStops(stops, fn = toFloat) {
281
281
  const result = [];
282
- const { length } = steps;
282
+ const { length } = stops;
283
283
  let nullIndex = 0;
284
284
  for (let i = 0; i < length; i++) {
285
- let [value, percent] = isString(steps[i]) ? steps[i].trim().split(' ') : [steps[i]];
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 getStep(steps, percent) {
323
- const index = findIndex(steps.slice(1), ([, targetPercent]) => percent <= targetPercent) + 1;
322
+ function getStop(stops, percent) {
323
+ const index = findIndex(stops.slice(1), ([, targetPercent]) => percent <= targetPercent) + 1;
324
324
  return [
325
- steps[index - 1][0],
326
- steps[index][0],
327
- (percent - steps[index - 1][1]) / (steps[index][1] - steps[index - 1][1]),
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(steps, percent) {
332
- const [start, end, p] = getStep(steps, percent);
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+([^\s]*)/;
337
- function getUnit(steps, defaultUnit) {
338
- for (const step of steps) {
339
- const match = step.match?.(unitRe);
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
  }
@@ -60,7 +60,7 @@ export default {
60
60
  attach,
61
61
  offset,
62
62
  boundary,
63
- viewportPadding: this.viewportPadding,
63
+ viewportPadding: this.boundaryAlign ? 0 : this.viewportPadding,
64
64
  flip: this.flip,
65
65
  });
66
66
  },
@@ -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>
@@ -35,27 +35,27 @@
35
35
  </div>
36
36
  </div>
37
37
 
38
- <h2>Start and End Steps</h2>
38
+ <h2>Start and End Stops</h2>
39
39
 
40
- <div id="test-start-end-steps" 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">
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 Steps</h2>
47
+ <h2>Multiple Stops</h2>
48
48
 
49
- <div id="test-multiple-steps" 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">
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>Step Positions</h2>
56
+ <h2>Stop Positions</h2>
57
57
 
58
- <div id="test-step-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">
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 steps by using a comma separated list of values. (e.g. x: 0,50,150). A step can be defined by a value and a position. If you don't specify the position of a step, it is placed halfway between the one that precedes it and the one that follows it.</p>
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">