├── .browserslistrc
├── .eslintrc.js
├── .github
└── workflows
│ └── main.yml
├── .gitignore
├── .postcssrc.js
├── .prettierrc.js
├── LICENSE
├── README.md
├── babel.config.js
├── package-lock.json
├── package.json
├── public
└── index.html
└── src
├── App.vue
├── components
├── Timeline.vue
├── TimelineItem.vue
└── index.js
└── main.js
/.browserslistrc:
--------------------------------------------------------------------------------
1 | > 1%
2 | last 2 versions
3 | not ie <= 8
4 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: {
4 | node: true
5 | },
6 | extends: [
7 | 'plugin:vue/recommended',
8 | 'plugin:prettier/recommended',
9 | '@vue/prettier'
10 | ],
11 | rules: {
12 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
13 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
14 | 'vue/no-v-html': 'off'
15 | },
16 | parserOptions: {
17 | parser: 'babel-eslint'
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/.github/workflows/main.yml:
--------------------------------------------------------------------------------
1 | name: CI
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 |
8 | jobs:
9 | build:
10 |
11 | runs-on: ubuntu-latest
12 |
13 | steps:
14 | - uses: actions/checkout@master
15 | - name: Run a one-line script
16 | run: echo Hello, world!
17 | - name: Run a multi-line script
18 | run: |
19 | echo Add other actions to build,
20 | echo test, and deploy your project.
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 | # local env files
6 | .env.local
7 | .env.*.local
8 |
9 | # Log files
10 | npm-debug.log*
11 | yarn-debug.log*
12 | yarn-error.log*
13 |
14 | # Editor directories and files
15 | .idea
16 | .vscode
17 | *.suo
18 | *.ntvs*
19 | *.njsproj
20 | *.sln
21 | *.sw*
22 |
--------------------------------------------------------------------------------
/.postcssrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | autoprefixer: {}
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/.prettierrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | semi: false,
3 | printWidth: 80,
4 | singleQuote: true,
5 | trailingComma: 'none',
6 | arrowParens: 'avoid'
7 | }
8 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Pablo Sirera
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 |
Timeline Vuejs
2 |
3 | [](https://www.npmjs.com/package/timeline-vuejs)
4 | [](https://www.npmjs.com/package/timeline-vuejs)
5 | [](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2Ftimeline-vuejs)
6 |
7 | [Demo Timeline Vue](https://codesandbox.io/s/n094ypklvl)
8 |
9 | ## 📦 Install
10 |
11 | ```
12 | npm install timeline-vuejs --save
13 | ```
14 |
15 | ```js
16 | // main.js
17 | import '../node_modules/timeline-vuejs/dist/timeline-vuejs.css'
18 | ```
19 |
20 | ```html
21 | // component.vue
22 |
33 | ```
34 |
35 | ## 🔧 Usage
36 |
37 | ```html
38 |
39 |
42 |
43 |
44 |
82 | ```
83 |
84 | ## Available props
85 |
86 | | **Props** | **Type** | **Default** | **Description** |
87 | | :----------------- | :------------------: | :----------------------------------------------------- | :---------------------------------------------------------- |
88 | | timelineItems | Array | [ ] | Items value of the timeline |
89 | | messageWhenNoItems | String | | Message when there are no items |
90 | | colorDots | String | #2da1bf | Color of the dots |
91 | | uniqueTimeline | Boolean | false | If true, the timeline isn't separated |
92 | | uniqueYear | Boolean | false | If true, the timeline isn't separated when is the same year |
93 | | order | String (desc or asc) | | Type of order |
94 | | dateLocale | String | Locale of the browser | Type of locale, for example 'en-US' |
95 |
96 |
97 | ## Example with order
98 |
99 | ```html
100 |
101 |
105 |
106 | ...
107 | ```
108 |
109 | ## Example with unique year
110 |
111 | ```html
112 |
113 |
118 |
119 | ...
120 | ```
121 |
122 | ## Example with day and month on title
123 |
124 | If you want to show day and month on specific items, send true on prop `showDayAndMonth`
125 | ```html
126 |
145 | ```
146 |
147 | ## Example with diferent colors
148 | ```html
149 |
169 | ```
170 |
171 |
172 | ## License
173 |
174 | **timeline-vuejs** © [Pablo Sirera](https://pablosirera.com), released under the [MIT](https://github.com/pablosirera/timeline-vuejs/blob/master/LICENSE) License.
175 | Authored and maintained by Pablo Sirera with help from [contributors](https://github.com/pablosirera/timeline-vuejs/contributors).
176 |
177 | > [pablosirera.com](https://pablosirera.com) · GitHub [Pablo Sirera](https://github.com/pablosirera) · Twitter [@pablosirera](https://twitter.com/pablosirera)
178 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ['@vue/app']
3 | }
4 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "timeline-vuejs",
3 | "version": "1.1.7",
4 | "main": "dist/timeline-vuejs.umd.js",
5 | "description": "Minimalist Timeline with VueJS",
6 | "scripts": {
7 | "serve": "vue-cli-service serve",
8 | "build": "vue-cli-service build",
9 | "build-bundle": "vue-cli-service build --target lib --name timeline-vuejs ./src/components/index.js",
10 | "lint": "vue-cli-service lint"
11 | },
12 | "keywords": [
13 | "timeline",
14 | "vue-timeline",
15 | "timeline-vuejs",
16 | "minimalist timeline",
17 | "timeline components"
18 | ],
19 | "repository": {
20 | "type": "git",
21 | "url": "git+https://github.com/pablosirera/timeline-vuejs"
22 | },
23 | "bugs": {
24 | "url": "https://github.com/pablosirera/timeline-vuejs/issues"
25 | },
26 | "homepage": "https://github.com/pablosirera/timeline-vuejs",
27 | "author": "Pablo Sirera ",
28 | "license": "MIT",
29 | "dependencies": {
30 | "vue": "^2.5.17"
31 | },
32 | "devDependencies": {
33 | "@vue/cli-plugin-babel": "^3.0.0",
34 | "@vue/cli-plugin-eslint": "^3.0.0",
35 | "@vue/cli-service": "^4.1.1",
36 | "@vue/eslint-config-prettier": "^4.0.1",
37 | "eslint": "^5.16.0",
38 | "eslint-plugin-vue": "^5.0.0",
39 | "lint-staged": "^7.2.2",
40 | "node-sass": "^4.9.0",
41 | "querystringify": ">=2.0.0",
42 | "sass-loader": "^7.0.1",
43 | "vue-template-compiler": "^2.5.17"
44 | },
45 | "files": [
46 | "dist/*",
47 | "src/*",
48 | "public/*",
49 | "*.json",
50 | "*.js"
51 | ],
52 | "gitHooks": {
53 | "pre-commit": "lint-staged"
54 | },
55 | "lint-staged": {
56 | "*.js": [
57 | "vue-cli-service lint",
58 | "git add"
59 | ],
60 | "*.vue": [
61 | "vue-cli-service lint",
62 | "git add"
63 | ]
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | timeline-vuejs
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
85 |
86 |
100 |
--------------------------------------------------------------------------------
/src/components/Timeline.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 | {{ getYear(timelineContent) }}
12 |
13 |
14 |
19 |
20 |
21 | {{ messageWhenNoItems }}
22 |
23 |
24 |
25 |
141 |
142 |
172 |
--------------------------------------------------------------------------------
/src/components/TimelineItem.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
{{ getFormattedDate(itemTimeline) }}
6 |
7 |
8 |
9 |
10 |
11 |
12 |
46 |
47 |
81 |
--------------------------------------------------------------------------------
/src/components/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import Timeline from './Timeline.vue'
3 |
4 | Vue.component(Timeline.name, Timeline)
5 |
6 | export default Timeline
7 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------