├── .github └── FUNDING.yml ├── .gitignore ├── LICENSE ├── README.md ├── babel.config.js ├── package.json ├── public ├── favicon.ico ├── index.html └── prev.png ├── src ├── App.vue ├── assets │ ├── logo.png │ ├── preview.png │ └── style.css ├── components │ └── Schedule.vue ├── main.js └── plugin.js ├── tests └── unit │ └── example.spec.js └── yarn.lock /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: burhanahmeed 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: ['https://karyakarsa.com/burhanahmeed', 'https://www.buymeacoffee.com/zOkT07A'] 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # netbeans 6 | /nbproject 7 | 8 | # local env files 9 | .env.local 10 | .env.*.local 11 | 12 | # Log files 13 | npm-debug.log* 14 | yarn-debug.log* 15 | yarn-error.log* 16 | pnpm-debug.log* 17 | 18 | # Editor directories and files 19 | .idea 20 | .vscode 21 | *.suo 22 | *.ntvs* 23 | *.njsproj 24 | *.sln 25 | *.sw? 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Burhanuddin Ahmed 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue daily scheduler 2 | 3 |
4 | 5 | [![VEDR](./src/assets/preview.png)](.) 6 | 7 | Vue daily scheduler is a custom Vue2 component to manage repeated schedule. It's a straightforward scheduler component you can use. 8 | 9 |
10 | 11 | [![GitHub forks](https://img.shields.io/github/forks/initbase/vue-daily-schedule)](https://github.com/initbase/vue-daily-schedule/network) 12 | [![GitHub stars](https://img.shields.io/github/stars/initbase/vue-daily-schedule)](https://github.com/initbase/vue-daily-schedule/stargazers) 13 | [![GitHub license](https://img.shields.io/github/license/initbase/vue-daily-schedule)](https://github.com/initbase/vue-daily-schedule/blob/master/LICENSE) 14 | [![GitHub issues](https://img.shields.io/github/issues/initbase/vue-daily-schedule)](https://github.com/initbase/vue-daily-schedule/issues) 15 | 16 | ### Demo 17 | 18 | [Demo here](https://vue-daily-schedule.vercel.app/) 19 | 20 | [NPMJS](https://www.npmjs.com/package/vue-daily-scheduler) 21 | 22 | ### Install 23 | Node 24 | ``` 25 | npm install vue-daily-scheduler 26 | 27 | # or yarn 28 | 29 | yarn add vue-daily-scheduler 30 | ``` 31 | Browser 32 | ```html 33 | 34 | 35 | ``` 36 | 37 | then, use inside a component 38 | ```javascript 39 | import 'vue-daily-scheduler/dist/vue-schedule.min.css' 40 | import VueSchedule from 'vue-daily-scheduler' 41 | export default { 42 | components: { 43 | VueSchedule 44 | }, 45 | data () { 46 | return { 47 | schedule: { 48 | 0: [], 49 | 1: [], 50 | 2: [], 51 | 3: [], 52 | 4: [], 53 | 5: [], 54 | 6: [] 55 | } 56 | } 57 | } 58 | } 59 | ``` 60 | use it inside vue template 61 | ```html 62 | 67 | ``` 68 | 69 | ### Props 70 | |Props|Desc|Type|Default| 71 | |---|---|---|---| 72 | |`steps`|The interval in minutes|`Number`|`60`| 73 | |`dayTable`|Array of day names for changing order or i18n|`Array`|`['So','Mo','Tu','We','Th','Fr','Sa']`| 74 | |`timeArray`|This props is optional. Array of time. `steps` props will be ignored if this props is filled.|`Array`|`[]`| 75 | |`strWeek`|String for i18n support|`String`|`Week`| 76 | |`strTime`|String for i18n support|`String`|`Time`| 77 | |`strDay`|String for i18n support|`String`|`Day`| 78 | |`disableWeekSelect`|Disable the whole week selection|`Boolean`|`false`| 79 | |`disableDaySelect`|Disable the whole day selection|`Boolean`|`false`| 80 | |`bg`|Block scheduler background color|`String`|`#223642`| 81 | |`bgHover`|Block scheduler background color when on hover|`String`|`#84dafc7a`| 82 | |`bgActive`|Block scheduler background color when active|`String`|`#84c9fc`| 83 | |`textColor`|Text color inside block scheduler|`String`|`#000`| 84 | #### Example 85 | ```html 86 | 97 | ``` 98 | 99 | ### with `timeArray` 100 | ```html 101 | 109 | ``` 110 | ### Future plans 111 | - ☐ add disabled time props 112 | 113 | 114 | ### Contribution 115 | Feel free if you want to submit pull request or an issue. 116 | 117 | ##### Creators 118 | |Name| 119 | |---| 120 | |[Burhanuddin Ahmed](https://github.com/burhanahmeed/)| 121 | |[Oleg Zernov](https://github.com/sawyer3273)| 122 | 123 | ### License 124 | MIT 125 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-daily-scheduler", 3 | "version": "1.0.12", 4 | "private": false, 5 | "author": "Burhanuddin Ahmed", 6 | "license": "MIT", 7 | "description": "A Vue.js component for continuous daily scheduling", 8 | "main": "dist/vue-schedule.umd.js", 9 | "module": "dist/vue-schedule.esm.js", 10 | "unpkg": "dist/vue-schedule.min.js", 11 | "repository": "burhanahmeed/vue-daily-schedule", 12 | "keywords": [ 13 | "vue", 14 | "component", 15 | "schedule", 16 | "scheduler" 17 | ], 18 | "browser": { 19 | "./sfc": "src/components/Schedule.vue" 20 | }, 21 | "files": [ 22 | "dist/*", 23 | "src/*", 24 | "attributes.json", 25 | "tags.json" 26 | ], 27 | "vetur": { 28 | "tags": "tags.json", 29 | "attributes": "attributes.json" 30 | }, 31 | "scripts": { 32 | "serve": "vue-cli-service serve", 33 | "build": "vue-cli-service build", 34 | "test:unit": "vue-cli-service test:unit", 35 | "build-bundle": "npm run build:unpkg & npm run build:es & npm run build:umd", 36 | "build:umd": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format umd --file dist/vue-schedule.umd.js", 37 | "build:es": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format es --file dist/vue-schedule.esm.js", 38 | "build:unpkg": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format iife --file dist/vue-schedule.min.js" 39 | }, 40 | "devDependencies": { 41 | "@vue/cli-plugin-babel": "^4.4.0", 42 | "@vue/cli-plugin-unit-jest": "^4.4.0", 43 | "@vue/cli-service": "^4.4.0", 44 | "@vue/test-utils": "^1.0.3", 45 | "cross-env": "^5.2.0", 46 | "minimist": "^1.2.0", 47 | "rollup": "^1.14.4", 48 | "rollup-plugin-buble": "^0.19.6", 49 | "rollup-plugin-commonjs": "^9.3.4", 50 | "rollup-plugin-replace": "^2.2.0", 51 | "rollup-plugin-scss": "^2.5.0", 52 | "rollup-plugin-uglify-es": "0.0.1", 53 | "rollup-plugin-vue": "^4.7.2", 54 | "vue": "^2.6.11", 55 | "vue-template-compiler": "^2.6.11", 56 | "rollup-plugin-css-only": "^3.1.0" 57 | }, 58 | "browserslist": [ 59 | "> 1%", 60 | "last 2 versions", 61 | "not dead" 62 | ], 63 | "jest": { 64 | "preset": "@vue/cli-plugin-unit-jest" 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/initbase/vue-daily-schedule/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /public/prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/initbase/vue-daily-schedule/HEAD/public/prev.png -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 34 | 35 | 68 | 69 | 79 | -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/initbase/vue-daily-schedule/HEAD/src/assets/logo.png -------------------------------------------------------------------------------- /src/assets/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/initbase/vue-daily-schedule/HEAD/src/assets/preview.png -------------------------------------------------------------------------------- /src/assets/style.css: -------------------------------------------------------------------------------- 1 | .vws-table-rule { 2 | border-collapse: separate; 3 | } 4 | .vws-table-rule-heading, .vws-rule-time { 5 | display: flex; 6 | flex-wrap: wrap; 7 | } 8 | .vws-table-rule-heading div, .vws-rule-time .vws-time-list { 9 | -ms-flex-preferred-size: 0; 10 | flex-basis: 0; 11 | -ms-flex-positive: 1; 12 | flex-grow: 1; 13 | max-width: 100%; 14 | margin: 1px; 15 | padding: 10px; 16 | font-size: 9px; 17 | } 18 | 19 | .vws-time-rule { 20 | width: 100px; 21 | display: block ruby; 22 | } 23 | .vws-rule-time-week, .vws-rule-time-item{ 24 | cursor: pointer; 25 | } 26 | .vws-rule-time-week, .vws-rule-time-item{ 27 | /* background: #223642; */ 28 | background: var(--vws-bg); 29 | } 30 | 31 | .vws-rule-time-week.active, .vws-rule-time-item.active{ 32 | /* background: #84c9fc; */ 33 | background: var(--vws-bgActive); 34 | } 35 | .vws-rule-time-week:hover, 36 | .vws-rule-time-item:hover, 37 | .vws-rule-time-week.active:hover, 38 | .vws-rule-time-item.active:hover{ 39 | /* background: #84dafc7a; */ 40 | background: var(--vws-bgHover); 41 | } 42 | 43 | .vws-rule-time-item span{ 44 | display: none; 45 | } 46 | 47 | .vws-rule-time-item .parent { 48 | display: flex !important; 49 | justify-content: center; 50 | align-items: center; 51 | text-align: center; 52 | color: #fff; 53 | font-size: 13px; 54 | font-weight: 800; 55 | height: 4px; 56 | } 57 | 58 | .vws-rule-time-item.active span { 59 | display: block; 60 | text-align: center; 61 | /* color: #000; */ 62 | color: var(--vws-text); 63 | } -------------------------------------------------------------------------------- /src/components/Schedule.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 70 | 71 | 472 | 473 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | 4 | Vue.config.productionTip = false 5 | 6 | new Vue({ 7 | render: h => h(App), 8 | }).$mount('#app') 9 | -------------------------------------------------------------------------------- /src/plugin.js: -------------------------------------------------------------------------------- 1 | import Schedule from "./components/Schedule.vue"; 2 | 3 | function install(Vue) { 4 | if (install.installed) return; 5 | install.installed = true; 6 | Vue.component("vue-schedule", Schedule); 7 | } 8 | 9 | const plugin = { 10 | install 11 | }; 12 | 13 | let GlobalVue = null; 14 | if (typeof window !== "undefined") { 15 | GlobalVue = window.Vue; 16 | } else if (typeof global !== "undefined") { 17 | GlobalVue = global.vue; 18 | } 19 | if (GlobalVue) { 20 | GlobalVue.use(plugin); 21 | } 22 | 23 | Schedule.install = install; 24 | 25 | export default Schedule; 26 | -------------------------------------------------------------------------------- /tests/unit/example.spec.js: -------------------------------------------------------------------------------- 1 | import { shallowMount } from '@vue/test-utils' 2 | import HelloWorld from '@/components/HelloWorld.vue' 3 | 4 | describe('HelloWorld.vue', () => { 5 | it('renders props.msg when passed', () => { 6 | const msg = 'new message' 7 | const wrapper = shallowMount(HelloWorld, { 8 | propsData: { msg } 9 | }) 10 | expect(wrapper.text()).toMatch(msg) 11 | }) 12 | }) 13 | --------------------------------------------------------------------------------