@pantograph/vue 0.13.1 → 0.14.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/ScrollContainer/Mask.d.ts +9 -0
- package/dist/ScrollContainer/ScrollContainer.d.ts +215 -0
- package/dist/ScrollContainer/ScrollContainer.model.d.ts +2 -0
- package/dist/ScrollContainer/index.d.ts +2 -0
- package/dist/ScrollContainer/index.js +148 -0
- package/dist/ScrollContainer/index.umd.cjs +1 -0
- package/dist/style/index.css +1 -1
- package/package.json +6 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const scrollContainerPrefix: string;
|
|
2
|
+
export interface Props {
|
|
3
|
+
topVisible: boolean;
|
|
4
|
+
bottomVisible: boolean;
|
|
5
|
+
endVisible: boolean;
|
|
6
|
+
startVisible: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { ScrollContainerType } from './ScrollContainer.model';
|
|
2
|
+
export interface ScrollContainerProps {
|
|
3
|
+
scrollDistance?: number;
|
|
4
|
+
scrollHideDelay?: number;
|
|
5
|
+
dir?: 'rtl' | 'ltr';
|
|
6
|
+
type?: ScrollContainerType;
|
|
7
|
+
rootProps?: object;
|
|
8
|
+
overlay?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare function __VLS_template(): {
|
|
11
|
+
slots: {
|
|
12
|
+
default?(_: {}): any;
|
|
13
|
+
};
|
|
14
|
+
refs: {
|
|
15
|
+
root: ({
|
|
16
|
+
$: import('vue').ComponentInternalInstance;
|
|
17
|
+
$data: {};
|
|
18
|
+
$props: Partial<{
|
|
19
|
+
type: import('../../../../node_modules/radix-vue/dist/ScrollArea/types.js', { with: { "resolution-mode": "import" } }).ScrollType;
|
|
20
|
+
scrollHideDelay: number;
|
|
21
|
+
}> & Omit<{
|
|
22
|
+
readonly type: import('../../../../node_modules/radix-vue/dist/ScrollArea/types.js', { with: { "resolution-mode": "import" } }).ScrollType;
|
|
23
|
+
readonly scrollHideDelay: number;
|
|
24
|
+
readonly dir?: import('../../../../node_modules/radix-vue/dist/ScrollArea/types.js', { with: { "resolution-mode": "import" } }).Direction | undefined;
|
|
25
|
+
readonly as?: (import('radix-vue', { with: { "resolution-mode": "import" } }).AsTag | import('vue').Component) | undefined;
|
|
26
|
+
readonly asChild?: boolean | undefined;
|
|
27
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "type" | "scrollHideDelay">;
|
|
28
|
+
$attrs: {
|
|
29
|
+
[x: string]: unknown;
|
|
30
|
+
};
|
|
31
|
+
$refs: {
|
|
32
|
+
[x: string]: unknown;
|
|
33
|
+
};
|
|
34
|
+
$slots: Readonly<{
|
|
35
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
$root: import('vue').ComponentPublicInstance | null;
|
|
38
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
|
39
|
+
$host: Element | null;
|
|
40
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
41
|
+
$el: any;
|
|
42
|
+
$options: import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
43
|
+
dir: {
|
|
44
|
+
type: import('vue').PropType<import('../../../../node_modules/radix-vue/dist/ScrollArea/types.js', { with: { "resolution-mode": "import" } }).Direction>;
|
|
45
|
+
};
|
|
46
|
+
type: {
|
|
47
|
+
type: import('vue').PropType<import('../../../../node_modules/radix-vue/dist/ScrollArea/types.js', { with: { "resolution-mode": "import" } }).ScrollType>;
|
|
48
|
+
default: string;
|
|
49
|
+
};
|
|
50
|
+
as: {
|
|
51
|
+
type: import('vue').PropType<import('radix-vue', { with: { "resolution-mode": "import" } }).AsTag | import('vue').Component>;
|
|
52
|
+
};
|
|
53
|
+
asChild: {
|
|
54
|
+
type: import('vue').PropType<boolean>;
|
|
55
|
+
};
|
|
56
|
+
scrollHideDelay: {
|
|
57
|
+
type: import('vue').PropType<number>;
|
|
58
|
+
default: number;
|
|
59
|
+
};
|
|
60
|
+
}>>, {
|
|
61
|
+
viewport: import('vue').Ref<HTMLElement | undefined>;
|
|
62
|
+
scrollTop: () => void;
|
|
63
|
+
scrollTopLeft: () => void;
|
|
64
|
+
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
65
|
+
type: import('../../../../node_modules/radix-vue/dist/ScrollArea/types.js', { with: { "resolution-mode": "import" } }).ScrollType;
|
|
66
|
+
scrollHideDelay: number;
|
|
67
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
68
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
69
|
+
created?: (() => void) | (() => void)[];
|
|
70
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
71
|
+
mounted?: (() => void) | (() => void)[];
|
|
72
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
73
|
+
updated?: (() => void) | (() => void)[];
|
|
74
|
+
activated?: (() => void) | (() => void)[];
|
|
75
|
+
deactivated?: (() => void) | (() => void)[];
|
|
76
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
77
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
78
|
+
destroyed?: (() => void) | (() => void)[];
|
|
79
|
+
unmounted?: (() => void) | (() => void)[];
|
|
80
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
81
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
82
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
83
|
+
};
|
|
84
|
+
$forceUpdate: () => void;
|
|
85
|
+
$nextTick: typeof import('vue').nextTick;
|
|
86
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
87
|
+
} & Readonly<{
|
|
88
|
+
type: import('../../../../node_modules/radix-vue/dist/ScrollArea/types.js', { with: { "resolution-mode": "import" } }).ScrollType;
|
|
89
|
+
scrollHideDelay: number;
|
|
90
|
+
}> & Omit<Readonly<import('vue').ExtractPropTypes<{
|
|
91
|
+
dir: {
|
|
92
|
+
type: import('vue').PropType<import('../../../../node_modules/radix-vue/dist/ScrollArea/types.js', { with: { "resolution-mode": "import" } }).Direction>;
|
|
93
|
+
};
|
|
94
|
+
type: {
|
|
95
|
+
type: import('vue').PropType<import('../../../../node_modules/radix-vue/dist/ScrollArea/types.js', { with: { "resolution-mode": "import" } }).ScrollType>;
|
|
96
|
+
default: string;
|
|
97
|
+
};
|
|
98
|
+
as: {
|
|
99
|
+
type: import('vue').PropType<import('radix-vue', { with: { "resolution-mode": "import" } }).AsTag | import('vue').Component>;
|
|
100
|
+
};
|
|
101
|
+
asChild: {
|
|
102
|
+
type: import('vue').PropType<boolean>;
|
|
103
|
+
};
|
|
104
|
+
scrollHideDelay: {
|
|
105
|
+
type: import('vue').PropType<number>;
|
|
106
|
+
default: number;
|
|
107
|
+
};
|
|
108
|
+
}>>, "type" | "scrollHideDelay" | "viewport" | "scrollTop" | "scrollTopLeft"> & import('vue').ShallowUnwrapRef<{
|
|
109
|
+
viewport: import('vue').Ref<HTMLElement | undefined>;
|
|
110
|
+
scrollTop: () => void;
|
|
111
|
+
scrollTopLeft: () => void;
|
|
112
|
+
}> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
113
|
+
$slots: {
|
|
114
|
+
default?(_: {}): any;
|
|
115
|
+
};
|
|
116
|
+
}) | null;
|
|
117
|
+
wrap: ({
|
|
118
|
+
$: import('vue').ComponentInternalInstance;
|
|
119
|
+
$data: {};
|
|
120
|
+
$props: Partial<{}> & Omit<{
|
|
121
|
+
readonly nonce?: string | undefined;
|
|
122
|
+
readonly as?: (import('radix-vue', { with: { "resolution-mode": "import" } }).AsTag | import('vue').Component) | undefined;
|
|
123
|
+
readonly asChild?: boolean | undefined;
|
|
124
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>;
|
|
125
|
+
$attrs: {
|
|
126
|
+
[x: string]: unknown;
|
|
127
|
+
};
|
|
128
|
+
$refs: {
|
|
129
|
+
[x: string]: unknown;
|
|
130
|
+
};
|
|
131
|
+
$slots: Readonly<{
|
|
132
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
133
|
+
}>;
|
|
134
|
+
$root: import('vue').ComponentPublicInstance | null;
|
|
135
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
|
136
|
+
$host: Element | null;
|
|
137
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
138
|
+
$el: any;
|
|
139
|
+
$options: import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
140
|
+
nonce: {
|
|
141
|
+
type: import('vue').PropType<string>;
|
|
142
|
+
};
|
|
143
|
+
asChild: {
|
|
144
|
+
type: import('vue').PropType<boolean>;
|
|
145
|
+
};
|
|
146
|
+
as: {
|
|
147
|
+
type: import('vue').PropType<import('radix-vue', { with: { "resolution-mode": "import" } }).AsTag | import('vue').Component>;
|
|
148
|
+
};
|
|
149
|
+
}>>, {
|
|
150
|
+
viewportElement: import('vue').Ref<HTMLElement | undefined>;
|
|
151
|
+
}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
152
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
153
|
+
created?: (() => void) | (() => void)[];
|
|
154
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
155
|
+
mounted?: (() => void) | (() => void)[];
|
|
156
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
157
|
+
updated?: (() => void) | (() => void)[];
|
|
158
|
+
activated?: (() => void) | (() => void)[];
|
|
159
|
+
deactivated?: (() => void) | (() => void)[];
|
|
160
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
161
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
162
|
+
destroyed?: (() => void) | (() => void)[];
|
|
163
|
+
unmounted?: (() => void) | (() => void)[];
|
|
164
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
165
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
166
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
167
|
+
};
|
|
168
|
+
$forceUpdate: () => void;
|
|
169
|
+
$nextTick: typeof import('vue').nextTick;
|
|
170
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
171
|
+
} & Readonly<{}> & Omit<Readonly<import('vue').ExtractPropTypes<{
|
|
172
|
+
nonce: {
|
|
173
|
+
type: import('vue').PropType<string>;
|
|
174
|
+
};
|
|
175
|
+
asChild: {
|
|
176
|
+
type: import('vue').PropType<boolean>;
|
|
177
|
+
};
|
|
178
|
+
as: {
|
|
179
|
+
type: import('vue').PropType<import('radix-vue', { with: { "resolution-mode": "import" } }).AsTag | import('vue').Component>;
|
|
180
|
+
};
|
|
181
|
+
}>>, "viewportElement"> & import('vue').ShallowUnwrapRef<{
|
|
182
|
+
viewportElement: import('vue').Ref<HTMLElement | undefined>;
|
|
183
|
+
}> & {} & import('vue').ComponentCustomProperties & {} & {
|
|
184
|
+
$slots: {
|
|
185
|
+
default?(_: {}): any;
|
|
186
|
+
};
|
|
187
|
+
}) | null;
|
|
188
|
+
top: HTMLDivElement;
|
|
189
|
+
end: HTMLDivElement;
|
|
190
|
+
start: HTMLDivElement;
|
|
191
|
+
bottom: HTMLDivElement;
|
|
192
|
+
};
|
|
193
|
+
attrs: Partial<{}>;
|
|
194
|
+
};
|
|
195
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
196
|
+
declare const __VLS_component: import('vue').DefineComponent<ScrollContainerProps, {
|
|
197
|
+
container: import('vue').Ref<any, any>;
|
|
198
|
+
root: import('vue').Ref<any, any>;
|
|
199
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
200
|
+
loadMore: (...args: any[]) => void;
|
|
201
|
+
}, string, import('vue').PublicProps, Readonly<ScrollContainerProps> & Readonly<{
|
|
202
|
+
onLoadMore?: ((...args: any[]) => any) | undefined;
|
|
203
|
+
}>, {
|
|
204
|
+
type: ScrollContainerType;
|
|
205
|
+
scrollDistance: number;
|
|
206
|
+
scrollHideDelay: number;
|
|
207
|
+
overlay: boolean;
|
|
208
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
209
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
210
|
+
export default _default;
|
|
211
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
212
|
+
new (): {
|
|
213
|
+
$slots: S;
|
|
214
|
+
};
|
|
215
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { defineComponent as D, createElementBlock as j, openBlock as x, normalizeClass as t, unref as e, createElementVNode as r, ref as S, computed as I, useTemplateRef as d, shallowRef as L, onBeforeUnmount as O, createBlock as U, mergeProps as w, withCtx as b, createVNode as a, renderSlot as q } from "vue";
|
|
2
|
+
import { ScrollAreaRoot as F, ScrollAreaViewport as G, ScrollAreaScrollbar as g, ScrollAreaThumb as A, ScrollAreaCorner as J } from "radix-vue";
|
|
3
|
+
import { cva as E } from "class-variance-authority";
|
|
4
|
+
import { getBemBlock as K, getBemElement as o, generateVariantClassList as c } from "@pantograph/utils";
|
|
5
|
+
import { useElementVisibility as _, useIntersectionObserver as Q } from "@vueuse/core";
|
|
6
|
+
import { a as W } from "../index-DXzWdQsN.js";
|
|
7
|
+
const l = K("scroll_container"), X = /* @__PURE__ */ D({
|
|
8
|
+
__name: "Mask",
|
|
9
|
+
props: {
|
|
10
|
+
topVisible: { type: Boolean },
|
|
11
|
+
bottomVisible: { type: Boolean },
|
|
12
|
+
endVisible: { type: Boolean },
|
|
13
|
+
startVisible: { type: Boolean }
|
|
14
|
+
},
|
|
15
|
+
setup(m) {
|
|
16
|
+
const u = m, s = o(l, "mask"), p = E(s, {
|
|
17
|
+
variants: {
|
|
18
|
+
topVisible: c("top-visible", s),
|
|
19
|
+
bottomVisible: c("bottom-visible", s),
|
|
20
|
+
endVisible: c("start-visible", s),
|
|
21
|
+
startVisible: c("end-visible", s)
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return (f, n) => (x(), j("div", {
|
|
25
|
+
class: t(e(p)(u))
|
|
26
|
+
}, [
|
|
27
|
+
r("div", {
|
|
28
|
+
class: t(e(o)(e(s), "top"))
|
|
29
|
+
}, null, 2),
|
|
30
|
+
r("div", {
|
|
31
|
+
class: t(e(o)(e(s), "bottom"))
|
|
32
|
+
}, null, 2),
|
|
33
|
+
r("div", {
|
|
34
|
+
class: t(e(o)(e(s), "start"))
|
|
35
|
+
}, null, 2),
|
|
36
|
+
r("div", {
|
|
37
|
+
class: t(e(o)(e(s), "end"))
|
|
38
|
+
}, null, 2)
|
|
39
|
+
], 2));
|
|
40
|
+
}
|
|
41
|
+
}), re = /* @__PURE__ */ D({
|
|
42
|
+
inheritAttrs: !1,
|
|
43
|
+
__name: "ScrollContainer",
|
|
44
|
+
props: {
|
|
45
|
+
scrollDistance: { default: 10 },
|
|
46
|
+
scrollHideDelay: { default: 200 },
|
|
47
|
+
dir: {},
|
|
48
|
+
type: { default: "hover" },
|
|
49
|
+
rootProps: {},
|
|
50
|
+
overlay: { type: Boolean, default: !0 }
|
|
51
|
+
},
|
|
52
|
+
emits: ["loadMore"],
|
|
53
|
+
setup(m, { expose: u, emit: s }) {
|
|
54
|
+
const p = S(), f = S(), n = m, H = s, P = E(l, {
|
|
55
|
+
variants: {
|
|
56
|
+
overlay: c("overlay", l)
|
|
57
|
+
}
|
|
58
|
+
}), v = o(l, "scroll_bar"), V = o(v, "thumb"), M = W(), R = I(() => n.dir ? n.dir : M.dir.value), C = d("top"), T = _(C), h = d("end"), $ = _(h), k = d("start"), z = _(k), B = d("bottom"), y = L(!1), { stop: N } = Q(B, ([{ isIntersecting: i }]) => {
|
|
59
|
+
i ? (H("loadMore"), y.value = !0) : y.value = !1;
|
|
60
|
+
});
|
|
61
|
+
return O(N), u({
|
|
62
|
+
container: f,
|
|
63
|
+
root: p
|
|
64
|
+
}), (i, Y) => (x(), U(e(F), w({
|
|
65
|
+
class: [e(P)({ overlay: i.overlay })],
|
|
66
|
+
scrollHideDelay: n.scrollHideDelay,
|
|
67
|
+
dir: R.value,
|
|
68
|
+
type: n.type
|
|
69
|
+
}, i.rootProps, {
|
|
70
|
+
ref_key: "root",
|
|
71
|
+
ref: p
|
|
72
|
+
}), {
|
|
73
|
+
default: b(() => [
|
|
74
|
+
a(e(G), w({
|
|
75
|
+
class: e(o)(e(l), "area")
|
|
76
|
+
}, i.$attrs, {
|
|
77
|
+
ref_key: "wrap",
|
|
78
|
+
ref: f,
|
|
79
|
+
"as-child": ""
|
|
80
|
+
}), {
|
|
81
|
+
default: b(() => [
|
|
82
|
+
r("div", {
|
|
83
|
+
class: t(e(o)(e(l), "area__wrap"))
|
|
84
|
+
}, [
|
|
85
|
+
q(i.$slots, "default"),
|
|
86
|
+
r("div", {
|
|
87
|
+
ref_key: "top",
|
|
88
|
+
ref: C,
|
|
89
|
+
class: t(e(o)(e(l), "top_observer"))
|
|
90
|
+
}, null, 2),
|
|
91
|
+
r("div", {
|
|
92
|
+
ref_key: "end",
|
|
93
|
+
ref: h,
|
|
94
|
+
class: t(e(o)(e(l), "end_observer"))
|
|
95
|
+
}, null, 2),
|
|
96
|
+
r("div", {
|
|
97
|
+
ref_key: "start",
|
|
98
|
+
ref: k,
|
|
99
|
+
class: t(e(o)(e(l), "start_observer"))
|
|
100
|
+
}, null, 2),
|
|
101
|
+
r("div", {
|
|
102
|
+
ref_key: "bottom",
|
|
103
|
+
ref: B,
|
|
104
|
+
class: t(e(o)(e(l), "bottom_observer"))
|
|
105
|
+
}, null, 2)
|
|
106
|
+
], 2)
|
|
107
|
+
]),
|
|
108
|
+
_: 3
|
|
109
|
+
}, 16, ["class"]),
|
|
110
|
+
a(X, {
|
|
111
|
+
topVisible: e(T),
|
|
112
|
+
bottomVisible: y.value,
|
|
113
|
+
endVisible: e($),
|
|
114
|
+
startVisible: e(z)
|
|
115
|
+
}, null, 8, ["topVisible", "bottomVisible", "endVisible", "startVisible"]),
|
|
116
|
+
a(e(g), {
|
|
117
|
+
class: t(e(v)),
|
|
118
|
+
orientation: "vertical"
|
|
119
|
+
}, {
|
|
120
|
+
default: b(() => [
|
|
121
|
+
a(e(A), {
|
|
122
|
+
class: t(e(V))
|
|
123
|
+
}, null, 8, ["class"])
|
|
124
|
+
]),
|
|
125
|
+
_: 1
|
|
126
|
+
}, 8, ["class"]),
|
|
127
|
+
a(e(g), {
|
|
128
|
+
class: t(e(v)),
|
|
129
|
+
orientation: "horizontal"
|
|
130
|
+
}, {
|
|
131
|
+
default: b(() => [
|
|
132
|
+
a(e(A), {
|
|
133
|
+
class: t(e(V))
|
|
134
|
+
}, null, 8, ["class"])
|
|
135
|
+
]),
|
|
136
|
+
_: 1
|
|
137
|
+
}, 8, ["class"]),
|
|
138
|
+
a(e(J))
|
|
139
|
+
]),
|
|
140
|
+
_: 3
|
|
141
|
+
}, 16, ["class", "scrollHideDelay", "dir", "type"]));
|
|
142
|
+
}
|
|
143
|
+
}), ae = ["auto", "always", "scroll", "hover"];
|
|
144
|
+
export {
|
|
145
|
+
re as ScrollContainer,
|
|
146
|
+
ae as ScrollContainerTypes,
|
|
147
|
+
re as default
|
|
148
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("radix-vue"),y=require("class-variance-authority"),t=require("@pantograph/utils"),i=require("@vueuse/core"),w=require("../index-fCdmNGB1.js"),l=t.getBemBlock("scroll_container"),A=e.defineComponent({__name:"Mask",props:{topVisible:{type:Boolean},bottomVisible:{type:Boolean},endVisible:{type:Boolean},startVisible:{type:Boolean}},setup(c){const u=c,r=t.getBemElement(l,"mask"),a=y.cva(r,{variants:{topVisible:t.generateVariantClassList("top-visible",r),bottomVisible:t.generateVariantClassList("bottom-visible",r),endVisible:t.generateVariantClassList("start-visible",r),startVisible:t.generateVariantClassList("end-visible",r)}});return(m,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(a)(u))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(t.getBemElement)(e.unref(r),"top"))},null,2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(t.getBemElement)(e.unref(r),"bottom"))},null,2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(t.getBemElement)(e.unref(r),"start"))},null,2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(t.getBemElement)(e.unref(r),"end"))},null,2)],2))}}),_=e.defineComponent({inheritAttrs:!1,__name:"ScrollContainer",props:{scrollDistance:{default:10},scrollHideDelay:{default:200},dir:{},type:{default:"hover"},rootProps:{},overlay:{type:Boolean,default:!0}},emits:["loadMore"],setup(c,{expose:u,emit:r}){const a=e.ref(),m=e.ref(),n=c,g=r,E=y.cva(l,{variants:{overlay:t.generateVariantClassList("overlay",l)}}),f=t.getBemElement(l,"scroll_bar"),b=t.getBemElement(f,"thumb"),B=w.injectConfigContext(),h=e.computed(()=>n.dir?n.dir:B.dir.value),p=e.useTemplateRef("top"),N=i.useElementVisibility(p),V=e.useTemplateRef("end"),S=i.useElementVisibility(V),v=e.useTemplateRef("start"),z=i.useElementVisibility(v),C=e.useTemplateRef("bottom"),d=e.shallowRef(!1),{stop:k}=i.useIntersectionObserver(C,([{isIntersecting:o}])=>{o?(g("loadMore"),d.value=!0):d.value=!1});return e.onBeforeUnmount(k),u({container:m,root:a}),(o,x)=>(e.openBlock(),e.createBlock(e.unref(s.ScrollAreaRoot),e.mergeProps({class:[e.unref(E)({overlay:o.overlay})],scrollHideDelay:n.scrollHideDelay,dir:h.value,type:n.type},o.rootProps,{ref_key:"root",ref:a}),{default:e.withCtx(()=>[e.createVNode(e.unref(s.ScrollAreaViewport),e.mergeProps({class:e.unref(t.getBemElement)(e.unref(l),"area")},o.$attrs,{ref_key:"wrap",ref:m,"as-child":""}),{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(t.getBemElement)(e.unref(l),"area__wrap"))},[e.renderSlot(o.$slots,"default"),e.createElementVNode("div",{ref_key:"top",ref:p,class:e.normalizeClass(e.unref(t.getBemElement)(e.unref(l),"top_observer"))},null,2),e.createElementVNode("div",{ref_key:"end",ref:V,class:e.normalizeClass(e.unref(t.getBemElement)(e.unref(l),"end_observer"))},null,2),e.createElementVNode("div",{ref_key:"start",ref:v,class:e.normalizeClass(e.unref(t.getBemElement)(e.unref(l),"start_observer"))},null,2),e.createElementVNode("div",{ref_key:"bottom",ref:C,class:e.normalizeClass(e.unref(t.getBemElement)(e.unref(l),"bottom_observer"))},null,2)],2)]),_:3},16,["class"]),e.createVNode(A,{topVisible:e.unref(N),bottomVisible:d.value,endVisible:e.unref(S),startVisible:e.unref(z)},null,8,["topVisible","bottomVisible","endVisible","startVisible"]),e.createVNode(e.unref(s.ScrollAreaScrollbar),{class:e.normalizeClass(e.unref(f)),orientation:"vertical"},{default:e.withCtx(()=>[e.createVNode(e.unref(s.ScrollAreaThumb),{class:e.normalizeClass(e.unref(b))},null,8,["class"])]),_:1},8,["class"]),e.createVNode(e.unref(s.ScrollAreaScrollbar),{class:e.normalizeClass(e.unref(f)),orientation:"horizontal"},{default:e.withCtx(()=>[e.createVNode(e.unref(s.ScrollAreaThumb),{class:e.normalizeClass(e.unref(b))},null,8,["class"])]),_:1},8,["class"]),e.createVNode(e.unref(s.ScrollAreaCorner))]),_:3},16,["class","scrollHideDelay","dir","type"]))}}),T=["auto","always","scroll","hover"];exports.ScrollContainer=_;exports.ScrollContainerTypes=T;exports.default=_;
|