edvoyui-component-library-test-flight 0.0.90 → 0.0.92
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/dist/input/EUIInput.vue.d.ts +1 -1
- package/dist/library-vue-ts.cjs.js +24 -70
- package/dist/library-vue-ts.css +1 -1
- package/dist/library-vue-ts.es.js +10578 -14027
- package/dist/library-vue-ts.umd.js +25 -71
- package/dist/modal/EUIModal.vue.d.ts +1 -1
- package/dist/modal/EUIModal.vue.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/assets/images/search-nodata.png +0 -0
- package/src/components/input/EUIInput.vue +62 -24
- package/src/components/modal/EUIModal.stories.ts +6 -0
- package/src/components/modal/EUIModal.vue +35 -18
- package/src/components/table/UTable.vue +8 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "/Volumes/work/repos/edvoy-ui-v2/src/components/modal/EUIModal.vue?vue&type=script&lang.ts";
|
|
2
|
-
import "/Volumes/work/repos/edvoy-ui-v2/src/components/modal/EUIModal.vue?vue&type=style&index=0&scoped=
|
|
2
|
+
import "/Volumes/work/repos/edvoy-ui-v2/src/components/modal/EUIModal.vue?vue&type=style&index=0&scoped=03103d67&lang.scss";
|
|
3
3
|
declare const _default: any;
|
|
4
4
|
export default _default;
|
|
5
5
|
//# sourceMappingURL=EUIModal.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EUIModal.vue.d.ts","sourceRoot":"","sources":["../../src/components/modal/EUIModal.vue"],"names":[],"mappings":"AACA,cAAc,2FAA2F,CAAC;
|
|
1
|
+
{"version":3,"file":"EUIModal.vue.d.ts","sourceRoot":"","sources":["../../src/components/modal/EUIModal.vue"],"names":[],"mappings":"AACA,cAAc,2FAA2F,CAAC;AA0F1G,OAAO,oHAAoH,CAAC;;AAE5H,wBAAmH"}
|
package/package.json
CHANGED
|
Binary file
|
|
@@ -1,18 +1,47 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<label
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
v-if="!inputFilled && label"
|
|
5
|
+
:for="`${name}-${id}`"
|
|
6
|
+
:class="[
|
|
7
|
+
'text-xs w-full text-gray-500 cursor-pointer font-medium',
|
|
8
|
+
required && `after:content-['*'] after:ml-0.5 after:text-red-500`,
|
|
9
|
+
]"
|
|
10
|
+
>
|
|
11
|
+
{{ label }}
|
|
12
|
+
</label>
|
|
13
13
|
<div
|
|
14
|
-
:class="[
|
|
14
|
+
:class="[
|
|
15
|
+
'relative',
|
|
16
|
+
{ 'pointer-events-none cursor-not-allowed': disabled },
|
|
17
|
+
{
|
|
18
|
+
'h-14 rounded-2xl focus-within:border-purple-600 focus-within:ring-1 focus-within:ring-purple-600 border border-gray-100':
|
|
19
|
+
inputFilled,
|
|
20
|
+
},
|
|
21
|
+
'group cursor-pointer relative w-full mb-2 overflow-hidden',
|
|
22
|
+
]"
|
|
15
23
|
>
|
|
24
|
+
<button
|
|
25
|
+
:class="inputValue ? ' absolute inset-y-0 right-3 ' : ' hidden '"
|
|
26
|
+
@click="emit('update:modelValue', '')"
|
|
27
|
+
>
|
|
28
|
+
<svg
|
|
29
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
30
|
+
fill="none"
|
|
31
|
+
viewBox="0 0 24 24"
|
|
32
|
+
stroke-width="1.5"
|
|
33
|
+
stroke="currentColor"
|
|
34
|
+
class="size-5"
|
|
35
|
+
>
|
|
36
|
+
<!-- <path stroke-linecap="round" stroke-linejoin="round" d="m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
|
|
37
|
+
-->
|
|
38
|
+
<path
|
|
39
|
+
stroke-linecap="round"
|
|
40
|
+
stroke-linejoin="round"
|
|
41
|
+
d="M6 18 18 6M6 6l12 12"
|
|
42
|
+
/>
|
|
43
|
+
</svg>
|
|
44
|
+
</button>
|
|
16
45
|
<label
|
|
17
46
|
v-if="inputFilled"
|
|
18
47
|
:for="`${name}-${id}`"
|
|
@@ -23,30 +52,39 @@
|
|
|
23
52
|
: 'top-1/2 text-sm w-full text-gray-700 cursor-pointer h-14 pt-5 pb-4',
|
|
24
53
|
disabled ? 'cursor-not-allowed bg-gray-50 z-10' : 'z-0 bg-white',
|
|
25
54
|
required && `after:content-['*'] after:ml-0.5 after:text-red-500`,
|
|
26
|
-
'absolute font-medium left-0 px-4 -translate-y-1/2 duration-300 group-focus-within:top-3.5 group-focus-within:text-xs group-focus-within:text-gray-400 rounded-2xl group-focus-within:bg-transparent group-focus-within:-translate-y-1/2 group-focus-within:ring-transparent group-focus-within:h-auto group-focus-within:py-0 first-letter:capitalize transition-all ease-in-out'
|
|
55
|
+
'absolute font-medium left-0 px-4 -translate-y-1/2 duration-300 group-focus-within:top-3.5 group-focus-within:text-xs group-focus-within:text-gray-400 rounded-2xl group-focus-within:bg-transparent group-focus-within:-translate-y-1/2 group-focus-within:ring-transparent group-focus-within:h-auto group-focus-within:py-0 first-letter:capitalize transition-all ease-in-out',
|
|
27
56
|
]"
|
|
28
57
|
>
|
|
29
|
-
{{ label ||
|
|
58
|
+
{{ label || "Label" }}
|
|
30
59
|
</label>
|
|
31
60
|
<div
|
|
32
61
|
v-if="icon && iconType"
|
|
33
|
-
:class="[
|
|
62
|
+
:class="[
|
|
63
|
+
'absolute inset-y-0 flex items-center pointer-events-none',
|
|
64
|
+
iconType === 'startIcon' ? 'left-0 pl-3' : 'right-0 pr-3',
|
|
65
|
+
disabled ? 'z-20' : '',
|
|
66
|
+
]"
|
|
34
67
|
>
|
|
35
|
-
<component
|
|
36
|
-
:is="icon"
|
|
37
|
-
class="text-gray-400 size-6"
|
|
38
|
-
aria-hidden="true"
|
|
39
|
-
/>
|
|
68
|
+
<component :is="icon" class="text-gray-400 size-6" aria-hidden="true" />
|
|
40
69
|
</div>
|
|
41
70
|
<input
|
|
42
71
|
:id="`${name}-${id}`"
|
|
43
72
|
ref="input"
|
|
44
|
-
:type="type"
|
|
73
|
+
:type="type === 'search' ? 'text' : type"
|
|
45
74
|
:value="modelValue"
|
|
46
75
|
:placeholder="placeholder"
|
|
47
76
|
:name="name"
|
|
48
|
-
:class="[
|
|
49
|
-
|
|
77
|
+
:class="[
|
|
78
|
+
'z-10 block placeholder:text-gray-400 focus:outline-none text-sm font-medium appearance-none disabled:opacity-75 autofill:bg-white leading-6 transition-all duration-100 border-none outline-none',
|
|
79
|
+
inputFilled
|
|
80
|
+
? 'pt-6 pb-3 rounded-2xl size-full'
|
|
81
|
+
: 'py-3 h-10 w-full ring-1 ring-gray-100 focus-within:ring-purple-600 focus-within:ring-2 ring-inset',
|
|
82
|
+
!inputFilled && rounded ? 'rounded-2xl' : 'rounded-md',
|
|
83
|
+
disabled ? 'cursor-not-allowed' : 'cursor-text',
|
|
84
|
+
getIconClass(),
|
|
85
|
+
!inputFilled && className,
|
|
86
|
+
'pr-8'
|
|
87
|
+
]"
|
|
50
88
|
:required="required"
|
|
51
89
|
:disabled="disabled"
|
|
52
90
|
:readonly="readonly"
|
|
@@ -124,10 +162,10 @@ const props = defineProps({
|
|
|
124
162
|
default: false,
|
|
125
163
|
},
|
|
126
164
|
inputFilled: {
|
|
127
|
-
type:Boolean,
|
|
128
|
-
default: false
|
|
165
|
+
type: Boolean,
|
|
166
|
+
default: false,
|
|
129
167
|
},
|
|
130
|
-
rounded:Boolean,
|
|
168
|
+
rounded: Boolean,
|
|
131
169
|
className: {
|
|
132
170
|
type: Array as PropType<string[]>,
|
|
133
171
|
required: false,
|
|
@@ -38,6 +38,12 @@ const meta: Meta<typeof EUIModal> = {
|
|
|
38
38
|
action: "confirm",
|
|
39
39
|
description: "Emits when the confirm button is clicked.",
|
|
40
40
|
},
|
|
41
|
+
persistent: {
|
|
42
|
+
control: "boolean",
|
|
43
|
+
description:
|
|
44
|
+
"Prevents the modal from being closed by clicking on the backdrop or pressing the Escape key.",
|
|
45
|
+
defaultValue: false,
|
|
46
|
+
},
|
|
41
47
|
},
|
|
42
48
|
},
|
|
43
49
|
parameters: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Teleport defer to="body">
|
|
3
|
-
<Transition name="modal">
|
|
3
|
+
<Transition name="modal" appear>
|
|
4
4
|
<div
|
|
5
5
|
v-if="isVisible"
|
|
6
6
|
class="fixed inset-0 z-50 flex flex-col items-center justify-end sm:justify-center"
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
</template>
|
|
84
84
|
|
|
85
85
|
<script lang="ts">
|
|
86
|
-
import { defineComponent,
|
|
86
|
+
import { defineComponent, onMounted, onUnmounted, watch } from "vue";
|
|
87
87
|
|
|
88
88
|
export default defineComponent({
|
|
89
89
|
name: "Modal",
|
|
@@ -108,27 +108,44 @@ export default defineComponent({
|
|
|
108
108
|
type: Boolean,
|
|
109
109
|
default: true,
|
|
110
110
|
},
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
closeModal() {
|
|
115
|
-
this.$emit("update:isVisible", false);
|
|
111
|
+
persistent: {
|
|
112
|
+
type: Boolean,
|
|
113
|
+
default: false,
|
|
116
114
|
},
|
|
117
115
|
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
116
|
+
emits: ["update:isVisible", "confirm"],
|
|
117
|
+
setup(props, { emit }) {
|
|
118
|
+
// Methods
|
|
119
|
+
const closeModal = () => {
|
|
120
|
+
if (!props.persistent) {
|
|
121
|
+
emit("update:isVisible", false);
|
|
124
122
|
}
|
|
123
|
+
};
|
|
124
|
+
const handleKeydown = (event: KeyboardEvent) => {
|
|
125
|
+
if (event.key === "Escape" && props.isVisible && !props.persistent) {
|
|
126
|
+
closeModal();
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
// Watcher for body scroll lock
|
|
130
|
+
watch(
|
|
131
|
+
() => props.isVisible,
|
|
132
|
+
(newVal) => {
|
|
133
|
+
document.body.style.overflow = newVal ? "hidden" : "";
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
// Lifecycle hooks
|
|
137
|
+
onMounted(() => {
|
|
138
|
+
window.addEventListener("keydown", handleKeydown);
|
|
125
139
|
});
|
|
126
140
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
141
|
+
onUnmounted(() => {
|
|
142
|
+
document.body.style.overflow = ""; // Reset scroll when modal unmounts
|
|
143
|
+
window.removeEventListener("keydown", handleKeydown);
|
|
144
|
+
});
|
|
145
|
+
return {
|
|
146
|
+
closeModal
|
|
147
|
+
};
|
|
148
|
+
}
|
|
132
149
|
});
|
|
133
150
|
</script>
|
|
134
151
|
|
|
@@ -177,9 +177,15 @@
|
|
|
177
177
|
"
|
|
178
178
|
>
|
|
179
179
|
<div
|
|
180
|
-
class="flex items-center justify-center
|
|
180
|
+
class="flex items-center justify-center w-[calc(100vw-14rem)]"
|
|
181
|
+
:class="[tableHeight ? tableHeight : 'h-[calc(100svh-12rem)] max-h-[calc(100svh-12rem)]']"
|
|
181
182
|
>
|
|
182
|
-
|
|
183
|
+
<div class="text-center">
|
|
184
|
+
<div class="mx-auto overflow-hidden rounded-md size-56">
|
|
185
|
+
<img src="@/assets/images/search-nodata.png" alt="" class="block object-contain object-center h-auto max-w-full opacity-90" />
|
|
186
|
+
</div>
|
|
187
|
+
<div class="my-2 text-xl font-medium text-gray-500">No matching records found</div>
|
|
188
|
+
</div>
|
|
183
189
|
</div>
|
|
184
190
|
</td>
|
|
185
191
|
</tr>
|