@a-vision-software/vue-input-components 1.2.5 → 1.2.6
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 +2 -2
- package/src/App.vue +7 -0
- package/src/assets/colors.css +67 -0
- package/src/assets/logo.svg +1 -0
- package/src/assets/main.css +160 -0
- package/src/env.d.ts +9 -0
- package/src/index.ts +8 -0
- package/src/main.ts +21 -0
- package/src/router/index.ts +44 -0
- package/src/types/index.ts +3 -0
- package/src/types/navigation.ts +32 -0
- package/src/types.d.ts +23 -0
- package/src/types.ts +108 -0
- package/src/views/ActionTestView.vue +307 -0
- package/src/views/DashboardView.vue +98 -0
- package/src/views/FileUploadTestView.vue +177 -0
- package/src/views/NavigationTestView.vue +319 -0
- package/src/views/TextInputTestView.vue +372 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a-vision-software/vue-input-components",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"description": "A collection of reusable Vue 3 input components with TypeScript support",
|
|
5
5
|
"author": "A-Vision Software",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
],
|
|
23
23
|
"type": "module",
|
|
24
24
|
"files": [
|
|
25
|
-
"src
|
|
25
|
+
"src",
|
|
26
26
|
"dist"
|
|
27
27
|
],
|
|
28
28
|
"main": "./dist/vue-input-components.cjs.js",
|
package/src/App.vue
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* Base colors */
|
|
3
|
+
--primary-color: #3498db;
|
|
4
|
+
--primary-color-light: rgba(52, 152, 219, 0.2);
|
|
5
|
+
--secondary-color: #2ecc71;
|
|
6
|
+
|
|
7
|
+
/* Text colors */
|
|
8
|
+
--text-color: #2c3e50;
|
|
9
|
+
--text-color-light: #7f8c8d;
|
|
10
|
+
|
|
11
|
+
/* UI colors */
|
|
12
|
+
--border-color: #dcdfe6;
|
|
13
|
+
--icon-color: #95a5a6;
|
|
14
|
+
|
|
15
|
+
/* State colors */
|
|
16
|
+
--error-color: #e74c3c;
|
|
17
|
+
--error-color-light: rgba(231, 76, 60, 0.2);
|
|
18
|
+
--success-color: #2ecc71;
|
|
19
|
+
--success-color-light: rgba(46, 204, 113, 0.2);
|
|
20
|
+
--warning-color: #f1c40f;
|
|
21
|
+
--warning-color-light: rgba(241, 196, 15, 0.2);
|
|
22
|
+
|
|
23
|
+
/* Background colors */
|
|
24
|
+
--disabled-color: #bdc3c7;
|
|
25
|
+
--disabled-background: #f5f7fa;
|
|
26
|
+
--card-bg: #ffffff;
|
|
27
|
+
--background-color: #f8f9fa;
|
|
28
|
+
|
|
29
|
+
/* Input colors */
|
|
30
|
+
--input-bg-color: rgba(255, 255, 255, 0.8);
|
|
31
|
+
--input-bg-hover: rgba(0, 0, 0, 0.05);
|
|
32
|
+
--input-bg-disabled: rgba(0, 0, 0, 0.05);
|
|
33
|
+
|
|
34
|
+
/* Text Colors */
|
|
35
|
+
--text-muted: #6c757d;
|
|
36
|
+
|
|
37
|
+
/* Border Colors */
|
|
38
|
+
--input-bg: #ffffff;
|
|
39
|
+
--input-bg-disabled: #e9ecef;
|
|
40
|
+
|
|
41
|
+
/* Status Colors */
|
|
42
|
+
--danger-color: #dc3545;
|
|
43
|
+
--success-color: #28a745;
|
|
44
|
+
--warning-color: #ffc107;
|
|
45
|
+
|
|
46
|
+
/* Shadow Colors */
|
|
47
|
+
--shadow-color: rgba(74, 108, 247, 0.25);
|
|
48
|
+
|
|
49
|
+
/* Typography */
|
|
50
|
+
--line-height: 20px;
|
|
51
|
+
|
|
52
|
+
/* File Upload Colors */
|
|
53
|
+
--upload-border-color: var(--border-color);
|
|
54
|
+
--upload-bg-color: var(--background-color);
|
|
55
|
+
--upload-dragging-border-color: var(--primary-color);
|
|
56
|
+
--upload-dragging-bg-color: var(--primary-color-light);
|
|
57
|
+
--upload-has-files-border-color: var(--success-color);
|
|
58
|
+
--upload-has-files-bg-color: var(--success-color-light);
|
|
59
|
+
--upload-icon-color: var(--icon-color);
|
|
60
|
+
--upload-text-color: var(--text-color-light);
|
|
61
|
+
--progress-bg-color: var(--disabled-background);
|
|
62
|
+
--progress-color: var(--primary-color);
|
|
63
|
+
--success-bg-color: var(--success-color-light);
|
|
64
|
+
--success-text-color: var(--success-color);
|
|
65
|
+
--error-bg-color: var(--error-color-light);
|
|
66
|
+
--error-text-color: var(--error-color);
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 261.76 226.69"><path d="M161.096.001l-30.225 52.351L100.647.001H-.005l130.877 226.688L261.749.001z" fill="#41b883"/><path d="M161.096.001l-30.225 52.351L100.647.001H52.346l78.526 136.01L209.398.001z" fill="#34495e"/></svg>
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* Typography */
|
|
3
|
+
--font-family:
|
|
4
|
+
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
5
|
+
--font-size-xs: 0.75rem;
|
|
6
|
+
--font-size-sm: 0.875rem;
|
|
7
|
+
--font-size-base: 1rem;
|
|
8
|
+
--font-size-lg: 1.125rem;
|
|
9
|
+
--font-size-xl: 1.25rem;
|
|
10
|
+
--font-weight-normal: 400;
|
|
11
|
+
--font-weight-medium: 500;
|
|
12
|
+
--font-weight-bold: 600;
|
|
13
|
+
--line-height-tight: 1.25;
|
|
14
|
+
--line-height-base: 1.5;
|
|
15
|
+
--line-height-loose: 1.75;
|
|
16
|
+
|
|
17
|
+
/* Spacing */
|
|
18
|
+
--spacing-xs: 0.25rem;
|
|
19
|
+
--spacing-sm: 0.5rem;
|
|
20
|
+
--spacing-md: 1rem;
|
|
21
|
+
--spacing-lg: 1.5rem;
|
|
22
|
+
--spacing-xl: 2rem;
|
|
23
|
+
|
|
24
|
+
/* Borders */
|
|
25
|
+
--border-radius-sm: 0.25rem;
|
|
26
|
+
--border-radius-md: 0.375rem;
|
|
27
|
+
--border-radius-lg: 0.5rem;
|
|
28
|
+
--border-width: 1px;
|
|
29
|
+
--border-width-thick: 2px;
|
|
30
|
+
|
|
31
|
+
/* Shadows */
|
|
32
|
+
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
33
|
+
--shadow-md: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
34
|
+
--shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
35
|
+
|
|
36
|
+
/* Transitions */
|
|
37
|
+
--transition-fast: 150ms;
|
|
38
|
+
--transition-base: 200ms;
|
|
39
|
+
--transition-slow: 300ms;
|
|
40
|
+
--transition-timing: ease-in-out;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* Base styles */
|
|
44
|
+
html {
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
font-size: 16px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
*,
|
|
50
|
+
*:before,
|
|
51
|
+
*:after {
|
|
52
|
+
box-sizing: inherit;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
body {
|
|
56
|
+
margin: 0;
|
|
57
|
+
padding: 0;
|
|
58
|
+
font-family: var(--font-family);
|
|
59
|
+
font-size: var(--font-size-base);
|
|
60
|
+
line-height: var(--line-height-base);
|
|
61
|
+
color: var(--text-color);
|
|
62
|
+
background-color: var(--background-color);
|
|
63
|
+
-webkit-font-smoothing: antialiased;
|
|
64
|
+
-moz-osx-font-smoothing: grayscale;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
h1,
|
|
68
|
+
h2,
|
|
69
|
+
h3,
|
|
70
|
+
h4,
|
|
71
|
+
h5,
|
|
72
|
+
h6 {
|
|
73
|
+
margin: 0;
|
|
74
|
+
font-weight: var(--font-weight-bold);
|
|
75
|
+
line-height: var(--line-height-tight);
|
|
76
|
+
color: var(--text-color);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
p {
|
|
80
|
+
margin: 0 0 var(--spacing-md) 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
a {
|
|
84
|
+
color: var(--primary-color);
|
|
85
|
+
text-decoration: none;
|
|
86
|
+
transition: color var(--transition-base) var(--transition-timing);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
a:hover {
|
|
90
|
+
color: var(--primary-color-light);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Utility classes */
|
|
94
|
+
.text-error {
|
|
95
|
+
color: var(--error-color);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.text-success {
|
|
99
|
+
color: var(--success-color);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.text-warning {
|
|
103
|
+
color: var(--warning-color);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.text-disabled {
|
|
107
|
+
color: var(--disabled-color);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.bg-card {
|
|
111
|
+
background-color: var(--card-bg);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.shadow-sm {
|
|
115
|
+
box-shadow: var(--shadow-sm);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.shadow-md {
|
|
119
|
+
box-shadow: var(--shadow-md);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.shadow-lg {
|
|
123
|
+
box-shadow: var(--shadow-lg);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.rounded-sm {
|
|
127
|
+
border-radius: var(--border-radius-sm);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.rounded-md {
|
|
131
|
+
border-radius: var(--border-radius-md);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.rounded-lg {
|
|
135
|
+
border-radius: var(--border-radius-lg);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/* Responsive breakpoints */
|
|
139
|
+
@media (max-width: 640px) {
|
|
140
|
+
html {
|
|
141
|
+
font-size: 14px;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@media (min-width: 1200px) {
|
|
146
|
+
html {
|
|
147
|
+
font-size: 16px;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* Print styles */
|
|
152
|
+
@media print {
|
|
153
|
+
body {
|
|
154
|
+
background: white;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
@page {
|
|
158
|
+
margin: 2cm;
|
|
159
|
+
}
|
|
160
|
+
}
|
package/src/env.d.ts
ADDED
package/src/index.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import TextInput from './components/TextInput.vue'
|
|
2
|
+
import FileUpload from './components/FileUpload.vue'
|
|
3
|
+
import Navigation from './components/Navigation.vue'
|
|
4
|
+
import Action from './components/Action.vue'
|
|
5
|
+
|
|
6
|
+
export { TextInput, FileUpload, Navigation, Action }
|
|
7
|
+
|
|
8
|
+
export * from './types'
|
package/src/main.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createApp } from 'vue'
|
|
2
|
+
import { library } from '@fortawesome/fontawesome-svg-core'
|
|
3
|
+
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
|
|
4
|
+
import { fas } from '@fortawesome/free-solid-svg-icons'
|
|
5
|
+
import { far } from '@fortawesome/free-regular-svg-icons'
|
|
6
|
+
|
|
7
|
+
import App from './App.vue'
|
|
8
|
+
import router from './router'
|
|
9
|
+
|
|
10
|
+
import './assets/colors.css'
|
|
11
|
+
import './assets/main.css'
|
|
12
|
+
|
|
13
|
+
// Add all solid icons to the library
|
|
14
|
+
library.add(fas, far)
|
|
15
|
+
|
|
16
|
+
const app = createApp(App)
|
|
17
|
+
|
|
18
|
+
app.use(router)
|
|
19
|
+
app.component('font-awesome-icon', FontAwesomeIcon)
|
|
20
|
+
|
|
21
|
+
app.mount('#app')
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { createRouter, createWebHistory } from 'vue-router'
|
|
2
|
+
import TextInputTestView from '../views/TextInputTestView.vue'
|
|
3
|
+
import FileUploadTestView from '../views/FileUploadTestView.vue'
|
|
4
|
+
import ActionTestView from '../views/ActionTestView.vue'
|
|
5
|
+
import DashboardView from '../views/DashboardView.vue'
|
|
6
|
+
import NavigationTestView from '../views/NavigationTestView.vue'
|
|
7
|
+
|
|
8
|
+
const router = createRouter({
|
|
9
|
+
history: createWebHistory(import.meta.env.BASE_URL),
|
|
10
|
+
routes: [
|
|
11
|
+
{
|
|
12
|
+
path: '/',
|
|
13
|
+
name: 'dashboard',
|
|
14
|
+
component: DashboardView,
|
|
15
|
+
meta: { title: 'Dashboard' },
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
path: '/text-input',
|
|
19
|
+
name: 'text-input',
|
|
20
|
+
component: TextInputTestView,
|
|
21
|
+
meta: { title: 'Text Input Test' },
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
path: '/file-upload',
|
|
25
|
+
name: 'file-upload',
|
|
26
|
+
component: FileUploadTestView,
|
|
27
|
+
meta: { title: 'File Upload Test' },
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
path: '/action',
|
|
31
|
+
name: 'action',
|
|
32
|
+
component: ActionTestView,
|
|
33
|
+
meta: { title: 'Action Test' },
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
path: '/navigation',
|
|
37
|
+
name: 'navigation',
|
|
38
|
+
component: NavigationTestView,
|
|
39
|
+
meta: { title: 'Navigation Test' },
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
export default router
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface NavigationItem {
|
|
2
|
+
id: string
|
|
3
|
+
label: string
|
|
4
|
+
url?: string
|
|
5
|
+
icon?: string
|
|
6
|
+
disabled?: boolean
|
|
7
|
+
alignment?: 'left' | 'right' | 'start' | 'end'
|
|
8
|
+
width?: string
|
|
9
|
+
children?: NavigationItem[]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface NavigationProps {
|
|
13
|
+
items: NavigationItem[]
|
|
14
|
+
type?: 'tiles' | 'dropdowns'
|
|
15
|
+
orientation?: 'horizontal' | 'vertical'
|
|
16
|
+
activeItem?: string
|
|
17
|
+
color?: string
|
|
18
|
+
hoverColor?: string
|
|
19
|
+
activeColor?: string
|
|
20
|
+
disabledColor?: string
|
|
21
|
+
gap?: string
|
|
22
|
+
padding?: string
|
|
23
|
+
borderRadius?: string
|
|
24
|
+
height?: string
|
|
25
|
+
width?: string
|
|
26
|
+
backgroundColor?: string
|
|
27
|
+
activeBackgroundColor?: string
|
|
28
|
+
activeItemAlignment?: 'left' | 'right' | 'top' | 'bottom'
|
|
29
|
+
showBottomBorder?: boolean
|
|
30
|
+
bottomBorderColor?: string
|
|
31
|
+
iconSize?: 'normal' | 'large'
|
|
32
|
+
}
|
package/src/types.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare module '@a-vision-software/vue-input-components' {
|
|
2
|
+
import { DefineComponent } from 'vue'
|
|
3
|
+
|
|
4
|
+
export const TextInput: DefineComponent<{
|
|
5
|
+
modelValue?: string
|
|
6
|
+
label?: string
|
|
7
|
+
placeholder?: string
|
|
8
|
+
required?: boolean
|
|
9
|
+
disabled?: boolean
|
|
10
|
+
error?: string
|
|
11
|
+
}>
|
|
12
|
+
|
|
13
|
+
export const FileUpload: DefineComponent<{
|
|
14
|
+
modelValue?: File[]
|
|
15
|
+
maxFiles?: number
|
|
16
|
+
maxFileSize?: number
|
|
17
|
+
accept?: string
|
|
18
|
+
uploadUrl?: string
|
|
19
|
+
required?: boolean
|
|
20
|
+
disabled?: boolean
|
|
21
|
+
error?: string
|
|
22
|
+
}>
|
|
23
|
+
}
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { Component } from 'vue'
|
|
2
|
+
|
|
3
|
+
export interface TextInputProps {
|
|
4
|
+
modelValue: string
|
|
5
|
+
type?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'date'
|
|
6
|
+
label?: string
|
|
7
|
+
placeholder?: string
|
|
8
|
+
icon?: string
|
|
9
|
+
disabled?: boolean
|
|
10
|
+
readonly?: boolean
|
|
11
|
+
maxlength?: number
|
|
12
|
+
error?: string
|
|
13
|
+
min?: string
|
|
14
|
+
max?: string
|
|
15
|
+
required?: boolean
|
|
16
|
+
success?: string
|
|
17
|
+
labelPosition?: 'top' | 'left'
|
|
18
|
+
labelAlign?: 'left' | 'right' | 'center'
|
|
19
|
+
totalWidth?: string
|
|
20
|
+
inputWidth?: string
|
|
21
|
+
labelWidth?: string
|
|
22
|
+
autosave?: (value: string) => Promise<void>
|
|
23
|
+
isTextarea?: boolean
|
|
24
|
+
maxHeight?: string
|
|
25
|
+
height?: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface FileUploadProps {
|
|
29
|
+
modelValue: File[]
|
|
30
|
+
label?: string
|
|
31
|
+
placeholder?: string
|
|
32
|
+
error?: string
|
|
33
|
+
disabled?: boolean
|
|
34
|
+
required?: boolean
|
|
35
|
+
multiple?: boolean
|
|
36
|
+
accept?: string
|
|
37
|
+
maxSize?: number
|
|
38
|
+
uploadUrl?: string
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface FileUploadEmits {
|
|
42
|
+
(e: 'update:modelValue', files: File[]): void
|
|
43
|
+
(e: 'files-selected', files: File[]): void
|
|
44
|
+
(e: 'start-upload', files: File[]): void
|
|
45
|
+
(e: 'upload-progress', progress: number): void
|
|
46
|
+
(e: 'upload-success', response: any): void
|
|
47
|
+
(e: 'upload-error', error: Error): void
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export type TextInputComponent = {
|
|
51
|
+
focus: () => void
|
|
52
|
+
blur: () => void
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type FileUploadComponent = Component<FileUploadProps>
|
|
56
|
+
|
|
57
|
+
export interface ActionProps {
|
|
58
|
+
icon?: string
|
|
59
|
+
label?: string
|
|
60
|
+
href?: string
|
|
61
|
+
type?: 'button' | 'submit' | 'reset'
|
|
62
|
+
disabled?: boolean
|
|
63
|
+
color?: string
|
|
64
|
+
size?: 'small' | 'regular' | 'large'
|
|
65
|
+
variant?: 'solid' | 'transparent'
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type ActionComponent = {
|
|
69
|
+
focus: () => void
|
|
70
|
+
blur: () => void
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface NavigationItem {
|
|
74
|
+
id: string
|
|
75
|
+
label: string
|
|
76
|
+
icon?: string
|
|
77
|
+
url?: string
|
|
78
|
+
children?: NavigationItem[]
|
|
79
|
+
type?: 'tile' | 'tab' | 'dropdown'
|
|
80
|
+
color?: string
|
|
81
|
+
disabled?: boolean
|
|
82
|
+
alignment?: 'start' | 'end'
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface NavigationProps {
|
|
86
|
+
items: NavigationItem[]
|
|
87
|
+
type?: 'tiles' | 'tabs' | 'dropdowns'
|
|
88
|
+
orientation?: 'horizontal' | 'vertical'
|
|
89
|
+
activeItem?: string
|
|
90
|
+
color?: string
|
|
91
|
+
hoverColor?: string
|
|
92
|
+
activeColor?: string
|
|
93
|
+
disabledColor?: string
|
|
94
|
+
iconSize?: string
|
|
95
|
+
gap?: string
|
|
96
|
+
padding?: string
|
|
97
|
+
borderRadius?: string
|
|
98
|
+
showIcons?: boolean
|
|
99
|
+
activeItemAlignment?: 'start' | 'end'
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface NavigationComponent {
|
|
103
|
+
props: NavigationProps
|
|
104
|
+
emits: {
|
|
105
|
+
(e: 'item-click', item: NavigationItem): void
|
|
106
|
+
(e: 'update:activeItem', id: string): void
|
|
107
|
+
}
|
|
108
|
+
}
|