eco-vue-js 0.3.82 → 0.3.84

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,10 +18,12 @@ 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;
24
25
  excludeParams?: string[] | undefined;
26
+ maxPages?: number | undefined;
25
27
  "onUpdate:header-padding"?: ((value: number) => any) | undefined;
26
28
  headerMargin?: number | undefined;
27
29
  headerTopIgnore?: boolean | undefined;
@@ -83,10 +85,12 @@ declare const _default: <Data extends DefaultData>(__VLS_props: {
83
85
  allowPageSelection?: boolean | undefined;
84
86
  minHeight?: boolean | undefined;
85
87
  pageClass?: string | undefined;
88
+ refetchInterval?: number | false | undefined;
86
89
  "onUpdate:page"?: ((value: number | undefined) => any) | undefined;
87
90
  skipScrollTarget?: boolean | undefined;
88
91
  pageLength?: number | undefined;
89
92
  excludeParams?: string[] | undefined;
93
+ maxPages?: number | undefined;
90
94
  "onUpdate:header-padding"?: ((value: number) => any) | undefined;
91
95
  headerMargin?: number | undefined;
92
96
  headerTopIgnore?: boolean | undefined;
@@ -152,10 +156,12 @@ declare const _default: <Data extends DefaultData>(__VLS_props: {
152
156
  allowPageSelection?: boolean | undefined;
153
157
  minHeight?: boolean | undefined;
154
158
  pageClass?: string | undefined;
159
+ refetchInterval?: number | false | undefined;
155
160
  "onUpdate:page"?: ((value: number | undefined) => any) | undefined;
156
161
  skipScrollTarget?: boolean | undefined;
157
162
  pageLength?: number | undefined;
158
163
  excludeParams?: string[] | undefined;
164
+ maxPages?: number | undefined;
159
165
  "onUpdate:header-padding"?: ((value: number) => any) | undefined;
160
166
  headerMargin?: number | undefined;
161
167
  headerTopIgnore?: boolean | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"WInf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AAS,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"}
@@ -26,7 +26,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
26
26
  unselectOnly: { type: Boolean },
27
27
  reverseSelection: { type: Boolean },
28
28
  allowPageSelection: { type: Boolean },
29
- pageClass: { default: void 0 }
29
+ pageClass: { default: void 0 },
30
+ maxPages: { default: void 0 },
31
+ refetchInterval: { type: [Number, Boolean], default: void 0 }
30
32
  },
31
33
  emits: ["update:page", "update:header-padding", "update:count", "update:selected"],
32
34
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -96,6 +98,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
96
98
  "reverse-selection": _ctx.reverseSelection,
97
99
  "allow-page-selection": _ctx.allowPageSelection,
98
100
  "page-class": _ctx.pageClass,
101
+ "max-pages": _ctx.maxPages,
102
+ "refetch-interval": _ctx.refetchInterval,
99
103
  "onUpdate:count": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:count", $event)),
100
104
  "onUpdate:selected": _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:selected", $event)),
101
105
  "onUpdate:page": _cache[2] || (_cache[2] = ($event) => _ctx.$emit("update:page", $event))
@@ -114,7 +118,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
114
118
  })
115
119
  ]),
116
120
  _: 3
117
- }, 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"])
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"])
118
122
  ], 64);
119
123
  };
120
124
  }
@@ -18,12 +18,14 @@ 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;
24
25
  headerTop?: number | undefined;
25
26
  headerHeight?: number | undefined;
26
27
  excludeParams?: string[] | undefined;
28
+ maxPages?: number | undefined;
27
29
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, __VLS_ctx?: {
28
30
  attrs: any;
29
31
  slots: Readonly<{
@@ -79,12 +81,14 @@ declare const _default: <Data extends DefaultData>(__VLS_props: {
79
81
  allowPageSelection?: boolean | undefined;
80
82
  minHeight?: boolean | undefined;
81
83
  pageClass?: string | undefined;
84
+ refetchInterval?: number | false | undefined;
82
85
  "onUpdate:page"?: ((value: number | undefined) => any) | undefined;
83
86
  skipScrollTarget?: boolean | undefined;
84
87
  pageLength?: number | undefined;
85
88
  headerTop?: number | undefined;
86
89
  headerHeight?: number | undefined;
87
90
  excludeParams?: string[] | undefined;
91
+ maxPages?: number | undefined;
88
92
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
89
93
  expose(exposed: import("vue").ShallowUnwrapRef<{
90
94
  resetPage: () => void;
@@ -144,12 +148,14 @@ declare const _default: <Data extends DefaultData>(__VLS_props: {
144
148
  allowPageSelection?: boolean | undefined;
145
149
  minHeight?: boolean | undefined;
146
150
  pageClass?: string | undefined;
151
+ refetchInterval?: number | false | undefined;
147
152
  "onUpdate:page"?: ((value: number | undefined) => any) | undefined;
148
153
  skipScrollTarget?: boolean | undefined;
149
154
  pageLength?: number | undefined;
150
155
  headerTop?: number | undefined;
151
156
  headerHeight?: number | undefined;
152
157
  excludeParams?: string[] | undefined;
158
+ maxPages?: number | undefined;
153
159
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
154
160
  expose(exposed: import("vue").ShallowUnwrapRef<{
155
161
  resetPage: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"WInfiniteListPages.vue.d.ts","sourceRoot":"","sources":["../../../src/components/InfiniteList/WInfiniteListPages.vue"],"names":[],"mappings":"AAyEA;;;;;iBAsbiB,WAAW;;;;;;;2BADD,OAAO,KAAK,OAAO;;;;;;;;;;;;;;;;WA4BvC,GAAG;;;;oDAlRkC,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;;;;OAoZuB,IAAI;;;;;qBA1B1D,WAAW;;;;;;;+BADD,OAAO,KAAK,OAAO;;;;;;;;;;;;;;;;;;SA2ByB,IAAI;WACpE,GAAG;;;;oDAlRkC,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;;;;;;;;;;yBA0X/B,WAAW;;;;;;;mCADD,OAAO,KAAK,OAAO;;;;;;;;;;;;;;;;;;aA2ByB,IAAI;eACpE,GAAG;;;;wDAlRkC,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;;;;AAjDhD,wBA2c2E;AAQ3E,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
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"}
@@ -6,7 +6,6 @@ import _sfc_main$2 from './components/InfiniteListButton.vue.js';
6
6
  import { isEqualObj } from '../../utils/utils.js';
7
7
  import { getIsScrollDown } from './models/utils.js';
8
8
 
9
- const MAX_PAGES = 5;
10
9
  const _sfc_main = /* @__PURE__ */ defineComponent({
11
10
  __name: "WInfiniteListPages",
12
11
  props: {
@@ -31,7 +30,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
31
30
  unselectOnly: { type: Boolean },
32
31
  reverseSelection: { type: Boolean },
33
32
  allowPageSelection: { type: Boolean },
34
- pageClass: { default: void 0 }
33
+ pageClass: { default: void 0 },
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 }) {
@@ -84,7 +85,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
84
85
  pages.value.push(nextPage.value);
85
86
  if (!silent)
86
87
  emit("update:page", nextPage.value);
87
- if (pages.value.length < MAX_PAGES)
88
+ if (pages.value.length < props.maxPages)
88
89
  return;
89
90
  const firstPage = pages.value.shift();
90
91
  if (firstPage === void 0)
@@ -99,7 +100,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
99
100
  pages.value.unshift(previousPage.value);
100
101
  if (!silent)
101
102
  emit("update:page", previousPage.value);
102
- if (pages.value.length < MAX_PAGES)
103
+ if (pages.value.length < props.maxPages)
103
104
  return;
104
105
  const lastPage = pages.value.pop();
105
106
  if (lastPage === void 0)
@@ -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;;;;iBAibiB,WAAW;;;;;;;;;;;;;;;2BAED,OAAO,KAAK,OAAO;oBAC1B,MAAM;eACX,OAAO;cACR,OAAO;;;;;;;;;;WAqBd,GAAG;;;;oDAhSkC,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;;;YArIN,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;Y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G,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;;;;AA/CtB,wBAyc2E;AAQ3E,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
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,SA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I,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 { data, error, setData, refetch, isFetching } = props.useQueryFn(toRef(props, "queryParams"));
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;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/rsmple/eco-vue-js.git"
6
6
  },
7
- "version": "0.3.82",
7
+ "version": "0.3.84",
8
8
  "scripts": {
9
9
  "dev": "vite",
10
10
  "build": "run-p type-check build-only",