Skip to content

Commit

Permalink
Merge pull request #56 from shubhadip/clear-btn-fix
Browse files Browse the repository at this point in the history
fix: clear button functionality fix
  • Loading branch information
shubhadip authored Feb 11, 2023
2 parents 4d2fb5c + 0c06964 commit f1cac37
Show file tree
Hide file tree
Showing 7 changed files with 1,730 additions and 16,011 deletions.
2 changes: 1 addition & 1 deletion .eslintcache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"/Users/shubhadipmaity/projects/vuejs3-datepicker/src/App.vue":"1"},{"size":4144,"mtime":1667540200834}]
[{"/Users/shubhadipmaity/projects/vuejs3-datepicker/src/components/datepicker/DateInput.vue":"1","/Users/shubhadipmaity/projects/vuejs3-datepicker/src/components/examples/VModel.vue":"2"},{"size":7097,"mtime":1676125280403},{"size":1645,"mtime":1676124771220}]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vuejs3-datepicker",
"version": "1.0.11",
"version": "1.0.14",
"description": "Vue 3 datepicker",
"files": [
"dist/*",
Expand Down
17,711 changes: 1,707 additions & 16,004 deletions serve/datepicker.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/components/datepicker/DateInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ export default defineComponent({
parseTypedDate,
inputBlurred,
inputRef,
clearDate,
};
},
});
Expand Down
4 changes: 3 additions & 1 deletion src/components/datepicker/datepicker.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
margin-left: 10px;
font-size: 15px;
}

&__typeablecalendar{
position: absolute;
top: 10px;
Expand Down Expand Up @@ -187,6 +186,9 @@
&__clear-button, &__calendar-button{
cursor: pointer;
font-style: normal;
position: absolute;
top: 12px;
right:12px;
&.disabled {
color: #999;
cursor: default;
Expand Down
4 changes: 2 additions & 2 deletions src/components/datepicker/locale/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,8 @@ export const vn = (): ILocale => {
'Tháng 11',
'Tháng 12',
];
const days = ['CN', 'H', 'B', 'T', 'N', 'S', 'B']
const daysNames = ['CN', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy']
const days = ['CN', 'H', 'B', 'T', 'N', 'S', 'B'];
const daysNames = ['CN', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ Năm', 'Thứ Sáu', 'Thứ Bảy'];
const rtl = false;
const ymd = false;
const yearSuffix = '';
Expand Down
17 changes: 15 additions & 2 deletions src/components/examples/VModel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
</template>
<template v-slot:content>
<div class="flex-block">
<appdate-picker v-model="dateinput" @update:modelValue="dateSelected" />
<appdate-picker
v-model="dateinput"
@update:modelValue="dateSelected"
:clearButton="true"
@cleared="handleClearDate"
/>
<div class="change-btn">
<button @click="changeValue">Change Value</button>
<p>UpdateValue : {{ dateinput }}</p>
Expand All @@ -29,7 +34,7 @@ export default defineComponent({
setup() {
const dateinput = ref(new Date());
const template = `<appdate-picker
v-model="dateinput"
v-model="dateinput"
@update:modelValue="dateSelected"
/>`;
Expand Down Expand Up @@ -59,12 +64,20 @@ export default defineComponent({
console.log(payload);
}
/**
* clear date handler
*/
function handleClearDate(): void {
console.log('clear date event triggered');
}
return {
dateinput,
changeValue,
dateSelected,
template,
script,
handleClearDate,
};
},
});
Expand Down

0 comments on commit f1cac37

Please sign in to comment.