ember-ebau-gwr 4.0.1 → 4.0.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [4.0.2](https://github.com/adfinis-sygroup/ember-ebau-gwr/compare/v4.0.1...v4.0.2) (2022-02-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update ember-pikaday and remove moment and dayjs ([1acbffc](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/1acbffca9eff26f32fdad9df1856d8bf936edf7b))
7
+
1
8
  ## [4.0.1](https://github.com/adfinis-sygroup/ember-ebau-gwr/compare/v4.0.0...v4.0.1) (2022-01-25)
2
9
 
3
10
 
@@ -2,20 +2,33 @@
2
2
  <div class="{{if @horizontal "uk-margin-left uk-flex-last"}}">
3
3
  {{component @labelComponent}}
4
4
  </div>
5
- <PikadayInput
6
- @format="DD.MM.YYYY"
7
- @placeholder={{t "ember-gwr.components.modelForm.datePlaceholder"}}
8
- @onSelection={{@update}}
9
- @value={{this.value}}
10
- @disabled={{@disabled}}
11
- @yearRange={{"2000,currentYear"}}
12
- class="uk-width-1 uk-input
13
- {{if @isInvalid "uk-form-danger"}}
14
- {{if @isValid "uk-form-success"}}"
15
- name={{@name}}
16
- required={{@required}}
17
- ...attributes
18
- />
5
+ {{#if @disabled}}
6
+ <input
7
+ type="text"
8
+ class="uk-input uk-width-1 {{if @isInvalid "uk-form-danger"}} {{if @isValid "uk-form-success"}}"
9
+ name={{@name}}
10
+ value={{format-date @value day="2-digit" month="2-digit" year="numeric"}}
11
+ placeholder={{t "ember-gwr.components.modelForm.datePlaceholder"}}
12
+ disabled
13
+ ...attributes
14
+ >
15
+ {{else}}
16
+ <input
17
+ type="text"
18
+ class="uk-input uk-width-1 {{if @isInvalid "uk-form-danger"}} {{if @isValid "uk-form-success"}}"
19
+ name={{@name}}
20
+ required={{@required}}
21
+ placeholder={{t "ember-gwr.components.modelForm.datePlaceholder"}}
22
+ ...attributes
23
+ {{pikaday
24
+ value=@value
25
+ yearRange=this.yearRange
26
+ onSelect=@update
27
+ toString=this.formatDate
28
+ i18n=this.pikadayTranslations
29
+ }}
30
+ />
31
+ {{/if}}
19
32
  </div>
20
33
  {{component @hintComponent}}
21
34
  {{component @errorComponent}}
@@ -1,13 +1,33 @@
1
+ import { action } from "@ember/object";
2
+ import { inject as service } from "@ember/service";
1
3
  import Component from "@glimmer/component";
4
+ import { Info } from "luxon";
2
5
 
3
- // TODO: remove file once two-way binding issue of value is resolved in ember-pikaday
4
- // https://github.com/adopted-ember-addons/ember-pikaday/issues/212
5
6
  export default class ModelFormDateComponent extends Component {
6
- get value() {
7
- return this.args.value;
7
+ @service intl;
8
+
9
+ get pikadayTranslations() {
10
+ const locale = this.intl.primaryLocale;
11
+
12
+ return {
13
+ previousMonth: this.intl.t("ember-gwr.previousMonth"),
14
+ nextMonth: this.intl.t("ember-gwr.nextMonth"),
15
+ months: Info.months("long", { locale }),
16
+ weekdays: Info.weekdays("long", { locale }),
17
+ weekdaysShort: Info.weekdays("short", { locale }),
18
+ };
8
19
  }
9
20
 
10
- // prevent pikaday two-way binding from
11
- // updating "value" field on input
12
- set value(value) {}
21
+ get yearRange() {
22
+ return [2000, new Date().getFullYear()];
23
+ }
24
+
25
+ @action
26
+ formatDate(value) {
27
+ return this.intl.formatDate(value, {
28
+ day: "2-digit",
29
+ month: "2-digit",
30
+ year: "numeric",
31
+ });
32
+ }
13
33
  }
@@ -0,0 +1,2 @@
1
+ import "ember-pikaday/pikaday.css";
2
+ export { default } from "ember-pikaday/modifiers/pikaday";
@@ -1,11 +1,11 @@
1
1
  import { get } from "@ember/object";
2
- import dayjs from "dayjs";
2
+ import { DateTime } from "luxon";
3
3
 
4
4
  // All functions in this file will be registered to handlebars as helpers.
5
5
 
6
6
  export function echDate(date) {
7
- return typeof date === "object" && date !== null
8
- ? dayjs(date).format("YYYY-MM-DD")
7
+ return date instanceof Date && date !== null
8
+ ? DateTime.fromJSDate(date).toISODate()
9
9
  : date;
10
10
  }
11
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-ebau-gwr",
3
- "version": "4.0.1",
3
+ "version": "4.0.2",
4
4
  "description": "Ember engine to integrate ebau-gwr into an ember app.",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -31,32 +31,32 @@
31
31
  "ember-engines": ">= 8"
32
32
  },
33
33
  "dependencies": {
34
- "@ember/render-modifiers": "^2.0.3",
34
+ "@ember/render-modifiers": "^2.0.4",
35
35
  "@glimmer/component": "^1.0.4",
36
36
  "@glimmer/tracking": "^1.0.4",
37
- "dayjs": "^1.10.7",
38
37
  "ember-auto-import": "^2.4.0",
39
38
  "ember-changeset": "^4.0.0-beta.2",
40
39
  "ember-changeset-validations": "^4.0.0-beta.2",
41
40
  "ember-cli-babel": "^7.26.11",
42
41
  "ember-cli-htmlbars": "^6.0.1",
43
42
  "ember-composable-helpers": "^5.0.0",
44
- "ember-concurrency": "^2.2.0",
43
+ "ember-concurrency": "^2.2.1",
45
44
  "ember-engines-router-service": "^0.3.0",
46
45
  "ember-intl": "^5.7.2",
47
- "ember-pikaday": "^3.0.0",
46
+ "ember-pikaday": "^4.0.0",
48
47
  "ember-power-select": "^5.0.3",
49
48
  "ember-truth-helpers": "^3.0.0",
50
- "ember-uikit": "^5.0.0-beta.7",
51
- "ember-validated-form": "^5.1.1",
52
- "handlebars": "^4.7.7"
49
+ "ember-uikit": "^5.0.0",
50
+ "ember-validated-form": "^5.2.0",
51
+ "handlebars": "^4.7.7",
52
+ "luxon": "^2.3.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@adfinis-sygroup/eslint-config": "1.5.0",
56
56
  "@adfinis-sygroup/semantic-release-config": "3.4.0",
57
57
  "@ember/optional-features": "2.0.0",
58
58
  "@ember/test-helpers": "2.6.0",
59
- "@embroider/test-setup": "1.0.0",
59
+ "@embroider/test-setup": "1.1.0",
60
60
  "babel-eslint": "10.1.0",
61
61
  "broccoli-asset-rev": "3.0.0",
62
62
  "ember-cli": "3.28.5",
@@ -66,7 +66,7 @@
66
66
  "ember-cli-sass": "10.0.1",
67
67
  "ember-cli-sri": "2.1.1",
68
68
  "ember-cli-terser": "4.0.2",
69
- "ember-data": "3.28.7",
69
+ "ember-data": "3.28.8",
70
70
  "ember-disable-prototype-extensions": "1.1.3",
71
71
  "ember-engines": "https://gitpkg.now.sh/anehx/ember-engines/packages/ember-engines?c08f7650ffc4b723e8ba1143d7498e58bc1e4b78",
72
72
  "ember-export-application-global": "2.0.1",
@@ -94,17 +94,16 @@
94
94
  "prettier": "2.5.1",
95
95
  "qunit": "2.17.2",
96
96
  "qunit-dom": "2.0.0",
97
- "sass": "1.49.0",
98
- "webpack": "5.67.0"
97
+ "sass": "1.49.7",
98
+ "webpack": "5.68.0"
99
99
  },
100
100
  "//": [
101
101
  "TODO: remove @embroider/* resolutions when https://github.com/embroider-build/embroider/issues/1077 is resolved",
102
102
  "TODO: remove ember-engines exotic dependency when https://github.com/ember-engines/ember-engines/pull/794 is released"
103
103
  ],
104
104
  "resolutions": {
105
- "@embroider/macros": "1.0.0",
106
- "@embroider/core": "1.0.0",
107
- "@embroider/util": "1.0.0"
105
+ "@embroider/macros": "1.1.0",
106
+ "@embroider/util": "1.1.0"
108
107
  },
109
108
  "engines": {
110
109
  "node": "12.* || 14.* || >= 16"
@@ -1,5 +1,7 @@
1
1
  ember-gwr:
2
2
  close: "Schliessen"
3
+ previousMonth: "Vorheriger Monat"
4
+ nextMonth: "Nächster Monat"
3
5
 
4
6
  models:
5
7
  building: |-
@@ -1,5 +1,7 @@
1
1
  ember-gwr:
2
2
  close: "Fermer"
3
+ previousMonth: "Mois précédent"
4
+ nextMonth: "Mois suivant"
3
5
 
4
6
  models:
5
7
  building: |-