edvoyui-component-library-test-flight 0.0.138 → 0.0.140
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/assets/.DS_Store +0 -0
- package/src/assets/fonts/.DS_Store +0 -0
- package/src/assets/images/.DS_Store +0 -0
- package/src/components/HelloWorld.vue +1 -1
- package/src/components/dragModal/EUIDrag.vue +179 -0
- package/src/components/index.ts +2 -1
- package/src/components/table/UTable.vue +20 -4
- package/src/components/tabs/EUITabs.vue +14 -2
- package/src/data/table.ts +2 -0
package/package.json
CHANGED
package/src/.DS_Store
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="isVisible"
|
|
4
|
+
ref="containerRef"
|
|
5
|
+
class="draggable-card"
|
|
6
|
+
:style="containerStyle"
|
|
7
|
+
>
|
|
8
|
+
<!-- HEADER / DRAG HANDLE -->
|
|
9
|
+
<div
|
|
10
|
+
class="flex items-center justify-between flex-shrink-0 px-2 bg-white cursor-grab"
|
|
11
|
+
@mousedown.prevent="startDrag"
|
|
12
|
+
@touchstart.prevent="startDrag"
|
|
13
|
+
>
|
|
14
|
+
<div class="flex items-center gap-4">
|
|
15
|
+
<EUIAvatar
|
|
16
|
+
image-url="https://tinyurl.com/43e5fxh9"
|
|
17
|
+
:profile="true"
|
|
18
|
+
full-name="JohnCena"
|
|
19
|
+
:show-status="true"
|
|
20
|
+
status="Online"
|
|
21
|
+
size="sm"
|
|
22
|
+
>
|
|
23
|
+
<template #name>John Cena</template>
|
|
24
|
+
<template #designation>Actor</template>
|
|
25
|
+
</EUIAvatar>
|
|
26
|
+
</div>
|
|
27
|
+
<EUIButton
|
|
28
|
+
color="white"
|
|
29
|
+
size="xs"
|
|
30
|
+
rounded
|
|
31
|
+
icon-type="icon"
|
|
32
|
+
:icon="ChevronBigDown"
|
|
33
|
+
:class="minimized ? 'rotate-0' : '-rotate-90'"
|
|
34
|
+
@click="onToggle"
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<!-- BODY -->
|
|
39
|
+
<transition name="slide-fade">
|
|
40
|
+
<div
|
|
41
|
+
v-if="minimized"
|
|
42
|
+
class="px-4 py-3 mt-4 overflow-y-auto border border-gray-100 border-solid rounded-lg bg-gray-50"
|
|
43
|
+
>
|
|
44
|
+
<h3 class="mb-2 text-lg font-semibold text-gray-900">
|
|
45
|
+
Card Title Here....
|
|
46
|
+
</h3>
|
|
47
|
+
<p class="mb-4 text-sm text-gray-500">
|
|
48
|
+
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Corporis non
|
|
49
|
+
velit doloremque sint repellat beatae accusamus? Recusandae possimus
|
|
50
|
+
voluptas beatae, labore dolor dolorem necessitatibus architecto
|
|
51
|
+
laudantium deserunt ipsam autem. Dignissimos?
|
|
52
|
+
</p>
|
|
53
|
+
|
|
54
|
+
<p class="text-sm text-gray-500">
|
|
55
|
+
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Dicta minima
|
|
56
|
+
ullam porro voluptate ea, amet accusamus et debitis.
|
|
57
|
+
</p>
|
|
58
|
+
|
|
59
|
+
<div class="mt-4 text-right">
|
|
60
|
+
<EUIButton
|
|
61
|
+
color="primary"
|
|
62
|
+
size="sm"
|
|
63
|
+
icon-type="endIcon"
|
|
64
|
+
:icon="XMarkIcon"
|
|
65
|
+
rounded
|
|
66
|
+
@click="isVisible = false"
|
|
67
|
+
>
|
|
68
|
+
Close
|
|
69
|
+
</EUIButton>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</transition>
|
|
73
|
+
</div>
|
|
74
|
+
</template>
|
|
75
|
+
|
|
76
|
+
<script setup lang="ts">
|
|
77
|
+
import { ref, computed, watch, onBeforeUnmount } from "vue";
|
|
78
|
+
import { XMarkIcon } from "@heroicons/vue/24/outline";
|
|
79
|
+
import EUIAvatar from "../avatar/EUIAvatar.vue";
|
|
80
|
+
import EUIButton from "../button/EUIButton.vue";
|
|
81
|
+
import ChevronBigDown from "../../assets/svg/ChevronBigDown.vue";
|
|
82
|
+
|
|
83
|
+
const isVisible = ref(true);
|
|
84
|
+
const minimized = ref(true);
|
|
85
|
+
const containerRef = ref<HTMLElement | null>(null);
|
|
86
|
+
|
|
87
|
+
const x = ref(20);
|
|
88
|
+
const y = ref(80);
|
|
89
|
+
const dragging = ref(false);
|
|
90
|
+
const startX = ref(0);
|
|
91
|
+
const startY = ref(0);
|
|
92
|
+
const origX = ref(0);
|
|
93
|
+
const origY = ref(0);
|
|
94
|
+
|
|
95
|
+
const onToggle = () => {
|
|
96
|
+
minimized.value = !minimized.value;
|
|
97
|
+
if (minimized.value) {
|
|
98
|
+
y.value = y.value <= 284 ? y.value : 284;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const startDrag = (e: MouseEvent | TouchEvent) => {
|
|
103
|
+
const tag = (e.target as Element).tagName.toLowerCase();
|
|
104
|
+
if (["input", "textarea", "select", "button", "svg", "path"].includes(tag))
|
|
105
|
+
return;
|
|
106
|
+
|
|
107
|
+
const { pageX, pageY } = "touches" in e ? e.touches[0] : e;
|
|
108
|
+
dragging.value = true;
|
|
109
|
+
startX.value = pageX;
|
|
110
|
+
startY.value = pageY;
|
|
111
|
+
origX.value = x.value;
|
|
112
|
+
origY.value = y.value;
|
|
113
|
+
|
|
114
|
+
window.addEventListener("mousemove", onDrag);
|
|
115
|
+
window.addEventListener("mouseup", stopDrag);
|
|
116
|
+
window.addEventListener("touchmove", onDrag);
|
|
117
|
+
window.addEventListener("touchend", stopDrag);
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const onDrag = (e: MouseEvent | TouchEvent) => {
|
|
121
|
+
if (!dragging.value) return;
|
|
122
|
+
const { pageX, pageY } = "touches" in e ? e.touches[0] : e;
|
|
123
|
+
const dx = pageX - startX.value;
|
|
124
|
+
const dy = pageY - startY.value;
|
|
125
|
+
|
|
126
|
+
let newX = origX.value - dx;
|
|
127
|
+
let newY = origY.value + dy;
|
|
128
|
+
|
|
129
|
+
const el = containerRef.value;
|
|
130
|
+
if (el) {
|
|
131
|
+
const { offsetWidth: w, offsetHeight: h } = el;
|
|
132
|
+
newX = Math.min(Math.max(0, newX), window.innerWidth - w);
|
|
133
|
+
newY = Math.min(Math.max(0, newY), window.innerHeight - h);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
x.value = newX;
|
|
137
|
+
y.value = newY;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const stopDrag = () => {
|
|
141
|
+
dragging.value = false;
|
|
142
|
+
window.removeEventListener("mousemove", onDrag);
|
|
143
|
+
window.removeEventListener("mouseup", stopDrag);
|
|
144
|
+
window.removeEventListener("touchmove", onDrag);
|
|
145
|
+
window.removeEventListener("touchend", stopDrag);
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
onBeforeUnmount(stopDrag);
|
|
149
|
+
|
|
150
|
+
// clamp Y when toggling
|
|
151
|
+
watch(minimized, (val) => {
|
|
152
|
+
if (!val && y.value > 300) {
|
|
153
|
+
y.value = 300;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
const containerStyle = computed(() => ({
|
|
158
|
+
position: "fixed" as const,
|
|
159
|
+
right: `${x.value}px`,
|
|
160
|
+
top: `${y.value}px`,
|
|
161
|
+
cursor: dragging.value ? "grabbing" : "grab",
|
|
162
|
+
zIndex: 999,
|
|
163
|
+
}));
|
|
164
|
+
</script>
|
|
165
|
+
|
|
166
|
+
<style lang="scss" scoped>
|
|
167
|
+
.draggable-card {
|
|
168
|
+
@apply p-2 w-96 border border-solid border-purple-100 overflow-hidden flex-col flex bg-white rounded-2xl shadow-xl shadow-violet-100;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.slide-fade-enter-active,
|
|
172
|
+
.slide-fade-leave-active {
|
|
173
|
+
transition: opacity 0.3s ease;
|
|
174
|
+
}
|
|
175
|
+
.slide-fade-enter-from,
|
|
176
|
+
.slide-fade-leave-to {
|
|
177
|
+
opacity: 0;
|
|
178
|
+
}
|
|
179
|
+
</style>
|
package/src/components/index.ts
CHANGED
|
@@ -41,7 +41,6 @@ export { default as EUITable } from "./table/EUITable.vue";
|
|
|
41
41
|
export { default as EUIStudentPagination } from "./table/EUIStudentPagination.vue";
|
|
42
42
|
export { default as EUIMultiDropdown } from "./dropdown/EUIMultiDropdown.vue";
|
|
43
43
|
export { default as GrowthTable } from "./table/GrowthTable.vue";
|
|
44
|
-
export { default as ColumnResizeTable } from "./table/ColumnResizeTable.vue";
|
|
45
44
|
|
|
46
45
|
export { default as EUILoader } from "./loader/EUILoader.vue";
|
|
47
46
|
export { default as EUICircleLoader } from "./loader/EUICircleLoader.vue";
|
|
@@ -56,3 +55,5 @@ export { default as EUISearchToggle } from "./searchexpand/EUISearchToggle.vue";
|
|
|
56
55
|
|
|
57
56
|
export { default as EUIBreadcrumb } from "./breadcrumb/EUIBreadcrumb.vue";
|
|
58
57
|
export { default as EUIAlerts } from "./alerts/EUIAlerts.vue";
|
|
58
|
+
export { default as ColumnResizeTable } from "./table/ColumnResizeTable.vue";
|
|
59
|
+
export { default as EUIDrag } from "./dragModal/EUIDrag.vue";
|
|
@@ -175,14 +175,27 @@
|
|
|
175
175
|
:rowIndex="rowIndex"
|
|
176
176
|
:headerIndex="headerIndex"
|
|
177
177
|
>
|
|
178
|
-
<span class="block truncate">
|
|
179
|
-
getValueByPath(row, header?.value)
|
|
180
|
-
|
|
178
|
+
<span class="block" :class="{'truncate':!header.showInfoText}">
|
|
179
|
+
{{ getValueByPath(row, header?.value) }}
|
|
180
|
+
<EUITooltip v-if="header?.showInfoText" placement="top" class="inline-block ms-0.5">
|
|
181
|
+
<template v-slot:default>
|
|
182
|
+
<InformationCircleIcon class="inline-block text-gray-500 size-4" />
|
|
183
|
+
</template>
|
|
184
|
+
<template v-slot:tooltip>
|
|
185
|
+
<div class="z-50 max-w-xs break-words whitespace-normal min-w-max">{{ header.showInfoText }}</div>
|
|
186
|
+
</template>
|
|
187
|
+
</EUITooltip>
|
|
188
|
+
</span>
|
|
181
189
|
</slot>
|
|
182
190
|
</td>
|
|
183
191
|
</tr>
|
|
184
192
|
<template v-if="tableExpanded">
|
|
185
|
-
<slot
|
|
193
|
+
<slot
|
|
194
|
+
name="expanded"
|
|
195
|
+
:row="row"
|
|
196
|
+
:rowIndex="rowIndex"
|
|
197
|
+
:headerLength="headers.length"
|
|
198
|
+
></slot>
|
|
186
199
|
</template>
|
|
187
200
|
</template>
|
|
188
201
|
<template v-else-if="computedItems.length === 0">
|
|
@@ -273,6 +286,8 @@ import EUIStudentPagination from "./EUIStudentPagination.vue";
|
|
|
273
286
|
import EUICircleLoader from "../loader/EUICircleLoader.vue";
|
|
274
287
|
import EUIPageLimit from "./EUIPageLimit.vue";
|
|
275
288
|
import "./UTable.scss";
|
|
289
|
+
import EUITooltip from "../tooltip/EUITooltip.vue";
|
|
290
|
+
import { InformationCircleIcon } from "@heroicons/vue/24/outline";
|
|
276
291
|
|
|
277
292
|
interface Header {
|
|
278
293
|
value: string;
|
|
@@ -281,6 +296,7 @@ interface Header {
|
|
|
281
296
|
sortable?: boolean;
|
|
282
297
|
width?: number;
|
|
283
298
|
color?: string;
|
|
299
|
+
showInfoText?: string;
|
|
284
300
|
}
|
|
285
301
|
|
|
286
302
|
interface Item {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
<div class=" overflow-hidden overflow-x-scroll">
|
|
5
|
+
<div
|
|
4
6
|
v-if="tabStyle === 'design'"
|
|
5
7
|
class="inline-flex flex-row items-center justify-start px-[0.25rem] min-h-[34px] mb-0.5 bg-gray-100 rounded-[0.625rem] ring-1 ring-gray-200/75 gap-2"
|
|
6
8
|
>
|
|
@@ -14,6 +16,7 @@
|
|
|
14
16
|
:class="[
|
|
15
17
|
tab?.disabled ? ' cursor-not-allowed ' : '',
|
|
16
18
|
isHighlighedActivetab ? ' rounded-t-lg !bg-[#EDE9FE] ' : '',
|
|
19
|
+
'flex-shrink-0'
|
|
17
20
|
]"
|
|
18
21
|
role="tab"
|
|
19
22
|
tabindex="-1"
|
|
@@ -80,6 +83,7 @@
|
|
|
80
83
|
: 'border-transparent text-gray-500',
|
|
81
84
|
tab?.disabled ? ' cursor-not-allowed ' : '',
|
|
82
85
|
isHighlighedActivetab&&activeTabIndex === tabindex ? ' rounded-t-lg !bg-[#EDE9FE]' : '',
|
|
86
|
+
'flex-shrink-0'
|
|
83
87
|
]"
|
|
84
88
|
@click="selectTab(tabindex)"
|
|
85
89
|
>
|
|
@@ -115,6 +119,7 @@
|
|
|
115
119
|
: 'border-transparent text-gray-500 z-0',
|
|
116
120
|
tab?.disabled ? ' cursor-not-allowed ' : '',
|
|
117
121
|
isHighlighedActivetab&&activeTabIndex === tabindex ? ' rounded-t-lg !bg-[#EDE9FE]' : '',
|
|
122
|
+
'flex-shrink-0'
|
|
118
123
|
]"
|
|
119
124
|
@click="selectTab(tabindex)"
|
|
120
125
|
>
|
|
@@ -128,7 +133,6 @@
|
|
|
128
133
|
</slot>
|
|
129
134
|
</button>
|
|
130
135
|
</div>
|
|
131
|
-
|
|
132
136
|
<div v-else class="flex items-center gap-1 p-2 transition-all duration-100">
|
|
133
137
|
<button
|
|
134
138
|
v-for="(tab, tabindex) in tabs"
|
|
@@ -145,6 +149,7 @@
|
|
|
145
149
|
: 'border-white hover:bg-gray-50 text-gray-700',
|
|
146
150
|
tab?.disabled ? ' cursor-not-allowed ' : '',
|
|
147
151
|
isHighlighedActivetab&&activeTabIndex === tabindex ? ' rounded-t-lg !bg-[#EDE9FE]' : '',
|
|
152
|
+
'flex-shrink-0'
|
|
148
153
|
]"
|
|
149
154
|
@click="selectTab(tabindex)"
|
|
150
155
|
>
|
|
@@ -158,6 +163,9 @@
|
|
|
158
163
|
</slot>
|
|
159
164
|
</button>
|
|
160
165
|
</div>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
|
|
161
169
|
<slot name="content" :active-tab="tabs[activeTabIndex]">
|
|
162
170
|
<div
|
|
163
171
|
:class="[
|
|
@@ -197,12 +205,14 @@ const props = defineProps<{
|
|
|
197
205
|
|
|
198
206
|
const emit = defineEmits<{
|
|
199
207
|
(event: "update:activeTab", activeTab: Tab): void;
|
|
208
|
+
(event: "update:defaultActiveIndex", defaultActiveIndex: number): void;
|
|
200
209
|
}>();
|
|
201
210
|
|
|
202
211
|
const activeTabIndex = ref(props.defaultActiveIndex ?? 0);
|
|
203
212
|
|
|
204
213
|
const selectTab = (index: number) => {
|
|
205
214
|
activeTabIndex.value = index;
|
|
215
|
+
emit("update:defaultActiveIndex", activeTabIndex.value );
|
|
206
216
|
emit("update:activeTab", props.tabs[activeTabIndex.value]);
|
|
207
217
|
};
|
|
208
218
|
|
|
@@ -210,6 +220,8 @@ watch(
|
|
|
210
220
|
() => props.defaultActiveIndex,
|
|
211
221
|
(newIndex) => {
|
|
212
222
|
activeTabIndex.value = newIndex ?? 0;
|
|
223
|
+
},{
|
|
224
|
+
immediate:true
|
|
213
225
|
}
|
|
214
226
|
);
|
|
215
227
|
</script>
|