eco-vue-js 0.7.1 → 0.7.2

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":"useSelected.d.ts","sourceRoot":"","sources":["../../../../src/components/InfiniteList/use/useSelected.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,GAAG,EAAC,MAAM,KAAK,CAAA;AA6BlD,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;8BAoBjB,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;;;CAsEzD,CAAA"}
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,
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.7.1",
7
+ "version": "0.7.2",
8
8
  "scripts": {
9
9
  "dev": "vite",
10
10
  "build": "run-p type-check build-only",