eco-vue-js 0.3.83 → 0.3.85
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Button/WButtonSelection.vue.d.ts +4 -9
- package/dist/components/Button/WButtonSelection.vue.d.ts.map +1 -1
- package/dist/components/Button/WButtonSelection.vue.js +51 -6
- package/dist/components/Button/WButtonSelectionAction.vue.js +15 -15
- package/dist/components/InfiniteList/WInfiniteList.vue.d.ts +3 -0
- package/dist/components/InfiniteList/WInfiniteList.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/WInfiniteList.vue.js +4 -2
- package/dist/components/InfiniteList/WInfiniteListPages.vue.d.ts +3 -0
- package/dist/components/InfiniteList/WInfiniteListPages.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/WInfiniteListPages.vue.js +5 -2
- package/dist/components/InfiniteList/components/InfiniteListPage.vue.d.ts +6 -0
- package/dist/components/InfiniteList/components/InfiniteListPage.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/components/InfiniteListPage.vue.js +34 -3
- package/package.json +1 -1
@@ -1,16 +1,16 @@
|
|
1
|
-
declare const _default:
|
1
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
2
2
|
title?: string | undefined;
|
3
3
|
selectedLength?: number | undefined;
|
4
|
+
disableMessageMore?: string | undefined;
|
4
5
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
5
6
|
"clear:selected": () => void;
|
6
7
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
7
8
|
title?: string | undefined;
|
8
9
|
selectedLength?: number | undefined;
|
10
|
+
disableMessageMore?: string | undefined;
|
9
11
|
}>>> & {
|
10
12
|
"onClear:selected"?: (() => any) | undefined;
|
11
|
-
}, {}, {}
|
12
|
-
default?(_: {}): any;
|
13
|
-
}>;
|
13
|
+
}, {}, {}>;
|
14
14
|
export default _default;
|
15
15
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
16
16
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
@@ -21,9 +21,4 @@ type __VLS_TypePropsToRuntimeProps<T> = {
|
|
21
21
|
required: true;
|
22
22
|
};
|
23
23
|
};
|
24
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
25
|
-
new (): {
|
26
|
-
$slots: S;
|
27
|
-
};
|
28
|
-
};
|
29
24
|
//# sourceMappingURL=WButtonSelection.vue.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WButtonSelection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Button/WButtonSelection.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WButtonSelection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Button/WButtonSelection.vue"],"names":[],"mappings":"AAkEA;;;;;;;;;;;;;;AAiSA,wBAWG;AACH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC"}
|
@@ -1,9 +1,14 @@
|
|
1
|
-
import { defineComponent, openBlock, createElementBlock, createElementVNode,
|
1
|
+
import { defineComponent, ref, openBlock, createElementBlock, createElementVNode, Fragment, renderList, createBlock, resolveDynamicComponent, unref, withCtx, createVNode, markRaw, createCommentVNode, Transition, toDisplayString } from 'vue';
|
2
2
|
import { numberFormatter } from '../../utils/utils.js';
|
3
3
|
import IconCancel from '../../assets/icons/default/IconCancel.svg.js';
|
4
|
+
import IconMore from '../../assets/icons/default/IconMore.svg.js';
|
5
|
+
import _sfc_main$1 from '../DropdownMenu/WDropdownMenu.vue.js';
|
6
|
+
import _sfc_main$2 from './WButtonSelectionAction.vue.js';
|
7
|
+
import { HorizontalAlign } from '../../utils/HorizontalAlign.js';
|
8
|
+
import _sfc_main$3 from '../ClickOutside/WClickOutside.vue.js';
|
4
9
|
|
5
|
-
const _hoisted_1 = { class: "
|
6
|
-
const _hoisted_2 = { class: "flex
|
10
|
+
const _hoisted_1 = { class: "grid grid-cols-[1fr,auto] h-12 pb-3 w-full" };
|
11
|
+
const _hoisted_2 = { class: "flex" };
|
7
12
|
const _hoisted_3 = {
|
8
13
|
key: 0,
|
9
14
|
class: "flex gap-3 sm-not:gap-1"
|
@@ -16,14 +21,54 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
16
21
|
__name: "WButtonSelection",
|
17
22
|
props: {
|
18
23
|
title: {},
|
19
|
-
selectedLength: {}
|
24
|
+
selectedLength: {},
|
25
|
+
disableMessageMore: {}
|
20
26
|
},
|
21
27
|
emits: ["clear:selected"],
|
22
28
|
setup(__props) {
|
29
|
+
const isOpen = ref(false);
|
23
30
|
return (_ctx, _cache) => {
|
24
31
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
25
32
|
createElementVNode("div", _hoisted_2, [
|
26
|
-
|
33
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.$slots.default?.(), (slot, index) => {
|
34
|
+
return openBlock(), createBlock(resolveDynamicComponent(slot), {
|
35
|
+
key: index,
|
36
|
+
class: "border-r border-solid border-gray-300 dark:border-gray-700 last:border-r-0"
|
37
|
+
});
|
38
|
+
}), 128)),
|
39
|
+
_ctx.$slots.more?.()?.length ? (openBlock(), createBlock(_sfc_main$1, {
|
40
|
+
key: 0,
|
41
|
+
"is-open": isOpen.value,
|
42
|
+
"max-width": 200,
|
43
|
+
"max-height": 300,
|
44
|
+
"horizontal-align": unref(HorizontalAlign).RIGHT_INNER
|
45
|
+
}, {
|
46
|
+
toggle: withCtx(() => [
|
47
|
+
createVNode(_sfc_main$2, {
|
48
|
+
title: "More",
|
49
|
+
icon: markRaw(unref(IconMore)),
|
50
|
+
"disable-message": _ctx.disableMessageMore,
|
51
|
+
onClick: _cache[0] || (_cache[0] = ($event) => isOpen.value = !isOpen.value)
|
52
|
+
}, null, 8, ["icon", "disable-message"])
|
53
|
+
]),
|
54
|
+
content: withCtx(() => [
|
55
|
+
createVNode(_sfc_main$3, {
|
56
|
+
class: "my-2 grid grid-cols-1 bg-default dark:bg-default-dark shadow-md rounded-xl overflow-hidden dark:outline dark:outline-1 dark:outline-gray-800",
|
57
|
+
onClick: _cache[1] || (_cache[1] = ($event) => isOpen.value = false)
|
58
|
+
}, {
|
59
|
+
default: withCtx(() => [
|
60
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.$slots.more?.(), (slot, index) => {
|
61
|
+
return openBlock(), createBlock(resolveDynamicComponent(slot), {
|
62
|
+
key: index,
|
63
|
+
class: "first:pt-2 last:pb-2"
|
64
|
+
});
|
65
|
+
}), 128))
|
66
|
+
]),
|
67
|
+
_: 1
|
68
|
+
})
|
69
|
+
]),
|
70
|
+
_: 1
|
71
|
+
}, 8, ["is-open", "horizontal-align"])) : createCommentVNode("", true)
|
27
72
|
]),
|
28
73
|
createVNode(Transition, {
|
29
74
|
"enter-active-class": "transition-opacity",
|
@@ -40,7 +85,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
40
85
|
]),
|
41
86
|
createElementVNode("div", {
|
42
87
|
class: "relative text-description sm-not:-px--inner-margin px-[1.125rem] flex items-center cursor-pointer select-none w-ripple w-ripple-hover",
|
43
|
-
onClick: _cache[
|
88
|
+
onClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("clear:selected"))
|
44
89
|
}, [
|
45
90
|
createVNode(unref(IconCancel))
|
46
91
|
])
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { defineComponent, openBlock, createElementBlock,
|
1
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createBlock, resolveDynamicComponent, toDisplayString, withCtx, createCommentVNode } from 'vue';
|
2
2
|
import _sfc_main$1 from '../Tooltip/WTooltip.vue.js';
|
3
3
|
|
4
|
-
const _hoisted_1 =
|
5
|
-
const _hoisted_2 = ["
|
4
|
+
const _hoisted_1 = ["disabled"];
|
5
|
+
const _hoisted_2 = { class: "px-5 sm:px-[1.125rem] flex gap-2 items-center h-9" };
|
6
6
|
const _hoisted_3 = { class: "whitespace-nowrap font-normal text-base sm-not:hidden" };
|
7
7
|
const _hoisted_4 = { class: "whitespace-nowrap" };
|
8
8
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
@@ -16,26 +16,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
16
16
|
emits: ["click"],
|
17
17
|
setup(__props) {
|
18
18
|
return (_ctx, _cache) => {
|
19
|
-
return openBlock(), createElementBlock("
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
19
|
+
return openBlock(), createElementBlock("button", {
|
20
|
+
disabled: _ctx.disableMessage !== void 0,
|
21
|
+
class: normalizeClass(["relative select-none cursor-pointer no-underline outline-none bg-none disabled:text-description disabled:cursor-not-allowed", {
|
22
|
+
"w-ripple w-ripple-hover before:text-primary-default dark:before:text-primary-dark hover:text-primary-default dark:hover:text-primary-dark": !_ctx.disableMessage,
|
23
|
+
"text-primary-default dark:text-primary-dark": _ctx.active,
|
24
|
+
"text-accent": !_ctx.active
|
25
|
+
}]),
|
26
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click"))
|
27
|
+
}, [
|
28
|
+
createElementVNode("div", _hoisted_2, [
|
29
29
|
(openBlock(), createBlock(resolveDynamicComponent(_ctx.icon))),
|
30
30
|
createElementVNode("div", _hoisted_3, toDisplayString(_ctx.title), 1)
|
31
|
-
]
|
31
|
+
]),
|
32
32
|
_ctx.disableMessage ? (openBlock(), createBlock(_sfc_main$1, { key: 0 }, {
|
33
33
|
default: withCtx(() => [
|
34
34
|
createElementVNode("div", _hoisted_4, toDisplayString(_ctx.disableMessage), 1)
|
35
35
|
]),
|
36
36
|
_: 1
|
37
37
|
})) : createCommentVNode("", true)
|
38
|
-
]);
|
38
|
+
], 10, _hoisted_1);
|
39
39
|
};
|
40
40
|
}
|
41
41
|
});
|
@@ -18,6 +18,7 @@ declare const _default: <Data extends DefaultData>(__VLS_props: {
|
|
18
18
|
allowPageSelection?: boolean | undefined;
|
19
19
|
minHeight?: boolean | undefined;
|
20
20
|
pageClass?: string | undefined;
|
21
|
+
refetchInterval?: number | false | undefined;
|
21
22
|
"onUpdate:page"?: ((value: number | undefined) => any) | undefined;
|
22
23
|
skipScrollTarget?: boolean | undefined;
|
23
24
|
pageLength?: number | undefined;
|
@@ -84,6 +85,7 @@ declare const _default: <Data extends DefaultData>(__VLS_props: {
|
|
84
85
|
allowPageSelection?: boolean | undefined;
|
85
86
|
minHeight?: boolean | undefined;
|
86
87
|
pageClass?: string | undefined;
|
88
|
+
refetchInterval?: number | false | undefined;
|
87
89
|
"onUpdate:page"?: ((value: number | undefined) => any) | undefined;
|
88
90
|
skipScrollTarget?: boolean | undefined;
|
89
91
|
pageLength?: number | undefined;
|
@@ -154,6 +156,7 @@ declare const _default: <Data extends DefaultData>(__VLS_props: {
|
|
154
156
|
allowPageSelection?: boolean | undefined;
|
155
157
|
minHeight?: boolean | undefined;
|
156
158
|
pageClass?: string | undefined;
|
159
|
+
refetchInterval?: number | false | undefined;
|
157
160
|
"onUpdate:page"?: ((value: number | undefined) => any) | undefined;
|
158
161
|
skipScrollTarget?: boolean | undefined;
|
159
162
|
pageLength?: number | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WInfiniteList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/InfiniteList/WInfiniteList.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WInfiniteList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/InfiniteList/WInfiniteList.vue"],"names":[],"mappings":"AA4DA;;;;;iBAwQiB,WAAW;;;;;;;2BADD,OAAO,KAAK,OAAO;;;;;;;;;;;;;;;;;;;WA8BvC,GAAG;;;;oDAhMkC,IAAI;sBAClC,OAAO;qBACR,MAAM,IAAI;;;mBAGZ,OAAO;kBACR,OAAO;uBACF,OAAO;cACd,IAAI;0BACO,OAAO,MAAM,EAAE,KAAK,CAAC,KAAK,IAAI;;;;oDATL,IAAI;sBAClC,OAAO;qBACR,MAAM,IAAI;;;mBAGZ,OAAO;kBACR,OAAO;uBACF,OAAO;cACd,IAAI;0BACO,OAAO,MAAM,EAAE,KAAK,CAAC,KAAK,IAAI;;;YAvD3C,aAAa,SAAS,MAAM,GAAG,SAAS,GAAG,IAAI;YAC/C,uBAAuB,SAAS,MAAM,GAAG,IAAI;YAC7C,cAAc,SAAS,MAAM,GAAG,IAAI;YACpC,iBAAiB,UAAU,MAAM,EAAE,GAAG,IAAI;;;;OA0OuB,IAAI;;;;;qBA5B1D,WAAW;;;;;;;+BADD,OAAO,KAAK,OAAO;;;;;;;;;;;;;;;;;;;;;SA6ByB,IAAI;WACpE,GAAG;;;;oDAhMkC,IAAI;sBAClC,OAAO;qBACR,MAAM,IAAI;;;mBAGZ,OAAO;kBACR,OAAO;uBACF,OAAO;cACd,IAAI;0BACO,OAAO,MAAM,EAAE,KAAK,CAAC,KAAK,IAAI;;;;oDATL,IAAI;sBAClC,OAAO;qBACR,MAAM,IAAI;;;mBAGZ,OAAO;kBACR,OAAO;uBACF,OAAO;cACd,IAAI;0BACO,OAAO,MAAM,EAAE,KAAK,CAAC,KAAK,IAAI;;;YAvD3C,aAAa,SAAS,MAAM,GAAG,SAAS,GAAG,IAAI;YAC/C,uBAAuB,SAAS,MAAM,GAAG,IAAI;YAC7C,cAAc,SAAS,MAAM,GAAG,IAAI;YACpC,iBAAiB,UAAU,MAAM,EAAE,GAAG,IAAI;;;;;;;;;;yBA8M/B,WAAW;;;;;;;mCADD,OAAO,KAAK,OAAO;;;;;;;;;;;;;;;;;;;;;aA6ByB,IAAI;eACpE,GAAG;;;;wDAhMkC,IAAI;0BAClC,OAAO;yBACR,MAAM,IAAI;;;uBAGZ,OAAO;sBACR,OAAO;2BACF,OAAO;kBACd,IAAI;8BACO,OAAO,MAAM,EAAE,KAAK,CAAC,KAAK,IAAI;;;;wDATL,IAAI;0BAClC,OAAO;yBACR,MAAM,IAAI;;;uBAGZ,OAAO;sBACR,OAAO;2BACF,OAAO;kBACd,IAAI;8BACO,OAAO,MAAM,EAAE,KAAK,CAAC,KAAK,IAAI;;;gBAvD3C,aAAa,SAAS,MAAM,GAAG,SAAS,GAAG,IAAI;gBAC/C,uBAAuB,SAAS,MAAM,GAAG,IAAI;gBAC7C,cAAc,SAAS,MAAM,GAAG,IAAI;gBACpC,iBAAiB,UAAU,MAAM,EAAE,GAAG,IAAI;;;;AAnDhD,wBAmS2E;AAQ3E,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -27,7 +27,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
27
27
|
reverseSelection: { type: Boolean },
|
28
28
|
allowPageSelection: { type: Boolean },
|
29
29
|
pageClass: { default: void 0 },
|
30
|
-
maxPages: { default: void 0 }
|
30
|
+
maxPages: { default: void 0 },
|
31
|
+
refetchInterval: { type: [Number, Boolean], default: void 0 }
|
31
32
|
},
|
32
33
|
emits: ["update:page", "update:header-padding", "update:count", "update:selected"],
|
33
34
|
setup(__props, { expose: __expose, emit: __emit }) {
|
@@ -98,6 +99,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
98
99
|
"allow-page-selection": _ctx.allowPageSelection,
|
99
100
|
"page-class": _ctx.pageClass,
|
100
101
|
"max-pages": _ctx.maxPages,
|
102
|
+
"refetch-interval": _ctx.refetchInterval,
|
101
103
|
"onUpdate:count": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:count", $event)),
|
102
104
|
"onUpdate:selected": _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:selected", $event)),
|
103
105
|
"onUpdate:page": _cache[2] || (_cache[2] = ($event) => _ctx.$emit("update:page", $event))
|
@@ -116,7 +118,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
116
118
|
})
|
117
119
|
]),
|
118
120
|
_: 3
|
119
|
-
}, 8, ["query-params", "use-query-fn", "is-invalid-page", "scrolling-element", "skip-scroll-target", "skeleton-length", "hide-page-title", "selected", "wrap", "no-gap", "transition", "page-length", "header-top", "header-height", "min-height", "exclude-params", "empty-stub", "select-only", "unselect-only", "reverse-selection", "allow-page-selection", "page-class", "max-pages"])
|
121
|
+
}, 8, ["query-params", "use-query-fn", "is-invalid-page", "scrolling-element", "skip-scroll-target", "skeleton-length", "hide-page-title", "selected", "wrap", "no-gap", "transition", "page-length", "header-top", "header-height", "min-height", "exclude-params", "empty-stub", "select-only", "unselect-only", "reverse-selection", "allow-page-selection", "page-class", "max-pages", "refetch-interval"])
|
120
122
|
], 64);
|
121
123
|
};
|
122
124
|
}
|
@@ -18,6 +18,7 @@ declare const _default: <Data extends DefaultData>(__VLS_props: {
|
|
18
18
|
allowPageSelection?: boolean | undefined;
|
19
19
|
minHeight?: boolean | undefined;
|
20
20
|
pageClass?: string | undefined;
|
21
|
+
refetchInterval?: number | false | undefined;
|
21
22
|
"onUpdate:page"?: ((value: number | undefined) => any) | undefined;
|
22
23
|
skipScrollTarget?: boolean | undefined;
|
23
24
|
pageLength?: number | undefined;
|
@@ -80,6 +81,7 @@ declare const _default: <Data extends DefaultData>(__VLS_props: {
|
|
80
81
|
allowPageSelection?: boolean | undefined;
|
81
82
|
minHeight?: boolean | undefined;
|
82
83
|
pageClass?: string | undefined;
|
84
|
+
refetchInterval?: number | false | undefined;
|
83
85
|
"onUpdate:page"?: ((value: number | undefined) => any) | undefined;
|
84
86
|
skipScrollTarget?: boolean | undefined;
|
85
87
|
pageLength?: number | undefined;
|
@@ -146,6 +148,7 @@ declare const _default: <Data extends DefaultData>(__VLS_props: {
|
|
146
148
|
allowPageSelection?: boolean | undefined;
|
147
149
|
minHeight?: boolean | undefined;
|
148
150
|
pageClass?: string | undefined;
|
151
|
+
refetchInterval?: number | false | undefined;
|
149
152
|
"onUpdate:page"?: ((value: number | undefined) => any) | undefined;
|
150
153
|
skipScrollTarget?: boolean | undefined;
|
151
154
|
pageLength?: number | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WInfiniteListPages.vue.d.ts","sourceRoot":"","sources":["../../../src/components/InfiniteList/WInfiniteListPages.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WInfiniteListPages.vue.d.ts","sourceRoot":"","sources":["../../../src/components/InfiniteList/WInfiniteListPages.vue"],"names":[],"mappings":"AA2EA;;;;;iBA0biB,WAAW;;;;;;;2BADD,OAAO,KAAK,OAAO;;;;;;;;;;;;;;;;;;WA8BvC,GAAG;;;;oDAtRkC,IAAI;sBAClC,OAAO;qBACR,MAAM,IAAI;;;mBAGZ,OAAO;kBACR,OAAO;uBACF,OAAO;cACd,IAAI;;;;oDARgC,IAAI;sBAClC,OAAO;qBACR,MAAM,IAAI;;;mBAGZ,OAAO;kBACR,OAAO;uBACF,OAAO;cACd,IAAI;;;YA7IN,aAAa,SAAS,MAAM,GAAG,SAAS,GAAG,IAAI;YAC/C,cAAc,SAAS,MAAM,GAAG,IAAI;YACpC,iBAAiB,UAAU,MAAM,EAAE,GAAG,IAAI;;;;OAwZuB,IAAI;;;;;qBA5B1D,WAAW;;;;;;;+BADD,OAAO,KAAK,OAAO;;;;;;;;;;;;;;;;;;;;SA6ByB,IAAI;WACpE,GAAG;;;;oDAtRkC,IAAI;sBAClC,OAAO;qBACR,MAAM,IAAI;;;mBAGZ,OAAO;kBACR,OAAO;uBACF,OAAO;cACd,IAAI;;;;oDARgC,IAAI;sBAClC,OAAO;qBACR,MAAM,IAAI;;;mBAGZ,OAAO;kBACR,OAAO;uBACF,OAAO;cACd,IAAI;;;YA7IN,aAAa,SAAS,MAAM,GAAG,SAAS,GAAG,IAAI;YAC/C,cAAc,SAAS,MAAM,GAAG,IAAI;YACpC,iBAAiB,UAAU,MAAM,EAAE,GAAG,IAAI;;;;;;;;;;yBA4X/B,WAAW;;;;;;;mCADD,OAAO,KAAK,OAAO;;;;;;;;;;;;;;;;;;;;aA6ByB,IAAI;eACpE,GAAG;;;;wDAtRkC,IAAI;0BAClC,OAAO;yBACR,MAAM,IAAI;;;uBAGZ,OAAO;sBACR,OAAO;2BACF,OAAO;kBACd,IAAI;;;;wDARgC,IAAI;0BAClC,OAAO;yBACR,MAAM,IAAI;;;uBAGZ,OAAO;sBACR,OAAO;2BACF,OAAO;kBACd,IAAI;;;gBA7IN,aAAa,SAAS,MAAM,GAAG,SAAS,GAAG,IAAI;gBAC/C,cAAc,SAAS,MAAM,GAAG,IAAI;gBACpC,iBAAiB,UAAU,MAAM,EAAE,GAAG,IAAI;;;;AAnDhD,wBAid2E;AAQ3E,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -31,7 +31,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
31
31
|
reverseSelection: { type: Boolean },
|
32
32
|
allowPageSelection: { type: Boolean },
|
33
33
|
pageClass: { default: void 0 },
|
34
|
-
maxPages: { default: 5 }
|
34
|
+
maxPages: { default: 5 },
|
35
|
+
refetchInterval: { type: [Number, Boolean], default: void 0 }
|
35
36
|
},
|
36
37
|
emits: ["update:page", "update:count", "update:selected"],
|
37
38
|
setup(__props, { expose: __expose, emit: __emit }) {
|
@@ -177,6 +178,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
177
178
|
"allow-page-selection": _ctx.allowPageSelection,
|
178
179
|
"min-height": _ctx.minHeight,
|
179
180
|
"page-class": _ctx.pageClass,
|
181
|
+
"refetch-interval": _ctx.refetchInterval,
|
182
|
+
"scrolling-element": _ctx.scrollingElement,
|
180
183
|
class: normalizeClass({
|
181
184
|
"last:min-h-[calc(100vh-var(--header-height)-var(--infinite-list-header-height))] last:pb-16": !_ctx.minHeight
|
182
185
|
}),
|
@@ -214,7 +217,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
214
217
|
})
|
215
218
|
]),
|
216
219
|
_: 2
|
217
|
-
}, 1032, ["query-params", "use-query-fn", "is-invalid-page", "skeleton-length", "first-page", "last-page", "hide-page-title", "selected", "wrap", "no-gap", "transition", "resetting", "empty-stub", "select-only", "unselect-only", "reverse-selection", "allow-page-selection", "min-height", "page-class", "class", "onRefetch"]);
|
220
|
+
}, 1032, ["query-params", "use-query-fn", "is-invalid-page", "skeleton-length", "first-page", "last-page", "hide-page-title", "selected", "wrap", "no-gap", "transition", "resetting", "empty-stub", "select-only", "unselect-only", "reverse-selection", "allow-page-selection", "min-height", "page-class", "refetch-interval", "scrolling-element", "class", "onRefetch"]);
|
218
221
|
}), 128)),
|
219
222
|
count.value !== 0 && nextPage.value ? (openBlock(), createBlock(_sfc_main$2, {
|
220
223
|
key: 1,
|
@@ -1,6 +1,7 @@
|
|
1
1
|
declare const _default: <Data extends DefaultData>(__VLS_props: {
|
2
2
|
transition?: boolean | undefined;
|
3
3
|
wrap?: boolean | undefined;
|
4
|
+
scrollingElement?: Element | null | undefined;
|
4
5
|
queryParams: QueryParams;
|
5
6
|
"onUpdate:selected"?: ((values: number[]) => any) | undefined;
|
6
7
|
selected?: number[] | undefined;
|
@@ -28,6 +29,7 @@ declare const _default: <Data extends DefaultData>(__VLS_props: {
|
|
28
29
|
allowPageSelection?: boolean | undefined;
|
29
30
|
minHeight?: boolean | undefined;
|
30
31
|
pageClass?: string | undefined;
|
32
|
+
refetchInterval?: number | false | undefined;
|
31
33
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, __VLS_ctx?: {
|
32
34
|
attrs: any;
|
33
35
|
slots: Readonly<{
|
@@ -73,6 +75,7 @@ declare const _default: <Data extends DefaultData>(__VLS_props: {
|
|
73
75
|
props: {
|
74
76
|
transition?: boolean | undefined;
|
75
77
|
wrap?: boolean | undefined;
|
78
|
+
scrollingElement?: Element | null | undefined;
|
76
79
|
queryParams: QueryParams;
|
77
80
|
"onUpdate:selected"?: ((values: number[]) => any) | undefined;
|
78
81
|
selected?: number[] | undefined;
|
@@ -100,6 +103,7 @@ declare const _default: <Data extends DefaultData>(__VLS_props: {
|
|
100
103
|
allowPageSelection?: boolean | undefined;
|
101
104
|
minHeight?: boolean | undefined;
|
102
105
|
pageClass?: string | undefined;
|
106
|
+
refetchInterval?: number | false | undefined;
|
103
107
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
104
108
|
expose(exposed: import("vue").ShallowUnwrapRef<{
|
105
109
|
getFirst: () => Data | undefined;
|
@@ -149,6 +153,7 @@ declare const _default: <Data extends DefaultData>(__VLS_props: {
|
|
149
153
|
props: {
|
150
154
|
transition?: boolean | undefined;
|
151
155
|
wrap?: boolean | undefined;
|
156
|
+
scrollingElement?: Element | null | undefined;
|
152
157
|
queryParams: QueryParams;
|
153
158
|
"onUpdate:selected"?: ((values: number[]) => any) | undefined;
|
154
159
|
selected?: number[] | undefined;
|
@@ -176,6 +181,7 @@ declare const _default: <Data extends DefaultData>(__VLS_props: {
|
|
176
181
|
allowPageSelection?: boolean | undefined;
|
177
182
|
minHeight?: boolean | undefined;
|
178
183
|
pageClass?: string | undefined;
|
184
|
+
refetchInterval?: number | false | undefined;
|
179
185
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
180
186
|
expose(exposed: import("vue").ShallowUnwrapRef<{
|
181
187
|
getFirst: () => Data | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"InfiniteListPage.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/InfiniteList/components/InfiniteListPage.vue"],"names":[],"mappings":"AAsHA
|
1
|
+
{"version":3,"file":"InfiniteListPage.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/InfiniteList/components/InfiniteListPage.vue"],"names":[],"mappings":"AAsHA;;;;;iBAwdiB,WAAW;;;;;;;;;;;;;;;2BAED,OAAO,KAAK,OAAO;oBAC1B,MAAM;eACX,OAAO;cACR,OAAO;;;;;;;;;;;WAuBd,GAAG;;;;oDApSkC,IAAI;sBAClC,OAAO;qBACR,MAAM,IAAI;;;mBAGZ,OAAO;kBACR,OAAO;cACT,IAAI;;;;oDAPgC,IAAI;sBAClC,OAAO;qBACR,MAAM,IAAI;;;mBAGZ,OAAO;kBACR,OAAO;cACT,IAAI;;;YAtKN,cAAc,SAAS,MAAM,GAAG,IAAI;YACpC,mBAAmB,SAAS,MAAM,GAAG,IAAI;YACzC,iBAAiB,SAAS,MAAM,GAAG,IAAI,GAAG,IAAI;YAC9C,qBAAqB,SAAS,MAAM,GAAG,IAAI,GAAG,IAAI;YAClD,eAAe,SAAS,MAAM,GAAG,IAAI;YACrC,mBAAmB,SAAS,MAAM,GAAG,IAAI;YACzC,SAAS,GAAG,IAAI;YAChB,2BAA2B,GAAG,IAAI;YAClC,iBAAiB,UAAU,MAAM,EAAE,GAAG,IAAI;YAC1C,SAAS,GAAG,IAAI;;;;;;OAybiD,IAAI;;;;;qBA3B1D,WAAW;;;;;;;;;;;;;;;+BAED,OAAO,KAAK,OAAO;wBAC1B,MAAM;mBACX,OAAO;kBACR,OAAO;;;;;;;;;;;;;;;SAsBkD,IAAI;WACpE,GAAG;;;;oDApSkC,IAAI;sBAClC,OAAO;qBACR,MAAM,IAAI;;;mBAGZ,OAAO;kBACR,OAAO;cACT,IAAI;;;;oDAPgC,IAAI;sBAClC,OAAO;qBACR,MAAM,IAAI;;;mBAGZ,OAAO;kBACR,OAAO;cACT,IAAI;;;YAtKN,cAAc,SAAS,MAAM,GAAG,IAAI;YACpC,mBAAmB,SAAS,MAAM,GAAG,IAAI;YACzC,iBAAiB,SAAS,MAAM,GAAG,IAAI,GAAG,IAAI;YAC9C,qBAAqB,SAAS,MAAM,GAAG,IAAI,GAAG,IAAI;YAClD,eAAe,SAAS,MAAM,GAAG,IAAI;YACrC,mBAAmB,SAAS,MAAM,GAAG,IAAI;YACzC,SAAS,GAAG,IAAI;YAChB,2BAA2B,GAAG,IAAI;YAClC,iBAAiB,UAAU,MAAM,EAAE,GAAG,IAAI;YAC1C,SAAS,GAAG,IAAI;;;;;;;;;;yBA8ZL,WAAW;;;;;;;;;;;;;;;mCAED,OAAO,KAAK,OAAO;4BAC1B,MAAM;uBACX,OAAO;sBACR,OAAO;;;;;;;;;;;;;;;aAsBkD,IAAI;eACpE,GAAG;;;;wDApSkC,IAAI;0BAClC,OAAO;yBACR,MAAM,IAAI;;;uBAGZ,OAAO;sBACR,OAAO;kBACT,IAAI;;;;wDAPgC,IAAI;0BAClC,OAAO;yBACR,MAAM,IAAI;;;uBAGZ,OAAO;sBACR,OAAO;kBACT,IAAI;;;gBAtKN,cAAc,SAAS,MAAM,GAAG,IAAI;gBACpC,mBAAmB,SAAS,MAAM,GAAG,IAAI;gBACzC,iBAAiB,SAAS,MAAM,GAAG,IAAI,GAAG,IAAI;gBAC9C,qBAAqB,SAAS,MAAM,GAAG,IAAI,GAAG,IAAI;gBAClD,eAAe,SAAS,MAAM,GAAG,IAAI;gBACrC,mBAAmB,SAAS,MAAM,GAAG,IAAI;gBACzC,SAAS,GAAG,IAAI;gBAChB,2BAA2B,GAAG,IAAI;gBAClC,iBAAiB,UAAU,MAAM,EAAE,GAAG,IAAI;gBAC1C,SAAS,GAAG,IAAI;;;;AAnDtB,wBAkf2E;AAQ3E,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { defineComponent, ref, toRef, computed, watch, onMounted, nextTick, openBlock, createElementBlock, unref, Fragment, createElementVNode, normalizeClass, createBlock, createCommentVNode, TransitionGroup, withCtx, renderList, renderSlot, toDisplayString } from 'vue';
|
1
|
+
import { defineComponent, ref, toRef, computed, watch, onMounted, nextTick, onBeforeUnmount, openBlock, createElementBlock, unref, Fragment, createElementVNode, normalizeClass, createBlock, createCommentVNode, TransitionGroup, withCtx, renderList, renderSlot, toDisplayString } from 'vue';
|
2
2
|
import _sfc_main$2 from './InfiniteListPageTitle.vue.js';
|
3
3
|
import _sfc_main$1 from './InfiniteListPageSelection.vue.js';
|
4
4
|
|
@@ -25,14 +25,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
25
25
|
reverseSelection: { type: Boolean },
|
26
26
|
allowPageSelection: { type: Boolean },
|
27
27
|
minHeight: { type: Boolean },
|
28
|
-
pageClass: { default: void 0 }
|
28
|
+
pageClass: { default: void 0 },
|
29
|
+
refetchInterval: { type: [Number, Boolean], default: void 0 },
|
30
|
+
scrollingElement: { default: void 0 }
|
29
31
|
},
|
30
32
|
emits: ["update:count", "update:pagesCount", "update:nextPage", "update:previousPage", "update:scroll", "error:invalidPage", "refetch", "update-from-header:scroll", "update:selected", "fetched"],
|
31
33
|
setup(__props, { expose: __expose, emit: __emit }) {
|
32
34
|
const props = __props;
|
33
35
|
const emit = __emit;
|
34
36
|
const element = ref();
|
35
|
-
const
|
37
|
+
const isIntersecting = ref(false);
|
38
|
+
const { data, error, setData, refetch, isFetching } = props.useQueryFn(
|
39
|
+
toRef(props, "queryParams"),
|
40
|
+
{
|
41
|
+
refetchInterval: props.refetchInterval ? computed(() => isIntersecting.value ? props.refetchInterval : void 0) : void 0
|
42
|
+
}
|
43
|
+
);
|
36
44
|
const count = computed(() => data.value?.count);
|
37
45
|
const pagesCount = computed(() => data.value?.pages_count);
|
38
46
|
const nextPage = computed(() => data.value?.next);
|
@@ -96,7 +104,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
96
104
|
emit("fetched");
|
97
105
|
});
|
98
106
|
let height = 0;
|
107
|
+
let intersectionObserver;
|
108
|
+
const observerCb = (entries) => {
|
109
|
+
isIntersecting.value = entries.some((entry) => {
|
110
|
+
if (entry.target === element.value) {
|
111
|
+
return entry.isIntersecting;
|
112
|
+
}
|
113
|
+
});
|
114
|
+
};
|
99
115
|
onMounted(() => {
|
116
|
+
if (props.refetchInterval && element.value) {
|
117
|
+
intersectionObserver = new IntersectionObserver(
|
118
|
+
observerCb,
|
119
|
+
{
|
120
|
+
root: props.scrollingElement ?? null,
|
121
|
+
rootMargin: "0px",
|
122
|
+
threshold: 0
|
123
|
+
}
|
124
|
+
);
|
125
|
+
intersectionObserver.observe(element.value);
|
126
|
+
}
|
100
127
|
height = element.value?.getBoundingClientRect()?.height ?? 0;
|
101
128
|
if (height === 0)
|
102
129
|
return;
|
@@ -109,6 +136,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
109
136
|
}
|
110
137
|
emit("update:scroll", height);
|
111
138
|
});
|
139
|
+
onBeforeUnmount(() => {
|
140
|
+
intersectionObserver?.disconnect();
|
141
|
+
intersectionObserver = void 0;
|
142
|
+
});
|
112
143
|
watch(data, async (_, oldValue) => {
|
113
144
|
if (oldValue)
|
114
145
|
return;
|