Skip to content

Commit 7b5f5cb

Browse files
committed
publish to npm
0 parents  commit 7b5f5cb

12 files changed

+6991
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
css/

README.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Vue Tailwind Picker
2+
>Datepicker for vue.js & tailwindcss, build with dayjs
3+
4+
<p align="center">
5+
<img width="700px" src="https://raw.githubusercontent.com/kenhyuwa/vue-tailwind-picker/master/vue-tailwind-picker.png?raw=true">
6+
</p>
7+
8+
## Installation
9+
10+
```bash
11+
$ npm install vue-tailwind-picker --save
12+
```
13+
14+
## Usage
15+
16+
```javascript
17+
import Vue from 'vue'
18+
import VueTailwindPicker from 'vue-tailwind-picker'
19+
20+
Vue.use(VueTailwindPicker)
21+
```
22+
23+
## Options/Props
24+
25+
<table>
26+
<thead>
27+
<tr>
28+
<th>Props</th>
29+
<th>Type</th>
30+
<th>Required</th>
31+
<th>Default</th>
32+
</tr>
33+
</thead>
34+
<tbody>
35+
<tr>
36+
<td>startDate</td>
37+
<td>String</td>
38+
<td>false</td>
39+
<td>dayjs().format('YYYY-MM-DD')</td>
40+
</tr>
41+
<tr>
42+
<td>endDate</td>
43+
<td>String</td>
44+
<td>false</td>
45+
<td><i>undefined</i></td>
46+
</tr>
47+
<tr>
48+
<td>formatDate</td>
49+
<td>String</td>
50+
<td>false</td>
51+
<td>YYYY-MM-DD</td>
52+
</tr>
53+
<tr>
54+
<td>formatDisplay</td>
55+
<td>String</td>
56+
<td>false</td>
57+
<td>YYYY-MM-DD</td>
58+
</tr>
59+
<tr>
60+
<td>tailwindPickerValue</td>
61+
<td>String</td>
62+
<td>false</td>
63+
<td>null or ''</td>
64+
</tr>
65+
<tr>
66+
<td>inline</td>
67+
<td>Boolean</td>
68+
<td>false</td>
69+
<td>true</td>
70+
</tr>
71+
<tr>
72+
<td>classicTheme</td>
73+
<td>Boolean</td>
74+
<td>false</td>
75+
<td>true</td>
76+
</tr>
77+
</tbody>
78+
</table>
79+
80+
### other props for matching with tailwindcss
81+
82+
```javascript
83+
... // e.g
84+
className: {
85+
type: Object,
86+
required: false,
87+
default: () => ({
88+
shadow: 'shadow',
89+
borderColor: 'border-gray-300',
90+
textColor: 'text-gray-800',
91+
pagination: {
92+
backgroundColor: 'bg-teal-500',
93+
hover: 'bg-teal-600',
94+
textColor: 'text-gray-100',
95+
},
96+
monthAndYear: {
97+
borderColor: 'border-teal-500',
98+
},
99+
calendar: {
100+
selected: {
101+
backgroundColor: 'bg-teal-500',
102+
textColor: 'text-white',
103+
borderColor: 'border-teal-600',
104+
},
105+
},
106+
}),
107+
},
108+
```
109+
110+
## License
111+
112+
[MIT](http://opensource.org/licenses/MIT)

build/rollup.config.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import vue from 'rollup-plugin-vue' // Menangani SFC .vue
2+
import buble from 'rollup-plugin-buble' // Transpile / polyfill dengan dukungan peramban yang masuk akal
3+
import commonjs from 'rollup-plugin-commonjs'
4+
export default {
5+
input: 'src/wrapper.js', // Jalur relatif to package.json
6+
output: {
7+
name: 'VueTailwindPicker',
8+
exports: 'named',
9+
extractCSS: false,
10+
globals: {
11+
dayjs: 'dayjs',
12+
'dayjs/plugin/isToday': 'dayjs/plugin/isToday',
13+
'dayjs/plugin/customParseFormat': 'dayjs/plugin/customParseFormat',
14+
'dayjs/plugin/isBetween': 'dayjs/plugin/isBetween',
15+
'dayjs/plugin/localizedFormat': 'dayjs/plugin/localizedFormat',
16+
'dayjs/plugin/advancedFormat': 'dayjs/plugin/advancedFormat',
17+
},
18+
},
19+
external: [
20+
'dayjs',
21+
'dayjs/plugin/isToday',
22+
'dayjs/plugin/customParseFormat',
23+
'dayjs/plugin/isBetween',
24+
'dayjs/plugin/localizedFormat',
25+
'dayjs/plugin/advancedFormat',
26+
],
27+
plugins: [
28+
commonjs(),
29+
vue({
30+
css: true, // Menyuntikkan css secara dinamis sebagai tag <style>
31+
compileTemplate: true, // Konversi secara eksplisit templat ke render function
32+
}),
33+
buble(), // Transpile ke ES5
34+
],
35+
}

0 commit comments

Comments
 (0)