@projectcaluma/ember-form 12.10.3 → 12.11.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,6 +14,7 @@
14
14
  name={{@field.pk}}
15
15
  class="uk-input {{if @disabled 'uk-disabled'}}"
16
16
  readonly={{@disabled}}
17
+ placeholder={{@field.question.raw.placeholder}}
17
18
  @disabled={{@disabled}}
18
19
  @locale={{this.locale}}
19
20
  @date={{or @field.answer.value null}}
@@ -10,5 +10,6 @@
10
10
  value={{@field.value}}
11
11
  min={{@field.question.raw.floatMinValue}}
12
12
  max={{@field.question.raw.floatMaxValue}}
13
+ placeholder={{@field.question.raw.placeholder}}
13
14
  {{on "input" this.input}}
14
15
  />
@@ -21,14 +21,7 @@
21
21
  @onClick={{fn this.download file.id}}
22
22
  />
23
23
  {{/each}}
24
- {{else if
25
- (and
26
- @field.answer.value
27
- (eq
28
- @field.question.raw.meta.widgetOverride "cf-field/input/number-separator"
29
- )
30
- )
31
- }}
24
+ {{else if (and @field.answer.value @field.question.useNumberSeparatorWidget)}}
32
25
  {{format-number @field.answer.value maximumFractionDigits=20}}
33
26
  {{else}}
34
27
  {{@field.answer.value}}
@@ -35,10 +35,16 @@ export default class GetWidgetHelper extends Helper {
35
35
 
36
36
  compute(params, { default: defaultWidget = "cf-field/input" }) {
37
37
  for (const obj of params) {
38
- const widget = obj?.raw?.meta?.widgetOverride;
38
+ let widget = obj?.raw?.meta?.widgetOverride;
39
+
40
+ if (obj?.useNumberSeparatorWidget) {
41
+ widget = "cf-field/input/number-separator";
42
+ }
43
+
39
44
  if (!widget) {
40
45
  continue;
41
46
  }
47
+
42
48
  const override =
43
49
  widget &&
44
50
  this.calumaOptions
@@ -1,4 +1,5 @@
1
1
  import { assert } from "@ember/debug";
2
+ import { inject as service } from "@ember/service";
2
3
  import { camelize } from "@ember/string";
3
4
  import { queryManager } from "ember-apollo-client";
4
5
  import { trackedFunction } from "reactiveweb/function";
@@ -17,6 +18,8 @@ const getValue = (answer) => {
17
18
  * @class Question
18
19
  */
19
20
  export default class Question extends Base {
21
+ @service calumaOptions;
22
+
20
23
  @queryManager apollo;
21
24
 
22
25
  constructor({ raw, ...args }) {
@@ -174,4 +177,16 @@ export default class Question extends Base {
174
177
 
175
178
  return value;
176
179
  }
180
+
181
+ get useNumberSeparatorWidget() {
182
+ return (
183
+ this.raw.meta.widgetOverride === "cf-field/input/number-separator" ||
184
+ (this.calumaOptions.alwaysUseNumberSeparatorWidget &&
185
+ [
186
+ "IntegerQuestion",
187
+ "FloatQuestion",
188
+ "CalculatedFloatQuestion",
189
+ ].includes(this.raw.__typename))
190
+ );
191
+ }
177
192
  }
@@ -1,4 +1,5 @@
1
1
  import { assert, debug } from "@ember/debug";
2
+ import { destroy } from "@ember/destroyable";
2
3
  import { set } from "@ember/object";
3
4
  import Service from "@ember/service";
4
5
 
@@ -41,7 +42,7 @@ export default class CalumaStoreService extends Service {
41
42
  }
42
43
 
43
44
  clear() {
44
- this._store.forEach((obj) => obj.destroy());
45
+ this._store.forEach((obj) => destroy(obj));
45
46
 
46
47
  // `this._store` is not an ember array but a native map
47
48
  // eslint-disable-next-line ember/no-array-prototype-extensions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@projectcaluma/ember-form",
3
- "version": "12.10.3",
3
+ "version": "12.11.0",
4
4
  "description": "Ember addon for rendering Caluma forms.",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -9,7 +9,7 @@
9
9
  "homepage": "https://docs.caluma.io/ember-caluma",
10
10
  "repository": "github:projectcaluma/ember-caluma",
11
11
  "dependencies": {
12
- "@babel/core": "^7.24.0",
12
+ "@babel/core": "^7.24.3",
13
13
  "@ember/string": "^3.1.1",
14
14
  "@embroider/macros": "^1.15.0",
15
15
  "@embroider/util": "^1.13.0",
@@ -22,7 +22,7 @@
22
22
  "ember-cli-htmlbars": "^6.3.0",
23
23
  "ember-cli-showdown": "^9.0.1",
24
24
  "ember-composable-helpers": "^5.0.0",
25
- "ember-concurrency": "^4.0.1",
25
+ "ember-concurrency": "^4.0.2",
26
26
  "ember-fetch": "^8.1.2",
27
27
  "ember-flatpickr": "^8.0.0",
28
28
  "ember-in-viewport": "^4.1.0",
@@ -30,7 +30,7 @@
30
30
  "ember-math-helpers": "^4.0.0",
31
31
  "ember-power-select": "^7.2.0",
32
32
  "ember-truth-helpers": "^4.0.3",
33
- "ember-uikit": "^9.0.1",
33
+ "ember-uikit": "^9.1.1",
34
34
  "ember-validators": "^4.1.2",
35
35
  "flatpickr": "^4.6.13",
36
36
  "graphql": "^15.8.0",
@@ -39,7 +39,7 @@
39
39
  "luxon": "^3.4.4",
40
40
  "reactiveweb": "^1.2.2",
41
41
  "tracked-toolbox": "^2.0.0",
42
- "@projectcaluma/ember-core": "^12.10.3"
42
+ "@projectcaluma/ember-core": "^12.11.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@ember/optional-features": "2.1.0",
@@ -67,13 +67,13 @@
67
67
  "qunit-dom": "3.0.0",
68
68
  "uikit": "3.19.2",
69
69
  "uuid": "9.0.1",
70
- "webpack": "5.90.3",
71
- "@projectcaluma/ember-workflow": "12.10.3",
72
- "@projectcaluma/ember-testing": "12.10.3"
70
+ "webpack": "5.91.0",
71
+ "@projectcaluma/ember-testing": "12.11.0",
72
+ "@projectcaluma/ember-workflow": "12.11.0"
73
73
  },
74
74
  "peerDependencies": {
75
75
  "ember-source": "^4.0.0",
76
- "@projectcaluma/ember-workflow": "^12.10.3"
76
+ "@projectcaluma/ember-workflow": "^12.11.0"
77
77
  },
78
78
  "dependenciesMeta": {
79
79
  "@projectcaluma/ember-core": {