@projectcaluma/ember-form-builder 11.0.0-beta.2 → 11.0.0-beta.3

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,19 @@
1
+ # [@projectcaluma/ember-form-builder-v11.0.0-beta.3](https://github.com/projectcaluma/ember-caluma/compare/@projectcaluma/ember-form-builder-v11.0.0-beta.2...@projectcaluma/ember-form-builder-v11.0.0-beta.3) (2022-01-24)
2
+
3
+
4
+ ### chore
5
+
6
+ * **deps:** update ember-uikit to v5 beta ([6568d39](https://github.com/projectcaluma/ember-caluma/commit/6568d398216d33b44da5b659830ca3c200dd7012))
7
+ * **form-builder:** rename actions from dasherized to camelized ([6a79484](https://github.com/projectcaluma/ember-caluma/commit/6a7948435f1e38e1f8b9cca82d1e091742afcc08))
8
+
9
+
10
+ ### BREAKING CHANGES
11
+
12
+ * **form-builder:** All previously dasherized expected actions are now
13
+ camelized. E.g `@on-add-question` becomes `@onAddQuestion`.
14
+ * **deps:** All `@projectcaluma/ember-*` packages now require
15
+ `ember-uikit` v5+.
16
+
1
17
  # [@projectcaluma/ember-form-builder-v11.0.0-beta.2](https://github.com/projectcaluma/ember-caluma/compare/@projectcaluma/ember-form-builder-v11.0.0-beta.1...@projectcaluma/ember-form-builder-v11.0.0-beta.2) (2022-01-18)
2
18
 
3
19
 
@@ -85,7 +85,7 @@
85
85
  <div
86
86
  class="uk-text-center uk-text-muted uk-padding uk-padding-remove-horizontal"
87
87
  >
88
- {{uk-icon "bolt" ratio=5}}
88
+ <UkIcon @icon="bolt" @ratio={{5}} />
89
89
  <p>{{t "caluma.form-builder.form.not-found" slug=@slug}}</p>
90
90
  </div>
91
91
  {{/if}}
@@ -3,7 +3,6 @@ import { action } from "@ember/object";
3
3
  import { inject as service } from "@ember/service";
4
4
  import Component from "@glimmer/component";
5
5
  import { queryManager } from "ember-apollo-client";
6
- import { optional } from "ember-composable-helpers/helpers/optional";
7
6
  import { timeout, restartableTask, dropTask } from "ember-concurrency";
8
7
  import { useTask } from "ember-resources";
9
8
 
@@ -89,7 +88,7 @@ export default class CfbFormEditorGeneral extends Component {
89
88
  )
90
89
  );
91
90
 
92
- optional([this.args["on-after-submit"]])(form);
91
+ this.args.onAfterSubmit?.(form);
93
92
  } catch (e) {
94
93
  this.notification.danger(
95
94
  this.intl.t(
@@ -3,7 +3,7 @@
3
3
 
4
4
  <UkSortable
5
5
  @handle=".uk-sortable-handle"
6
- @on-moved={{this._handleMoved}}
6
+ @onMoved={{this._handleMoved}}
7
7
  @tagName="ul"
8
8
  class="uk-list uk-list-divider uk-margin-remove-bottom uk-margin-small-top"
9
9
  >
@@ -4,8 +4,8 @@
4
4
  @question.isArchived
5
5
  "cfb-form-editor__question-list__item__archived"
6
6
  }}
7
- {{did-insert (fn (optional @on-register) this.elementId @question.slug)}}
8
- {{will-destroy (fn (optional @on-unregister) this.elementId @question.slug)}}
7
+ {{did-insert (fn (optional @onRegister) this.elementId @question.slug)}}
8
+ {{will-destroy (fn (optional @onUnregister) this.elementId @question.slug)}}
9
9
  ...attributes
10
10
  >
11
11
  <div class="uk-flex uk-flex-middle">
@@ -24,7 +24,7 @@
24
24
  data-test-remove-item
25
25
  uk-icon="minus"
26
26
  class="cfb-pointer uk-text-danger"
27
- {{on "click" (fn (optional @on-remove-question) @question)}}
27
+ {{on "click" (fn (optional @onRemoveQuestion) @question)}}
28
28
  >
29
29
  </i>
30
30
  {{else if (eq @mode "add")}}
@@ -33,7 +33,7 @@
33
33
  data-test-add-item
34
34
  uk-icon="plus"
35
35
  class="cfb-pointer uk-text-success"
36
- {{on "click" (fn (optional @on-add-question) @question)}}
36
+ {{on "click" (fn (optional @onAddQuestion) @question)}}
37
37
  >
38
38
  </i>
39
39
  {{/if}}
@@ -51,12 +51,12 @@ export default class CfbFormEditorQuestionListItem extends Component {
51
51
  @action
52
52
  editQuestion(question, e) {
53
53
  e.preventDefault();
54
- this.args["on-edit-question"]?.(question);
54
+ this.args.onEditQuestion?.(question);
55
55
  }
56
56
 
57
57
  @action
58
58
  clickForm(form, e) {
59
59
  e.preventDefault();
60
- this.args["on-click-form"]?.(form);
60
+ this.args.onClickForm?.(form);
61
61
  }
62
62
  }
@@ -76,12 +76,12 @@
76
76
  data-test-question-list-item={{item.node.slug}}
77
77
  @mode={{this.mode}}
78
78
  @question={{item.node}}
79
- @on-edit-question={{@on-edit-question}}
80
- @on-remove-question={{perform this.removeQuestion}}
81
- @on-add-question={{perform this.addQuestion}}
82
- @on-click-form={{@on-click-form}}
83
- @on-register={{this.registerChild}}
84
- @on-unregister={{this.unregisterChild}}
79
+ @onEditQuestion={{@onEditQuestion}}
80
+ @onRemoveQuestion={{perform this.removeQuestion}}
81
+ @onAddQuestion={{perform this.addQuestion}}
82
+ @onClickForm={{@onClickForm}}
83
+ @onRegister={{this.registerChild}}
84
+ @onUnregister={{this.unregisterChild}}
85
85
  />
86
86
  {{else}}
87
87
  <li
@@ -4,7 +4,6 @@ import { inject as service } from "@ember/service";
4
4
  import Component from "@glimmer/component";
5
5
  import { tracked } from "@glimmer/tracking";
6
6
  import { queryManager } from "ember-apollo-client";
7
- import { optional } from "ember-composable-helpers/helpers/optional";
8
7
  import {
9
8
  timeout,
10
9
  enqueueTask,
@@ -148,7 +147,7 @@ export default class ComponentsCfbFormEditorQuestionList extends Component {
148
147
 
149
148
  this.questionTask.perform();
150
149
 
151
- optional([this.args["on-after-add-question"]])(question);
150
+ this.args.onAfterAddQuestion?.(question);
152
151
  } catch (e) {
153
152
  this.notification.danger(
154
153
  this.intl.t("caluma.form-builder.notification.form.add-question.error")
@@ -176,7 +175,7 @@ export default class ComponentsCfbFormEditorQuestionList extends Component {
176
175
  )
177
176
  );
178
177
 
179
- optional([this.args["on-after-remove-question"]])(question);
178
+ this.args.onAfterRemoveQuestion?.(question);
180
179
  } catch (e) {
181
180
  this.notification.danger(
182
181
  this.intl.t(
@@ -238,7 +237,7 @@ export default class ComponentsCfbFormEditorQuestionList extends Component {
238
237
  createNewQuestion(e) {
239
238
  e.preventDefault();
240
239
 
241
- this.args["on-create-question"]?.();
240
+ this.args.onCreateQuestion?.();
242
241
  this.setMode("reorder");
243
242
  }
244
243
  }
@@ -450,7 +450,7 @@
450
450
 
451
451
  <UkButton
452
452
  @color="link"
453
- @on-click={{toggle-action "showAdvanced" this}}
453
+ @onClick={{toggle-action "showAdvanced" this}}
454
454
  class="uk-flex uk-flex-middle uk-margin"
455
455
  >
456
456
  {{#if this.showAdvanced}}
@@ -8,7 +8,6 @@ import { tracked } from "@glimmer/tracking";
8
8
  import { queryManager } from "ember-apollo-client";
9
9
  import Changeset from "ember-changeset";
10
10
  import lookupValidator from "ember-changeset-validations";
11
- import { optional } from "ember-composable-helpers/helpers/optional";
12
11
  import { dropTask, restartableTask, task, timeout } from "ember-concurrency";
13
12
  import { all } from "rsvp";
14
13
 
@@ -406,7 +405,7 @@ export default class CfbFormEditorQuestion extends Component {
406
405
  this.intl.t("caluma.form-builder.notification.question.save.success")
407
406
  );
408
407
 
409
- optional([this.args["on-after-submit"]])(question);
408
+ this.args.onAfterSubmit?.(question);
410
409
  } catch (e) {
411
410
  // eslint-disable-next-line no-console
412
411
  console.error(e);
@@ -12,11 +12,11 @@
12
12
  {{else}}
13
13
  <CfbFormEditor::QuestionList
14
14
  @form={{@slug}}
15
- @on-edit-question={{@on-edit-question}}
16
- @on-create-question={{@on-create-question}}
17
- @on-after-add-question={{@on-after-add-question}}
18
- @on-after-remove-question={{@on-after-remove-question}}
19
- @on-click-form={{@on-click-form}}
15
+ @onEditQuestion={{@onEditQuestion}}
16
+ @onCreateQuestion={{@onCreateQuestion}}
17
+ @onAfterAddQuestion={{@onAfterAddQuestion}}
18
+ @onAfterRemoveQuestion={{@onAfterRemoveQuestion}}
19
+ @onClickForm={{@onClickForm}}
20
20
  />
21
21
  {{/if}}
22
22
  </div>
@@ -12,7 +12,7 @@
12
12
  type="button"
13
13
  uk-icon="pencil"
14
14
  class="uk-icon-button"
15
- {{on "click" (fn (optional @on-edit-form) @item)}}
15
+ {{on "click" (fn (optional @onEditForm) @item)}}
16
16
  >
17
17
  </button>
18
18
  </span>
@@ -3,7 +3,7 @@
3
3
  {{#each (array "active" "archived" "all") as |category|}}
4
4
  <UkButton
5
5
  data-test-filter={{category}}
6
- @on-click={{fn (perform this.setFilter) "category" category}}
6
+ @onClick={{fn (perform this.setFilter) "category" category}}
7
7
  @label={{t (concat "caluma.form-builder.form." category)}}
8
8
  @class={{if (eq this.category category) "uk-button-primary" ""}}
9
9
  />
@@ -12,7 +12,7 @@
12
12
  <div>
13
13
  <UkButton
14
14
  data-test-new-form
15
- @on-click={{optional @on-new-form}}
15
+ @onClick={{optional @onNewForm}}
16
16
  @label={{t "caluma.form-builder.form.new"}}
17
17
  />
18
18
  </div>
@@ -37,7 +37,7 @@
37
37
  <CfbFormList::Item
38
38
  data-test-form-list-item={{item.slug}}
39
39
  @item={{item}}
40
- @on-edit-form={{@on-edit-form}}
40
+ @onEditForm={{@onEditForm}}
41
41
  />
42
42
  {{/each}}
43
43
  {{#if this.formsQuery.isLoading}}
@@ -7,7 +7,7 @@
7
7
  @size={{@size}}
8
8
  @name={{@name}}
9
9
  @disabled={{@disabled}}
10
- @on-toggle={{@update}}
10
+ @onToggle={{@update}}
11
11
  />
12
12
  </div>
13
13
 
@@ -1,5 +1,5 @@
1
1
  <CfbFormEditor::Question
2
2
  @slug={{@model.questionSlug}}
3
3
  @form={{@model.formSlug}}
4
- @on-after-submit={{this.afterSubmit}}
4
+ @onAfterSubmit={{this.afterSubmit}}
5
5
  />
@@ -1,4 +1 @@
1
- <CfbFormEditor::Question
2
- @form={{@model}}
3
- @on-after-submit={{this.afterSubmit}}
4
- />
1
+ <CfbFormEditor::Question @form={{@model}} @onAfterSubmit={{this.afterSubmit}} />
@@ -1,10 +1,10 @@
1
1
  <CfbFormEditor
2
2
  @slug={{@model}}
3
- @on-edit-question={{this.editQuestion}}
4
- @on-create-question={{this.createQuestion}}
5
- @on-after-add-question={{this.editQuestion}}
6
- @on-after-remove-question={{this.afterRemoveQuestion}}
7
- @on-click-form={{this.clickForm}}
3
+ @onEditQuestion={{this.editQuestion}}
4
+ @onCreateQuestion={{this.createQuestion}}
5
+ @onAfterAddQuestion={{this.editQuestion}}
6
+ @onAfterRemoveQuestion={{this.afterRemoveQuestion}}
7
+ @onClickForm={{this.clickForm}}
8
8
  >
9
9
  {{outlet}}
10
10
  </CfbFormEditor>
@@ -1 +1 @@
1
- <CfbFormList @on-new-form={{this.newForm}} @on-edit-form={{this.editForm}} />
1
+ <CfbFormList @onNewForm={{this.newForm}} @onEditForm={{this.editForm}} />
@@ -1,6 +1,6 @@
1
1
  <CfbFormEditor @slug={{@model}}>
2
2
  <CfbFormEditor::General
3
3
  @slug={{@model}}
4
- @on-after-submit={{this.afterSubmit}}
4
+ @onAfterSubmit={{this.afterSubmit}}
5
5
  />
6
6
  </CfbFormEditor>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@projectcaluma/ember-form-builder",
3
- "version": "11.0.0-beta.2",
3
+ "version": "11.0.0-beta.3",
4
4
  "description": "Ember engine for building Caluma forms.",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -22,10 +22,10 @@
22
22
  "@glimmer/component": "^1.0.4",
23
23
  "@glimmer/tracking": "^1.0.4",
24
24
  "@projectcaluma/ember-core": "^11.0.0-beta.2",
25
- "@projectcaluma/ember-form": "^11.0.0-beta.2",
25
+ "@projectcaluma/ember-form": "^11.0.0-beta.3",
26
26
  "codejar": "^3.5.0",
27
27
  "ember-apollo-client": "^3.2.0",
28
- "ember-auto-import": "^2.3.0",
28
+ "ember-auto-import": "^2.4.0",
29
29
  "ember-changeset": "^4.0.0-beta.1",
30
30
  "ember-changeset-validations": "^4.0.0-beta.2",
31
31
  "ember-cli-babel": "^7.26.11",
@@ -39,7 +39,7 @@
39
39
  "ember-power-select": "^5.0.3",
40
40
  "ember-resources": "^4.1.3",
41
41
  "ember-test-selectors": "^6.0.0",
42
- "ember-uikit": "^4.0.0",
42
+ "ember-uikit": "^5.0.0-beta.3",
43
43
  "ember-validated-form": "^5.1.1",
44
44
  "graphql": "^15.8.0",
45
45
  "graphql-tag": "^2.12.6",
@@ -50,15 +50,15 @@
50
50
  "devDependencies": {
51
51
  "@ember/optional-features": "2.0.0",
52
52
  "@ember/test-helpers": "2.6.0",
53
- "@embroider/test-setup": "0.50.2",
53
+ "@embroider/test-setup": "1.0.0",
54
54
  "@faker-js/faker": "6.0.0-alpha.3",
55
- "@projectcaluma/ember-testing": "10.2.0-beta.1",
55
+ "@projectcaluma/ember-testing": "10.2.0-beta.2",
56
56
  "broccoli-asset-rev": "3.0.0",
57
57
  "ember-cli": "3.28.5",
58
58
  "ember-cli-code-coverage": "1.0.3",
59
59
  "ember-cli-dependency-checker": "3.2.0",
60
60
  "ember-cli-inject-live-reload": "2.1.0",
61
- "ember-cli-mirage": "2.3.1",
61
+ "ember-cli-mirage": "2.4.0",
62
62
  "ember-cli-sri": "2.1.1",
63
63
  "ember-cli-terser": "4.0.2",
64
64
  "ember-disable-prototype-extensions": "1.1.3",
@@ -76,7 +76,7 @@
76
76
  "npm-run-all": "4.1.5",
77
77
  "qunit": "2.17.2",
78
78
  "qunit-dom": "2.0.0",
79
- "webpack": "5.66.0"
79
+ "webpack": "5.67.0"
80
80
  },
81
81
  "engines": {
82
82
  "node": "12.* || 14.* || >= 16"