v-datepicker-lite 0.0.2 → 0.0.4
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/README.md +64 -79
- package/index.js +1292 -786
- package/package.json +9 -3
- package/style.css +1 -1
- package/types/index.d.ts +36 -36
package/README.md
CHANGED
|
@@ -4,13 +4,13 @@ A lightweight and customizable Vue 3 date picker component with support for date
|
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
7
|
+
- **Multiple Selection Modes**: Supports `date`, `time`, `dateTime`, `week`, and `month` modes.
|
|
8
|
+
- **Responsive Design**: Adapts to various screen sizes with a clean, modern UI.
|
|
9
|
+
- **Accessibility**: Includes ARIA attributes and keyboard navigation for enhanced usability.
|
|
10
|
+
- **Customizable**: Flexible props for date format, time format, min/max dates, disabled dates, and more.
|
|
11
|
+
- **Time Selection**: Supports 12h/24h formats with customizable time intervals (15, 30, or 60 minutes).
|
|
12
|
+
- **Performance Optimized**: Uses Vue 3 composition API for efficient rendering and state management.
|
|
13
|
+
- **TypeScript Support**: Fully typed with TypeScript for better developer experience.
|
|
14
14
|
|
|
15
15
|
## Demo
|
|
16
16
|
|
|
@@ -47,16 +47,14 @@ const selectedDate = (ref < Date) | (null > null)
|
|
|
47
47
|
</script>
|
|
48
48
|
|
|
49
49
|
<template>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
</p>
|
|
59
|
-
</div>
|
|
50
|
+
<div>
|
|
51
|
+
<h3>Date Picker</h3>
|
|
52
|
+
<DatePicker v-model:value="selectedDate" mode="date" />
|
|
53
|
+
<p>
|
|
54
|
+
Selected:
|
|
55
|
+
{{ selectedDate ? selectedDate.toLocaleDateString() : 'None' }}
|
|
56
|
+
</p>
|
|
57
|
+
</div>
|
|
60
58
|
</template>
|
|
61
59
|
```
|
|
62
60
|
|
|
@@ -73,16 +71,14 @@ const selectedWeek = (ref < Date) | (null > null)
|
|
|
73
71
|
</script>
|
|
74
72
|
|
|
75
73
|
<template>
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
</p>
|
|
85
|
-
</div>
|
|
74
|
+
<div>
|
|
75
|
+
<h3>Week Picker</h3>
|
|
76
|
+
<DatePicker v-model:value="selectedWeek" mode="week" />
|
|
77
|
+
<p>
|
|
78
|
+
Selected:
|
|
79
|
+
{{ selectedWeek ? selectedWeek.toLocaleDateString() : 'None' }}
|
|
80
|
+
</p>
|
|
81
|
+
</div>
|
|
86
82
|
</template>
|
|
87
83
|
```
|
|
88
84
|
|
|
@@ -99,16 +95,14 @@ const selectedMonth = (ref < Date) | (null > null)
|
|
|
99
95
|
</script>
|
|
100
96
|
|
|
101
97
|
<template>
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
</p>
|
|
111
|
-
</div>
|
|
98
|
+
<div>
|
|
99
|
+
<h3>Month Picker</h3>
|
|
100
|
+
<DatePicker v-model:value="selectedMonth" mode="month" />
|
|
101
|
+
<p>
|
|
102
|
+
Selected:
|
|
103
|
+
{{ selectedMonth ? selectedMonth.toLocaleDateString() : 'None' }}
|
|
104
|
+
</p>
|
|
105
|
+
</div>
|
|
112
106
|
</template>
|
|
113
107
|
```
|
|
114
108
|
|
|
@@ -125,18 +119,18 @@ const selectedDateTime = (ref < Date) | (null > null)
|
|
|
125
119
|
</script>
|
|
126
120
|
|
|
127
121
|
<template>
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
122
|
+
<div>
|
|
123
|
+
<h3>DateTime Picker</h3>
|
|
124
|
+
<DatePicker
|
|
125
|
+
v-model:value="selectedDateTime"
|
|
126
|
+
mode="dateTime"
|
|
127
|
+
time-format="12h"
|
|
128
|
+
time-interval="15" />
|
|
129
|
+
<p>
|
|
130
|
+
Selected:
|
|
131
|
+
{{ selectedDateTime ? selectedDateTime.toLocaleString() : 'None' }}
|
|
132
|
+
</p>
|
|
133
|
+
</div>
|
|
140
134
|
</template>
|
|
141
135
|
```
|
|
142
136
|
|
|
@@ -153,21 +147,18 @@ const selectedDate = (ref < Date) | (null > null)
|
|
|
153
147
|
</script>
|
|
154
148
|
|
|
155
149
|
<template>
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
{{ selectedDate ? selectedDate.toLocaleDateString() : 'None' }}
|
|
169
|
-
</p>
|
|
170
|
-
</div>
|
|
150
|
+
<div>
|
|
151
|
+
<h3>Restricted Date Picker</h3>
|
|
152
|
+
<DatePicker
|
|
153
|
+
v-model:value="selectedDate"
|
|
154
|
+
mode="date"
|
|
155
|
+
:min-date="new Date().toISOString().split('T')[0]"
|
|
156
|
+
:disabled-dates="[{ start: '2025-08-15', end: '2025-08-20' }, { start: '2025-08-25' }]" />
|
|
157
|
+
<p>
|
|
158
|
+
Selected:
|
|
159
|
+
{{ selectedDate ? selectedDate.toLocaleDateString() : 'None' }}
|
|
160
|
+
</p>
|
|
161
|
+
</div>
|
|
171
162
|
</template>
|
|
172
163
|
```
|
|
173
164
|
|
|
@@ -200,24 +191,18 @@ Customize the appearance using the following CSS variables defined in `style.css
|
|
|
200
191
|
|
|
201
192
|
```css
|
|
202
193
|
:root {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
--date-picker-radius: 0.375em; /* Border radius */
|
|
213
|
-
--date-picker-hover: #f3f4f6; /* Hover background color */
|
|
194
|
+
--date-picker-primary: #2d66ed;
|
|
195
|
+
--date-picker-primary-fg: #ffffff;
|
|
196
|
+
--date-picker-text: inherit;
|
|
197
|
+
--date-picker-border: #00000020;
|
|
198
|
+
--date-picker-secondary: #00000010;
|
|
199
|
+
--date-picker-hover: #00000010;
|
|
200
|
+
--date-picker-disabled: #000000b4;
|
|
201
|
+
--date-picker-today: #00000010;
|
|
202
|
+
--date-picker-radius: 0.375em;
|
|
214
203
|
}
|
|
215
204
|
```
|
|
216
205
|
|
|
217
206
|
## Author
|
|
218
207
|
|
|
219
208
|
[safdar-azeem](https://github.com/safdar-azeem)
|
|
220
|
-
|
|
221
|
-
## License
|
|
222
|
-
|
|
223
|
-
MIT
|