@projectcaluma/ember-form 12.15.4 → 13.0.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,6 @@
1
1
  import { action } from "@ember/object";
2
2
  import { inject as service } from "@ember/service";
3
+ import { waitForPromise } from "@ember/test-waiters";
3
4
  import { macroCondition, isTesting } from "@embroider/macros";
4
5
  import Component from "@glimmer/component";
5
6
  import { queryManager } from "ember-apollo-client";
@@ -86,7 +87,9 @@ export default class CfFieldInputFilesComponent extends Component {
86
87
  };
87
88
 
88
89
  // upload the actual file to data storage
89
- await Promise.all(newFiles.map((file) => uploadFunction(file)));
90
+ await Promise.all(
91
+ newFiles.map((file) => waitForPromise(uploadFunction(file))),
92
+ );
90
93
 
91
94
  this.args.field.answer.value = savedAnswerValue;
92
95
  } catch (error) {
@@ -25,17 +25,28 @@
25
25
  class="uk-animation-fade uk-text-danger"
26
26
  />
27
27
  {{/if}}
28
- <UkButton
29
- @color="link"
30
- @onClick={{fn this.edit document}}
31
- title={{t "caluma.form.edit"}}
32
- class="uk-flex-inline uk-margin-small-left table-controls"
33
- data-test-edit-row
34
- >
35
- <UkIcon @icon="pencil" />
36
- <span hidden>{{t "caluma.form.edit"}}</span>
37
- </UkButton>
38
- {{#unless @disabled}}
28
+ {{#if @disabled}}
29
+ <UkButton
30
+ @color="link"
31
+ @onClick={{fn this.edit document}}
32
+ title={{t "caluma.form.view"}}
33
+ class="uk-flex-inline uk-margin-small-left table-controls"
34
+ data-test-edit-row
35
+ >
36
+ <UkIcon @icon="eye" />
37
+ <span hidden>{{t "caluma.form.view"}}</span>
38
+ </UkButton>
39
+ {{else}}
40
+ <UkButton
41
+ @color="link"
42
+ @onClick={{fn this.edit document}}
43
+ title={{t "caluma.form.edit"}}
44
+ class="uk-flex-inline uk-margin-small-left table-controls"
45
+ data-test-edit-row
46
+ >
47
+ <UkIcon @icon="pencil" />
48
+ <span hidden>{{t "caluma.form.edit"}}</span>
49
+ </UkButton>
39
50
  <UkButton
40
51
  @color="link"
41
52
  @onClick={{fn (perform this.delete) document}}
@@ -46,7 +57,7 @@
46
57
  <UkIcon @icon="trash" />
47
58
  <span hidden>{{t "caluma.form.delete"}}</span>
48
59
  </UkButton>
49
- {{/unless}}
60
+ {{/if}}
50
61
  </div>
51
62
  </td>
52
63
  </tr>
@@ -126,7 +126,9 @@ export default class CfFieldInputTableComponent extends Component {
126
126
  this.documentToEditIsNew = false;
127
127
  }
128
128
 
129
- yield this.args.field.validate.perform();
129
+ if (!this.args.disabled) {
130
+ yield this.args.field.validate.perform();
131
+ }
130
132
 
131
133
  this.showAddModal = false;
132
134
  this.documentToEdit = null;
@@ -269,7 +269,7 @@ export default class Document extends Base {
269
269
  }
270
270
 
271
271
  if (field.hidden || [undefined, null].includes(field.value)) {
272
- return defaultValue ?? field.question.isMultipleChoice ? [] : null;
272
+ return (defaultValue ?? field.question.isMultipleChoice) ? [] : null;
273
273
  }
274
274
 
275
275
  if (field.question.isTable) {
@@ -1,3 +1,5 @@
1
+ @use "sass:meta";
2
+
1
3
  /* UIkit overwrites
2
4
  * ----------------
3
5
  * These styles amend UIkit so that disabled form elements can be styled as
@@ -12,7 +14,7 @@
12
14
  background-color: $form-disabled-background;
13
15
  color: $form-disabled-color;
14
16
 
15
- @if mixin-exists(hook-form-disabled) {
17
+ @if meta.mixin-exists(hook-form-disabled) {
16
18
  @include hook-form-disabled;
17
19
  }
18
20
  }
@@ -30,7 +32,7 @@
30
32
  cursor: default;
31
33
  background-color: $form-radio-disabled-background;
32
34
 
33
- @if mixin-exists(hook-form-radio-disabled) {
35
+ @if meta.mixin-exists(hook-form-radio-disabled) {
34
36
  @include hook-form-radio-disabled;
35
37
  }
36
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@projectcaluma/ember-form",
3
- "version": "12.15.4",
3
+ "version": "13.0.0-beta.1",
4
4
  "description": "Ember addon for rendering Caluma forms.",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -9,15 +9,16 @@
9
9
  "homepage": "https://docs.caluma.io/ember-caluma",
10
10
  "repository": "github:projectcaluma/ember-caluma",
11
11
  "dependencies": {
12
- "@babel/core": "^7.24.7",
13
- "@ember/string": "^3.1.1",
14
- "@embroider/macros": "^1.15.0",
15
- "@embroider/util": "^1.13.1",
12
+ "@babel/core": "^7.25.2",
13
+ "@ember/string": "^4.0.0",
14
+ "@embroider/macros": "^1.16.5",
15
+ "@embroider/util": "^1.13.2",
16
16
  "@glimmer/component": "^1.1.2",
17
17
  "@glimmer/tracking": "^1.1.2",
18
18
  "ember-apollo-client": "~4.0.2",
19
- "ember-auto-import": "^2.7.2",
19
+ "ember-auto-import": "^2.7.4",
20
20
  "ember-autoresize-modifier": "^0.7.0",
21
+ "ember-basic-dropdown": "^8.1.0",
21
22
  "ember-cli-babel": "^8.2.0",
22
23
  "ember-cli-htmlbars": "^6.3.0",
23
24
  "ember-cli-showdown": "^9.0.1",
@@ -26,28 +27,28 @@
26
27
  "ember-fetch": "^8.1.2",
27
28
  "ember-flatpickr": "^8.0.0",
28
29
  "ember-in-viewport": "^4.1.0",
29
- "ember-intl": "^6.5.3",
30
+ "ember-intl": "^7.0.4",
30
31
  "ember-math-helpers": "^4.0.0",
31
- "ember-power-select": "^7.2.0",
32
+ "ember-power-select": "^8.2.0",
32
33
  "ember-truth-helpers": "^4.0.3",
33
34
  "ember-uikit": "^9.1.2",
34
35
  "ember-validators": "^4.1.2",
35
36
  "flatpickr": "^4.6.13",
36
- "graphql": "^15.8.0",
37
+ "graphql": "^15.9.0",
37
38
  "jexl": "^2.3.0",
38
39
  "lodash.isequal": "^4.5.0",
39
40
  "luxon": "^3.4.4",
40
- "reactiveweb": "^1.2.3",
41
+ "reactiveweb": "^1.3.0",
41
42
  "tracked-toolbox": "^2.0.0",
42
- "@projectcaluma/ember-core": "^12.15.4"
43
+ "@projectcaluma/ember-core": "^13.0.0-beta.1"
43
44
  },
44
45
  "devDependencies": {
45
46
  "@ember/optional-features": "2.1.0",
46
- "@ember/test-helpers": "3.3.0",
47
+ "@ember/test-helpers": "3.3.1",
47
48
  "@embroider/test-setup": "4.0.0",
48
49
  "@faker-js/faker": "8.4.1",
49
50
  "broccoli-asset-rev": "3.0.0",
50
- "ember-cli": "5.7.0",
51
+ "ember-cli": "5.10.0",
51
52
  "ember-cli-clean-css": "3.0.0",
52
53
  "ember-cli-code-coverage": "3.0.0",
53
54
  "ember-cli-dependency-checker": "3.3.2",
@@ -57,25 +58,25 @@
57
58
  "ember-cli-sri": "2.1.1",
58
59
  "ember-cli-terser": "4.0.2",
59
60
  "ember-load-initializers": "2.1.2",
60
- "ember-qunit": "8.0.2",
61
- "ember-resolver": "11.0.1",
62
- "ember-source": "5.7.0",
61
+ "ember-qunit": "8.1.0",
62
+ "ember-resolver": "12.0.1",
63
+ "ember-source": "5.10.1",
63
64
  "ember-source-channel-url": "3.0.0",
64
65
  "ember-try": "3.0.0",
65
66
  "loader.js": "4.7.0",
66
67
  "miragejs": "0.1.48",
67
- "qunit": "2.20.1",
68
- "qunit-dom": "3.1.2",
69
- "uikit": "3.21.5",
70
- "sass": "1.70.0",
71
- "uuid": "9.0.1",
72
- "webpack": "5.91.0",
73
- "@projectcaluma/ember-testing": "12.15.4",
74
- "@projectcaluma/ember-workflow": "12.15.4"
68
+ "qunit": "2.21.1",
69
+ "qunit-dom": "3.2.0",
70
+ "sass": "1.77.8",
71
+ "uikit": "3.21.8",
72
+ "uuid": "10.0.0",
73
+ "webpack": "5.93.0",
74
+ "@projectcaluma/ember-testing": "12.15.5",
75
+ "@projectcaluma/ember-workflow": "12.15.5"
75
76
  },
76
77
  "peerDependencies": {
77
- "ember-source": "^4.0.0",
78
- "@projectcaluma/ember-workflow": "^12.15.4"
78
+ "ember-source": ">= 4.0.0",
79
+ "@projectcaluma/ember-workflow": "^12.15.5"
79
80
  },
80
81
  "dependenciesMeta": {
81
82
  "@projectcaluma/ember-core": {
@@ -6,6 +6,7 @@ caluma:
6
6
  edit: "Bearbeiten"
7
7
  cancel: "Abbrechen"
8
8
  close: "Schliessen"
9
+ view: "Anzeigen"
9
10
  selectFile: "Durchsuchen..."
10
11
  deleteRow: "Möchten Sie diese Zeile wirklich löschen?"
11
12
  addRow: "Zeile hinzufügen"
@@ -6,6 +6,7 @@ caluma:
6
6
  edit: "Edit"
7
7
  cancel: "Cancel"
8
8
  close: "Close"
9
+ view: "View"
9
10
  selectFile: "Browse..."
10
11
  deleteRow: "Do you really want to delete this row?"
11
12
  addRow: "Add row"
@@ -6,6 +6,7 @@ caluma:
6
6
  edit: "modifier"
7
7
  cancel: "annuler"
8
8
  close: "fermer"
9
+ view: "Montrer"
9
10
  selectFile: "Sélectionner..."
10
11
  deleteRow: "Voulez-vous supprimer cette ligne?"
11
12
  addRow: "Ajouter une ligne"
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "declarationDir": "declarations",
5
- "emitDeclarationOnly": true,
6
- "noEmit": false,
7
- "rootDir": "."
8
- },
9
- "include": ["addon", "addon-test-support"]
10
- }