@@ -81,15 +81,25 @@ Vue.component('VueCtkDateTimePicker', VueCtkDateTimePicker);
8181
8282Here is an example of [ UMD implementation] ( https://codepen.io/louismazel/pen/jQWNzQ ) .
8383
84- ## Use custom element to trigger the component
85-
84+ ## Use custom element to trigger the component (using [ Slots api] ( https://v3.vuejs.org/api/directives.html#v-slot ) )
8685``` html
87- <VueCtkDateTimePicker :no-value-to-custom-elem =" (true|false)" />
88- ...
89- <input type =" text" />
90- ... or
91- <button type =" button" >Label</button >
92- ...
86+ <VueCtkDateTimePicker >
87+ <template v-slot =" { dateFormatted, toggleDatePicker, isOpen, close }" >
88+ ...
89+ <input
90+ type =" text"
91+ :value =" dateFormatted"
92+ @focus =" toggleDatePicker(true)"
93+ >
94+ ... or
95+ <button
96+ type =" button"
97+ @click =" toggleDatePicker(true)"
98+ >
99+ {{ dateFormatted }}
100+ </button >
101+ ...
102+ </template >
93103</VueCtkDateTimePicker >
94104```
95105
@@ -114,9 +124,8 @@ Here is an example of [UMD implementation](https://codepen.io/louismazel/pen/jQW
114124| only-date | Boolean | no | false |
115125| no-label | Boolean | no | false |
116126| no-header | Boolean | no | false |
117- | no-value-to-custom-elem (6) | Boolean | no | false |
118- | min-date (7) | String | no | - |
119- | max-date (7) | String | no | - |
127+ | min-date (6) | String | no | - |
128+ | max-date (6) | String | no | - |
120129| no-weekends-days | Boolean | no | false |
121130| auto-close | Boolean | no | false |
122131| inline | Boolean | no | false |
@@ -129,16 +138,16 @@ Here is an example of [UMD implementation](https://codepen.io/louismazel/pen/jQW
129138| button-now-translation | String | no | 'Now' |
130139| no-button-now | Boolean | no | false |
131140| first-day-of-week | Int (0 to 7) | no | - |
132- | disabled-dates (8 ) | Array` <string> ` | no | [ ] |
133- | disabled-hours (9 ) | Array` <string> ` | no | - |
141+ | disabled-dates (7 ) | Array` <string> ` | no | [ ] |
142+ | disabled-hours (8 ) | Array` <string> ` | no | - |
134143| shortcut | String | no | - |
135- | custom-shortcuts (10 ) | Array` <object> ` | no | - |
136- | disabled-weekly (11 ) | Array` <integer> ` | no | [ ] |
137- | no-keyboard (12 ) | Boolean | no | false |
138- | right (13 ) | Boolean | no | false |
144+ | custom-shortcuts (9 ) | Array` <object> ` | no | - |
145+ | disabled-weekly (10 ) | Array` <integer> ` | no | [ ] |
146+ | no-keyboard (11 ) | Boolean | no | false |
147+ | right (12 ) | Boolean | no | false |
139148| noClearButton | Boolean | no | false |
140149| behaviour | Object | no | [ See behaviour] ( #Behaviour ) |
141- | id (14 ) | String | no | undefined |
150+ | id (13 ) | String | no | undefined |
142151
143152(1) hint : Is a text that replaces the label/placeholder (Ex : Error designation)
144153
@@ -150,15 +159,13 @@ Here is an example of [UMD implementation](https://codepen.io/louismazel/pen/jQW
150159
151160(5) locale : Default value is the locale of the browser - Ex : Set ` locale="fr" ` to force to French language
152161
153- (6) no-value-to-custom-elem : No value will set to your elem (you can get the formatted value with @formatted-value event)
154-
155- (7) min-date && max-date should be in the same format as property format specified. If format not set - it is set to 'YYYY-MM-DD hh: mm a' by default
162+ (6) min-date && max-date should be in the same format as property format specified. If format not set - it is set to 'YYYY-MM-DD hh: mm a' by default
156163
157- (8 ) Disabled-Dates is an Array of dates in 'YYYY-MM-DD' format (ex: ` ['2018-04-03', '2018-04-07', '2018-04-09'] ` )
164+ (7 ) Disabled-Dates is an Array of dates in 'YYYY-MM-DD' format (ex: ` ['2018-04-03', '2018-04-07', '2018-04-09'] ` )
158165
159- (9 ) disabled-hours : Must be an Array of hours in 24h format ('00' to '23') : ` ['00','01','02','03','04','05','06','07','19','20','21','22','23'] `
166+ (8 ) disabled-hours : Must be an Array of hours in 24h format ('00' to '23') : ` ['00','01','02','03','04','05','06','07','19','20','21','22','23'] `
160167
161- (10 ) custom-shortcuts - It's an array of objects. Each object represents a single shortcut.
168+ (9 ) custom-shortcuts - It's an array of objects. Each object represents a single shortcut.
162169
163170``` js
164171[
@@ -205,13 +212,13 @@ With the `shortcut` property, you can specify a shortcut that's selected by defa
205212 : shortcut= " 'thisMonth'"
206213```
207214
208- (11 ) disabled-weekly : Days of the week which are disabled every week, in Array format with day index, Sunday as 0 and Saturday as 6: ` [0,4,6] `
215+ (10 ) disabled-weekly : Days of the week which are disabled every week, in Array format with day index, Sunday as 0 and Saturday as 6: ` [0,4,6] `
209216
210- (12 ) no-keyboard : Disable keyboard accessibility & navigation
217+ (11 ) no-keyboard : Disable keyboard accessibility & navigation
211218
212- (13 ) right : add this attribute to align the picker on right
219+ (12 ) right : add this attribute to align the picker on right
213220
214- (14 ) id : it assign id such as 'passedstring-input' to input help diffrentiate between two date-time-picker on same component.
221+ (13 ) id : it assign id such as 'passedstring-input' to input help diffrentiate between two date-time-picker on same component.
215222
216223> Any additionnal attribute passed to the component will be automatically be binded to the input component. (eg. if you passes a ` type ` attribute, the ` <input> ` will receive it).
217224
0 commit comments