eco-vue-js 0.9.21 → 0.9.22

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.
@@ -1 +1 @@
1
- {"version":3,"file":"InfiniteListPage.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/InfiniteList/components/InfiniteListPage.vue"],"names":[],"mappings":"yBAgXiB,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,WAAW,eACvE,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WA4cxD,mBAAmB,CAAC;qBAxcb,WAAW;oBACZ,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC;wBAChC,MAAM;mBACX,OAAO;kBACR,OAAO;wBACD,OAAO;eAChB,OAAO;gBACN,OAAO;qBACF,OAAO;oBACR,OAAO;oBACP,MAAM;oBACN,OAAO;oBACP,OAAO;oBACP,MAAM;0BACA,MAAM,GAAG,KAAK;2BACb,OAAO,GAAG,IAAI;uBAClB,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;mBAElD,KAAK,EAAE;qBACL,CAAC,IAAI,EAAE,IAAI,KAAK,KAAK;qBACrB,OAAO;uBACL,OAAO;2BACH,OAAO;6BACL,OAAO;KAibuD,CAAC,4BAA2B;oBAChG,OAAO,KAAK,EAAE,gBAAgB;;;;2BAjWvB,MAAM;MAiWuC,GAAG,IAAI;WACpE,GAAG;;kBAhPD,CAAC,KAAK,EAAE;YAChB,IAAI,EAAE,IAAI,CAAA;YACV,MAAM,EAAE,CAAC,OAAO,CAA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,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":"yBA4WiB,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,WAAW,eACvE,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WAscxD,mBAAmB,CAAC;qBAlcb,WAAW;oBACZ,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC;wBAChC,MAAM;mBACX,OAAO;kBACR,OAAO;wBACD,OAAO;eAChB,OAAO;gBACN,OAAO;qBACF,OAAO;oBACR,OAAO;oBACP,MAAM;oBACN,OAAO;oBACP,OAAO;oBACP,MAAM;0BACA,MAAM,GAAG,KAAK;2BACb,OAAO,GAAG,IAAI;uBAClB,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;mBAElD,KAAK,EAAE;qBACL,CAAC,IAAI,EAAE,IAAI,KAAK,KAAK;qBACrB,OAAO;uBACL,OAAO;2BACH,OAAO;6BACL,OAAO;KA2auD,CAAC,4BAA2B;oBAChG,OAAO,KAAK,EAAE,gBAAgB;;;;2BA3VvB,MAAM;MA2VuC,GAAG,IAAI;WACpE,GAAG;;kBA1OD,CAAC,KAAK,EAAE;YAChB,IAAI,EAAE,IAAI,CAAA;YACV,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,GAAG,SAAS,KAAK,IAAI,CAAA;YAC5C,QAAQ,EAAE,O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+1,4 @@
1
- import { defineComponent, useTemplateRef, ref, toRef, computed, watch, onMounted, nextTick, onBeforeUnmount, openBlock, createElementBlock, normalizeClass, unref, Fragment, createElementVNode, createBlock, createCommentVNode, resolveDynamicComponent, TransitionGroup, normalizeProps, mergeProps, withCtx, renderList, renderSlot, toDisplayString } from 'vue';
1
+ import { defineComponent, useTemplateRef, ref, toRef, computed, watch, onMounted, nextTick, onBeforeUnmount, openBlock, createElementBlock, unref, Fragment, createElementVNode, normalizeClass, createBlock, createCommentVNode, resolveDynamicComponent, TransitionGroup, normalizeProps, mergeProps, withCtx, renderList, renderSlot, toDisplayString } from 'vue';
2
2
  import _sfc_main$3 from '../../EmptyComponent/WEmptyComponent.vue.js';
3
3
  import '../../Button/WButtonAction.vue.js';
4
4
  import '../../Button/WButton.vue.js';
@@ -15,7 +15,11 @@ import '../../Input/WInputDate.vue.js';
15
15
  import '../../Link/WLink.vue.js';
16
16
  import '@tanstack/vue-query';
17
17
 
18
- const _hoisted_1 = { class: "py-1.25 sm-not:px-3 cursor-default select-none" };
18
+ const _hoisted_1 = {
19
+ ref: "element",
20
+ class: "relative"
21
+ };
22
+ const _hoisted_2 = { class: "py-1.25 sm-not:px-3 cursor-default select-none" };
19
23
  const _sfc_main = /* @__PURE__ */ defineComponent({
20
24
  __name: "InfiniteListPage",
21
25
  props: {
@@ -170,13 +174,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
170
174
  scrollTo
171
175
  });
172
176
  return (_ctx, _cache) => {
173
- return openBlock(), createElementBlock("div", {
174
- ref: "element",
175
- class: normalizeClass(["relative", {
176
- "last:min-h-[calc(100vh-var(--header-height)-var(--infinite-list-header-height))] last:pb-16": !_ctx.minHeight,
177
- "last:min-h-full": _ctx.minHeight && !unref(data)
178
- }])
179
- }, [
177
+ return openBlock(), createElementBlock("div", _hoisted_1, [
180
178
  page.value && unref(data)?.results.length !== 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
181
179
  createElementVNode("div", {
182
180
  class: normalizeClass(["flex", {
@@ -269,9 +267,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
269
267
  "pb-2": _ctx.minHeight && !_ctx.lastChild
270
268
  }])
271
269
  }, [
272
- createElementVNode("div", _hoisted_1, toDisplayString(_ctx.emptyStub), 1)
270
+ createElementVNode("div", _hoisted_2, toDisplayString(_ctx.emptyStub), 1)
273
271
  ], 2))
274
- ], 2);
272
+ ], 512);
275
273
  };
276
274
  }
277
275
  });
@@ -1 +1 @@
1
- {"version":3,"file":"InfiniteListPages.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/InfiniteList/components/InfiniteListPages.vue"],"names":[],"mappings":"yBAgUiB,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,WAAW,eACvE,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WAglBxD,mBAAmB,CAAC;;;;;oBA5kBd,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC;qBACnC,WAAW;yBACP,MAAM;wBACP,OAAO;eAChB,OAAO;gBACN,OAAO;qBACF,OAAO;qBACP,MAAM;2BACA,OAAO,GAAG,IAAI;oBACrB,MAAM;uBACH,MAAM;oBACT,OAAO;oBACP,OAAO;wBACH,CAAC,MAAM,WAAW,CAAC,EAAE;oBACzB,MAAM;oBACN,MAAM;mBACP,MAAM;0BACC,MAAM,GAAG,KAAK;uBACjB,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;mBAElD,KAAK,EAAE;qBACL,CAAC,IAAI,EAAE,IAAI,KAAK,KAAK;qBACrB,O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CAAC,OAAO,WAAW,CAAC;;AA1lBvE,wBA0lB4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"InfiniteListPages.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/InfiniteList/components/InfiniteListPages.vue"],"names":[],"mappings":"yBA2UiB,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,WAAW,eACvE,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WAgmBxD,mBAAmB,CAAC;;;;;oBA5lBd,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC;qBACnC,WAAW;yBACP,MAAM;wBACP,OAAO;eAChB,OAAO;gBACN,OAAO;qBACF,OAAO;qBACP,MAAM;2BACA,OAAO,GAAG,IAAI;oBACrB,MAAM;uBACH,MAAM;oBACT,OAAO;oBACP,OAAO;wBACH,CAAC,MAAM,WAAW,CAAC,EAAE;oBACzB,MAAM;oBACN,MAAM;mBACP,MAAM;0BACC,MAAM,GAAG,KAAK;uBACjB,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;mBAElD,KAAK,EAAE;qBACL,CAAC,IAAI,EAAE,IAAI,KAAK,KAAK;qBACrB,OAAO;uBACL,OAAO;2BACH,OAAO;6BACL,OAAO;KAmkBuD,CAAC,4BAA2B;oBAChG,OAAO,KAAK,EAAE,gBAAgB;;0CAlcP,MAAM;MAkcuB,GAAG,IAA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AC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
@@ -1,4 +1,4 @@
1
- import { defineComponent, useTemplateRef, ref, computed, watch, toRef, openBlock, createBlock, normalizeStyle, withCtx, unref, createCommentVNode, createElementBlock, Fragment, renderList, nextTick, renderSlot } from 'vue';
1
+ import { defineComponent, useTemplateRef, ref, computed, watch, toRef, openBlock, createBlock, normalizeStyle, normalizeClass, withCtx, unref, createCommentVNode, createElementBlock, Fragment, renderList, nextTick, renderSlot } from 'vue';
2
2
  import { isEqualObj } from '../../../utils/utils.js';
3
3
  import _sfc_main$2 from './InfiniteListButton.vue.js';
4
4
  import _sfc_main$3 from './InfiniteListPage.vue.js';
@@ -102,6 +102,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
102
102
  if (index === -1) return;
103
103
  const newPages = pages.value.slice(0, pages.value.length - index);
104
104
  pages.value = newPages.length === 0 ? [1] : newPages;
105
+ if (pagesCount.value >= page) pagesCount.value = page - 1;
106
+ if (nextPage.value === page) nextPage.value = null;
105
107
  emit("update:page", pages.value[pages.value.length - 1]);
106
108
  };
107
109
  const goto = async (page = 1, itemIndex) => {
@@ -116,6 +118,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
116
118
  isResettingPage.value = true;
117
119
  emit("update:page", page === 1 ? void 0 : page);
118
120
  pages.value = [];
121
+ const element = props.scrollingElement ?? document.scrollingElement;
122
+ const value = (infiniteScrollRef.value?.$el.offsetTop ?? 0) - props.headerHeight - 60;
123
+ if (element && element.scrollTop > value) element.scrollTop = value;
119
124
  await nextTick();
120
125
  pages.value = [page];
121
126
  nextPage.value = null;
@@ -123,7 +128,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
123
128
  };
124
129
  watch(toRef(props, "queryParams"), (newValue, oldValue) => {
125
130
  if (isEqualObj(newValue, oldValue, ["page", ...props.excludeParams ?? []])) return;
126
- if (pages.value.length === 1 && pages.value[0] === 1) return;
127
131
  resetPage();
128
132
  });
129
133
  watch(pagesCount, (value) => {
@@ -141,6 +145,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
141
145
  ref: "infiniteScroll",
142
146
  "scrolling-element": _ctx.scrollingElement,
143
147
  style: normalizeStyle({ "--infinite-list-header-height": _ctx.headerHeight + "px" }),
148
+ class: normalizeClass({
149
+ "min-h-[calc(100vh-var(--header-height)-var(--infinite-list-header-height))] pb-16": !_ctx.minHeight,
150
+ "min-h-full": _ctx.minHeight
151
+ }),
144
152
  "onScroll:down": addNextPage,
145
153
  "onScroll:up": addPreviousPage
146
154
  }, {
@@ -219,7 +227,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
219
227
  })) : createCommentVNode("", true)
220
228
  ]),
221
229
  _: 3
222
- }, 8, ["scrolling-element", "style"]);
230
+ }, 8, ["scrolling-element", "style", "class"]);
223
231
  };
224
232
  }
225
233
  });
@@ -2,7 +2,9 @@ declare function __VLS_template(): {
2
2
  slots: {
3
3
  default?(_: {}): any;
4
4
  };
5
- refs: {};
5
+ refs: {
6
+ container: HTMLDivElement;
7
+ };
6
8
  attrs: Partial<{}>;
7
9
  };
8
10
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
@@ -19,7 +21,9 @@ declare const __VLS_component: import('vue').DefineComponent<{
19
21
  }> & Readonly<{
20
22
  "onScroll:up"?: (() => any) | undefined;
21
23
  "onScroll:down"?: (() => any) | undefined;
22
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
24
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
25
+ container: HTMLDivElement;
26
+ }, any>;
23
27
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
24
28
  export default _default;
25
29
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -1 +1 @@
1
- {"version":3,"file":"InfiniteListScroll.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/InfiniteList/components/InfiniteListScroll.vue"],"names":[],"mappings":"AA4IA,iBAAS,cAAc;;yBA0BM,GAAG;;;WASlB,OAAO,IAA6B;EAEjD;AAYD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;sBApHD,OAAO,GAAG,IAAI;;;;;;;;sBAAd,OAAO,GAAG,IAAI;;;;kFA+HhC,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"InfiniteListScroll.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/InfiniteList/components/InfiniteListScroll.vue"],"names":[],"mappings":"AAgJA,iBAAS,cAAc;;yBA4BM,GAAG;;;;;WAUlB,OAAO,IAA6B;EAEjD;AAYD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;sBAzHD,OAAO,GAAG,IAAI;;;;;;;;sBAAd,OAAO,GAAG,IAAI;;;;;;OAqIhC,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,6 +1,7 @@
1
- import { defineComponent, computed, watch, onMounted, onUnmounted, openBlock, createElementBlock, renderSlot } from 'vue';
1
+ import { defineComponent, useTemplateRef, computed, watch, onMounted, onUnmounted, openBlock, createElementBlock, renderSlot } from 'vue';
2
2
  import { getIsScrollUp, getIsScrollDown } from '../models/utils.js';
3
3
 
4
+ const _hoisted_1 = { ref: "container" };
4
5
  const _sfc_main = /* @__PURE__ */ defineComponent({
5
6
  __name: "InfiniteListScroll",
6
7
  props: {
@@ -10,10 +11,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
10
11
  setup(__props, { expose: __expose, emit: __emit }) {
11
12
  const props = __props;
12
13
  const emit = __emit;
14
+ const containerRef = useTemplateRef("container");
13
15
  const element = computed(() => props.scrollingElement ?? document);
14
16
  const listener = (event) => {
15
- if (event.target !== element.value) return;
16
- if (getIsScrollUp(props.scrollingElement ?? document.scrollingElement)) {
17
+ if (event.target !== element.value || !containerRef.value) return;
18
+ if (getIsScrollUp(props.scrollingElement ?? document.scrollingElement, containerRef.value.offsetTop)) {
17
19
  emit("scroll:up");
18
20
  return;
19
21
  }
@@ -46,9 +48,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
46
48
  checkIsScrollDown
47
49
  });
48
50
  return (_ctx, _cache) => {
49
- return openBlock(), createElementBlock("div", null, [
51
+ return openBlock(), createElementBlock("div", _hoisted_1, [
50
52
  renderSlot(_ctx.$slots, "default")
51
- ]);
53
+ ], 512);
52
54
  };
53
55
  }
54
56
  });
@@ -1,3 +1,3 @@
1
- export declare const getIsScrollUp: (element: Element | null) => boolean;
1
+ export declare const getIsScrollUp: (element: Element | null, offsetTop: number) => boolean;
2
2
  export declare const getIsScrollDown: (element: Element | null) => boolean;
3
3
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/InfiniteList/models/utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,YAAa,OAAO,GAAG,IAAI,KAAG,OAIvD,CAAA;AAED,eAAO,MAAM,eAAe,YAAa,OAAO,GAAG,IAAI,KAAG,OAIzD,CAAA"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/InfiniteList/models/utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,YAAa,OAAO,GAAG,IAAI,aAAa,MAAM,KAAG,OAI1E,CAAA;AAED,eAAO,MAAM,eAAe,YAAa,OAAO,GAAG,IAAI,KAAG,OAIzD,CAAA"}
@@ -1,7 +1,7 @@
1
1
  const TRIGGER_FACTOR = 200;
2
- const getIsScrollUp = (element) => {
2
+ const getIsScrollUp = (element, offsetTop) => {
3
3
  if (!element) return false;
4
- return element.scrollTop < TRIGGER_FACTOR;
4
+ return element.scrollTop - offsetTop < TRIGGER_FACTOR;
5
5
  };
6
6
  const getIsScrollDown = (element) => {
7
7
  if (!element) return false;
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.9.21",
7
+ "version": "0.9.22",
8
8
  "scripts": {
9
9
  "build": "run-p type-check \"build-only {@}\" --",
10
10
  "preview": "vite preview",