eco-vue-js 0.8.20 → 0.8.21
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/icons/default/IconMore.svg.js +3 -17
- package/dist/assets/icons/sax/IconTableSettings.svg.js +40 -0
- package/dist/components/Button/WButtonMore.vue.d.ts +5 -1
- package/dist/components/Button/WButtonMore.vue.d.ts.map +1 -1
- package/dist/components/Button/WButtonMore.vue.js +6 -5
- package/dist/components/DropdownMenu/WDropdownMenu.vue.d.ts +68 -1
- package/dist/components/DropdownMenu/WDropdownMenu.vue.d.ts.map +1 -1
- package/dist/components/DropdownMenu/WDropdownMenu.vue.js +9 -12
- package/dist/components/Input/WInputSuggest.vue.d.ts.map +1 -1
- package/dist/components/Input/WInputSuggest.vue.js +2 -1
- package/dist/components/List/WList.vue.d.ts.map +1 -1
- package/dist/components/List/WList.vue.js +66 -49
- package/dist/components/List/WListCard.vue.d.ts.map +1 -1
- package/dist/components/List/WListCard.vue.js +1 -1
- package/dist/components/List/WListHeader.vue.d.ts +1 -0
- package/dist/components/List/WListHeader.vue.d.ts.map +1 -1
- package/dist/components/List/WListHeader.vue.js +3 -1
- package/dist/components/List/components/HeaderSettings.vue.d.ts +24 -0
- package/dist/components/List/components/HeaderSettings.vue.d.ts.map +1 -0
- package/dist/components/List/components/HeaderSettings.vue.js +78 -0
- package/dist/components/List/components/HeaderSettings.vue2.js +5 -0
- package/dist/components/List/components/HeaderSettingsItem.vue.d.ts +32 -0
- package/dist/components/List/components/HeaderSettingsItem.vue.d.ts.map +1 -0
- package/dist/components/List/components/HeaderSettingsItem.vue.js +64 -0
- package/dist/components/List/components/HeaderSettingsItem.vue2.js +5 -0
- package/dist/components/List/types.d.ts +6 -0
- package/dist/components/List/types.d.ts.map +1 -1
- package/package.json +1 -1
@@ -10,23 +10,9 @@ const _hoisted_1 = {
|
|
10
10
|
|
11
11
|
function render(_ctx, _cache) {
|
12
12
|
return (openBlock(), createElementBlock("svg", _hoisted_1, _cache[0] || (_cache[0] = [
|
13
|
-
createElementVNode("
|
14
|
-
|
15
|
-
|
16
|
-
r: "2.5",
|
17
|
-
fill: "currentColor"
|
18
|
-
}, null, -1),
|
19
|
-
createElementVNode("circle", {
|
20
|
-
cx: "12",
|
21
|
-
cy: "12",
|
22
|
-
r: "2.5",
|
23
|
-
fill: "currentColor"
|
24
|
-
}, null, -1),
|
25
|
-
createElementVNode("circle", {
|
26
|
-
cx: "21",
|
27
|
-
cy: "12",
|
28
|
-
r: "2.5",
|
29
|
-
fill: "currentColor"
|
13
|
+
createElementVNode("path", {
|
14
|
+
fill: "currentColor",
|
15
|
+
d: "M14.5 21a2.5 2.5 0 1 0-5 0 2.5 2.5 0 0 0 5 0ZM14.5 12a2.5 2.5 0 1 0-5 0 2.5 2.5 0 0 0 5 0ZM14.5 3a2.5 2.5 0 1 0-5 0 2.5 2.5 0 0 0 5 0Z"
|
30
16
|
}, null, -1)
|
31
17
|
])))
|
32
18
|
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { openBlock, createElementBlock, createElementVNode } from 'vue';
|
2
|
+
|
3
|
+
const _hoisted_1 = {
|
4
|
+
xmlns: "http://www.w3.org/2000/svg",
|
5
|
+
width: "20",
|
6
|
+
height: "20",
|
7
|
+
fill: "none",
|
8
|
+
viewBox: "0 0 24 24"
|
9
|
+
};
|
10
|
+
|
11
|
+
function render(_ctx, _cache) {
|
12
|
+
return (openBlock(), createElementBlock("svg", _hoisted_1, _cache[0] || (_cache[0] = [
|
13
|
+
createElementVNode("path", {
|
14
|
+
stroke: "currentColor",
|
15
|
+
"stroke-linecap": "round",
|
16
|
+
"stroke-linejoin": "round",
|
17
|
+
"stroke-width": "1.5",
|
18
|
+
d: "M22 11V9c0-5-2-7-7-7H9C4 2 2 4 2 9v6c0 5 2 7 7 7h1M2.03 8.5H22M2.03 15.5H9.324M8.51 21.99V2.01M15.51 2.01v7.748"
|
19
|
+
}, null, -1),
|
20
|
+
createElementVNode("path", {
|
21
|
+
stroke: "currentColor",
|
22
|
+
"stroke-linecap": "round",
|
23
|
+
"stroke-linejoin": "round",
|
24
|
+
"stroke-miterlimit": "10",
|
25
|
+
"stroke-width": "1.5",
|
26
|
+
d: "M16.72 18.599a1.59 1.59 0 1 0 0-3.18 1.59 1.59 0 0 0 0 3.18Z"
|
27
|
+
}, null, -1),
|
28
|
+
createElementVNode("path", {
|
29
|
+
stroke: "currentColor",
|
30
|
+
"stroke-linecap": "round",
|
31
|
+
"stroke-linejoin": "round",
|
32
|
+
"stroke-miterlimit": "10",
|
33
|
+
"stroke-width": "1.5",
|
34
|
+
d: "M11.42 17.469v-.93c0-.55.45-1 1-1 .96 0 1.35-.68.87-1.51a1 1 0 0 1 .37-1.37l.91-.53c.42-.25.96-.1 1.21.32l.06.1c.48.83 1.26.83 1.74 0l.06-.1c.25-.42.79-.56 1.21-.32l.91.53c.48.28.65.89.37 1.37-.48.83-.09 1.51.87 1.51.55 0 1 .45 1 1v.93c0 .55-.45 1-1 1-.96 0-1.35.68-.87 1.51a1 1 0 0 1-.37 1.37l-.91.53c-.42.25-.96.1-1.21-.32l-.06-.1c-.48-.83-1.26-.83-1.74 0l-.06.1c-.25.42-.79.56-1.21.32l-.91-.53c-.48-.28-.65-.89-.37-1.37.48-.83.09-1.51-.87-1.51a.99.99 0 0 1-1-1Z"
|
35
|
+
}, null, -1)
|
36
|
+
])))
|
37
|
+
}
|
38
|
+
const IconTableSettings = { render: render };
|
39
|
+
|
40
|
+
export { IconTableSettings as default, render };
|
@@ -1,14 +1,18 @@
|
|
1
1
|
declare function __VLS_template(): {
|
2
2
|
slots: {
|
3
|
-
default?(_: {
|
3
|
+
default?(_: {
|
4
|
+
close: () => void;
|
5
|
+
}): any;
|
4
6
|
};
|
5
7
|
refs: {};
|
6
8
|
attrs: Partial<{}>;
|
7
9
|
};
|
8
10
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
9
11
|
declare const __VLS_component: import('vue').DefineComponent<{
|
12
|
+
icon?: SVGComponent;
|
10
13
|
disabled?: boolean;
|
11
14
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
15
|
+
icon?: SVGComponent;
|
12
16
|
disabled?: boolean;
|
13
17
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
14
18
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WButtonMore.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Button/WButtonMore.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WButtonMore.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Button/WButtonMore.vue"],"names":[],"mappings":"AAqGA,iBAAS,cAAc;;;yBATL,IAAI;YA+GQ,GAAG;;;WASnB,OAAO,IAA6B;EAEjD;AAeD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;WAvJZ,YAAY;eACR,OAAO;;WADX,YAAY;eACR,OAAO;iGA4JlB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { defineComponent, ref, openBlock, createElementBlock, normalizeClass, createVNode, unref, withCtx, createElementVNode, renderSlot } from 'vue';
|
1
|
+
import { defineComponent, ref, openBlock, createElementBlock, normalizeClass, createVNode, unref, withCtx, createElementVNode, createBlock, resolveDynamicComponent, renderSlot } from 'vue';
|
2
2
|
import _sfc_main$1 from '../DropdownMenu/WDropdownMenu.vue.js';
|
3
3
|
import { HorizontalAlign } from '../../utils/HorizontalAlign.js';
|
4
4
|
import IconMore from '../../assets/icons/default/IconMore.svg.js';
|
@@ -8,6 +8,7 @@ const _hoisted_1 = ["disabled"];
|
|
8
8
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
9
9
|
__name: "WButtonMore",
|
10
10
|
props: {
|
11
|
+
icon: {},
|
11
12
|
disabled: { type: Boolean }
|
12
13
|
},
|
13
14
|
setup(__props) {
|
@@ -26,7 +27,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
26
27
|
class: normalizeClass([{
|
27
28
|
"w-hover-circle-trigger cursor-pointer": !_ctx.disabled,
|
28
29
|
"cursor-not-allowed opacity-50": _ctx.disabled
|
29
|
-
}, "outline-none"]),
|
30
|
+
}, "outline-none w-full h-full flex items-center justify-center"]),
|
30
31
|
onClick: toggle
|
31
32
|
}, [
|
32
33
|
createVNode(_sfc_main$1, {
|
@@ -40,13 +41,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
40
41
|
}, {
|
41
42
|
toggle: withCtx(() => [
|
42
43
|
createElementVNode("div", {
|
43
|
-
class: normalizeClass(["relative
|
44
|
+
class: normalizeClass(["relative p-px", {
|
44
45
|
"w-hover-circle": !_ctx.disabled,
|
45
46
|
"text-description": !isOpen.value,
|
46
47
|
"text-primary-default dark:text-primary-dark": isOpen.value
|
47
48
|
}])
|
48
49
|
}, [
|
49
|
-
|
50
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.icon ?? unref(IconMore))))
|
50
51
|
], 2)
|
51
52
|
]),
|
52
53
|
content: withCtx(() => [
|
@@ -55,7 +56,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
55
56
|
onClick: close
|
56
57
|
}, {
|
57
58
|
default: withCtx(() => [
|
58
|
-
renderSlot(_ctx.$slots, "default")
|
59
|
+
renderSlot(_ctx.$slots, "default", { close })
|
59
60
|
]),
|
60
61
|
_: 3
|
61
62
|
})
|
@@ -87,7 +87,74 @@ declare const __VLS_component: import('vue').DefineComponent<DropdownMenuProps,
|
|
87
87
|
"update:rect": () => any;
|
88
88
|
}, string, import('vue').PublicProps, Readonly<DropdownMenuProps> & Readonly<{
|
89
89
|
"onUpdate:rect"?: (() => any) | undefined;
|
90
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
90
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
91
|
+
container: HTMLDivElement;
|
92
|
+
dropdown: ({
|
93
|
+
$: import('vue').ComponentInternalInstance;
|
94
|
+
$data: {};
|
95
|
+
$props: {
|
96
|
+
readonly maxHeight: number;
|
97
|
+
readonly maxWidth: number;
|
98
|
+
readonly horizontalAlign: import('../../main').HorizontalAlign;
|
99
|
+
readonly parentElement: Element;
|
100
|
+
readonly updateAlign?: boolean | undefined;
|
101
|
+
readonly emitUpdate?: boolean | undefined;
|
102
|
+
readonly "onUpdate:rect"?: (() => any) | undefined;
|
103
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
104
|
+
$attrs: {
|
105
|
+
[x: string]: unknown;
|
106
|
+
};
|
107
|
+
$refs: {
|
108
|
+
[x: string]: unknown;
|
109
|
+
};
|
110
|
+
$slots: Readonly<{
|
111
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
112
|
+
}>;
|
113
|
+
$root: import('vue').ComponentPublicInstance | null;
|
114
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
115
|
+
$host: Element | null;
|
116
|
+
$emit: (event: "update:rect") => void;
|
117
|
+
$el: any;
|
118
|
+
$options: import('vue').ComponentOptionsBase<Readonly<import('../Dropdown/types').DropdownProps> & Readonly<{
|
119
|
+
"onUpdate:rect"?: (() => any) | undefined;
|
120
|
+
}>, {
|
121
|
+
update: () => void;
|
122
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
123
|
+
"update:rect": () => any;
|
124
|
+
}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
125
|
+
beforeCreate?: (() => void) | (() => void)[];
|
126
|
+
created?: (() => void) | (() => void)[];
|
127
|
+
beforeMount?: (() => void) | (() => void)[];
|
128
|
+
mounted?: (() => void) | (() => void)[];
|
129
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
130
|
+
updated?: (() => void) | (() => void)[];
|
131
|
+
activated?: (() => void) | (() => void)[];
|
132
|
+
deactivated?: (() => void) | (() => void)[];
|
133
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
134
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
135
|
+
destroyed?: (() => void) | (() => void)[];
|
136
|
+
unmounted?: (() => void) | (() => void)[];
|
137
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
138
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
139
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
140
|
+
};
|
141
|
+
$forceUpdate: () => void;
|
142
|
+
$nextTick: typeof import('vue').nextTick;
|
143
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
144
|
+
} & Readonly<{}> & Omit<Readonly<import('../Dropdown/types').DropdownProps> & Readonly<{
|
145
|
+
"onUpdate:rect"?: (() => any) | undefined;
|
146
|
+
}>, "update"> & import('vue').ShallowUnwrapRef<{
|
147
|
+
update: () => void;
|
148
|
+
}> & {} & import('vue').ComponentCustomProperties & {} & {
|
149
|
+
$slots: {
|
150
|
+
default?(_: {
|
151
|
+
left: string;
|
152
|
+
right: string;
|
153
|
+
istop: boolean;
|
154
|
+
}): any;
|
155
|
+
};
|
156
|
+
}) | null;
|
157
|
+
}, any>;
|
91
158
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
92
159
|
export default _default;
|
93
160
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WDropdownMenu.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DropdownMenu/WDropdownMenu.vue"],"names":[],"mappings":"AAsEA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAA;AAiC9C,iBAAS,cAAc;;;;YAyFK,GAAG;;;;;YACD,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
1
|
+
{"version":3,"file":"WDropdownMenu.vue.d.ts","sourceRoot":"","sources":["../../../src/components/DropdownMenu/WDropdownMenu.vue"],"names":[],"mappings":"AAsEA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAA;AAiC9C,iBAAS,cAAc;;;;YAyFK,GAAG;;;;;YACD,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAuD8rhB,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;WA5Cv0hB,OAAO,IAA6B;EAEjD;AAYD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCA6B0shB,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;OAlBn1hB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
@@ -1,6 +1,7 @@
|
|
1
|
-
import { defineComponent,
|
1
|
+
import { defineComponent, useTemplateRef, openBlock, createElementBlock, renderSlot, createBlock, Teleport, createVNode, Transition, withCtx, unref, normalizeClass, normalizeProps, guardReactiveProps, createCommentVNode } from 'vue';
|
2
2
|
import _sfc_main$1 from '../Dropdown/WDropdown.vue.js';
|
3
3
|
|
4
|
+
const _hoisted_1 = { ref: "container" };
|
4
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
5
6
|
__name: "WDropdownMenu",
|
6
7
|
props: {
|
@@ -15,18 +16,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
16
|
},
|
16
17
|
emits: ["update:rect"],
|
17
18
|
setup(__props, { expose: __expose }) {
|
18
|
-
const
|
19
|
-
const
|
19
|
+
const containerRef = useTemplateRef("container");
|
20
|
+
const dropdownRef = useTemplateRef("dropdown");
|
20
21
|
__expose({
|
21
22
|
updateDropdown: () => {
|
22
|
-
|
23
|
+
dropdownRef.value?.update();
|
23
24
|
}
|
24
25
|
});
|
25
26
|
return (_ctx, _cache) => {
|
26
|
-
return openBlock(), createElementBlock("div",
|
27
|
-
ref_key: "container",
|
28
|
-
ref: container
|
29
|
-
}, [
|
27
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
30
28
|
renderSlot(_ctx.$slots, "toggle", { unclickable: false }),
|
31
29
|
(openBlock(), createBlock(Teleport, {
|
32
30
|
to: "body",
|
@@ -39,11 +37,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
39
37
|
"leave-to-class": "opacity-0"
|
40
38
|
}, {
|
41
39
|
default: withCtx(() => [
|
42
|
-
|
40
|
+
unref(containerRef) && _ctx.isOpen ? (openBlock(), createBlock(_sfc_main$1, {
|
43
41
|
key: 0,
|
44
|
-
|
45
|
-
|
46
|
-
"parent-element": container.value,
|
42
|
+
ref: "dropdown",
|
43
|
+
"parent-element": unref(containerRef),
|
47
44
|
"horizontal-align": _ctx.horizontalAlign,
|
48
45
|
"update-align": _ctx.updateAlign,
|
49
46
|
"max-height": _ctx.maxHeight,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WInputSuggest.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Input/WInputSuggest.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WInputSuggest.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Input/WInputSuggest.vue"],"names":[],"mappings":"AAiOA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAA;yBAG7B,IAAI,SAAS,SAAS,wBACzB,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WAqfxD,mBAAmB,CAAC,6BAAyD,CAAC,4BAA2B;oBAChG,OAAO,KAAK,EAAE,gBAAgB;;;;;MAAsB,GAAG,IAAI;WACpE,GAAG;;gBAvaH,MAAM,IAAI;mBACP,MAAM,IAAI;iBACZ,CAAC,KAAK,EAAE;YAAC,WAAW,CAAC,EAAE,OAAO,CAAA;SAAC,KAAK,IAAI;gBACzC,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,IAAI;kBACpC,CAAC,KAAK,EAAE;YAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;SAAC,KAAK,IAAI;;gBAJ/C,MAAM,IAAI;mBACP,MAAM,IAAI;iBACZ,CAAC,KAAK,EAAE;YAAC,WAAW,CAAC,EAAE,OAAO,CAAA;SAAC,KAAK,IAAI;gBACzC,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,IAAI;kBACpC,CAAC,KAAK,EAAE;YAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;SAAC,KAAK,IAAI;;;YAlEnD,mBAAmB,mDAAsB,IAAI;YAC7C,gBAAgB,SAAS,aAAa,GAAG,IAAI;YAC7C,aAAa,SAAS,aAAa,GAAG,IAAI;YAC1C,eAAe,SAAS,aAAa,GAAG,IAAI;YAC5C,iBAAiB,SAAS,aAAa,GAAG,IAAI;YAC9C,MAAM,GAAG,IAAI;YACb,OAAO,GAAG,IAAI;YACd,aAAa,GAAG,IAAI;YACpB,OAAO,SAAS,UAAU,GAAG,IAAI;YACjC,MAAM,SAAS,UAAU,GAAG,IAAI;;;;;YAieM,OAAO,CAAC,OAAO,WAAW,CAAC;;AA/fvE,wBA+f4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -103,7 +103,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
103
103
|
maxWidth: _ctx.maxWidth,
|
104
104
|
horizontalAlign: _ctx.horizontalAlign,
|
105
105
|
updateAlign: true,
|
106
|
-
teleport: _ctx.teleport
|
106
|
+
teleport: _ctx.teleport,
|
107
|
+
noZIndex: _ctx.noZIndex
|
107
108
|
}), {
|
108
109
|
toggle: withCtx(({ unclickable }) => [
|
109
110
|
createVNode(_sfc_main$3, mergeProps({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/List/WList.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/List/WList.vue"],"names":[],"mappings":"AAqSA,OAAO,KAAK,EAAC,aAAa,EAAE,cAAc,EAAe,SAAS,EAAE,aAAa,EAAC,MAAM,SAAS,CAAA;yBAQhF,IAAI,SAAS,WAAW,EAAE,WAAW,eACxC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WAomBxD,mBAAmB,CAAC;;;gBA5lBpB,MAAM;gBACN,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE;oBAC1B,cAAc,CAAC,IAAI,CAAC;oBACpB,iBAAiB,CAAC,IAAI,EAAE,WAAW,CAAC;qBACnC,WAAW;6BACH,MAAM;wBACX,MAAM;eACf,aAAa,CAAC,WAAW,CAAC,EAAE;mBACxB,aAAa,CAAC,WAAW,CAAC,EAAE;cACjC,aAAa,CAAC,IAAI,CAAC,EAAE;yBACV,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO;oBAC5B,MAAM;6BACG,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM;oBACvD,OAAO;qBACN,OAAO;KA8kBiE,CAAC,4BAA2B;oBAChG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;cA3kBP,uBAAuB,SAAS,MAAM,KAAG,IAAI;;;;YAglBP,OAAO,CAAC,OAAO,WAAW,CAAC;;AA9mBvE,wBA8mB4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -1,12 +1,13 @@
|
|
1
|
-
import { defineComponent, ref, computed, openBlock, createBlock, unref, withCtx, createSlots, createElementBlock, Fragment, renderList, resolveDynamicComponent, normalizeClass, createCommentVNode,
|
1
|
+
import { defineComponent, ref, computed, openBlock, createBlock, unref, withCtx, createSlots, createElementBlock, Fragment, renderList, resolveDynamicComponent, normalizeClass, createCommentVNode, createVNode, normalizeStyle } from 'vue';
|
2
2
|
import _sfc_main$1 from '../InfiniteList/WInfiniteList.vue.js';
|
3
3
|
import { getIsMobile } from '../../utils/mobile.js';
|
4
4
|
import { useSelected, getPosition } from '../../utils/useSelected.js';
|
5
|
-
import _sfc_main$
|
5
|
+
import _sfc_main$6 from './WListCard.vue.js';
|
6
6
|
import _sfc_main$3 from './WListHeader.vue.js';
|
7
|
-
import _sfc_main$
|
7
|
+
import _sfc_main$5 from './WListHeaderItem.vue.js';
|
8
8
|
import { parseOrdering } from '../../utils/order.js';
|
9
9
|
import _sfc_main$2 from '../Button/WButtonSelection.vue.js';
|
10
|
+
import _sfc_main$4 from './components/HeaderSettings.vue.js';
|
10
11
|
|
11
12
|
const PAGE_LENGTH = 24;
|
12
13
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
@@ -34,7 +35,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
34
35
|
const props = __props;
|
35
36
|
const listCount = ref(0);
|
36
37
|
const selectionCount = ref(0);
|
37
|
-
const
|
38
|
+
const fieldsConfig = ref(props.fields.reduce((result, field, index) => {
|
39
|
+
result[field.label] = {
|
40
|
+
width: 0,
|
41
|
+
visible: true,
|
42
|
+
order: index
|
43
|
+
};
|
44
|
+
return result;
|
45
|
+
}, {}));
|
46
|
+
const fieldsVisible = computed(() => props.fields.filter((field) => field.visibleGetter?.(props.queryParams) ?? true));
|
47
|
+
const fieldsFiltered = computed(() => {
|
48
|
+
if (isMobile) return fieldsVisible.value;
|
49
|
+
return fieldsVisible.value.filter((field) => fieldsConfig.value[field.label].visible).sort((a, b) => fieldsConfig.value[a.label].order - fieldsConfig.value[b.label].order);
|
50
|
+
});
|
38
51
|
const allowSelect = computed(() => props.bulk !== void 0);
|
39
52
|
const {
|
40
53
|
selected,
|
@@ -93,8 +106,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
93
106
|
onSelect: unref(setSelected),
|
94
107
|
onSelectReverse: unref(setSelectedReverse),
|
95
108
|
onSelectRange: unref(setSelectedRange),
|
96
|
-
"onUpdate:headerPadding": _cache[
|
97
|
-
"onUpdate:count": _cache[
|
109
|
+
"onUpdate:headerPadding": _cache[5] || (_cache[5] = ($event) => _ctx.$emit("update:header-padding", $event)),
|
110
|
+
"onUpdate:count": _cache[6] || (_cache[6] = ($event) => listCount.value = $event)
|
98
111
|
}, {
|
99
112
|
header: withCtx(({ selectAllValue }) => [
|
100
113
|
allowSelect.value ? (openBlock(), createBlock(_sfc_main$2, {
|
@@ -142,32 +155,38 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
142
155
|
"tooltip-text": _ctx.selectAllTextGetter(selectAllValue !== true, _ctx.count ?? listCount.value),
|
143
156
|
count: _ctx.count ?? listCount.value,
|
144
157
|
selection: selectAllValue,
|
145
|
-
"onToggle:selection": _cache[
|
158
|
+
"onToggle:selection": _cache[4] || (_cache[4] = ($event) => $event ? unref(setSelectedReverse)([]) : unref(setSelected)([]))
|
146
159
|
}, {
|
160
|
+
settings: withCtx(() => [
|
161
|
+
createVNode(_sfc_main$4, {
|
162
|
+
fields: _ctx.fields,
|
163
|
+
"fields-config": fieldsConfig.value,
|
164
|
+
"query-params": _ctx.queryParams,
|
165
|
+
"onUpdate:fieldsConfig": _cache[3] || (_cache[3] = ($event) => fieldsConfig.value = { ...fieldsConfig.value, ...$event })
|
166
|
+
}, null, 8, ["fields", "fields-config", "query-params"])
|
167
|
+
]),
|
147
168
|
default: withCtx(() => [
|
148
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
149
|
-
return openBlock(),
|
150
|
-
field.
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
}, null, 8, ["title", "field", "class", "ordering", "disabled", "allow-resize", "style", "onUpdate:width"])) : createCommentVNode("", true)
|
163
|
-
], 64);
|
169
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(fieldsFiltered.value, (field) => {
|
170
|
+
return openBlock(), createBlock(_sfc_main$5, {
|
171
|
+
key: field.label,
|
172
|
+
title: typeof field.title === "string" ? field.title : field.title(_ctx.queryParams),
|
173
|
+
field: typeof field.field === "string" ? field.field : field.field?.(_ctx.queryParams),
|
174
|
+
class: normalizeClass(field.cssClass),
|
175
|
+
ordering: ordering.value,
|
176
|
+
disabled: !field.field,
|
177
|
+
"allow-resize": field.allowResize,
|
178
|
+
style: normalizeStyle({
|
179
|
+
minWidth: !unref(isMobile) && fieldsConfig.value[field.label]?.width ? fieldsConfig.value[field.label].width + "px" : void 0
|
180
|
+
}),
|
181
|
+
"onUpdate:width": ($event) => fieldsConfig.value[field.label].width = $event
|
182
|
+
}, null, 8, ["title", "field", "class", "ordering", "disabled", "allow-resize", "style", "onUpdate:width"]);
|
164
183
|
}), 128))
|
165
184
|
]),
|
166
185
|
_: 2
|
167
186
|
}, 1032, ["query-params", "allow-select", "tooltip-text", "count", "selection"])) : createCommentVNode("", true)
|
168
187
|
]),
|
169
188
|
default: withCtx(({ item, skeleton, setter, refetch }) => [
|
170
|
-
createVNode(_sfc_main$
|
189
|
+
createVNode(_sfc_main$6, {
|
171
190
|
disabled: skeleton,
|
172
191
|
mobile: unref(isMobile),
|
173
192
|
"card-class": _ctx.cardClass,
|
@@ -176,31 +195,29 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
176
195
|
"allow-open": _ctx.fields.some((item2) => item2.allowOpen) && !skeleton
|
177
196
|
}, createSlots({
|
178
197
|
default: withCtx(({ toggle, isOpen }) => [
|
179
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
180
|
-
return openBlock(),
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
}, null, 40, ["item", "readonly", "skeleton", "mobile", "class", "style", "onUpdate:item", "onDelete:item", "onClick"])) : createCommentVNode("", true)
|
203
|
-
], 64);
|
198
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(fieldsFiltered.value, (field) => {
|
199
|
+
return openBlock(), createBlock(resolveDynamicComponent(field.component), {
|
200
|
+
key: field.label,
|
201
|
+
item,
|
202
|
+
readonly: _ctx.readonlyGetter?.(item),
|
203
|
+
skeleton,
|
204
|
+
mobile: unref(isMobile),
|
205
|
+
class: normalizeClass({
|
206
|
+
[field.cssClass ?? ""]: true,
|
207
|
+
"cursor-pointer w-ripple w-ripple-hover w-ripple-has w-ripple-opacity-[0.04]": field.allowOpen && !skeleton,
|
208
|
+
"sm:border-y border-gray-300 dark:border-gray-700": _ctx.hasBorder,
|
209
|
+
"sm:border-b-[transparent] sm:dark:border-b-[transparent]": _ctx.hasBorder && isOpen
|
210
|
+
}),
|
211
|
+
style: normalizeStyle({
|
212
|
+
minWidth: !unref(isMobile) && fieldsConfig.value[field.label]?.width ? fieldsConfig.value[field.label].width + "px" : void 0
|
213
|
+
}),
|
214
|
+
"onUpdate:item": setter,
|
215
|
+
"onDelete:item": ($event) => {
|
216
|
+
setter();
|
217
|
+
refetch();
|
218
|
+
},
|
219
|
+
onClick: ($event) => field.allowOpen && !skeleton && toggle()
|
220
|
+
}, null, 40, ["item", "readonly", "skeleton", "mobile", "class", "style", "onUpdate:item", "onDelete:item", "onClick"]);
|
204
221
|
}), 128))
|
205
222
|
]),
|
206
223
|
more: withCtx(() => [
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WListCard.vue.d.ts","sourceRoot":"","sources":["../../../src/components/List/WListCard.vue"],"names":[],"mappings":"AAqQA,iBAAS,cAAc;;;;;
|
1
|
+
{"version":3,"file":"WListCard.vue.d.ts","sourceRoot":"","sources":["../../../src/components/List/WListCard.vue"],"names":[],"mappings":"AAqQA,iBAAS,cAAc;;;;;YAwSO,GAAG;sBACN,GAAG;2BACE,GAAG;;;WASrB,OAAO,IAA6B;EAEjD;AA4BD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;eAnZR,OAAO;eACP,OAAO;aACT,OAAO;iBACH,OAAO;eACT,OAAO;gBACN,OAAO;gBACP,MAAM;gBACN,OAAO;;;;;;;eAPR,OAAO;eACP,OAAO;aACT,OAAO;iBACH,OAAO;eACT,OAAO;gBACN,OAAO;gBACP,MAAM;gBACN,OAAO;;;;kFAuZnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
@@ -110,7 +110,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
110
110
|
], 2)) : createCommentVNode("", true),
|
111
111
|
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ toggle, isOpen: isOpen.value }))),
|
112
112
|
createElementVNode("div", {
|
113
|
-
class: normalizeClass(["sm:sticky sm:z-[1] sm:right-inner sm:bg-default sm:dark:bg-default-dark", {
|
113
|
+
class: normalizeClass(["sm:sticky sm:z-[1] sm:right-inner sm:bg-default sm:dark:bg-default-dark sm:ml-auto", {
|
114
114
|
"width-14": !_ctx.hideMore,
|
115
115
|
"width-4": _ctx.hideMore
|
116
116
|
}])
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WListHeader.vue.d.ts","sourceRoot":"","sources":["../../../src/components/List/WListHeader.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WListHeader.vue.d.ts","sourceRoot":"","sources":["../../../src/components/List/WListHeader.vue"],"names":[],"mappings":"AAwFA,iBAAS,cAAc;;yBAwIM,GAAG;0BACF,GAAG;;;WASnB,OAAO,IAA6B;EAEjD;AAYD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;kBAtLL,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;;;kFA0LnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { FieldConfig, ListField } from '../types';
|
2
|
+
declare const _default: <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
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
4
|
+
readonly "onUpdate:fields-config"?: ((value: Record<string, FieldConfig>) => any) | undefined;
|
5
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:fields-config"> & {
|
6
|
+
fields: ListField<Data, QueryParams>[];
|
7
|
+
fieldsConfig: Record<string, FieldConfig>;
|
8
|
+
queryParams: QueryParams;
|
9
|
+
disabled?: boolean;
|
10
|
+
}> & import('vue').PublicProps;
|
11
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
12
|
+
attrs: any;
|
13
|
+
slots: {};
|
14
|
+
emit: (e: "update:fields-config", value: Record<string, FieldConfig>) => void;
|
15
|
+
}>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
16
|
+
[key: string]: any;
|
17
|
+
}> & {
|
18
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
19
|
+
};
|
20
|
+
export default _default;
|
21
|
+
type __VLS_PrettifyLocal<T> = {
|
22
|
+
[K in keyof T]: T[K];
|
23
|
+
} & {};
|
24
|
+
//# sourceMappingURL=HeaderSettings.vue.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"HeaderSettings.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/List/components/HeaderSettings.vue"],"names":[],"mappings":"AA2FA,OAAO,KAAK,EAAC,WAAW,EAAE,SAAS,EAAC,MAAM,UAAU,CAAA;yBAInC,IAAI,SAAS,WAAW,EAAE,WAAW,eACxC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WAiNxD,mBAAmB,CAAC;;;gBA7MpB,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE;sBACxB,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC;qBAC5B,WAAW;mBACb,OAAO;KA0MmE,CAAC,4BAA2B;oBAChG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;cAvMP,sBAAsB,SAAS,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,KAAG,IAAI;;;;YA4M3B,OAAO,CAAC,OAAO,WAAW,CAAC;;AA3NvE,wBA2N4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -0,0 +1,78 @@
|
|
1
|
+
import { defineComponent, ref, openBlock, createBlock, markRaw, unref, withCtx, createElementVNode, createElementBlock, Fragment, renderList, normalizeStyle } from 'vue';
|
2
|
+
import _sfc_main$1 from '../../Button/WButtonMore.vue.js';
|
3
|
+
import IconTableSettings from '../../../assets/icons/sax/IconTableSettings.svg.js';
|
4
|
+
import _sfc_main$2 from './HeaderSettingsItem.vue.js';
|
5
|
+
|
6
|
+
const _hoisted_1 = { class: "p-4" };
|
7
|
+
const _hoisted_2 = { class: "flex flex-col" };
|
8
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
9
|
+
__name: "HeaderSettings",
|
10
|
+
props: {
|
11
|
+
fields: {},
|
12
|
+
fieldsConfig: {},
|
13
|
+
queryParams: {},
|
14
|
+
disabled: { type: Boolean }
|
15
|
+
},
|
16
|
+
emits: ["update:fields-config"],
|
17
|
+
setup(__props, { emit: __emit }) {
|
18
|
+
const props = __props;
|
19
|
+
const emit = __emit;
|
20
|
+
const dragItem = ref(null);
|
21
|
+
const dragItemNewOrder = ref(null);
|
22
|
+
const getOrder = (field) => {
|
23
|
+
if (dragItem.value === null || dragItemNewOrder.value === null) return props.fieldsConfig[field.label].order;
|
24
|
+
if (field.label === dragItem.value) return dragItemNewOrder.value;
|
25
|
+
if (props.fieldsConfig[field.label].order <= dragItemNewOrder.value) return props.fieldsConfig[field.label].order - 1;
|
26
|
+
return props.fieldsConfig[field.label].order;
|
27
|
+
};
|
28
|
+
const dragEnter = (field) => {
|
29
|
+
dragItemNewOrder.value = getOrder(field);
|
30
|
+
};
|
31
|
+
const dragEnd = () => {
|
32
|
+
dragItem.value = null;
|
33
|
+
dragItemNewOrder.value = null;
|
34
|
+
};
|
35
|
+
const drop = () => {
|
36
|
+
const newConfig = props.fields.reduce((result, field) => {
|
37
|
+
result[field.label] = { ...props.fieldsConfig[field.label], order: getOrder(field) };
|
38
|
+
return result;
|
39
|
+
}, {});
|
40
|
+
if (Object.keys(newConfig).some((key) => props.fieldsConfig[key].order !== newConfig[key].order)) emit("update:fields-config", newConfig);
|
41
|
+
dragEnd();
|
42
|
+
};
|
43
|
+
return (_ctx, _cache) => {
|
44
|
+
return openBlock(), createBlock(_sfc_main$1, {
|
45
|
+
icon: markRaw(unref(IconTableSettings)),
|
46
|
+
disabled: _ctx.disabled
|
47
|
+
}, {
|
48
|
+
default: withCtx(() => [
|
49
|
+
createElementVNode("div", _hoisted_1, [
|
50
|
+
createElementVNode("div", _hoisted_2, [
|
51
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.fields, (field) => {
|
52
|
+
return openBlock(), createBlock(_sfc_main$2, {
|
53
|
+
key: field.label,
|
54
|
+
field,
|
55
|
+
"field-config": _ctx.fieldsConfig[field.label],
|
56
|
+
"query-params": _ctx.queryParams,
|
57
|
+
disabled: _ctx.disabled,
|
58
|
+
style: normalizeStyle({
|
59
|
+
order: getOrder(field)
|
60
|
+
}),
|
61
|
+
"onDrag:start": ($event) => dragItem.value = field.label,
|
62
|
+
"onDrag:enter": ($event) => dragEnter(field),
|
63
|
+
"onDrag:end": drop,
|
64
|
+
"onUpdate:fieldsConfig": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:fields-config", $event))
|
65
|
+
}, null, 8, ["field", "field-config", "query-params", "disabled", "style", "onDrag:start", "onDrag:enter"]);
|
66
|
+
}), 128))
|
67
|
+
]),
|
68
|
+
_cache[1] || (_cache[1] = createElementVNode("div", { class: "border-b border-solid border-gray-200 dark:border-gray-700 my-4" }, null, -1)),
|
69
|
+
_cache[2] || (_cache[2] = createElementVNode("button", { class: "relative py-1 px-2 rounded-lg w-ripple w-ripple-hover bg-gray-100 dark:bg-gray-800" }, " Reset ", -1))
|
70
|
+
])
|
71
|
+
]),
|
72
|
+
_: 1
|
73
|
+
}, 8, ["icon", "disabled"]);
|
74
|
+
};
|
75
|
+
}
|
76
|
+
});
|
77
|
+
|
78
|
+
export { _sfc_main as default };
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { FieldConfig, ListField } from '../types';
|
2
|
+
declare const _default: <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
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
4
|
+
readonly "onUpdate:fields-config"?: ((value: Record<string, FieldConfig>) => any) | undefined;
|
5
|
+
readonly "onDrag:start"?: (() => any) | undefined;
|
6
|
+
readonly "onDrag:enter"?: (() => any) | undefined;
|
7
|
+
readonly "onDrag:end"?: (() => any) | undefined;
|
8
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:fields-config" | "onDrag:start" | "onDrag:enter" | "onDrag:end"> & {
|
9
|
+
field: ListField<Data, QueryParams>;
|
10
|
+
fieldConfig: FieldConfig;
|
11
|
+
queryParams: QueryParams;
|
12
|
+
disabled?: boolean;
|
13
|
+
}> & import('vue').PublicProps;
|
14
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
15
|
+
attrs: any;
|
16
|
+
slots: {};
|
17
|
+
emit: {
|
18
|
+
(e: "update:fields-config", value: Record<string, FieldConfig>): void;
|
19
|
+
(e: "drag:start"): void;
|
20
|
+
(e: "drag:enter"): void;
|
21
|
+
(e: "drag:end"): void;
|
22
|
+
};
|
23
|
+
}>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
24
|
+
[key: string]: any;
|
25
|
+
}> & {
|
26
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
27
|
+
};
|
28
|
+
export default _default;
|
29
|
+
type __VLS_PrettifyLocal<T> = {
|
30
|
+
[K in keyof T]: T[K];
|
31
|
+
} & {};
|
32
|
+
//# sourceMappingURL=HeaderSettingsItem.vue.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"HeaderSettingsItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/List/components/HeaderSettingsItem.vue"],"names":[],"mappings":"AAiFA,OAAO,KAAK,EAAC,WAAW,EAAE,SAAS,EAAC,MAAM,UAAU,CAAA;yBAKnC,IAAI,SAAS,WAAW,EAAE,WAAW,eACxC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WA0JxD,mBAAmB,CAAC;;;;;;eAtJrB,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC;qBACtB,WAAW;qBACX,WAAW;mBACb,OAAO;KAmJmE,CAAC,4BAA2B;oBAChG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;;YAhJP,sBAAsB,SAAS,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,IAAI;YACjE,YAAY,GAAG,IAAI;YACnB,YAAY,GAAG,IAAI;YACnB,UAAU,GAAG,IAAI;;;;;YAkJqB,OAAO,CAAC,OAAO,WAAW,CAAC;;AApKvE,wBAoK4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -0,0 +1,64 @@
|
|
1
|
+
import { defineComponent, ref, openBlock, createElementBlock, normalizeClass, withModifiers, createElementVNode, createVNode, unref, toDisplayString, createBlock, resolveDynamicComponent } from 'vue';
|
2
|
+
import IconDrag from '../../../assets/icons/sax/IconDrag.svg.js';
|
3
|
+
import IconEye from '../../../assets/icons/sax/IconEye.svg.js';
|
4
|
+
import IconEyeSlash from '../../../assets/icons/sax/IconEyeSlash.svg.js';
|
5
|
+
|
6
|
+
const _hoisted_1 = ["draggable"];
|
7
|
+
const _hoisted_2 = { class: "px-2 py-1 self-center font-semibold" };
|
8
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
9
|
+
__name: "HeaderSettingsItem",
|
10
|
+
props: {
|
11
|
+
field: {},
|
12
|
+
fieldConfig: {},
|
13
|
+
queryParams: {},
|
14
|
+
disabled: { type: Boolean }
|
15
|
+
},
|
16
|
+
emits: ["update:fields-config", "drag:start", "drag:enter", "drag:end"],
|
17
|
+
setup(__props, { emit: __emit }) {
|
18
|
+
const emit = __emit;
|
19
|
+
const isDraggable = ref(false);
|
20
|
+
const isDragging = ref(false);
|
21
|
+
const initDrag = () => {
|
22
|
+
isDraggable.value = true;
|
23
|
+
};
|
24
|
+
const startDrag = () => {
|
25
|
+
isDragging.value = true;
|
26
|
+
emit("drag:start");
|
27
|
+
};
|
28
|
+
const endDrag = () => {
|
29
|
+
isDraggable.value = false;
|
30
|
+
isDragging.value = false;
|
31
|
+
emit("drag:end");
|
32
|
+
};
|
33
|
+
return (_ctx, _cache) => {
|
34
|
+
return openBlock(), createElementBlock("div", {
|
35
|
+
draggable: isDraggable.value,
|
36
|
+
class: normalizeClass(["grid grid-cols-[auto,1fr,auto] text-description select-none bg-default dark:bg-default-dark", {
|
37
|
+
"opacity-[0.001]": isDragging.value,
|
38
|
+
"opacity-50": !_ctx.fieldConfig.visible && !isDragging.value
|
39
|
+
}]),
|
40
|
+
onDragstart: startDrag,
|
41
|
+
onDragend: endDrag,
|
42
|
+
onDragenter: _cache[1] || (_cache[1] = ($event) => !isDraggable.value && _ctx.$emit("drag:enter")),
|
43
|
+
onDragover: _cache[2] || (_cache[2] = withModifiers(() => {
|
44
|
+
}, ["stop", "prevent"]))
|
45
|
+
}, [
|
46
|
+
createElementVNode("button", {
|
47
|
+
class: "relative w-ripple w-ripple-hover px-2 flex items-center",
|
48
|
+
onMousedown: initDrag
|
49
|
+
}, [
|
50
|
+
createVNode(unref(IconDrag), { class: "rotate-90" })
|
51
|
+
], 32),
|
52
|
+
createElementVNode("div", _hoisted_2, toDisplayString(typeof _ctx.field.title === "string" ? _ctx.field.title : _ctx.field.title(_ctx.queryParams)), 1),
|
53
|
+
createElementVNode("button", {
|
54
|
+
class: "relative w-ripple w-ripple-hover px-2 flex items-center",
|
55
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:fields-config", { [_ctx.field.label]: { ..._ctx.fieldConfig, visible: !_ctx.fieldConfig.visible } }))
|
56
|
+
}, [
|
57
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.fieldConfig.visible ? unref(IconEye) : unref(IconEyeSlash)), { class: "pointer-events-none" }))
|
58
|
+
])
|
59
|
+
], 42, _hoisted_1);
|
60
|
+
};
|
61
|
+
}
|
62
|
+
});
|
63
|
+
|
64
|
+
export { _sfc_main as default };
|
@@ -8,6 +8,7 @@ export type FieldComponent<Data> = Component<{
|
|
8
8
|
export type ListField<Data, QueryParams = unknown> = {
|
9
9
|
component: Raw<FieldComponent<Data>>;
|
10
10
|
title: string | ((params: QueryParams) => string);
|
11
|
+
label: string;
|
11
12
|
cssClass?: string;
|
12
13
|
field?: Extract<keyof Data, string> | ((params: QueryParams) => Extract<keyof Data, string>);
|
13
14
|
visibleGetter?: (params: QueryParams) => boolean;
|
@@ -23,4 +24,9 @@ export type BulkComponent<QueryParams> = Component<{
|
|
23
24
|
selectionCount: number;
|
24
25
|
disableMessage?: string;
|
25
26
|
}>;
|
27
|
+
export type FieldConfig = {
|
28
|
+
width: number;
|
29
|
+
visible: boolean;
|
30
|
+
order: number;
|
31
|
+
};
|
26
32
|
//# sourceMappingURL=types.d.ts.map
|
@@ -1 +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;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC,CAAA;AAEF,MAAM,MAAM,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,IAAI;IACnD,SAAS,EAAE,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAA;IACpC,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,WAAW,KAAK,MAAM,CAAC,CAAA;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,IAAI,EAAE,MAAM,CAAC,CAAC,CAAA;IAC5F,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAA;IAChD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,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"}
|
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;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC,CAAA;AAEF,MAAM,MAAM,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,IAAI;IACnD,SAAS,EAAE,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAA;IACpC,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,WAAW,KAAK,MAAM,CAAC,CAAA;IACjD,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,IAAI,EAAE,MAAM,CAAC,CAAC,CAAA;IAC5F,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAA;IAChD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,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;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd,CAAA"}
|