@projectcaluma/ember-form 13.1.5 → 13.2.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.
@@ -3,11 +3,18 @@
3
3
  {{@field.question.raw.label}}
4
4
  </span>
5
5
 
6
- {{#if (and (not @field.question.isCalculated) @field.optional)}}
7
- <span
8
- class="uk-margin-small-left uk-text-muted uk-text-lowercase uk-text-normal"
9
- >({{t "caluma.form.optional"}})</span>
10
- {{/if}}
6
+ {{#unless @field.question.isCalculated}}
7
+ {{#if (and @field.optional (not this.useMandatoryAsterisk))}}
8
+ <span
9
+ class="uk-margin-small-left uk-text-muted uk-text-lowercase uk-text-normal"
10
+ >({{t "caluma.form.optional"}})</span>
11
+ {{else if (and (not @field.optional) this.useMandatoryAsterisk)}}
12
+ <span
13
+ title={{t "caluma.form.mandatory"}}
14
+ class="uk-text-muted uk-text-lowercase uk-text-normal cf-label__mandatory-asterisk"
15
+ >* </span>
16
+ {{/if}}
17
+ {{/unless}}
11
18
 
12
19
  {{yield}}
13
20
  </label>
@@ -0,0 +1,20 @@
1
+ import { getOwner } from "@ember/application";
2
+ import Component from "@glimmer/component";
3
+
4
+ /**
5
+ * Label component of the CfField
6
+ *
7
+ * @class CfFieldLabelComponent
8
+ */
9
+ export default class CfFieldLabelComponent extends Component {
10
+ get config() {
11
+ return getOwner(this).resolveRegistration("config:environment");
12
+ }
13
+
14
+ get useMandatoryAsterisk() {
15
+ const { USE_MANDATORY_ASTERISK = false } =
16
+ this.config["ember-caluma"] || {};
17
+
18
+ return this.args.useMandatoryAsterisk ?? USE_MANDATORY_ASTERISK;
19
+ }
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@projectcaluma/ember-form",
3
- "version": "13.1.5",
3
+ "version": "13.2.0",
4
4
  "description": "Ember addon for rendering Caluma forms.",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -40,7 +40,7 @@
40
40
  "luxon": "^3.5.0",
41
41
  "reactiveweb": "^1.3.0",
42
42
  "tracked-toolbox": "^2.0.0",
43
- "@projectcaluma/ember-core": "^13.1.5"
43
+ "@projectcaluma/ember-core": "^13.2.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@ember/optional-features": "2.2.0",
@@ -66,17 +66,17 @@
66
66
  "loader.js": "4.7.0",
67
67
  "miragejs": "0.1.48",
68
68
  "qunit": "2.22.0",
69
- "qunit-dom": "3.3.0",
69
+ "qunit-dom": "3.4.0",
70
70
  "sass": "1.81.0",
71
71
  "uikit": "3.21.16",
72
72
  "uuid": "11.0.3",
73
73
  "webpack": "5.96.1",
74
- "@projectcaluma/ember-testing": "13.1.5",
75
- "@projectcaluma/ember-workflow": "13.1.5"
74
+ "@projectcaluma/ember-testing": "13.2.0",
75
+ "@projectcaluma/ember-workflow": "13.2.0"
76
76
  },
77
77
  "peerDependencies": {
78
78
  "ember-source": ">= 4.0.0",
79
- "@projectcaluma/ember-workflow": "^13.1.5"
79
+ "@projectcaluma/ember-workflow": "^13.2.0"
80
80
  },
81
81
  "dependenciesMeta": {
82
82
  "@projectcaluma/ember-core": {
@@ -12,6 +12,7 @@ caluma:
12
12
  addRow: "Zeile hinzufügen"
13
13
  optionNotAvailable: "Diese Option ist nicht mehr verfügbar"
14
14
  info: "Mehr Informationen"
15
+ mandatory: "Pflichtfeld"
15
16
 
16
17
  error:
17
18
  details: "Technische Details:"
@@ -12,6 +12,7 @@ caluma:
12
12
  addRow: "Add row"
13
13
  optionNotAvailable: "This option is not available anymore"
14
14
  info: "More information"
15
+ mandatory: "Mandatory field"
15
16
 
16
17
  error:
17
18
  details: "Technical details:"
@@ -12,6 +12,7 @@ caluma:
12
12
  addRow: "Ajouter une ligne"
13
13
  optionNotAvailable: "Cette option n'est plus disponible"
14
14
  info: "Plus d'informations"
15
+ mandatory: "Champ obligatoire"
15
16
 
16
17
  error:
17
18
  details: "Détails techniques :"
@@ -12,6 +12,7 @@ caluma:
12
12
  addRow: "Aggiungi riga"
13
13
  optionNotAvailable: "Questa opzione non è più disponibile"
14
14
  info: "Ulteriori informazioni"
15
+ mandatory: "Campo obbligatorio"
15
16
 
16
17
  error:
17
18
  details: "Dettagli tecnici:"