eco-vue-js 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useSelected.d.ts","sourceRoot":"","sources":["../../../../src/components/InfiniteList/use/useSelected.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"useSelected.d.ts","sourceRoot":"","sources":["../../../../src/components/InfiniteList/use/useSelected.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,KAAK,GAAG,EAAC,MAAM,KAAK,CAAA;AA6BnE,eAAO,MAAM,WAAW,GAAI,KAAK,SACxB,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,cAClB,GAAG,CAAC,MAAM,CAAC,YACb,GAAG,CAAC,KAAK,EAAE,CAAC,WACb,GAAG,CAAC,OAAO,CAAC,iBACN,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,UAE5C,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,IAAI,iBACjB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,IAAI,eAC1B,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,KAAK,IAAI;8BAqBjB,YAAY,CAAC,KAAK,CAAC;wBA4CzB,KAAK;+BAYE,KAAK,QAAQ,MAAM,SAAS,MAAM;2BAhBtC,YAAY,CAAC,KAAK,CAAC;;;+BAsCf,YAAY,CAAC,KAAK,CAAC,GAAG,IAAI;yBAIhC,KAAK,SAAS,OAAO,KAAG,IAAI;;;CA4EzD,CAAA"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ref, computed, unref } from 'vue';
|
1
|
+
import { ref, computed, unref, onBeforeUnmount } from 'vue';
|
2
2
|
|
3
3
|
const isRightOrder = (value) => {
|
4
4
|
return value[0].page < value[1].page || value[0].page === value[1].page && value[0].index <= value[1].index;
|
@@ -22,6 +22,7 @@ const useSelected = (count, pageLength, selected, reverse, selectedRange, select
|
|
22
22
|
const isSelecting = ref(false);
|
23
23
|
const rangeCursor = ref(null);
|
24
24
|
const rangeHover = ref(null);
|
25
|
+
const disabled = ref(false);
|
25
26
|
const allowSelectHover = computed(() => rangeCursor.value !== null && isSelecting.value);
|
26
27
|
const selectionRangeCount = computed(() => {
|
27
28
|
if (!selectedRange.value) return void 0;
|
@@ -90,6 +91,7 @@ const useSelected = (count, pageLength, selected, reverse, selectedRange, select
|
|
90
91
|
rangeCursor.value = value;
|
91
92
|
};
|
92
93
|
const toggleSelected = (id, value) => {
|
94
|
+
if (disabled.value) return;
|
93
95
|
if (reverse.value && count?.value === selected.value.length + 1) {
|
94
96
|
select([]);
|
95
97
|
cursorReset();
|
@@ -129,6 +131,9 @@ const useSelected = (count, pageLength, selected, reverse, selectedRange, select
|
|
129
131
|
return _count !== void 0 && selected.value.length >= _count ? true : selected.value.length ? null : false;
|
130
132
|
}
|
131
133
|
});
|
134
|
+
onBeforeUnmount(() => {
|
135
|
+
disabled.value = true;
|
136
|
+
});
|
132
137
|
return {
|
133
138
|
setSelectedRange,
|
134
139
|
getIsSelected,
|