eco-vue-js 0.5.11 → 0.5.12
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/InfiniteList/WInfiniteListPages.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/WInfiniteListPages.vue.js +16 -19
- package/dist/components/InfiniteList/components/InfiniteListButton.vue.d.ts +2 -0
- package/dist/components/InfiniteList/components/InfiniteListButton.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/components/InfiniteListButton.vue.js +7 -3
- package/package.json +1 -1
@@ -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":"AA8EA;;;;wBAqfwB,IAAI,KAAK,KAAK;;;;iBApBrB,WAAW;;;;gBAFZ,kBAAkB,IAAI,EAAE,QAAQ,EAAE,WAAW,CAAC;2BACnC,OAAO,KAAK,OAAO;;;;;;;;mBAkB3B,QAAQ,WAAW,kBAAkB,IAAI,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;;;;;;;;;WAelF,GAAG;;;kBAlSA,IAAI;+BACS,IAAI,GAAG,SAAS,KAAK,IAAI;sBAClC,OAAO;qBACR,MAAM,IAAI;;;mBAGZ,OAAO;kBACR,OAAO;uBACF,OAAO;kBACZ,MAAM;mBACL,MAAM;cACT,IAAI;;;kBAXF,IAAI;+BACS,IAAI,GAAG,SAAS,KAAK,IAAI;sBAClC,OAAO;qBACR,MAAM,IAAI;;;mBAGZ,OAAO;kBACR,OAAO;uBACF,OAAO;kBACZ,MAAM;mBACL,MAAM;cACT,IAAI;;;YA1KN,aAAa,SAAS,MAAM,GAAG,SAAS,GAAG,IAAI;YAC/C,cAAc,SAAS,MAAM,GAAG,IAAI;YACpC,iBAAiB,UAAU,KA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BACZ,MAAM;uBACL,MAAM;kBACT,IAAI;;;sBAXF,IAAI;mCACS,IAAI,GAAG,SAAS,KAAK,IAAI;0BAClC,OAAO;yBACR,MAAM,IAAI;;;uBAGZ,OAAO;sBACR,OAAO;2BACF,OAAO;sBACZ,MAAM;uBACL,MAAM;kBACT,IAAI;;;gBA1KN,aAAa,SAAS,MAAM,GAAG,SAAS,GAAG,IAAI;gBAC/C,cAAc,SAAS,MAAM,GAAG,IAAI;gBACpC,iBAAiB,UAAU,KAAK,EAAE,GAAG,IAAI;;;;AAvD/C,wBA2f2E;AAQ3E,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -116,16 +116,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
116
116
|
element.scrollTop = element.scrollTop + height;
|
117
117
|
};
|
118
118
|
const removePage = (page) => {
|
119
|
-
if (previousPage.value === page)
|
120
|
-
previousPage.value = null;
|
121
|
-
if (nextPage.value === page)
|
122
|
-
nextPage.value = null;
|
123
119
|
const index = pages.value.indexOf(page);
|
124
120
|
if (index === -1)
|
125
121
|
return;
|
126
|
-
pages.value.
|
127
|
-
|
128
|
-
pages.value = [1];
|
122
|
+
const newPages = pages.value.slice(0, pages.value.length - index);
|
123
|
+
pages.value = newPages.length === 0 ? [1] : newPages;
|
129
124
|
emit("update:page", pages.value[pages.value.length - 1]);
|
130
125
|
};
|
131
126
|
const goto = async (page = 1, itemIndex) => {
|
@@ -153,6 +148,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
153
148
|
resetPage();
|
154
149
|
});
|
155
150
|
watch(count, (value) => emit("update:count", value), { immediate: true });
|
151
|
+
watch(pagesCount, (value) => {
|
152
|
+
if (pages.value[pages.value.length - 1] > value) {
|
153
|
+
const newPages = pages.value.filter((page) => page <= value);
|
154
|
+
pages.value = newPages.length === 0 ? [1] : newPages;
|
155
|
+
}
|
156
|
+
}, { immediate: true });
|
156
157
|
__expose({
|
157
158
|
resetPage,
|
158
159
|
goto
|
@@ -169,8 +170,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
169
170
|
default: withCtx(() => [
|
170
171
|
isPreviousButtonVisible.value ? (openBlock(), createBlock(_sfc_main$2, {
|
171
172
|
key: 0,
|
172
|
-
onClick: _cache[0] || (_cache[0] = ($event) => addPreviousPage())
|
173
|
-
|
173
|
+
onClick: _cache[0] || (_cache[0] = ($event) => addPreviousPage()),
|
174
|
+
onCheck: infiniteScroll.value?.checkIsScrollUp
|
175
|
+
}, null, 8, ["onCheck"])) : createCommentVNode("", true),
|
174
176
|
(openBlock(true), createElementBlock(Fragment, null, renderList(pages.value, (page, index) => {
|
175
177
|
return openBlock(), createBlock(_sfc_main$3, {
|
176
178
|
ref_for: true,
|
@@ -203,14 +205,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
203
205
|
"onUpdate:selected": _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:selected", $event)),
|
204
206
|
"onUpdate:count": updateCount,
|
205
207
|
"onUpdate:pagesCount": updatePagesCount,
|
206
|
-
"onUpdate:nextPage": _cache[2] || (_cache[2] = ($event) =>
|
207
|
-
|
208
|
-
infiniteScroll.value?.checkIsScrollDown();
|
209
|
-
}),
|
210
|
-
"onUpdate:previousPage": _cache[3] || (_cache[3] = ($event) => {
|
211
|
-
updatePreviousPage($event);
|
212
|
-
infiniteScroll.value?.checkIsScrollUp();
|
213
|
-
}),
|
208
|
+
"onUpdate:nextPage": _cache[2] || (_cache[2] = ($event) => updateNextPage($event)),
|
209
|
+
"onUpdate:previousPage": _cache[3] || (_cache[3] = ($event) => updatePreviousPage($event)),
|
214
210
|
"onUpdate:scroll": updateScroll,
|
215
211
|
"onUpdateFromHeader:scroll": _cache[4] || (_cache[4] = ($event) => _ctx.headerTop > 0 && nextTick(() => updateScroll(_ctx.headerTop))),
|
216
212
|
"onRemove:page": removePage,
|
@@ -237,8 +233,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
237
233
|
}), 128)),
|
238
234
|
count.value !== 0 && nextPage.value ? (openBlock(), createBlock(_sfc_main$2, {
|
239
235
|
key: 1,
|
240
|
-
onClick: addNextPage
|
241
|
-
|
236
|
+
onClick: addNextPage,
|
237
|
+
onCheck: infiniteScroll.value?.checkIsScrollDown
|
238
|
+
}, null, 8, ["onCheck"])) : createCommentVNode("", true)
|
242
239
|
]),
|
243
240
|
_: 3
|
244
241
|
}, 8, ["scrolling-element", "style"]);
|
@@ -1,7 +1,9 @@
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
2
2
|
click: () => void;
|
3
|
+
check: () => void;
|
3
4
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>> & {
|
4
5
|
onClick?: (() => any) | undefined;
|
6
|
+
onCheck?: (() => any) | undefined;
|
5
7
|
}, {}, {}>;
|
6
8
|
export default _default;
|
7
9
|
//# sourceMappingURL=InfiniteListButton.vue.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"InfiniteListButton.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/InfiniteList/components/InfiniteListButton.vue"],"names":[],"mappings":"AAUA
|
1
|
+
{"version":3,"file":"InfiniteListButton.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/InfiniteList/components/InfiniteListButton.vue"],"names":[],"mappings":"AAUA;;;;;;;;AAmFA,wBAMG"}
|
@@ -1,12 +1,16 @@
|
|
1
|
-
import { defineComponent, openBlock, createElementBlock, createVNode, unref, withCtx, createTextVNode } from 'vue';
|
1
|
+
import { defineComponent, onMounted, openBlock, createElementBlock, createVNode, unref, withCtx, createTextVNode } from 'vue';
|
2
2
|
import { SemanticType } from '../../../utils/SemanticType.js';
|
3
3
|
import _sfc_main$1 from '../../Button/WButton.vue.js';
|
4
4
|
|
5
5
|
const _hoisted_1 = { class: "flex w-full p-12 justify-center items-center" };
|
6
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
7
7
|
__name: "InfiniteListButton",
|
8
|
-
emits: ["click"],
|
9
|
-
setup(__props) {
|
8
|
+
emits: ["click", "check"],
|
9
|
+
setup(__props, { emit: __emit }) {
|
10
|
+
const emit = __emit;
|
11
|
+
onMounted(() => {
|
12
|
+
emit("check");
|
13
|
+
});
|
10
14
|
return (_ctx, _cache) => {
|
11
15
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
12
16
|
createVNode(_sfc_main$1, {
|