uikit 3.16.4-dev.fd2458e3b → 3.16.5-dev.dda1f1b31

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 (120) hide show
  1. package/.eslintrc.json +1 -0
  2. package/CHANGELOG.md +9 -1
  3. package/build/build.js +5 -4
  4. package/build/icons.js +2 -1
  5. package/build/less.js +2 -11
  6. package/build/prefix.js +2 -1
  7. package/build/release.js +4 -3
  8. package/build/scope.js +2 -1
  9. package/build/scss.js +2 -1
  10. package/build/util.js +3 -3
  11. package/dist/css/uikit-core-rtl.css +1 -1
  12. package/dist/css/uikit-core-rtl.min.css +1 -1
  13. package/dist/css/uikit-core.css +1 -1
  14. package/dist/css/uikit-core.min.css +1 -1
  15. package/dist/css/uikit-rtl.css +1 -1
  16. package/dist/css/uikit-rtl.min.css +1 -1
  17. package/dist/css/uikit.css +1 -1
  18. package/dist/css/uikit.min.css +1 -1
  19. package/dist/js/components/countdown.js +12 -14
  20. package/dist/js/components/countdown.min.js +1 -1
  21. package/dist/js/components/filter.js +506 -22
  22. package/dist/js/components/filter.min.js +1 -1
  23. package/dist/js/components/lightbox-panel.js +2601 -310
  24. package/dist/js/components/lightbox-panel.min.js +1 -1
  25. package/dist/js/components/lightbox.js +2612 -323
  26. package/dist/js/components/lightbox.min.js +1 -1
  27. package/dist/js/components/notification.js +1 -1
  28. package/dist/js/components/notification.min.js +1 -1
  29. package/dist/js/components/parallax.js +466 -43
  30. package/dist/js/components/parallax.min.js +1 -1
  31. package/dist/js/components/slider-parallax.js +184 -2
  32. package/dist/js/components/slider-parallax.min.js +1 -1
  33. package/dist/js/components/slider.js +2345 -49
  34. package/dist/js/components/slider.min.js +1 -1
  35. package/dist/js/components/slideshow-parallax.js +184 -2
  36. package/dist/js/components/slideshow-parallax.min.js +1 -1
  37. package/dist/js/components/slideshow.js +2339 -49
  38. package/dist/js/components/slideshow.min.js +1 -1
  39. package/dist/js/components/sortable.js +472 -1
  40. package/dist/js/components/sortable.min.js +1 -1
  41. package/dist/js/components/tooltip.js +2298 -11
  42. package/dist/js/components/tooltip.min.js +1 -1
  43. package/dist/js/components/upload.js +1 -1
  44. package/dist/js/components/upload.min.js +1 -1
  45. package/dist/js/uikit-core.js +951 -931
  46. package/dist/js/uikit-core.min.js +1 -1
  47. package/dist/js/uikit-icons.js +153 -152
  48. package/dist/js/uikit-icons.min.js +1 -1
  49. package/dist/js/uikit.js +979 -954
  50. package/dist/js/uikit.min.js +1 -1
  51. package/package.json +2 -2
  52. package/src/images/icons/mastodon.svg +3 -0
  53. package/src/js/api/app.js +12 -0
  54. package/src/js/api/boot.js +64 -43
  55. package/src/js/api/component.js +60 -61
  56. package/src/js/api/computed.js +39 -0
  57. package/src/js/api/events.js +45 -0
  58. package/src/js/api/global.js +58 -56
  59. package/src/js/api/hooks.js +35 -114
  60. package/src/js/api/index.js +8 -24
  61. package/src/js/api/instance.js +55 -55
  62. package/src/js/api/log.js +10 -0
  63. package/src/js/api/observables.js +125 -0
  64. package/src/js/api/observer.js +76 -0
  65. package/src/js/{util → api}/options.js +38 -1
  66. package/src/js/api/props.js +102 -0
  67. package/src/js/api/state.js +26 -280
  68. package/src/js/api/update.js +77 -0
  69. package/src/js/api/watch.js +34 -0
  70. package/src/js/components/countdown.js +14 -16
  71. package/src/js/components/filter.js +18 -24
  72. package/src/js/components/internal/slider-preload.js +5 -6
  73. package/src/js/components/lightbox-panel.js +1 -1
  74. package/src/js/components/lightbox.js +11 -23
  75. package/src/js/components/parallax.js +8 -6
  76. package/src/js/components/slider.js +10 -0
  77. package/src/js/components/tooltip.js +2 -1
  78. package/src/js/core/accordion.js +5 -6
  79. package/src/js/core/cover.js +9 -9
  80. package/src/js/core/drop.js +13 -6
  81. package/src/js/core/dropnav.js +1 -1
  82. package/src/js/core/grid.js +2 -5
  83. package/src/js/core/height-match.js +9 -16
  84. package/src/js/core/height-viewport.js +5 -7
  85. package/src/js/core/img.js +12 -19
  86. package/src/js/core/leader.js +4 -2
  87. package/src/js/core/margin.js +11 -21
  88. package/src/js/core/modal.js +1 -1
  89. package/src/js/core/offcanvas.js +6 -2
  90. package/src/js/core/overflow-auto.js +5 -5
  91. package/src/js/core/responsive.js +5 -7
  92. package/src/js/core/scroll.js +19 -10
  93. package/src/js/core/scrollspy-nav.js +6 -5
  94. package/src/js/core/scrollspy.js +27 -36
  95. package/src/js/core/sticky.js +12 -10
  96. package/src/js/core/svg.js +4 -2
  97. package/src/js/core/switcher.js +11 -9
  98. package/src/js/core/toggle.js +4 -4
  99. package/src/js/core/video.js +6 -14
  100. package/src/js/mixin/modal.js +2 -1
  101. package/src/js/mixin/parallax.js +1 -1
  102. package/src/js/mixin/slider-nav.js +2 -1
  103. package/src/js/mixin/slider.js +9 -3
  104. package/src/js/util/filter.js +13 -0
  105. package/src/js/util/index.js +0 -1
  106. package/src/js/util/keys.js +11 -0
  107. package/src/js/util/lang.js +7 -7
  108. package/src/js/util/observer.js +4 -2
  109. package/src/js/util/scroll.js +42 -0
  110. package/src/js/util/svg.js +16 -0
  111. package/src/js/util/viewport.js +1 -1
  112. package/src/scss/mixins-theme.scss +1640 -1596
  113. package/src/scss/mixins.scss +1370 -1370
  114. package/src/scss/variables-theme.scss +1255 -1255
  115. package/src/scss/variables.scss +1113 -1113
  116. package/src/js/mixin/lazyload.js +0 -27
  117. package/src/js/mixin/resize.js +0 -11
  118. package/src/js/mixin/scroll.js +0 -32
  119. package/src/js/mixin/swipe.js +0 -72
  120. package/src/js/mixin/utils.js +0 -91
@@ -1,242 +1,44 @@
1
- import {
2
- assign,
3
- camelize,
4
- data as getData,
5
- hasOwn,
6
- hyphenate,
7
- isArray,
8
- isFunction,
9
- isNumeric,
10
- isPlainObject,
11
- isString,
12
- isUndefined,
13
- mergeOptions,
14
- on,
15
- parseOptions,
16
- startsWith,
17
- toBoolean,
18
- toNumber,
19
- } from 'uikit-util';
1
+ import { callHook } from './hooks';
2
+ import { initComputed } from './computed';
3
+ import { coerce, mergeOptions } from './options';
4
+ import { assign, isArray, isPlainObject, isUndefined } from '../util';
20
5
 
21
- export default function (UIkit) {
22
- let uid = 0;
6
+ let uid = 0;
23
7
 
24
- UIkit.prototype._init = function (options) {
25
- options = options || {};
26
- options.data = normalizeData(options, this.constructor.options);
8
+ export function init(instance, options = {}) {
9
+ options.data = normalizeData(options, instance.constructor.options);
27
10
 
28
- this.$options = mergeOptions(this.constructor.options, options, this);
29
- this.$el = null;
30
- this.$props = {};
11
+ instance.$options = mergeOptions(instance.constructor.options, options, instance);
31
12
 
32
- this._uid = uid++;
33
- this._initData();
34
- this._initMethods();
35
- this._initComputeds();
36
- this._callHook('created');
13
+ instance.$props = {};
37
14
 
38
- if (options.el) {
39
- this.$mount(options.el);
40
- }
41
- };
42
-
43
- UIkit.prototype._initData = function () {
44
- const { data = {} } = this.$options;
45
-
46
- for (const key in data) {
47
- this.$props[key] = this[key] = data[key];
48
- }
49
- };
50
-
51
- UIkit.prototype._initMethods = function () {
52
- const { methods } = this.$options;
53
-
54
- if (methods) {
55
- for (const key in methods) {
56
- this[key] = methods[key].bind(this);
57
- }
58
- }
59
- };
60
-
61
- UIkit.prototype._initComputeds = function () {
62
- const { computed } = this.$options;
63
-
64
- this._computed = {};
65
-
66
- if (computed) {
67
- for (const key in computed) {
68
- registerComputed(this, key, computed[key]);
69
- }
70
- }
71
- };
72
-
73
- UIkit.prototype._initProps = function (props) {
74
- let key;
75
-
76
- props = props || getProps(this.$options);
77
-
78
- for (key in props) {
79
- if (!isUndefined(props[key])) {
80
- this.$props[key] = props[key];
81
- }
82
- }
83
-
84
- const exclude = [this.$options.computed, this.$options.methods];
85
- for (key in this.$props) {
86
- if (key in props && notIn(exclude, key)) {
87
- this[key] = this.$props[key];
88
- }
89
- }
90
- };
91
-
92
- UIkit.prototype._initEvents = function () {
93
- this._events = [];
94
- for (const event of this.$options.events || []) {
95
- if (hasOwn(event, 'handler')) {
96
- registerEvent(this, event);
97
- } else {
98
- for (const key in event) {
99
- registerEvent(this, event[key], key);
100
- }
101
- }
102
- }
103
- };
104
-
105
- UIkit.prototype._unbindEvents = function () {
106
- this._events.forEach((unbind) => unbind());
107
- delete this._events;
108
- };
109
-
110
- UIkit.prototype._initObservers = function () {
111
- this._observers = [initPropsObserver(this), initChildListObserver(this)];
112
- };
113
-
114
- UIkit.prototype.registerObserver = function (...observer) {
115
- this._observers.push(...observer);
116
- };
117
-
118
- UIkit.prototype._disconnectObservers = function () {
119
- this._observers.forEach((observer) => observer?.disconnect());
120
- };
121
- }
122
-
123
- function getProps(opts) {
124
- const data = {};
125
- const { args = [], props = {}, el, id } = opts;
126
-
127
- if (!props) {
128
- return data;
129
- }
130
-
131
- for (const key in props) {
132
- const prop = hyphenate(key);
133
- let value = getData(el, prop);
134
-
135
- if (isUndefined(value)) {
136
- continue;
137
- }
138
-
139
- value = props[key] === Boolean && value === '' ? true : coerce(props[key], value);
140
-
141
- if (prop === 'target' && startsWith(value, '_')) {
142
- continue;
143
- }
144
-
145
- data[key] = value;
146
- }
147
-
148
- const options = parseOptions(getData(el, id), args);
15
+ instance._uid = uid++;
16
+ initData(instance);
17
+ initMethods(instance);
18
+ initComputed(instance);
19
+ callHook(instance, 'created');
149
20
 
150
- for (const key in options) {
151
- const prop = camelize(key);
152
- if (!isUndefined(props[prop])) {
153
- data[prop] = coerce(props[prop], options[key]);
154
- }
21
+ if (options.el) {
22
+ instance.$mount(options.el);
155
23
  }
156
-
157
- return data;
158
24
  }
159
25
 
160
- function registerComputed(component, key, cb) {
161
- Object.defineProperty(component, key, {
162
- enumerable: true,
163
-
164
- get() {
165
- const { _computed, $props, $el } = component;
166
-
167
- if (!hasOwn(_computed, key)) {
168
- _computed[key] = (cb.get || cb).call(component, $props, $el);
169
- }
26
+ function initData(instance) {
27
+ const { data = {} } = instance.$options;
170
28
 
171
- return _computed[key];
172
- },
173
-
174
- set(value) {
175
- const { _computed } = component;
176
-
177
- _computed[key] = cb.set ? cb.set.call(component, value) : value;
178
-
179
- if (isUndefined(_computed[key])) {
180
- delete _computed[key];
181
- }
182
- },
183
- });
184
- }
185
-
186
- export function registerEvent(component, event, key) {
187
- if (!isPlainObject(event)) {
188
- event = { name: key, handler: event };
189
- }
190
-
191
- let { name, el, handler, capture, passive, delegate, filter, self } = event;
192
- el = isFunction(el) ? el.call(component) : el || component.$el;
193
-
194
- if (isArray(el)) {
195
- el.forEach((el) => registerEvent(component, { ...event, el }, key));
196
- return;
197
- }
198
-
199
- if (!el || (filter && !filter.call(component))) {
200
- return;
29
+ for (const key in data) {
30
+ instance.$props[key] = instance[key] = data[key];
201
31
  }
202
-
203
- component._events.push(
204
- on(
205
- el,
206
- name,
207
- delegate ? (isString(delegate) ? delegate : delegate.call(component)) : null,
208
- isString(handler) ? component[handler] : handler.bind(component),
209
- { passive, capture, self }
210
- )
211
- );
212
32
  }
213
33
 
214
- function notIn(options, key) {
215
- return options.every((arr) => !arr || !hasOwn(arr, key));
216
- }
34
+ function initMethods(instance) {
35
+ const { methods } = instance.$options;
217
36
 
218
- function coerce(type, value) {
219
- if (type === Boolean) {
220
- return toBoolean(value);
221
- } else if (type === Number) {
222
- return toNumber(value);
223
- } else if (type === 'list') {
224
- return toList(value);
225
- } else if (type === Object && isString(value)) {
226
- return parseOptions(value);
37
+ if (methods) {
38
+ for (const key in methods) {
39
+ instance[key] = methods[key].bind(instance);
40
+ }
227
41
  }
228
-
229
- return type ? type(value) : value;
230
- }
231
-
232
- function toList(value) {
233
- return isArray(value)
234
- ? value
235
- : isString(value)
236
- ? value
237
- .split(/,(?![^(]*\))/)
238
- .map((value) => (isNumeric(value) ? toNumber(value) : toBoolean(value.trim())))
239
- : [value];
240
42
  }
241
43
 
242
44
  function normalizeData({ data = {} }, { args = [], props = {} }) {
@@ -261,59 +63,3 @@ function normalizeData({ data = {} }, { args = [], props = {} }) {
261
63
 
262
64
  return data;
263
65
  }
264
-
265
- function initChildListObserver(component) {
266
- let { el, computed } = component.$options;
267
-
268
- if (!computed) {
269
- return;
270
- }
271
-
272
- for (const key in computed) {
273
- if (computed[key].document) {
274
- el = el.ownerDocument;
275
- break;
276
- }
277
- }
278
-
279
- const observer = new MutationObserver(() => component._callWatches());
280
- observer.observe(el, {
281
- childList: true,
282
- subtree: true,
283
- });
284
-
285
- return observer;
286
- }
287
-
288
- function initPropsObserver(component) {
289
- const { $options, $props } = component;
290
- const { id, attrs, props, el } = $options;
291
-
292
- if (!props || attrs === false) {
293
- return;
294
- }
295
-
296
- const attributes = isArray(attrs) ? attrs : Object.keys(props);
297
- const filter = attributes.map((key) => hyphenate(key)).concat(id);
298
-
299
- const observer = new MutationObserver((records) => {
300
- const data = getProps($options);
301
- if (
302
- records.some(({ attributeName }) => {
303
- const prop = attributeName.replace('data-', '');
304
- return (prop === id ? attributes : [camelize(prop), camelize(attributeName)]).some(
305
- (prop) => !isUndefined(data[prop]) && data[prop] !== $props[prop]
306
- );
307
- })
308
- ) {
309
- component.$reset();
310
- }
311
- });
312
-
313
- observer.observe(el, {
314
- attributes: true,
315
- attributeFilter: filter.concat(filter.map((key) => `data-${key}`)),
316
- });
317
-
318
- return observer;
319
- }
@@ -0,0 +1,77 @@
1
+ import { registerObserver } from './observer';
2
+ import { callWatches } from './watch';
3
+ import { assign, fastdom, isFunction, isPlainObject } from '../util';
4
+
5
+ export function callUpdate(instance, e = 'update') {
6
+ if (!instance._connected) {
7
+ return;
8
+ }
9
+
10
+ if (e === 'update' || e === 'resize') {
11
+ callWatches(instance);
12
+ }
13
+
14
+ if (!instance.$options.update) {
15
+ return;
16
+ }
17
+
18
+ if (!instance._updates) {
19
+ instance._updates = new Set();
20
+ fastdom.read(() => {
21
+ if (instance._connected) {
22
+ runUpdates(instance, instance._updates);
23
+ }
24
+ delete instance._updates;
25
+ });
26
+ }
27
+
28
+ instance._updates.add(e.type || e);
29
+ }
30
+
31
+ function runUpdates(instance, types) {
32
+ for (const { read, write, events = [] } of instance.$options.update) {
33
+ if (!types.has('update') && !events.some((type) => types.has(type))) {
34
+ continue;
35
+ }
36
+
37
+ let result;
38
+ if (read) {
39
+ result = read.call(instance, instance._data, types);
40
+
41
+ if (result && isPlainObject(result)) {
42
+ assign(instance._data, result);
43
+ }
44
+ }
45
+
46
+ if (write && result !== false) {
47
+ fastdom.write(() => {
48
+ if (instance._connected) {
49
+ write.call(instance, instance._data, types);
50
+ }
51
+ });
52
+ }
53
+ }
54
+ }
55
+
56
+ export function initUpdateObserver(instance) {
57
+ let { el, computed, observe } = instance.$options;
58
+
59
+ if (!computed && !observe?.some((options) => isFunction(options.target))) {
60
+ return;
61
+ }
62
+
63
+ for (const key in computed || {}) {
64
+ if (computed[key].document) {
65
+ el = el.ownerDocument;
66
+ break;
67
+ }
68
+ }
69
+
70
+ const observer = new MutationObserver(() => callWatches(instance));
71
+ observer.observe(el, {
72
+ childList: true,
73
+ subtree: true,
74
+ });
75
+
76
+ registerObserver(instance, observer);
77
+ }
@@ -0,0 +1,34 @@
1
+ import { fastdom, hasOwn, isEqual } from '../util';
2
+ import { callObserverUpdates } from './observer';
3
+
4
+ export function callWatches(instance) {
5
+ if (instance._watch) {
6
+ return;
7
+ }
8
+
9
+ const initial = !hasOwn(instance, '_watch');
10
+
11
+ instance._watch = fastdom.read(() => {
12
+ if (instance._connected) {
13
+ runWatches(instance, initial);
14
+ }
15
+ instance._watch = null;
16
+ });
17
+ }
18
+
19
+ function runWatches(instance, initial) {
20
+ const values = { ...instance._computed };
21
+ instance._computed = {};
22
+
23
+ for (const [key, { watch, immediate }] of Object.entries(instance.$options.computed || {})) {
24
+ if (
25
+ watch &&
26
+ ((initial && immediate) ||
27
+ (hasOwn(values, key) && !isEqual(values[key], instance[key])))
28
+ ) {
29
+ watch.call(instance, instance[key], initial ? undefined : values[key]);
30
+ }
31
+ }
32
+
33
+ callObserverUpdates(instance);
34
+ }
@@ -29,23 +29,21 @@ export default {
29
29
  this.stop();
30
30
  },
31
31
 
32
- events: [
33
- {
34
- name: 'visibilitychange',
35
-
36
- el() {
37
- return document;
38
- },
39
-
40
- handler() {
41
- if (document.hidden) {
42
- this.stop();
43
- } else {
44
- this.start();
45
- }
46
- },
32
+ events: {
33
+ name: 'visibilitychange',
34
+
35
+ el() {
36
+ return document;
47
37
  },
48
- ],
38
+
39
+ handler() {
40
+ if (document.hidden) {
41
+ this.stop();
42
+ } else {
43
+ this.start();
44
+ }
45
+ },
46
+ },
49
47
 
50
48
  methods: {
51
49
  start() {
@@ -1,4 +1,5 @@
1
1
  import Animate from '../mixin/animate';
2
+ import { parseOptions } from '../api/options';
2
3
  import {
3
4
  $,
4
5
  $$,
@@ -17,11 +18,10 @@ import {
17
18
  isTag,
18
19
  isUndefined,
19
20
  matches,
20
- parseOptions,
21
21
  toggleClass,
22
22
  trigger,
23
23
  } from 'uikit-util';
24
- import { keyMap } from '../mixin/utils';
24
+ import { keyMap } from '../util/keys';
25
25
 
26
26
  export default {
27
27
  mixins: [Animate],
@@ -70,8 +70,8 @@ export default {
70
70
  return $$(`${target} > *`, $el);
71
71
  },
72
72
 
73
- watch(list, old) {
74
- if (old && !isEqualList(list, old)) {
73
+ watch(list, prev) {
74
+ if (prev) {
75
75
  this.updateState();
76
76
  }
77
77
  },
@@ -80,26 +80,24 @@ export default {
80
80
  },
81
81
  },
82
82
 
83
- events: [
84
- {
85
- name: 'click keydown',
83
+ events: {
84
+ name: 'click keydown',
86
85
 
87
- delegate() {
88
- return `[${this.attrItem}],[data-${this.attrItem}]`;
89
- },
86
+ delegate() {
87
+ return `[${this.attrItem}],[data-${this.attrItem}]`;
88
+ },
90
89
 
91
- handler(e) {
92
- if (e.type === 'keydown' && e.keyCode !== keyMap.SPACE) {
93
- return;
94
- }
90
+ handler(e) {
91
+ if (e.type === 'keydown' && e.keyCode !== keyMap.SPACE) {
92
+ return;
93
+ }
95
94
 
96
- if (closest(e.target, 'a,button')) {
97
- e.preventDefault();
98
- this.apply(e.current);
99
- }
100
- },
95
+ if (closest(e.target, 'a,button')) {
96
+ e.preventDefault();
97
+ this.apply(e.current);
98
+ }
101
99
  },
102
- ],
100
+ },
103
101
 
104
102
  methods: {
105
103
  apply(el) {
@@ -211,10 +209,6 @@ function matchFilter(
211
209
  : stateSort === sort && stateOrder === order;
212
210
  }
213
211
 
214
- function isEqualList(listA, listB) {
215
- return listA.length === listB.length && listA.every((el) => listB.includes(el));
216
- }
217
-
218
212
  function getSelector({ filter }) {
219
213
  let selector = '';
220
214
  each(filter, (value) => (selector += value || ''));
@@ -1,9 +1,8 @@
1
- import Lazyload from '../../mixin/lazyload';
1
+ import { lazyload } from '../../api/observables';
2
2
 
3
3
  export default {
4
- mixins: [Lazyload],
5
-
6
- connected() {
7
- this.lazyload(this.slides, this.getAdjacentSlides);
8
- },
4
+ observe: lazyload({
5
+ target: ({ slides }) => slides,
6
+ targets: (instance) => instance.getAdjacentSlides(),
7
+ }),
9
8
  };
@@ -1,7 +1,7 @@
1
- import { keyMap } from '../mixin/utils';
2
1
  import Animations from './internal/lightbox-animations';
3
2
  import Modal from '../mixin/modal';
4
3
  import Slideshow from '../mixin/slideshow';
4
+ import { keyMap } from '../util/keys';
5
5
  import {
6
6
  $,
7
7
  addClass,
@@ -1,16 +1,6 @@
1
1
  import LightboxPanel from './lightbox-panel';
2
- import {
3
- $$,
4
- assign,
5
- attr,
6
- data,
7
- findIndex,
8
- isElement,
9
- isTag,
10
- on,
11
- parseOptions,
12
- uniqueBy,
13
- } from 'uikit-util';
2
+ import { parseOptions } from '../api/options';
3
+ import { $$, assign, attr, data, findIndex, isElement, isTag, on, uniqueBy } from 'uikit-util';
14
4
 
15
5
  export default {
16
6
  install,
@@ -42,20 +32,18 @@ export default {
42
32
  this.hide();
43
33
  },
44
34
 
45
- events: [
46
- {
47
- name: 'click',
35
+ events: {
36
+ name: 'click',
48
37
 
49
- delegate() {
50
- return `${this.toggle}:not(.uk-disabled)`;
51
- },
38
+ delegate() {
39
+ return `${this.toggle}:not(.uk-disabled)`;
40
+ },
52
41
 
53
- handler(e) {
54
- e.preventDefault();
55
- this.show(e.current);
56
- },
42
+ handler(e) {
43
+ e.preventDefault();
44
+ this.show(e.current);
57
45
  },
58
- ],
46
+ },
59
47
 
60
48
  methods: {
61
49
  show(index) {
@@ -1,10 +1,9 @@
1
- import Resize from '../mixin/resize';
2
- import Scroll from '../mixin/scroll';
3
1
  import Parallax from '../mixin/parallax';
2
+ import { resize, scroll } from '../api/observables';
4
3
  import { css, isVisible, parent, query, scrolledOver, toPx } from 'uikit-util';
5
4
 
6
5
  export default {
7
- mixins: [Parallax, Resize, Scroll],
6
+ mixins: [Parallax],
8
7
 
9
8
  props: {
10
9
  target: String,
@@ -41,9 +40,12 @@ export default {
41
40
  },
42
41
  },
43
42
 
44
- resizeTargets() {
45
- return [this.$el, this.target];
46
- },
43
+ observe: [
44
+ resize({
45
+ target: ({ $el, target }) => [$el, target],
46
+ }),
47
+ scroll(),
48
+ ],
47
49
 
48
50
  update: {
49
51
  read({ percent }, types) {
@@ -1,4 +1,5 @@
1
1
  import Class from '../mixin/class';
2
+ import { resize } from '../api/observables';
2
3
  import Slider, { speedUp } from '../mixin/slider';
3
4
  import SliderReactive from '../mixin/slider-reactive';
4
5
  import SliderPreload from './internal/slider-preload';
@@ -15,6 +16,7 @@ import {
15
16
  findIndex,
16
17
  getIndex,
17
18
  includes,
19
+ isVisible,
18
20
  last,
19
21
  selFocusable,
20
22
  sumBy,
@@ -113,12 +115,20 @@ export default {
113
115
  list: this.list,
114
116
  };
115
117
  },
118
+
119
+ slides() {
120
+ return children(this.list).filter(isVisible);
121
+ },
116
122
  },
117
123
 
118
124
  connected() {
119
125
  toggleClass(this.$el, this.clsContainer, !$(`.${this.clsContainer}`, this.$el));
120
126
  },
121
127
 
128
+ observe: resize({
129
+ target: ({ slides }) => slides,
130
+ }),
131
+
122
132
  update: {
123
133
  write() {
124
134
  for (const el of this.navItems) {