eco-vue-js 0.6.8 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. package/dist/components/Button/WButtonSelection.vue.d.ts +17 -1
  2. package/dist/components/Button/WButtonSelection.vue.d.ts.map +1 -1
  3. package/dist/components/Button/WButtonSelection.vue.js +11 -17
  4. package/dist/components/List/WList.vue.d.ts +35 -0
  5. package/dist/components/List/WList.vue.d.ts.map +1 -0
  6. package/dist/components/List/WList.vue.js +189 -0
  7. package/dist/components/List/WList.vue2.js +5 -0
  8. package/dist/components/List/WListCard.vue.d.ts.map +1 -0
  9. package/dist/components/List/WListCardField.vue.d.ts.map +1 -0
  10. package/dist/components/List/WListHeader.vue.d.ts +39 -0
  11. package/dist/components/List/WListHeader.vue.d.ts.map +1 -0
  12. package/dist/components/List/WListHeader.vue.js +45 -0
  13. package/dist/components/List/WListHeader.vue2.js +5 -0
  14. package/dist/components/List/WListHeaderItem.vue.d.ts +25 -0
  15. package/dist/components/List/WListHeaderItem.vue.d.ts.map +1 -0
  16. package/dist/components/List/WListHeaderItem.vue.js +86 -0
  17. package/dist/components/List/WListHeaderItem.vue2.js +5 -0
  18. package/dist/components/List/types.d.ts +23 -0
  19. package/dist/components/List/types.d.ts.map +1 -0
  20. package/dist/imports/componentsPlugin.d.ts +6 -3
  21. package/dist/imports/componentsPlugin.d.ts.map +1 -1
  22. package/dist/main.js +6 -3
  23. package/dist/types/global.d.ts +25 -0
  24. package/dist/utils/order.d.ts +11 -0
  25. package/dist/utils/order.d.ts.map +1 -0
  26. package/dist/utils/order.js +18 -0
  27. package/dist/utils/useSelected.d.ts +12 -0
  28. package/dist/utils/useSelected.d.ts.map +1 -0
  29. package/dist/utils/useSelected.js +61 -0
  30. package/dist/utils/utils.d.ts +5 -0
  31. package/dist/utils/utils.d.ts.map +1 -1
  32. package/dist/utils/utils.js +22 -1
  33. package/package.json +23 -5
  34. package/dist/components/ListCard/WListCard.vue.d.ts.map +0 -1
  35. package/dist/components/ListCard/WListCardField.vue.d.ts.map +0 -1
  36. /package/dist/components/{ListCard → List}/WListCard.vue.d.ts +0 -0
  37. /package/dist/components/{ListCard → List}/WListCard.vue.js +0 -0
  38. /package/dist/components/{ListCard → List}/WListCard.vue2.js +0 -0
  39. /package/dist/components/{ListCard → List}/WListCardField.vue.d.ts +0 -0
  40. /package/dist/components/{ListCard → List}/WListCardField.vue.js +0 -0
  41. /package/dist/components/{ListCard → List}/WListCardField.vue2.js +0 -0
@@ -1,4 +1,14 @@
1
- declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
1
+ declare function __VLS_template(): {
2
+ default?(_: {
3
+ disableMessage: string | undefined;
4
+ cssClass: string;
5
+ }): any;
6
+ more?(_: {
7
+ disableMessage: string | undefined;
8
+ cssClass: string;
9
+ }): any;
10
+ };
11
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
2
12
  title?: string;
3
13
  disableMessage?: string;
4
14
  }>, {
@@ -20,6 +30,7 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
20
30
  title: string;
21
31
  disableMessage: string;
22
32
  }, {}>;
33
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
23
34
  export default _default;
24
35
  type __VLS_WithDefaults<P, D> = {
25
36
  [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
@@ -29,6 +40,11 @@ type __VLS_WithDefaults<P, D> = {
29
40
  type __VLS_Prettify<T> = {
30
41
  [K in keyof T]: T[K];
31
42
  } & {};
43
+ type __VLS_WithTemplateSlots<T, S> = T & {
44
+ new (): {
45
+ $slots: S;
46
+ };
47
+ };
32
48
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
33
49
  type __VLS_TypePropsToOption<T> = {
34
50
  [K in keyof T]-?: {} extends Pick<T, K> ? {
@@ -1 +1 @@
1
- {"version":3,"file":"WButtonSelection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Button/WButtonSelection.vue"],"names":[],"mappings":";YAiIY,MAAM;qBACG,MAAM;;;;;;;;;YADf,MAAM;qBACG,MAAM;;;;;;;WADf,MAAM;oBACG,MAAM;;AAqR3B,wBAQG;AAOH,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAC7C,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAAC,CAAC,GACvC,CAAC,CAAC,CAAC,CAAC;CACP,CAAC;AAEN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AAExD,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
1
+ {"version":3,"file":"WButtonSelection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Button/WButtonSelection.vue"],"names":[],"mappings":"AAgLA,iBAAS,cAAc;;;;QA8LM,GAAG;;;;QACL,GAAG;EA2B7B;AACD,QAAA,MAAM,eAAe;Y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 +1,4 @@
1
- import { defineComponent, ref, inject, computed, watch, openBlock, createElementBlock, createElementVNode, Fragment, renderList, createBlock, resolveDynamicComponent, unref, withCtx, createVNode, markRaw, createCommentVNode, Transition, toDisplayString } from 'vue';
1
+ import { defineComponent, ref, inject, computed, watch, openBlock, createElementBlock, createElementVNode, renderSlot, normalizeProps, guardReactiveProps, createBlock, unref, withCtx, createVNode, markRaw, createCommentVNode, Transition, toDisplayString } from 'vue';
2
2
  import { numberFormatter } from '../../utils/utils.js';
3
3
  import IconCancel from '../../assets/icons/default/IconCancel.svg.js';
4
4
  import IconMore from '../../assets/icons/default/IconMore.svg.js';
@@ -45,13 +45,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
45
45
  return (_ctx, _cache) => {
46
46
  return openBlock(), createElementBlock("div", _hoisted_1, [
47
47
  createElementVNode("div", _hoisted_2, [
48
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.$slots.default?.(), (slot, index) => {
49
- return openBlock(), createBlock(resolveDynamicComponent(slot), {
50
- key: index,
51
- "disable-message": disableMessageValue.value,
52
- class: "border-r border-solid border-gray-300 dark:border-gray-700 last:border-r-0"
53
- }, null, 8, ["disable-message"]);
54
- }), 128)),
48
+ renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({
49
+ disableMessage: disableMessageValue.value,
50
+ cssClass: "border-r border-solid border-gray-300 dark:border-gray-700 last:border-r-0"
51
+ }))),
55
52
  _ctx.$slots.more?.()?.length ? (openBlock(), createBlock(_sfc_main$1, {
56
53
  key: 0,
57
54
  "is-open": isOpen.value,
@@ -73,18 +70,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
73
70
  onClick: _cache[1] || (_cache[1] = ($event) => isOpen.value = false)
74
71
  }, {
75
72
  default: withCtx(() => [
76
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.$slots.more?.(), (slot, index) => {
77
- return openBlock(), createBlock(resolveDynamicComponent(slot), {
78
- key: index,
79
- "disable-message": disableMessageValue.value,
80
- class: "first:pt-2 last:pb-2"
81
- }, null, 8, ["disable-message"]);
82
- }), 128))
73
+ renderSlot(_ctx.$slots, "more", normalizeProps(guardReactiveProps({
74
+ disableMessage: disableMessageValue.value,
75
+ cssClass: "first:pt-2 last:pb-2"
76
+ })))
83
77
  ]),
84
- _: 1
78
+ _: 3
85
79
  })
86
80
  ]),
87
- _: 1
81
+ _: 3
88
82
  }, 8, ["is-open", "horizontal-align"])) : createCommentVNode("", true)
89
83
  ]),
90
84
  createVNode(Transition, {
@@ -0,0 +1,35 @@
1
+ import { BulkComponent, ListField, MenuComponent } from './types';
2
+
3
+ declare const _default: <Data extends DefaultData, ApiError, QueryParams>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_Prettify<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
+ props: __VLS_Prettify<Pick<Partial<{}> & Omit<{
5
+ "onUpdate:header-padding"?: ((value: number) => any) | undefined;
6
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{}>> & {
7
+ "onUpdate:header-padding"?: ((value: number) => any) | undefined;
8
+ }, never>, "onUpdate:header-padding"> & {
9
+ count?: number;
10
+ fields: ListField<Data, QueryParams>[];
11
+ useQueryFn: UseQueryPaginated<Data, ApiError, QueryParams>;
12
+ queryParams: QueryParams;
13
+ bulkDisableMessage?: string;
14
+ selectionTitle: string;
15
+ bulk?: BulkComponent<QueryParams>[];
16
+ menu: MenuComponent<Data>[];
17
+ readonlyGetter?: (item: Data) => boolean;
18
+ cardClass?: string;
19
+ isInvalidPage: (error: unknown) => boolean;
20
+ selectAllTextGetter: (isUnselect: boolean, count: number) => string;
21
+ }> & import('vue').PublicProps;
22
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
23
+ attrs: any;
24
+ slots: ReturnType<() => {}>;
25
+ emit: ((e: "update:header-padding", value: number) => void) & {};
26
+ }>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
27
+ [key: string]: any;
28
+ }> & {
29
+ __ctx?: Awaited<typeof __VLS_setup>;
30
+ };
31
+ export default _default;
32
+ type __VLS_Prettify<T> = {
33
+ [K in keyof T]: T[K];
34
+ } & {};
35
+ //# sourceMappingURL=WList.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/List/WList.vue"],"names":[],"mappings":"AA8MA,OAAO,KAAK,EAAC,aAAa,EAAE,SAAS,EAAE,aAAa,EAAC,MAAM,SAAS,CAAA;yBAOnD,IAAI,SAAS,WAAW,EAAE,QAAQ,EAAE,WAAW,eAClD,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBACvF,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WA0axD,cAAc,CAAC;;;;;gBAlaf,MAAM;gBACN,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE;oBAC1B,iBAAiB,CAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,CAAC;qBAC7C,WAAW;6BACH,MAAM;wBACX,MAAM;eACf,aAAa,CAAC,WAAW,CAAC,EAAE;cAC7B,aAAa,CAAC,IAAI,CAAC,EAAE;yBACV,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO;oBAC5B,MAAM;uBACH,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO;6BACrB,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM;KAuZa,CAAC,4BAA2B;oBAC3F,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;WACH,UAAU,UAAuB;UAClC,KAtZH,uBAAuB,SAAS,MAAM,KAAG,IAAI,MAsZF;;;;YAGL,OAAO,CAAC,OAAO,WAAW,CAAC;;AApbvE,wBAob4E;AAM5E,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
@@ -0,0 +1,189 @@
1
+ import { defineComponent, ref, computed, openBlock, createBlock, unref, withCtx, createElementBlock, Fragment, renderList, resolveDynamicComponent, normalizeClass, createCommentVNode, createVNode } from 'vue';
2
+ import _sfc_main$1 from '../InfiniteList/WInfiniteList.vue.js';
3
+ import { getIsMobile } from '../../utils/mobile.js';
4
+ import { useSelected, getPosition } from '../../utils/useSelected.js';
5
+ import _sfc_main$5 from './WListCard.vue.js';
6
+ import _sfc_main$3 from './WListHeader.vue.js';
7
+ import _sfc_main$4 from './WListHeaderItem.vue.js';
8
+ import { parseOrdering } from '../../utils/order.js';
9
+ import _sfc_main$2 from '../Button/WButtonSelection.vue.js';
10
+
11
+ const PAGE_LENGTH = 24;
12
+ const _sfc_main = /* @__PURE__ */ defineComponent({
13
+ __name: "WList",
14
+ props: {
15
+ count: {},
16
+ fields: {},
17
+ useQueryFn: {},
18
+ queryParams: {},
19
+ bulkDisableMessage: {},
20
+ selectionTitle: {},
21
+ bulk: {},
22
+ menu: {},
23
+ readonlyGetter: { type: Function },
24
+ cardClass: {},
25
+ isInvalidPage: { type: Function },
26
+ selectAllTextGetter: { type: Function }
27
+ },
28
+ emits: ["update:header-padding"],
29
+ setup(__props) {
30
+ const isMobile = getIsMobile();
31
+ const props = __props;
32
+ const listCount = ref(0);
33
+ const selectionCount = ref(0);
34
+ const allowSelect = computed(() => props.bulk !== void 0);
35
+ const {
36
+ selected,
37
+ reverse,
38
+ setSelected,
39
+ setSelectedReverse,
40
+ selectedRange,
41
+ setSelectedRange
42
+ } = useSelected();
43
+ const ordering = computed(() => {
44
+ if (props.queryParams instanceof Object && "ordering" in props.queryParams && typeof props.queryParams.ordering === "string") {
45
+ return parseOrdering(props.queryParams.ordering);
46
+ }
47
+ return [];
48
+ });
49
+ const getQueryParamsBulk = () => {
50
+ if (selectedRange.value) {
51
+ return {
52
+ ...props.queryParams,
53
+ slice_indexes: [
54
+ getPosition(selectedRange.value[0], PAGE_LENGTH),
55
+ getPosition(selectedRange.value[1], PAGE_LENGTH)
56
+ ],
57
+ page: void 0
58
+ };
59
+ }
60
+ if (selected.value.length) {
61
+ if (reverse.value) {
62
+ return {
63
+ ...props.queryParams,
64
+ id__not_in: selected.value.slice()
65
+ };
66
+ } else {
67
+ return {
68
+ ...props.queryParams,
69
+ id__in: selected.value.slice()
70
+ };
71
+ }
72
+ }
73
+ return props.queryParams;
74
+ };
75
+ return (_ctx, _cache) => {
76
+ return openBlock(), createBlock(_sfc_main$1, {
77
+ "use-query-fn": _ctx.useQueryFn,
78
+ "query-params": _ctx.queryParams,
79
+ "skeleton-length": _ctx.count ?? listCount.value,
80
+ "header-margin": unref(isMobile) ? 0 : 24,
81
+ "is-invalid-page": _ctx.isInvalidPage,
82
+ "hide-page-title": "",
83
+ transition: "",
84
+ "page-class": "grid sm:gap-4",
85
+ "allow-select": allowSelect.value,
86
+ "allow-select-range": "",
87
+ selected: unref(selected),
88
+ reverse: unref(reverse),
89
+ "selected-range": unref(selectedRange),
90
+ "page-length": PAGE_LENGTH,
91
+ count: _ctx.count ?? listCount.value,
92
+ onSelect: unref(setSelected),
93
+ onSelectReverse: unref(setSelectedReverse),
94
+ onSelectRange: unref(setSelectedRange),
95
+ "onUpdate:headerPadding": _cache[3] || (_cache[3] = ($event) => _ctx.$emit("update:header-padding", $event)),
96
+ "onUpdate:count": _cache[4] || (_cache[4] = ($event) => listCount.value = $event)
97
+ }, {
98
+ header: withCtx(({ selectAllValue }) => [
99
+ allowSelect.value ? (openBlock(), createBlock(_sfc_main$2, {
100
+ key: 0,
101
+ title: _ctx.selectionTitle,
102
+ "disable-message": _ctx.bulkDisableMessage,
103
+ "onUpdate:selectionCount": _cache[1] || (_cache[1] = ($event) => selectionCount.value = $event)
104
+ }, {
105
+ default: withCtx(({ disableMessage, cssClass }) => [
106
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.bulk, (item, index) => {
107
+ return openBlock(), createBlock(resolveDynamicComponent(item), {
108
+ key: index,
109
+ "selection-count": selectionCount.value,
110
+ "query-params-getter": getQueryParamsBulk,
111
+ "disable-message": disableMessage,
112
+ class: normalizeClass(cssClass),
113
+ "onClear:selected": _cache[0] || (_cache[0] = ($event) => unref(setSelected)([]))
114
+ }, null, 40, ["selection-count", "disable-message", "class"]);
115
+ }), 128))
116
+ ]),
117
+ _: 1
118
+ }, 8, ["title", "disable-message"])) : createCommentVNode("", true),
119
+ !unref(isMobile) ? (openBlock(), createBlock(_sfc_main$3, {
120
+ key: 1,
121
+ class: "sm-not:hidden",
122
+ "query-params": _ctx.queryParams,
123
+ "allow-select": allowSelect.value,
124
+ "tooltip-text": _ctx.selectAllTextGetter(selectAllValue !== true, _ctx.count ?? 0),
125
+ count: _ctx.count,
126
+ selection: selectAllValue,
127
+ "onToggle:selection": _cache[2] || (_cache[2] = ($event) => $event ? unref(setSelectedReverse)([]) : unref(setSelected)([]))
128
+ }, {
129
+ default: withCtx(() => [
130
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.fields, (field, index) => {
131
+ return openBlock(), createBlock(_sfc_main$4, {
132
+ key: index,
133
+ title: typeof field.title === "string" ? field.title : field.title(_ctx.queryParams),
134
+ field: field.field,
135
+ class: normalizeClass([field.cssClass, index === _ctx.fields.length - 1 ? "z-[1]" : void 0]),
136
+ ordering: ordering.value,
137
+ disabled: !field.field
138
+ }, null, 8, ["title", "field", "class", "ordering", "disabled"]);
139
+ }), 128))
140
+ ]),
141
+ _: 2
142
+ }, 1032, ["query-params", "allow-select", "tooltip-text", "count", "selection"])) : createCommentVNode("", true)
143
+ ]),
144
+ default: withCtx(({ item, skeleton, setter, refetch }) => [
145
+ createVNode(_sfc_main$5, {
146
+ disabled: skeleton,
147
+ mobile: unref(isMobile),
148
+ class: normalizeClass(_ctx.cardClass)
149
+ }, {
150
+ more: withCtx(() => [
151
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menu, (menuItem, menuIndex) => {
152
+ return openBlock(), createBlock(resolveDynamicComponent(menuItem), {
153
+ key: menuIndex,
154
+ item,
155
+ readonly: _ctx.readonlyGetter?.(item),
156
+ "onUpdate:item": setter,
157
+ "onDelete:item": ($event) => {
158
+ setter();
159
+ refetch();
160
+ }
161
+ }, null, 40, ["item", "readonly", "onUpdate:item", "onDelete:item"]);
162
+ }), 128))
163
+ ]),
164
+ default: withCtx(() => [
165
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.fields, (field, index) => {
166
+ return openBlock(), createBlock(resolveDynamicComponent(field.component), {
167
+ key: index,
168
+ item,
169
+ readonly: _ctx.readonlyGetter?.(item),
170
+ class: normalizeClass(field.cssClass),
171
+ skeleton,
172
+ "onUpdate:item": setter,
173
+ "onDelete:item": ($event) => {
174
+ setter();
175
+ refetch();
176
+ }
177
+ }, null, 40, ["item", "readonly", "class", "skeleton", "onUpdate:item", "onDelete:item"]);
178
+ }), 128))
179
+ ]),
180
+ _: 2
181
+ }, 1032, ["disabled", "mobile", "class"])
182
+ ]),
183
+ _: 1
184
+ }, 8, ["use-query-fn", "query-params", "skeleton-length", "header-margin", "is-invalid-page", "allow-select", "selected", "reverse", "selected-range", "count", "onSelect", "onSelectReverse", "onSelectRange"]);
185
+ };
186
+ }
187
+ });
188
+
189
+ export { _sfc_main as default };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from './WList.vue.js';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WListCard.vue.d.ts","sourceRoot":"","sources":["../../../src/components/List/WListCard.vue"],"names":[],"mappings":"AAwLA,iBAAS,cAAc;;;QA6MO,GAAG;kBACN,GAAG;EA6B7B;AACD,QAAA,MAAM,eAAe;eAlSR,OAAO;eACP,OAAO;aACT,OAAO;iBACH,OAAO;eACT,OAAO;;;;;;;eAJP,OAAO;eACP,OAAO;aACT,OAAO;iBACH,OAAO;eACT,OAAO;;;;UAsSlB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WListCardField.vue.d.ts","sourceRoot":"","sources":["../../../src/components/List/WListCardField.vue"],"names":[],"mappings":"AA2DA,iBAAS,cAAc;qBAgEM,GAAG;mBACL,GAAG;mBACF,GAAG;EAgB9B;AACD,QAAA,MAAM,eAAe;iBA9FN,MAAM,GAAG,MAAM;eACjB,OAAO;;iBADL,MAAM,GAAG,MAAM;eACjB,OAAO;aAmGlB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -0,0 +1,39 @@
1
+ declare function __VLS_template(): {
2
+ default?(_: {}): any;
3
+ };
4
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_TypePropsToOption<{
5
+ allowSelect?: boolean;
6
+ hideMore?: boolean;
7
+ disabled?: boolean;
8
+ count?: number;
9
+ selection?: boolean | null;
10
+ tooltipText: string;
11
+ }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
12
+ "toggle:selection": (value: boolean) => void;
13
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<{
14
+ allowSelect?: boolean;
15
+ hideMore?: boolean;
16
+ disabled?: boolean;
17
+ count?: number;
18
+ selection?: boolean | null;
19
+ tooltipText: string;
20
+ }>>> & {
21
+ "onToggle:selection"?: ((value: boolean) => any) | undefined;
22
+ }, {}, {}>;
23
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
24
+ export default _default;
25
+ type __VLS_WithTemplateSlots<T, S> = T & {
26
+ new (): {
27
+ $slots: S;
28
+ };
29
+ };
30
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
31
+ type __VLS_TypePropsToOption<T> = {
32
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
33
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
34
+ } : {
35
+ type: import('vue').PropType<T[K]>;
36
+ required: true;
37
+ };
38
+ };
39
+ //# sourceMappingURL=WListHeader.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WListHeader.vue.d.ts","sourceRoot":"","sources":["../../../src/components/List/WListHeader.vue"],"names":[],"mappings":"AAuEA,iBAAS,cAAc;qBAyEM,GAAG;EAgB/B;AACD,QAAA,MAAM,eAAe;kBA9GL,OAAO;eACV,OAAO;eACP,OAAO;YACV,MAAM;gBACF,OAAO,GAAG,IAAI;iBACb,MAAM;;;;kBALL,OAAO;eACV,OAAO;eACP,OAAO;YACV,MAAM;gBACF,OAAO,GAAG,IAAI;iBACb,MAAM;;;UAgHnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { defineComponent, openBlock, createElementBlock, Fragment, createBlock, createCommentVNode, renderSlot } from 'vue';
2
+ import _sfc_main$1 from '../Checkbox/WCheckbox.vue.js';
3
+
4
+ const _hoisted_1 = { class: "flex text-description font-semibold" };
5
+ const _hoisted_2 = {
6
+ key: 0,
7
+ class: "w-list-header-item width-16"
8
+ };
9
+ const _hoisted_3 = {
10
+ key: 1,
11
+ class: "w-list-header-item width-14"
12
+ };
13
+ const _sfc_main = /* @__PURE__ */ defineComponent({
14
+ __name: "WListHeader",
15
+ props: {
16
+ allowSelect: { type: Boolean },
17
+ hideMore: { type: Boolean },
18
+ disabled: { type: Boolean },
19
+ count: {},
20
+ selection: { type: [Boolean, null] },
21
+ tooltipText: {}
22
+ },
23
+ emits: ["toggle:selection"],
24
+ setup(__props) {
25
+ return (_ctx, _cache) => {
26
+ return openBlock(), createElementBlock("div", _hoisted_1, [
27
+ _ctx.allowSelect ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
28
+ _ctx.selection === void 0 || _ctx.count === 0 ? (openBlock(), createElementBlock("div", _hoisted_2)) : (openBlock(), createBlock(_sfc_main$1, {
29
+ key: 1,
30
+ disabled: _ctx.disabled,
31
+ "model-value": _ctx.selection,
32
+ "tooltip-text": _ctx.tooltipText,
33
+ intermediate: "",
34
+ class: "w-list-header-item width-16 justify-end",
35
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("toggle:selection", $event))
36
+ }, null, 8, ["disabled", "model-value", "tooltip-text"]))
37
+ ], 64)) : createCommentVNode("", true),
38
+ renderSlot(_ctx.$slots, "default"),
39
+ !_ctx.hideMore ? (openBlock(), createElementBlock("div", _hoisted_3)) : createCommentVNode("", true)
40
+ ]);
41
+ };
42
+ }
43
+ });
44
+
45
+ export { _sfc_main as default };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from './WListHeader.vue.js';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
@@ -0,0 +1,25 @@
1
+ import { OrderItem } from '../../utils/order';
2
+
3
+ declare const _default: <Field>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_Prettify<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
+ props: __VLS_Prettify<Pick<Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{}>>, never>, never> & {
5
+ title?: string;
6
+ field: Field;
7
+ ordering: OrderItem<Field>[];
8
+ disabled?: boolean;
9
+ }> & import('vue').PublicProps;
10
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
11
+ attrs: any;
12
+ slots: ReturnType<() => {
13
+ default?(_: {}): any;
14
+ }>;
15
+ emit: {};
16
+ }>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
17
+ [key: string]: any;
18
+ }> & {
19
+ __ctx?: Awaited<typeof __VLS_setup>;
20
+ };
21
+ export default _default;
22
+ type __VLS_Prettify<T> = {
23
+ [K in keyof T]: T[K];
24
+ } & {};
25
+ //# sourceMappingURL=WListHeaderItem.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WListHeaderItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/List/WListHeaderItem.vue"],"names":[],"mappings":"AAkGA,OAAO,EAAwB,KAAK,SAAS,EAAC,MAAM,eAAe,CAAA;yBAGlD,KAAK,eACR,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBACvF,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WAyKxD,cAAc,CAAC;gBArKf,MAAM;eACP,KAAK;kBACF,SAAS,CAAC,KAAK,CAAC,EAAE;mBACjB,OAAO;KAkK8D,CAAC,4BAA2B;oBAC3F,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;WACH,UAAU;yBAtBS,GAAG;MAsBW;;;;;YAIC,OAAO,CAAC,OAAO,WAAW,CAAC;;AAnLvE,wBAmL4E;AAM5E,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
@@ -0,0 +1,86 @@
1
+ import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, createTextVNode, toDisplayString, createVNode, Transition, withCtx, unref, createCommentVNode } from 'vue';
2
+ import { useRoute, useRouter } from 'vue-router';
3
+ import IconBack from '../../assets/icons/default/IconBack.svg.js';
4
+ import { Order, encodeOrdering } from '../../utils/order.js';
5
+
6
+ const _hoisted_1 = {
7
+ key: 0,
8
+ class: "flex gap-1 w-7 items-center"
9
+ };
10
+ const _hoisted_2 = { key: 0 };
11
+ const _sfc_main = /* @__PURE__ */ defineComponent({
12
+ __name: "WListHeaderItem",
13
+ props: {
14
+ title: {},
15
+ field: {},
16
+ ordering: {},
17
+ disabled: { type: Boolean }
18
+ },
19
+ setup(__props) {
20
+ const props = __props;
21
+ const route = useRoute();
22
+ const router = useRouter();
23
+ const index = computed(() => props.ordering.findIndex((item) => item.field === props.field));
24
+ const updateQuery = (newOrdering) => {
25
+ const newOrderingValue = encodeOrdering(newOrdering);
26
+ if (route.query.ordering === newOrderingValue) return;
27
+ router.replace({
28
+ query: {
29
+ ...route.query,
30
+ ordering: newOrderingValue
31
+ }
32
+ });
33
+ };
34
+ const setOrdering = () => {
35
+ if (props.disabled) return;
36
+ const newOrdering = props.ordering.slice();
37
+ if (index.value === -1) {
38
+ newOrdering.push({ field: props.field, order: Order.ASC });
39
+ } else if (newOrdering[index.value].order === Order.ASC) {
40
+ newOrdering[index.value].order = Order.DESC;
41
+ } else {
42
+ newOrdering.splice(index.value, 1);
43
+ }
44
+ updateQuery(newOrdering);
45
+ };
46
+ return (_ctx, _cache) => {
47
+ return openBlock(), createElementBlock("div", {
48
+ class: normalizeClass(["w-list-header-item flex gap-2 select-none items-center text-description font-semibold h-11", {
49
+ "cursor-pointer": !_ctx.disabled
50
+ }]),
51
+ onClick: setOrdering
52
+ }, [
53
+ createElementVNode("div", {
54
+ class: normalizeClass(["whitespace-nowrap", {
55
+ "hover:underline": !_ctx.disabled
56
+ }])
57
+ }, [
58
+ renderSlot(_ctx.$slots, "default", {}, () => [
59
+ createTextVNode(toDisplayString(_ctx.title), 1)
60
+ ])
61
+ ], 2),
62
+ createVNode(Transition, {
63
+ "enter-active-class": "transition-opacity",
64
+ "leave-active-class": "transition-opacity",
65
+ "enter-from-class": "opacity-0",
66
+ "leave-to-class": "opacity-0"
67
+ }, {
68
+ default: withCtx(() => [
69
+ index.value !== -1 ? (openBlock(), createElementBlock("div", _hoisted_1, [
70
+ createVNode(unref(IconBack), {
71
+ class: normalizeClass(["w-4 h-4 transition-transform", {
72
+ "rotate-90": _ctx.ordering[index.value]?.order === "ASC",
73
+ "-rotate-90": _ctx.ordering[index.value]?.order === "DESC"
74
+ }])
75
+ }, null, 8, ["class"]),
76
+ _ctx.ordering.length > 1 ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(index.value + 1), 1)) : createCommentVNode("", true)
77
+ ])) : createCommentVNode("", true)
78
+ ]),
79
+ _: 1
80
+ })
81
+ ], 2);
82
+ };
83
+ }
84
+ });
85
+
86
+ export { _sfc_main as default };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from './WListHeaderItem.vue.js';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
@@ -0,0 +1,23 @@
1
+ import { Component, Raw } from 'vue';
2
+
3
+ export type FieldComponent<Data> = Component<{
4
+ item: Data;
5
+ skeleton?: boolean;
6
+ readonly?: boolean;
7
+ }>;
8
+ export type ListField<Data, QueryParams = unknown> = {
9
+ component: Raw<FieldComponent<Data>>;
10
+ title: string | ((item: QueryParams) => string);
11
+ cssClass?: string;
12
+ field?: keyof Data;
13
+ };
14
+ export type MenuComponent<Data> = Component<{
15
+ item: Data;
16
+ readonly?: boolean;
17
+ }>;
18
+ export type BulkComponent<QueryParams> = Component<{
19
+ queryParamsGetter: () => QueryParams;
20
+ selectionCount: number;
21
+ disableMessage?: string;
22
+ }>;
23
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/List/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAE,GAAG,EAAC,MAAM,KAAK,CAAA;AAEvC,MAAM,MAAM,cAAc,CAAC,IAAI,IAAI,SAAS,CAAC;IAC3C,IAAI,EAAE,IAAI,CAAA;IACV,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC,CAAA;AAEF,MAAM,MAAM,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,IAAI;IACnD,SAAS,EAAE,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;IACrC,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,WAAW,KAAK,MAAM,CAAC,CAAC;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;CACpB,CAAA;AAED,MAAM,MAAM,aAAa,CAAC,IAAI,IAAI,SAAS,CAAC;IAC1C,IAAI,EAAE,IAAI,CAAA;IACV,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC,CAAA;AAEF,MAAM,MAAM,aAAa,CAAC,WAAW,IAAI,SAAS,CAAC;IACjD,iBAAiB,EAAE,MAAM,WAAW,CAAA;IACpC,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAC,CAAA"}
@@ -38,8 +38,11 @@ import { default as WInputOptions } from '../components/Input/WInputOptions.vue'
38
38
  import { default as WInputSuggest } from '../components/Input/WInputSuggest.vue';
39
39
  import { default as WLink } from '../components/Link/WLink.vue';
40
40
  import { default as WLinkArrow } from '../components/Link/WLinkArrow.vue';
41
- import { default as WListCard } from '../components/ListCard/WListCard.vue';
42
- import { default as WListCardField } from '../components/ListCard/WListCardField.vue';
41
+ import { default as WList } from '../components/List/WList.vue';
42
+ import { default as WListCard } from '../components/List/WListCard.vue';
43
+ import { default as WListCardField } from '../components/List/WListCardField.vue';
44
+ import { default as WListHeader } from '../components/List/WListHeader.vue';
45
+ import { default as WListHeaderItem } from '../components/List/WListHeaderItem.vue';
43
46
  import { default as WMenuItem } from '../components/MenuItem/WMenuItem.vue';
44
47
  import { default as WModal } from '../components/Modal/WModal.vue';
45
48
  import { default as WModalStepper } from '../components/Modal/WModalStepper.vue';
@@ -66,5 +69,5 @@ declare const _default: {
66
69
  install: (app: App | any) => void;
67
70
  };
68
71
  export default _default;
69
- export { WActionsBar, WBottomSheet, WButton, WButtonAction, WButtonCopy, WButtonDropdown, WButtonGroup, WButtonMore, WButtonMoreItem, WButtonSelection, WButtonSelectionAction, WCheckbox, WChip, WClickOutside, WCounter, WDatePicker, WDatePickerSingle, WDropdown, WDropdownMenu, WExpansion, WExpansionItem, WFieldWrapper, WFilePicker, WFilterWrapper, WForm, WFormValidator, WHeaderBar, WImageViewer, WInfiniteList, WInfiniteListPages, WInfoCard, WInfoCardNegative, WInput, WInputAsync, WInputDate, WInputOptions, WInputSuggest, WLink, WLinkArrow, WListCard, WListCardField, WMenuItem, WModal, WModalStepper, WModalWrapper, WNavBar, WNavItem, WNavItemExpand, WNavItemTransition, WNotify, WSelect, WSelectAsync, WSelectAsyncList, WSelectAsyncSingle, WSelectSingle, WSkeleton, WSpinner, WTabs, WTabsColumns, WToggle, WTooltip, WTooltipContainer, };
72
+ export { WActionsBar, WBottomSheet, WButton, WButtonAction, WButtonCopy, WButtonDropdown, WButtonGroup, WButtonMore, WButtonMoreItem, WButtonSelection, WButtonSelectionAction, WCheckbox, WChip, WClickOutside, WCounter, WDatePicker, WDatePickerSingle, WDropdown, WDropdownMenu, WExpansion, WExpansionItem, WFieldWrapper, WFilePicker, WFilterWrapper, WForm, WFormValidator, WHeaderBar, WImageViewer, WInfiniteList, WInfiniteListPages, WInfoCard, WInfoCardNegative, WInput, WInputAsync, WInputDate, WInputOptions, WInputSuggest, WLink, WLinkArrow, WList, WListCard, WListCardField, WListHeader, WListHeaderItem, WMenuItem, WModal, WModalStepper, WModalWrapper, WNavBar, WNavItem, WNavItemExpand, WNavItemTransition, WNotify, WSelect, WSelectAsync, WSelectAsyncList, WSelectAsyncSingle, WSelectSingle, WSkeleton, WSpinner, WTabs, WTabsColumns, WToggle, WTooltip, WTooltipContainer, };
70
73
  //# sourceMappingURL=componentsPlugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"componentsPlugin.d.ts","sourceRoot":"","sources":["../../src/imports/componentsPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,KAAK,CAAA;AAE5B,OAAO,WAAW,MAAM,yCAAyC,CAAA;AACjE,OAAO,YAAY,MAAM,2CAA2C,CAAA;AACpE,OAAO,OAAO,MAAM,iCAAiC,CAAA;AACrD,OAAO,aAAa,MAAM,uCAAuC,CAA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sBAAsB,EACtB,SAAS,EACT,KAAK,EACL,aAAa,EACb,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,UAAU,EACV,cAAc,EACd,aAAa,EACb,WAAW,EACX,cAAc,EACd,KAAK,EACL,cAAc,EACd,UAAU,EACV,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,SAAS,EACT,iBAAiB,EACjB,MAAM,EACN,WAAW,EACX,UAAU,EACV,aAAa,EACb,aAAa,EACb,KAAK,EACL,UAAU,EACV,SAAS,EACT,cAAc,EACd,SAAS,EACT,MAAM,EACN,aAAa,EACb,aAAa,EACb,OAAO,EACP,QAAQ,EACR,cAAc,EACd,kBAAkB,EAClB,OAAO,EACP,OAAO,EACP,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,iBAAiB,GAClB,CAAA"}
1
+ {"version":3,"file":"componentsPlugin.d.ts","sourceRoot":"","sources":["../../src/imports/componentsPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,KAAK,CAAA;AAE5B,OAAO,WAAW,MAAM,yCAAyC,CAAA;AACjE,OAAO,YAAY,MAAM,2CAA2C,CAAA;AACpE,OAAO,OAAO,MAAM,iCAAiC,CAAA;AACrD,OAAO,aAAa,MAAM,uCAAuC,CAAA;AACjE,OAAO,WAAW,MAAM,qCAAqC,CAAA;AAC7D,OAAO,eAAe,MAAM,yCAAyC,CAAA;AACrE,OAAO,YAAY,MAAM,sCAAsC,CAAA;AAC/D,OAAO,WAAW,MAAM,qCAAqC,CAAA;AAC7D,OAAO,eAAe,MAAM,yCAAyC,CAAA;AACrE,OAAO,gBAAgB,MAAM,0CAA0C,CAAA;AACvE,OAAO,sBAAsB,MAAM,gDAAgD,CAAA;AACnF,OAAO,SAAS,MAAM,qCAAqC,CAAA;AAC3D,OAAO,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kBAAkB,EAClB,SAAS,EACT,iBAAiB,EACjB,MAAM,EACN,WAAW,EACX,UAAU,EACV,aAAa,EACb,aAAa,EACb,KAAK,EACL,UAAU,EACV,KAAK,EACL,SAAS,EACT,cAAc,EACd,WAAW,EACX,eAAe,EACf,SAAS,EACT,MAAM,EACN,aAAa,EACb,aAAa,EACb,OAAO,EACP,QAAQ,EACR,cAAc,EACd,kBAAkB,EAClB,OAAO,EACP,OAAO,EACP,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,iBAAiB,GAClB,CAAA"}
package/dist/main.js CHANGED
@@ -41,8 +41,11 @@ export { default as WInputOptions } from './components/Input/WInputOptions.vue.j
41
41
  export { default as WInputSuggest } from './components/Input/WInputSuggest.vue.js';
42
42
  export { default as WLink } from './components/Link/WLink.vue.js';
43
43
  export { default as WLinkArrow } from './components/Link/WLinkArrow.vue.js';
44
- export { default as WListCard } from './components/ListCard/WListCard.vue.js';
45
- export { default as WListCardField } from './components/ListCard/WListCardField.vue.js';
44
+ export { default as WList } from './components/List/WList.vue.js';
45
+ export { default as WListCard } from './components/List/WListCard.vue.js';
46
+ export { default as WListCardField } from './components/List/WListCardField.vue.js';
47
+ export { default as WListHeader } from './components/List/WListHeader.vue.js';
48
+ export { default as WListHeaderItem } from './components/List/WListHeaderItem.vue.js';
46
49
  export { default as WMenuItem } from './components/MenuItem/WMenuItem.vue.js';
47
50
  export { default as WModal } from './components/Modal/WModal.vue.js';
48
51
  export { default as WModalStepper } from './components/Modal/WModalStepper.vue.js';
@@ -73,4 +76,4 @@ export { Month, WeekDay, addDay, addMonth, addYear, dateFormat, dateFormatter, d
73
76
  export { getIsMobile, getIsTouchDevice } from './utils/mobile.js';
74
77
  export { useDefaultQuery } from './utils/useDefaultQuery.js';
75
78
  export { useCopy } from './utils/useCopy.js';
76
- export { debounce, genId, getAllScrollParents, getScrollParent, hasParent, isClientSide, isEqualArr, isEqualObj, numberCompactFormatter, numberFormatter, percentCompactFormatter, throttle } from './utils/utils.js';
79
+ export { debounce, genId, getAllScrollParents, getScrollParent, hasParent, isClientSide, isEqualArr, isEqualObj, isId, isIndex, isPage, numberCompactFormatter, numberFormatter, parseId, parseIndex, percentCompactFormatter, throttle } from './utils/utils.js';
@@ -64,3 +64,28 @@ declare type SelectedRange<Value> = [
64
64
  SelectedPage<Value>,
65
65
  ]
66
66
 
67
+ declare type UnionToIntersection<T> =
68
+ (T extends T ? (arg: T) => 0 : never) extends
69
+ (arg: infer I) => 0
70
+ ? I
71
+ : never
72
+
73
+ declare type LastInUnion<U> =
74
+ UnionToIntersection<
75
+ U extends U ? (arg: U) => 0 : never
76
+ > extends (arg: infer Last) => 0
77
+ ? Last
78
+ : never
79
+
80
+ declare type UnionToTuple<
81
+ U,
82
+ Last = LastInUnion<U>
83
+ > =
84
+ [U] extends [never]
85
+ ? []
86
+ : [
87
+ ...UnionToTuple<Exclude<U, Last>>,
88
+ Last,
89
+ ]
90
+
91
+ declare type ObjectKeys<O> = UnionToTuple<keyof O>
@@ -0,0 +1,11 @@
1
+ export declare enum Order {
2
+ ASC = "ASC",
3
+ DESC = "DESC"
4
+ }
5
+ export type OrderItem<Field> = {
6
+ field: Field;
7
+ order: Order;
8
+ };
9
+ export declare const parseOrdering: <Field extends string = string>(ordering: string) => OrderItem<Field>[];
10
+ export declare const encodeOrdering: (items: OrderItem<unknown>[]) => string | undefined;
11
+ //# sourceMappingURL=order.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order.d.ts","sourceRoot":"","sources":["../../src/utils/order.ts"],"names":[],"mappings":"AACA,oBAAY,KAAK;IACf,GAAG,QAAQ;IACX,IAAI,SAAS;CACd;AAED,MAAM,MAAM,SAAS,CAAC,KAAK,IAAI;IAAC,KAAK,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAC,CAAA;AAE3D,eAAO,MAAM,aAAa,GAAI,KAAK,SAAS,MAAM,qBAAqB,MAAM,KAAG,SAAS,CAAC,KAAK,CAAC,EAO/F,CAAA;AAED,eAAO,MAAM,cAAc,UAAW,SAAS,CAAC,OAAO,CAAC,EAAE,KAAG,MAAM,GAAG,SAErE,CAAA"}
@@ -0,0 +1,18 @@
1
+ var Order = /* @__PURE__ */ ((Order2) => {
2
+ Order2["ASC"] = "ASC";
3
+ Order2["DESC"] = "DESC";
4
+ return Order2;
5
+ })(Order || {});
6
+ const parseOrdering = (ordering) => {
7
+ return ordering.split(",").map((orderItem) => {
8
+ return {
9
+ field: orderItem.replace(/^-+/, ""),
10
+ order: orderItem[0] === "-" ? "DESC" /* DESC */ : "ASC" /* ASC */
11
+ };
12
+ });
13
+ };
14
+ const encodeOrdering = (items) => {
15
+ return items.map((item) => `${item.order === "DESC" ? "-" : ""}${item.field}`).join(",") || void 0;
16
+ };
17
+
18
+ export { Order, encodeOrdering, parseOrdering };
@@ -0,0 +1,12 @@
1
+ export declare const isSelecionPage: <T>(value: unknown) => value is SelectedPage<T>;
2
+ export declare const isSelectedRange: <T>(value: unknown) => value is SelectedRange<T>;
3
+ export declare const getPosition: <T>(range: SelectedPage<T>, pageLength: number) => number;
4
+ export declare const useSelected: () => {
5
+ selectedRange: import('vue').ComputedRef<SelectedRange<number> | undefined>;
6
+ setSelectedRange: (value: SelectedRange<number>) => void;
7
+ selected: import('vue').ComputedRef<number[]>;
8
+ reverse: import('vue').ComputedRef<boolean>;
9
+ setSelected: (value: number[]) => void;
10
+ setSelectedReverse: (value: number[]) => void;
11
+ };
12
+ //# sourceMappingURL=useSelected.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSelected.d.ts","sourceRoot":"","sources":["../../src/utils/useSelected.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,OAAO,KAAG,KAAK,IAAI,YAAY,CAAC,CAAC,CAMzE,CAAA;AAMD,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,OAAO,KAAG,KAAK,IAAI,aAAa,CAAC,CAAC,CAK3E,CAAA;AAMD,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC,cAAc,MAAM,KAAG,MAE3E,CAAA;AAQD,eAAO,MAAM,WAAW;;8BAmBW,aAAa,CAAC,MAAM,CAAC;;;yBAgB1B,MAAM,EAAE,KAAG,IAAI;gCAIR,MAAM,EAAE,KAAG,IAAI;CAanD,CAAA"}
@@ -0,0 +1,61 @@
1
+ import { computed } from 'vue';
2
+ import { useRoute, useRouter } from 'vue-router';
3
+ import { isPage, isIndex, isId } from './utils.js';
4
+
5
+ const keysLengthPage = 3;
6
+ const isSelecionPage = (value) => {
7
+ return value instanceof Object && Object.keys(value).length === keysLengthPage && "page" in value && isPage(value.page) && "index" in value && isIndex(value.index) && "id" in value && isId(value.id);
8
+ };
9
+ const stringifySelectedPage = (value) => value.page + ":" + value.index + ":" + value.id;
10
+ const keysLengthRange = 2;
11
+ const isSelectedRange = (value) => {
12
+ return Array.isArray(value) && value.length === keysLengthRange && isSelecionPage(value[0]) && isSelecionPage(value[1]);
13
+ };
14
+ const isRightOrder = (value) => {
15
+ return value[0].page < value[1].page || value[0].page === value[1].page && value[0].index <= value[1].index;
16
+ };
17
+ const getPosition = (range, pageLength) => {
18
+ return (range.page - 1) * pageLength + range.index;
19
+ };
20
+ const stringifySelectedRange = (value) => stringifySelectedPage(value[0]) + "-" + stringifySelectedPage(value[1]);
21
+ const DIVIDER = ",";
22
+ const useSelected = () => {
23
+ const route = useRoute();
24
+ const router = useRouter();
25
+ const selectedRange = computed(() => {
26
+ if (!route.hash.includes("-")) return void 0;
27
+ const parsed = route.hash.substring(1).split("-").map((item) => {
28
+ const [page, index, id] = item.split(":").map((value) => Number.parseInt(value));
29
+ return { page, index, id };
30
+ });
31
+ if (!isSelectedRange(parsed)) return void 0;
32
+ if (!isRightOrder(parsed)) parsed.reverse();
33
+ return parsed;
34
+ });
35
+ const setSelectedRange = (value) => {
36
+ router.replace({ query: route.query, hash: `#${stringifySelectedRange(value)}` });
37
+ };
38
+ const selected = computed(() => {
39
+ if (typeof route.hash !== "string") return [];
40
+ if (route.hash.includes("-")) return [];
41
+ const substring = route.hash[1] === "!" ? route.hash.substring(2) : route.hash.substring(1);
42
+ return substring.split(DIVIDER).map((item) => Number.parseInt(item)).filter((item) => !isNaN(item));
43
+ });
44
+ const reverse = computed(() => typeof route.hash === "string" && route.hash[1] === "!");
45
+ const setSelected = (value) => {
46
+ router.replace({ query: route.query, hash: `#${value.join(DIVIDER)}` });
47
+ };
48
+ const setSelectedReverse = (value) => {
49
+ router.replace({ query: route.query, hash: `#!${value.join(DIVIDER)}` });
50
+ };
51
+ return {
52
+ selectedRange,
53
+ setSelectedRange,
54
+ selected,
55
+ reverse,
56
+ setSelected,
57
+ setSelectedReverse
58
+ };
59
+ };
60
+
61
+ export { getPosition, isSelecionPage, isSelectedRange, useSelected };
@@ -11,5 +11,10 @@ export declare const numberCompactFormatter: Intl.NumberFormat;
11
11
  export declare const numberFormatter: Intl.NumberFormat;
12
12
  export declare const isClientSide: boolean;
13
13
  export declare const genId: () => number;
14
+ export declare const isId: (value: unknown) => value is number;
15
+ export declare const parseId: (value: unknown) => number;
16
+ export declare const isPage: (value: unknown) => value is number;
17
+ export declare const isIndex: (value: unknown) => value is number;
18
+ export declare const parseIndex: (value: unknown) => number;
14
19
  export {};
15
20
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,eAAe,SAAU,OAAO,KAAG,OAAO,GAAG,IAKhD,CAAA;AAEV,eAAO,MAAM,mBAAmB,UAAW,OAAO,mBAAa,KAAK,CAAC,OAAO,CAa3E,CAAA;AAED,eAAO,MAAM,SAAS,WAAY,OAAO,WAAW,OAAO,KAAG,OAI7D,CAAA;AAGD,KAAK,UAA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UAAU,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,SAAM,GAAG,CAAC,CAYpE;AAED,eAAO,MAAM,UAAU,SAAU,OAAO,EAAE,QAAQ,OAAO,EAAE,KAAG,OAE7D,CAAA;AAED,eAAO,MAAM,UAAU,SAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,MAAM,EAAE,YAAY,MAAM,EAAE,KAAG,OAWjI,CAAA;AAED,eAAO,MAAM,uBAAuB,mBAAmE,CAAA;AACvG,eAAO,MAAM,sBAAsB,mBAAiD,CAAA;AACpF,eAAO,MAAM,eAAe,mBAA0B,CAAA;AAEtD,eAAO,MAAM,YAAY,EAAE,OAAuC,CAAA;AAIlE,eAAO,MAAM,KAAK,cAEjB,CAAA;AAED,eAAO,MAAM,IAAI,UAAW,OAAO,KAAG,KAAK,IAAI,MAE9C,CAAA;AAED,eAAO,MAAM,OAAO,UAAW,OAAO,KAAG,MAUxC,CAAA;AAED,eAAO,MAAM,MAAM,UAAW,OAAO,KAAG,KAAK,IAAI,MAAqB,CAAA;AAEtE,eAAO,MAAM,OAAO,UAAW,OAAO,KAAG,KAAK,IAAI,MAEjD,CAAA;AAED,eAAO,MAAM,UAAU,UAAW,OAAO,KAAG,MAU3C,CAAA"}
@@ -58,5 +58,26 @@ let iterator = 1;
58
58
  const genId = () => {
59
59
  return iterator++;
60
60
  };
61
+ const isId = (value) => {
62
+ return typeof value === "number" && Number.isInteger(value) && value > 0;
63
+ };
64
+ const parseId = (value) => {
65
+ if (typeof value === "number" && isId(value)) return value;
66
+ if (typeof value !== "string") return NaN;
67
+ const parsed = Number.parseInt(value);
68
+ if (isId(parsed)) return parsed;
69
+ return NaN;
70
+ };
71
+ const isPage = (value) => isId(value);
72
+ const isIndex = (value) => {
73
+ return typeof value === "number" && Number.isInteger(value) && value >= 0;
74
+ };
75
+ const parseIndex = (value) => {
76
+ if (typeof value === "number" && isIndex(value)) return value;
77
+ if (typeof value !== "string") return NaN;
78
+ const parsed = Number.parseInt(value);
79
+ if (isIndex(parsed)) return parsed;
80
+ return NaN;
81
+ };
61
82
 
62
- export { debounce, genId, getAllScrollParents, getScrollParent, hasParent, isClientSide, isEqualArr, isEqualObj, numberCompactFormatter, numberFormatter, percentCompactFormatter, throttle };
83
+ export { debounce, genId, getAllScrollParents, getScrollParent, hasParent, isClientSide, isEqualArr, isEqualObj, isId, isIndex, isPage, numberCompactFormatter, numberFormatter, parseId, parseIndex, percentCompactFormatter, throttle };
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/rsmple/eco-vue-js.git"
6
6
  },
7
- "version": "0.6.8",
7
+ "version": "0.7.0",
8
8
  "scripts": {
9
9
  "dev": "vite",
10
10
  "build": "run-p type-check build-only",
@@ -108,6 +108,12 @@
108
108
  "./dist/utils/useCopy": {
109
109
  "import": "./dist/utils/useCopy.js"
110
110
  },
111
+ "./dist/utils/order": {
112
+ "import": "./dist/utils/order.js"
113
+ },
114
+ "./dist/utils/useSelected": {
115
+ "import": "./dist/utils/useSelected.js"
116
+ },
111
117
  "./dist/components/ActionsBar/WActionsBar.vue": {
112
118
  "import": "./dist/components/ActionsBar/WActionsBar.vue.js"
113
119
  },
@@ -240,11 +246,23 @@
240
246
  "./dist/components/Link/WLinkArrow.vue": {
241
247
  "import": "./dist/components/Link/WLinkArrow.vue.js"
242
248
  },
243
- "./dist/components/ListCard/WListCard.vue": {
244
- "import": "./dist/components/ListCard/WListCard.vue.js"
249
+ "./dist/components/List/WList.vue": {
250
+ "import": "./dist/components/List/WList.vue.js"
251
+ },
252
+ "./dist/components/List/WListCard.vue": {
253
+ "import": "./dist/components/List/WListCard.vue.js"
254
+ },
255
+ "./dist/components/List/WListCardField.vue": {
256
+ "import": "./dist/components/List/WListCardField.vue.js"
257
+ },
258
+ "./dist/components/List/WListHeader.vue": {
259
+ "import": "./dist/components/List/WListHeader.vue.js"
260
+ },
261
+ "./dist/components/List/WListHeaderItem.vue": {
262
+ "import": "./dist/components/List/WListHeaderItem.vue.js"
245
263
  },
246
- "./dist/components/ListCard/WListCardField.vue": {
247
- "import": "./dist/components/ListCard/WListCardField.vue.js"
264
+ "./dist/components/List/types": {
265
+ "import": "./dist/components/List/types.d.ts"
248
266
  },
249
267
  "./dist/components/MenuItem/WMenuItem.vue": {
250
268
  "import": "./dist/components/MenuItem/WMenuItem.vue.js"
@@ -1 +0,0 @@
1
- {"version":3,"file":"WListCard.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ListCard/WListCard.vue"],"names":[],"mappings":"AAwLA,iBAAS,cAAc;;;QA6MO,GAAG;kBACN,GAAG;EA6B7B;AACD,QAAA,MAAM,eAAe;eAlSR,OAAO;eACP,OAAO;aACT,OAAO;iBACH,OAAO;eACT,OAAO;;;;;;;eAJP,OAAO;eACP,OAAO;aACT,OAAO;iBACH,OAAO;eACT,OAAO;;;;UAsSlB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAAvG,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CA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