Skip to content

Commit 287a455

Browse files
author
Nathan Reyes
committed
Forward 'min-date' and 'max-date' props (Closes #78). Add navigation styling (Closes #93). Support synced calendar panes (Closes #80). Add vertical orientation (Closes #89).
1 parent 5bc69cc commit 287a455

File tree

17 files changed

+701
-481
lines changed

17 files changed

+701
-481
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.DS_Store
22
node_modules/
33
dist/
4+
docs/
45
lib/
56
working/
67
npm-debug.log*

CHANGELOG.md

Lines changed: 67 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,74 @@
1+
## Bug Fixes
2+
### `v-date-picker`
3+
* Fixed glitch with highlight cap animation when `mode === "range"`
4+
* Fixed bug with `themeStyles.dayContent` style getting ignored. Closes #115.
5+
6+
## Improvements
7+
### `v-calendar`
8+
* Added `min-date` prop as a convenient alternative to `min-page`
9+
* Added `max-date` prop as a convenient alternative to `max-page`
10+
* Added `is-linked` prop to link panes to consecutive months when `is-double-paned` is set. Closes #80.
11+
* Added `is-vertical` prop for vertical calendar orientation when `is-double-paned` is set. Closes #89.
12+
13+
### Defaults
14+
Theme styles modifications. Closes #93.
15+
16+
| Style | Modification | Description |
17+
| ----- | ------------ | ----- |
18+
| `horizontalDivider` | Added | Horizontal divider when calendars are in vertical orientation (`is-vertical`) |
19+
| `navHeader` | Added | Navigation pane header. |
20+
| `navHeaderTitle` | Added | Navigation pane header title. |
21+
| `navHeaderArrows` | Added | Navigation pane header arrows. |
22+
| `navMonthCell` | Added | Navigation pane month cells. |
23+
| `navYearCell` | Added | Navigation pane year cells. |
24+
| `header` | Edited | Supports use of function that accepts a [`page`](https://docs.vcalendar.io/api#page-object) object and return a style |
25+
| `headerTitle` | Edited | Supports use of function that accepts a [`page`](https://docs.vcalendar.io/api#page-object) object and return a style |
26+
| `headerArrows` | Edited | Supports use of function that accepts a [`page`](https://docs.vcalendar.io/api#page-object) object and return a style |
27+
| `headerHorizontalDivider` | Edited | Supports use of function that accepts a [`page`](https://docs.vcalendar.io/api#page-object) object and return a style |
28+
| `weekdays` | Edited | Supports use of function that accepts a [`page`](https://docs.vcalendar.io/api#page-object) object and return a style |
29+
| `weekdaysHorizontalDivider` | Edited | Supports use of function that accepts a [`page`](https://docs.vcalendar.io/api#page-object) object and return a style |
30+
| `weeks` | Edited | Supports use of function that accepts a [`page`](https://docs.vcalendar.io/api#page-object) object and return a style |
31+
| ~~`headerVerticalDivider`~~ | Removed | *Reference note below* |
32+
| ~~`weekdaysVerticalDivider`~~ | Removed | *Reference note below* |
33+
| ~~`weeksVerticalDivider`~~ | Removed | *Reference note below* |
34+
35+
* Styles removed in favor of defining functions for the `header`, `weekdays` and `weeks` styles like so...
36+
37+
```html
38+
<template>
39+
<v-calendar :theme-styles='themeStyles'>
40+
</v-calendar>
41+
</template>
42+
```
43+
44+
```javascript
45+
export default {
46+
data() {
47+
return {
48+
themeStyles: {
49+
// Use page position to set left border for the 2nd pane header
50+
// NOTE: You can use the `verticalDivider` style to apply a single border. Just use this technique to apply different border styles for specific sections (header, weekdays, weeks)
51+
header({ position }) {
52+
return (position === 2) && {
53+
borderLeft: '1px solid #dadada'
54+
};
55+
}
56+
}
57+
}
58+
}
59+
}
60+
```
61+
62+
### `v-date-picker`
63+
* `min-date` and `max-date` props are now forwarded to `v-calendar`. Closes #78.
64+
165
# v0.8.0
266
## Bug Fixes
3-
`v-date-picker`
67+
### `v-date-picker`
468
* Fixes `select-attribute` and `drag-attribute` props getting written over. Closes #75.
569

670
## Improvements
7-
`v-calendar`
71+
### `v-calendar`
872
* Attribute types (highlight, bar, dot, contentStyle, popover) can now be defined as functions that accept an object parameter with the following properties and return an object. Closes #81.
973

1074
| Property Name | Type | Description |
@@ -20,7 +84,7 @@
2084
* The `dayContentHover` theme style has been deprecated in favor of using a function to define the `contentStyle`.
2185
* Support use of a `formats.data` parser to parse attribute dates
2286

23-
`v-date-picker`
87+
### `v-date-picker`
2488
* Add `popoverShowClearMargin` prop to apply clear margin when popover appears. Closes #47.
2589
* Add events for `popover-will-appear`, `popover-did-appear`, `popover-will-disappear` and `popover-did-disappear`
2690
* `show-popover` prop renamed to `show-day-popover` to avoid confusion with input popover

docs/components/date-picker/examples/ExDatePicker.vue

Lines changed: 0 additions & 56 deletions
This file was deleted.

docs/components/date-picker/sections/SectionDatePicker.vue

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515
</ul>
1616
</div>
1717
</b-tab-item>
18-
<!--DatePicker Example Code-->
19-
<b-tab-item label='Example Code'>
20-
<code-block :code='exDatePickerCode'></code-block>
21-
</b-tab-item>
2218
<!--DatePicker Example Options-->
2319
<b-tab-item label='Options' icon='gear'>
2420
<b-field label='Mode'>
@@ -78,7 +74,7 @@
7874
v-for='a in popoverAlignments'
7975
:key='a'
8076
:native-value='a'
81-
v-model='popoverAlignment'>
77+
v-model='popoverAlign'>
8278
{{ a }}
8379
</b-radio>
8480
</p>
@@ -102,19 +98,28 @@
10298
Birthday
10399
</label>
104100
<div class='control'>
105-
<ex-date-picker
101+
<v-date-picker
102+
ref='picker'
103+
class='picker'
104+
:from-page.sync='fromPage'
105+
:to-page.sync='toPage'
106106
:mode='mode'
107-
:show-disabled-dates='showDisabledDates'
107+
:tint-color='tintColor'
108+
:show-caps='showCaps'
109+
:show-day-popover='showDayPopover'
110+
:disabled-dates='showDisabledDates ? disabledDates : null'
111+
:attributes='[]'
108112
:is-inline='isInline'
109113
:is-expanded='isExpanded'
114+
:input-props='inputProps'
110115
:popover-expanded='popoverExpanded'
111116
:popover-visibility='popoverVisibility'
112117
:popover-direction='popoverDirection'
113-
:popover-align='popoverAlignment'
114-
:tint-color='tintColor'
115-
:show-caps='showCaps'
116-
:show-popover='showDayPopover'>
117-
</ex-date-picker>
118+
:popover-align='popoverAlign'
119+
v-model='selectedValue'
120+
is-double-paned
121+
is-linked>
122+
</v-date-picker>
118123
</div>
119124
</div>
120125
<div class='field'>
@@ -135,30 +140,32 @@
135140
</template>
136141

137142
<script>
138-
import ExDatePicker from '../examples/ExDatePicker';
139-
import ExDatePickerCode from '!!raw-loader!../examples/ExDatePicker';
140-
141143
export default {
142-
components: {
143-
ExDatePicker,
144-
},
145144
data() {
146145
return {
147-
exDatePickerCode: ExDatePickerCode,
148146
mode: 'single',
149-
selectedValue: null,
147+
selectedValue: new Date(2018, 3, 15),
150148
showCaps: true,
151149
showDayPopover: true,
152150
showDisabledDates: false,
153151
isInline: false,
154152
isExpanded: false,
155153
popoverExpanded: true,
156-
popoverVisibility: 'visible',
154+
popoverVisibility: 'focus',
157155
popoverVisibilities: ['hover', 'focus', 'visible', 'hidden'],
158156
popoverDirection: 'bottom',
159157
popoverDirections: ['bottom', 'top', 'left', 'right'],
160-
popoverAlignment: 'left',
158+
popoverAlign: 'left',
161159
tintColor: '#66b3cc',
160+
dragValue: null,
161+
fromPage: null,
162+
toPage: null,
163+
disabledDates: { weekdays: [1, 7] },
164+
inputProps: {
165+
class: 'input',
166+
},
167+
// minDate: new Date(2018, 3, 1),
168+
// maxDate: new Date(2019, 5, 20),
162169
};
163170
},
164171
computed: {
@@ -178,8 +185,8 @@ export default {
178185
watch: {
179186
popoverAlignments(val) {
180187
if (val && val.length) {
181-
if (!this.popoverAlignment || !val.includes(this.popoverAlignment)) {
182-
this.popoverAlignment = val[0];
188+
if (!this.popoverAlign || !val.includes(this.popoverAlign)) {
189+
this.popoverAlign = val[0];
183190
}
184191
}
185192
},

docs/components/home/examples/ExIntro.vue

Lines changed: 0 additions & 39 deletions
This file was deleted.

docs/components/home/sections/SectionIntro.vue

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,18 @@
1919
</p>
2020
</div>
2121
</b-tab-item>
22-
<!--Intro Example Code-->
23-
<b-tab-item label='Example Code'>
24-
<code-block :code='exIntroCode'></code-block>
25-
</b-tab-item>
2622
<!--Intro Options-->
2723
<b-tab-item label='Options' icon='gear'>
2824
<b-field grouped>
2925
<b-field>
3026
<b-switch v-model='isDoublePaned'>Double Paned</b-switch>
3127
</b-field>
28+
<b-field>
29+
<b-switch v-model='isLinked'>Linked</b-switch>
30+
</b-field>
31+
<b-field>
32+
<b-switch v-model='isVertical'>Vertical</b-switch>
33+
</b-field>
3234
<b-field>
3335
<b-switch v-model='isExpanded'>Expanded</b-switch>
3436
</b-field>
@@ -76,38 +78,53 @@
7678
</div>
7779
<div class='column'>
7880
<div class='example-container'>
79-
<ex-intro
81+
<v-calendar
8082
:is-double-paned='isDoublePaned'
83+
:is-linked='isLinked'
84+
:is-vertical='isVertical'
8185
:is-expanded='isExpanded'
8286
:nav-visibility='navVisibility'
8387
:title-position='titlePosition'
8488
:title-transition='titleTransition'
85-
:weeks-transition='weeksTransition'>
86-
</ex-intro>
89+
:weeks-transition='weeksTransition'
90+
:theme-styles='themeStyles'
91+
:min-date='new Date()'>
92+
</v-calendar>
8793
</div>
8894
</div>
8995
</div>
9096
</section>
9197
</template>
9298

9399
<script>
94-
import ExIntro from '../examples/ExIntro';
95-
import ExIntroCode from '!!raw-loader!../examples/ExIntro';
96-
97100
export default {
98-
components: {
99-
ExIntro,
100-
},
101101
data() {
102102
return {
103-
exIntroCode: ExIntroCode,
104103
isDoublePaned: true,
104+
isLinked: false,
105+
isVertical: false,
105106
isExpanded: false,
106107
navVisibility: 'focus',
107108
navVisibilities: ['focus', 'hover', 'visible', 'hidden'],
108109
titlePosition: 'center',
109110
titleTransition: 'slide-h',
110111
weeksTransition: 'slide-h',
112+
themeStyles: {
113+
// navHeaderTitle: {
114+
// color: 'red',
115+
// },
116+
// navHeaderArrows: {
117+
// color: 'blue',
118+
// },
119+
// weekdaysHorizontalDivider({ position }) {
120+
// return (
121+
// position === 2 && {
122+
// borderBottom: '1px solid red',
123+
// margin: '0 20px',
124+
// }
125+
// );
126+
// },
127+
},
111128
};
112129
},
113130
};

0 commit comments

Comments
 (0)