Skip to content

Commit

Permalink
Added read-only
Browse files Browse the repository at this point in the history
Resolves #78
  • Loading branch information
ClickerMonkey committed Oct 4, 2018
1 parent 57bf9ed commit 3905299
Show file tree
Hide file tree
Showing 23 changed files with 292 additions and 62 deletions.
2 changes: 1 addition & 1 deletion dist/lib/dayspan-vuetify.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/lib/dayspan-vuetify.min.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lib/dayspan-vuetify.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lib/dayspan-vuetify.min.js.map

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,12 @@ which generate the events.
- eventDetailsColor
- eventDetailsIcon
- eventDetailsBusy
- eventDetailsExtra
- eventTabsExtra
- eventExclusions
- eventInclusions
- eventCancels
- schedule
- scheduleSpan
- scheduleType
- scheduleTimes
Expand Down
12 changes: 12 additions & 0 deletions src/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

<ds-calendar-app ref="app"
:calendar="calendar"
:read-only="readOnly"
@change="saveState">

<template slot="title">
Expand All @@ -20,6 +21,7 @@
<template slot="eventPopover" slot-scope="slotData">
<ds-calendar-event-popover
v-bind="slotData"
:read-only="readOnly"
@finish="saveState"
></ds-calendar-event-popover>
</template>
Expand Down Expand Up @@ -47,6 +49,15 @@
<div class="ds-ev-description">{{ getCalendarTime( calendarEvent ) }}</div>
</template>

<template slot="drawerBottom">
<div class="pa-3">
<v-checkbox
label="Read Only?"
v-model="readOnly"
></v-checkbox>
</div>
</template>

</ds-calendar-app>

</v-app>
Expand All @@ -64,6 +75,7 @@ export default {
data: vm => ({
storeKey: 'dayspanState',
calendar: Calendar.months(),
readOnly: false,
defaultEvents: [
{
data: {
Expand Down
4 changes: 3 additions & 1 deletion src/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export default {

data:
{
version: '0.2.4',
version: '0.3.0',

readOnly: false,

today: Day.today(),
tomorrow: Day.tomorrow(),
Expand Down
7 changes: 7 additions & 0 deletions src/components/Agenda.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<ds-agenda-day
v-bind="{$scopedSlots}"
v-on="$listeners"
:read-only="readOnly"
:key="day.dayIdentifier"
:day="day"
:calendar="calendar"
Expand Down Expand Up @@ -40,6 +41,12 @@ export default {
{
required: true,
type: Calendar
},
readOnly:
{
type: Boolean,
default: false
}
},
Expand Down
7 changes: 7 additions & 0 deletions src/components/AgendaDay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<ds-agenda-event
v-bind="{$scopedSlots}"
v-on="$listeners"
:read-only="readOnly"
:key="event.id"
:calendar-event="event"
:calendar="calendar"
Expand Down Expand Up @@ -44,6 +45,12 @@ export default {
type: Calendar
},
readOnly:
{
type: Boolean,
default: false
},
placeholder:
{
type: CalendarEvent
Expand Down
9 changes: 8 additions & 1 deletion src/components/AgendaEvent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

</div>

<slot name="eventPopover" v-bind="{calendarEvent, calendar, edit, details, close}"></slot>
<slot name="eventPopover" v-bind="{readOnly, calendarEvent, calendar, edit, details, close}"></slot>

</v-menu>

Expand Down Expand Up @@ -88,6 +88,12 @@ export default {
type: Calendar
},
readOnly:
{
type: Boolean,
default: false
},
first:
{
type: Boolean,
Expand Down Expand Up @@ -136,6 +142,7 @@ export default {
slotData()
{
return {
readOnly: this.readOnly,
calendarEvent: this.calendarEvent,
calendar: this.calendar,
details: this.details,
Expand Down
10 changes: 8 additions & 2 deletions src/components/Calendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ export default {
default() {
return this.$dsDefaults().handleMove;
}
},
readOnly:
{
type: Boolean,
default: false
}
},
Expand Down Expand Up @@ -143,12 +149,12 @@ export default {
canAdd()
{
return this.$dayspan.features.drag && this.handleAdd;
return this.$dayspan.features.drag && this.handleAdd && !this.readOnly && !this.$dayspan.readOnly;
},
canMove()
{
return this.$dayspan.features.move && this.handleMove;
return this.$dayspan.features.move && this.handleMove && !this.readOnly && !this.$dayspan.readOnly;
}
},
Expand Down
Loading

0 comments on commit 3905299

Please sign in to comment.