ember-power-calendar 0.16.2 → 0.17.0
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/addon/components/power-calendar/days.js +1 -1
- package/addon/components/power-calendar-range.js +1 -2
- package/addon/templates/components/power-calendar/days.hbs +1 -1
- package/addon/templates/components/power-calendar/nav.hbs +4 -4
- package/addon/templates/components/power-calendar.hbs +1 -1
- package/package.json +12 -10
- package/CHANGELOG.md +0 -227
|
@@ -73,7 +73,7 @@ export default @layout(templateLayout) @tagName('') class extends Component {
|
|
|
73
73
|
return weekdaysNames.slice(localeStartOfWeek).concat(weekdaysNames.slice(0, localeStartOfWeek));
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
@computed('calendar', 'focusedId', 'localeStartOfWeek', 'minDate', 'maxDate', 'disabledDates.[]', 'maxLength')
|
|
76
|
+
@computed('calendar', 'focusedId', 'localeStartOfWeek', 'minDate', 'maxDate', 'disabledDates.[]', 'maxLength', 'currentCenter')
|
|
77
77
|
get days() {
|
|
78
78
|
let today = this.powerCalendarService.getDate();
|
|
79
79
|
let lastDay = this.lastDay();
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { computed, action, getProperties } from '@ember/object';
|
|
2
|
-
import { assign } from '@ember/polyfills';
|
|
3
2
|
import CalendarComponent from './power-calendar';
|
|
4
3
|
import fallbackIfUndefined from '../utils/computed-fallback-if-undefined';
|
|
5
4
|
import {
|
|
@@ -65,7 +64,7 @@ export default class extends CalendarComponent {
|
|
|
65
64
|
@computed('_publicAPI', 'minRange', 'maxRange')
|
|
66
65
|
get publicAPI() {
|
|
67
66
|
let rangeOnlyAPI = this.getProperties('minRange', 'maxRange');
|
|
68
|
-
return assign(rangeOnlyAPI, this._publicAPI);
|
|
67
|
+
return Object.assign(rangeOnlyAPI, this._publicAPI);
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
// Actions
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<nav class="ember-power-calendar-nav">
|
|
2
2
|
{{#if @calendar.actions.changeCenter}}
|
|
3
|
-
<button type="button" class="ember-power-calendar-nav-control ember-power-calendar-nav-control--previous" {{on "click" (fn calendar.actions.moveCenter -1 this.unit @calendar)}}>«</button>
|
|
3
|
+
<button type="button" class="ember-power-calendar-nav-control ember-power-calendar-nav-control--previous" {{on "click" (fn @calendar.actions.moveCenter -1 this.unit @calendar)}}>«</button>
|
|
4
4
|
{{/if}}
|
|
5
5
|
<div class="ember-power-calendar-nav-title">
|
|
6
|
-
{{#if
|
|
6
|
+
{{#if (has-block)}}
|
|
7
7
|
{{yield @calendar}}
|
|
8
8
|
{{else}}
|
|
9
9
|
{{power-calendar-format-date @calendar.center this.format locale=@calendar.locale}}
|
|
10
10
|
{{/if}}
|
|
11
11
|
</div>
|
|
12
|
-
{{#if calendar.actions.changeCenter}}
|
|
12
|
+
{{#if @calendar.actions.changeCenter}}
|
|
13
13
|
<button type="button" class="ember-power-calendar-nav-control ember-power-calendar-nav-control--next" {{on "click" (fn @calendar.actions.moveCenter 1 this.unit @calendar)}}>»</button>
|
|
14
14
|
{{/if}}
|
|
15
|
-
</nav>
|
|
15
|
+
</nav>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-power-calendar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "Powerful and customizable calendar component for Ember",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "ember build --environment=production",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"@glimmer/tracking": "^1.0.0",
|
|
29
29
|
"babel-eslint": "^10.1.0",
|
|
30
30
|
"broccoli-asset-rev": "^3.0.0",
|
|
31
|
-
"ember-auto-import": "^
|
|
32
|
-
"ember-basic-dropdown": "^
|
|
31
|
+
"ember-auto-import": "^2.4.0",
|
|
32
|
+
"ember-basic-dropdown": "^4.0.3",
|
|
33
33
|
"ember-cli": "~3.17.0",
|
|
34
34
|
"ember-cli-app-version": "^3.2.0",
|
|
35
35
|
"ember-cli-custom-assertions": "^0.1.1",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"ember-export-application-global": "^2.0.1",
|
|
47
47
|
"ember-load-initializers": "^2.1.1",
|
|
48
48
|
"ember-maybe-import-regenerator": "^0.1.6",
|
|
49
|
-
"ember-power-calendar-moment": "^0.
|
|
50
|
-
"ember-power-select": "^
|
|
49
|
+
"ember-power-calendar-moment": "^0.2.0",
|
|
50
|
+
"ember-power-select": "^5.0.3",
|
|
51
51
|
"ember-resolver": "^7.0.0",
|
|
52
52
|
"ember-source": "~3.17.0",
|
|
53
53
|
"ember-source-channel-url": "^2.0.1",
|
|
@@ -58,9 +58,11 @@
|
|
|
58
58
|
"eslint-plugin-node": "^11.0.0",
|
|
59
59
|
"loader.js": "^4.7.0",
|
|
60
60
|
"memory-scroll": "^1.0.0",
|
|
61
|
+
"moment": "^2.29.1",
|
|
61
62
|
"npm-run-all": "^4.1.5",
|
|
62
63
|
"qunit-dom": "^1.1.0",
|
|
63
|
-
"sass": "^1.15.2"
|
|
64
|
+
"sass": "^1.15.2",
|
|
65
|
+
"webpack": "^5.68.0"
|
|
64
66
|
},
|
|
65
67
|
"keywords": [
|
|
66
68
|
"ember-addon",
|
|
@@ -79,13 +81,13 @@
|
|
|
79
81
|
"test": "tests"
|
|
80
82
|
},
|
|
81
83
|
"dependencies": {
|
|
82
|
-
"ember-assign-helper": "^0.3.0",
|
|
84
|
+
"ember-assign-helper": "^0.3.0 || ^0.4.0",
|
|
83
85
|
"ember-cli-babel": "^7.18.0",
|
|
84
86
|
"ember-cli-element-closest-polyfill": "^0.0.2",
|
|
85
|
-
"ember-cli-htmlbars": "^4.2.3",
|
|
86
|
-
"ember-concurrency": "^0.8.27 || ^0.9.0 || ^0.10.0 || ^1.0.0 || ^
|
|
87
|
+
"ember-cli-htmlbars": "^4.2.3 || ^5.0.0 || ^6.0.0",
|
|
88
|
+
"ember-concurrency": "^0.8.27 || ^0.9.0 || ^0.10.0 || ^1.0.0 || ^2.0.0-rc.1",
|
|
87
89
|
"ember-decorators": "^6.1.1",
|
|
88
|
-
"ember-element-helper": "^0.
|
|
90
|
+
"ember-element-helper": "^0.5.0 || ^0.6.0",
|
|
89
91
|
"ember-truth-helpers": "^2.1.0 || ^3.0.0"
|
|
90
92
|
},
|
|
91
93
|
"ember": {
|
package/CHANGELOG.md
DELETED
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
## Master
|
|
2
|
-
|
|
3
|
-
# 0.16.2
|
|
4
|
-
- [ENHANCEMENT] Relax dependency on ember-truth-helpers.
|
|
5
|
-
|
|
6
|
-
# 0.16.1
|
|
7
|
-
- [ENHANCEMENT] Bump version of `element-closest-polyfill` to 0.0.2
|
|
8
|
-
|
|
9
|
-
# 0.16.0
|
|
10
|
-
|
|
11
|
-
## 0.14.5
|
|
12
|
-
- [BUGFIX] Don't set `center` to undefined in days component. Users may subclass it and define center
|
|
13
|
-
as readonly.
|
|
14
|
-
|
|
15
|
-
## 0.14.4
|
|
16
|
-
- [ENHANCEMENT] Added support for optional `@tag` argument to `<PowerCalendar />`
|
|
17
|
-
|
|
18
|
-
## 0.14.3
|
|
19
|
-
- [BUGFIX] Remove deprecation by adding a setter for the locale to power-calendar service.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
## 0.14.2
|
|
23
|
-
- [BUGFIX] Both `minDate` and `maxDate` should form part of the range and therefore be selectables.
|
|
24
|
-
|
|
25
|
-
## 0.14.1
|
|
26
|
-
- [ENHANCEMENT] The `<calendar.Nav>` component will display in the `data-power-calendar-id` the value of `calendar.calendarUniqueId`
|
|
27
|
-
if present (it not present, it will display `calendar.uniqueId` as before)
|
|
28
|
-
|
|
29
|
-
## 0.14.0
|
|
30
|
-
- [BREAKING] Update addon to angle-bracket syntax. It requires Ember 3.11 now. The yielded components are
|
|
31
|
-
now capitalized (e.g. `<calendar.Nav>`).
|
|
32
|
-
|
|
33
|
-
## 0.13.3
|
|
34
|
-
- [CHORE] Allow ember-concurrency 1.0
|
|
35
|
-
|
|
36
|
-
## 0.13.2
|
|
37
|
-
- [BUGFIX] Make use of `$nav-button-color--focus`, which before wasn't really being used as intended. This makes it customizable.
|
|
38
|
-
|
|
39
|
-
## 0.13.1
|
|
40
|
-
- [BUGFIX] Fix bug detecting keyword in package.json
|
|
41
|
-
|
|
42
|
-
## 0.13.0
|
|
43
|
-
- [ENHANCEMENT] Detect EPC-adapters (like ember-power-calendar-luxon and ember-power-calendar-moment)
|
|
44
|
-
not using a whitelist, but looking for the keyword `ember-power-calendar-adapter` in their package.json
|
|
45
|
-
|
|
46
|
-
## 0.12.0
|
|
47
|
-
- [ENHANCEMENT] Update ember-concurrency to 0.9 for better octane support
|
|
48
|
-
|
|
49
|
-
## 0.11.0
|
|
50
|
-
Unsure
|
|
51
|
-
|
|
52
|
-
## 0.10.3
|
|
53
|
-
- [ENHANCEMENT] Allow range calendar's `actions.select` to take an range. It used to only
|
|
54
|
-
allow a single day from which it constructed a the range. This hasn't change, but now if it receives
|
|
55
|
-
a range it it will use that range it will use as is.
|
|
56
|
-
|
|
57
|
-
## 0.10.2
|
|
58
|
-
- [ENHANCEMENT] Allow pass a `@unit` and `@format` to the `calendar.Nav` component, which used to be
|
|
59
|
-
hardcoded values (`'month'` and `'MMMM YYYY'` respetively).
|
|
60
|
-
|
|
61
|
-
## 0.10.1
|
|
62
|
-
- [ENHANCEMENT] Allow multiple calendar's `actions.select` to take an array of days. It used to only
|
|
63
|
-
allow a single day from which it constructed a new list. This hasn't change, but now if it receives
|
|
64
|
-
a list it it will use that list as the final set of values.
|
|
65
|
-
|
|
66
|
-
## 0.10.0
|
|
67
|
-
- [CHORE] Minimum version of `ember-power-calendar-luxon` has to be 0.1.5 and of `ember-power-calendar-moment` 0.1.4.
|
|
68
|
-
Some utility functions have been extracted there.
|
|
69
|
-
|
|
70
|
-
## 0.9.7
|
|
71
|
-
- [ENHANCEMENT] `{{#cal.days}}` yields the array of weeks as third argument.
|
|
72
|
-
|
|
73
|
-
## 0.9.6
|
|
74
|
-
- [ENHANCEMENT] Allow `{{cal.days}}` component to receive a `dayClass` property that can be either a string or a function that takes `(day, calendar, weeks)` and returns a string. That string is added as a class to days.
|
|
75
|
-
|
|
76
|
-
## 0.9.5
|
|
77
|
-
- [ENHANCEMENT] Add `type` to public API. Possible values: "single" | "multiple" | "range"
|
|
78
|
-
- [DOCS] Document public API object.
|
|
79
|
-
- [CHORE] Update dependencies, including babel 7
|
|
80
|
-
|
|
81
|
-
## 0.9.4
|
|
82
|
-
- [BUFIX] Fix 0.9.3 in versions of ember-cli >= 3.5
|
|
83
|
-
|
|
84
|
-
## 0.9.3
|
|
85
|
-
- [BUGFIX] Fix broken dependency check under yarn workspaces.
|
|
86
|
-
|
|
87
|
-
## 0.9.2
|
|
88
|
-
- [BUGFIX] Fix testing of ember-power-calendar from within a whormole to the root of the body.
|
|
89
|
-
|
|
90
|
-
## 0.9.1
|
|
91
|
-
- [BUGFIX] Prevent infinite loop rendering the days component
|
|
92
|
-
|
|
93
|
-
## 0.9.0
|
|
94
|
-
- [BREAKING] Now this addon requires the user to install either `ember-power-calendar-moment` or `ember-power-calendar-luxon`
|
|
95
|
-
to work. However, once installed it should either of those, it should behave the same (obviously you won't ve able to pass
|
|
96
|
-
moment object if you choose the luxon addon)
|
|
97
|
-
|
|
98
|
-
## 0.8.1
|
|
99
|
-
- [BUGFIX] Update minimum version of `ember-power-calendar-moment` to fix some bugs.
|
|
100
|
-
|
|
101
|
-
## 0.8.0
|
|
102
|
-
- [CHORE] 🎉🎉**BIG CHANGE**🎉🎉 Now the utility functions don't live on this addon but on another addon
|
|
103
|
-
named `ember-power-calendar-moment`, that for the time being is a runtime dependency so it shouldn't
|
|
104
|
-
be breaking. In an upcoming version it will be removed from the runtime dependencies so user will have
|
|
105
|
-
to explicitly install that other addon.
|
|
106
|
-
|
|
107
|
-
## 0.8.0-beta.2
|
|
108
|
-
- [BREAKING] Require the new testing API based on `setupTest`/`setupRenderingTest`/`setupApplicationTest` that
|
|
109
|
-
comes with `ember-qunit` 3.2+.
|
|
110
|
-
|
|
111
|
-
## 0.8.0-beta.1
|
|
112
|
-
- [BREAKING] This addon no longer depends on `ember-moment`, only in `ember-cli-moment-shim`, which
|
|
113
|
-
means it no longer attempts to read the locale from the `service:moment`. You can now set the locale
|
|
114
|
-
(if different from the global moment.js locale) in the `service:power-calendar`.
|
|
115
|
-
|
|
116
|
-
- [HUGE REFACTOR] The addon is pretty decoupled from moment.js, with the plan of allowing using it
|
|
117
|
-
with luxon.js, or other libraries (maybe without any library!) in the next version.
|
|
118
|
-
It should not be a breaking change, but since it was a very big refactor, update it with care.
|
|
119
|
-
Due to this refactor and the drop of ember-moment, the addon is ~28kb (~4.5kb min+gzip) smaller
|
|
120
|
-
than before.
|
|
121
|
-
|
|
122
|
-
## 0.7.3
|
|
123
|
-
- [ENHANCEMENT] Add helpful assertions when a calendar receives an invalid date as center and when the user tries to change the center of a calendar without an `onCenterChange` action.
|
|
124
|
-
|
|
125
|
-
## 0.7.2
|
|
126
|
-
- [FEATURE] Add `proximitySelection` to `power-calendar-range`. When true (default is false) the clicking on the calendar after a range has been selected doesn't start a new range, but moves the closest extreme of the current range, expanding or narrowing it.
|
|
127
|
-
|
|
128
|
-
## 0.7.1
|
|
129
|
-
- [INTERNAL] Update some testing deps
|
|
130
|
-
|
|
131
|
-
## 0.7.0
|
|
132
|
-
- [BREAKING] Require Ember >= 2.10
|
|
133
|
-
|
|
134
|
-
## 0.6.1
|
|
135
|
-
- [BUGFIX] Ensure `addon-test-support/` folder is not blacklisted in NPM
|
|
136
|
-
|
|
137
|
-
## 0.6.0
|
|
138
|
-
- [ENHANCEMENT] Now the `calendarCenter` and `calendarSelect` helpers are importable from `ember-power-calendar/test-support`
|
|
139
|
-
and can be used in both integration and acceptance tests.
|
|
140
|
-
- [ENHANCEMENT] When the `moveCenter` action was called with a `null`/`undefined` value it could cause
|
|
141
|
-
problems. Now doing that is perfectly legal and it will center the month in the current date.
|
|
142
|
-
|
|
143
|
-
## 0.5.0
|
|
144
|
-
- [ENHANCEMENT] Allow invocation without block. It renders both nav and days.
|
|
145
|
-
- [BUGFIX] Add `type="button"` to buttons in the nav so they are not implicitly considered
|
|
146
|
-
type submit, leading to submitting the enclosing form.
|
|
147
|
-
- [INTERNAL] The addon is now jQuery free too.
|
|
148
|
-
- [BREAKING] Allow the `ember-power-calendar` SASS/LESS mixin to take a lot more variables
|
|
149
|
-
to customize colors and more. Potentially breaking, but probably not for the big majority.
|
|
150
|
-
|
|
151
|
-
## 0.4.0
|
|
152
|
-
- [INTERNAL] Update to Babel 6
|
|
153
|
-
|
|
154
|
-
## 0.3.2
|
|
155
|
-
- [BUGFIX] Broken safari styles due to unnecesary flex position on days.
|
|
156
|
-
|
|
157
|
-
## 0.3.1
|
|
158
|
-
- [ENHANCEMENT] Added less support.
|
|
159
|
-
|
|
160
|
-
## 0.3.0
|
|
161
|
-
- [BREAKING] `onSelect` and `onCenterAction` now receive the publicAPI of the component
|
|
162
|
-
as second argument and the event as third.
|
|
163
|
-
|
|
164
|
-
## 0.2.7
|
|
165
|
-
- [ENHANCEMENT] `data-ember-power-calendar-id` can be bound from the outside
|
|
166
|
-
|
|
167
|
-
## 0.2.6
|
|
168
|
-
- [ENHANCEMENT] Added an `onInit` action that can be passed from the outside, and it called with the public API
|
|
169
|
-
once.
|
|
170
|
-
|
|
171
|
-
## 0.2.5
|
|
172
|
-
- [BREAKING] Renamed `service:power-calendar-clock` to just `service:power-calendar`. This service
|
|
173
|
-
wasn't public, so it's unlikely anyone will be affected.
|
|
174
|
-
- [ENHANCEMENT] Added `calendar.uniqueId` to the public API. The `{{cal.days}}` use it to display a `data-power-calendar-id`
|
|
175
|
-
attribute that reference the original calendar.
|
|
176
|
-
- [ENHANCEMENT] The `calendarCenter` and `calendarSelect` test helpers now also work with tagless calendars,
|
|
177
|
-
thanks to the enhancement above.
|
|
178
|
-
|
|
179
|
-
## 0.2.4
|
|
180
|
-
- [ENHANCEMENT] Add `maxLength` to the `{{cal.days}}` component of multiple selects. It determines the
|
|
181
|
-
max number of day selections the user can make. Once that number is reached no more days can be selected,
|
|
182
|
-
but those selected can be unselected. Defaults to `Infinity` so there is no limit by default.
|
|
183
|
-
|
|
184
|
-
## 0.2.3
|
|
185
|
-
- [ENHANCEMENT] Allow to disable specific days passing `{{cal.days disabledDates=collection}}`.
|
|
186
|
-
As usual the property can be a collection of Dates or Moments.
|
|
187
|
-
|
|
188
|
-
## 0.2.2
|
|
189
|
-
- [ENHANCEMENT] Improve default styles of calendar days.
|
|
190
|
-
|
|
191
|
-
## 0.2.1
|
|
192
|
-
- [ENHANCEMENT] Make Sass mixin more configurable, by accepting more variables. The basic usage remains
|
|
193
|
-
the same, this is not breaking.
|
|
194
|
-
## 0.2.1
|
|
195
|
-
- [BREAKING] The component no longer automatically gets a `ember-power-calendar--loading` when
|
|
196
|
-
the `onCenterChange` returns a promise/task. Instead, the publicAPI of the component will have
|
|
197
|
-
the `loading` flag set to true, and you can use that to any purpose. This flag might change
|
|
198
|
-
in future.
|
|
199
|
-
|
|
200
|
-
## 0.1.8
|
|
201
|
-
- [BUGFIX] Fix styles in IE11 - @nwhittaker
|
|
202
|
-
|
|
203
|
-
## 0.1.7
|
|
204
|
-
- [BUGFIX] Fix calculation of days when the `moment` global had a different locale than the `service:moment`.
|
|
205
|
-
|
|
206
|
-
## 0.1.6
|
|
207
|
-
- [BUGFIX] Make `ember-assign-helper` a runtime dependency.
|
|
208
|
-
|
|
209
|
-
## 0.1.5
|
|
210
|
-
- [FEATURE] Add `maxRange` to prevent users from selecting ranges > the given duration.
|
|
211
|
-
- [FEATURE] Add `minRange` to prevent users from selecting ranges < the given duration.
|
|
212
|
-
- [BUGFIX] If a range has `start` and `end` in the same day, that day has both `*--range-start` and `*--range-end` classes.
|
|
213
|
-
- [BREAKING] Rename `calendar.actions.changeCenter` to `calendar.actions.moveCenter`.
|
|
214
|
-
- [BUGFIX] Clicking on the last selected day selected it twice instead of removing it.
|
|
215
|
-
|
|
216
|
-
## 0.1.4
|
|
217
|
-
- [FEATURE] Add `weekdayFormat` to customize the format of the weekdays. Values: "short" (default), "long" and "min".
|
|
218
|
-
|
|
219
|
-
## 0.1.3
|
|
220
|
-
- [FEATURE] Add `calendarCenter` and `calendarSelect` test-helpers for acceptnace testing.
|
|
221
|
-
|
|
222
|
-
## 0.1.2
|
|
223
|
-
- [FEATURE] Add `i18n` based in ember-moment.
|
|
224
|
-
|
|
225
|
-
## 0.1.1
|
|
226
|
-
- [FEATURE] Add `minDate` and `maxDate` to default `<calendar.Days/>` component to disabled days before/after
|
|
227
|
-
some specific date.
|