@ascua/calendar 0.4.6 → 0.6.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/calendar.js +19 -19
- package/package.json +3 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { tracked } from '@glimmer/tracking';
|
|
3
|
-
import {
|
|
3
|
+
import { service } from '@ember/service';
|
|
4
4
|
import { action } from '@ember/object';
|
|
5
5
|
import { arg } from '@ascua/decorators';
|
|
6
6
|
|
|
7
7
|
export default class extends Component {
|
|
8
8
|
|
|
9
|
-
@
|
|
9
|
+
@service('-document') document;
|
|
10
10
|
|
|
11
11
|
@tracked top = 0;
|
|
12
12
|
|
|
@@ -39,20 +39,20 @@ export default class extends Component {
|
|
|
39
39
|
let t = this.element.getBoundingClientRect().top - 5;
|
|
40
40
|
let l = this.element.getBoundingClientRect().left - 5;
|
|
41
41
|
|
|
42
|
-
while (
|
|
43
|
-
while (
|
|
42
|
+
while (l + w > window.innerWidth - 30) l--;
|
|
43
|
+
while (t + h > window.innerHeight - 30) t--;
|
|
44
44
|
|
|
45
45
|
this.left = l; this.top = t;
|
|
46
46
|
|
|
47
|
-
setTimeout(
|
|
47
|
+
setTimeout(() => {
|
|
48
48
|
|
|
49
49
|
let w = element.offsetWidth;
|
|
50
50
|
let h = element.offsetHeight;
|
|
51
51
|
let t = this.element.getBoundingClientRect().top - 5;
|
|
52
52
|
let l = this.element.getBoundingClientRect().left - 5;
|
|
53
53
|
|
|
54
|
-
while (
|
|
55
|
-
while (
|
|
54
|
+
while (l + w > window.innerWidth - 30) l--;
|
|
55
|
+
while (t + h > window.innerHeight - 30) t--;
|
|
56
56
|
|
|
57
57
|
this.left = l; this.top = t;
|
|
58
58
|
|
|
@@ -66,23 +66,23 @@ export default class extends Component {
|
|
|
66
66
|
|
|
67
67
|
get value() {
|
|
68
68
|
switch (true) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
case this.args.value && this.args.value instanceof Date === true:
|
|
70
|
+
return this.args.value;
|
|
71
|
+
case this.args.value && this.args.value instanceof Date === false:
|
|
72
|
+
return new Date(this.args.value);
|
|
73
|
+
default:
|
|
74
|
+
return undefined;
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
get pivot() {
|
|
79
79
|
switch (true) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
case this.current !== undefined:
|
|
81
|
+
return this.current;
|
|
82
|
+
case this.value !== undefined:
|
|
83
|
+
return this.value;
|
|
84
|
+
default:
|
|
85
|
+
return new Date();
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ascua/calendar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Small description for @ascua/calendar goes here",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"url": "https://surrealdb.com"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@ascua/decorators": "^0.
|
|
18
|
+
"@ascua/decorators": "^0.6.0",
|
|
19
19
|
"ember-cli-babel": "^8.2.0",
|
|
20
20
|
"ember-cli-htmlbars": "^6.3.0"
|
|
21
21
|
},
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "56b63607322165599c91049cbb91e5241ca8234c"
|
|
30
30
|
}
|