@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 +16 -0
- package/addon/components/cfb-form-editor/general.hbs +1 -1
- package/addon/components/cfb-form-editor/general.js +1 -2
- package/addon/components/cfb-form-editor/question/options.hbs +1 -1
- package/addon/components/cfb-form-editor/question-list/item.hbs +4 -4
- package/addon/components/cfb-form-editor/question-list/item.js +2 -2
- package/addon/components/cfb-form-editor/question-list.hbs +6 -6
- package/addon/components/cfb-form-editor/question-list.js +3 -4
- package/addon/components/cfb-form-editor/question.hbs +1 -1
- package/addon/components/cfb-form-editor/question.js +1 -2
- package/addon/components/cfb-form-editor.hbs +5 -5
- package/addon/components/cfb-form-list/item.hbs +1 -1
- package/addon/components/cfb-form-list.hbs +3 -3
- package/addon/components/cfb-toggle-switch.hbs +1 -1
- package/addon/templates/edit/questions/edit.hbs +1 -1
- package/addon/templates/edit/questions/new.hbs +1 -4
- package/addon/templates/edit.hbs +5 -5
- package/addon/templates/index.hbs +1 -1
- package/addon/templates/new.hbs +1 -1
- package/package.json +8 -8
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
|
|
|
@@ -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
|
-
|
|
91
|
+
this.args.onAfterSubmit?.(form);
|
|
93
92
|
} catch (e) {
|
|
94
93
|
this.notification.danger(
|
|
95
94
|
this.intl.t(
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
@question.isArchived
|
|
5
5
|
"cfb-form-editor__question-list__item__archived"
|
|
6
6
|
}}
|
|
7
|
-
{{did-insert (fn (optional @
|
|
8
|
-
{{will-destroy (fn (optional @
|
|
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 @
|
|
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 @
|
|
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
|
|
54
|
+
this.args.onEditQuestion?.(question);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
@action
|
|
58
58
|
clickForm(form, e) {
|
|
59
59
|
e.preventDefault();
|
|
60
|
-
this.args
|
|
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
|
-
@
|
|
80
|
-
@
|
|
81
|
-
@
|
|
82
|
-
@
|
|
83
|
-
@
|
|
84
|
-
@
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
240
|
+
this.args.onCreateQuestion?.();
|
|
242
241
|
this.setMode("reorder");
|
|
243
242
|
}
|
|
244
243
|
}
|
|
@@ -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
|
-
|
|
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
|
-
@
|
|
16
|
-
@
|
|
17
|
-
@
|
|
18
|
-
@
|
|
19
|
-
@
|
|
15
|
+
@onEditQuestion={{@onEditQuestion}}
|
|
16
|
+
@onCreateQuestion={{@onCreateQuestion}}
|
|
17
|
+
@onAfterAddQuestion={{@onAfterAddQuestion}}
|
|
18
|
+
@onAfterRemoveQuestion={{@onAfterRemoveQuestion}}
|
|
19
|
+
@onClickForm={{@onClickForm}}
|
|
20
20
|
/>
|
|
21
21
|
{{/if}}
|
|
22
22
|
</div>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
{{#each (array "active" "archived" "all") as |category|}}
|
|
4
4
|
<UkButton
|
|
5
5
|
data-test-filter={{category}}
|
|
6
|
-
@
|
|
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
|
-
@
|
|
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
|
-
@
|
|
40
|
+
@onEditForm={{@onEditForm}}
|
|
41
41
|
/>
|
|
42
42
|
{{/each}}
|
|
43
43
|
{{#if this.formsQuery.isLoading}}
|
package/addon/templates/edit.hbs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<CfbFormEditor
|
|
2
2
|
@slug={{@model}}
|
|
3
|
-
@
|
|
4
|
-
@
|
|
5
|
-
@
|
|
6
|
-
@
|
|
7
|
-
@
|
|
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 @
|
|
1
|
+
<CfbFormList @onNewForm={{this.newForm}} @onEditForm={{this.editForm}} />
|
package/addon/templates/new.hbs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@projectcaluma/ember-form-builder",
|
|
3
|
-
"version": "11.0.0-beta.
|
|
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.
|
|
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.
|
|
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": "^
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
79
|
+
"webpack": "5.67.0"
|
|
80
80
|
},
|
|
81
81
|
"engines": {
|
|
82
82
|
"node": "12.* || 14.* || >= 16"
|