@a-vision-software/vue-input-components 1.4.3 → 1.4.5
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/src/components/Modal.vue.d.ts +2 -0
- package/dist/src/types/modal.d.ts +1 -0
- package/dist/vue-input-components.cjs.js +1 -1
- package/dist/vue-input-components.css +1 -1
- package/dist/vue-input-components.es.js +416 -415
- package/dist/vue-input-components.umd.js +1 -1
- package/package.json +2 -2
- package/src/components/Modal.vue +2 -1
- package/src/components/TextInput.vue +3 -3
- package/src/types/modal.ts +1 -0
- package/src/views/ModalTestView.vue +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a-vision-software/vue-input-components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.5",
|
|
4
4
|
"description": "A collection of reusable Vue 3 input components with TypeScript support",
|
|
5
5
|
"author": "A-Vision Software",
|
|
6
6
|
"license": "MIT",
|
|
@@ -85,4 +85,4 @@
|
|
|
85
85
|
"publishConfig": {
|
|
86
86
|
"access": "public"
|
|
87
87
|
}
|
|
88
|
-
}
|
|
88
|
+
}
|
package/src/components/Modal.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Teleport to="body">
|
|
3
3
|
<transition name="modal-fade">
|
|
4
|
-
<div v-if="modelValue" class="modal-backdrop">
|
|
4
|
+
<div v-if="modelValue" class="modal-backdrop" :class="modalClass">
|
|
5
5
|
<div class="modal" :style="modalStyle" role="dialog" aria-labelledby="modalTitle"
|
|
6
6
|
aria-describedby="modalContent">
|
|
7
7
|
<div v-if="props.isLargeIcon && props.icon" class="modal-large-icon">
|
|
@@ -39,6 +39,7 @@ import { ModalProps, ModalEmits } from '../types/modal'
|
|
|
39
39
|
|
|
40
40
|
const props = withDefaults(defineProps<ModalProps>(), {
|
|
41
41
|
modelValue: false,
|
|
42
|
+
class: '',
|
|
42
43
|
title: '',
|
|
43
44
|
minWidth: '300px',
|
|
44
45
|
maxWidth: '800px',
|
|
@@ -115,12 +115,12 @@ const formatDateForModel = (date: Date | null): string => {
|
|
|
115
115
|
const day = String(date.getDate()).padStart(2, '0')
|
|
116
116
|
const month = String(date.getMonth() + 1).padStart(2, '0')
|
|
117
117
|
const year = date.getFullYear()
|
|
118
|
-
return `${
|
|
118
|
+
return `${year}-${month}-${day}`
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
const parseDateFromModel = (dateStr: string): Date | null => {
|
|
122
122
|
if (!dateStr) return null
|
|
123
|
-
const [
|
|
123
|
+
const [year, month, day] = dateStr.split('-').map(Number)
|
|
124
124
|
return new Date(year, month - 1, day)
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -210,7 +210,7 @@ onUnmounted(() => {
|
|
|
210
210
|
})
|
|
211
211
|
|
|
212
212
|
onMounted(() => {
|
|
213
|
-
id.value = `text-input-${Math.random().toString(36).
|
|
213
|
+
id.value = `text-input-${Math.random().toString(36).substring(2, 9)}`
|
|
214
214
|
if (props.type === 'date' && props.modelValue) {
|
|
215
215
|
dateValue.value = parseDateFromModel(props.modelValue)
|
|
216
216
|
}
|
package/src/types/modal.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
<Action label="Open Basic Modal" @click="showBasicModal = true" />
|
|
11
11
|
|
|
12
|
-
<Modal v-model="showBasicModal" title="Basic Modal Example" icon="info-circle">
|
|
12
|
+
<Modal v-model="showBasicModal" title="Basic Modal Example" icon="info-circle" modal-class="basic-modal">
|
|
13
13
|
<p>This is a basic modal example with default styling.</p>
|
|
14
14
|
<p>The modal can be closed by clicking the X button in the top right corner.</p>
|
|
15
15
|
</Modal>
|