|
| 1 | +<template> |
| 2 | + <div id="app"> |
| 3 | + <div class="titles"> |
| 4 | + <h1>VUE DATEPCIKER COMPONENT</h1> |
| 5 | + <div class="using"> |
| 6 | + <div> |
| 7 | + <span class="install">npm install vue-datepicker-component</span> or |
| 8 | + <span class="install">yarn add vue-datepicker-component</span> |
| 9 | + </div> |
| 10 | + <code class="code" v-html="exampleCode"> |
| 11 | + </code> |
| 12 | + </div> |
| 13 | + <div class="viewCode"> |
| 14 | + <a href="https://github.com/edisdev/vue-datepicker-ui" target="_blank"> |
| 15 | + View Github Repository |
| 16 | + </a> |
| 17 | + <p>Thank you so much in advance for stars & supports. 😍👍 |
| 18 | + </p> |
| 19 | + </div> |
| 20 | + </div> |
| 21 | + <div class="example" |
| 22 | + v-for="(example,index) in examples" |
| 23 | + :key="index"> |
| 24 | + <h3>{{ example.title }}</h3> |
| 25 | + <Calendar |
| 26 | + v-model="example.value" |
| 27 | + :range="example.range" |
| 28 | + :lang="example.lang" |
| 29 | + :firstDayOfWeek="example.firstDayOfWeek" |
| 30 | + :input-class="example.inputClass" |
| 31 | + :position="example.position" |
| 32 | + :disabled-start-date="example.disabledStartDate" |
| 33 | + :text-format="example.textFormat" |
| 34 | + :date-format="example.dateFormat" |
| 35 | + :disabled-end-date="example.disabledEndDate"/> |
| 36 | + <blockquote class="exam-props"> |
| 37 | + <textarea :value="JSON.stringify(example, null, 2)" readonly> |
| 38 | + </textarea> |
| 39 | + </blockquote> |
| 40 | + </div> |
| 41 | + </div> |
| 42 | +</template> |
| 43 | + |
| 44 | +<script> |
| 45 | +import Calendar from './components/calendar.vue' |
| 46 | +
|
| 47 | +export default { |
| 48 | + name: 'app', |
| 49 | + components: { |
| 50 | + Calendar |
| 51 | + }, |
| 52 | + data() { |
| 53 | + return { |
| 54 | + exampleCode: '< Calendar <br> v-model="example.value" <br> :range="example.range" <br> :lang="example.lang" <br> :firstDayOfWeek="example.firstDayOfWeek" <br> :input-class="example.inputClass" <br> :position="example.position" <br> :disabled-start-date="example.disabledStartDate" <br> :text-format="example.textFormat" <br> :date-format="example.dateFormat" <br> :disabled-end-date="example.disabledEndDate"/>', |
| 55 | + examples: [ |
| 56 | + { title: 'Single', |
| 57 | + inputClass: 'exampleDatePicker', |
| 58 | + lang: 'tr', |
| 59 | + position: 'bottom', |
| 60 | + range: false, |
| 61 | + value: new Date(), |
| 62 | + firstDayOfWeek: 'monday' |
| 63 | + }, |
| 64 | + { title: 'Range', |
| 65 | + inputClass: 'exampleDatePicker', |
| 66 | + lang: 'tr', |
| 67 | + position: 'bottom', |
| 68 | + range: true, |
| 69 | + value: [new Date(), new Date(new Date().getTime() + ( 9 * 24 * 60 * 60 * 1000))], |
| 70 | + firstDayOfWeek: 'monday' |
| 71 | + }, |
| 72 | + { title: 'Custom lang, First day of week', |
| 73 | + inputClass: 'exampleDatePicker', |
| 74 | + lang: 'en', |
| 75 | + position: 'right', |
| 76 | + range: true, |
| 77 | + value: [new Date(), new Date(new Date().getTime() + ( 9 * 24 * 60 * 60 * 1000))], |
| 78 | + firstDayOfWeek: 'sunday' |
| 79 | + }, |
| 80 | + { title: 'Disabled Status', |
| 81 | + inputClass: 'exampleDatePicker', |
| 82 | + lang: 'ar', |
| 83 | + position: 'top', |
| 84 | + disabledStartDate: { |
| 85 | + to: new Date(new Date().getTime() - ( 20 * 24 * 60 * 60 * 1000)), |
| 86 | + from: new Date(new Date().getTime() - ( 1 * 24 * 60 * 60 * 1000)) |
| 87 | + }, |
| 88 | + value: new Date(new Date().getTime() - ( 5 * 24 * 60 * 60 * 1000)) |
| 89 | + }, |
| 90 | + { title: 'Date Options String', |
| 91 | + inputClass: 'exampleDatePicker', |
| 92 | + lang: 'en', |
| 93 | + position: 'left', |
| 94 | + textFormat: 'long', |
| 95 | + value: new Date() |
| 96 | + }, |
| 97 | + { title: 'Showed Date Format', |
| 98 | + inputClass: 'exampleDatePicker', |
| 99 | + lang: 'en', |
| 100 | + position: 'right', |
| 101 | + value: new Date(), |
| 102 | + dateFormat: {day: '2-digit', month: '2-digit', year: 'numeric'} |
| 103 | + }, |
| 104 | + ] |
| 105 | + } |
| 106 | + } |
| 107 | +} |
| 108 | +</script> |
| 109 | + |
| 110 | +<style> |
| 111 | +* { |
| 112 | + box-sizing: border-box; |
| 113 | + padding: 0; |
| 114 | + margin: 0; |
| 115 | +} |
| 116 | +#app { |
| 117 | + font-family: 'Avenir', Helvetica, Arial, sans-serif; |
| 118 | + -webkit-font-smoothing: antialiased; |
| 119 | + -moz-osx-font-smoothing: grayscale; |
| 120 | + display: flex; |
| 121 | + width: 98vw; |
| 122 | + padding-top: 50px; |
| 123 | + padding-bottom: 200px; |
| 124 | + padding-left: 2vw; |
| 125 | + padding-right: 2vw; |
| 126 | + flex-wrap: wrap; |
| 127 | +} |
| 128 | +.titles { |
| 129 | + width: 98vw; |
| 130 | + border-bottom: 1px solid #dedeee; |
| 131 | + padding-bottom: 20px; |
| 132 | + text-align: center; |
| 133 | +} |
| 134 | +.titles .viewCode { |
| 135 | + margin-top: 10px; |
| 136 | +} |
| 137 | +.titles .viewCode a { |
| 138 | + color: #1bba67; |
| 139 | + font-weight: bold; |
| 140 | +} |
| 141 | +.titles .viewCode p { |
| 142 | + margin-top: 5px; |
| 143 | + font-weight: bold; |
| 144 | +} |
| 145 | +.titles .using { |
| 146 | + display: flex; |
| 147 | + flex-direction: column; |
| 148 | + align-items: center; |
| 149 | + margin-top: 20px; |
| 150 | +} |
| 151 | +.titles .using .install{ |
| 152 | + font-size: 16px; |
| 153 | + background: #000; |
| 154 | + border-radius: 4px; |
| 155 | + color: #ffb00f; |
| 156 | + padding: 10px; |
| 157 | +} |
| 158 | +.titles .using .code { |
| 159 | + width: 40%; |
| 160 | + background: #000; |
| 161 | + display: block; |
| 162 | + align-self: center; |
| 163 | + color: #1bba67; |
| 164 | + padding: 20px; |
| 165 | + font-size: 16px; |
| 166 | + margin-top: 30px; |
| 167 | + border-radius: 4px; |
| 168 | + text-align: left; |
| 169 | +} |
| 170 | +
|
| 171 | +.example { |
| 172 | + padding-left: 3vw; |
| 173 | + min-width: 30vw; |
| 174 | + padding-top: 30px; |
| 175 | + border-bottom: 1px solid #eaeaeb; |
| 176 | +} |
| 177 | +.example:nth-child(3n-1) , .example:nth-child(3n) { |
| 178 | + border-right: 1px solid #eaeaeb; |
| 179 | +} |
| 180 | +.example h3 { |
| 181 | + margin-bottom: 20px; |
| 182 | +} |
| 183 | +.example .exam-props { |
| 184 | + height: 250px; |
| 185 | + margin-top: 20px; |
| 186 | +} |
| 187 | +
|
| 188 | +.example .exam-props textarea{ |
| 189 | + margin-top: 20px; |
| 190 | + height: 200px; |
| 191 | + padding: 7px; |
| 192 | + border-radius: 6px; |
| 193 | + border-color: #eaeaeb; |
| 194 | + resize: none; |
| 195 | + width: 95%; |
| 196 | +} |
| 197 | +</style> |
0 commit comments