eco-vue-js 0.5.4 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Button/WButtonMore.vue.d.ts.map +1 -1
- package/dist/components/Button/WButtonMore.vue.js +2 -1
- package/dist/components/Button/WButtonSelection.vue.d.ts +10 -13
- package/dist/components/Button/WButtonSelection.vue.d.ts.map +1 -1
- package/dist/components/Button/WButtonSelection.vue.js +31 -15
- package/dist/components/Checkbox/WCheckbox.vue.d.ts +2 -0
- package/dist/components/Checkbox/WCheckbox.vue.d.ts.map +1 -1
- package/dist/components/Checkbox/WCheckbox.vue.js +6 -3
- package/dist/components/DropdownMenu/WDropdownMenu.vue.d.ts +2 -0
- package/dist/components/DropdownMenu/WDropdownMenu.vue.d.ts.map +1 -1
- package/dist/components/DropdownMenu/WDropdownMenu.vue.js +4 -3
- package/dist/components/ImageViewer/WImageViewer.vue.d.ts.map +1 -1
- package/dist/components/ImageViewer/WImageViewer.vue.js +2 -0
- package/dist/components/InfiniteList/WInfiniteList.vue.d.ts +45 -12
- package/dist/components/InfiniteList/WInfiniteList.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/WInfiniteList.vue.js +81 -32
- package/dist/components/InfiniteList/WInfiniteListPages.vue.d.ts +6 -6
- package/dist/components/InfiniteList/WInfiniteListPages.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/WInfiniteListPages.vue.js +17 -17
- package/dist/components/InfiniteList/components/EmptyComponent.vue.d.ts +10 -0
- package/dist/components/InfiniteList/components/EmptyComponent.vue.d.ts.map +1 -0
- package/dist/components/InfiniteList/components/EmptyComponent.vue.js +11 -0
- package/dist/components/InfiniteList/components/InfiniteListPage.vue.d.ts +6 -6
- package/dist/components/InfiniteList/components/InfiniteListPage.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/components/InfiniteListPage.vue.js +49 -64
- package/dist/components/InfiniteList/components/InfiniteListPageSelectItem.vue.d.ts +33 -0
- package/dist/components/InfiniteList/components/InfiniteListPageSelectItem.vue.d.ts.map +1 -0
- package/dist/components/InfiniteList/components/InfiniteListPageSelectItem.vue.js +27 -0
- package/dist/components/InfiniteList/components/InfiniteListPageSelectItem.vue2.js +5 -0
- package/dist/components/InfiniteList/models/injection.d.ts +16 -0
- package/dist/components/InfiniteList/models/injection.d.ts.map +1 -0
- package/dist/components/InfiniteList/models/injection.js +4 -0
- package/dist/components/InfiniteList/use/useSelected.d.ts +14 -0
- package/dist/components/InfiniteList/use/useSelected.d.ts.map +1 -0
- package/dist/components/InfiniteList/use/useSelected.js +159 -0
- package/dist/components/ListCard/WListCard.vue.d.ts +10 -18
- package/dist/components/ListCard/WListCard.vue.d.ts.map +1 -1
- package/dist/components/ListCard/WListCard.vue.js +50 -25
- package/dist/components/Modal/WModal.vue.d.ts.map +1 -1
- package/dist/components/Select/components/SelectOption.vue.d.ts +3 -3
- package/dist/components/Select/components/SelectOption.vue.d.ts.map +1 -1
- package/dist/types/global.d.ts +13 -0
- package/dist/utils/Modal.d.ts +8 -5
- package/dist/utils/Modal.d.ts.map +1 -1
- package/package.json +1 -1
@@ -0,0 +1,16 @@
|
|
1
|
+
import type { InjectionKey, Ref } from 'vue';
|
2
|
+
export declare const wInfiniteListSelection: InjectionKey<{
|
3
|
+
allowSelect?: Ref<boolean> | undefined;
|
4
|
+
allowSelectRange?: Ref<boolean> | undefined;
|
5
|
+
allowSelectHover?: Ref<boolean> | undefined;
|
6
|
+
selectedCount?: Ref<number> | undefined;
|
7
|
+
clearSelected?(): void;
|
8
|
+
}>;
|
9
|
+
export declare const wInfiniteListSelectionItem: InjectionKey<{
|
10
|
+
selected?: Ref<boolean> | undefined;
|
11
|
+
selectedBetween?: Ref<boolean> | undefined;
|
12
|
+
updateSelected?(value: boolean): void;
|
13
|
+
updateSelectedRange?(): void;
|
14
|
+
updateSelectedRangeHover?(): void;
|
15
|
+
}>;
|
16
|
+
//# sourceMappingURL=injection.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"injection.d.ts","sourceRoot":"","sources":["../../../../src/components/InfiniteList/models/injection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAE,GAAG,EAAC,MAAM,KAAK,CAAA;AAE1C,eAAO,MAAM,sBAAsB;;;;;sBAMf,IAAI;EACtB,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;2BAId,OAAO,GAAG,IAAI;4BACb,IAAI;iCACC,IAAI;EACjC,CAAA"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { type Ref } from 'vue';
|
2
|
+
export declare const useSelected: <Value>(count: Ref<number | undefined>, pageLength: Ref<number>, selected: Ref<Value[]>, reverse: Ref<boolean>, selectedRange: Ref<SelectedRange<Value> | undefined>, select: (value: Value[]) => void, selectReverse: (value: Value[]) => void, selectRange: (value: SelectedRange<Value>) => void) => {
|
3
|
+
setSelectedRange: (value: SelectedPage<Value>) => void;
|
4
|
+
getIsSelected: (id: Value) => boolean;
|
5
|
+
getIsSelectedBetween: (id: Value, page: number, index: number) => boolean;
|
6
|
+
setRangeHover: (value: SelectedPage<Value>) => void;
|
7
|
+
allowSelectHover: import("vue").ComputedRef<boolean>;
|
8
|
+
selectionRangeCount: import("vue").ComputedRef<number | undefined>;
|
9
|
+
setSelectedCursor: (value: SelectedPage<Value> | null) => void;
|
10
|
+
toggleSelected: (id: Value, value: boolean) => void;
|
11
|
+
selectedCount: import("vue").ComputedRef<number>;
|
12
|
+
selectAllValue: import("vue").ComputedRef<boolean | null>;
|
13
|
+
};
|
14
|
+
//# sourceMappingURL=useSelected.d.ts.map
|
@@ -0,0 +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,iBACf,IAAI,MAAM,GAAG,SAAS,CAAC,cAClB,IAAI,MAAM,CAAC,YACb,IAAI,KAAK,EAAE,CAAC,WACb,IAAI,OAAO,CAAC,iBACN,IAAI,cAAc,KAAK,CAAC,GAAG,SAAS,CAAC,kBAEpC,KAAK,EAAE,KAAK,IAAI,yBACT,KAAK,EAAE,KAAK,IAAI,gDACO,IAAI;8BAoBjB,aAAa,KAAK,CAAC;wBA4CzB,KAAK;+BAYE,KAAK,QAAQ,MAAM,SAAS,MAAM;2BAhBtC,aAAa,KAAK,CAAC;;;+BAsCf,aAAa,KAAK,CAAC,GAAG,IAAI;yBAIhC,KAAK,SAAS,OAAO,KAAG,IAAI;;;CAsEzD,CAAA"}
|
@@ -0,0 +1,159 @@
|
|
1
|
+
import { ref, computed, unref } from 'vue';
|
2
|
+
|
3
|
+
const isRightOrder = (value) => {
|
4
|
+
return value[0].page < value[1].page || value[0].page === value[1].page && value[0].index <= value[1].index;
|
5
|
+
};
|
6
|
+
const isSelectedBetween = (range, page, index) => {
|
7
|
+
if (range[0].page < page && range[1].page > page)
|
8
|
+
return true;
|
9
|
+
if (range[0].page === range[1].page && range[0].page === page)
|
10
|
+
return range[0].index < index && range[1].index > index;
|
11
|
+
return range[0].page === page && range[0].index < index || range[1].page === page && range[1].index > index;
|
12
|
+
};
|
13
|
+
const isWrongId = (selectionPage, id, page, index) => {
|
14
|
+
return selectionPage.id !== id && selectionPage.page === page && selectionPage.index === index;
|
15
|
+
};
|
16
|
+
const isWrongIdRange = (range, id, page, index) => {
|
17
|
+
return isWrongId(range[0], id, page, index) || isWrongId(range[1], id, page, index);
|
18
|
+
};
|
19
|
+
const getCount = (range, pageLength) => {
|
20
|
+
if (range[1].page === range[0].page)
|
21
|
+
return range[1].index - range[0].index + 1;
|
22
|
+
return (range[1].page - range[0].page) * pageLength + range[1].index - range[0].index + 1;
|
23
|
+
};
|
24
|
+
const useSelected = (count, pageLength, selected, reverse, selectedRange, select, selectReverse, selectRange) => {
|
25
|
+
const isSelecting = ref(false);
|
26
|
+
const rangeCursor = ref(null);
|
27
|
+
const rangeHover = ref(null);
|
28
|
+
const allowSelectHover = computed(() => rangeCursor.value !== null && isSelecting.value);
|
29
|
+
const selectionRangeCount = computed(() => {
|
30
|
+
if (!selectedRange.value)
|
31
|
+
return void 0;
|
32
|
+
return getCount(selectedRange.value, unref(pageLength));
|
33
|
+
});
|
34
|
+
const cursorReset = () => {
|
35
|
+
rangeCursor.value = null;
|
36
|
+
rangeHover.value = null;
|
37
|
+
isSelecting.value = false;
|
38
|
+
};
|
39
|
+
const setSelectedRange = (value) => {
|
40
|
+
if (!rangeCursor.value) {
|
41
|
+
rangeCursor.value = value;
|
42
|
+
rangeHover.value = value;
|
43
|
+
isSelecting.value = true;
|
44
|
+
select([]);
|
45
|
+
return;
|
46
|
+
}
|
47
|
+
if (value.id === rangeCursor.value.id) {
|
48
|
+
select([value.id]);
|
49
|
+
cursorReset();
|
50
|
+
return;
|
51
|
+
}
|
52
|
+
const result = [value, rangeCursor.value];
|
53
|
+
if (!isRightOrder(result))
|
54
|
+
result.reverse();
|
55
|
+
if (getCount(result, unref(pageLength)) === unref(count)) {
|
56
|
+
cursorReset();
|
57
|
+
selectReverse([]);
|
58
|
+
return;
|
59
|
+
}
|
60
|
+
selectRange(result);
|
61
|
+
cursorReset();
|
62
|
+
};
|
63
|
+
const resetSelectionRange = () => {
|
64
|
+
rangeCursor.value = null;
|
65
|
+
rangeHover.value = null;
|
66
|
+
select([]);
|
67
|
+
};
|
68
|
+
const setRangeHover = (value) => {
|
69
|
+
rangeHover.value = value;
|
70
|
+
};
|
71
|
+
const getIsSelected = (id) => {
|
72
|
+
if (selectedRange.value) {
|
73
|
+
return selectedRange.value[0].id === id || selectedRange.value[1].id === id;
|
74
|
+
}
|
75
|
+
if (rangeCursor.value && rangeHover.value) {
|
76
|
+
return rangeCursor.value.id === id || rangeHover.value.id === id;
|
77
|
+
}
|
78
|
+
return reverse.value ? !selected.value.includes(id) : selected.value.includes(id);
|
79
|
+
};
|
80
|
+
const getIsSelectedBetween = (id, page, index) => {
|
81
|
+
let is = false;
|
82
|
+
if (selectedRange.value) {
|
83
|
+
is = isSelectedBetween(selectedRange.value, page, index);
|
84
|
+
if (!is && isWrongIdRange(selectedRange.value, id, page, index))
|
85
|
+
resetSelectionRange();
|
86
|
+
}
|
87
|
+
if (rangeCursor.value && rangeHover.value) {
|
88
|
+
const range = [rangeCursor.value, rangeHover.value];
|
89
|
+
if (!isRightOrder(range))
|
90
|
+
range.reverse();
|
91
|
+
is = isSelectedBetween(range, page, index);
|
92
|
+
if (!is && isWrongIdRange(range, id, page, index))
|
93
|
+
resetSelectionRange();
|
94
|
+
}
|
95
|
+
return is;
|
96
|
+
};
|
97
|
+
const setSelectedCursor = (value) => {
|
98
|
+
rangeCursor.value = value;
|
99
|
+
};
|
100
|
+
const toggleSelected = (id, value) => {
|
101
|
+
if (reverse.value && count?.value === selected.value.length + 1) {
|
102
|
+
select([]);
|
103
|
+
cursorReset();
|
104
|
+
return;
|
105
|
+
}
|
106
|
+
const newSelected = selected.value.slice();
|
107
|
+
const index = newSelected.indexOf(id);
|
108
|
+
if (index !== -1 && !value) {
|
109
|
+
newSelected.splice(index, 1);
|
110
|
+
} else if (value) {
|
111
|
+
newSelected.push(id);
|
112
|
+
}
|
113
|
+
if (reverse.value) {
|
114
|
+
if (count?.value !== void 0 && count.value <= newSelected.length) {
|
115
|
+
if (newSelected.length === 0)
|
116
|
+
selectReverse([]);
|
117
|
+
else
|
118
|
+
select([]);
|
119
|
+
cursorReset();
|
120
|
+
return;
|
121
|
+
}
|
122
|
+
selectReverse(newSelected);
|
123
|
+
} else {
|
124
|
+
select(newSelected);
|
125
|
+
}
|
126
|
+
};
|
127
|
+
const selectedCount = computed(() => {
|
128
|
+
if (selectedRange.value)
|
129
|
+
return getCount(selectedRange.value, unref(pageLength));
|
130
|
+
const _count = unref(count);
|
131
|
+
return reverse.value && _count !== void 0 ? Math.max(_count - selected.value.length, 0) : selected.value.length;
|
132
|
+
});
|
133
|
+
const selectAllValue = computed(() => {
|
134
|
+
if (selectedRange.value)
|
135
|
+
return null;
|
136
|
+
const _count = unref(count);
|
137
|
+
if (_count === 0)
|
138
|
+
return false;
|
139
|
+
if (reverse.value) {
|
140
|
+
return selected.value.length === 0 ? true : null;
|
141
|
+
} else {
|
142
|
+
return _count !== void 0 && selected.value.length >= _count ? true : selected.value.length ? null : false;
|
143
|
+
}
|
144
|
+
});
|
145
|
+
return {
|
146
|
+
setSelectedRange,
|
147
|
+
getIsSelected,
|
148
|
+
getIsSelectedBetween,
|
149
|
+
setRangeHover,
|
150
|
+
allowSelectHover,
|
151
|
+
selectionRangeCount,
|
152
|
+
setSelectedCursor,
|
153
|
+
toggleSelected,
|
154
|
+
selectedCount,
|
155
|
+
selectAllValue
|
156
|
+
};
|
157
|
+
};
|
158
|
+
|
159
|
+
export { useSelected };
|
@@ -1,35 +1,27 @@
|
|
1
1
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
2
2
|
disabled?: boolean | undefined;
|
3
|
-
selected?: boolean | undefined;
|
4
|
-
selectedBetween?: boolean | undefined;
|
5
|
-
selectedHover?: boolean | undefined;
|
6
3
|
hideMore?: boolean | undefined;
|
7
4
|
mobile?: boolean | undefined;
|
8
|
-
allowSelect?: boolean | undefined;
|
9
|
-
allowSelectHover?: boolean | undefined;
|
10
5
|
moreBottom?: boolean | undefined;
|
11
|
-
|
12
|
-
}>, {
|
6
|
+
alignTop?: boolean | undefined;
|
7
|
+
}>, {
|
8
|
+
updateSelected: ((value: boolean) => void) | undefined;
|
9
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
13
10
|
"update:selected": (value: boolean) => void;
|
14
|
-
"update
|
15
|
-
"update-hover:selected": (value: boolean) => void;
|
11
|
+
"update:selected-hover": (value: boolean) => void;
|
16
12
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
17
13
|
disabled?: boolean | undefined;
|
18
|
-
selected?: boolean | undefined;
|
19
|
-
selectedBetween?: boolean | undefined;
|
20
|
-
selectedHover?: boolean | undefined;
|
21
14
|
hideMore?: boolean | undefined;
|
22
15
|
mobile?: boolean | undefined;
|
23
|
-
allowSelect?: boolean | undefined;
|
24
|
-
allowSelectHover?: boolean | undefined;
|
25
16
|
moreBottom?: boolean | undefined;
|
26
|
-
|
17
|
+
alignTop?: boolean | undefined;
|
27
18
|
}>>> & {
|
28
19
|
"onUpdate:selected"?: ((value: boolean) => any) | undefined;
|
29
|
-
"onUpdate
|
30
|
-
"onUpdate-hover:selected"?: ((value: boolean) => any) | undefined;
|
20
|
+
"onUpdate:selected-hover"?: ((value: boolean) => any) | undefined;
|
31
21
|
}, {}, {}>, {
|
32
|
-
default?(_: {
|
22
|
+
default?(_: {
|
23
|
+
toggle: ((value: boolean) => void) | undefined;
|
24
|
+
}): any;
|
33
25
|
more?(_: {}): any;
|
34
26
|
}>;
|
35
27
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WListCard.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ListCard/WListCard.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WListCard.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ListCard/WListCard.vue"],"names":[],"mappings":"AA8DA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgRA,wBAAwG;AACxG,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
|
@@ -1,9 +1,10 @@
|
|
1
|
-
import { defineComponent, openBlock, createElementBlock, createVNode, Transition, withCtx, createCommentVNode, createBlock, normalizeClass, renderSlot, markRaw
|
1
|
+
import { defineComponent, inject, watch, openBlock, createElementBlock, createVNode, Transition, withCtx, unref, createCommentVNode, createBlock, normalizeClass, renderSlot, markRaw } from 'vue';
|
2
2
|
import _sfc_main$1 from '../Checkbox/WCheckbox.vue.js';
|
3
3
|
import _sfc_main$2 from '../Button/WButtonMore.vue.js';
|
4
4
|
import _sfc_main$3 from '../Button/WButtonMoreItem.vue.js';
|
5
5
|
import IconAddCircle from '../../assets/icons/sax/IconAddCircle.svg.js';
|
6
6
|
import IconMinusCircle from '../../assets/icons/sax/IconMinusCircle.svg.js';
|
7
|
+
import { wInfiniteListSelection, wInfiniteListSelectionItem } from '../InfiniteList/models/injection.js';
|
7
8
|
|
8
9
|
const _hoisted_1 = { class: "grid relative w-full sm:flex sm-not:group-even:bg-gray-50 sm-not:dark:group-even:bg-primary-darkest/25 sm-not:pt-2" };
|
9
10
|
const _hoisted_2 = {
|
@@ -14,18 +15,39 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
15
|
__name: "WListCard",
|
15
16
|
props: {
|
16
17
|
disabled: { type: Boolean },
|
17
|
-
selected: { type: Boolean },
|
18
|
-
selectedBetween: { type: Boolean },
|
19
|
-
selectedHover: { type: Boolean },
|
20
18
|
hideMore: { type: Boolean },
|
21
19
|
mobile: { type: Boolean },
|
22
|
-
allowSelect: { type: Boolean },
|
23
|
-
allowSelectHover: { type: Boolean },
|
24
20
|
moreBottom: { type: Boolean },
|
25
|
-
|
21
|
+
alignTop: { type: Boolean }
|
26
22
|
},
|
27
|
-
emits: ["update:selected", "update
|
28
|
-
setup(__props) {
|
23
|
+
emits: ["update:selected", "update:selected-hover"],
|
24
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
25
|
+
const emit = __emit;
|
26
|
+
const {
|
27
|
+
allowSelect,
|
28
|
+
allowSelectRange,
|
29
|
+
allowSelectHover
|
30
|
+
} = inject(wInfiniteListSelection, {});
|
31
|
+
const {
|
32
|
+
selected,
|
33
|
+
selectedBetween,
|
34
|
+
updateSelected,
|
35
|
+
updateSelectedRange,
|
36
|
+
updateSelectedRangeHover
|
37
|
+
} = inject(wInfiniteListSelectionItem, {});
|
38
|
+
if (selected) {
|
39
|
+
watch(selected, (value) => {
|
40
|
+
emit("update:selected", value);
|
41
|
+
});
|
42
|
+
}
|
43
|
+
if (allowSelectHover) {
|
44
|
+
watch(allowSelectHover, (value) => {
|
45
|
+
emit("update:selected-hover", value);
|
46
|
+
});
|
47
|
+
}
|
48
|
+
__expose({
|
49
|
+
updateSelected
|
50
|
+
});
|
29
51
|
return (_ctx, _cache) => {
|
30
52
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
31
53
|
createVNode(Transition, {
|
@@ -35,37 +57,40 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
35
57
|
"leave-to-class": "-translate-x-2"
|
36
58
|
}, {
|
37
59
|
default: withCtx(() => [
|
38
|
-
_ctx.mobile &&
|
60
|
+
_ctx.mobile && unref(selected) ? (openBlock(), createElementBlock("div", _hoisted_2)) : createCommentVNode("", true)
|
39
61
|
]),
|
40
62
|
_: 1
|
41
63
|
}),
|
42
|
-
|
64
|
+
unref(allowSelect) && !_ctx.mobile ? (openBlock(), createBlock(_sfc_main$1, {
|
43
65
|
key: 0,
|
44
|
-
"model-value":
|
66
|
+
"model-value": unref(selectedBetween) ? null : unref(selected) ?? false,
|
45
67
|
disabled: _ctx.disabled,
|
46
|
-
"allow-shift":
|
68
|
+
"allow-shift": unref(allowSelectRange),
|
69
|
+
"align-top": _ctx.alignTop,
|
47
70
|
class: normalizeClass(["sm:w-list-row-item sm-not:hidden", {
|
48
|
-
"opacity-50":
|
71
|
+
"opacity-50": unref(allowSelectHover)
|
49
72
|
}]),
|
50
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) =>
|
51
|
-
"onUpdateShift:modelValue": _cache[1] || (_cache[1] = ($event) =>
|
52
|
-
onMouseover: _cache[2] || (_cache[2] = ($event) =>
|
53
|
-
}, null, 8, ["model-value", "disabled", "allow-shift", "class"])) : createCommentVNode("", true),
|
54
|
-
renderSlot(_ctx.$slots, "default"),
|
73
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(allowSelectHover) ? unref(updateSelectedRange)?.() : unref(updateSelected)?.($event)),
|
74
|
+
"onUpdateShift:modelValue": _cache[1] || (_cache[1] = ($event) => unref(updateSelectedRange)?.()),
|
75
|
+
onMouseover: _cache[2] || (_cache[2] = ($event) => unref(allowSelectHover) ? unref(updateSelectedRangeHover)?.() : void 0)
|
76
|
+
}, null, 8, ["model-value", "disabled", "allow-shift", "align-top", "class"])) : createCommentVNode("", true),
|
77
|
+
renderSlot(_ctx.$slots, "default", { toggle: unref(updateSelected) }),
|
55
78
|
!_ctx.hideMore ? (openBlock(), createBlock(_sfc_main$2, {
|
56
79
|
key: 1,
|
57
|
-
class: normalizeClass(["sm-not:absolute sm-not:right-0 sm-not:-mx--inner-margin sm-not:bottom-0 sm-not:items-start sm:w-list-row-item flex
|
80
|
+
class: normalizeClass(["sm-not:absolute sm-not:right-0 sm-not:-mx--inner-margin sm-not:bottom-0 sm-not:items-start sm:w-list-row-item flex pl-4", {
|
58
81
|
"sm-not:top-5": !_ctx.moreBottom,
|
59
|
-
"sm-not:top-12": _ctx.moreBottom
|
82
|
+
"sm-not:top-12": _ctx.moreBottom,
|
83
|
+
"items-start pt-2": _ctx.alignTop,
|
84
|
+
"items-center": !_ctx.alignTop
|
60
85
|
}]),
|
61
86
|
disabled: _ctx.disabled
|
62
87
|
}, {
|
63
88
|
default: withCtx(() => [
|
64
|
-
|
89
|
+
unref(allowSelect) && _ctx.mobile ? (openBlock(), createBlock(_sfc_main$3, {
|
65
90
|
key: 0,
|
66
|
-
text:
|
67
|
-
icon:
|
68
|
-
onClick: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("update:selected", !
|
91
|
+
text: unref(selected) ? "Unselect" : "Select",
|
92
|
+
icon: unref(selected) ? markRaw(unref(IconMinusCircle)) : markRaw(unref(IconAddCircle)),
|
93
|
+
onClick: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("update:selected", !unref(selected)))
|
69
94
|
}, null, 8, ["text", "icon"])) : createCommentVNode("", true),
|
70
95
|
renderSlot(_ctx.$slots, "more")
|
71
96
|
]),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/WModal.vue"],"names":[],"mappings":"AAyCA;;
|
1
|
+
{"version":3,"file":"WModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/WModal.vue"],"names":[],"mappings":"AAyCA;;AA6PA,wBAKG"}
|
@@ -9,6 +9,7 @@ declare const _default: <Model extends string | number>(__VLS_props: {
|
|
9
9
|
next?: Model | null | undefined;
|
10
10
|
first?: boolean | undefined;
|
11
11
|
last?: boolean | undefined;
|
12
|
+
onUnmounted?: (() => any) | undefined;
|
12
13
|
"onUpdate:is-cursor"?: ((value: {
|
13
14
|
previous: Model | null | undefined;
|
14
15
|
next: Model | null | undefined;
|
@@ -16,7 +17,6 @@ declare const _default: <Model extends string | number>(__VLS_props: {
|
|
16
17
|
"onUpdate:cursor"?: (() => any) | undefined;
|
17
18
|
"onUpdate:previous"?: ((value: Model | null | undefined) => any) | undefined;
|
18
19
|
"onUpdate:next"?: ((value: Model | null | undefined) => any) | undefined;
|
19
|
-
onUnmounted?: (() => any) | undefined;
|
20
20
|
"onUpdate:first"?: (() => any) | undefined;
|
21
21
|
"onUpdate:last"?: (() => any) | undefined;
|
22
22
|
isCursor?: boolean | undefined;
|
@@ -61,6 +61,7 @@ declare const _default: <Model extends string | number>(__VLS_props: {
|
|
61
61
|
next?: Model | null | undefined;
|
62
62
|
first?: boolean | undefined;
|
63
63
|
last?: boolean | undefined;
|
64
|
+
onUnmounted?: (() => any) | undefined;
|
64
65
|
"onUpdate:is-cursor"?: ((value: {
|
65
66
|
previous: Model | null | undefined;
|
66
67
|
next: Model | null | undefined;
|
@@ -68,7 +69,6 @@ declare const _default: <Model extends string | number>(__VLS_props: {
|
|
68
69
|
"onUpdate:cursor"?: (() => any) | undefined;
|
69
70
|
"onUpdate:previous"?: ((value: Model | null | undefined) => any) | undefined;
|
70
71
|
"onUpdate:next"?: ((value: Model | null | undefined) => any) | undefined;
|
71
|
-
onUnmounted?: (() => any) | undefined;
|
72
72
|
"onUpdate:first"?: (() => any) | undefined;
|
73
73
|
"onUpdate:last"?: (() => any) | undefined;
|
74
74
|
isCursor?: boolean | undefined;
|
@@ -117,6 +117,7 @@ declare const _default: <Model extends string | number>(__VLS_props: {
|
|
117
117
|
next?: Model | null | undefined;
|
118
118
|
first?: boolean | undefined;
|
119
119
|
last?: boolean | undefined;
|
120
|
+
onUnmounted?: (() => any) | undefined;
|
120
121
|
"onUpdate:is-cursor"?: ((value: {
|
121
122
|
previous: Model | null | undefined;
|
122
123
|
next: Model | null | undefined;
|
@@ -124,7 +125,6 @@ declare const _default: <Model extends string | number>(__VLS_props: {
|
|
124
125
|
"onUpdate:cursor"?: (() => any) | undefined;
|
125
126
|
"onUpdate:previous"?: ((value: Model | null | undefined) => any) | undefined;
|
126
127
|
"onUpdate:next"?: ((value: Model | null | undefined) => any) | undefined;
|
127
|
-
onUnmounted?: (() => any) | undefined;
|
128
128
|
"onUpdate:first"?: (() => any) | undefined;
|
129
129
|
"onUpdate:last"?: (() => any) | undefined;
|
130
130
|
isCursor?: boolean | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SelectOption.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/components/SelectOption.vue"],"names":[],"mappings":"AAsCA;;;;;;gBAsPc,OAAO
|
1
|
+
{"version":3,"file":"SelectOption.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/components/SelectOption.vue"],"names":[],"mappings":"AAsCA;;;;;;gBAsPc,OAAO;;;;;;;;kBAxNuB,KAAK,GAAG,IAAI,GAAG,SAAS;cAAQ,KAAK,GAAG,IAAI,GAAG,SAAS;;;;;;;;;;;WA0O7F,GAAG;;yBAxKS;YAAC,QAAQ,EAAE,OAAO,CAAA;SAAC,KAAK,IAAI;;yBAA5B;YAAC,QAAQ,EAAE,OAAO,CAAA;SAAC,KAAK,IAAI;;;YApEzC,QAAQ,GAAG,IAAI;YACf,UAAU,GAAG,IAAI;YACjB,kBAAkB,SAAS;YAAC,QAAQ,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC;YAAC,IAAI,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,CAAA;SAAC,GAAG,IAAI;YACtG,eAAe,GAAG,IAAI;YACtB,iBAAiB,SAAS,KAAK,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;YACzD,aAAa,SAAS,KAAK,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;YACrD,WAAW,GAAG,IAAI;YAClB,cAAc,GAAG,IAAI;YACrB,aAAa,GAAG,IAAI;;;;OAmO6C,IAAI;;;;;;oBAjB7D,OAAO;;;;;;;;sBAxNuB,KAAK,GAAG,IAAI,GAAG,SAAS;kBAAQ,KAAK,GAAG,IAAI,GAAG,SAAS;;;;;;;;;;;;;SAyO7B,IAAI;WACpE,GAAG;;yBAxKS;YAAC,QAAQ,EAAE,OAAO,CAAA;SAAC,KAAK,IAAI;;yBAA5B;YAAC,QAAQ,EAAE,OAAO,CAAA;SAAC,KAAK,IAAI;;;YApEzC,QAAQ,GAAG,IAAI;YACf,UAAU,GAAG,IAAI;YACjB,kBAAkB,SAAS;YAAC,QAAQ,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC;YAAC,IAAI,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,CAAA;SAAC,GAAG,IAAI;YACtG,eAAe,GAAG,IAAI;YACtB,iBAAiB,SAAS,KAAK,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;YACzD,aAAa,SAAS,KAAK,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;YACrD,WAAW,GAAG,IAAI;YAClB,cAAc,GAAG,IAAI;YACrB,aAAa,GAAG,IAAI;;;;;;;;;;;wBAkNZ,OAAO;;;;;;;;0BAxNuB,KAAK,GAAG,IAAI,GAAG,SAAS;sBAAQ,KAAK,GAAG,IAAI,GAAG,SAAS;;;;;;;;;;;;;aAyO7B,IAAI;eACpE,GAAG;;6BAxKS;gBAAC,QAAQ,EAAE,OAAO,CAAA;aAAC,KAAK,IAAI;;6BAA5B;gBAAC,QAAQ,EAAE,OAAO,CAAA;aAAC,KAAK,IAAI;;;gBApEzC,QAAQ,GAAG,IAAI;gBACf,UAAU,GAAG,IAAI;gBACjB,kBAAkB,SAAS;gBAAC,QAAQ,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC;gBAAC,IAAI,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,CAAA;aAAC,GAAG,IAAI;gBACtG,eAAe,GAAG,IAAI;gBACtB,iBAAiB,SAAS,KAAK,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;gBACzD,aAAa,SAAS,KAAK,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;gBACrD,WAAW,GAAG,IAAI;gBAClB,cAAc,GAAG,IAAI;gBACrB,aAAa,GAAG,IAAI;;;;AA7B1B,wBAsQ2E"}
|
package/dist/types/global.d.ts
CHANGED
@@ -51,3 +51,16 @@ declare type UseQueryWithParams<Model, ApiError, QueryParams> =
|
|
51
51
|
(queryParams: import('vue').MaybeRef<QueryParams>, options?: QueryOptions<Model, ApiError>) => ReturnType<typeof import('../utils/useDefaultQuery').useDefaultQuery<Model, ApiError>>
|
52
52
|
|
53
53
|
declare type UseQueryPaginated<Model, ApiError, QueryParams> = UseQueryWithParams<PaginatedResponse<Model>, ApiError, QueryParams>
|
54
|
+
|
55
|
+
|
56
|
+
declare interface SelectedPage<Value> {
|
57
|
+
page: number
|
58
|
+
index: number
|
59
|
+
id: Value
|
60
|
+
}
|
61
|
+
|
62
|
+
declare type SelectedRange<Value> = [
|
63
|
+
SelectedPage<Value>,
|
64
|
+
SelectedPage<Value>,
|
65
|
+
]
|
66
|
+
|
package/dist/utils/Modal.d.ts
CHANGED
@@ -1,10 +1,13 @@
|
|
1
|
-
import { type Component } from 'vue';
|
1
|
+
import { type Component, type ComponentOptions, type MethodOptions } from 'vue';
|
2
2
|
import type { ConfirmModalProps } from '../components/Modal/modals/Confirm/types';
|
3
|
-
export type
|
4
|
-
|
3
|
+
export type ModalComponent<Props> = Component<Props, any, any, ComponentOptions, MethodOptions, {
|
4
|
+
'close:modal': () => void;
|
5
|
+
}>;
|
6
|
+
export type AddModal<Props> = (component: ModalComponent<Props>, props?: Props, cb?: () => void, autoclose?: boolean) => (() => void);
|
7
|
+
export declare const initModal: <Props>(value: AddModal<Props> | undefined) => void;
|
5
8
|
export declare const Modal: {
|
6
|
-
add(component:
|
7
|
-
addAutoclosable(component:
|
9
|
+
add<Props>(component: ModalComponent<Props>, props?: Props, cb?: () => void): (() => void) | null;
|
10
|
+
addAutoclosable<Props_1>(component: ModalComponent<Props_1>, props?: Props_1 | undefined, cb?: () => void): (() => void) | null;
|
8
11
|
addConfirm(props: ConfirmModalProps, cb?: () => void): (() => void) | null;
|
9
12
|
};
|
10
13
|
//# sourceMappingURL=Modal.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../src/utils/Modal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,SAAS,EAAC,MAAM,KAAK,CAAA;
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../src/utils/Modal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,SAAS,EAAE,KAAK,gBAAgB,EAAE,KAAK,aAAa,EAAC,MAAM,KAAK,CAAA;AAC5G,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,yCAAyC,CAAA;AAI9E,MAAM,MAAM,cAAc,CAAC,KAAK,IAAI,SAAS,CAC3C,KAAK,EAEL,GAAG,EAEH,GAAG,EACH,gBAAgB,EAChB,aAAa,EACb;IACE,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CACF,CAAA;AAED,MAAM,MAAM,QAAQ,CAAC,KAAK,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE,MAAM,IAAI,EAAE,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC,MAAM,IAAI,CAAC,CAAA;AAKrI,eAAO,MAAM,SAAS,iBAAkB,SAAS,KAAK,CAAC,GAAG,SAAS,SAElE,CAAA;AAED,eAAO,MAAM,KAAK;0BACM,eAAe,KAAK,CAAC,UAAU,KAAK,OAAO,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI;mGAIpB,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI;sBAI3F,iBAAiB,OAAO,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI;CAQ3E,CAAA"}
|