eco-vue-js 0.10.5 → 0.10.7

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.
Files changed (96) hide show
  1. package/dist/components/Button/WButtonDropdown.vue.d.ts +1 -1
  2. package/dist/components/Button/WButtonDropdown.vue.d.ts.map +1 -1
  3. package/dist/components/Button/WButtonDropdown.vue.js +1 -12
  4. package/dist/components/Button/WButtonSelection.vue.d.ts +6 -5
  5. package/dist/components/Button/WButtonSelection.vue.d.ts.map +1 -1
  6. package/dist/components/Button/WButtonSelection.vue.js +10 -24
  7. package/dist/components/Checkbox/WCheckbox.vue.d.ts +0 -2
  8. package/dist/components/Checkbox/WCheckbox.vue.d.ts.map +1 -1
  9. package/dist/components/Checkbox/WCheckbox.vue.js +2 -8
  10. package/dist/components/FieldWrapper/WFieldWrapper.vue.js +1 -14
  11. package/dist/components/Form/WForm.vue.d.ts +2 -2
  12. package/dist/components/Form/WFormValidator.vue.d.ts +2 -2
  13. package/dist/components/Form/WFormValidator.vue.js +1 -14
  14. package/dist/components/Form/models/utils.js +0 -14
  15. package/dist/components/FormAsync/use/useFormAsync.d.ts.map +1 -1
  16. package/dist/components/FormAsync/use/useFormAsync.js +2 -14
  17. package/dist/components/HeaderBar/WHeaderBar.vue.js +2 -2
  18. package/dist/components/InfiniteList/WInfiniteList.vue.d.ts +3 -18
  19. package/dist/components/InfiniteList/WInfiniteList.vue.d.ts.map +1 -1
  20. package/dist/components/InfiniteList/WInfiniteList.vue.js +25 -83
  21. package/dist/components/InfiniteList/WInfiniteListWrapper.vue.js +1 -1
  22. package/dist/components/InfiniteList/components/InfiniteListPage.vue.d.ts +0 -5
  23. package/dist/components/InfiniteList/components/InfiniteListPage.vue.d.ts.map +1 -1
  24. package/dist/components/InfiniteList/components/InfiniteListPage.vue.js +8 -27
  25. package/dist/components/InfiniteList/components/InfiniteListPages.vue.d.ts +1 -8
  26. package/dist/components/InfiniteList/components/InfiniteListPages.vue.d.ts.map +1 -1
  27. package/dist/components/InfiniteList/components/InfiniteListPages.vue.js +10 -21
  28. package/dist/components/InfiniteList/use/useInfiniteListHeader.js +0 -13
  29. package/dist/components/Input/WInputSuggest.vue.js +3 -3
  30. package/dist/components/List/WList.vue.d.ts +3 -2
  31. package/dist/components/List/WList.vue.d.ts.map +1 -1
  32. package/dist/components/List/WList.vue.js +99 -112
  33. package/dist/components/List/WListCard.vue.d.ts +13 -11
  34. package/dist/components/List/WListCard.vue.d.ts.map +1 -1
  35. package/dist/components/List/WListCard.vue.js +79 -87
  36. package/dist/components/List/WListHeaderItem.vue.d.ts.map +1 -1
  37. package/dist/components/List/WListHeaderItem.vue.js +1 -1
  38. package/dist/components/List/components/HeaderSettings.vue.d.ts +3 -2
  39. package/dist/components/List/components/HeaderSettings.vue.d.ts.map +1 -1
  40. package/dist/components/List/components/HeaderSettings.vue.js +20 -24
  41. package/dist/components/List/components/HeaderSort.vue.d.ts +1 -1
  42. package/dist/components/List/components/HeaderSort.vue.d.ts.map +1 -1
  43. package/dist/components/List/components/HeaderSort.vue.js +0 -13
  44. package/dist/components/List/components/ListCardAction.vue.d.ts +23 -0
  45. package/dist/components/List/components/ListCardAction.vue.d.ts.map +1 -0
  46. package/dist/components/List/components/ListCardAction.vue.js +23 -0
  47. package/dist/components/List/components/ListCardAction.vue2.js +5 -0
  48. package/dist/components/List/types.d.ts +5 -0
  49. package/dist/components/List/types.d.ts.map +1 -1
  50. package/dist/components/List/use/useListConfig.d.ts +3 -10
  51. package/dist/components/List/use/useListConfig.d.ts.map +1 -1
  52. package/dist/components/List/use/useListConfig.js +20 -16
  53. package/dist/components/Modal/WModalStepper.vue.d.ts +26 -26
  54. package/dist/components/Nav/WNavItemExpand.vue.js +0 -13
  55. package/dist/components/Select/WSelect.vue.d.ts.map +1 -1
  56. package/dist/components/Select/WSelect.vue.js +2 -2
  57. package/dist/components/Select/WSelectAsync.vue.d.ts.map +1 -1
  58. package/dist/components/Select/WSelectAsync.vue.js +2 -2
  59. package/dist/components/Select/WSelectAsyncList.vue.d.ts +1 -1
  60. package/dist/components/Select/WSelectAsyncList.vue.d.ts.map +1 -1
  61. package/dist/components/Select/WSelectAsyncList.vue.js +0 -1
  62. package/dist/components/Select/components/SelectAsyncList.vue.d.ts.map +1 -1
  63. package/dist/components/Select/components/SelectAsyncList.vue.js +15 -11
  64. package/dist/components/Tabs/WTabs.vue.d.ts +24 -24
  65. package/dist/components/Tabs/WTabs.vue.d.ts.map +1 -1
  66. package/dist/components/Tabs/WTabs.vue.js +4 -17
  67. package/dist/components/Tabs/WTabsColumns.vue.js +2 -2
  68. package/dist/components/Tabs/components/TabItem.vue.d.ts +12 -12
  69. package/dist/main.js +2 -2
  70. package/dist/types/global.d.ts +0 -11
  71. package/dist/utils/mobile.d.ts +3 -0
  72. package/dist/utils/mobile.d.ts.map +1 -1
  73. package/dist/utils/mobile.js +15 -2
  74. package/dist/utils/useSelected.d.ts +22 -10
  75. package/dist/utils/useSelected.d.ts.map +1 -1
  76. package/dist/utils/useSelected.js +177 -45
  77. package/dist/utils/utils.d.ts +5 -0
  78. package/dist/utils/utils.d.ts.map +1 -1
  79. package/dist/utils/utils.js +9 -1
  80. package/eslint/plugin.js +4 -0
  81. package/package.json +1 -1
  82. package/tailwind-base/plugins/default.ts +1 -0
  83. package/dist/components/InfiniteList/components/InfiniteListPageSelectItem.vue.d.ts +0 -31
  84. package/dist/components/InfiniteList/components/InfiniteListPageSelectItem.vue.d.ts.map +0 -1
  85. package/dist/components/InfiniteList/components/InfiniteListPageSelectItem.vue.js +0 -30
  86. package/dist/components/InfiniteList/components/InfiniteListPageSelectItem.vue2.js +0 -5
  87. package/dist/components/InfiniteList/components/InfiniteListPageSelection.vue.d.ts +0 -27
  88. package/dist/components/InfiniteList/components/InfiniteListPageSelection.vue.d.ts.map +0 -1
  89. package/dist/components/InfiniteList/components/InfiniteListPageSelection.vue.js +0 -66
  90. package/dist/components/InfiniteList/components/InfiniteListPageSelection.vue2.js +0 -5
  91. package/dist/components/InfiniteList/models/injection.d.ts +0 -16
  92. package/dist/components/InfiniteList/models/injection.d.ts.map +0 -1
  93. package/dist/components/InfiniteList/models/injection.js +0 -4
  94. package/dist/components/InfiniteList/use/useSelected.d.ts +0 -14
  95. package/dist/components/InfiniteList/use/useSelected.d.ts.map +0 -1
  96. package/dist/components/InfiniteList/use/useSelected.js +0 -151
@@ -1,14 +1,13 @@
1
1
  import { defineComponent, useTemplateRef, ref, toRef, computed, watch, onMounted, nextTick, onBeforeUnmount, createElementBlock, openBlock, unref, Fragment, createElementVNode, createBlock, createCommentVNode, normalizeClass, resolveDynamicComponent, TransitionGroup, normalizeProps, mergeProps, withCtx, renderList, renderSlot, toDisplayString } from 'vue';
2
- import _sfc_main$3 from '../../EmptyComponent/WEmptyComponent.vue.js';
2
+ import _sfc_main$2 from '../../EmptyComponent/WEmptyComponent.vue.js';
3
3
  import { ApiError } from '../../../utils/api.js';
4
- import _sfc_main$1 from './InfiniteListPageSelection.vue.js';
5
- import _sfc_main$2 from './InfiniteListPageTitle.vue.js';
4
+ import _sfc_main$1 from './InfiniteListPageTitle.vue.js';
6
5
 
7
6
  const _hoisted_1 = {
8
7
  ref: "element",
9
8
  class: "relative"
10
9
  };
11
- const _hoisted_2 = { class: "mt-[--w-list-gap,1rem] flex" };
10
+ const _hoisted_2 = { class: "mt-[--w-list-gap,0] flex" };
12
11
  const _hoisted_3 = { class: "py-1.25 sm-not:px-3 cursor-default select-none" };
13
12
  const _sfc_main = /* @__PURE__ */ defineComponent({
14
13
  __name: "InfiniteListPage",
@@ -29,12 +28,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
29
28
  refetchInterval: { type: [Number, Boolean], default: void 0 },
30
29
  scrollingElement: { default: void 0 },
31
30
  queryOptions: { default: void 0 },
32
- selected: { default: void 0 },
33
- valueGetter: {},
34
- selectOnly: { type: Boolean },
35
- unselectOnly: { type: Boolean },
36
- reverseSelection: { type: Boolean },
37
- allowPageSelection: { type: Boolean }
31
+ valueGetter: {}
38
32
  },
39
33
  emits: ["update:count", "update:pages-count", "update:next-page", "update:previous-page", "update:scroll", "remove:page", "refetch", "update-from-header:scroll", "update:selected", "fetched", "update:error"],
40
34
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -169,21 +163,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
169
163
  return openBlock(), createElementBlock("div", _hoisted_1, [
170
164
  page.value && unref(data)?.results.length !== 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
171
165
  createElementVNode("div", _hoisted_2, [
172
- _ctx.selected !== void 0 && _ctx.allowPageSelection ? (openBlock(), createBlock(_sfc_main$1, {
166
+ !_ctx.hidePageTitle ? (openBlock(), createBlock(_sfc_main$1, {
173
167
  key: 0,
174
- selected: _ctx.selected,
175
- items: unref(data)?.results ?? [],
176
- disabled: !unref(data)?.results,
177
- "tooltip-text-persisted": _ctx.hidePageTitle,
178
- "select-only": _ctx.selectOnly,
179
- "unselect-only": _ctx.unselectOnly,
180
- reverse: _ctx.reverseSelection,
181
- "value-getter": _ctx.valueGetter,
182
- class: "sm:w-list-row-item sm-not:px-[calc(var(--inner-margin)-2px)] pb-4 pt-6",
183
- "onUpdate:selected": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:selected", $event))
184
- }, null, 8, ["selected", "items", "disabled", "tooltip-text-persisted", "select-only", "unselect-only", "reverse", "value-getter"])) : createCommentVNode("", true),
185
- !_ctx.hidePageTitle ? (openBlock(), createBlock(_sfc_main$2, {
186
- key: 1,
187
168
  "query-params": _ctx.queryParams,
188
169
  class: "pb-4 pt-6"
189
170
  }, null, 8, ["query-params"])) : createCommentVNode("", true)
@@ -191,7 +172,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
191
172
  createElementVNode("div", {
192
173
  class: normalizeClass(_ctx.pageClass)
193
174
  }, [
194
- hasData.value && unref(data)?.results ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.transition ? TransitionGroup : _sfc_main$3), normalizeProps(mergeProps({ key: 0 }, _ctx.transition ? {
175
+ hasData.value && unref(data)?.results ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.transition ? TransitionGroup : _sfc_main$2), normalizeProps(mergeProps({ key: 0 }, _ctx.transition ? {
195
176
  "enter-active-class": "transition-[grid-template-rows] overflow-hidden grid",
196
177
  "enter-from-class": "grid-rows-[0fr]",
197
178
  "enter-to-class": "grid-rows-[1fr]",
@@ -202,12 +183,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
202
183
  } : void 0)), {
203
184
  default: withCtx(() => [
204
185
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(data).results, (item, index) => {
205
- return openBlock(), createBlock(resolveDynamicComponent(_ctx.transition ? "div" : _sfc_main$3), mergeProps({
186
+ return openBlock(), createBlock(resolveDynamicComponent(_ctx.transition ? "div" : _sfc_main$2), mergeProps({
206
187
  key: _ctx.valueGetter(item),
207
188
  ref_for: true
208
189
  }, _ctx.transition ? { class: "w-full" } : void 0), {
209
190
  default: withCtx(() => [
210
- (openBlock(), createBlock(resolveDynamicComponent(_ctx.transition ? "div" : _sfc_main$3), mergeProps({ ref_for: true }, _ctx.transition ? { class: "[overflow:inherit]" } : void 0), {
191
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.transition ? "div" : _sfc_main$2), mergeProps({ ref_for: true }, _ctx.transition ? { class: "[overflow:inherit]" } : void 0), {
211
192
  default: withCtx(() => [
212
193
  renderSlot(_ctx.$slots, "default", {
213
194
  item,
@@ -2,13 +2,12 @@ import { ApiError } from '../../../utils/api';
2
2
  declare const _default: <Model extends number | string, Data extends DefaultData, QueryParams>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
3
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
4
  readonly "onUpdate:count"?: ((value: number) => any) | undefined;
5
- readonly "onUpdate:selected"?: ((values: Model[]) => any) | undefined;
6
5
  readonly "onUpdate:error"?: ((value: ApiError<{}, {
7
6
  detail?: string | undefined;
8
7
  non_field_errors?: string[] | undefined;
9
8
  }>) => any) | undefined;
10
9
  readonly "onUpdate:page"?: ((value: number | undefined) => any) | undefined;
11
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:count" | "onUpdate:selected" | "onUpdate:error" | "onUpdate:page"> & {
10
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:count" | "onUpdate:error" | "onUpdate:page"> & {
12
11
  useQueryFn: UseQueryPaginated<Data, QueryParams>;
13
12
  queryParams: QueryParams;
14
13
  skeletonLength?: number;
@@ -27,12 +26,7 @@ declare const _default: <Model extends number | string, Data extends DefaultData
27
26
  maxPages?: number;
28
27
  refetchInterval?: number | false;
29
28
  queryOptions?: Partial<QueryOptions<PaginatedResponse<Data>>>;
30
- selected?: Model[];
31
29
  valueGetter: (data: Data) => Model;
32
- selectOnly?: boolean;
33
- unselectOnly?: boolean;
34
- reverseSelection?: boolean;
35
- allowPageSelection?: boolean;
36
30
  }> & import('vue').PublicProps;
37
31
  expose(exposed: import('vue').ShallowUnwrapRef<{
38
32
  resetPage: (page?: number) => Promise<void>;
@@ -73,7 +67,6 @@ declare const _default: <Model extends number | string, Data extends DefaultData
73
67
  emit: {
74
68
  (e: "update:page", value: number | undefined): void;
75
69
  (e: "update:count", value: number): void;
76
- (e: "update:selected", values: Model[]): void;
77
70
  (e: "update:error", value: ApiError): void;
78
71
  };
79
72
  }>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
@@ -1 +1 @@
1
- {"version":3,"file":"InfiniteListPages.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/InfiniteList/components/InfiniteListPages.vue"],"names":[],"mappings":"AAiUA,OAAO,KA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,IAAI,CAAA;YACf,IAAI,CAAC,EAAE,IAAI,CAAA;YACX,KAAK,EAAE,OAAO,CAAA;YACd,IAAI,EAAE,OAAO,CAAA;YACb,SAAS,EAAE,OAAO,CAAA;YAClB,IAAI,EAAE,MAAM,CAAA;YACZ,KAAK,EAAE,MAAM,CAAA;YACb,KAAK,EAAE,KAAK,CAAA;SACb,KAAK,IAAI;;kBAbA,CAAC,KAAK,EAAE;YAChB,IAAI,EAAE,IAAI,CAAA;YACV,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,GAAG,SAAS,KAAK,IAAI,CAAA;YAC5C,QAAQ,EAAE,OAAO,CAAA;YACjB,OAAO,EAAE,MAAM,IAAI,CAAA;YACnB,QAAQ,CAAC,EAAE,IAAI,CAAA;YACf,IAAI,CAAC,EAAE,IAAI,CAAA;YACX,KAAK,EAAE,OAAO,CAAA;YACd,IAAI,EAAE,OAAO,CAAA;YACb,SAAS,EAAE,OAAO,CAAA;YAClB,IAAI,EAAE,MAAM,CAAA;YACZ,KAAK,EAAE,MAAM,CAAA;YACb,KAAK,EAAE,KAAK,CAAA;SACb,KAAK,IAAI;;;YAjLN,aAAa,SAAS,MAAM,GAAG,SAAS,GAAG,IAAI;YAC/C,cAAc,SAAS,MAAM,GAAG,IAAI;YACpC,iBAAiB,UAAU,KAAK,EAAE,GAAG,IAAI;YACzC,cAAc,SAAS,QAAQ,GAAG,IAAI;;;;;YAkkBA,OAAO,CAAC,OAAO,WAAW,CAAC;;AAznBvE,wBAynB4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"InfiniteListPages.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/InfiniteList/components/InfiniteListPages.vue"],"names":[],"mappings":"AAoTA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAA;yBAcx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AAE,OAAO,CAAA;YAClB,IAAI,EAAE,MAAM,CAAA;YACZ,KAAK,EAAE,MAAM,CAAA;YACb,KAAK,EAAE,KAAK,CAAA;SACb,KAAK,IAAI;;kBAbA,CAAC,KAAK,EAAE;YAChB,IAAI,EAAE,IAAI,CAAA;YACV,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,GAAG,SAAS,KAAK,IAAI,CAAA;YAC5C,QAAQ,EAAE,OAAO,CAAA;YACjB,OAAO,EAAE,MAAM,IAAI,CAAA;YACnB,QAAQ,CAAC,EAAE,IAAI,CAAA;YACf,IAAI,CAAC,EAAE,IAAI,CAAA;YACX,KAAK,EAAE,OAAO,CAAA;YACd,IAAI,EAAE,OAAO,CAAA;YACb,SAAS,EAAE,OAAO,CAAA;YAClB,IAAI,EAAE,MAAM,CAAA;YACZ,KAAK,EAAE,MAAM,CAAA;YACb,KAAK,EAAE,KAAK,CAAA;SACb,KAAK,IAAI;;;YAhLN,aAAa,SAAS,MAAM,GAAG,SAAS,GAAG,IAAI;YAC/C,cAAc,SAAS,MAAM,GAAG,IAAI;YACpC,cAAc,SAAS,QAAQ,GAAG,IAAI;;;;;YAkjBA,OAAO,CAAC,OAAO,WAAW,CAAC;;AAlmBvE,wBAkmB4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
@@ -27,14 +27,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
27
27
  maxPages: { default: 5 },
28
28
  refetchInterval: { type: [Number, Boolean], default: void 0 },
29
29
  queryOptions: { default: void 0 },
30
- selected: { default: void 0 },
31
- valueGetter: {},
32
- selectOnly: { type: Boolean },
33
- unselectOnly: { type: Boolean },
34
- reverseSelection: { type: Boolean },
35
- allowPageSelection: { type: Boolean }
30
+ valueGetter: {}
36
31
  },
37
- emits: ["update:page", "update:count", "update:selected", "update:error"],
32
+ emits: ["update:page", "update:count", "update:error"],
38
33
  setup(__props, { expose: __expose, emit: __emit }) {
39
34
  const props = __props;
40
35
  const emit = __emit;
@@ -179,26 +174,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
179
174
  "refetch-interval": _ctx.refetchInterval,
180
175
  "scrolling-element": _ctx.scrollingElement,
181
176
  "query-options": _ctx.queryOptions,
182
- selected: _ctx.selected,
183
177
  "value-getter": _ctx.valueGetter,
184
- "select-only": _ctx.selectOnly,
185
- "unselect-only": _ctx.unselectOnly,
186
- "reverse-selection": _ctx.reverseSelection,
187
- "allow-page-selection": _ctx.allowPageSelection,
188
- "onUpdate:selected": _cache[2] || (_cache[2] = ($event) => _ctx.$emit("update:selected", $event)),
189
- "onUpdate:count": _cache[3] || (_cache[3] = ($event) => {
178
+ "onUpdate:count": _cache[2] || (_cache[2] = ($event) => {
190
179
  updateCount($event);
191
180
  _ctx.$emit("update:count", $event);
192
181
  }),
193
182
  "onUpdate:pagesCount": updatePagesCount,
194
- "onUpdate:nextPage": _cache[4] || (_cache[4] = ($event) => updateNextPage($event)),
195
- "onUpdate:previousPage": _cache[5] || (_cache[5] = ($event) => updatePreviousPage($event)),
183
+ "onUpdate:nextPage": _cache[3] || (_cache[3] = ($event) => updateNextPage($event)),
184
+ "onUpdate:previousPage": _cache[4] || (_cache[4] = ($event) => updatePreviousPage($event)),
196
185
  "onUpdate:scroll": updateScroll,
197
- "onUpdateFromHeader:scroll": _cache[6] || (_cache[6] = ($event) => _ctx.headerTop > 0 && nextTick(() => updateScroll(_ctx.headerTop))),
186
+ "onUpdateFromHeader:scroll": _cache[5] || (_cache[5] = ($event) => _ctx.headerTop > 0 && nextTick(() => updateScroll(_ctx.headerTop))),
198
187
  "onRemove:page": removePage,
199
188
  onRefetch: ($event) => unref(refetchNextPages)(index),
200
- onFetched: _cache[7] || (_cache[7] = ($event) => isResettingPage.value = false),
201
- "onUpdate:error": _cache[8] || (_cache[8] = ($event) => _ctx.$emit("update:error", $event))
189
+ onFetched: _cache[6] || (_cache[6] = ($event) => isResettingPage.value = false),
190
+ "onUpdate:error": _cache[7] || (_cache[7] = ($event) => _ctx.$emit("update:error", $event))
202
191
  }, {
203
192
  default: withCtx(({ item, setter, skeleton, refetch, previous, next, first, last, page: itemPage, index: itemIndex }) => [
204
193
  renderSlot(_ctx.$slots, "default", {
@@ -217,12 +206,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
217
206
  })
218
207
  ]),
219
208
  _: 2
220
- }, 1032, ["query-params", "use-query-fn", "skeleton-length", "first-page", "last-page", "hide-page-title", "wrap", "transition", "resetting", "empty-stub", "min-height", "last-child", "page-class", "refetch-interval", "scrolling-element", "query-options", "selected", "value-getter", "select-only", "unselect-only", "reverse-selection", "allow-page-selection", "onRefetch"]);
209
+ }, 1032, ["query-params", "use-query-fn", "skeleton-length", "first-page", "last-page", "hide-page-title", "wrap", "transition", "resetting", "empty-stub", "min-height", "last-child", "page-class", "refetch-interval", "scrolling-element", "query-options", "value-getter", "onRefetch"]);
221
210
  }), 128)),
222
211
  count.value !== 0 && nextPage.value ? (openBlock(), createBlock(_sfc_main$2, {
223
212
  key: 1,
224
213
  onClick: addNextPage,
225
- onCheck: _cache[9] || (_cache[9] = ($event) => unref(infiniteScrollRef)?.checkIsScrollDown())
214
+ onCheck: _cache[8] || (_cache[8] = ($event) => unref(infiniteScrollRef)?.checkIsScrollDown())
226
215
  })) : createCommentVNode("", true)
227
216
  ]),
228
217
  _: 3
@@ -1,18 +1,5 @@
1
1
  import { ref, onMounted, onBeforeUnmount } from 'vue';
2
- import '../../Button/WButtonAction.vue.js';
3
- import '../../Button/WButton.vue.js';
4
2
  import { isClientSide } from '../../../utils/utils.js';
5
- import '../../Button/WButtonDropdown.vue.js';
6
- import '../../../utils/supportsPassive.js';
7
- import '../../Dropdown/utils/DropdownStyle.js';
8
- import 'vue-router';
9
- import '../../../utils/Modal.js';
10
- import '../../Input/WInputSuggest.vue.js';
11
- import '../../HeaderBar/use/useHeaderPadding.js';
12
- import '../../Input/WInputDate.vue.js';
13
- import '../../Link/WLink.vue.js';
14
- import '@tanstack/vue-query';
15
- import '../../List/use/useListConfig.js';
16
3
 
17
4
  const headerElementHeight = 60;
18
5
  const observerOptions = {
@@ -5,7 +5,7 @@ import _sfc_main$3 from './WInput.vue.js';
5
5
  import WSkeleton from '../Skeleton/WSkeleton.vue.js';
6
6
  import IconArrow from '../../assets/icons/default/IconArrow.svg.js';
7
7
  import { HorizontalAlign } from '../../utils/HorizontalAlign.js';
8
- import { getIsMobile, getIsTouchDevice } from '../../utils/mobile.js';
8
+ import { useIsMobile } from '../../utils/mobile.js';
9
9
 
10
10
  const _sfc_main = /* @__PURE__ */ defineComponent({
11
11
  ...{ inheritAttrs: false },
@@ -69,7 +69,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
69
69
  const dropdownMenuRef = useTemplateRef("dropdownMenu");
70
70
  const inputRef = useTemplateRef("input");
71
71
  const contentRef = useTemplateRef("content");
72
- const isMobile = getIsMobile() || getIsTouchDevice();
72
+ const { isMobile } = useIsMobile();
73
73
  const isDisabled = computed(() => props.readonly || props.disabled);
74
74
  const open = () => {
75
75
  if (isDisabled.value) return;
@@ -81,7 +81,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
81
81
  emit("close");
82
82
  };
83
83
  const focus = () => {
84
- if (isMobile) open();
84
+ if (isMobile.value) open();
85
85
  inputRef.value?.focus();
86
86
  };
87
87
  const blur = () => {
@@ -1,6 +1,7 @@
1
1
  import { BulkComponent, CardAreas, FieldComponent, FieldConfigMap, GridCol, ListFields, MenuComponent } from './types';
2
2
  import { LinkProps } from '../../types/types';
3
3
  import { ApiError } from '../../utils/api';
4
+ import { ListMode } from '../../utils/utils';
4
5
  declare const _default: <Data extends DefaultData, QueryParams, Fields extends ListFields<Data, QueryParams>, CardColumns extends readonly GridCol[]>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
5
6
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
6
7
  readonly "onUpdate:error"?: ((value: ApiError<{}, {
@@ -18,7 +19,7 @@ declare const _default: <Data extends DefaultData, QueryParams, Fields extends L
18
19
  selectionTitle: string;
19
20
  bulk?: BulkComponent<QueryParams>[];
20
21
  bulkMore?: BulkComponent<QueryParams>[];
21
- menu: MenuComponent<Data>[];
22
+ menu?: MenuComponent<Data>[];
22
23
  readonlyGetter?: (item: Data) => boolean;
23
24
  cardClass?: string;
24
25
  cardWrapperClass?: string;
@@ -26,13 +27,13 @@ declare const _default: <Data extends DefaultData, QueryParams, Fields extends L
26
27
  hasBorder?: boolean;
27
28
  configKey: string;
28
29
  defaultConfigMap: FieldConfigMap<Fields>;
30
+ defaultMode?: ListMode;
29
31
  alignTop?: boolean;
30
32
  disableMore?: boolean;
31
33
  readonly?: boolean;
32
34
  noOrdering?: boolean;
33
35
  formNameGetter?: (data: Data) => string | undefined;
34
36
  groupBy?: (a: Data, b: Data) => boolean;
35
- hideMore?: boolean;
36
37
  cardColumns: CardColumns;
37
38
  cardAreas: CardAreas<Fields, CardColumns["length"]>;
38
39
  cardTo?: (item: Data) => LinkProps["to"];
@@ -1 +1 @@
1
- {"version":3,"file":"WList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/List/WList.vue"],"names":[],"mappings":"AAuXA,OAAO,KAAK,EAAC,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAC,MAAM,SAAS,CAAA;AACzH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAA;yBAsBxB,IAAI,SAAS,WAAW,EAAE,WAAW,EAAE,MAAM,SA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CAAC,IAAI,EAAE,WAAW,CAAC;qBACnC,WAAW;uBACT,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;6BACxC,MAAM;wBACX,MAAM;eACf,aAAa,CAAC,WAAW,CAAC,EAAE;mBACxB,aAAa,CAAC,WAAW,CAAC,EAAE;eAChC,aAAa,CAAC,IAAI,CAAC,EAAE;yBACX,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO;oBAC5B,MAAM;2BACC,MAAM;6BACJ,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM;oBACvD,OAAO;mBACR,MAAM;0BACC,cAAc,CAAC,MAAM,CAAC;sBAC1B,QAAQ;mBACX,OAAO;sBACJ,OAAO;mBACV,OAAO;qBACL,OAAO;yBACH,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,GAAG,SAAS;kBACzC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,KAAK,OAAO;qBAC1B,WAAW;mBACb,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;iBAC1C,CAAC,IAAI,EAAE,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC;KAsoB6C,CAAC,4BAA2B;oBAChG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;;;YA9De,GAAG;;;;;YACH,GAAG;;cAtkBzB,cAAc,SAAS,QAAQ,KAAG,IAAI;;;;YAwoBA,OAAO,CAAC,OAAO,WAAW,CAAC;;AA/qBvE,wBA+qB4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
@@ -1,21 +1,10 @@
1
- import { defineComponent, ref, computed, toRef, createElementBlock, openBlock, normalizeClass, unref, createVNode, normalizeStyle, withCtx, renderSlot, createCommentVNode, createSlots, Fragment, renderList, createBlock, resolveDynamicComponent, createElementVNode, isRef } from 'vue';
1
+ import { defineComponent, ref, computed, toRef, createElementBlock, openBlock, normalizeClass, unref, createVNode, normalizeStyle, withCtx, renderSlot, createCommentVNode, createSlots, createBlock, resolveDynamicComponent, Fragment, renderList, 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 '../Button/WButtonAction.vue.js';
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, getPosition } from '../../utils/useSelected.js';
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({
@@ -48,23 +36,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
48
36
  hasBorder: { type: Boolean },
49
37
  configKey: {},
50
38
  defaultConfigMap: {},
39
+ defaultMode: {},
51
40
  alignTop: { type: Boolean },
52
41
  disableMore: { type: Boolean },
53
42
  readonly: { type: Boolean },
54
43
  noOrdering: { type: Boolean },
55
44
  formNameGetter: { type: Function },
56
45
  groupBy: { type: Function },
57
- hideMore: { type: Boolean },
58
46
  cardColumns: {},
59
47
  cardAreas: {},
60
48
  cardTo: { type: Function }
61
49
  },
62
50
  emits: ["update:error"],
63
51
  setup(__props) {
64
- const isMobile = getIsMobile();
65
52
  const props = __props;
53
+ const { isMobile } = useIsMobile();
66
54
  const listCount = ref(void 0);
67
- const selectionCount = ref(0);
68
55
  const cardStyles = computed(() => {
69
56
  if (!props.cardColumns || !props.cardAreas) return;
70
57
  return {
@@ -73,20 +60,32 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
73
60
  };
74
61
  });
75
62
  const fieldsVisible = computed(() => filterFields(props.fields, (field) => field.visibleGetter?.(props.queryParams) ?? true));
76
- const { listConfig, fieldConfigMap, isGrid, hasSaved, reset, save, updateMode } = useListConfig(toRef(props, "configKey"), fieldsVisible, toRef(props, "defaultConfigMap"));
63
+ const {
64
+ listConfig,
65
+ fieldConfigMap,
66
+ isGrid,
67
+ hasSaved,
68
+ reset,
69
+ save,
70
+ updateMode
71
+ } = useListConfig(toRef(props, "configKey"), fieldsVisible, toRef(props, "defaultConfigMap"), toRef(props, "defaultMode"));
77
72
  const fieldsFiltered = computed(() => {
78
73
  return filterFields(fieldsVisible.value, (field) => fieldConfigMap.value[field.label]?.visible).sort((a, b) => fieldConfigMap.value[getFirstFieldLabel(a)].order - fieldConfigMap.value[getFirstFieldLabel(b)].order);
79
74
  });
80
75
  const allowSelect = computed(() => props.bulk !== void 0);
81
76
  const allowOpen = computed(() => props.expansion !== void 0);
77
+ const disableSelect = computed(() => !allowSelect.value);
82
78
  const {
83
- selected,
84
- reverse,
85
- setSelected,
86
- setSelectedReverse,
87
- selectedRange,
88
- setSelectedRange
89
- } = useSelected();
79
+ allowSelectHover,
80
+ selectionCount,
81
+ selectAllValue,
82
+ getIsSelected,
83
+ hoverSelected,
84
+ toggleSelected,
85
+ resetSelection,
86
+ selectAll,
87
+ getQueryParams
88
+ } = useSelected(toRef(props, "count"), disableSelect);
90
89
  const ordering = computed(() => {
91
90
  if (props.queryParams instanceof Object && "ordering" in props.queryParams && typeof props.queryParams.ordering === "string") {
92
91
  return parseOrdering(props.queryParams.ordering);
@@ -94,29 +93,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
94
93
  return [];
95
94
  });
96
95
  const getQueryParamsBulk = () => {
97
- if (selectedRange.value) {
98
- return {
99
- ...props.queryParams,
100
- slice_indexes: [
101
- getPosition(selectedRange.value[0], PAGE_LENGTH),
102
- getPosition(selectedRange.value[1], PAGE_LENGTH)
103
- ],
104
- page: void 0
105
- };
106
- }
107
- if (selected.value.length) {
108
- if (reverse.value) {
109
- return {
110
- ...props.queryParams,
111
- id__not_in: selected.value.slice()
112
- };
113
- } else {
114
- return {
115
- ...props.queryParams,
116
- id__in: selected.value.slice()
117
- };
118
- }
119
- }
96
+ const queryParamsSelection = getQueryParams();
97
+ if (queryParamsSelection) return {
98
+ ...props.queryParams,
99
+ ...queryParamsSelection
100
+ };
120
101
  return props.queryParams;
121
102
  };
122
103
  const getFieldStyles = (label, nested) => {
@@ -141,42 +122,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
141
122
  "query-options": _ctx.queryOptions,
142
123
  "skeleton-length": _ctx.count ?? listCount.value ?? unref(PAGE_LENGTH),
143
124
  "hide-page-title": "",
144
- "allow-select": allowSelect.value,
145
- "allow-select-range": "",
146
- selected: unref(selected),
147
- reverse: unref(reverse),
148
- "selected-range": unref(selectedRange),
149
125
  "page-length": unref(PAGE_LENGTH),
150
126
  count: _ctx.count ?? listCount.value,
151
- "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]",
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]",
152
128
  style: normalizeStyle(cardStyles.value),
153
129
  class: normalizeClass(_ctx.$attrs.class),
154
- onSelect: unref(setSelected),
155
- onSelectReverse: unref(setSelectedReverse),
156
- onSelectRange: unref(setSelectedRange),
157
- "onUpdate:count": _cache[5] || (_cache[5] = ($event) => listCount.value = $event),
158
- "onUpdate:error": _cache[6] || (_cache[6] = ($event) => _ctx.$emit("update:error", $event))
130
+ "onUpdate:count": _cache[2] || (_cache[2] = ($event) => listCount.value = $event),
131
+ "onUpdate:error": _cache[3] || (_cache[3] = ($event) => _ctx.$emit("update:error", $event))
159
132
  }, {
160
- header: withCtx(({ selectAllValue }) => [
133
+ header: withCtx(() => [
161
134
  renderSlot(_ctx.$slots, "header", { count: listCount.value }),
162
135
  createVNode(_sfc_main$4, {
163
136
  title: _ctx.selectionTitle,
164
137
  "disable-message": _ctx.bulkDisableMessage,
165
- class: "z-[3]",
166
- "onUpdate:selectionCount": _cache[3] || (_cache[3] = ($event) => selectionCount.value = $event)
138
+ "selected-count": unref(selectionCount),
139
+ class: "z-[2]",
140
+ "onClear:selection": unref(resetSelection)
167
141
  }, createSlots({
168
- default: withCtx(({ disableMessage, cssClass }) => [
169
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.bulk, (item, index) => {
170
- return openBlock(), createBlock(resolveDynamicComponent(item), {
171
- key: index,
172
- "selection-count": selectionCount.value,
173
- "query-params-getter": getQueryParamsBulk,
174
- "disable-message": disableMessage,
175
- class: normalizeClass(cssClass),
176
- "onClear:selected": _cache[0] || (_cache[0] = ($event) => unref(setSelected)([]))
177
- }, null, 40, ["selection-count", "disable-message", "class"]);
178
- }), 128))
179
- ]),
180
142
  settings: withCtx(() => [
181
143
  createElementVNode("div", _hoisted_1, [
182
144
  !_ctx.noOrdering ? (openBlock(), createBlock(_sfc_main$5, {
@@ -188,44 +150,61 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
188
150
  }, null, 8, ["ordering", "fields", "query-params"])) : createCommentVNode("", true),
189
151
  createVNode(_sfc_main$6, {
190
152
  "field-config-map": unref(fieldConfigMap),
191
- "onUpdate:fieldConfigMap": _cache[2] || (_cache[2] = ($event) => isRef(fieldConfigMap) ? fieldConfigMap.value = $event : null),
153
+ "onUpdate:fieldConfigMap": _cache[0] || (_cache[0] = ($event) => isRef(fieldConfigMap) ? fieldConfigMap.value = $event : null),
192
154
  mode: unref(listConfig).mode,
193
155
  fields: fieldsVisible.value,
194
156
  "query-params": _ctx.queryParams,
195
157
  "has-saved": unref(hasSaved),
158
+ mobile: unref(isMobile),
196
159
  "onClick:reset": unref(reset),
197
160
  "onUpdate:mode": unref(updateMode)
198
- }, null, 8, ["field-config-map", "mode", "fields", "query-params", "has-saved", "onClick:reset", "onUpdate:mode"])
161
+ }, null, 8, ["field-config-map", "mode", "fields", "query-params", "has-saved", "mobile", "onClick:reset", "onUpdate:mode"])
199
162
  ])
200
163
  ]),
201
164
  _: 2
202
165
  }, [
203
- _ctx.bulkMore ? {
166
+ _ctx.bulk ? {
167
+ name: "default",
168
+ fn: withCtx(({ disableMessage, cssClass }) => [
169
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.bulk, (item, index) => {
170
+ return openBlock(), createBlock(resolveDynamicComponent(item), {
171
+ key: index,
172
+ "selection-count": unref(selectionCount),
173
+ "query-params-getter": getQueryParamsBulk,
174
+ "disable-message": disableMessage,
175
+ class: normalizeClass(cssClass),
176
+ "onClear:selected": unref(resetSelection)
177
+ }, null, 40, ["selection-count", "disable-message", "class", "onClear:selected"]);
178
+ }), 128))
179
+ ]),
180
+ key: "0"
181
+ } : void 0,
182
+ _ctx.bulk && _ctx.bulkMore ? {
204
183
  name: "more",
205
184
  fn: withCtx((scope) => [
206
185
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.bulkMore, (item, index) => {
207
186
  return openBlock(), createBlock(resolveDynamicComponent(item), {
208
187
  key: index,
209
- "selection-count": selectionCount.value,
188
+ "selection-count": unref(selectionCount),
210
189
  "query-params-getter": getQueryParamsBulk,
211
190
  "disable-message": scope?.disableMessage,
212
191
  class: normalizeClass(scope?.cssClass),
213
- "onClear:selected": _cache[1] || (_cache[1] = ($event) => unref(setSelected)([]))
214
- }, null, 40, ["selection-count", "disable-message", "class"]);
192
+ "onClear:selected": unref(resetSelection)
193
+ }, null, 40, ["selection-count", "disable-message", "class", "onClear:selected"]);
215
194
  }), 128))
216
195
  ]),
217
- key: "0"
196
+ key: "1"
218
197
  } : void 0
219
- ]), 1032, ["title", "disable-message"]),
198
+ ]), 1032, ["title", "disable-message", "selected-count", "onClear:selection"]),
220
199
  !unref(isGrid) ? (openBlock(), createBlock(_sfc_main$7, {
221
200
  key: 0,
222
201
  class: "sm-not:hidden mb-4",
223
202
  "query-params": _ctx.queryParams,
224
203
  "allow-select": allowSelect.value,
225
- "tooltip-text": _ctx.selectAllTextGetter(selectAllValue !== true, _ctx.count ?? listCount.value ?? 0),
204
+ "tooltip-text": _ctx.selectAllTextGetter(unref(selectAllValue) !== true, _ctx.count ?? listCount.value ?? 0),
226
205
  count: _ctx.count ?? listCount.value,
227
- selection: selectAllValue,
228
- "onToggle:selection": _cache[4] || (_cache[4] = ($event) => $event ? unref(setSelectedReverse)([]) : unref(setSelected)([]))
206
+ selection: unref(selectAllValue),
207
+ "onToggle:selection": _cache[1] || (_cache[1] = ($event) => $event ? unref(selectAll)() : unref(resetSelection)())
229
208
  }, {
230
209
  default: withCtx(() => [
231
210
  createVNode(_sfc_main$8, { fields: fieldsFiltered.value }, {
@@ -246,10 +225,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
246
225
  _: 1
247
226
  }, 8, ["fields"])
248
227
  ]),
249
- _: 2
250
- }, 1032, ["query-params", "allow-select", "tooltip-text", "count", "selection"])) : createCommentVNode("", true)
228
+ _: 1
229
+ }, 8, ["query-params", "allow-select", "tooltip-text", "count", "selection"])) : createCommentVNode("", true)
251
230
  ]),
252
- default: withCtx(({ item, skeleton, setter, refetch, previous, index }) => [
231
+ default: withCtx(({ item, skeleton, setter, refetch, previous, index, position, value }) => [
253
232
  _ctx.groupBy && (index === 0 || !skeleton && (!previous || !_ctx.groupBy(item, previous))) ? renderSlot(_ctx.$slots, "group", {
254
233
  key: 0,
255
234
  item,
@@ -265,10 +244,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
265
244
  "has-border": _ctx.hasBorder,
266
245
  "allow-open": allowOpen.value && !skeleton,
267
246
  "align-top": _ctx.alignTop,
268
- "hide-more": _ctx.hideMore,
269
247
  "form-name": !skeleton ? _ctx.formNameGetter?.(item) : void 0,
270
248
  card: unref(isGrid),
271
- to: _ctx.cardTo?.(item)
249
+ to: _ctx.cardTo?.(item),
250
+ selected: skeleton ? false : unref(getIsSelected)(value, position),
251
+ "allow-select": allowSelect.value,
252
+ "allow-select-hover": unref(allowSelectHover),
253
+ "onToggle:selected": ($event) => unref(toggleSelected)(value, position),
254
+ "onHover:selected": ($event) => unref(hoverSelected)(position)
272
255
  }, createSlots({
273
256
  default: withCtx(({ validate }) => [
274
257
  createVNode(_sfc_main$3, {
@@ -301,25 +284,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
301
284
  _: 2
302
285
  }, 1032, ["fields", "item", "skeleton", "card"])
303
286
  ]),
304
- more: withCtx(() => [
305
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menu, (menuItem, menuIndex) => {
306
- return openBlock(), createBlock(resolveDynamicComponent(menuItem), {
307
- key: menuIndex,
308
- item,
309
- readonly: _ctx.readonly || (_ctx.readonlyGetter?.(item) ?? false),
310
- "update-item": setter,
311
- "delete-item": () => {
312
- setter();
313
- refetch();
314
- },
315
- "onUpdate:item": setter,
316
- "onDelete:item": ($event) => {
317
- setter();
318
- refetch();
319
- }
320
- }, null, 40, ["item", "readonly", "update-item", "delete-item", "onUpdate:item", "onDelete:item"]);
321
- }), 128))
322
- ]),
323
287
  _: 2
324
288
  }, [
325
289
  _ctx.expansion ? {
@@ -338,11 +302,34 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
338
302
  }, null, 40, ["item", "readonly", "skeleton", "card", "onUpdate:item", "onDelete:item"]))
339
303
  ]),
340
304
  key: "0"
305
+ } : void 0,
306
+ _ctx.menu ? {
307
+ name: "more",
308
+ fn: withCtx(() => [
309
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menu, (menuItem, menuIndex) => {
310
+ return openBlock(), createBlock(resolveDynamicComponent(menuItem), {
311
+ key: menuIndex,
312
+ item,
313
+ readonly: _ctx.readonly || (_ctx.readonlyGetter?.(item) ?? false),
314
+ "update-item": setter,
315
+ "delete-item": () => {
316
+ setter();
317
+ refetch();
318
+ },
319
+ "onUpdate:item": setter,
320
+ "onDelete:item": ($event) => {
321
+ setter();
322
+ refetch();
323
+ }
324
+ }, null, 40, ["item", "readonly", "update-item", "delete-item", "onUpdate:item", "onDelete:item"]);
325
+ }), 128))
326
+ ]),
327
+ key: "1"
341
328
  } : void 0
342
- ]), 1032, ["disabled", "disable-more", "mobile", "card-class", "card-wrapper-class", "has-border", "allow-open", "align-top", "hide-more", "form-name", "card", "to"])
329
+ ]), 1032, ["disabled", "disable-more", "mobile", "card-class", "card-wrapper-class", "has-border", "allow-open", "align-top", "form-name", "card", "to", "selected", "allow-select", "allow-select-hover", "onToggle:selected", "onHover:selected"])
343
330
  ]),
344
331
  _: 3
345
- }, 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"])
332
+ }, 8, ["use-query-fn", "query-params", "query-options", "skeleton-length", "page-length", "count", "page-class", "style", "class"])
346
333
  ], 2);
347
334
  };
348
335
  }