Giter Site home page Giter Site logo

dayspan-vuetify's Introduction

dayspan-vuetify

A collection of components for Schedules and Calendars in DaySpan using Vuetify

This library strives to offer all the functionality any modern calendar app could support, and more. Not only can this be used for calendar apps, but any application where the user wishes to control when events should occur within a system.

Click here for a full app example

Every feature of the library can be toggled with local and global settings, and all text can be localized.

Status

This library is nearing functional completion (documentation on every component, prop, event, slot, method will have to wait) but is still subject to the occasional small change in API.

Current documentation

Notice

  • This library uses v-html in a few places (to display event details for example) so you must sanitize your own data against XSS vulnerabilities.

Usage

Install with npm install --save dayspan-vuetify

This library works best with Vuetify >= 1.1.9

import DaySpanVuetify from 'dayspan-vuetify'

Vue.use( DaySpanVuetify, {
  // options is vue definition, the resulting reactive component is stored in components as this.$dayspan or Vue.$dayspan
  data: {
    // data or computed to override
  },
  computed: {
    // data or computed to override
  },
  methods: {
    // methods to override
  }
});

To see what options can be passed to the plugin, checkout this file.

Once done, you can access components like ds-event, ds-calendar, and ds-calendar-app from any component (they are registered globally).

Example / Template

Checkout dayspan-vuetify-example for an example of a calendar app which saves events to localStorage.

Example Code

Install with npm install --save dayspan-vuetify

app.js

import Vue from 'vue'
import Vuetify from 'vuetify'
import DaySpanVuetify from 'dayspan-vuetify'
import App from './App.vue'

import 'vuetify/dist/vuetify.min.css'
import 'material-design-icons-iconfont/dist/material-design-icons.css'
import 'dayspan-vuetify/dist/lib/dayspan-vuetify.min.css'

Vue.config.productionTip = false

Vue.use(Vuetify);

Vue.use(DaySpanVuetify, {
  methods: {
    getDefaultEventColor: () => '#1976d2'
  }
});

new Vue({
  el: '#app',
  render: h => h(App)
})

App.vue

<template>
  <v-app id="dayspan" v-cloak>
    <ds-calendar-app :calendar="calendar"></ds-calendar-app>
  </v-app>
</template>

<script>
import { Calendar } from 'dayspan';

export default {
  name: 'app',
  data: () => ({
    calendar: Calendar.months()
  })
}
</script>

<style>
body, html, #app, #dayspan {
  font-family: Roboto, sans-serif;
  width: 100%;
  height: 100%;
}
</style>

index.html

<!DOCTYPE html>
<html>
  <head>
    <link href='https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons' rel="stylesheet">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>You Calendar App Title</title>
    <style> [v-cloak] { display: none; } </style>
  </head>
  <body>
    <div id="app"></div>
    <!-- built files should be auto injected -->
  </body>
</html>

Locales

This library supports multiple locales but the build only comes with en-us/en. The following code shows you how to add locales, changing the current locale, and updating a given locale:

// You can access $dayspan via Vue.$dayspan or this.$dayspan inside a component.

$dayspan.setLocale('en'); // if en does not exist, this will have no affect
$dayspan.setLocale('fr', true); // true was passed, so if the locale does not exist an error is thrown
$dayspan.locales; // map of locale names to locale values

// A locale is really just an object that overrides the values you specify found in $dayspan. A locale does not need to specify all possible values, just ones that should be overriden when setLocale is called.

$dayspan.addLocale('es', {
  promptLabels: {
    // Are you sure you want to remove this event?
    actionRemove: '¿Estás seguro de que quieres eliminar este evento?'
  }
});

// Update locale (merge changes into locale)
$dayspan.updateLocale('en', {
  patterns: {
    lastDay: (day) => 'Final day of the month'
  }
});

French Locale

import fr from 'dayspan-vuetify/src/locales/fr';
import Vue from 'vue';
// dayspan-vuetify should already be loaded at this point
Vue.$dayspan.addLocales(['fr', 'fr-CA', 'fr-BE', 'fr-CH', 'fr-FR', 'fr-LU', 'fr-MC'], fr);

Dutch Locale

import nl from 'dayspan-vuetify/src/locales/nl';
import Vue from 'vue';
// dayspan-vuetify should already be loaded at this point
Vue.$dayspan.addLocales(['nl', 'nl-NL', 'nl-BE'], nl);

German Locale

import de from 'dayspan-vuetify/src/locales/de';
import Vue from 'vue';
// dayspan-vuetify should already be loaded at this point
Vue.$dayspan.addLocales(['de', 'de-DE', 'de-CH', 'de-AT', 'de-BE', 'de-IT', 'de-LI', 'de-LU'], de);

Catalan Locale

import ca from 'dayspan-vuetify/src/locales/ca';
import Vue from 'vue';
// dayspan-vuetify should already be loaded at this point
Vue.$dayspan.addLocales(['ca', 'ca-ES'], ca);

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

For detailed explanation on how things work, checkout the guide and docs for vue-loader.

dayspan-vuetify's People

Contributors

anoadragon453 avatar audricch avatar clickermonkey avatar deka avatar developernaren avatar federicobaldini avatar luizotavior avatar maartenvw avatar mehmetakifalp avatar naulacambra avatar nomadigital avatar teuunn avatar wolfgangal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dayspan-vuetify's Issues

Add permission checks

  • Can user edit event?
  • Can user edit event frequency?
  • Can user edit event times/all day?
  • Can user edit specific detail?
  • Can user see specific detail?
  • Can user perform action?

Add prompting options

Before the following actions, they should be able to specify whether they want the user prompted with an "Are you sure? Yes/No".

The prompt should be slotted.

The actions:

  • actionRemove
  • actionExclude
  • actionCancel
  • actionUncancel
  • actionMove
  • actionInclude
  • move
  • toggleAllDay
  • removeExistingTime (when an event already exists)
  • changeExistingType (when an event already exists)

Relative font imports do not work

Following the install instructions, I get errors that .fonts/*.woff etc. are not found from *.css.min. I was able to work around this by copying the fonts directory into the lib directory so that the relative imports line up. Should the imports in the .min.css be changed to ../fonts/*.woff etc. or am I doing something wrong on how I import it?

Event printing

This will be an option in ds-schedule-actions and it will trigger an event. The default implementation of the event will be very lacking - the user should override this.

type check failed for prop "calendar". Expected E, got Object.

`

<script> import { Calendar, Weekday, Month, Sorts, Day } from 'dayspan'; import Vue from 'vue'; export default { name: 'dayspan', data () { return { calendar: Calendar.months() } }, created () { } } </script> <style scoped> </style>`

I did like this, but I got wrong. how can I fix it?

Clicking on a day results in page navigation

Clicking on a day in month view results in a page navigate. Since there's no URL set as the href value, it simply reloads the page.

Adding the .prevent modifier to the a tag in the Day.vue component should fix this problem.

Event search & filtering

This will be up to the user to implement which events are visible and which apply - but this library will update the visible flag and refresh the calendar.

This library will provide the search bar, and optional filter area.

Scheduler

Allows the user to add an event based on guest availability.

Based on a group of events, show each group as a column with their list of events.

Dragging to create event does not work in Firefox

Tested On:
Browser: Firefox 61.0.1
OS : Ubuntu 18.04 and Ubuntu 16.04 (64-bit)

When I drag on multiple cells, it just opens the dialog to create an event on the day I started to drag the mouse from. It works like a click event.

This works in chrome (68.0.344). It opens a modal with multiple day selected, as expected.

Please let me know if you need additional information to replicate the issue.

Calendar mistakes clicks for drags on touchpad

When I click on an event in month view, the calendar mistakes my click for a drag, and does not open the edit dialog. However, tapping the event on my touchscreen works as expected.

This is on a Dell XPS 15.

Not sure how to customize

I am looking to customize calendar. I need to add and remove some fields in the create event pop up and load event when the calendar starts, But it is not mentioned anywhere in the doc and am very confused.

Are there any docs or links I can get started on?

You can publish the code you are using for the example somewhere, that can be helpful to me.

Add patterns for better schedule readability

  • on the 1st last day of the month = Last day of the month
    • { lastDayOfMonth: [1] }
  • on the 1st last day of April = Last day of April
    • { lastDayOfMonth: [1], month: 1 }
  • on Monday in September on the 1st last weekspan of the month = Last Monday in September
    • ex: Memorial Day
    • { lastWeekspanOfMonth: [0], dayOfWeek: 1, month: 1 }

Type switching broken

Schedule type set a few values that the other types don't have, the calendar is messed up after that.

Support of database usage

First of all, this is a great project. Thank you for making this nice library.
I see that currently the library uses only Local Storage to store "events".
Is there any plan to support an option for database instead?

I am happy to create a pull request for it too. And I believe the changes should be made in src/app.vue since that's the only place I can find localStorage?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.