eco-vue-js 0.10.4 → 0.10.6
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.
- package/dist/components/Button/WButtonDropdown.vue.d.ts +1 -1
- package/dist/components/Button/WButtonDropdown.vue.d.ts.map +1 -1
- package/dist/components/Button/WButtonDropdown.vue.js +1 -12
- package/dist/components/Button/WButtonSelection.vue.d.ts +6 -5
- package/dist/components/Button/WButtonSelection.vue.d.ts.map +1 -1
- package/dist/components/Button/WButtonSelection.vue.js +10 -24
- package/dist/components/Checkbox/WCheckbox.vue.d.ts +0 -2
- package/dist/components/Checkbox/WCheckbox.vue.d.ts.map +1 -1
- package/dist/components/Checkbox/WCheckbox.vue.js +2 -8
- package/dist/components/FieldWrapper/WFieldWrapper.vue.js +1 -14
- package/dist/components/Form/WForm.vue.d.ts +2 -2
- package/dist/components/Form/WFormValidator.vue.d.ts +2 -2
- package/dist/components/Form/WFormValidator.vue.js +1 -14
- package/dist/components/Form/models/utils.js +0 -14
- package/dist/components/FormAsync/use/useFormAsync.d.ts.map +1 -1
- package/dist/components/FormAsync/use/useFormAsync.js +2 -14
- package/dist/components/HeaderBar/WHeaderBar.vue.js +2 -2
- package/dist/components/InfiniteList/WInfiniteList.vue.d.ts +3 -18
- package/dist/components/InfiniteList/WInfiniteList.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/WInfiniteList.vue.js +25 -83
- package/dist/components/InfiniteList/WInfiniteListWrapper.vue.js +1 -1
- package/dist/components/InfiniteList/components/InfiniteListPage.vue.d.ts +0 -5
- package/dist/components/InfiniteList/components/InfiniteListPage.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/components/InfiniteListPage.vue.js +8 -27
- package/dist/components/InfiniteList/components/InfiniteListPages.vue.d.ts +1 -8
- package/dist/components/InfiniteList/components/InfiniteListPages.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/components/InfiniteListPages.vue.js +10 -21
- package/dist/components/InfiniteList/use/useInfiniteListHeader.js +0 -13
- package/dist/components/Input/WInputSuggest.vue.js +3 -3
- package/dist/components/List/WList.vue.d.ts +3 -0
- package/dist/components/List/WList.vue.d.ts.map +1 -1
- package/dist/components/List/WList.vue.js +230 -245
- package/dist/components/List/WListCard.vue.d.ts +15 -9
- package/dist/components/List/WListCard.vue.d.ts.map +1 -1
- package/dist/components/List/WListCard.vue.js +79 -84
- package/dist/components/List/WListHeaderItem.vue.d.ts.map +1 -1
- package/dist/components/List/WListHeaderItem.vue.js +1 -1
- package/dist/components/List/components/HeaderSettings.vue.d.ts +3 -2
- package/dist/components/List/components/HeaderSettings.vue.d.ts.map +1 -1
- package/dist/components/List/components/HeaderSettings.vue.js +21 -25
- package/dist/components/List/components/HeaderSort.vue.d.ts +1 -1
- package/dist/components/List/components/HeaderSort.vue.d.ts.map +1 -1
- package/dist/components/List/components/HeaderSort.vue.js +0 -13
- package/dist/components/List/components/ListCardAction.vue.d.ts +23 -0
- package/dist/components/List/components/ListCardAction.vue.d.ts.map +1 -0
- package/dist/components/List/components/ListCardAction.vue.js +23 -0
- package/dist/components/List/components/ListCardAction.vue2.js +5 -0
- package/dist/components/List/components/ListCardFieldNested.vue.d.ts +2 -0
- package/dist/components/List/components/ListCardFieldNested.vue.d.ts.map +1 -1
- package/dist/components/List/components/ListCardFieldNested.vue.js +2 -1
- package/dist/components/List/types.d.ts +5 -0
- package/dist/components/List/types.d.ts.map +1 -1
- package/dist/components/List/use/useListConfig.d.ts +3 -10
- package/dist/components/List/use/useListConfig.d.ts.map +1 -1
- package/dist/components/List/use/useListConfig.js +20 -16
- package/dist/components/List/use/useOrdering.js +3 -3
- package/dist/components/Modal/WModalStepper.vue.d.ts +26 -26
- package/dist/components/Nav/WNavItemExpand.vue.js +0 -13
- package/dist/components/Select/WSelect.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelect.vue.js +2 -2
- package/dist/components/Select/WSelectAsync.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectAsync.vue.js +2 -2
- package/dist/components/Select/WSelectAsyncList.vue.d.ts +1 -1
- package/dist/components/Select/WSelectAsyncList.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectAsyncList.vue.js +0 -1
- package/dist/components/Select/components/SelectAsyncList.vue.d.ts.map +1 -1
- package/dist/components/Select/components/SelectAsyncList.vue.js +15 -11
- package/dist/components/Tabs/WTabs.vue.d.ts +24 -24
- package/dist/components/Tabs/WTabs.vue.d.ts.map +1 -1
- package/dist/components/Tabs/WTabs.vue.js +4 -17
- package/dist/components/Tabs/WTabsColumns.vue.js +2 -2
- package/dist/components/Tabs/components/TabItem.vue.d.ts +12 -12
- package/dist/main.js +2 -2
- package/dist/types/global.d.ts +0 -11
- package/dist/utils/mobile.d.ts +3 -0
- package/dist/utils/mobile.d.ts.map +1 -1
- package/dist/utils/mobile.js +15 -2
- package/dist/utils/useSelected.d.ts +22 -10
- package/dist/utils/useSelected.d.ts.map +1 -1
- package/dist/utils/useSelected.js +172 -45
- package/dist/utils/utils.d.ts +5 -0
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +9 -1
- package/eslint/plugin.js +4 -0
- package/package.json +1 -1
- package/tailwind-base/plugins/default.ts +5 -2
- package/dist/components/InfiniteList/components/InfiniteListPageSelectItem.vue.d.ts +0 -31
- package/dist/components/InfiniteList/components/InfiniteListPageSelectItem.vue.d.ts.map +0 -1
- package/dist/components/InfiniteList/components/InfiniteListPageSelectItem.vue.js +0 -30
- package/dist/components/InfiniteList/components/InfiniteListPageSelectItem.vue2.js +0 -5
- package/dist/components/InfiniteList/components/InfiniteListPageSelection.vue.d.ts +0 -27
- package/dist/components/InfiniteList/components/InfiniteListPageSelection.vue.d.ts.map +0 -1
- package/dist/components/InfiniteList/components/InfiniteListPageSelection.vue.js +0 -66
- package/dist/components/InfiniteList/components/InfiniteListPageSelection.vue2.js +0 -5
- package/dist/components/InfiniteList/models/injection.d.ts +0 -16
- package/dist/components/InfiniteList/models/injection.d.ts.map +0 -1
- package/dist/components/InfiniteList/models/injection.js +0 -4
- package/dist/components/InfiniteList/use/useSelected.d.ts +0 -14
- package/dist/components/InfiniteList/use/useSelected.d.ts.map +0 -1
- package/dist/components/InfiniteList/use/useSelected.js +0 -151
@@ -1,21 +1,10 @@
|
|
1
|
-
import { defineComponent, ref, computed, toRef,
|
1
|
+
import { defineComponent, ref, computed, toRef, createElementBlock, openBlock, normalizeClass, unref, createVNode, normalizeStyle, withCtx, renderSlot, createCommentVNode, createSlots, Fragment, renderList, createBlock, resolveDynamicComponent, createElementVNode, isRef } from 'vue';
|
2
2
|
import _sfc_main$4 from '../Button/WButtonSelection.vue.js';
|
3
3
|
import _sfc_main$1 from '../InfiniteList/WInfiniteList.vue.js';
|
4
|
-
import '
|
5
|
-
import '../Button/WButton.vue.js';
|
6
|
-
import { getIsMobile } from '../../utils/mobile.js';
|
7
|
-
import '../Button/WButtonDropdown.vue.js';
|
8
|
-
import '../../utils/supportsPassive.js';
|
9
|
-
import '../Dropdown/utils/DropdownStyle.js';
|
10
|
-
import 'vue-router';
|
11
|
-
import '../../utils/Modal.js';
|
12
|
-
import '../Input/WInputSuggest.vue.js';
|
13
|
-
import '../HeaderBar/use/useHeaderPadding.js';
|
14
|
-
import '../Input/WInputDate.vue.js';
|
15
|
-
import '../Link/WLink.vue.js';
|
4
|
+
import { useIsMobile } from '../../utils/mobile.js';
|
16
5
|
import { parseOrdering } from '../../utils/order.js';
|
17
6
|
import { PAGE_LENGTH } from '../../utils/useDefaultQuery.js';
|
18
|
-
import { useSelected
|
7
|
+
import { useSelected } from '../../utils/useSelected.js';
|
19
8
|
import _sfc_main$2 from './WListCard.vue.js';
|
20
9
|
import _sfc_main$7 from './WListHeader.vue.js';
|
21
10
|
import _sfc_main$9 from './WListHeaderItem.vue.js';
|
@@ -24,7 +13,6 @@ import _sfc_main$6 from './components/HeaderSettings.vue.js';
|
|
24
13
|
import _sfc_main$5 from './components/HeaderSort.vue.js';
|
25
14
|
import _sfc_main$3 from './components/ListCardFieldNested.vue.js';
|
26
15
|
import { filterFields, useListConfig, getFirstFieldLabel } from './use/useListConfig.js';
|
27
|
-
import '@tanstack/vue-query';
|
28
16
|
|
29
17
|
const _hoisted_1 = { class: "flex" };
|
30
18
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
@@ -43,10 +31,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
43
31
|
menu: {},
|
44
32
|
readonlyGetter: { type: Function },
|
45
33
|
cardClass: {},
|
34
|
+
cardWrapperClass: {},
|
46
35
|
selectAllTextGetter: { type: Function },
|
47
36
|
hasBorder: { type: Boolean },
|
48
37
|
configKey: {},
|
49
38
|
defaultConfigMap: {},
|
39
|
+
defaultMode: {},
|
50
40
|
alignTop: { type: Boolean },
|
51
41
|
disableMore: { type: Boolean },
|
52
42
|
readonly: { type: Boolean },
|
@@ -60,31 +50,42 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
60
50
|
},
|
61
51
|
emits: ["update:error"],
|
62
52
|
setup(__props) {
|
63
|
-
const isMobile = getIsMobile();
|
64
53
|
const props = __props;
|
54
|
+
const { isMobile } = useIsMobile();
|
65
55
|
const listCount = ref(void 0);
|
66
|
-
const selectionCount = ref(0);
|
67
56
|
const cardStyles = computed(() => {
|
57
|
+
if (!props.cardColumns || !props.cardAreas) return;
|
68
58
|
return {
|
69
59
|
"--w-list-grid-cols": props.cardColumns.join(" "),
|
70
60
|
"--w-list-grid-areas": props.cardAreas.map((inner) => `"${inner.join(" ")}"`).join("\n")
|
71
61
|
};
|
72
62
|
});
|
73
63
|
const fieldsVisible = computed(() => filterFields(props.fields, (field) => field.visibleGetter?.(props.queryParams) ?? true));
|
74
|
-
const {
|
64
|
+
const {
|
65
|
+
listConfig,
|
66
|
+
fieldConfigMap,
|
67
|
+
isGrid,
|
68
|
+
hasSaved,
|
69
|
+
reset,
|
70
|
+
save,
|
71
|
+
updateMode
|
72
|
+
} = useListConfig(toRef(props, "configKey"), fieldsVisible, toRef(props, "defaultConfigMap"), toRef(props, "defaultMode"));
|
75
73
|
const fieldsFiltered = computed(() => {
|
76
74
|
return filterFields(fieldsVisible.value, (field) => fieldConfigMap.value[field.label]?.visible).sort((a, b) => fieldConfigMap.value[getFirstFieldLabel(a)].order - fieldConfigMap.value[getFirstFieldLabel(b)].order);
|
77
75
|
});
|
78
76
|
const allowSelect = computed(() => props.bulk !== void 0);
|
79
77
|
const allowOpen = computed(() => props.expansion !== void 0);
|
80
78
|
const {
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
79
|
+
allowSelectHover,
|
80
|
+
selectionCount,
|
81
|
+
selectAllValue,
|
82
|
+
getIsSelected,
|
83
|
+
hoverSelected,
|
84
|
+
toggleSelected,
|
85
|
+
resetSelection,
|
86
|
+
selectAll,
|
87
|
+
getQueryParams
|
88
|
+
} = useSelected(toRef(props, "count"));
|
88
89
|
const ordering = computed(() => {
|
89
90
|
if (props.queryParams instanceof Object && "ordering" in props.queryParams && typeof props.queryParams.ordering === "string") {
|
90
91
|
return parseOrdering(props.queryParams.ordering);
|
@@ -92,35 +93,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
92
93
|
return [];
|
93
94
|
});
|
94
95
|
const getQueryParamsBulk = () => {
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
getPosition(selectedRange.value[1], PAGE_LENGTH)
|
101
|
-
],
|
102
|
-
page: void 0
|
103
|
-
};
|
104
|
-
}
|
105
|
-
if (selected.value.length) {
|
106
|
-
if (reverse.value) {
|
107
|
-
return {
|
108
|
-
...props.queryParams,
|
109
|
-
id__not_in: selected.value.slice()
|
110
|
-
};
|
111
|
-
} else {
|
112
|
-
return {
|
113
|
-
...props.queryParams,
|
114
|
-
id__in: selected.value.slice()
|
115
|
-
};
|
116
|
-
}
|
117
|
-
}
|
96
|
+
const queryParamsSelection = getQueryParams();
|
97
|
+
if (queryParamsSelection) return {
|
98
|
+
...props.queryParams,
|
99
|
+
...queryParamsSelection
|
100
|
+
};
|
118
101
|
return props.queryParams;
|
119
102
|
};
|
120
|
-
const getFieldStyles = (label) => {
|
121
|
-
if (isGrid.value) return {
|
122
|
-
gridArea: label
|
123
|
-
};
|
103
|
+
const getFieldStyles = (label, nested) => {
|
104
|
+
if (isGrid.value) return nested ? void 0 : { gridArea: label };
|
124
105
|
if (!fieldConfigMap.value[label]?.width) return void 0;
|
125
106
|
const value = fieldConfigMap.value[label].width + "px";
|
126
107
|
return {
|
@@ -129,216 +110,220 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
129
110
|
};
|
130
111
|
};
|
131
112
|
return (_ctx, _cache) => {
|
132
|
-
return openBlock(),
|
133
|
-
"use-query-fn": _ctx.useQueryFn,
|
134
|
-
"query-params": _ctx.queryParams,
|
135
|
-
"query-options": _ctx.queryOptions,
|
136
|
-
"skeleton-length": _ctx.count ?? listCount.value ?? unref(PAGE_LENGTH),
|
137
|
-
"hide-page-title": "",
|
138
|
-
"allow-select": allowSelect.value,
|
139
|
-
"allow-select-range": "",
|
140
|
-
selected: unref(selected),
|
141
|
-
reverse: unref(reverse),
|
142
|
-
"selected-range": unref(selectedRange),
|
143
|
-
"page-length": unref(PAGE_LENGTH),
|
144
|
-
count: _ctx.count ?? listCount.value,
|
145
|
-
"page-class": unref(isGrid) ? "grid grid-cols-[repeat(auto-fill,minmax(var(--w-list-card-width,16rem),1fr))] gap-[--w-list-gap,1rem]" : "grid grid-cols-1 gap-[--w-list-gap,1rem]",
|
146
|
-
style: normalizeStyle(cardStyles.value),
|
113
|
+
return openBlock(), createElementBlock("div", {
|
147
114
|
class: normalizeClass({
|
148
115
|
"w-card": unref(isGrid),
|
149
116
|
"w-list": !unref(isGrid)
|
150
|
-
})
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
})
|
176
|
-
|
177
|
-
settings: withCtx(() => [
|
178
|
-
createElementVNode("div", _hoisted_1, [
|
179
|
-
!_ctx.noOrdering ? (openBlock(), createBlock(_sfc_main$5, {
|
180
|
-
key: 0,
|
181
|
-
ordering: ordering.value,
|
182
|
-
fields: fieldsFiltered.value,
|
183
|
-
"query-params": _ctx.queryParams,
|
184
|
-
class: "border-r border-solid border-gray-300 dark:border-gray-700"
|
185
|
-
}, null, 8, ["ordering", "fields", "query-params"])) : createCommentVNode("", true),
|
186
|
-
createVNode(_sfc_main$6, {
|
187
|
-
"field-config-map": unref(fieldConfigMap),
|
188
|
-
"onUpdate:fieldConfigMap": _cache[2] || (_cache[2] = ($event) => isRef(fieldConfigMap) ? fieldConfigMap.value = $event : null),
|
189
|
-
mode: unref(listConfig).mode,
|
190
|
-
fields: fieldsVisible.value,
|
191
|
-
"query-params": _ctx.queryParams,
|
192
|
-
"has-saved": unref(hasSaved),
|
193
|
-
"onClick:reset": unref(reset),
|
194
|
-
"onUpdate:mode": unref(updateMode)
|
195
|
-
}, null, 8, ["field-config-map", "mode", "fields", "query-params", "has-saved", "onClick:reset", "onUpdate:mode"])
|
196
|
-
])
|
197
|
-
]),
|
198
|
-
_: 2
|
199
|
-
}, [
|
200
|
-
_ctx.bulkMore ? {
|
201
|
-
name: "more",
|
202
|
-
fn: withCtx((scope) => [
|
203
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.bulkMore, (item, index) => {
|
117
|
+
})
|
118
|
+
}, [
|
119
|
+
createVNode(_sfc_main$1, {
|
120
|
+
"use-query-fn": _ctx.useQueryFn,
|
121
|
+
"query-params": _ctx.queryParams,
|
122
|
+
"query-options": _ctx.queryOptions,
|
123
|
+
"skeleton-length": _ctx.count ?? listCount.value ?? unref(PAGE_LENGTH),
|
124
|
+
"hide-page-title": "",
|
125
|
+
"page-length": unref(PAGE_LENGTH),
|
126
|
+
count: _ctx.count ?? listCount.value,
|
127
|
+
"page-class": unref(isGrid) ? "grid grid-cols-[repeat(auto-fill,minmax(var(--w-list-card-width,16rem),1fr))] gap-[--w-list-gap,0]" : "grid grid-cols-1 gap-[--w-list-gap,0]",
|
128
|
+
style: normalizeStyle(cardStyles.value),
|
129
|
+
class: normalizeClass(_ctx.$attrs.class),
|
130
|
+
"onUpdate:count": _cache[2] || (_cache[2] = ($event) => listCount.value = $event),
|
131
|
+
"onUpdate:error": _cache[3] || (_cache[3] = ($event) => _ctx.$emit("update:error", $event))
|
132
|
+
}, {
|
133
|
+
header: withCtx(() => [
|
134
|
+
renderSlot(_ctx.$slots, "header", { count: listCount.value }),
|
135
|
+
createVNode(_sfc_main$4, {
|
136
|
+
title: _ctx.selectionTitle,
|
137
|
+
"disable-message": _ctx.bulkDisableMessage,
|
138
|
+
"selected-count": unref(selectionCount),
|
139
|
+
class: "z-[2]",
|
140
|
+
"onClear:selection": unref(resetSelection)
|
141
|
+
}, createSlots({
|
142
|
+
default: withCtx(({ disableMessage, cssClass }) => [
|
143
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.bulk, (item, index) => {
|
204
144
|
return openBlock(), createBlock(resolveDynamicComponent(item), {
|
205
145
|
key: index,
|
206
|
-
"selection-count": selectionCount
|
146
|
+
"selection-count": unref(selectionCount),
|
207
147
|
"query-params-getter": getQueryParamsBulk,
|
208
|
-
"disable-message":
|
209
|
-
class: normalizeClass(
|
210
|
-
"onClear:selected":
|
211
|
-
}, null, 40, ["selection-count", "disable-message", "class"]);
|
148
|
+
"disable-message": disableMessage,
|
149
|
+
class: normalizeClass(cssClass),
|
150
|
+
"onClear:selected": unref(resetSelection)
|
151
|
+
}, null, 40, ["selection-count", "disable-message", "class", "onClear:selected"]);
|
212
152
|
}), 128))
|
213
153
|
]),
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
key: 0,
|
219
|
-
class: "sm-not:hidden mb-4",
|
220
|
-
"query-params": _ctx.queryParams,
|
221
|
-
"allow-select": allowSelect.value,
|
222
|
-
"tooltip-text": _ctx.selectAllTextGetter(selectAllValue !== true, _ctx.count ?? listCount.value ?? 0),
|
223
|
-
count: _ctx.count ?? listCount.value,
|
224
|
-
selection: selectAllValue,
|
225
|
-
"onToggle:selection": _cache[4] || (_cache[4] = ($event) => $event ? unref(setSelectedReverse)([]) : unref(setSelected)([]))
|
226
|
-
}, {
|
227
|
-
default: withCtx(() => [
|
228
|
-
createVNode(_sfc_main$8, { fields: fieldsFiltered.value }, {
|
229
|
-
default: withCtx(({ field }) => [
|
230
|
-
createVNode(_sfc_main$9, {
|
231
|
-
title: typeof field.title === "string" ? field.title : field.title(_ctx.queryParams),
|
232
|
-
field: typeof field.field === "string" ? field.field : field.field?.(_ctx.queryParams),
|
233
|
-
class: normalizeClass(field.cssClass),
|
154
|
+
settings: withCtx(() => [
|
155
|
+
createElementVNode("div", _hoisted_1, [
|
156
|
+
!_ctx.noOrdering ? (openBlock(), createBlock(_sfc_main$5, {
|
157
|
+
key: 0,
|
234
158
|
ordering: ordering.value,
|
235
|
-
|
236
|
-
"
|
237
|
-
"
|
238
|
-
|
239
|
-
|
240
|
-
"
|
241
|
-
|
159
|
+
fields: fieldsFiltered.value,
|
160
|
+
"query-params": _ctx.queryParams,
|
161
|
+
class: "border-r border-solid border-gray-300 dark:border-gray-700"
|
162
|
+
}, null, 8, ["ordering", "fields", "query-params"])) : createCommentVNode("", true),
|
163
|
+
createVNode(_sfc_main$6, {
|
164
|
+
"field-config-map": unref(fieldConfigMap),
|
165
|
+
"onUpdate:fieldConfigMap": _cache[0] || (_cache[0] = ($event) => isRef(fieldConfigMap) ? fieldConfigMap.value = $event : null),
|
166
|
+
mode: unref(listConfig).mode,
|
167
|
+
fields: fieldsVisible.value,
|
168
|
+
"query-params": _ctx.queryParams,
|
169
|
+
"has-saved": unref(hasSaved),
|
170
|
+
mobile: unref(isMobile),
|
171
|
+
"onClick:reset": unref(reset),
|
172
|
+
"onUpdate:mode": unref(updateMode)
|
173
|
+
}, null, 8, ["field-config-map", "mode", "fields", "query-params", "has-saved", "mobile", "onClick:reset", "onUpdate:mode"])
|
174
|
+
])
|
175
|
+
]),
|
176
|
+
_: 2
|
177
|
+
}, [
|
178
|
+
_ctx.bulkMore ? {
|
179
|
+
name: "more",
|
180
|
+
fn: withCtx((scope) => [
|
181
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.bulkMore, (item, index) => {
|
182
|
+
return openBlock(), createBlock(resolveDynamicComponent(item), {
|
183
|
+
key: index,
|
184
|
+
"selection-count": unref(selectionCount),
|
185
|
+
"query-params-getter": getQueryParamsBulk,
|
186
|
+
"disable-message": scope?.disableMessage,
|
187
|
+
class: normalizeClass(scope?.cssClass),
|
188
|
+
"onClear:selected": unref(resetSelection)
|
189
|
+
}, null, 40, ["selection-count", "disable-message", "class", "onClear:selected"]);
|
190
|
+
}), 128))
|
242
191
|
]),
|
243
|
-
|
244
|
-
}
|
245
|
-
]),
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
192
|
+
key: "0"
|
193
|
+
} : void 0
|
194
|
+
]), 1032, ["title", "disable-message", "selected-count", "onClear:selection"]),
|
195
|
+
!unref(isGrid) ? (openBlock(), createBlock(_sfc_main$7, {
|
196
|
+
key: 0,
|
197
|
+
class: "sm-not:hidden mb-4",
|
198
|
+
"query-params": _ctx.queryParams,
|
199
|
+
"allow-select": allowSelect.value,
|
200
|
+
"tooltip-text": _ctx.selectAllTextGetter(unref(selectAllValue) !== true, _ctx.count ?? listCount.value ?? 0),
|
201
|
+
count: _ctx.count ?? listCount.value,
|
202
|
+
selection: unref(selectAllValue),
|
203
|
+
"onToggle:selection": _cache[1] || (_cache[1] = ($event) => $event ? unref(selectAll)() : unref(resetSelection)())
|
204
|
+
}, {
|
205
|
+
default: withCtx(() => [
|
206
|
+
createVNode(_sfc_main$8, { fields: fieldsFiltered.value }, {
|
207
|
+
default: withCtx(({ field, nested }) => [
|
208
|
+
createVNode(_sfc_main$9, {
|
209
|
+
title: typeof field.title === "string" ? field.title : field.title(_ctx.queryParams),
|
210
|
+
field: typeof field.field === "string" ? field.field : field.field?.(_ctx.queryParams),
|
211
|
+
class: normalizeClass(field.cssClass),
|
212
|
+
ordering: ordering.value,
|
213
|
+
disabled: _ctx.noOrdering || !field.field,
|
214
|
+
"allow-resize": field.allowResize,
|
215
|
+
"item-class": field.cssClassHeader,
|
216
|
+
"width-style": getFieldStyles(field.label, nested),
|
217
|
+
"onUpdate:width": ($event) => unref(fieldConfigMap)[field.label].width = $event,
|
218
|
+
"onSave:width": unref(save)
|
219
|
+
}, null, 8, ["title", "field", "class", "ordering", "disabled", "allow-resize", "item-class", "width-style", "onUpdate:width", "onSave:width"])
|
220
|
+
]),
|
221
|
+
_: 1
|
222
|
+
}, 8, ["fields"])
|
223
|
+
]),
|
224
|
+
_: 1
|
225
|
+
}, 8, ["query-params", "allow-select", "tooltip-text", "count", "selection"])) : createCommentVNode("", true)
|
226
|
+
]),
|
227
|
+
default: withCtx(({ item, skeleton, setter, refetch, previous, index, position, value }) => [
|
228
|
+
_ctx.groupBy && (index === 0 || !skeleton && (!previous || !_ctx.groupBy(item, previous))) ? renderSlot(_ctx.$slots, "group", {
|
229
|
+
key: 0,
|
230
|
+
item,
|
231
|
+
previous,
|
232
|
+
skeleton
|
233
|
+
}) : createCommentVNode("", true),
|
234
|
+
createVNode(_sfc_main$2, {
|
235
|
+
disabled: skeleton,
|
236
|
+
"disable-more": _ctx.disableMore,
|
237
|
+
mobile: unref(isMobile),
|
238
|
+
"card-class": _ctx.cardClass,
|
239
|
+
"card-wrapper-class": _ctx.cardWrapperClass,
|
240
|
+
"has-border": _ctx.hasBorder,
|
241
|
+
"allow-open": allowOpen.value && !skeleton,
|
242
|
+
"align-top": _ctx.alignTop,
|
243
|
+
"hide-more": _ctx.hideMore,
|
244
|
+
"form-name": !skeleton ? _ctx.formNameGetter?.(item) : void 0,
|
245
|
+
card: unref(isGrid),
|
246
|
+
to: _ctx.cardTo?.(item),
|
247
|
+
selected: skeleton ? false : unref(getIsSelected)(value, position),
|
248
|
+
"allow-select": allowSelect.value,
|
249
|
+
"allow-select-hover": unref(allowSelectHover),
|
250
|
+
"onToggle:selected": ($event) => unref(toggleSelected)(value, position),
|
251
|
+
"onHover:selected": ($event) => unref(hoverSelected)(position)
|
252
|
+
}, createSlots({
|
253
|
+
default: withCtx(({ validate }) => [
|
254
|
+
createVNode(_sfc_main$3, {
|
255
|
+
fields: fieldsFiltered.value,
|
256
|
+
item,
|
257
|
+
skeleton,
|
258
|
+
card: unref(isGrid)
|
259
|
+
}, {
|
260
|
+
default: withCtx((defaultScope) => [
|
261
|
+
(openBlock(), createBlock(resolveDynamicComponent(defaultScope.field.component), {
|
262
|
+
item: defaultScope.item,
|
263
|
+
readonly: _ctx.readonly || (_ctx.readonlyGetter?.(defaultScope.item) ?? false),
|
264
|
+
skeleton,
|
265
|
+
card: unref(isGrid),
|
266
|
+
class: normalizeClass({
|
267
|
+
[defaultScope.field.cssClass ?? ""]: true,
|
268
|
+
"items-center": !_ctx.alignTop,
|
269
|
+
"items-start": _ctx.alignTop,
|
270
|
+
"pr-6": !unref(isGrid)
|
271
|
+
}),
|
272
|
+
style: normalizeStyle(getFieldStyles(defaultScope.field.label, defaultScope.nested)),
|
273
|
+
"onUpdate:item": setter,
|
274
|
+
"onDelete:item": ($event) => {
|
275
|
+
setter();
|
276
|
+
refetch();
|
277
|
+
},
|
278
|
+
onValidate: ($event) => validate()
|
279
|
+
}, null, 40, ["item", "readonly", "skeleton", "card", "class", "style", "onUpdate:item", "onDelete:item", "onValidate"]))
|
280
|
+
]),
|
281
|
+
_: 2
|
282
|
+
}, 1032, ["fields", "item", "skeleton", "card"])
|
283
|
+
]),
|
284
|
+
more: withCtx(() => [
|
285
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menu, (menuItem, menuIndex) => {
|
286
|
+
return openBlock(), createBlock(resolveDynamicComponent(menuItem), {
|
287
|
+
key: menuIndex,
|
288
|
+
item,
|
289
|
+
readonly: _ctx.readonly || (_ctx.readonlyGetter?.(item) ?? false),
|
290
|
+
"update-item": setter,
|
291
|
+
"delete-item": () => {
|
292
|
+
setter();
|
293
|
+
refetch();
|
294
|
+
},
|
295
|
+
"onUpdate:item": setter,
|
296
|
+
"onDelete:item": ($event) => {
|
297
|
+
setter();
|
298
|
+
refetch();
|
299
|
+
}
|
300
|
+
}, null, 40, ["item", "readonly", "update-item", "delete-item", "onUpdate:item", "onDelete:item"]);
|
301
|
+
}), 128))
|
302
|
+
]),
|
303
|
+
_: 2
|
304
|
+
}, [
|
305
|
+
_ctx.expansion ? {
|
306
|
+
name: "expansion",
|
307
|
+
fn: withCtx(() => [
|
308
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.expansion), {
|
309
|
+
item,
|
310
|
+
readonly: _ctx.readonly || (_ctx.readonlyGetter?.(item) ?? false),
|
280
311
|
skeleton,
|
281
312
|
card: unref(isGrid),
|
282
|
-
class: normalizeClass({
|
283
|
-
[defaultScope.field.cssClass ?? ""]: true,
|
284
|
-
"items-center": !_ctx.alignTop,
|
285
|
-
"items-start": _ctx.alignTop,
|
286
|
-
"pr-6": !unref(isGrid)
|
287
|
-
}),
|
288
|
-
style: normalizeStyle(getFieldStyles(defaultScope.field.label)),
|
289
313
|
"onUpdate:item": setter,
|
290
314
|
"onDelete:item": ($event) => {
|
291
315
|
setter();
|
292
316
|
refetch();
|
293
|
-
}
|
294
|
-
|
295
|
-
}, null, 40, ["item", "readonly", "skeleton", "card", "class", "style", "onUpdate:item", "onDelete:item", "onValidate"]))
|
317
|
+
}
|
318
|
+
}, null, 40, ["item", "readonly", "skeleton", "card", "onUpdate:item", "onDelete:item"]))
|
296
319
|
]),
|
297
|
-
|
298
|
-
}
|
299
|
-
]),
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
item,
|
305
|
-
readonly: _ctx.readonly || (_ctx.readonlyGetter?.(item) ?? false),
|
306
|
-
"update-item": setter,
|
307
|
-
"delete-item": () => {
|
308
|
-
setter();
|
309
|
-
refetch();
|
310
|
-
},
|
311
|
-
"onUpdate:item": setter,
|
312
|
-
"onDelete:item": ($event) => {
|
313
|
-
setter();
|
314
|
-
refetch();
|
315
|
-
}
|
316
|
-
}, null, 40, ["item", "readonly", "update-item", "delete-item", "onUpdate:item", "onDelete:item"]);
|
317
|
-
}), 128))
|
318
|
-
]),
|
319
|
-
_: 2
|
320
|
-
}, [
|
321
|
-
_ctx.expansion ? {
|
322
|
-
name: "expansion",
|
323
|
-
fn: withCtx(() => [
|
324
|
-
(openBlock(), createBlock(resolveDynamicComponent(_ctx.expansion), {
|
325
|
-
item,
|
326
|
-
readonly: _ctx.readonly || (_ctx.readonlyGetter?.(item) ?? false),
|
327
|
-
skeleton,
|
328
|
-
card: unref(isGrid),
|
329
|
-
"onUpdate:item": setter,
|
330
|
-
"onDelete:item": ($event) => {
|
331
|
-
setter();
|
332
|
-
refetch();
|
333
|
-
}
|
334
|
-
}, null, 40, ["item", "readonly", "skeleton", "card", "onUpdate:item", "onDelete:item"]))
|
335
|
-
]),
|
336
|
-
key: "0"
|
337
|
-
} : void 0
|
338
|
-
]), 1032, ["disabled", "disable-more", "mobile", "card-class", "has-border", "allow-open", "align-top", "hide-more", "form-name", "card", "to"])
|
339
|
-
]),
|
340
|
-
_: 3
|
341
|
-
}, 8, ["use-query-fn", "query-params", "query-options", "skeleton-length", "allow-select", "selected", "reverse", "selected-range", "page-length", "count", "page-class", "style", "class", "onSelect", "onSelectReverse", "onSelectRange"]);
|
320
|
+
key: "0"
|
321
|
+
} : void 0
|
322
|
+
]), 1032, ["disabled", "disable-more", "mobile", "card-class", "card-wrapper-class", "has-border", "allow-open", "align-top", "hide-more", "form-name", "card", "to", "selected", "allow-select", "allow-select-hover", "onToggle:selected", "onHover:selected"])
|
323
|
+
]),
|
324
|
+
_: 3
|
325
|
+
}, 8, ["use-query-fn", "query-params", "query-options", "skeleton-length", "page-length", "count", "page-class", "style", "class"])
|
326
|
+
], 2);
|
342
327
|
};
|
343
328
|
}
|
344
329
|
});
|
@@ -23,16 +23,18 @@ declare const __VLS_component: import('vue').DefineComponent<{
|
|
23
23
|
alignTop: boolean | undefined;
|
24
24
|
hasBorder: boolean | undefined;
|
25
25
|
cardClass: string | undefined;
|
26
|
+
cardWrapperClass: string | undefined;
|
26
27
|
allowOpen: boolean | undefined;
|
27
28
|
disableMore: boolean | undefined;
|
28
29
|
formName: string | undefined;
|
29
|
-
card: boolean
|
30
|
+
card: boolean;
|
30
31
|
to: LinkProps["to"] | undefined;
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
"
|
32
|
+
selected: boolean;
|
33
|
+
allowSelect: boolean;
|
34
|
+
allowSelectHover: boolean;
|
35
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
36
|
+
"toggle:selected": () => any;
|
37
|
+
"hover:selected": () => any;
|
36
38
|
}, string, import('vue').PublicProps, Readonly<{
|
37
39
|
disabled: boolean | undefined;
|
38
40
|
hideMore: boolean | undefined;
|
@@ -40,14 +42,18 @@ declare const __VLS_component: import('vue').DefineComponent<{
|
|
40
42
|
alignTop: boolean | undefined;
|
41
43
|
hasBorder: boolean | undefined;
|
42
44
|
cardClass: string | undefined;
|
45
|
+
cardWrapperClass: string | undefined;
|
43
46
|
allowOpen: boolean | undefined;
|
44
47
|
disableMore: boolean | undefined;
|
45
48
|
formName: string | undefined;
|
46
|
-
card: boolean
|
49
|
+
card: boolean;
|
47
50
|
to: LinkProps["to"] | undefined;
|
51
|
+
selected: boolean;
|
52
|
+
allowSelect: boolean;
|
53
|
+
allowSelectHover: boolean;
|
48
54
|
}> & Readonly<{
|
49
|
-
"
|
50
|
-
"
|
55
|
+
"onToggle:selected"?: (() => any) | undefined;
|
56
|
+
"onHover:selected"?: (() => any) | undefined;
|
51
57
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
52
58
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
53
59
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WListCard.vue.d.ts","sourceRoot":"","sources":["../../../src/components/List/WListCard.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WListCard.vue.d.ts","sourceRoot":"","sources":["../../../src/components/List/WListCard.vue"],"names":[],"mappings":"AA+OA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,eAAe,CAAA;AA+D5C,iBAAS,cAAc;;;;;;YAwZO,GAAG;sBACN,GAAG;sBACH,GAAG;2BACE,GAAG;;;;;WAUrB,OAAO,IAA6B;EAEjD;AA2BD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;cA/eT,OAAO,GAAG,SAAS;cACnB,OAAO,GAAG,SAAS;YACrB,OAAO,GAAG,SAAS;cACjB,OAAO,GAAG,SAAS;eAClB,OAAO,GAAG,SAAS;eACnB,MAAM,GAAG,SAAS;sBACX,MAAM,GAAG,SAAS;eACzB,OAAO,GAAG,SAAS;iBACjB,OAAO,GAAG,SAAS;cACtB,MAAM,GAAG,SAAS;UACtB,OAAO;QACT,SAAS,CAAC,IAAI,CAAC,GAAG,SAAS;cAErB,OAAO;iBACJ,OAAO;sBACF,OAAO;;;;;cAff,OAAO,GAAG,SAAS;cACnB,OAAO,GAAG,SAAS;YACrB,OAAO,GAAG,SAAS;cACjB,OAAO,GAAG,SAAS;eAClB,OAAO,GAAG,SAAS;eACnB,MAAM,GAAG,SAAS;sBACX,MAAM,GAAG,SAAS;eACzB,OAAO,GAAG,SAAS;iBACjB,OAAO,GAAG,SAAS;cACtB,MAAM,GAAG,SAAS;UACtB,OAAO;QACT,SAAS,CAAC,IAAI,CAAC,GAAG,SAAS;cAErB,OAAO;iBACJ,OAAO;sBACF,OAAO;;;;kFA0ezB,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"}
|