edvoyui-component-library-test-flight 0.0.242 → 0.0.244
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/components/alerts/EUIAlerts.d.ts +3 -3
- package/dist/components/alerts/EUIAlerts.vue +23 -6
- package/dist/components/telephone/EUITelephone.vue +23 -4
- package/dist/edvoy-ui.cjs.js +15 -15
- package/dist/edvoy-ui.css +1 -1
- package/dist/edvoy-ui.es.js +4820 -4792
- package/dist/edvoy-ui.umd.js +27 -27
- package/package.json +1 -1
|
@@ -26,7 +26,7 @@ declare const __VLS_component: import('../../../node_modules/vue').DefineCompone
|
|
|
26
26
|
default: string;
|
|
27
27
|
};
|
|
28
28
|
alertType: {
|
|
29
|
-
type: PropType<"Default" | "Warning" | "Success" | "Error">;
|
|
29
|
+
type: PropType<"Default" | "Info" | "Warning" | "Success" | "Error">;
|
|
30
30
|
default: string;
|
|
31
31
|
};
|
|
32
32
|
alertIcon: {
|
|
@@ -53,7 +53,7 @@ declare const __VLS_component: import('../../../node_modules/vue').DefineCompone
|
|
|
53
53
|
default: string;
|
|
54
54
|
};
|
|
55
55
|
alertType: {
|
|
56
|
-
type: PropType<"Default" | "Warning" | "Success" | "Error">;
|
|
56
|
+
type: PropType<"Default" | "Info" | "Warning" | "Success" | "Error">;
|
|
57
57
|
default: string;
|
|
58
58
|
};
|
|
59
59
|
alertIcon: {
|
|
@@ -71,7 +71,7 @@ declare const __VLS_component: import('../../../node_modules/vue').DefineCompone
|
|
|
71
71
|
showAlert: boolean;
|
|
72
72
|
heading: string;
|
|
73
73
|
textMessage: string;
|
|
74
|
-
alertType: "Success" | "Error" | "Default" | "Warning";
|
|
74
|
+
alertType: "Success" | "Error" | "Default" | "Info" | "Warning";
|
|
75
75
|
alertIcon: string | Function | Record<string, any>;
|
|
76
76
|
actionItems: boolean;
|
|
77
77
|
}, {}, {}, {}, string, import('../../../node_modules/vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
leave-from-class="opacity-100"
|
|
8
8
|
leave-to-class="opacity-0"
|
|
9
9
|
>
|
|
10
|
-
<div v-if="showAlert" :class="['
|
|
10
|
+
<div v-if="showAlert" :class="['px-4 py-4 rounded-lg border border-solid', alertsClass.bgColor]">
|
|
11
11
|
<div
|
|
12
12
|
:class="[closeIcon && !textMessage ? 'items-center pr-2 flex' : 'flex items-start']"
|
|
13
13
|
>
|
|
@@ -87,8 +87,10 @@ import {
|
|
|
87
87
|
CheckCircleIcon,
|
|
88
88
|
XCircleIcon,
|
|
89
89
|
XMarkIcon,
|
|
90
|
+
InformationCircleIcon
|
|
90
91
|
} from "@heroicons/vue/24/solid";
|
|
91
92
|
|
|
93
|
+
|
|
92
94
|
const props = defineProps({
|
|
93
95
|
showAlert: {
|
|
94
96
|
type: Boolean,
|
|
@@ -103,7 +105,7 @@ const props = defineProps({
|
|
|
103
105
|
default: "",
|
|
104
106
|
},
|
|
105
107
|
alertType: {
|
|
106
|
-
type: String as PropType<"Default" | "Warning" | "Success" | "Error">,
|
|
108
|
+
type: String as PropType<"Default" | "Info" | "Warning" | "Success" | "Error">,
|
|
107
109
|
default: "Default",
|
|
108
110
|
},
|
|
109
111
|
alertIcon: {
|
|
@@ -127,7 +129,22 @@ const onClose = () => {
|
|
|
127
129
|
const alertsClass = computed(() => {
|
|
128
130
|
const iconClasses = {
|
|
129
131
|
Default: {
|
|
130
|
-
bgColor: "bg-
|
|
132
|
+
bgColor: "bg-gray-100 border-gray-200",
|
|
133
|
+
leftIcon: {
|
|
134
|
+
icon: InformationCircleIcon,
|
|
135
|
+
color: "text-gray-600",
|
|
136
|
+
},
|
|
137
|
+
titleColor: "text-gray-800",
|
|
138
|
+
textColor: "text-gray-700",
|
|
139
|
+
btnPrimary:
|
|
140
|
+
"bg-gray-700 hover:bg-gray-800 focus:ring-gray-600 focus:ring-offset-gray-50",
|
|
141
|
+
btnTertiary:
|
|
142
|
+
"text-gray-500 bg-gray-50 hover:bg-gray-100 focus:ring-gray-600 focus:ring-offset-gray-50",
|
|
143
|
+
btnClose:
|
|
144
|
+
"bg-gray-50 text-gray-500 hover:bg-gray-100 focus:ring-gray-600 focus:ring-offset-gray-50",
|
|
145
|
+
},
|
|
146
|
+
Info: {
|
|
147
|
+
bgColor: "bg-blue-50 border-blue-200",
|
|
131
148
|
leftIcon: {
|
|
132
149
|
icon: CheckCircleIcon,
|
|
133
150
|
color: "text-blue-400",
|
|
@@ -142,7 +159,7 @@ const alertsClass = computed(() => {
|
|
|
142
159
|
"bg-blue-50 text-blue-500 hover:bg-blue-100 focus:ring-blue-600 focus:ring-offset-blue-50",
|
|
143
160
|
},
|
|
144
161
|
Warning: {
|
|
145
|
-
bgColor: "bg-yellow-50",
|
|
162
|
+
bgColor: "bg-yellow-50 border-orange-200",
|
|
146
163
|
leftIcon: {
|
|
147
164
|
icon: ExclamationTriangleIcon,
|
|
148
165
|
color: "text-yellow-400",
|
|
@@ -157,7 +174,7 @@ const alertsClass = computed(() => {
|
|
|
157
174
|
"bg-yellow-50 text-yellow-500 hover:bg-yellow-100 focus:ring-yellow-600 focus:ring-offset-yellow-50",
|
|
158
175
|
},
|
|
159
176
|
Success: {
|
|
160
|
-
bgColor: "bg-green-50",
|
|
177
|
+
bgColor: "bg-green-50 border-green-200",
|
|
161
178
|
leftIcon: {
|
|
162
179
|
icon: CheckCircleIcon,
|
|
163
180
|
color: "text-green-400",
|
|
@@ -172,7 +189,7 @@ const alertsClass = computed(() => {
|
|
|
172
189
|
"bg-green-50 text-green-500 hover:bg-green-100 focus:ring-green-600 focus:ring-offset-green-50",
|
|
173
190
|
},
|
|
174
191
|
Error: {
|
|
175
|
-
bgColor: "bg-red-50",
|
|
192
|
+
bgColor: "bg-red-50 border-red-200",
|
|
176
193
|
leftIcon: {
|
|
177
194
|
icon: XCircleIcon,
|
|
178
195
|
color: "text-red-400",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
:class="[getIconClass()]"
|
|
49
49
|
@on-input="onInputChanged"
|
|
50
50
|
@country-changed="onCountryChanged"
|
|
51
|
+
@focus="onFocus"
|
|
51
52
|
@blur="onBlur"
|
|
52
53
|
></vue-tel-input>
|
|
53
54
|
</button>
|
|
@@ -85,7 +86,7 @@ import "vue-tel-input/vue-tel-input.css";
|
|
|
85
86
|
|
|
86
87
|
type TelephoneInputMeta = PhoneMeta & { number: string };
|
|
87
88
|
|
|
88
|
-
const emit = defineEmits(["update:modelValue", "blur", "update:isValid"]);
|
|
89
|
+
const emit = defineEmits(["update:modelValue", "blur", "focus", "update:isValid"]);
|
|
89
90
|
|
|
90
91
|
const props = defineProps({
|
|
91
92
|
modelValue: {
|
|
@@ -170,6 +171,7 @@ const inputValue = computed(() => {
|
|
|
170
171
|
});
|
|
171
172
|
|
|
172
173
|
const mobile = ref(String(props.modelValue ?? ""));
|
|
174
|
+
const isFocused = ref(false);
|
|
173
175
|
const isTouched = ref(false);
|
|
174
176
|
const telephoneIsValid = ref(props.isValid);
|
|
175
177
|
const activeCountry = ref<CountryObject | null>(null);
|
|
@@ -252,10 +254,16 @@ const bindProps = computed<VueTelInputProps>(() => ({
|
|
|
252
254
|
},
|
|
253
255
|
}));
|
|
254
256
|
|
|
257
|
+
const onFocus = () => {
|
|
258
|
+
isFocused.value = true;
|
|
259
|
+
emit("focus");
|
|
260
|
+
};
|
|
261
|
+
|
|
255
262
|
const onInputChanged = (
|
|
256
263
|
_formattedNumber: string,
|
|
257
264
|
phoneObject: TelephoneInputMeta,
|
|
258
265
|
) => {
|
|
266
|
+
isFocused.value = true;
|
|
259
267
|
telephoneIsValid.value = Boolean(phoneObject.valid);
|
|
260
268
|
hasError.value = !telephoneIsValid.value;
|
|
261
269
|
|
|
@@ -267,6 +275,7 @@ const onInputChanged = (
|
|
|
267
275
|
};
|
|
268
276
|
|
|
269
277
|
const onBlur = () => {
|
|
278
|
+
isFocused.value = false;
|
|
270
279
|
isTouched.value = true;
|
|
271
280
|
emit("blur");
|
|
272
281
|
};
|
|
@@ -320,9 +329,19 @@ const internalErrorMessage = computed(() => {
|
|
|
320
329
|
return "Enter a valid phone number";
|
|
321
330
|
});
|
|
322
331
|
|
|
323
|
-
const errorMessage = computed(
|
|
324
|
-
(
|
|
325
|
-
|
|
332
|
+
const errorMessage = computed(() => {
|
|
333
|
+
if (props.readonly || props.disabled) return "";
|
|
334
|
+
|
|
335
|
+
if (isFocused.value && !telephoneIsValid.value) {
|
|
336
|
+
return "";
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
if (isTouched.value) {
|
|
340
|
+
return internalErrorMessage.value || externalErrorMessage.value || "";
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
return externalErrorMessage.value || "";
|
|
344
|
+
});
|
|
326
345
|
|
|
327
346
|
const getIconClass = () => {
|
|
328
347
|
switch (props.iconType) {
|