vue-functional-calendar 2.9.8 → 2.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/README.md +216 -0
- package/dist/FunctionalCalendar.common.js +2 -2
- package/dist/FunctionalCalendar.common.js.map +1 -1
- package/dist/FunctionalCalendar.umd.js +2 -2
- package/dist/FunctionalCalendar.umd.js.map +1 -1
- package/dist/FunctionalCalendar.umd.min.js.map +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/src/components/FunctionalCalendar.vue +8 -8
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
<p align="center"><img src="https://raw.githubusercontent.com/ManukMinasyan/vue-functional-calendar/master/public/logo.png" width="200" /></p>
|
|
2
|
+
|
|
3
|
+
<h1 align="center">Vue Functional Calendar</h1>
|
|
4
|
+
<p align="center">Modern calendar and datepicker module for Vue.js</p>
|
|
5
|
+
|
|
6
|
+
[](https://offset.earth/treeware?gift-trees)
|
|
7
|
+
[](https://twitter.com/intent/tweet?text=Lightweight,%20high%20performance%20calendar%20component%20based%20on%20Vue.js&url=https://github.com/ManukMinasyan/vue-functional-calendar&via=github&hashtags=vue,calendar,design,developers)
|
|
8
|
+
|
|
9
|
+
[](https://travis-ci.org/ManukMinasyan/vue-functional-calendar)
|
|
10
|
+
[](https://www.npmjs.com/package/vue-functional-calendar)
|
|
11
|
+
[](LICENSE)
|
|
12
|
+
[](https://www.npmjs.com/package/vue-functional-calendar)
|
|
13
|
+
___
|
|
14
|
+
## Demo
|
|
15
|
+
|
|
16
|
+
Demo: <a href="https://y3jnxov469.codesandbox.io/" target="_blank">https://y3jnxov469.codesandbox.io/</a>
|
|
17
|
+
|
|
18
|
+
[](https://codesandbox.io/s/980jov4m4p?fontsize=14&hidenavigation=1)
|
|
19
|
+
|
|
20
|
+
<img src="https://raw.githubusercontent.com/ManukMinasyan/vue-functional-calendar/master/public/demo.png"/>
|
|
21
|
+
|
|
22
|
+
___
|
|
23
|
+
|
|
24
|
+
* Lightweight, high-performance calendar component based on Vue.js
|
|
25
|
+
* Small memory usage, good performance, good style, and high scalability
|
|
26
|
+
* Native js development, no third-party library introduced
|
|
27
|
+
* Date Picker, Date Range, Multiple Calendars, Modal Calendar
|
|
28
|
+
|
|
29
|
+
___
|
|
30
|
+
|
|
31
|
+
## Browser Support
|
|
32
|
+
 |  |  |  |  |  |
|
|
33
|
+
--- | --- | --- | --- | --- | --- |
|
|
34
|
+
39+ ✔ | 28+ ✔ | 10.1+ ✔ | 27+ ✔ | 15+ ✔ | Latest ✔ |
|
|
35
|
+
|
|
36
|
+
___
|
|
37
|
+
|
|
38
|
+
## Install
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
npm i vue-functional-calendar --save
|
|
42
|
+
```
|
|
43
|
+
___
|
|
44
|
+
|
|
45
|
+
## Usage
|
|
46
|
+
|
|
47
|
+
### Vue.use()
|
|
48
|
+
|
|
49
|
+
```javascript
|
|
50
|
+
// Introduced in vue file
|
|
51
|
+
import FunctionalCalendar from 'vue-functional-calendar';
|
|
52
|
+
Vue.use(FunctionalCalendar, {
|
|
53
|
+
dayNames: ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su']
|
|
54
|
+
});
|
|
55
|
+
````
|
|
56
|
+
|
|
57
|
+
### Import Component
|
|
58
|
+
```javascript
|
|
59
|
+
// Introduced in vue file
|
|
60
|
+
import { FunctionalCalendar } from 'vue-functional-calendar';
|
|
61
|
+
````
|
|
62
|
+
|
|
63
|
+
### Component Settings
|
|
64
|
+
````javascript
|
|
65
|
+
export default {
|
|
66
|
+
components: {
|
|
67
|
+
FunctionalCalendar
|
|
68
|
+
},
|
|
69
|
+
data() {
|
|
70
|
+
return {
|
|
71
|
+
calendarData: {}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
````
|
|
76
|
+
|
|
77
|
+
### Template Usage
|
|
78
|
+
````html
|
|
79
|
+
<FunctionalCalendar
|
|
80
|
+
// v-model="calendarData"
|
|
81
|
+
|
|
82
|
+
// v-on:changedMonth="changedMonth"
|
|
83
|
+
// v-on:changedYear="changedYear"
|
|
84
|
+
|
|
85
|
+
// :sundayStart="true"
|
|
86
|
+
// :date-format="'dd/mm/yyyy'"
|
|
87
|
+
// :is-date-range="true"
|
|
88
|
+
// :is-date-picker="true"
|
|
89
|
+
:...:
|
|
90
|
+
></FunctionalCalendar>
|
|
91
|
+
````
|
|
92
|
+
___
|
|
93
|
+
|
|
94
|
+
## Usage With Configs
|
|
95
|
+
### Component Settings
|
|
96
|
+
````javascript
|
|
97
|
+
export default {
|
|
98
|
+
components: {
|
|
99
|
+
FunctionalCalendar
|
|
100
|
+
},
|
|
101
|
+
data() {
|
|
102
|
+
return {
|
|
103
|
+
calendarData: {},
|
|
104
|
+
calendarConfigs: {
|
|
105
|
+
sundayStart: false,
|
|
106
|
+
dateFormat: 'dd/mm/yyyy',
|
|
107
|
+
isDatePicker: false,
|
|
108
|
+
isDateRange: false
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
}
|
|
113
|
+
````
|
|
114
|
+
|
|
115
|
+
### Template Usage
|
|
116
|
+
````html
|
|
117
|
+
<FunctionalCalendar
|
|
118
|
+
// v-model="calendarData"
|
|
119
|
+
// :configs="calendarConfigs"
|
|
120
|
+
></FunctionalCalendar>
|
|
121
|
+
````
|
|
122
|
+
___
|
|
123
|
+
|
|
124
|
+
### A note on markDates
|
|
125
|
+
The `markedDates` property **must** be in JavaScript Date format, e.g, no leading zeroes on month and days.
|
|
126
|
+
|
|
127
|
+
✅ Correct: 1/12/2019
|
|
128
|
+
❎ Incorrect: 01/12/2019
|
|
129
|
+
___
|
|
130
|
+
|
|
131
|
+
## Available props
|
|
132
|
+
| Prop | Type | Default | Example | Description |
|
|
133
|
+
|-------------------------------|-----------------|-------------|-------------|------------------------------------------|
|
|
134
|
+
| sundayStart | Boolean | false | true | Week start sunday |
|
|
135
|
+
| newCurrentDate | Date | new Date() | new Date(2019,10,11) | Calendar Current Date |
|
|
136
|
+
| limits | [Object, Boolean] | false | {min: '31/10/2019', max: '31/12/2019'} | Set calendar show, and marked dates limits. |
|
|
137
|
+
| minSelDays | [Number, Boolean] | false | 3 | Set minimum selected days count. |
|
|
138
|
+
| maxSelDays | [Number, Boolean] | false | 10 | Set maximum selected days count. |
|
|
139
|
+
| placeholder | [String, Boolean] | false | 'yyyy/mm/dd' | Date input placeholder |
|
|
140
|
+
| dateFormat | String | 'dd/mm/yyyy' | 'yyyy/mm/dd' | Date formatting string |
|
|
141
|
+
| isDatePicker | Boolean | false | true | Enable or disable date picker |
|
|
142
|
+
| isMultipleDatePicker | Boolean | false | true | Enable or disable multiple date picker |
|
|
143
|
+
| isMultipleDateRange | Boolean | false | true | Enable or disable multiple date range |
|
|
144
|
+
| isDateRange | Boolean | false | true | Enable or disable date range |
|
|
145
|
+
| withTimePicker | Boolean | false | true | Enable or disable time picker |
|
|
146
|
+
| isMultiple | Boolean | false | true | Enable multiple calendar function |
|
|
147
|
+
| calendarsCount | Number | 1 | 3 | Count of calendars, working only is prop isMultiple |
|
|
148
|
+
| isSeparately | Boolean | false | true | Enable separately calendars |
|
|
149
|
+
| isModal | Boolean | false | true | Enable modal calendar function |
|
|
150
|
+
| isAutoCloseable | Boolean | false | true | Hide picker(calendar) if date has been selected |
|
|
151
|
+
| isTypeable | Boolean | false | true | Enable manually date typing function, working only with prop isModal |
|
|
152
|
+
| changeMonthFunction | Boolean | false | true | Enable changed month with list, function |
|
|
153
|
+
| changeYearFunction | Boolean | false | true | Enable changed year with list, function |
|
|
154
|
+
| changeYearStep | Number | 12 | 6 | Change year list step count |
|
|
155
|
+
| changeMonthStep | Number | 1 | 3 | How many months to jump forward with NextMonth() |
|
|
156
|
+
| markedDates | Array | [] | ['10/12/2020', '12/12/2020'] **OR** [{date: '10/1/2020', class: 'marked-class'},{date: '12/1/2020', class: 'marked-class-2'}] | Marked dates array |
|
|
157
|
+
| markedDateRange | Object | {start: false, end: false} | {start: '12/12/2020', end: '20/12/2020'} **OR** [{start: '12/12/2020', end: '20/12/2020'}, {start: '24/12/2020', end: '28/12/2020'}] | Marked date ranges |
|
|
158
|
+
| disabledDayNames | Array | [] | ['Su','We'] | Disabled Days Of Week |
|
|
159
|
+
| disabledDates | Array | [] | ['24/12/2020','27/12/2020'] **OR** ['beforeToday', 'afterToday', '24/12/2020','27/12/2020'] | Disabled Dates |
|
|
160
|
+
| enabledDates | Array | [] | ['24/12/2020','27/12/2020'] | Reversal of Disabled Dates |
|
|
161
|
+
| dayNames | Array | ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'] | ['Monday', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Sunday'] | Week Day Names |
|
|
162
|
+
| monthNames | Array | ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] | ["Jan.", "Feb.", "Mar", "Apr.", "May", "Jun.", "Jul.", "Aug.", "Sept.", "Oct.", "Nov.", "Dec."] | Month names |
|
|
163
|
+
| shortMonthNames | Array | ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] | ["Jan.", "Feb.", "Mar", "Apr.", "May", "Jun.", "Jul.", "Aug.", "Sept.", "Oct.", "Nov.", "Dec."] | Short month names |
|
|
164
|
+
| showWeekNumbers | Boolean | false | true | Display week numbers. |
|
|
165
|
+
| transition | Boolean | true | false | Calendar animations |
|
|
166
|
+
| hiddenElements | Array | [] | ['dayNames', 'navigationArrows', 'leftAndRightDays', 'month'] | Hide calendar elements |
|
|
167
|
+
| titlePosition | String | center | left, right, center | Set title position |
|
|
168
|
+
| arrowsPosition | String | space-between | left, right, space-between | Set arrows position |
|
|
169
|
+
| isDark | Boolean | false | true | Dark theme |
|
|
170
|
+
| isLayoutExpandable | Boolean | false | true | Enable expanding the calendar layout |
|
|
171
|
+
| alwaysUseDefaultClasses | Boolean | false | true | Always add default classes to Day element, even when overriding with a slot |
|
|
172
|
+
___
|
|
173
|
+
|
|
174
|
+
### Slots
|
|
175
|
+
| Name | Description | Props |
|
|
176
|
+
| :------------- | :------------- | :-----------------------------------------------------------:
|
|
177
|
+
| Default |Default slot responsible for the day component | {week: Object, day: Object}
|
|
178
|
+
| datePickerInput |This slot responsible for the modal date picker input | {selectedDate: String, isTypeable: Boolean}
|
|
179
|
+
| dateRangeInputs |This slot responsible for the modal date range inputs | {startDate: String, endDate: String, isTypeable: Boolean}
|
|
180
|
+
| footer |This slot responsible for the calendar footer | {}
|
|
181
|
+
|
|
182
|
+
### Events
|
|
183
|
+
|
|
184
|
+
| Event | Output | Description |
|
|
185
|
+
| :------------- | :------------- | :-----------------------------------------------------------:
|
|
186
|
+
| dayClicked |Object | Get clicked day object
|
|
187
|
+
| choseDay |Object | Get the object of the selected day
|
|
188
|
+
| changedMonth |Date | Month page has been changed
|
|
189
|
+
| changedYear |Date | Year page has been changed
|
|
190
|
+
| selectedDaysCount |Number | Get number of days between date range dates
|
|
191
|
+
| dayMouseOver |Date | Mouse over day
|
|
192
|
+
| opened | | The picker is opened
|
|
193
|
+
| closed | | The picker is closed
|
|
194
|
+
|
|
195
|
+
##### Add the ref attribute to the calendar component and use these methods to do more.
|
|
196
|
+
````javascript
|
|
197
|
+
For example: <FunctionalCalendar ref="Calendar"></FunctionalCalendar>
|
|
198
|
+
|
|
199
|
+
✅ this.$refs.Calendar.PreMonth(); //Call method implementation to go to previous month
|
|
200
|
+
✅ this.$refs.Calendar.NextMonth(); //Call method implementation to go to next month
|
|
201
|
+
✅ this.$refs.Calendar.PreYear(); //Call method implementation to go to previous year
|
|
202
|
+
✅ this.$refs.Calendar.NextYear(); //Call method implementation to go to next year
|
|
203
|
+
✅ this.$refs.Calendar.ChooseDate('today'); //Call method implementation to go to today
|
|
204
|
+
✅ this.$refs.Calendar.ChooseDate('25/09/2020'); //Call method implementation to go to a date
|
|
205
|
+
````
|
|
206
|
+
___
|
|
207
|
+
|
|
208
|
+
## Treeware
|
|
209
|
+
|
|
210
|
+
You're free to use this package, but if it makes it to your production environment you are required to buy the world a tree.
|
|
211
|
+
|
|
212
|
+
It’s now common knowledge that one of the best tools to tackle the climate crisis and keep our temperatures from rising above 1.5C is to <a href="https://www.bbc.co.uk/news/science-environment-48870920">plant trees</a>. If you support this package and contribute to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.
|
|
213
|
+
|
|
214
|
+
You can buy trees here [offset.earth/treeware](https://offset.earth/treeware?gift-trees)
|
|
215
|
+
|
|
216
|
+
Read more about Treeware at [treeware.earth](http://treeware.earth)
|
|
@@ -4516,7 +4516,7 @@ if (typeof window !== 'undefined') {
|
|
|
4516
4516
|
// Indicate to webpack that this file can be concatenated
|
|
4517
4517
|
/* harmony default export */ var setPublicPath = (null);
|
|
4518
4518
|
|
|
4519
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"b737400a-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/FunctionalCalendar.vue?vue&type=template&id=
|
|
4519
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"b737400a-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/FunctionalCalendar.vue?vue&type=template&id=2e159d63&
|
|
4520
4520
|
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:"popoverElement",staticClass:"vfc-popover-container",attrs:{"tabindex":"0"}},[_c('PickerInputs',{attrs:{"fConfigs":_vm.fConfigs,"singleSelectedDate":_vm.singleSelectedDate,"calendar":_vm.calendar},scopedSlots:_vm._u([{key:"dateRangeInputs",fn:function(props){return [_vm._t("dateRangeInputs",null,{"startDate":props.startDate,"endDate":props.endDate,"isTypeable":_vm.fConfigs.isTypeable})]}},{key:"datePickerInput",fn:function(props){return [_vm._t("datePickerInput",null,{"selectedDate":props.selectedDate,"isTypeable":_vm.fConfigs.isTypeable})]}}],null,true)}),_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.showCalendar),expression:"showCalendar"}],ref:"mainContainer",staticClass:"vfc-main-container",class:{
|
|
4521
4521
|
'vfc-modal':
|
|
4522
4522
|
_vm.fConfigs.isModal &&
|
|
@@ -4543,7 +4543,7 @@ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._sel
|
|
|
4543
4543
|
var staticRenderFns = []
|
|
4544
4544
|
|
|
4545
4545
|
|
|
4546
|
-
// CONCATENATED MODULE: ./src/components/FunctionalCalendar.vue?vue&type=template&id=
|
|
4546
|
+
// CONCATENATED MODULE: ./src/components/FunctionalCalendar.vue?vue&type=template&id=2e159d63&
|
|
4547
4547
|
|
|
4548
4548
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.object.assign.js
|
|
4549
4549
|
var es6_object_assign = __webpack_require__("f751");
|