@gorse/shards-vue 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/.editorconfig +13 -0
  2. package/CHANGELOG.md +49 -0
  3. package/CONTRIBUTING.md +92 -0
  4. package/ISSUE_TEMPLATE.md +19 -0
  5. package/LICENSE +21 -0
  6. package/README.md +157 -0
  7. package/build/optimize.js +49 -0
  8. package/build/paths.js +12 -0
  9. package/build/rollup.config.js +106 -0
  10. package/dist/shards-vue.common.js +13994 -0
  11. package/dist/shards-vue.common.js.map +1 -0
  12. package/dist/shards-vue.common.min.js +1 -0
  13. package/dist/shards-vue.common.min.map +1 -0
  14. package/dist/shards-vue.esm.js +13990 -0
  15. package/dist/shards-vue.esm.js.map +1 -0
  16. package/dist/shards-vue.esm.min.js +1 -0
  17. package/dist/shards-vue.esm.min.map +1 -0
  18. package/dist/shards-vue.umd.js +13997 -0
  19. package/dist/shards-vue.umd.js.map +1 -0
  20. package/dist/shards-vue.umd.min.js +1 -0
  21. package/dist/shards-vue.umd.min.map +1 -0
  22. package/logo.jpg +0 -0
  23. package/package.json +121 -0
  24. package/sandbox/Sandbox.vue +45 -0
  25. package/src/components/alert/Alert.vue +156 -0
  26. package/src/components/alert/README.md +86 -0
  27. package/src/components/alert/index.js +17 -0
  28. package/src/components/badge/Badge.vue +62 -0
  29. package/src/components/badge/README.md +112 -0
  30. package/src/components/badge/index.js +17 -0
  31. package/src/components/breadcrumb/Breadcrumb.vue +55 -0
  32. package/src/components/breadcrumb/BreadcrumbItem.vue +42 -0
  33. package/src/components/breadcrumb/BreadcrumbLink.vue +56 -0
  34. package/src/components/breadcrumb/README.md +53 -0
  35. package/src/components/breadcrumb/index.js +23 -0
  36. package/src/components/button/Button.vue +107 -0
  37. package/src/components/button/ButtonClose.vue +47 -0
  38. package/src/components/button/README.md +197 -0
  39. package/src/components/button/index.js +21 -0
  40. package/src/components/button-group/ButtonGroup.vue +66 -0
  41. package/src/components/button-group/README.md +72 -0
  42. package/src/components/button-group/index.js +18 -0
  43. package/src/components/button-toolbar/ButtonToolbar.vue +29 -0
  44. package/src/components/button-toolbar/README.md +24 -0
  45. package/src/components/button-toolbar/index.js +18 -0
  46. package/src/components/card/Card.vue +57 -0
  47. package/src/components/card/CardBody.vue +92 -0
  48. package/src/components/card/CardFooter.vue +61 -0
  49. package/src/components/card/CardGroup.vue +47 -0
  50. package/src/components/card/CardHeader.vue +61 -0
  51. package/src/components/card/CardImg.vue +64 -0
  52. package/src/components/card/README.md +96 -0
  53. package/src/components/card/index.js +27 -0
  54. package/src/components/collapse/Collapse.vue +209 -0
  55. package/src/components/collapse/README.md +86 -0
  56. package/src/components/collapse/index.js +17 -0
  57. package/src/components/container/Col.vue +125 -0
  58. package/src/components/container/Container.vue +31 -0
  59. package/src/components/container/README.md +91 -0
  60. package/src/components/container/Row.vue +64 -0
  61. package/src/components/container/index.js +21 -0
  62. package/src/components/datepicker/Datepicker.vue +391 -0
  63. package/src/components/datepicker/README.md +185 -0
  64. package/src/components/datepicker/index.js +17 -0
  65. package/src/components/dropdown/Dropdown.vue +442 -0
  66. package/src/components/dropdown/DropdownDivider.vue +22 -0
  67. package/src/components/dropdown/DropdownHeader.vue +29 -0
  68. package/src/components/dropdown/DropdownItem.vue +25 -0
  69. package/src/components/dropdown/README.md +177 -0
  70. package/src/components/dropdown/index.js +23 -0
  71. package/src/components/embed/Embed.vue +47 -0
  72. package/src/components/embed/README.md +23 -0
  73. package/src/components/embed/index.js +17 -0
  74. package/src/components/form/Form.vue +40 -0
  75. package/src/components/form/FormFeedback.vue +39 -0
  76. package/src/components/form/FormInvalidFeedback.vue +39 -0
  77. package/src/components/form/FormRow.vue +21 -0
  78. package/src/components/form/FormText.vue +41 -0
  79. package/src/components/form/FormValidFeedback.vue +39 -0
  80. package/src/components/form/README.md +84 -0
  81. package/src/components/form/index.js +29 -0
  82. package/src/components/form-checkbox/FormCheckbox.vue +200 -0
  83. package/src/components/form-checkbox/README.md +131 -0
  84. package/src/components/form-checkbox/index.js +18 -0
  85. package/src/components/form-input/FormInput.vue +176 -0
  86. package/src/components/form-input/README.md +110 -0
  87. package/src/components/form-input/index.js +18 -0
  88. package/src/components/form-radio/FormRadio.vue +155 -0
  89. package/src/components/form-radio/README.md +61 -0
  90. package/src/components/form-radio/index.js +18 -0
  91. package/src/components/form-select/FormSelect.vue +246 -0
  92. package/src/components/form-select/README.md +180 -0
  93. package/src/components/form-select/index.js +18 -0
  94. package/src/components/form-textarea/FormTextarea.vue +250 -0
  95. package/src/components/form-textarea/README.md +74 -0
  96. package/src/components/form-textarea/index.js +18 -0
  97. package/src/components/image/Image.vue +123 -0
  98. package/src/components/image/README.md +32 -0
  99. package/src/components/image/index.js +18 -0
  100. package/src/components/index.js +63 -0
  101. package/src/components/input-group/InputGroup.vue +125 -0
  102. package/src/components/input-group/InputGroupAddon.vue +58 -0
  103. package/src/components/input-group/InputGroupText.vue +20 -0
  104. package/src/components/input-group/README.md +188 -0
  105. package/src/components/input-group/index.js +21 -0
  106. package/src/components/link/Link.vue +157 -0
  107. package/src/components/link/README.md +27 -0
  108. package/src/components/link/create-link-props.js +54 -0
  109. package/src/components/link/index.js +17 -0
  110. package/src/components/list-group/ListGroup.vue +30 -0
  111. package/src/components/list-group/ListGroupItem.vue +90 -0
  112. package/src/components/list-group/README.md +23 -0
  113. package/src/components/list-group/index.js +19 -0
  114. package/src/components/modal/Modal.vue +121 -0
  115. package/src/components/modal/ModalBody.vue +20 -0
  116. package/src/components/modal/ModalFooter.vue +21 -0
  117. package/src/components/modal/ModalHeader.vue +39 -0
  118. package/src/components/modal/ModalTitle.vue +21 -0
  119. package/src/components/modal/README.md +74 -0
  120. package/src/components/modal/index.js +25 -0
  121. package/src/components/nav/Nav.vue +62 -0
  122. package/src/components/nav/NavItem.vue +23 -0
  123. package/src/components/nav/NavText.vue +21 -0
  124. package/src/components/nav/README.md +94 -0
  125. package/src/components/nav/index.js +19 -0
  126. package/src/components/navbar/Navbar.vue +63 -0
  127. package/src/components/navbar/NavbarBrand.vue +41 -0
  128. package/src/components/navbar/NavbarNav.vue +38 -0
  129. package/src/components/navbar/NavbarToggle.vue +55 -0
  130. package/src/components/navbar/README.md +51 -0
  131. package/src/components/navbar/index.js +23 -0
  132. package/src/components/popover/Popover.vue +126 -0
  133. package/src/components/popover/README.md +73 -0
  134. package/src/components/popover/index.js +17 -0
  135. package/src/components/progress/Progress.vue +93 -0
  136. package/src/components/progress/ProgressBar.vue +123 -0
  137. package/src/components/progress/README.md +95 -0
  138. package/src/components/progress/index.js +19 -0
  139. package/src/components/slider/README.md +120 -0
  140. package/src/components/slider/Slider.vue +103 -0
  141. package/src/components/slider/index.js +17 -0
  142. package/src/components/tabs/README.md +111 -0
  143. package/src/components/tabs/Tab.vue +132 -0
  144. package/src/components/tabs/Tabs.vue +290 -0
  145. package/src/components/tabs/_TabButton.vue +130 -0
  146. package/src/components/tabs/index.js +19 -0
  147. package/src/components/tooltip/README.md +70 -0
  148. package/src/components/tooltip/Tooltip.vue +115 -0
  149. package/src/components/tooltip/index.js +17 -0
  150. package/src/directives/index.js +7 -0
  151. package/src/directives/toggle/index.js +16 -0
  152. package/src/directives/toggle/toggle.js +45 -0
  153. package/src/directives/tooltip/README.md +42 -0
  154. package/src/directives/tooltip/index.js +16 -0
  155. package/src/directives/tooltip/meta.json +5 -0
  156. package/src/directives/tooltip/tooltip.js +145 -0
  157. package/src/index.js +27 -0
  158. package/src/markdown/getting-started/README.md +80 -0
  159. package/src/markdown/getting-started/meta.json +4 -0
  160. package/src/markdown/roadmap/README.md +3 -0
  161. package/src/markdown/roadmap/meta.json +4 -0
  162. package/src/mixins/checkbox-radio.mixin.js +73 -0
  163. package/src/mixins/root-listener.mixin.js +32 -0
  164. package/src/mixins/tooltip-popover.mixin.js +292 -0
  165. package/src/scripts/utils.js +18 -0
  166. package/src/utils/constants.js +191 -0
  167. package/src/utils/events.js +48 -0
  168. package/src/utils/index.js +251 -0
  169. package/src/utils/observer.js +56 -0
  170. package/src/utils/popover.class.js +91 -0
  171. package/src/utils/target.js +50 -0
  172. package/src/utils/tooltip.class.js +60 -0
  173. package/src/utils/tpmanager.class.js +730 -0
@@ -0,0 +1,391 @@
1
+ <template>
2
+ <VueDatepicker
3
+ :value="value"
4
+ :name="name"
5
+ :id="id"
6
+ :format="format"
7
+ :language="language"
8
+ :open-date="openDate"
9
+ :day-cell-content="dayCellContent"
10
+ :full-month-name="fullMonthName"
11
+ :disabled-dates="disabledDates"
12
+ :highlighted="highlighted"
13
+ :placeholder="placeholder"
14
+ :inline="inline"
15
+ :calendar-class="computedCalendarClass"
16
+ :input-class="inputClass"
17
+ :wrapper-class="wrapperClass"
18
+ :monday-first="mondayFirst"
19
+ :clear-button="clearButton"
20
+ :clear-button-icon="clearButtonIcon"
21
+ :calendar-button="calendarButton"
22
+ :calendar-button-icon="calendarButtonIcon"
23
+ :calendar-button-icon-content="calendarButtonIconContent"
24
+ :initial-view="initialView"
25
+ :disabled="disabled"
26
+ :required="required"
27
+ :typeable="typeable"
28
+ :use-utc="useUtc"
29
+ :minimum-view="minimumView"
30
+ :maximum-view="maximumView"
31
+ v-on="$listeners">
32
+ <slot name="beforeCalendarHeader" slot="beforeCalendarHeader" />
33
+ <slot name="afterDateInput" slot="afterDateInput" />
34
+ </VueDatepicker>
35
+ </template>
36
+
37
+ <script>
38
+ import VueDatepicker from 'vuejs-datepicker'
39
+
40
+ // Validator function that checks the date props.
41
+ const _datePropValidator = (v) => {
42
+ return v === null
43
+ || v instanceof Date
44
+ || typeof v === 'string'
45
+ || typeof v === 'number'
46
+ }
47
+
48
+ export default {
49
+ name: 'd-datepicker',
50
+ components: { VueDatepicker },
51
+ props: {
52
+ /**
53
+ * The datepicker's value.
54
+ */
55
+ value: {
56
+ validator: _datePropValidator
57
+ },
58
+ /**
59
+ * The name.
60
+ */
61
+ name: {
62
+ type: String,
63
+ default: null
64
+ },
65
+ /**
66
+ * The component's ID.
67
+ */
68
+ id: {
69
+ type: String,
70
+ default: null
71
+ },
72
+ /**
73
+ * The date format.
74
+ */
75
+ format: {
76
+ type: [String, Function],
77
+ default: 'dd MMM yyyy'
78
+ },
79
+ /**
80
+ * The language.
81
+ */
82
+ language: Object,
83
+ /**
84
+ * If set, the datepicker will open on this date.
85
+ */
86
+ openDate: {
87
+ validator: _datePropValidator
88
+ },
89
+ /**
90
+ * Function used to render custom content inside the day cell.
91
+ */
92
+ dayCellContent: Function,
93
+ /**
94
+ * Whether to show the full month name, or not.
95
+ */
96
+ fullMonthName: Boolean,
97
+ /**
98
+ * Configure disabled dates.
99
+ */
100
+ disabledDates: Object,
101
+ /**
102
+ * Highlight dates.
103
+ */
104
+ highlighted: Object,
105
+ /**
106
+ * The placeholder.
107
+ */
108
+ placeholder: String,
109
+ /**
110
+ * Show the datepicker always open.
111
+ */
112
+ inline: Boolean,
113
+ /**
114
+ * The CSS class applied to the calendar element.
115
+ */
116
+ calendarClass: {
117
+ type: [String, Object, Array],
118
+ default: ''
119
+ },
120
+ /**
121
+ * The CSS Class applied to the input element.
122
+ */
123
+ inputClass: {
124
+ type: [String, Object, Array],
125
+ default: 'form-control'
126
+ },
127
+ /**
128
+ * The CSS class applied to the wrapper element.
129
+ */
130
+ wrapperClass: [String, Object, Array],
131
+ /**
132
+ * Whether Monday is the first day, or not.
133
+ */
134
+ mondayFirst: Boolean,
135
+ /**
136
+ * Display a button for clearing the dates.
137
+ */
138
+ clearButton: Boolean,
139
+ /**
140
+ * Use an icon for the clear button.
141
+ */
142
+ clearButtonIcon: String,
143
+ /**
144
+ * Dislay a calendar button.
145
+ */
146
+ calendarButton: Boolean,
147
+ /**
148
+ * The calendar button's icon.
149
+ */
150
+ calendarButtonIcon: String,
151
+ /**
152
+ * The calendar button's icon content.
153
+ */
154
+ calendarButtonIconContent: String,
155
+ /**
156
+ * If set, the datepicker is opened on that specific view.
157
+ */
158
+ initialView: String,
159
+ /**
160
+ * The disabled state.
161
+ */
162
+ disabled: Boolean,
163
+ /**
164
+ * The required state.
165
+ */
166
+ required: Boolean,
167
+ /**
168
+ * Whether to allow users to type the date, or not.
169
+ */
170
+ typeable: Boolean,
171
+ /**
172
+ * Use UTC for time calculations.
173
+ */
174
+ useUtc: Boolean,
175
+ /**
176
+ * If set, the lower-level views will not be shown.
177
+ */
178
+ minimumView: {
179
+ type: String,
180
+ default: 'day'
181
+ },
182
+ /**
183
+ * If set, the higher-level views will not be shown.
184
+ */
185
+ maximumView: {
186
+ type: String,
187
+ default: 'year'
188
+ },
189
+ /**
190
+ * Whether the datepicker should be small, or not.
191
+ */
192
+ small: {
193
+ type: Boolean,
194
+ default: false
195
+ }
196
+ },
197
+ computed: {
198
+ computedCalendarClass() {
199
+ let _calendarClass = this.small ? 'vdp-datepicker__small' : ''
200
+
201
+ return _calendarClass += this.calendarClass
202
+ }
203
+ }
204
+ }
205
+ </script>
206
+
207
+ <style lang="scss">
208
+ @use "sass:color";
209
+
210
+ $white: #fff;
211
+ $black: #000;
212
+
213
+ $color-silver-sand: #c3c7cc;
214
+ $color-primary: #007bff;
215
+ $color-shuttle-gray: #5a6169;
216
+ $color-porcelain: #eceeef;
217
+
218
+ $border-color: transparent;
219
+ $border-radius-default: .375rem;
220
+ $transition-default: all 250ms cubic-bezier(.27,.01,.38,1.06);
221
+ $font-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
222
+
223
+ $datepicker-color: $color-shuttle-gray;
224
+ $datepicker-min-width: 10rem;
225
+ $datepicker-background-color: $white;
226
+ $datepicker-border-radius: $border-radius-default;
227
+ $datepicker-font-size: 1rem;
228
+ $datepicker-padding-x: 22px;
229
+ $datepicker-padding-y: 20px;
230
+ $datepicker-font-weight: 300;
231
+ $datepicker-border: 1px solid rgba($black,.05);
232
+ $datepicker-drop-shadows: 0 0.5rem 4rem rgba($black,.11),
233
+ 0 10px 20px rgba($black,.05),
234
+ 0 2px 3px rgba($black,.06);
235
+
236
+ $datepicker-cell-width: 36px;
237
+ $datepicker-cell-height: 36px;
238
+ $datepicker-cell-hover-color: $color-porcelain;
239
+ $datepicker-cell-line-height: 2;
240
+ $datepicker-cell-font-size: 1rem;
241
+
242
+ $datepicker-small-padding-y: .625rem;
243
+ $datepicker-small-padding-x: .625rem;
244
+ $datepicker-small-font-size: .75rem;
245
+ $datepicker-small-max-width: 235px;
246
+
247
+ $datepicker-small-day-font-size: 12px;
248
+ $datepicker-small-day-font-weight: 500;
249
+ $datepicker-small-day-width: 1.875rem;
250
+ $datepicker-small-day-height: 1.875rem;
251
+ $datepicker-small-day-line-height: 2.25;
252
+
253
+ $datepicker-small-day-header-font-size: 100%;
254
+
255
+ div.vdp-datepicker {
256
+ &__calendar {
257
+ color: $datepicker-color;
258
+ padding: $datepicker-padding-y $datepicker-padding-x;
259
+ min-width: $datepicker-min-width;
260
+ font-size: $datepicker-font-size;
261
+ font-weight: $datepicker-font-weight;
262
+ font-family: $font-system;
263
+ background-color: $datepicker-background-color;
264
+ border: $datepicker-border;
265
+ border-radius: $datepicker-border-radius;
266
+ box-shadow: $datepicker-drop-shadows;
267
+ border: 1px solid rgba($black,.15) !important;
268
+
269
+ // Header
270
+ header {
271
+ display: flex;
272
+ padding-bottom: 10px;
273
+
274
+ span {
275
+ transition: $transition-default;
276
+ border-radius: $border-radius-default;
277
+ font-weight: 500;
278
+
279
+ &.next:after {
280
+ border-left-color: $color-silver-sand;
281
+ }
282
+
283
+ &.prev:after {
284
+ border-right-color: $color-silver-sand;
285
+ }
286
+ }
287
+ }
288
+
289
+ // Header elements and specific calendar cells.
290
+ header span,
291
+ .cell.day:not(.disabled):not(.blank), .cell.month, .cell.year {
292
+ &:hover {
293
+ background-color: $datepicker-cell-hover-color;
294
+ border-color: $border-color !important;
295
+ }
296
+ }
297
+
298
+ // Cells
299
+ .cell {
300
+ line-height: $datepicker-cell-line-height;
301
+ font-size: $datepicker-cell-font-size;
302
+ border-radius: $border-radius-default;
303
+ transition: $transition-default;
304
+ border-color: $border-color;
305
+ height: auto;
306
+
307
+ // Day headers
308
+ &.day-header {
309
+ font-weight: 500;
310
+ }
311
+
312
+ // Days
313
+ &.day {
314
+ width: $datepicker-cell-width;
315
+ height: $datepicker-cell-height;
316
+ border-radius: 50%;
317
+ }
318
+
319
+ // Months
320
+ &.month,
321
+ &.year {
322
+ height: $datepicker-cell-height;
323
+ font-size: 12px;
324
+ line-height: 33px;
325
+ }
326
+
327
+ // Selected
328
+ &.selected,
329
+ &.highlighted.selected {
330
+ background: $color-primary !important;
331
+ color: $white;
332
+ &:hover {
333
+ background: color.adjust($color-primary, $lightness: -5%) !important;
334
+ border-color: $border-color !important;
335
+ }
336
+ }
337
+
338
+ &.highlighted {
339
+ background: $color-primary;
340
+ color: $white;
341
+
342
+ &:hover {
343
+ background: color.adjust($color-primary, $lightness: -5%) !important;
344
+ border-color: $border-color !important;
345
+ }
346
+
347
+ &:not(.highlight-start):not(.highlight-end) {
348
+ border-radius: 0;
349
+ }
350
+
351
+ &.highlight-start {
352
+ border-top-right-radius: 0;
353
+ border-bottom-right-radius: 0;
354
+ }
355
+
356
+ &.highlight-end {
357
+ border-top-left-radius: 0;
358
+ border-bottom-left-radius: 0;
359
+ }
360
+ }
361
+ }
362
+ }
363
+
364
+ // Small Datepicker modifier.
365
+ &__small {
366
+ padding: $datepicker-small-padding-y $datepicker-small-padding-x;
367
+ font-size: $datepicker-small-font-size;
368
+ max-width: $datepicker-small-max-width;
369
+
370
+ .cell {
371
+ &.day {
372
+ width: $datepicker-small-day-width;
373
+ height: $datepicker-small-day-height;
374
+ line-height: $datepicker-small-day-line-height;
375
+ }
376
+
377
+ &.day,
378
+ &.month,
379
+ &.year {
380
+ font-size: $datepicker-small-day-font-size;
381
+ font-weight: $datepicker-small-day-font-weight;
382
+ }
383
+
384
+ &.day-header {
385
+ font-size: $datepicker-small-day-header-font-size;
386
+ }
387
+ }
388
+ }
389
+ }
390
+ </style>
391
+
@@ -0,0 +1,185 @@
1
+ # Datepickers
2
+
3
+ Datepickers in Shards Vue are wrappers over the `vuejs-datepicker` component. You can learn more about the component in [the official component's GitHub repository](https://github.com/charliekassel/vuejs-datepicker), or follow the short guide below for an overview of how to use datepickers in Shards Vue.
4
+
5
+ ## Basic Example
6
+
7
+ Creating a datepicker can be easily achieved using the `<d-datepicker>` component.
8
+
9
+ :::demo
10
+ ```html
11
+
12
+ <template>
13
+ <div>
14
+ <div>Opened: <span :class="[opened ? 'text-success' : 'text-danger']">{{ opened }}</span></div>
15
+ <div>📅 Date: <span>{{ date }}</span></div>
16
+ <d-datepicker
17
+ v-model="date"
18
+ @opened="handleOpened"
19
+ @closed="handleClosed"
20
+ typeable />
21
+ </div>
22
+ </template>
23
+
24
+ <script>
25
+ export default {
26
+ data() {
27
+ return {
28
+ opened: false,
29
+ date: new Date(2018, 8, 23)
30
+ }
31
+ },
32
+ methods: {
33
+ handleOpened() {
34
+ this.opened = true
35
+ },
36
+ handleClosed() {
37
+ this.opened = false
38
+ }
39
+ }
40
+ }
41
+ </script>
42
+
43
+ <!-- datepicker-1.vue -->
44
+ ```
45
+ :::
46
+
47
+
48
+ ## Disabled Dates
49
+
50
+ There are multiple ways that you can follow in order to display disabled dates.
51
+
52
+ :::demo
53
+ ```html
54
+
55
+ <template>
56
+ <div>
57
+ <div>📅 Date: <span>{{ date }}</span></div>
58
+ <d-datepicker
59
+ v-model="date"
60
+ :disabled-dates="disabledDates"
61
+ typeable />
62
+ </div>
63
+ </template>
64
+
65
+ <script>
66
+ export default {
67
+ data() {
68
+ return {
69
+ date: new Date(2018, 8, 23),
70
+ disabledDates: {
71
+ // Disable all the dates up to specific date.
72
+ to: new Date(2016, 0, 5),
73
+
74
+ // Disable all dates after specific date.
75
+ from: new Date(2016, 0, 26),
76
+
77
+ // Disable only Saturdays and Sundays.
78
+ days: [6, 0],
79
+
80
+ // Disable 29th, 30th and 31st of each month.
81
+ daysOfMonth: [29, 30, 31],
82
+
83
+ // Disable an array of dates.
84
+ dates: [
85
+ new Date(2016, 9, 16),
86
+ new Date(2016, 9, 17),
87
+ new Date(2016, 9, 18)
88
+ ],
89
+
90
+ // Disable dates in given ranges (exclusive).
91
+ ranges: [{
92
+ from: new Date(2016, 11, 25),
93
+ to: new Date(2016, 11, 30)
94
+ }, {
95
+ from: new Date(2017, 1, 12),
96
+ to: new Date(2017, 2, 25)
97
+ }],
98
+
99
+ /**
100
+ * You can also use a custom predictor function that returns true if
101
+ * the date is disabled or false if it's not. You can use this callback
102
+ * validator to provide your own date checking logic in case the options
103
+ * above are not sufficient for your own use case.
104
+ */
105
+ customPredictor: function(date) {
106
+ // Disables the date if it is a multiple of 5.
107
+ if(date.getDate() % 5 == 0){
108
+ return true
109
+ }
110
+ }
111
+ }
112
+ }
113
+ }
114
+ }
115
+ </script>
116
+
117
+ <!-- datepicker-2.vue -->
118
+ ```
119
+ :::
120
+
121
+
122
+ ## Highlighted Dates
123
+
124
+ :::demo
125
+ ```html
126
+
127
+ <template>
128
+ <div>
129
+ <div>📅 Date: <span>{{ date }}</span></div>
130
+ <d-datepicker
131
+ v-model="date"
132
+ :highlighted="highlightedDates"
133
+ typeable />
134
+ </div>
135
+ </template>
136
+
137
+ <script>
138
+ export default {
139
+ data() {
140
+ return {
141
+ date: new Date(2018, 8, 23),
142
+ highlightedDates: {
143
+ // Highlight all dates up to specific date.
144
+ to: new Date(2016, 0, 5),
145
+
146
+ // Highlight all dates after specific date.
147
+ from: new Date(2016, 0, 26),
148
+
149
+ // Highlight Saturdays and Sundays.
150
+ days: [6, 0],
151
+
152
+ // Highlight 15th, 20th and 31st of each month.
153
+ daysOfMonth: [15, 20, 31],
154
+
155
+ // Highlight an array of dates.
156
+ dates: [
157
+ new Date(2016, 9, 16),
158
+ new Date(2016, 9, 17),
159
+ new Date(2016, 9, 18)
160
+ ],
161
+
162
+ /**
163
+ * You can also use a custom predictor function that returns true if
164
+ * the date is highlighted or false if it's not. You can use this callback
165
+ * validator to provide your own date checking logic in case the options
166
+ * above are not sufficient for your own use case.
167
+ */
168
+ customPredictor: function(date) {
169
+ // Highlights the date if it is a multiple of 4.
170
+ if(date.getDate() % 4 == 0){
171
+ return true
172
+ }
173
+ },
174
+
175
+ // Highlight disabled dates
176
+ includeDisabled: true
177
+ }
178
+ }
179
+ }
180
+ }
181
+ </script>
182
+
183
+ <!-- datepicker-3.vue -->
184
+ ```
185
+ :::
@@ -0,0 +1,17 @@
1
+ import { registerComponents, vueUse } from './../../utils'
2
+
3
+ import dDatepicker from './Datepicker.vue'
4
+
5
+ const components = {
6
+ dDatepicker
7
+ }
8
+
9
+ const VuePlugin = {
10
+ install (Vue) {
11
+ registerComponents(Vue, components)
12
+ }
13
+ }
14
+
15
+ vueUse(VuePlugin)
16
+
17
+ export default VuePlugin