eco-vue-js 0.8.18 → 0.8.20
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/icons/sax/IconDrag.svg.js +24 -0
- package/dist/components/Button/WButtonSelection.vue.d.ts.map +1 -1
- package/dist/components/Button/WButtonSelection.vue.js +1 -1
- package/dist/components/Expansion/WExpansion.vue.d.ts +6 -2
- package/dist/components/Expansion/WExpansion.vue.d.ts.map +1 -1
- package/dist/components/Expansion/WExpansion.vue.js +4 -1
- package/dist/components/FormAsync/WFormAsyncInput.vue.js +1 -0
- package/dist/components/FormAsync/WFormAsyncSelect.vue.js +1 -0
- package/dist/components/FormAsync/WFormAsyncSelectInfiniteSingle.vue.js +1 -0
- package/dist/components/FormAsync/WFormAsyncSelectSingle.vue.js +1 -0
- package/dist/components/FormAsync/WFormAsyncSelectStringified.vue.js +1 -0
- package/dist/components/InfiniteList/components/InfiniteListPage.vue.js +6 -6
- package/dist/components/Input/WInput.vue.js +7 -6
- package/dist/components/Input/WInputAsync.vue.js +1 -0
- package/dist/components/Input/WInputDate.vue.js +1 -0
- package/dist/components/Input/WInputOptions.vue.js +1 -0
- package/dist/components/Input/WInputSuggest.vue.js +2 -1
- package/dist/components/Input/types.d.ts +1 -0
- package/dist/components/Input/types.d.ts.map +1 -1
- package/dist/components/List/WList.vue.d.ts +5 -1
- package/dist/components/List/WList.vue.d.ts.map +1 -1
- package/dist/components/List/WList.vue.js +91 -31
- package/dist/components/List/WListCard.vue.d.ts +9 -1
- package/dist/components/List/WListCard.vue.d.ts.map +1 -1
- package/dist/components/List/WListCard.vue.js +114 -52
- package/dist/components/List/WListCardField.vue.d.ts.map +1 -1
- package/dist/components/List/WListCardField.vue.js +21 -25
- package/dist/components/List/WListHeader.vue.d.ts.map +1 -1
- package/dist/components/List/WListHeader.vue.js +36 -23
- package/dist/components/List/WListHeaderItem.vue.d.ts +5 -2
- package/dist/components/List/WListHeaderItem.vue.d.ts.map +1 -1
- package/dist/components/List/WListHeaderItem.vue.js +52 -37
- package/dist/components/List/components/HeaderItemResizer.vue.d.ts +20 -0
- package/dist/components/List/components/HeaderItemResizer.vue.d.ts.map +1 -0
- package/dist/components/List/components/HeaderItemResizer.vue.js +66 -0
- package/dist/components/List/components/HeaderItemResizer.vue2.js +5 -0
- package/dist/components/List/types.d.ts +6 -2
- package/dist/components/List/types.d.ts.map +1 -1
- package/dist/components/Select/WSelect.vue.js +1 -0
- package/dist/components/Select/WSelectAsync.vue.js +1 -0
- package/dist/components/Select/WSelectAsyncSingle.vue.js +1 -0
- package/dist/components/Select/WSelectSingle.vue.js +1 -0
- package/dist/components/Select/WSelectStringified.vue.js +1 -0
- package/package.json +1 -1
- package/tailwind-base/plugins/default.cjs +35 -34
@@ -1,4 +1,4 @@
|
|
1
|
-
import { defineComponent, inject, watch, openBlock, createElementBlock, createVNode, Transition, withCtx, unref, createCommentVNode, createBlock,
|
1
|
+
import { defineComponent, ref, inject, watch, openBlock, createElementBlock, Fragment, createElementVNode, normalizeClass, createVNode, Transition, withCtx, unref, createCommentVNode, createBlock, renderSlot, normalizeProps, guardReactiveProps, markRaw } from 'vue';
|
2
2
|
import _sfc_main$1 from '../Checkbox/WCheckbox.vue.js';
|
3
3
|
import _sfc_main$2 from '../Button/WButtonMore.vue.js';
|
4
4
|
import _sfc_main$3 from '../Button/WButtonMoreItem.vue.js';
|
@@ -6,11 +6,14 @@ import IconAddCircle from '../../assets/icons/sax/IconAddCircle.svg.js';
|
|
6
6
|
import IconMinusCircle from '../../assets/icons/sax/IconMinusCircle.svg.js';
|
7
7
|
import { wInfiniteListSelection, wInfiniteListSelectionItem } from '../InfiniteList/models/injection.js';
|
8
8
|
|
9
|
-
const _hoisted_1 = {
|
10
|
-
const _hoisted_2 = {
|
9
|
+
const _hoisted_1 = {
|
11
10
|
key: 0,
|
12
11
|
class: "bg-primary-default dark:bg-primary-dark w-2 h-full hidden sm-not:block absolute left-0 top-0"
|
13
12
|
};
|
13
|
+
const _hoisted_2 = {
|
14
|
+
key: 0,
|
15
|
+
class: "absolute top-0 -z-[1] left-full h-full w-[calc(var(--actions-bar-width)+var(--inner-margin))] bg-default dark:bg-default-dark sm-not:hidden"
|
16
|
+
};
|
14
17
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
15
18
|
__name: "WListCard",
|
16
19
|
props: {
|
@@ -18,11 +21,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
18
21
|
hideMore: { type: Boolean },
|
19
22
|
mobile: { type: Boolean },
|
20
23
|
moreBottom: { type: Boolean },
|
21
|
-
alignTop: { type: Boolean }
|
24
|
+
alignTop: { type: Boolean },
|
25
|
+
hasBorder: { type: Boolean },
|
26
|
+
cardClass: {},
|
27
|
+
allowOpen: { type: Boolean }
|
22
28
|
},
|
23
29
|
emits: ["update:selected", "update:selected-hover"],
|
24
30
|
setup(__props, { expose: __expose, emit: __emit }) {
|
25
31
|
const emit = __emit;
|
32
|
+
const isOpen = ref(false);
|
33
|
+
const toggle = () => {
|
34
|
+
isOpen.value = !isOpen.value;
|
35
|
+
};
|
26
36
|
const {
|
27
37
|
allowSelect,
|
28
38
|
allowSelectRange,
|
@@ -49,54 +59,106 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
49
59
|
updateSelected
|
50
60
|
});
|
51
61
|
return (_ctx, _cache) => {
|
52
|
-
return openBlock(), createElementBlock(
|
53
|
-
|
54
|
-
"
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
},
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
62
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
63
|
+
createElementVNode("div", {
|
64
|
+
class: normalizeClass(["relative w-full grid sm:flex isolate sm:mt-4 first:mt-0 sm-not:group-even:bg-gray-50 sm-not:dark:group-even:bg-primary-darkest/25 sm-not:pt-2 sm-not:-px--inner-margin", {
|
65
|
+
[_ctx.cardClass ?? ""]: true,
|
66
|
+
"w-ripple-trigger-has": _ctx.allowOpen
|
67
|
+
}])
|
68
|
+
}, [
|
69
|
+
createVNode(Transition, {
|
70
|
+
"enter-active-class": "transition-transform duration-200",
|
71
|
+
"leave-active-class": "transition-transform duration-200",
|
72
|
+
"enter-from-class": "-translate-x-2",
|
73
|
+
"leave-to-class": "-translate-x-2"
|
74
|
+
}, {
|
75
|
+
default: withCtx(() => [
|
76
|
+
_ctx.mobile && unref(selected) ? (openBlock(), createElementBlock("div", _hoisted_1)) : createCommentVNode("", true)
|
77
|
+
]),
|
78
|
+
_: 1
|
79
|
+
}),
|
80
|
+
!_ctx.mobile ? (openBlock(), createElementBlock("div", {
|
81
|
+
key: 0,
|
82
|
+
class: normalizeClass(["sticky z-[1] left-inner sm-not:hidden bg-default dark:bg-default-dark", {
|
83
|
+
"width-16": unref(allowSelect),
|
84
|
+
"width-4": !unref(allowSelect)
|
85
|
+
}])
|
86
|
+
}, [
|
87
|
+
_cache[4] || (_cache[4] = createElementVNode("div", { class: "absolute top-0 -z-[1] right-full h-full w-[calc(var(--nav-bar-width)+var(--inner-margin))] bg-default dark:bg-default-dark" }, null, -1)),
|
88
|
+
createElementVNode("div", {
|
89
|
+
class: normalizeClass(["h-full", {
|
90
|
+
"sm:border sm:border-r-0 border-gray-300 dark:border-gray-700 sm:rounded-tl-3xl": _ctx.hasBorder,
|
91
|
+
"sm:rounded-bl-3xl": _ctx.hasBorder && !isOpen.value,
|
92
|
+
"sm:border-b-[transparent] sm:dark:border-b-[transparent]": _ctx.hasBorder && isOpen.value,
|
93
|
+
"w-ripple-has-only w-ripple-hover w-ripple-opacity-[0.04]": _ctx.allowOpen
|
94
|
+
}])
|
95
|
+
}, [
|
96
|
+
unref(allowSelect) ? (openBlock(), createBlock(_sfc_main$1, {
|
97
|
+
key: 0,
|
98
|
+
"model-value": unref(selectedBetween) ? null : unref(selected) ?? false,
|
99
|
+
disabled: _ctx.disabled,
|
100
|
+
"allow-shift": unref(allowSelectRange),
|
101
|
+
"align-top": _ctx.alignTop,
|
102
|
+
class: normalizeClass(["px-4 h-full", {
|
103
|
+
"opacity-50": unref(allowSelectHover)
|
104
|
+
}]),
|
105
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(allowSelectHover) ? unref(updateSelectedRange)?.() : unref(updateSelected)?.($event)),
|
106
|
+
"onUpdateShift:modelValue": _cache[1] || (_cache[1] = ($event) => unref(updateSelectedRange)?.()),
|
107
|
+
onMouseover: _cache[2] || (_cache[2] = ($event) => unref(allowSelectHover) ? unref(updateSelectedRangeHover)?.() : void 0)
|
108
|
+
}, null, 8, ["model-value", "disabled", "allow-shift", "align-top", "class"])) : createCommentVNode("", true)
|
109
|
+
], 2)
|
110
|
+
], 2)) : createCommentVNode("", true),
|
111
|
+
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ toggle, isOpen: isOpen.value }))),
|
112
|
+
createElementVNode("div", {
|
113
|
+
class: normalizeClass(["sm:sticky sm:z-[1] sm:right-inner sm:bg-default sm:dark:bg-default-dark", {
|
114
|
+
"width-14": !_ctx.hideMore,
|
115
|
+
"width-4": _ctx.hideMore
|
116
|
+
}])
|
117
|
+
}, [
|
118
|
+
!_ctx.mobile ? (openBlock(), createElementBlock("div", _hoisted_2)) : createCommentVNode("", true),
|
119
|
+
createElementVNode("div", {
|
120
|
+
class: normalizeClass(["h-full", {
|
121
|
+
"sm:border sm:border-l-0 border-gray-300 dark:border-gray-700 sm:rounded-tr-3xl": _ctx.hasBorder,
|
122
|
+
"sm:rounded-br-3xl": _ctx.hasBorder && !isOpen.value,
|
123
|
+
"sm:border-b-[transparent] sm:dark:border-b-[transparent]": _ctx.hasBorder && isOpen.value,
|
124
|
+
"w-ripple-has-only w-ripple-hover w-ripple-opacity-[0.04]": _ctx.allowOpen
|
125
|
+
}])
|
126
|
+
}, [
|
127
|
+
!_ctx.hideMore ? (openBlock(), createBlock(_sfc_main$2, {
|
128
|
+
key: 0,
|
129
|
+
class: normalizeClass(["sm-not:absolute sm-not:right-0 sm-not:bottom-0 flex px-4 sm:h-full", {
|
130
|
+
"sm-not:top-5": !_ctx.moreBottom,
|
131
|
+
"sm-not:top-10": _ctx.moreBottom,
|
132
|
+
"items-start pt-2": _ctx.alignTop,
|
133
|
+
"items-center": !_ctx.alignTop
|
134
|
+
}]),
|
135
|
+
disabled: _ctx.disabled
|
136
|
+
}, {
|
137
|
+
default: withCtx(() => [
|
138
|
+
unref(allowSelect) && _ctx.mobile ? (openBlock(), createBlock(_sfc_main$3, {
|
139
|
+
key: 0,
|
140
|
+
text: unref(selected) ? "Unselect" : "Select",
|
141
|
+
icon: unref(selected) ? markRaw(unref(IconMinusCircle)) : markRaw(unref(IconAddCircle)),
|
142
|
+
onClick: _cache[3] || (_cache[3] = ($event) => unref(updateSelected)?.(!unref(selected)))
|
143
|
+
}, null, 8, ["text", "icon"])) : createCommentVNode("", true),
|
144
|
+
renderSlot(_ctx.$slots, "more")
|
145
|
+
]),
|
146
|
+
_: 3
|
147
|
+
}, 8, ["class", "disabled"])) : createCommentVNode("", true)
|
148
|
+
], 2)
|
149
|
+
], 2)
|
150
|
+
], 2),
|
151
|
+
_ctx.$slots.expansion ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
152
|
+
isOpen.value ? (openBlock(), createElementBlock("div", {
|
153
|
+
key: 0,
|
154
|
+
class: normalizeClass(["sm:sticky sm:w-inner sm:left-inner", {
|
155
|
+
"sm:px-5 sm:border sm:border-t-0 border-gray-300 dark:border-gray-700 sm:rounded-b-3xl": _ctx.hasBorder
|
156
|
+
}])
|
157
|
+
}, [
|
158
|
+
renderSlot(_ctx.$slots, "expansion")
|
159
|
+
], 2)) : createCommentVNode("", true)
|
160
|
+
], 64)) : createCommentVNode("", true)
|
161
|
+
], 64);
|
100
162
|
};
|
101
163
|
}
|
102
164
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WListCardField.vue.d.ts","sourceRoot":"","sources":["../../../src/components/List/WListCardField.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WListCardField.vue.d.ts","sourceRoot":"","sources":["../../../src/components/List/WListCardField.vue"],"names":[],"mappings":"AAuDA,iBAAS,cAAc;;yBA8DM,GAAG;uBACL,GAAG;uBACF,GAAG;;;WASjB,OAAO,IAA6B;EAEjD;AAUD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;iBAhGN,MAAM,GAAG,MAAM;eACjB,OAAO;;iBADL,MAAM,GAAG,MAAM;eACjB,OAAO;iGAqGlB,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,11 +1,10 @@
|
|
1
|
-
import { defineComponent, openBlock, createElementBlock,
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createBlock, renderSlot, createElementVNode, createTextVNode, toDisplayString, createVNode, withCtx } from 'vue';
|
2
2
|
import WSkeleton from '../Skeleton/WSkeleton.vue.js';
|
3
3
|
import _sfc_main$1 from '../Tooltip/WTooltip.vue.js';
|
4
4
|
|
5
|
-
const _hoisted_1 = { class: "
|
6
|
-
const _hoisted_2 = { class: "
|
7
|
-
const _hoisted_3 = { class: "
|
8
|
-
const _hoisted_4 = { class: "min-w-[12rem] max-w-xl overflow-hidden" };
|
5
|
+
const _hoisted_1 = { class: "grid grid-cols-1 items-center sm:h-16 sm:pr-6" };
|
6
|
+
const _hoisted_2 = { class: "truncate" };
|
7
|
+
const _hoisted_3 = { class: "min-w-[12rem] max-w-xl overflow-hidden" };
|
9
8
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
10
9
|
__name: "WListCardField",
|
11
10
|
props: {
|
@@ -15,27 +14,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
14
|
setup(__props) {
|
16
15
|
return (_ctx, _cache) => {
|
17
16
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
renderSlot(_ctx.$slots, "inner", {}, () => [
|
32
|
-
createTextVNode(toDisplayString(_ctx.modelValue), 1)
|
33
|
-
])
|
17
|
+
_ctx.skeleton ? (openBlock(), createBlock(WSkeleton, { key: 0 })) : renderSlot(_ctx.$slots, "default", { key: 1 }, () => [
|
18
|
+
createElementVNode("div", _hoisted_2, [
|
19
|
+
renderSlot(_ctx.$slots, "inner", {}, () => [
|
20
|
+
createTextVNode(toDisplayString(_ctx.modelValue), 1)
|
21
|
+
]),
|
22
|
+
createVNode(_sfc_main$1, {
|
23
|
+
"no-touch": "",
|
24
|
+
"overflow-only": ""
|
25
|
+
}, {
|
26
|
+
default: withCtx(() => [
|
27
|
+
createElementVNode("div", _hoisted_3, [
|
28
|
+
renderSlot(_ctx.$slots, "inner", {}, () => [
|
29
|
+
createTextVNode(toDisplayString(_ctx.modelValue), 1)
|
34
30
|
])
|
35
|
-
])
|
36
|
-
|
37
|
-
|
38
|
-
|
31
|
+
])
|
32
|
+
]),
|
33
|
+
_: 3
|
34
|
+
})
|
39
35
|
])
|
40
36
|
])
|
41
37
|
]);
|
@@ -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":"AAsFA,iBAAS,cAAc;;yBAsIM,GAAG;;;WASlB,OAAO,IAA6B;EAEjD;AAYD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;kBAnLL,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;;;kFAuLnB,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,15 +1,10 @@
|
|
1
|
-
import { defineComponent, openBlock, createElementBlock,
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, createBlock, createCommentVNode, renderSlot } from 'vue';
|
2
2
|
import _sfc_main$1 from '../Checkbox/WCheckbox.vue.js';
|
3
3
|
|
4
|
-
const _hoisted_1 = { class: "flex text-description font-semibold" };
|
5
|
-
const _hoisted_2 = {
|
6
|
-
|
7
|
-
|
8
|
-
};
|
9
|
-
const _hoisted_3 = {
|
10
|
-
key: 1,
|
11
|
-
class: "w-list-header-item width-14"
|
12
|
-
};
|
4
|
+
const _hoisted_1 = { class: "flex text-description font-semibold h-12" };
|
5
|
+
const _hoisted_2 = { class: "sticky z-[1] left-inner bg-default dark:bg-default-dark" };
|
6
|
+
const _hoisted_3 = { class: "bg-primary-light dark:bg-primary-darkest border-y border-solid border-gray-300 dark:border-gray-700 flex flex-1" };
|
7
|
+
const _hoisted_4 = { class: "sticky z-[1] right-inner bg-default dark:bg-default-dark" };
|
13
8
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
14
9
|
__name: "WListHeader",
|
15
10
|
props: {
|
@@ -24,19 +19,37 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
24
19
|
setup(__props) {
|
25
20
|
return (_ctx, _cache) => {
|
26
21
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
22
|
+
createElementVNode("div", _hoisted_2, [
|
23
|
+
_cache[1] || (_cache[1] = createElementVNode("div", { class: "absolute top-0 -z-[1] right-full h-full w-[calc(var(--nav-bar-width)+var(--inner-margin))] bg-default dark:bg-default-dark" }, null, -1)),
|
24
|
+
createElementVNode("div", {
|
25
|
+
class: normalizeClass(["bg-primary-light dark:bg-primary-darkest border-y border-solid border-gray-300 dark:border-gray-700 rounded-l-2xl border-l h-full", {
|
26
|
+
"width-16": _ctx.allowSelect,
|
27
|
+
"width-4": !_ctx.allowSelect
|
28
|
+
}])
|
29
|
+
}, [
|
30
|
+
_ctx.allowSelect && _ctx.selection !== void 0 && _ctx.count !== 0 ? (openBlock(), createBlock(_sfc_main$1, {
|
31
|
+
key: 0,
|
32
|
+
disabled: _ctx.disabled,
|
33
|
+
"model-value": _ctx.selection,
|
34
|
+
"tooltip-text": _ctx.tooltipText,
|
35
|
+
intermediate: "",
|
36
|
+
class: "w-full h-full justify-end pr-6",
|
37
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("toggle:selection", $event))
|
38
|
+
}, null, 8, ["disabled", "model-value", "tooltip-text"])) : createCommentVNode("", true)
|
39
|
+
], 2)
|
40
|
+
]),
|
41
|
+
createElementVNode("div", _hoisted_3, [
|
42
|
+
renderSlot(_ctx.$slots, "default")
|
43
|
+
]),
|
44
|
+
createElementVNode("div", _hoisted_4, [
|
45
|
+
_cache[2] || (_cache[2] = createElementVNode("div", { class: "absolute top-0 -z-[1] left-full h-full w-[calc(var(--actions-bar-width)+var(--inner-margin))] bg-default dark:bg-default-dark" }, null, -1)),
|
46
|
+
createElementVNode("div", {
|
47
|
+
class: normalizeClass(["bg-primary-light dark:bg-primary-darkest border-y border-solid border-gray-300 dark:border-gray-700 rounded-r-2xl border-r h-full", {
|
48
|
+
"width-14": !_ctx.hideMore,
|
49
|
+
"width-4": _ctx.hideMore
|
50
|
+
}])
|
51
|
+
}, null, 2)
|
52
|
+
])
|
40
53
|
]);
|
41
54
|
};
|
42
55
|
}
|
@@ -1,17 +1,20 @@
|
|
1
1
|
import { OrderItem } from '../../utils/order';
|
2
2
|
declare const _default: <Field>(__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<{
|
3
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
4
|
+
readonly "onUpdate:width"?: ((value: number) => any) | undefined;
|
5
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:width"> & {
|
4
6
|
title?: string;
|
5
7
|
field: Field;
|
6
8
|
ordering: OrderItem<Field>[];
|
7
9
|
disabled?: boolean;
|
10
|
+
allowResize?: boolean;
|
8
11
|
}> & import('vue').PublicProps;
|
9
12
|
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
10
13
|
attrs: any;
|
11
14
|
slots: {
|
12
15
|
default?(_: {}): any;
|
13
16
|
};
|
14
|
-
emit:
|
17
|
+
emit: (e: "update:width", value: number) => void;
|
15
18
|
}>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
16
19
|
[key: string]: any;
|
17
20
|
}> & {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WListHeaderItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/List/WListHeaderItem.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WListHeaderItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/List/WListHeaderItem.vue"],"names":[],"mappings":"AAgHA,OAAO,EAAwB,KAAK,SAAS,EAAC,MAAM,eAAe,CAAA;yBAIlD,KAAK,eACR,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;WAmNxD,mBAAmB,CAAC;;;gBA/MpB,MAAM;eACP,KAAK;kBACF,SAAS,CAAC,KAAK,CAAC,EAAE;mBACjB,OAAO;sBACJ,OAAO;KA2MgE,CAAC,4BAA2B;oBAChG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;yBA9BiB,GAAG;;cA1K3B,cAAc,SAAS,MAAM,KAAG,IAAI;;;;YA6ME,OAAO,CAAC,OAAO,WAAW,CAAC;;AA7NvE,wBA6N4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -1,11 +1,12 @@
|
|
1
|
-
import { defineComponent, computed, openBlock,
|
1
|
+
import { defineComponent, computed, openBlock, createBlock, resolveDynamicComponent, withCtx, normalizeClass, createElementVNode, renderSlot, createTextVNode, toDisplayString, Transition, createElementBlock, createVNode, unref, createCommentVNode } from 'vue';
|
2
2
|
import { useRoute, useRouter } from 'vue-router';
|
3
3
|
import IconBack from '../../assets/icons/default/IconBack.svg.js';
|
4
4
|
import { Order, encodeOrdering } from '../../utils/order.js';
|
5
|
+
import _sfc_main$1 from './components/HeaderItemResizer.vue.js';
|
5
6
|
|
6
7
|
const _hoisted_1 = {
|
7
8
|
key: 0,
|
8
|
-
class: "flex gap-1
|
9
|
+
class: "flex gap-1 items-center"
|
9
10
|
};
|
10
11
|
const _hoisted_2 = { key: 0 };
|
11
12
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
@@ -14,8 +15,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
15
|
title: {},
|
15
16
|
field: {},
|
16
17
|
ordering: {},
|
17
|
-
disabled: { type: Boolean }
|
18
|
+
disabled: { type: Boolean },
|
19
|
+
allowResize: { type: Boolean }
|
18
20
|
},
|
21
|
+
emits: ["update:width"],
|
19
22
|
setup(__props) {
|
20
23
|
const props = __props;
|
21
24
|
const route = useRoute();
|
@@ -44,41 +47,53 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
44
47
|
updateQuery(newOrdering);
|
45
48
|
};
|
46
49
|
return (_ctx, _cache) => {
|
47
|
-
return openBlock(),
|
48
|
-
class:
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
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"
|
50
|
+
return openBlock(), createBlock(resolveDynamicComponent(_ctx.allowResize ? _sfc_main$1 : "div"), {
|
51
|
+
class: "select-none text-description pr-6",
|
52
|
+
"onUpdate:width": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:width", $event))
|
53
|
+
}, {
|
54
|
+
default: withCtx(() => [
|
55
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.disabled ? "div" : "button"), {
|
56
|
+
class: normalizeClass(["h-full w-full flex gap-2 group font-semibold items-center", {
|
57
|
+
"cursor-pointer": !_ctx.disabled
|
58
|
+
}]),
|
59
|
+
onClick: setOrdering
|
60
|
+
}, {
|
61
|
+
default: withCtx(() => [
|
62
|
+
createElementVNode("div", {
|
63
|
+
class: normalizeClass(["whitespace-nowrap", {
|
64
|
+
"group-hover:underline": !_ctx.disabled
|
74
65
|
}])
|
75
|
-
},
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
66
|
+
}, [
|
67
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
68
|
+
createTextVNode(toDisplayString(_ctx.title), 1)
|
69
|
+
])
|
70
|
+
], 2),
|
71
|
+
!_ctx.disabled ? (openBlock(), createBlock(Transition, {
|
72
|
+
key: 0,
|
73
|
+
"enter-active-class": "transition-opacity",
|
74
|
+
"leave-active-class": "transition-opacity",
|
75
|
+
"enter-from-class": "opacity-0",
|
76
|
+
"leave-to-class": "opacity-0"
|
77
|
+
}, {
|
78
|
+
default: withCtx(() => [
|
79
|
+
index.value !== -1 ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
80
|
+
createVNode(unref(IconBack), {
|
81
|
+
class: normalizeClass(["square-3 transition-transform", {
|
82
|
+
"rotate-90": _ctx.ordering[index.value]?.order === "ASC",
|
83
|
+
"-rotate-90": _ctx.ordering[index.value]?.order === "DESC"
|
84
|
+
}])
|
85
|
+
}, null, 8, ["class"]),
|
86
|
+
_ctx.ordering.length > 1 ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(index.value + 1), 1)) : createCommentVNode("", true)
|
87
|
+
])) : createCommentVNode("", true)
|
88
|
+
]),
|
89
|
+
_: 1
|
90
|
+
})) : createCommentVNode("", true)
|
91
|
+
]),
|
92
|
+
_: 3
|
93
|
+
}, 8, ["class"]))
|
94
|
+
]),
|
95
|
+
_: 3
|
96
|
+
}, 32);
|
82
97
|
};
|
83
98
|
}
|
84
99
|
});
|
@@ -0,0 +1,20 @@
|
|
1
|
+
declare const _default: <Field>(__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<{
|
2
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
3
|
+
readonly "onUpdate:width"?: ((value: number) => any) | undefined;
|
4
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:width"> & {}> & import('vue').PublicProps;
|
5
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
6
|
+
attrs: any;
|
7
|
+
slots: {
|
8
|
+
default?(_: {}): any;
|
9
|
+
};
|
10
|
+
emit: (e: "update:width", value: number) => void;
|
11
|
+
}>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
12
|
+
[key: string]: any;
|
13
|
+
}> & {
|
14
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
15
|
+
};
|
16
|
+
export default _default;
|
17
|
+
type __VLS_PrettifyLocal<T> = {
|
18
|
+
[K in keyof T]: T[K];
|
19
|
+
} & {};
|
20
|
+
//# sourceMappingURL=HeaderItemResizer.vue.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"HeaderItemResizer.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/List/components/HeaderItemResizer.vue"],"names":[],"mappings":"yBAmFiB,KAAK,eACR,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;WAwIxD,mBAAmB,CAAC;;2IAAyD,CAAC,4BAA2B;oBAChG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;yBA7BgB,GAAG;;cAzG1B,cAAc,SAAS,MAAM,KAAG,IAAI;;;;YA2IE,OAAO,CAAC,OAAO,WAAW,CAAC;;AAlJvE,wBAkJ4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import { defineComponent, useTemplateRef, onMounted, onBeforeUnmount, openBlock, createElementBlock, renderSlot, createElementVNode, withModifiers, createVNode, unref } from 'vue';
|
2
|
+
import IconDrag from '../../../assets/icons/sax/IconDrag.svg.js';
|
3
|
+
import DOMListenerContainer from '../../../utils/DOMListenerContainer.js';
|
4
|
+
|
5
|
+
const _hoisted_1 = {
|
6
|
+
ref: "element",
|
7
|
+
class: "relative"
|
8
|
+
};
|
9
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
10
|
+
__name: "HeaderItemResizer",
|
11
|
+
emits: ["update:width"],
|
12
|
+
setup(__props, { emit: __emit }) {
|
13
|
+
const emit = __emit;
|
14
|
+
const listenerContainer = new DOMListenerContainer();
|
15
|
+
const elementRef = useTemplateRef("element");
|
16
|
+
let started = null;
|
17
|
+
let widthSaved = null;
|
18
|
+
const startDrag = (clickEvent) => {
|
19
|
+
if (!elementRef.value) return;
|
20
|
+
started = clickEvent.clientX;
|
21
|
+
widthSaved = elementRef.value.offsetWidth;
|
22
|
+
listenerContainer.addEventListener(document, "mousemove", (event) => {
|
23
|
+
if (started === null || widthSaved === null || !(event instanceof MouseEvent)) {
|
24
|
+
endDrag();
|
25
|
+
return;
|
26
|
+
}
|
27
|
+
emit("update:width", widthSaved + event.clientX - started);
|
28
|
+
});
|
29
|
+
listenerContainer.addEventListener(document, "mouseup", (event) => {
|
30
|
+
event.stopPropagation();
|
31
|
+
event.preventDefault();
|
32
|
+
endDrag();
|
33
|
+
});
|
34
|
+
};
|
35
|
+
const endDrag = () => {
|
36
|
+
listenerContainer.destroy();
|
37
|
+
started = null;
|
38
|
+
widthSaved = null;
|
39
|
+
};
|
40
|
+
onMounted(() => {
|
41
|
+
setTimeout(() => {
|
42
|
+
if (!elementRef.value) return;
|
43
|
+
emit("update:width", elementRef.value.offsetWidth);
|
44
|
+
}, 1e3);
|
45
|
+
});
|
46
|
+
onBeforeUnmount(() => {
|
47
|
+
listenerContainer.destroy();
|
48
|
+
});
|
49
|
+
return (_ctx, _cache) => {
|
50
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
51
|
+
renderSlot(_ctx.$slots, "default"),
|
52
|
+
createElementVNode("button", {
|
53
|
+
class: "absolute top-0 right-1 h-full w-6 flex items-center opacity-50 hover:opacity-100 cursor-col-resize",
|
54
|
+
onMousedown: withModifiers(startDrag, ["stop", "prevent"]),
|
55
|
+
onMouseup: withModifiers(endDrag, ["stop", "prevent"]),
|
56
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(() => {
|
57
|
+
}, ["stop", "prevent"]))
|
58
|
+
}, [
|
59
|
+
createVNode(unref(IconDrag))
|
60
|
+
], 32)
|
61
|
+
], 512);
|
62
|
+
};
|
63
|
+
}
|
64
|
+
});
|
65
|
+
|
66
|
+
export { _sfc_main as default };
|
@@ -3,12 +3,16 @@ export type FieldComponent<Data> = Component<{
|
|
3
3
|
item: Data;
|
4
4
|
skeleton?: boolean;
|
5
5
|
readonly?: boolean;
|
6
|
+
mobile?: boolean;
|
6
7
|
}>;
|
7
8
|
export type ListField<Data, QueryParams = unknown> = {
|
8
9
|
component: Raw<FieldComponent<Data>>;
|
9
|
-
title: string | ((
|
10
|
+
title: string | ((params: QueryParams) => string);
|
10
11
|
cssClass?: string;
|
11
|
-
field?: keyof Data;
|
12
|
+
field?: Extract<keyof Data, string> | ((params: QueryParams) => Extract<keyof Data, string>);
|
13
|
+
visibleGetter?: (params: QueryParams) => boolean;
|
14
|
+
allowOpen?: boolean;
|
15
|
+
allowResize?: boolean;
|
12
16
|
};
|
13
17
|
export type MenuComponent<Data> = Component<{
|
14
18
|
item: Data;
|
@@ -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;
|
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"}
|