@ulu/frontend-vue 0.5.15 → 0.6.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/components/elements/UluButton.vue.d.ts +4 -0
- package/dist/components/elements/UluButton.vue.d.ts.map +1 -1
- package/dist/components/elements/UluButton.vue.js +31 -16
- package/dist/components/elements/UluIcon.vue.js +21 -36
- package/dist/components/forms/UluFormCheckbox.vue.d.ts +3 -19
- package/dist/components/forms/UluFormCheckbox.vue.d.ts.map +1 -1
- package/dist/components/forms/UluFormCheckbox.vue.js +10 -31
- package/dist/components/forms/UluFormFile.vue.d.ts +3 -25
- package/dist/components/forms/UluFormFile.vue.d.ts.map +1 -1
- package/dist/components/forms/UluFormFile.vue.js +11 -49
- package/dist/components/forms/UluFormItem.vue.d.ts +23 -8
- package/dist/components/forms/UluFormItem.vue.d.ts.map +1 -1
- package/dist/components/forms/UluFormItem.vue.js +126 -29
- package/dist/components/forms/UluFormLabel.vue.d.ts +24 -0
- package/dist/components/forms/UluFormLabel.vue.d.ts.map +1 -0
- package/dist/components/forms/UluFormLabel.vue.js +34 -0
- package/dist/components/forms/UluFormRadio.vue.d.ts +7 -25
- package/dist/components/forms/UluFormRadio.vue.d.ts.map +1 -1
- package/dist/components/forms/UluFormRadio.vue.js +11 -37
- package/dist/components/forms/UluFormSelect.vue.d.ts +7 -23
- package/dist/components/forms/UluFormSelect.vue.d.ts.map +1 -1
- package/dist/components/forms/UluFormSelect.vue.js +24 -43
- package/dist/components/forms/UluFormText.vue.d.ts +5 -23
- package/dist/components/forms/UluFormText.vue.d.ts.map +1 -1
- package/dist/components/forms/UluFormText.vue.js +10 -38
- package/dist/components/forms/UluFormTextarea.vue.d.ts +5 -23
- package/dist/components/forms/UluFormTextarea.vue.d.ts.map +1 -1
- package/dist/components/forms/UluFormTextarea.vue.js +10 -37
- package/dist/components/forms/UluSearchForm.vue.d.ts +24 -3
- package/dist/components/forms/UluSearchForm.vue.d.ts.map +1 -1
- package/dist/components/forms/UluSearchForm.vue.js +67 -22
- package/dist/components/index.d.ts +1 -0
- package/dist/components/systems/facets/UluFacetsFilterSelects.vue.d.ts.map +1 -1
- package/dist/components/systems/facets/UluFacetsFilterSelects.vue.js +21 -22
- package/dist/components/systems/scroll-anchors/UluScrollAnchors.vue.d.ts.map +1 -1
- package/dist/components/systems/scroll-anchors/UluScrollAnchors.vue.js +18 -10
- package/dist/components/systems/scroll-anchors/UluScrollAnchorsNavAnimated.vue.d.ts +8 -2
- package/dist/components/systems/scroll-anchors/UluScrollAnchorsNavAnimated.vue.d.ts.map +1 -1
- package/dist/components/systems/scroll-anchors/UluScrollAnchorsNavAnimated.vue.js +92 -47
- package/dist/components/systems/scroll-anchors/useScrollAnchors.d.ts.map +1 -1
- package/dist/components/systems/scroll-anchors/useScrollAnchors.js +113 -70
- package/dist/components/utils/UluAction.vue.d.ts +2 -0
- package/dist/components/utils/UluAction.vue.d.ts.map +1 -1
- package/dist/components/utils/UluAction.vue.js +9 -5
- package/dist/components/visualizations/UluProgressBar.vue.d.ts +2 -2
- package/dist/index.js +130 -128
- package/dist/plugins/core/index.d.ts.map +1 -1
- package/dist/plugins/core/index.js +17 -16
- package/dist/utils/props.d.ts +7 -0
- package/dist/utils/props.d.ts.map +1 -1
- package/dist/utils/props.js +8 -2
- package/lib/components/elements/UluButton.vue +18 -3
- package/lib/components/elements/UluIcon.vue +8 -26
- package/lib/components/forms/UluForm.vue +25 -25
- package/lib/components/forms/UluFormCheckbox.vue +11 -25
- package/lib/components/forms/UluFormFieldset.vue +6 -6
- package/lib/components/forms/UluFormFile.vue +10 -40
- package/lib/components/forms/UluFormItem.vue +150 -39
- package/lib/components/forms/UluFormLabel.vue +30 -0
- package/lib/components/forms/UluFormRadio.vue +15 -34
- package/lib/components/forms/UluFormSelect.vue +19 -24
- package/lib/components/forms/UluFormText.vue +7 -25
- package/lib/components/forms/UluFormTextarea.vue +7 -25
- package/lib/components/forms/UluSearchForm.vue +67 -19
- package/lib/components/forms/UluSelectableMenu.vue +62 -62
- package/lib/components/index.js +1 -0
- package/lib/components/systems/facets/UluFacetsFilterSelects.vue +11 -14
- package/lib/components/systems/scroll-anchors/UluScrollAnchors.vue +9 -1
- package/lib/components/systems/scroll-anchors/UluScrollAnchorsNavAnimated.vue +95 -16
- package/lib/components/systems/scroll-anchors/_scroll-anchors-nav-animated.scss +12 -1
- package/lib/components/systems/scroll-anchors/useScrollAnchors.js +195 -54
- package/lib/components/utils/UluAction.vue +6 -2
- package/lib/plugins/core/index.js +2 -1
- package/lib/utils/props.js +14 -0
- package/package.json +3 -3
|
@@ -47,6 +47,7 @@ export { default as UluFormActions } from './forms/UluFormActions.vue';
|
|
|
47
47
|
export { default as UluFormCheckbox } from './forms/UluFormCheckbox.vue';
|
|
48
48
|
export { default as UluFormFieldset } from './forms/UluFormFieldset.vue';
|
|
49
49
|
export { default as UluFormItem } from './forms/UluFormItem.vue';
|
|
50
|
+
export { default as UluFormLabel } from './forms/UluFormLabel.vue';
|
|
50
51
|
export { default as UluFormItemsInline } from './forms/UluFormItemsInline.vue';
|
|
51
52
|
export { default as UluFormRadio } from './forms/UluFormRadio.vue';
|
|
52
53
|
export { default as UluFormRequiredChar } from './forms/UluFormRequiredChar.vue';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UluFacetsFilterSelects.vue.d.ts","sourceRoot":"","sources":["../../../../lib/components/systems/facets/UluFacetsFilterSelects.vue"],"names":[],"mappings":"AA0CA;
|
|
1
|
+
{"version":3,"file":"UluFacetsFilterSelects.vue.d.ts","sourceRoot":"","sources":["../../../../lib/components/systems/facets/UluFacetsFilterSelects.vue"],"names":[],"mappings":"AA0CA;wBAyOqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AAZjC;;;;;;;;sPASG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createElementBlock as
|
|
1
|
+
import { createElementBlock as d, openBlock as n, normalizeClass as a, Fragment as m, renderList as _, createElementVNode as i, renderSlot as r, createTextVNode as o, toDisplayString as u } from "vue";
|
|
2
2
|
/* empty css */
|
|
3
|
-
const
|
|
3
|
+
const w = ["for"], S = ["id", "onChange"], $ = { value: "" }, k = ["value", "selected"], F = {
|
|
4
4
|
__name: "UluFacetsFilterSelects",
|
|
5
5
|
props: {
|
|
6
6
|
/**
|
|
@@ -19,10 +19,9 @@ const v = ["for"], w = ["id", "onChange"], S = { value: "" }, $ = ["value", "sel
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
emits: ["facet-change"],
|
|
22
|
-
setup(c, { emit:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
function p(l, f) {
|
|
22
|
+
setup(c, { emit: y }) {
|
|
23
|
+
const b = y;
|
|
24
|
+
function v(l, f) {
|
|
26
25
|
const e = f.target.value;
|
|
27
26
|
l.children.find((s) => s.selected)?.uid !== e && l.children.forEach((s) => {
|
|
28
27
|
const h = s.uid === e;
|
|
@@ -33,45 +32,45 @@ const v = ["for"], w = ["id", "onChange"], S = { value: "" }, $ = ["value", "sel
|
|
|
33
32
|
});
|
|
34
33
|
});
|
|
35
34
|
}
|
|
36
|
-
return (l, f) => (
|
|
35
|
+
return (l, f) => (n(), d("div", {
|
|
37
36
|
class: a(["facets-dropdown-filters", c.classes.container])
|
|
38
37
|
}, [
|
|
39
|
-
(
|
|
38
|
+
(n(!0), d(m, null, _(c.facets, (e) => (n(), d("div", {
|
|
40
39
|
class: a(["facets-dropdown-filters__group", c.classes.group]),
|
|
41
40
|
key: e.uid
|
|
42
41
|
}, [
|
|
43
|
-
|
|
42
|
+
i("label", {
|
|
44
43
|
for: `facet-dropdown-${e.uid}`,
|
|
45
44
|
class: a(["facets-dropdown-filters__label", c.classes.label])
|
|
46
45
|
}, [
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
r(l.$slots, "label", {}, () => [
|
|
47
|
+
o(u(e.name), 1)
|
|
49
48
|
])
|
|
50
|
-
], 10,
|
|
51
|
-
|
|
49
|
+
], 10, w),
|
|
50
|
+
i("select", {
|
|
52
51
|
id: `facet-dropdown-${e.uid}`,
|
|
53
52
|
class: a(["facets-dropdown-filters__select", c.classes.select]),
|
|
54
|
-
onChange: (t) =>
|
|
53
|
+
onChange: (t) => v(e, t)
|
|
55
54
|
}, [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
i("option", $, [
|
|
56
|
+
r(l.$slots, "optionAll", { group: e }, () => [
|
|
57
|
+
o(" All " + u(e.name) + "s ", 1)
|
|
59
58
|
])
|
|
60
59
|
]),
|
|
61
|
-
(
|
|
60
|
+
(n(!0), d(m, null, _(e.children, (t, s) => (n(), d("option", {
|
|
62
61
|
key: t.uid,
|
|
63
62
|
value: t.uid,
|
|
64
63
|
selected: t.selected
|
|
65
64
|
}, [
|
|
66
|
-
|
|
65
|
+
r(l.$slots, "option", {
|
|
67
66
|
group: e,
|
|
68
67
|
option: t,
|
|
69
68
|
index: s
|
|
70
69
|
}, () => [
|
|
71
|
-
|
|
70
|
+
o(u(t.label), 1)
|
|
72
71
|
])
|
|
73
|
-
], 8,
|
|
74
|
-
], 42,
|
|
72
|
+
], 8, k))), 128))
|
|
73
|
+
], 42, S)
|
|
75
74
|
], 2))), 128))
|
|
76
75
|
], 2));
|
|
77
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UluScrollAnchors.vue.d.ts","sourceRoot":"","sources":["../../../../lib/components/systems/scroll-anchors/UluScrollAnchors.vue"],"names":[],"mappings":"AAKA;
|
|
1
|
+
{"version":3,"file":"UluScrollAnchors.vue.d.ts","sourceRoot":"","sources":["../../../../lib/components/systems/scroll-anchors/UluScrollAnchors.vue"],"names":[],"mappings":"AAKA;wBAqMqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AAbjC;;;;;;;mBAUG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as s, provide as
|
|
1
|
+
import { ref as s, provide as l, computed as p, createElementBlock as f, openBlock as m, renderSlot as d } from "vue";
|
|
2
2
|
import { useScrollAnchors as h } from "./useScrollAnchors.js";
|
|
3
3
|
const A = {
|
|
4
4
|
__name: "UluScrollAnchors",
|
|
@@ -33,20 +33,28 @@ const A = {
|
|
|
33
33
|
/**
|
|
34
34
|
* Enable debug logging for the IntersectionObserver
|
|
35
35
|
*/
|
|
36
|
-
debug: Boolean
|
|
36
|
+
debug: Boolean,
|
|
37
|
+
/**
|
|
38
|
+
* If true, the last section will deactivate when scrolling past its bounding box.
|
|
39
|
+
* By default, the last section remains active until the user scrolls back up.
|
|
40
|
+
*/
|
|
41
|
+
deactivateLastItem: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: !1
|
|
44
|
+
}
|
|
37
45
|
},
|
|
38
46
|
emits: ["section-change"],
|
|
39
|
-
setup(
|
|
40
|
-
const
|
|
41
|
-
return h({ sections: e, props:
|
|
47
|
+
setup(c, { emit: r }) {
|
|
48
|
+
const a = c, u = r, e = s([]), n = s(null);
|
|
49
|
+
return h({ sections: e, props: a, emit: u, componentElRef: n }), l("uluScrollAnchorsSections", p(() => e.value)), l("uluScrollAnchorsRegister", (o) => {
|
|
42
50
|
e.value.push(o);
|
|
43
|
-
}),
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
}), (o,
|
|
51
|
+
}), l("uluScrollAnchorsUnregister", (o) => {
|
|
52
|
+
const t = e.value.findIndex((i) => i.id === o);
|
|
53
|
+
t > -1 && e.value.splice(t, 1);
|
|
54
|
+
}), (o, t) => (m(), f("div", {
|
|
47
55
|
class: "scroll-anchors",
|
|
48
56
|
ref_key: "componentEl",
|
|
49
|
-
ref:
|
|
57
|
+
ref: n
|
|
50
58
|
}, [
|
|
51
59
|
d(o.$slots, "default")
|
|
52
60
|
], 512));
|
|
@@ -6,6 +6,9 @@ type __VLS_WithTemplateSlots<T, S> = T & (new () => {
|
|
|
6
6
|
declare const __VLS_component: import('vue').DefineComponent<{}, {
|
|
7
7
|
element: string;
|
|
8
8
|
railWidth: number;
|
|
9
|
+
trimRailToCenters: boolean;
|
|
10
|
+
railStartOffset: number;
|
|
11
|
+
railEndOffset: number;
|
|
9
12
|
indicatorWidth: number;
|
|
10
13
|
indicatorHeight: number;
|
|
11
14
|
indicatorAlignment: string;
|
|
@@ -13,13 +16,16 @@ declare const __VLS_component: import('vue').DefineComponent<{}, {
|
|
|
13
16
|
$props: {
|
|
14
17
|
readonly element?: string | undefined;
|
|
15
18
|
readonly railWidth?: number | undefined;
|
|
19
|
+
readonly trimRailToCenters?: boolean | undefined;
|
|
20
|
+
readonly railStartOffset?: number | undefined;
|
|
21
|
+
readonly railEndOffset?: number | undefined;
|
|
16
22
|
readonly indicatorWidth?: number | undefined;
|
|
17
23
|
readonly indicatorHeight?: number | undefined;
|
|
18
24
|
readonly indicatorAlignment?: string | undefined;
|
|
19
25
|
readonly indicatorAlignmentOffset?: number | undefined;
|
|
20
26
|
};
|
|
21
27
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
22
|
-
|
|
28
|
+
listRef: HTMLUListElement;
|
|
23
29
|
}, any>;
|
|
24
30
|
type __VLS_TemplateResult = {
|
|
25
31
|
attrs: Partial<{}>;
|
|
@@ -30,7 +36,7 @@ type __VLS_TemplateResult = {
|
|
|
30
36
|
}): any;
|
|
31
37
|
};
|
|
32
38
|
refs: {
|
|
33
|
-
|
|
39
|
+
listRef: HTMLUListElement;
|
|
34
40
|
};
|
|
35
41
|
rootEl: any;
|
|
36
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UluScrollAnchorsNavAnimated.vue.d.ts","sourceRoot":"","sources":["../../../../lib/components/systems/scroll-anchors/UluScrollAnchorsNavAnimated.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UluScrollAnchorsNavAnimated.vue.d.ts","sourceRoot":"","sources":["../../../../lib/components/systems/scroll-anchors/UluScrollAnchorsNavAnimated.vue"],"names":[],"mappings":"AAqCA;wBA4eqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AAXjC;;;;;;;;;;;;;;;;;;;;;;;QAQG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { runAfterFramePaint as
|
|
3
|
-
import { useScrollAnchorSections as
|
|
4
|
-
const
|
|
1
|
+
import { ref as c, onMounted as $, onBeforeUnmount as w, computed as N, watch as C, createBlock as z, createCommentVNode as B, unref as p, openBlock as y, resolveDynamicComponent as M, normalizeStyle as g, withCtx as T, createElementVNode as _, createElementBlock as k, Fragment as W, renderList as E, normalizeClass as S, renderSlot as H, createTextVNode as I, toDisplayString as V } from "vue";
|
|
2
|
+
import { runAfterFramePaint as D } from "@ulu/utils/browser/performance.js";
|
|
3
|
+
import { useScrollAnchorSections as F } from "./useScrollAnchorSections.js";
|
|
4
|
+
const L = ["href"], j = {
|
|
5
5
|
__name: "UluScrollAnchorsNavAnimated",
|
|
6
6
|
props: {
|
|
7
7
|
/**
|
|
@@ -18,6 +18,26 @@ const E = { class: "scroll-anchors-nav-animated__rail" }, F = ["href"], P = {
|
|
|
18
18
|
type: Number,
|
|
19
19
|
default: 3
|
|
20
20
|
},
|
|
21
|
+
/**
|
|
22
|
+
* Dynamically trims the rail to span exactly from the center of the first indicator to the center of the last indicator. Disabled by default
|
|
23
|
+
*/
|
|
24
|
+
trimRailToCenters: {
|
|
25
|
+
type: Boolean
|
|
26
|
+
},
|
|
27
|
+
/**
|
|
28
|
+
* Pixel offset for the start (top) of the dynamic rail.
|
|
29
|
+
*/
|
|
30
|
+
railStartOffset: {
|
|
31
|
+
type: Number,
|
|
32
|
+
default: 0
|
|
33
|
+
},
|
|
34
|
+
/**
|
|
35
|
+
* Pixel offset for the end (bottom) of the dynamic rail.
|
|
36
|
+
*/
|
|
37
|
+
railEndOffset: {
|
|
38
|
+
type: Number,
|
|
39
|
+
default: 0
|
|
40
|
+
},
|
|
21
41
|
/**
|
|
22
42
|
* The width of the indicator, defaults to railWidth
|
|
23
43
|
*/
|
|
@@ -48,71 +68,96 @@ const E = { class: "scroll-anchors-nav-animated__rail" }, F = ["href"], P = {
|
|
|
48
68
|
default: 0
|
|
49
69
|
}
|
|
50
70
|
},
|
|
51
|
-
setup(
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
71
|
+
setup(u) {
|
|
72
|
+
const l = u, a = F(), f = c(null), x = c({}), d = c(!1), h = c(0);
|
|
73
|
+
let s = null;
|
|
74
|
+
$(() => {
|
|
75
|
+
f.value && (s = new ResizeObserver(() => {
|
|
76
|
+
h.value++;
|
|
77
|
+
}), s.observe(f.value));
|
|
78
|
+
}), w(() => {
|
|
79
|
+
s && (s.disconnect(), s = null);
|
|
80
|
+
});
|
|
81
|
+
function v(e) {
|
|
82
|
+
const t = x.value[e];
|
|
83
|
+
if (!t) return null;
|
|
84
|
+
const { offsetTop: n, offsetHeight: r } = t, o = l.indicatorHeight != null, R = l.indicatorWidth ?? l.railWidth, b = o ? l.indicatorHeight : r;
|
|
85
|
+
let m = n;
|
|
86
|
+
return l.indicatorAlignment === "center" && (m = n + r / 2 - b / 2), m += l.indicatorAlignmentOffset, { y: m, height: b, width: R };
|
|
87
|
+
}
|
|
88
|
+
const i = N(() => {
|
|
89
|
+
if (h.value, !a || !a.value || !a.value.length)
|
|
57
90
|
return !1;
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
91
|
+
const e = a.value.findIndex((t) => t.active);
|
|
92
|
+
return e === -1 ? !1 : v(e) || !1;
|
|
93
|
+
}), A = N(() => {
|
|
94
|
+
if (h.value, !l.trimRailToCenters) return {};
|
|
95
|
+
if (!a || !a.value || a.value.length < 1) return {};
|
|
96
|
+
const e = v(0), t = v(a.value.length - 1);
|
|
97
|
+
if (!e || !t) return {};
|
|
98
|
+
let n = e.y + e.height / 2, r = t.y + t.height / 2;
|
|
99
|
+
n += l.railStartOffset, r += l.railEndOffset;
|
|
100
|
+
const o = Math.max(0, r - n);
|
|
101
|
+
return {
|
|
102
|
+
"--ulu-sa-nav-rail-top": `${n}px`,
|
|
103
|
+
"--ulu-sa-nav-rail-height": `${o}px`
|
|
104
|
+
};
|
|
63
105
|
});
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
106
|
+
C(i, (e) => {
|
|
107
|
+
e && !d.value && D(() => {
|
|
108
|
+
d.value = !0;
|
|
67
109
|
});
|
|
68
110
|
});
|
|
69
|
-
function
|
|
70
|
-
|
|
111
|
+
function O(e, t) {
|
|
112
|
+
t && (x.value[e] = t);
|
|
71
113
|
}
|
|
72
|
-
return (
|
|
114
|
+
return (e, t) => p(a) && p(a).length ? (y(), z(M(u.element), {
|
|
73
115
|
key: 0,
|
|
74
116
|
class: "scroll-anchors__nav scroll-anchors__nav--animated scroll-anchors-nav-animated",
|
|
75
|
-
style:
|
|
117
|
+
style: g({ "--ulu-sa-nav-rail-width": `${u.railWidth}px` })
|
|
76
118
|
}, {
|
|
77
|
-
default:
|
|
78
|
-
|
|
79
|
-
|
|
119
|
+
default: T(() => [
|
|
120
|
+
_("ul", {
|
|
121
|
+
class: "scroll-anchors-nav-animated__rail",
|
|
122
|
+
ref_key: "listRef",
|
|
123
|
+
ref: f,
|
|
124
|
+
style: g(A.value)
|
|
125
|
+
}, [
|
|
126
|
+
(y(!0), k(W, null, E(p(a), (n, r) => (y(), k("li", {
|
|
80
127
|
key: r,
|
|
81
|
-
class:
|
|
128
|
+
class: S({ "is-active": n.active })
|
|
82
129
|
}, [
|
|
83
|
-
|
|
84
|
-
class:
|
|
130
|
+
_("a", {
|
|
131
|
+
class: S({ "is-active": n.active }),
|
|
85
132
|
ref_for: !0,
|
|
86
|
-
ref: (
|
|
87
|
-
href: `#${
|
|
133
|
+
ref: (o) => O(r, o),
|
|
134
|
+
href: `#${n.titleId}`
|
|
88
135
|
}, [
|
|
89
|
-
|
|
90
|
-
item:
|
|
136
|
+
H(e.$slots, "default", {
|
|
137
|
+
item: n,
|
|
91
138
|
index: r
|
|
92
139
|
}, () => [
|
|
93
|
-
|
|
140
|
+
I(V(n.title), 1)
|
|
94
141
|
])
|
|
95
|
-
], 10,
|
|
142
|
+
], 10, L)
|
|
96
143
|
], 2))), 128))
|
|
97
|
-
]),
|
|
98
|
-
|
|
99
|
-
class:
|
|
100
|
-
"scroll-anchors-nav-animated__indicator--can-transition":
|
|
144
|
+
], 4),
|
|
145
|
+
_("div", {
|
|
146
|
+
class: S(["scroll-anchors-nav-animated__indicator", {
|
|
147
|
+
"scroll-anchors-nav-animated__indicator--can-transition": d.value
|
|
101
148
|
}]),
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
height: `${e.value ? e.value.height : 0}px`,
|
|
108
|
-
width: `${e.value ? e.value.width : 0}px`
|
|
149
|
+
style: g({
|
|
150
|
+
opacity: i.value ? "1" : "0",
|
|
151
|
+
transform: `translateY(${i.value ? i.value.y : 0}px)`,
|
|
152
|
+
height: `${i.value ? i.value.height : 0}px`,
|
|
153
|
+
width: `${i.value ? i.value.width : 0}px`
|
|
109
154
|
})
|
|
110
155
|
}, null, 6)
|
|
111
156
|
]),
|
|
112
157
|
_: 3
|
|
113
|
-
}, 8, ["style"])) :
|
|
158
|
+
}, 8, ["style"])) : B("", !0);
|
|
114
159
|
}
|
|
115
160
|
};
|
|
116
161
|
export {
|
|
117
|
-
|
|
162
|
+
j as default
|
|
118
163
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScrollAnchors.d.ts","sourceRoot":"","sources":["../../../../lib/components/systems/scroll-anchors/useScrollAnchors.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useScrollAnchors.d.ts","sourceRoot":"","sources":["../../../../lib/components/systems/scroll-anchors/useScrollAnchors.js"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,4EAFW;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,WAAW;IAAC,cAAc,EAAE,MAAM,CAAA;CAAC,QAsTnF"}
|
|
@@ -1,95 +1,138 @@
|
|
|
1
|
-
import { onMounted as
|
|
2
|
-
import { getScrollParent as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { onMounted as P, onUnmounted as U, watch as Y, nextTick as L } from "vue";
|
|
2
|
+
import { getScrollParent as M } from "@ulu/utils/browser/dom.js";
|
|
3
|
+
import { debounce as j } from "@ulu/utils/performance.js";
|
|
4
|
+
function J({ sections: r, props: t, emit: T, componentElRef: m }) {
|
|
5
|
+
let a = null, O = 0, k = "down", d = null, x = !0;
|
|
6
|
+
function g(e) {
|
|
7
|
+
return r.value.findIndex(({ element: n }) => e === n);
|
|
7
8
|
}
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
function B(e, n, s = "down") {
|
|
10
|
+
if (!e) return;
|
|
11
|
+
const v = s === "down" ? "forward" : "reverse";
|
|
12
|
+
n ? (e.active = !0, e.inactiveFrom = null, e.activeFrom = v) : (e.active && (e.inactiveFrom = v, e.activeFrom = null), e.active = !1);
|
|
13
|
+
}
|
|
14
|
+
function $(e = null, n = "down") {
|
|
15
|
+
r.value.forEach((s) => {
|
|
16
|
+
s !== e && B(s, !1, n);
|
|
11
17
|
});
|
|
12
18
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
19
|
+
function h(e, n) {
|
|
20
|
+
e && !e.active && (t.debug && console.log("Activate:", e.title), L(() => {
|
|
21
|
+
$(e, n), B(e, !0, n), T("section-change", { section: e, sections: r.value, active: !0 });
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
function I(e, n) {
|
|
25
|
+
const s = r.value.find((v) => v.active);
|
|
26
|
+
s && (t.debug && n && console.log(n, s.title), L(() => {
|
|
27
|
+
$(null, e), T("section-change", { section: s, sections: r.value, active: !1 });
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
function y() {
|
|
31
|
+
let e = null;
|
|
32
|
+
return t.observerOptions && t.observerOptions.root !== void 0 ? e = t.observerOptions.root : m.value && (e = M(m.value), e === document.scrollingElement && (e = null)), e || window;
|
|
33
|
+
}
|
|
34
|
+
const A = j(() => {
|
|
35
|
+
t.debug && console.log("New Observer (debounced/check)"), a && (a.disconnect(), a = null), E(), w();
|
|
36
|
+
}, 100);
|
|
37
|
+
function C() {
|
|
38
|
+
D(), d = y(), d && d.addEventListener("scroll", A, { passive: !0 });
|
|
39
|
+
}
|
|
40
|
+
function D() {
|
|
41
|
+
d && (d.removeEventListener("scroll", A), d = null);
|
|
42
|
+
}
|
|
43
|
+
function E() {
|
|
44
|
+
x = !0;
|
|
45
|
+
const e = (u) => {
|
|
46
|
+
const { root: R } = a, S = R ? R.scrollTop : document.documentElement.scrollTop || window.scrollY;
|
|
47
|
+
let i = k;
|
|
48
|
+
S > O ? i = "down" : S < O && (i = "up"), t.debug && (console.groupCollapsed(`Scroll: ${O} -> ${S} (${i})`), console.table(u.map((o) => ({
|
|
49
|
+
el: o.target.id || o.target.tagName,
|
|
50
|
+
int: o.isIntersecting,
|
|
51
|
+
ratio: o.intersectionRatio.toFixed(2)
|
|
52
|
+
})))), O = S, k = i;
|
|
53
|
+
const b = u.filter((o) => o.isIntersecting);
|
|
54
|
+
if (b.length > 0) {
|
|
55
|
+
b.sort((c, f) => g(c.target) - g(f.target));
|
|
56
|
+
const o = i === "down" ? b[b.length - 1] : b[0];
|
|
57
|
+
t.debug && console.log("Target:", o.target.id || o.target.tagName);
|
|
58
|
+
const l = r.value[g(o.target)];
|
|
59
|
+
h(l, i);
|
|
60
|
+
} else if (x) {
|
|
61
|
+
t.debug && console.log("Fallback: bounds");
|
|
62
|
+
let o = -1;
|
|
63
|
+
if (u.forEach((l) => {
|
|
64
|
+
const c = l.rootBounds ? l.rootBounds.top : 0;
|
|
65
|
+
if (l.boundingClientRect.top <= c + 1) {
|
|
66
|
+
const f = g(l.target);
|
|
67
|
+
f > o && (o = f);
|
|
68
|
+
}
|
|
69
|
+
}), o > -1) {
|
|
70
|
+
const l = o === r.value.length - 1, c = r.value[o];
|
|
71
|
+
if (l && t.deactivateLastItem) {
|
|
72
|
+
const f = u.find((H) => H.target === c.element), F = f.rootBounds ? f.rootBounds.bottom : window.innerHeight;
|
|
73
|
+
f && f.boundingClientRect.bottom < F ? I(i, "Deactivate (last):") : h(c, i);
|
|
74
|
+
} else
|
|
75
|
+
h(c, i);
|
|
76
|
+
} else if (t.debug && console.log("Fallback: top"), !t.firstItemActive)
|
|
77
|
+
I(i, "Deactivate (top):");
|
|
78
|
+
else {
|
|
79
|
+
const l = r.value[0];
|
|
80
|
+
h(l, i);
|
|
81
|
+
}
|
|
33
82
|
} else {
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
-
const
|
|
40
|
-
(
|
|
41
|
-
w(null, s), h("section-change", { section: n, sections: i.value, active: !1 });
|
|
42
|
-
}));
|
|
83
|
+
t.debug && console.log("Check edges");
|
|
84
|
+
const o = r.value.find((l) => l.active);
|
|
85
|
+
if (o) {
|
|
86
|
+
const l = u.find((c) => c.target === o.element);
|
|
87
|
+
if (l && !l.isIntersecting) {
|
|
88
|
+
const c = g(l.target), f = c === 0, F = c === r.value.length - 1;
|
|
89
|
+
(f && i === "up" && !t.firstItemActive || F && i === "down" && t.deactivateLastItem) && I(i, "Deactivate (edge):");
|
|
43
90
|
}
|
|
44
91
|
}
|
|
45
92
|
}
|
|
46
|
-
|
|
93
|
+
x = !1, t.debug && console.groupEnd();
|
|
47
94
|
};
|
|
48
|
-
let
|
|
49
|
-
|
|
50
|
-
let
|
|
95
|
+
let n = null;
|
|
96
|
+
t.observerOptions && t.observerOptions.root !== void 0 ? n = t.observerOptions.root : m.value && (n = M(m.value), n === document.scrollingElement && (n = null));
|
|
97
|
+
let s = {
|
|
51
98
|
rootMargin: "-25% 0px -55% 0px",
|
|
52
99
|
threshold: 0
|
|
53
100
|
};
|
|
54
|
-
if (
|
|
55
|
-
const
|
|
56
|
-
|
|
101
|
+
if (t.snapOffset !== !1 && t.snapOffset !== void 0) {
|
|
102
|
+
const u = t.snapOffset === !0 ? 20 : Number(t.snapOffset);
|
|
103
|
+
s.rootMargin = `-${u}% 0px -${99 - u}% 0px`;
|
|
57
104
|
}
|
|
58
|
-
const
|
|
59
|
-
...
|
|
60
|
-
...
|
|
61
|
-
root:
|
|
105
|
+
const v = {
|
|
106
|
+
...s,
|
|
107
|
+
...t.observerOptions || {},
|
|
108
|
+
root: n
|
|
62
109
|
};
|
|
63
|
-
|
|
110
|
+
a = new IntersectionObserver(e, v);
|
|
64
111
|
}
|
|
65
|
-
function
|
|
66
|
-
|
|
67
|
-
|
|
112
|
+
function w() {
|
|
113
|
+
a && (a.disconnect(), r.value.forEach(({ element: e }) => {
|
|
114
|
+
e && a.observe(e);
|
|
68
115
|
}));
|
|
69
116
|
}
|
|
70
|
-
function
|
|
71
|
-
|
|
117
|
+
function N() {
|
|
118
|
+
a && (a.disconnect(), a = null);
|
|
72
119
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
x();
|
|
81
|
-
}), F(() => i.value.length, () => {
|
|
82
|
-
O(() => {
|
|
83
|
-
b();
|
|
120
|
+
P(() => {
|
|
121
|
+
E(), w(), C();
|
|
122
|
+
}), U(() => {
|
|
123
|
+
N(), D(), A.cancel();
|
|
124
|
+
}), Y(() => r.value.length, () => {
|
|
125
|
+
L(() => {
|
|
126
|
+
w();
|
|
84
127
|
});
|
|
85
|
-
}),
|
|
86
|
-
() => [
|
|
128
|
+
}), Y(
|
|
129
|
+
() => [t.snapOffset, t.observerOptions],
|
|
87
130
|
() => {
|
|
88
|
-
|
|
131
|
+
N(), E(), w(), C();
|
|
89
132
|
},
|
|
90
133
|
{ deep: !0 }
|
|
91
134
|
);
|
|
92
135
|
}
|
|
93
136
|
export {
|
|
94
|
-
|
|
137
|
+
J as useScrollAnchors
|
|
95
138
|
};
|
|
@@ -4,6 +4,7 @@ type __VLS_WithTemplateSlots<T, S> = T & (new () => {
|
|
|
4
4
|
$slots: S;
|
|
5
5
|
});
|
|
6
6
|
declare const __VLS_component: import('vue').DefineComponent<{}, {
|
|
7
|
+
type?: string | undefined;
|
|
7
8
|
activeClass?: string | undefined;
|
|
8
9
|
to?: string | Record<string, any> | undefined;
|
|
9
10
|
target?: string | undefined;
|
|
@@ -14,6 +15,7 @@ declare const __VLS_component: import('vue').DefineComponent<{}, {
|
|
|
14
15
|
exactActiveClass?: string | undefined;
|
|
15
16
|
click?: Function | undefined;
|
|
16
17
|
$props: {
|
|
18
|
+
readonly type?: string | undefined;
|
|
17
19
|
readonly activeClass?: string | undefined;
|
|
18
20
|
readonly to?: string | Record<string, any> | undefined;
|
|
19
21
|
readonly target?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UluAction.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/utils/UluAction.vue"],"names":[],"mappings":"AAQA;
|
|
1
|
+
{"version":3,"file":"UluAction.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/utils/UluAction.vue"],"names":[],"mappings":"AAQA;wBA6NqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AAXjC;;;;;;;;;;;;;;;;;;;;;;;2OAQG"}
|