From 62038ec03901484de5a39205a6481af080193f45 Mon Sep 17 00:00:00 2001 From: MrWook Date: Tue, 19 Jan 2021 07:49:01 +0100 Subject: [PATCH 1/4] feat(input): add slot for calendar and clear button icons --- src/components/DateInput.vue | 18 +++++++++++------- src/components/Datepicker.vue | 2 ++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/components/DateInput.vue b/src/components/DateInput.vue index 4379e4ba..a150102e 100644 --- a/src/components/DateInput.vue +++ b/src/components/DateInput.vue @@ -12,10 +12,12 @@ @click="toggleCalendar" > - - {{ calendarButtonIconContent }} - - + + + {{ calendarButtonIconContent }} + + + @@ -49,9 +51,11 @@ @click="clearDate()" > - - × - + + + × + + diff --git a/src/components/Datepicker.vue b/src/components/Datepicker.vue index a9df94d3..ee4ce12b 100644 --- a/src/components/Datepicker.vue +++ b/src/components/Datepicker.vue @@ -38,6 +38,8 @@ > + + Date: Tue, 19 Jan 2021 07:49:15 +0100 Subject: [PATCH 2/4] feat(input): add slot for calendar and clear button icons --- docs/guide/Props/README.md | 6 ++--- docs/guide/Slots/README.md | 54 +++++++++++++++++++++++++++++--------- 2 files changed, 44 insertions(+), 16 deletions(-) diff --git a/docs/guide/Props/README.md b/docs/guide/Props/README.md index 1e4d27da..db3cad8f 100755 --- a/docs/guide/Props/README.md +++ b/docs/guide/Props/README.md @@ -6,11 +6,11 @@ | autofocus | String | | Sets html `autofocus` attribute on input | | bootstrap-styling | Boolean | false | Use bootstrap v4 styling classes. | | calendar-button | Boolean | false | Show an icon that that can be clicked | -| calendar-button-icon | String | | Use icon for button (ex: fa fa-calendar) | -| calendar-button-icon-content | String | | Use for material-icons (ex: event) | +| calendar-button-icon | String | | (Deprecated for slot) Use icon for button (ex: fa fa-calendar) | +| calendar-button-icon-content | String | | (Deprecated for slot) Use for material-icons (ex: event) | | calendar-class | String|Object | | CSS class applied to the calendar el | | clear-button | Boolean | false | Show an icon for clearing the date | -| clear-button-icon | String | | Use icon for button (ex: fa fa-times) | +| clear-button-icon | String | | (Deprecated for slot) Use icon for button (ex: fa fa-times) | | day-cell-content | Function | | Use to render custom content in day cell | | disabled | Boolean | false | If `true`, disable Datepicker on screen | | disabled-dates | Object | | See below for configuration | diff --git a/docs/guide/Slots/README.md b/docs/guide/Slots/README.md index b685dfdc..91401a5d 100755 --- a/docs/guide/Slots/README.md +++ b/docs/guide/Slots/README.md @@ -11,9 +11,9 @@ to show some custom text: ```html -
- Choose a Date -
+
``` @@ -26,9 +26,11 @@ to show some custom text: ```html -
- -
+
``` @@ -39,7 +41,9 @@ To implement some custom styling (for instance to add an animated placeholder) o ```html - Choose a Date + ``` @@ -50,9 +54,9 @@ allows you to do that: ```html - + ``` @@ -62,11 +66,35 @@ To provide custom content for buttons that rotate intervals in calendar header ` ```html - + + + +``` + +## calendarBtn + +To provide custom content for the calendar button, the `calendarBtn` slot may be used: + +```html + + + +``` + +## calendarBtn + +To provide custom content for the clear button, the `clearBtn` slot may be used: + +```html + + ``` From 0078985b84d91acb2d7f3da1891db5f92e92dbd3 Mon Sep 17 00:00:00 2001 From: MrWook Date: Tue, 19 Jan 2021 07:49:54 +0100 Subject: [PATCH 3/4] chore(demo): update styles for demo --- example/Demo.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/example/Demo.vue b/example/Demo.vue index 7a411df6..dc155bc7 100755 --- a/example/Demo.vue +++ b/example/Demo.vue @@ -496,7 +496,7 @@ export default {