@rebilly/revel 13.6.9 → 13.7.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/CHANGELOG.md +4 -2
- package/dist/components/r-alert/r-alert.vue.d.ts +2 -2
- package/dist/components/r-button/r-button.vue.d.ts +4 -4
- package/dist/components/r-date-input/r-calendar.vue.d.ts +1 -1
- package/dist/components/r-date-input/r-date-input.vue.d.ts +3 -3
- package/dist/components/r-date-input/r-date-range-button-group.vue.d.ts +1 -1
- package/dist/components/r-date-input/r-range-calendar.vue.d.ts +1 -1
- package/dist/components/r-date-range/components/calendar.vue.d.ts +2 -2
- package/dist/components/r-date-range/components/popup.vue.d.ts +3 -3
- package/dist/components/r-date-range/components/presets.vue.d.ts +1 -1
- package/dist/components/r-date-range/r-date-range.vue.d.ts +2 -2
- package/dist/components/r-flex/r-flex-item.vue.d.ts +2 -2
- package/dist/components/r-grid/r-grid-cell.vue.d.ts +1 -1
- package/dist/components/r-icon/r-icon.vue.d.ts +1 -1
- package/dist/components/r-input/r-input.vue.d.ts +2 -2
- package/dist/components/r-repeater/r-repeater.vue.d.ts +4 -4
- package/dist/components/r-select/r-select.vue.d.ts +13 -13
- package/dist/components/r-select/r-select.vue.mjs +4 -1
- package/dist/components/r-tabs/r-tabs.vue.d.ts +22 -0
- package/dist/components/r-tabs/r-tabs.vue.mjs +74 -56
- package/dist/components/r-tabs/r-tabs.vue_vue_type_script_lang.mjs +65 -15
- package/dist/revel.umd.js +11 -11
- package/dist/style.css +1 -1
- package/dist/vendor/@angelblanco/v-calendar/dist/es/index.mjs +1 -1
- package/package.json +5 -5
|
@@ -2,9 +2,22 @@ import { capitalizeFirstLetter as e } from "../../common/helpers/capitalize-firs
|
|
|
2
2
|
import { debounce as t } from "../../vendor/es-toolkit/dist/compat/function/debounce.mjs";
|
|
3
3
|
import { isKebabCase as n } from "../../common/helpers/is-kebab-case.mjs";
|
|
4
4
|
import { RTooltipDirective as r } from "../../directives/r-tooltip/r-tooltip.mjs";
|
|
5
|
-
import { computed as i, defineComponent as a,
|
|
5
|
+
import { computed as i, defineComponent as a, nextTick as o, onBeforeUnmount as s, onMounted as c, ref as l, watch as u } from "vue";
|
|
6
6
|
//#region src/components/r-tabs/r-tabs.vue?vue&type=script&lang.ts
|
|
7
|
-
|
|
7
|
+
function d(e) {
|
|
8
|
+
let t = e?.parentElement ?? null;
|
|
9
|
+
for (; t;) {
|
|
10
|
+
let { overflowY: e } = window.getComputedStyle(t);
|
|
11
|
+
if (e === "auto" || e === "scroll" || e === "overlay") return t;
|
|
12
|
+
t = t.parentElement;
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
function f(e) {
|
|
17
|
+
let t = Array.from(e.children).find((e) => e instanceof HTMLElement && e.tagName === "HEADER");
|
|
18
|
+
return t instanceof HTMLElement ? t : null;
|
|
19
|
+
}
|
|
20
|
+
var p = a({
|
|
8
21
|
name: "RTabs",
|
|
9
22
|
components: {},
|
|
10
23
|
directives: { tooltip: r },
|
|
@@ -40,22 +53,59 @@ var l = a({
|
|
|
40
53
|
lazy: {
|
|
41
54
|
type: Boolean,
|
|
42
55
|
default: !0
|
|
56
|
+
},
|
|
57
|
+
sticky: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: !1
|
|
43
60
|
}
|
|
44
61
|
},
|
|
45
62
|
emits: ["tab-selected"],
|
|
46
|
-
setup() {
|
|
47
|
-
let
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
63
|
+
setup(e) {
|
|
64
|
+
let n = l([]), r = l(null), i = l(null), a = l(null), p = l(0), m = l(!1), h = null, g = null, _ = !1, v = () => {
|
|
65
|
+
p.value += 1;
|
|
66
|
+
}, y = t(v, 100);
|
|
67
|
+
function b() {
|
|
68
|
+
h?.disconnect(), h = null, g?.disconnect(), g = null, m.value = !1, i.value?.style.removeProperty("--r-tabs-sticky-offset");
|
|
69
|
+
}
|
|
70
|
+
function x(e, t) {
|
|
71
|
+
g?.disconnect(), g = null;
|
|
72
|
+
let n = a.value;
|
|
73
|
+
if (!n || typeof IntersectionObserver > "u") return;
|
|
74
|
+
let r = e === document.documentElement ? null : e, i = new IntersectionObserver(([e]) => {
|
|
75
|
+
if (g !== i) return;
|
|
76
|
+
let t = e?.rootBounds?.top;
|
|
77
|
+
m.value = !!(e && !e.isIntersecting && t != null && e.boundingClientRect.bottom <= t);
|
|
78
|
+
}, {
|
|
79
|
+
root: r,
|
|
80
|
+
rootMargin: `-${Math.round(t)}px 0px 0px 0px`,
|
|
81
|
+
threshold: 0
|
|
82
|
+
});
|
|
83
|
+
g = i, i.observe(n);
|
|
84
|
+
}
|
|
85
|
+
function S() {
|
|
86
|
+
if (b(), !e.sticky) return;
|
|
87
|
+
let t = i.value;
|
|
88
|
+
if (!t) return;
|
|
89
|
+
let n = d(t) ?? document.documentElement, r = f(n), a = () => {
|
|
90
|
+
let e = r ? r.getBoundingClientRect().height : 0;
|
|
91
|
+
t.style.setProperty("--r-tabs-sticky-offset", `${e}px`), x(n, e);
|
|
92
|
+
};
|
|
93
|
+
a(), r && typeof ResizeObserver < "u" && (h = new ResizeObserver(() => a()), h.observe(r));
|
|
94
|
+
}
|
|
95
|
+
return c(() => {
|
|
96
|
+
window.addEventListener("resize", y), _ = !0, S();
|
|
97
|
+
}), s(() => {
|
|
98
|
+
window.removeEventListener("resize", y), y.cancel?.(), _ = !1, b();
|
|
99
|
+
}), u(() => e.sticky, () => {
|
|
100
|
+
_ && o(() => S());
|
|
54
101
|
}), {
|
|
55
|
-
tabItemLinkRefs:
|
|
56
|
-
tablistRef:
|
|
57
|
-
|
|
58
|
-
|
|
102
|
+
tabItemLinkRefs: n,
|
|
103
|
+
tablistRef: r,
|
|
104
|
+
stickyHostRef: i,
|
|
105
|
+
stickySentinelRef: a,
|
|
106
|
+
layoutVersion: p,
|
|
107
|
+
recomputeIndicator: v,
|
|
108
|
+
isStuck: m
|
|
59
109
|
};
|
|
60
110
|
},
|
|
61
111
|
data: () => ({
|
|
@@ -137,4 +187,4 @@ var l = a({
|
|
|
137
187
|
}
|
|
138
188
|
});
|
|
139
189
|
//#endregion
|
|
140
|
-
export {
|
|
190
|
+
export { p as default };
|