@mozaic-ds/vue 0.37.0 → 0.37.1-beta.0
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/dist/mozaic-vue.adeo.css +11 -10
- package/dist/mozaic-vue.adeo.umd.js +871 -541
- package/dist/mozaic-vue.common.js +871 -541
- package/dist/mozaic-vue.common.js.map +1 -1
- package/dist/mozaic-vue.css +1 -1
- package/dist/mozaic-vue.umd.js +871 -541
- package/dist/mozaic-vue.umd.js.map +1 -1
- package/dist/mozaic-vue.umd.min.js +2 -2
- package/dist/mozaic-vue.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/header/index.js +1 -1
- package/src/components/index.js +2 -0
- package/src/index.js +2 -1
- package/types/index.d.ts +4 -0
- package/src/components/header/composable/useScrollDirection.js +0 -61
package/package.json
CHANGED
package/src/components/index.js
CHANGED
|
@@ -15,8 +15,10 @@ export { MField } from './field';
|
|
|
15
15
|
export { MDropdown } from './dropdown';
|
|
16
16
|
export { MFileUploader } from './fileuploader';
|
|
17
17
|
export { MFlag } from './flag';
|
|
18
|
+
export { MHeader } from './header';
|
|
18
19
|
export { MHero } from './hero';
|
|
19
20
|
export { MIcon } from './icon';
|
|
21
|
+
export { MKpi } from './kpi';
|
|
20
22
|
export { MLayer } from './layer';
|
|
21
23
|
export { MLink } from './link';
|
|
22
24
|
export { MListBox, MListBoxActions } from './listbox';
|
package/src/index.js
CHANGED
|
@@ -34,8 +34,10 @@ export { MField } from './components/field';
|
|
|
34
34
|
export { MDropdown } from './components/dropdown';
|
|
35
35
|
export { MFileUploader } from './components/fileuploader';
|
|
36
36
|
export { MFlag } from './components/flag';
|
|
37
|
+
export { MHeader } from './components/header';
|
|
37
38
|
export { MHero } from './components/hero';
|
|
38
39
|
export { MIcon } from './components/icon';
|
|
40
|
+
export { MKpi } from './components/kpi';
|
|
39
41
|
export { MLayer } from './components/layer';
|
|
40
42
|
export { MLink } from './components/link';
|
|
41
43
|
export { MListBox, MListBoxActions } from './components/listbox';
|
|
@@ -61,4 +63,3 @@ export { MTextArea } from './components/textarea';
|
|
|
61
63
|
export { MTextInput } from './components/textinput';
|
|
62
64
|
export { MToggle } from './components/toggle';
|
|
63
65
|
export { MTooltip } from './components/tooltip';
|
|
64
|
-
export { MKpi } from './components/kpi';
|
package/types/index.d.ts
CHANGED
|
@@ -19,9 +19,11 @@ declare module '@mozaic-ds/vue' {
|
|
|
19
19
|
const MDropdown: VueConstructor;
|
|
20
20
|
const MField: VueConstructor;
|
|
21
21
|
const MFileUploader: VueConstructor;
|
|
22
|
+
const MHeader: VueConstructor;
|
|
22
23
|
const MFlag: VueConstructor;
|
|
23
24
|
const MHero: VueConstructor;
|
|
24
25
|
const MIcon: VueConstructor;
|
|
26
|
+
const MKpi: VueConstructor;
|
|
25
27
|
const MLayer: VueConstructor;
|
|
26
28
|
const MLink: VueConstructor;
|
|
27
29
|
const MListBox: VueConstructor;
|
|
@@ -68,9 +70,11 @@ declare module '@mozaic-ds/vue' {
|
|
|
68
70
|
MDropdown,
|
|
69
71
|
MField,
|
|
70
72
|
MFileUploader,
|
|
73
|
+
MHeader,
|
|
71
74
|
MFlag,
|
|
72
75
|
MHero,
|
|
73
76
|
MIcon,
|
|
77
|
+
MKpi,
|
|
74
78
|
MLayer,
|
|
75
79
|
MLink,
|
|
76
80
|
MListBox,
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { unrefElement } from '@vueuse/core';
|
|
2
|
-
import { computed, onBeforeUnmount, reactive, watch } from 'vue';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Get information about scrolling animation.
|
|
6
|
-
* @param header @type {Ref<HTMLElement | undefined>} The header element ref.
|
|
7
|
-
* @param isAnimate @type {Ref<boolean>} The computed property indicate if animation is active.
|
|
8
|
-
* @returns Information about scrolling.
|
|
9
|
-
*/
|
|
10
|
-
export function useScrollDirection(header, isAnimate) {
|
|
11
|
-
let originalScrollPos = 0;
|
|
12
|
-
|
|
13
|
-
const state = reactive({
|
|
14
|
-
direction: undefined
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
const direction = computed(() => state.direction);
|
|
18
|
-
|
|
19
|
-
function onScroll(e) {
|
|
20
|
-
const element = unrefElement(header);
|
|
21
|
-
|
|
22
|
-
if (element) {
|
|
23
|
-
const container = element.parentElement;
|
|
24
|
-
|
|
25
|
-
if (container && e.target === container) {
|
|
26
|
-
const currentScrollPos = container.scrollTop;
|
|
27
|
-
|
|
28
|
-
if (currentScrollPos <= element.offsetHeight) {
|
|
29
|
-
state.direction = undefined;
|
|
30
|
-
} else if (currentScrollPos < originalScrollPos) {
|
|
31
|
-
state.direction = 'up';
|
|
32
|
-
} else {
|
|
33
|
-
state.direction = 'down';
|
|
34
|
-
}
|
|
35
|
-
originalScrollPos = currentScrollPos;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
watch(
|
|
41
|
-
() => isAnimate.value,
|
|
42
|
-
() => {
|
|
43
|
-
if (isAnimate.value) {
|
|
44
|
-
window.addEventListener('scroll', onScroll, { capture: true });
|
|
45
|
-
} else {
|
|
46
|
-
window.removeEventListener('scroll', onScroll, { capture: true });
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
{ immediate: true }
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
onBeforeUnmount(() => {
|
|
53
|
-
if (isAnimate.value) {
|
|
54
|
-
window.removeEventListener('scroll', onScroll, { capture: true });
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
return {
|
|
59
|
-
direction
|
|
60
|
-
};
|
|
61
|
-
}
|