Skip to content

Commit 900cd42

Browse files
committed
add some props & fix issues when purge tailwindcss is enabled
1 parent 38dbf7e commit 900cd42

File tree

7 files changed

+442
-318
lines changed

7 files changed

+442
-318
lines changed

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# CHANGELOG
2+
>All changes when a new version is released are documented here.
3+
4+
## 0.0.1
5+
- First commit
6+
7+
## 0.0.2
8+
- Fix minor bug
9+
10+
## 1.0.0
11+
- Major update
12+
- Change all props to easy usage
13+
14+
## 1.0.1
15+
- Support dark mode
16+
17+
## 1.0.3
18+
- Fix closable when selected picker
19+
20+
## 1.1.0
21+
- Major update
22+
- Change props <code>:class-name</code> to <code>:theme</code>
23+
- Fix style when purge tailwindcss is enable
24+
- Add new props <code>auto-close</code>
25+
- Fix reset picker when away

README.md

Lines changed: 70 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Vue Tailwind Picker
22
>Datepicker for vue.js of tailwindcss & dayjs
33
4+
[![NPM](https://nodei.co/npm/vue-tailwind-picker.png?compact=true)](https://www.npmjs.com/package/vue-tailwind-picker)
5+
46
![Example](https://raw.githubusercontent.com/kenhyuwa/vue-tailwind-picker/master/vue-tailwind-picker.gif)
57

68
##### Default
@@ -16,19 +18,24 @@
1618
## Installation
1719
### NPM
1820
```bash
19-
$ npm install vue-tailwind-picker --save
21+
$ npm install vue-tailwind-picker
22+
```
23+
24+
### Yarn
25+
```bash
26+
$ yarn add vue-tailwind-picker
2027
```
2128

2229
#### CDN
2330

2431
```html
25-
<script src="https://unpkg.com/vue-tailwind-picker@1.0.3/dist/vue-tailwind-picker.min.js"></script>
32+
<script src="https://unpkg.com/vue-tailwind-picker@1.1.0/dist/vue-tailwind-picker.min.js"></script>
2633
```
2734

2835
If you are using native ES Modules, there is also an ES Modules compatible build:
2936
```html
3037
<script type="module">
31-
import VueTailwindPicker from 'https://cdn.jsdelivr.net/npm/vue-tailwind-picker@1.0.3/dist/vue-tailwind-picker.esm.js'
38+
import VueTailwindPicker from 'https://cdn.jsdelivr.net/npm/vue-tailwind-picker@1.1.0/dist/vue-tailwind-picker.esm.js'
3239
</script>
3340
```
3441

@@ -72,8 +79,7 @@ then add to nuxt.config.js
7279
start-date="2020-01-01"
7380
end-date="2021-12-31"
7481
format-date="YYYY-MM-DD"
75-
:inline="true"
76-
:class-name="classObject"
82+
:theme="classObject"
7783
:event-date="events"
7884
@change="(v) => (picker = v)"
7985
>
@@ -116,28 +122,54 @@ export default {
116122
classObject(){
117123
return this.darkMode ?
118124
{
119-
backgroundColor: '#1A202C',
120-
base: 'gray-800',
121-
hover: 'gray-700',
122-
color: {
123-
default: 'white',
124-
holiday: 'red-500',
125-
weekend: 'indigo-400',
126-
selected: 'teal-400',
127-
event: 'blue-500',
125+
background: '#1A202C',
126+
text: 'text-white',
127+
border: 'border-gray-700',
128+
currentColor: 'text-gray-200',
129+
navigation: {
130+
background: 'bg-gray-800',
131+
hover: 'hover:bg-gray-700',
132+
focus: 'bg-gray-700',
133+
},
134+
picker: {
135+
rounded: 'rounded-md',
136+
selected: {
137+
background: 'bg-teal-400',
138+
border: 'border-teal-400',
139+
hover: 'hover:border-teal-400',
140+
},
141+
holiday: 'text-red-400',
142+
weekend: 'text-green-400',
143+
event: 'bg-blue-500',
144+
},
145+
event: {
146+
border: 'border-gray-700',
128147
},
129148
} :
130149
{
131-
backgroundColor: '#FFFFFF',
132-
base: 'gray-100',
133-
hover: 'gray-200',
134-
color: {
135-
default: 'gray-700',
136-
holiday: 'red-400',
137-
weekend: 'green-400',
138-
selected: 'red-500',
139-
event: 'indigo-500',
140-
},
150+
background: '#FFFFFF',
151+
text: 'text-gray-700',
152+
border: 'border-gray-200',
153+
currentColor: 'text-gray-200',
154+
navigation: {
155+
background: 'bg-gray-100',
156+
hover: 'hover:bg-gray-200',
157+
focus: 'bg-gray-200',
158+
},
159+
picker: {
160+
rounded: 'rounded-full',
161+
selected: {
162+
background: 'bg-red-500',
163+
border: 'border-red-500',
164+
hover: 'hover:border-red-500',
165+
},
166+
holiday: 'text-red-400',
167+
weekend: 'text-green-400',
168+
event: 'bg-indigo-500',
169+
},
170+
event: {
171+
border: 'border-gray-200',
172+
},
141173
}
142174
}
143175
}
@@ -182,7 +214,7 @@ export default {
182214
<td>false</td>
183215
</tr>
184216
<tr>
185-
<td>className</td>
217+
<td>theme</td>
186218
<td>Object</td>
187219
<td>false</td>
188220
<td>see example, default object is light mode</td>
@@ -199,6 +231,12 @@ export default {
199231
<td>false</td>
200232
<td>$emit()</td>
201233
</tr>
234+
<tr>
235+
<td>autoClose</td>
236+
<td>Boolean</td>
237+
<td>false</td>
238+
<td>true</td>
239+
</tr>
202240
</tbody>
203241
</table>
204242

@@ -207,4 +245,10 @@ please contribute to be better...
207245

208246
## License
209247

210-
[MIT](http://opensource.org/licenses/MIT)
248+
The MIT License (MIT). Please see [LICENSE](http://opensource.org/licenses/MIT) for more information.
249+
250+
## Changelog
251+
252+
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently
253+
254+
_Made with love by [Ken](https://facebook.com/diaddemi)_

0 commit comments

Comments
 (0)