@projectcaluma/ember-form 11.0.0-beta.4 → 11.0.0-beta.40
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 +202 -0
- package/addon/components/cf-content.hbs +38 -37
- package/addon/components/cf-content.js +7 -3
- package/addon/components/cf-field/hint.hbs +5 -0
- package/addon/components/cf-field/input/action-button.hbs +8 -4
- package/addon/components/cf-field/input/action-button.js +60 -59
- package/addon/components/cf-field/input/checkbox.hbs +2 -3
- package/addon/components/cf-field/input/date.hbs +12 -25
- package/addon/components/cf-field/input/date.js +19 -11
- package/addon/components/cf-field/input/files.hbs +38 -0
- package/addon/components/cf-field/input/files.js +113 -0
- package/addon/components/cf-field/input/powerselect.hbs +27 -29
- package/addon/components/cf-field/input/powerselect.js +8 -2
- package/addon/components/cf-field/input/radio.hbs +2 -2
- package/addon/components/cf-field/input/static.hbs +1 -1
- package/addon/components/cf-field/input/table.hbs +20 -18
- package/addon/components/cf-field/input/table.js +1 -11
- package/addon/components/cf-field/input.hbs +8 -21
- package/addon/components/cf-field/input.js +32 -14
- package/addon/components/cf-field/label.hbs +4 -2
- package/addon/components/cf-field-value.hbs +22 -7
- package/addon/components/cf-field-value.js +12 -36
- package/addon/components/cf-field.hbs +42 -9
- package/addon/components/cf-field.js +41 -17
- package/addon/components/cf-form-wrapper.hbs +4 -1
- package/addon/components/cf-form.hbs +6 -1
- package/addon/components/document-validity.js +16 -1
- package/addon/gql/fragments/field.graphql +32 -7
- package/addon/gql/mutations/save-document-files-answer.graphql +9 -0
- package/addon/gql/queries/document-forms.graphql +1 -1
- package/addon/gql/queries/dynamic-options.graphql +4 -4
- package/addon/gql/queries/{fileanswer-info.graphql → filesanswer-info.graphql} +4 -4
- package/addon/helpers/format-graphql-error.js +21 -0
- package/addon/helpers/get-widget.js +16 -2
- package/addon/instance-initializers/form-widget-overrides.js +52 -0
- package/addon/lib/document.js +9 -1
- package/addon/lib/field.js +96 -59
- package/addon/lib/navigation.js +3 -1
- package/addon/lib/question.js +18 -5
- package/addon/modifiers/autoresize.js +14 -0
- package/addon/services/caluma-store.js +2 -0
- package/app/components/cf-field/{input/file.js → hint.js} +1 -1
- package/app/components/cf-field/input/files.js +1 -0
- package/app/helpers/format-graphql-error.js +1 -0
- package/app/helpers/get-widget.js +1 -4
- package/app/instance-initializers/form-widget-overrides.js +4 -0
- package/app/modifiers/autoresize.js +1 -0
- package/app/styles/@projectcaluma/ember-form.scss +5 -15
- package/app/styles/_flatpickr.scss +47 -0
- package/blueprints/@projectcaluma/ember-form/index.js +1 -1
- package/index.js +12 -0
- package/package.json +47 -37
- package/translations/de.yaml +6 -6
- package/translations/en.yaml +6 -6
- package/translations/fr.yaml +6 -6
- package/addon/components/cf-field/input/file.hbs +0 -32
- package/addon/components/cf-field/input/file.js +0 -89
- package/addon/components/cf-field/label.js +0 -11
- package/addon/gql/mutations/remove-answer.graphql +0 -7
- package/addon/gql/mutations/save-document-file-answer.graphql +0 -9
- package/addon/instance-initializers/setup-pikaday-i18n.js +0 -35
- package/config/environment.js +0 -5
package/addon/lib/field.js
CHANGED
@@ -3,6 +3,7 @@ import { assert } from "@ember/debug";
|
|
3
3
|
import { associateDestroyableChild } from "@ember/destroyable";
|
4
4
|
import { inject as service } from "@ember/service";
|
5
5
|
import { camelize } from "@ember/string";
|
6
|
+
import { isEmpty } from "@ember/utils";
|
6
7
|
import { tracked } from "@glimmer/tracking";
|
7
8
|
import { queryManager } from "ember-apollo-client";
|
8
9
|
import { restartableTask, lastValue, dropTask } from "ember-concurrency";
|
@@ -12,7 +13,7 @@ import { cached } from "tracked-toolbox";
|
|
12
13
|
|
13
14
|
import { decodeId } from "@projectcaluma/ember-core/helpers/decode-id";
|
14
15
|
import saveDocumentDateAnswerMutation from "@projectcaluma/ember-form/gql/mutations/save-document-date-answer.graphql";
|
15
|
-
import
|
16
|
+
import saveDocumentFilesAnswerMutation from "@projectcaluma/ember-form/gql/mutations/save-document-files-answer.graphql";
|
16
17
|
import saveDocumentFloatAnswerMutation from "@projectcaluma/ember-form/gql/mutations/save-document-float-answer.graphql";
|
17
18
|
import saveDocumentIntegerAnswerMutation from "@projectcaluma/ember-form/gql/mutations/save-document-integer-answer.graphql";
|
18
19
|
import saveDocumentListAnswerMutation from "@projectcaluma/ember-form/gql/mutations/save-document-list-answer.graphql";
|
@@ -33,7 +34,7 @@ export const TYPE_MAP = {
|
|
33
34
|
DynamicChoiceQuestion: "StringAnswer",
|
34
35
|
TableQuestion: "TableAnswer",
|
35
36
|
FormQuestion: null,
|
36
|
-
|
37
|
+
FilesQuestion: "FilesAnswer",
|
37
38
|
StaticQuestion: null,
|
38
39
|
DateQuestion: "DateAnswer",
|
39
40
|
};
|
@@ -43,7 +44,7 @@ const MUTATION_MAP = {
|
|
43
44
|
IntegerAnswer: saveDocumentIntegerAnswerMutation,
|
44
45
|
StringAnswer: saveDocumentStringAnswerMutation,
|
45
46
|
ListAnswer: saveDocumentListAnswerMutation,
|
46
|
-
|
47
|
+
FilesAnswer: saveDocumentFilesAnswerMutation,
|
47
48
|
DateAnswer: saveDocumentDateAnswerMutation,
|
48
49
|
TableAnswer: saveDocumentTableAnswerMutation,
|
49
50
|
};
|
@@ -63,7 +64,6 @@ const fieldIsHiddenOrEmpty = (field) => {
|
|
63
64
|
*/
|
64
65
|
export default class Field extends Base {
|
65
66
|
@service intl;
|
66
|
-
@service validator;
|
67
67
|
|
68
68
|
@queryManager apollo;
|
69
69
|
|
@@ -83,18 +83,14 @@ export default class Field extends Base {
|
|
83
83
|
_createQuestion() {
|
84
84
|
const owner = getOwner(this);
|
85
85
|
|
86
|
-
|
86
|
+
this.question =
|
87
87
|
this.calumaStore.find(`Question:${this.raw.question.slug}`) ||
|
88
88
|
new (owner.factoryFor("caluma-model:question").class)({
|
89
89
|
raw: this.raw.question,
|
90
90
|
owner,
|
91
91
|
});
|
92
92
|
|
93
|
-
|
94
|
-
question.loadDynamicOptions.perform();
|
95
|
-
}
|
96
|
-
|
97
|
-
this.question = question;
|
93
|
+
this.question.dataSourceContext = this.document.dataSourceContext;
|
98
94
|
}
|
99
95
|
|
100
96
|
_createAnswer() {
|
@@ -113,6 +109,7 @@ export default class Field extends Base {
|
|
113
109
|
|
114
110
|
answer = new Answer({
|
115
111
|
raw: {
|
112
|
+
id: null,
|
116
113
|
__typename: answerType,
|
117
114
|
question: { slug: this.raw.question.slug },
|
118
115
|
[camelize(answerType.replace(/Answer$/, "Value"))]: null,
|
@@ -152,6 +149,16 @@ export default class Field extends Base {
|
|
152
149
|
*/
|
153
150
|
@tracked _errors = [];
|
154
151
|
|
152
|
+
/**
|
153
|
+
* Currently rendered field components that use this field. This is used in
|
154
|
+
* the document validity component to await all current save tasks before
|
155
|
+
* validating.
|
156
|
+
*
|
157
|
+
* @property {Set} _components
|
158
|
+
* @private
|
159
|
+
*/
|
160
|
+
_components = new Set();
|
161
|
+
|
155
162
|
/**
|
156
163
|
* The primary key of the field. Consists of the document and question primary
|
157
164
|
* keys.
|
@@ -540,18 +547,24 @@ export default class Field extends Base {
|
|
540
547
|
|
541
548
|
const type = this.answer.raw.__typename;
|
542
549
|
|
550
|
+
const value = this.answer.serializedValue;
|
551
|
+
const input = {
|
552
|
+
question: this.question.slug,
|
553
|
+
document: this.document.uuid,
|
554
|
+
};
|
555
|
+
|
556
|
+
if (value !== null) {
|
557
|
+
input.value = value;
|
558
|
+
}
|
559
|
+
|
560
|
+
if (this.document.dataSourceContext) {
|
561
|
+
input.dataSourceContext = JSON.stringify(this.document.dataSourceContext);
|
562
|
+
}
|
563
|
+
|
543
564
|
const response = yield this.apollo.mutate(
|
544
565
|
{
|
545
566
|
mutation: MUTATION_MAP[type],
|
546
|
-
variables: {
|
547
|
-
input: {
|
548
|
-
question: this.question.slug,
|
549
|
-
document: this.document.uuid,
|
550
|
-
...(this.answer.serializedValue !== null
|
551
|
-
? { value: this.answer.serializedValue }
|
552
|
-
: {}),
|
553
|
-
},
|
554
|
-
},
|
567
|
+
variables: { input },
|
555
568
|
},
|
556
569
|
`saveDocument${type}.answer`
|
557
570
|
);
|
@@ -577,10 +590,10 @@ export default class Field extends Base {
|
|
577
590
|
@cached
|
578
591
|
get errors() {
|
579
592
|
return this._errors.map(({ type, context, value }) => {
|
580
|
-
return this.intl.t(
|
581
|
-
|
582
|
-
|
583
|
-
);
|
593
|
+
return this.intl.t(`caluma.form.validation.${type}`, {
|
594
|
+
...context,
|
595
|
+
value,
|
596
|
+
});
|
584
597
|
});
|
585
598
|
}
|
586
599
|
|
@@ -618,6 +631,35 @@ export default class Field extends Base {
|
|
618
631
|
this._errors = errors;
|
619
632
|
}
|
620
633
|
|
634
|
+
/**
|
635
|
+
* Validate the value against the regexes of the given format validators.
|
636
|
+
*
|
637
|
+
* @method _validateFormatValidators
|
638
|
+
* @return {Array<Boolean|Object>} An array of error objects or `true`
|
639
|
+
* @private
|
640
|
+
*/
|
641
|
+
_validateFormatValidators() {
|
642
|
+
const validators =
|
643
|
+
this.question.raw.formatValidators?.edges.map((edge) => edge.node) ?? [];
|
644
|
+
const value = this.answer.value;
|
645
|
+
|
646
|
+
if (isEmpty(value)) {
|
647
|
+
// empty values should not be validated since they are handled by the
|
648
|
+
// requiredness validation
|
649
|
+
return validators.map(() => true);
|
650
|
+
}
|
651
|
+
|
652
|
+
return validators.map((validator) => {
|
653
|
+
return (
|
654
|
+
new RegExp(validator.regex).test(value) || {
|
655
|
+
type: "format",
|
656
|
+
context: { errorMsg: validator.errorMsg },
|
657
|
+
value,
|
658
|
+
}
|
659
|
+
);
|
660
|
+
});
|
661
|
+
}
|
662
|
+
|
621
663
|
/**
|
622
664
|
* Method to validate if a question is required or not.
|
623
665
|
*
|
@@ -637,15 +679,12 @@ export default class Field extends Base {
|
|
637
679
|
* predefined by the question.
|
638
680
|
*
|
639
681
|
* @method _validateTextQuestion
|
640
|
-
* @return {
|
682
|
+
* @return {Array<Boolean|Object>} An array of error objects or `true`
|
641
683
|
* @private
|
642
684
|
*/
|
643
|
-
|
685
|
+
_validateTextQuestion() {
|
644
686
|
return [
|
645
|
-
...
|
646
|
-
this.answer.value,
|
647
|
-
this.question.raw.meta.formatValidators ?? []
|
648
|
-
)),
|
687
|
+
...this._validateFormatValidators(),
|
649
688
|
validate("length", this.answer.value, {
|
650
689
|
min: this.question.raw.textMinLength || 0,
|
651
690
|
max: this.question.raw.textMaxLength || Number.POSITIVE_INFINITY,
|
@@ -658,15 +697,12 @@ export default class Field extends Base {
|
|
658
697
|
* than predefined by the question.
|
659
698
|
*
|
660
699
|
* @method _validateTextareaQuestion
|
661
|
-
* @return {
|
700
|
+
* @return {Array<Boolean|Object>} An array of error objects or `true`
|
662
701
|
* @private
|
663
702
|
*/
|
664
|
-
|
703
|
+
_validateTextareaQuestion() {
|
665
704
|
return [
|
666
|
-
...
|
667
|
-
this.answer.value,
|
668
|
-
this.question.raw.meta.formatValidators ?? []
|
669
|
-
)),
|
705
|
+
...this._validateFormatValidators(),
|
670
706
|
validate("length", this.answer.value, {
|
671
707
|
min: this.question.raw.textareaMinLength || 0,
|
672
708
|
max: this.question.raw.textareaMaxLength || Number.POSITIVE_INFINITY,
|
@@ -714,10 +750,7 @@ export default class Field extends Base {
|
|
714
750
|
* @private
|
715
751
|
*/
|
716
752
|
_validateChoiceQuestion() {
|
717
|
-
return
|
718
|
-
allowBlank: true,
|
719
|
-
in: (this.options || []).map(({ slug }) => slug),
|
720
|
-
});
|
753
|
+
return this._validateOption(this.answer.value, true);
|
721
754
|
}
|
722
755
|
|
723
756
|
/**
|
@@ -729,15 +762,9 @@ export default class Field extends Base {
|
|
729
762
|
* @private
|
730
763
|
*/
|
731
764
|
_validateMultipleChoiceQuestion() {
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
}
|
736
|
-
return value.map((value) =>
|
737
|
-
validate("inclusion", value, {
|
738
|
-
in: (this.options || []).map(({ slug }) => slug),
|
739
|
-
})
|
740
|
-
);
|
765
|
+
return this.answer.value
|
766
|
+
? this.answer.value.map((value) => this._validateOption(value))
|
767
|
+
: true;
|
741
768
|
}
|
742
769
|
|
743
770
|
/**
|
@@ -749,11 +776,9 @@ export default class Field extends Base {
|
|
749
776
|
* @private
|
750
777
|
*/
|
751
778
|
async _validateDynamicChoiceQuestion() {
|
752
|
-
await this.question.
|
779
|
+
await this.question.dynamicOptions;
|
753
780
|
|
754
|
-
return
|
755
|
-
in: (this.options || []).map(({ slug }) => slug),
|
756
|
-
});
|
781
|
+
return this._validateOption(this.answer.value, true);
|
757
782
|
}
|
758
783
|
|
759
784
|
/**
|
@@ -771,23 +796,35 @@ export default class Field extends Base {
|
|
771
796
|
return true;
|
772
797
|
}
|
773
798
|
|
774
|
-
await this.question.
|
799
|
+
await this.question.dynamicOptions;
|
775
800
|
|
776
|
-
return
|
777
|
-
|
778
|
-
|
779
|
-
|
801
|
+
return this.answer.value
|
802
|
+
? value.map((value) => this._validateOption(value))
|
803
|
+
: true;
|
804
|
+
}
|
805
|
+
|
806
|
+
_validateOption(value, allowBlank = false) {
|
807
|
+
const label = Array.isArray(this.selected)
|
808
|
+
? this.selected.find((selected) => selected.slug === value)?.label
|
809
|
+
: this.selected?.label;
|
810
|
+
|
811
|
+
return validate("inclusion", value, {
|
812
|
+
in: (this.options || [])
|
813
|
+
.filter((option) => !option.disabled)
|
814
|
+
.map(({ slug }) => slug),
|
815
|
+
allowBlank,
|
816
|
+
label: label ?? value,
|
780
817
|
});
|
781
818
|
}
|
782
819
|
|
783
820
|
/**
|
784
821
|
* Dummy method for the validation of file uploads.
|
785
822
|
*
|
786
|
-
* @method
|
823
|
+
* @method _validateFilesQuestion
|
787
824
|
* @return {Boolean} Always returns true
|
788
825
|
* @private
|
789
826
|
*/
|
790
|
-
|
827
|
+
_validateFilesQuestion() {
|
791
828
|
return true;
|
792
829
|
}
|
793
830
|
|
package/addon/lib/navigation.js
CHANGED
@@ -232,7 +232,9 @@ export class NavigationItem extends Base {
|
|
232
232
|
@cached
|
233
233
|
get visibleFields() {
|
234
234
|
return this.fieldset.fields.filter(
|
235
|
-
(f) =>
|
235
|
+
(f) =>
|
236
|
+
!["FormQuestion", "StaticQuestion"].includes(f.questionType) &&
|
237
|
+
!f.hidden
|
236
238
|
);
|
237
239
|
}
|
238
240
|
|
package/addon/lib/question.js
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
import { assert } from "@ember/debug";
|
2
2
|
import { camelize } from "@ember/string";
|
3
3
|
import { queryManager } from "ember-apollo-client";
|
4
|
-
import { dropTask
|
4
|
+
import { dropTask } from "ember-concurrency";
|
5
|
+
import { trackedTask } from "ember-resources/util/ember-concurrency";
|
5
6
|
import { cached } from "tracked-toolbox";
|
6
7
|
|
7
8
|
import getDynamicOptions from "@projectcaluma/ember-form/gql/queries/dynamic-options.graphql";
|
@@ -65,19 +66,31 @@ export default class Question extends Base {
|
|
65
66
|
{
|
66
67
|
query: getDynamicOptions,
|
67
68
|
fetchPolicy: "network-only",
|
68
|
-
variables: {
|
69
|
+
variables: {
|
70
|
+
question: this.slug,
|
71
|
+
context: this.dataSourceContext
|
72
|
+
? JSON.stringify(this.dataSourceContext)
|
73
|
+
: null,
|
74
|
+
},
|
69
75
|
},
|
70
76
|
"allQuestions.edges"
|
71
77
|
);
|
72
78
|
|
73
79
|
return (
|
74
|
-
question.node.dynamicChoiceOptions
|
80
|
+
question.node.dynamicChoiceOptions ??
|
75
81
|
question.node.dynamicMultipleChoiceOptions
|
76
82
|
);
|
77
83
|
}
|
78
84
|
|
79
|
-
|
80
|
-
|
85
|
+
dynamicOptions = trackedTask(this, this.loadDynamicOptions, () => []);
|
86
|
+
|
87
|
+
get dynamicChoiceOptions() {
|
88
|
+
return this.dynamicOptions.value ?? [];
|
89
|
+
}
|
90
|
+
|
91
|
+
get dynamicMultipleChoiceOptions() {
|
92
|
+
return this.dynamicOptions.value ?? [];
|
93
|
+
}
|
81
94
|
|
82
95
|
/**
|
83
96
|
* Whether the question is a single choice question
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { registerDestructor } from "@ember/destroyable";
|
2
|
+
import { inject as service } from "@ember/service";
|
3
|
+
import AutoresizeModifier from "ember-autoresize-modifier/modifiers/autoresize";
|
4
|
+
|
5
|
+
export default class CustomAutoresizeModifier extends AutoresizeModifier {
|
6
|
+
@service inViewport;
|
7
|
+
|
8
|
+
modify(...args) {
|
9
|
+
super.modify(...args);
|
10
|
+
|
11
|
+
this.inViewport.watchElement(this.el).onEnter(this.resize);
|
12
|
+
registerDestructor(this, () => this.inViewport.stopWatching(this.el));
|
13
|
+
}
|
14
|
+
}
|
@@ -43,6 +43,8 @@ export default class CalumaStoreService extends Service {
|
|
43
43
|
clear() {
|
44
44
|
this._store.forEach((obj) => obj.destroy());
|
45
45
|
|
46
|
+
// `this._store` is not an ember array but a native map
|
47
|
+
// eslint-disable-next-line ember/no-array-prototype-extensions
|
46
48
|
this._store.clear();
|
47
49
|
}
|
48
50
|
}
|
@@ -1 +1 @@
|
|
1
|
-
export { default } from "@projectcaluma/ember-form/components/cf-field/
|
1
|
+
export { default } from "@projectcaluma/ember-form/components/cf-field/hint";
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from "@projectcaluma/ember-form/components/cf-field/input/files";
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from "@projectcaluma/ember-form/helpers/format-graphql-error";
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from "@projectcaluma/ember-form/modifiers/autoresize";
|
@@ -3,21 +3,11 @@
|
|
3
3
|
@import "../cf-field";
|
4
4
|
@import "../cf-navigation";
|
5
5
|
|
6
|
-
@import "../
|
7
|
-
|
8
|
-
.cf-checkbox_label {
|
9
|
-
display: block;
|
10
|
-
position: relative;
|
11
|
-
padding-left: 26px;
|
6
|
+
@import "../flatpickr";
|
12
7
|
|
13
|
-
|
14
|
-
position: absolute;
|
15
|
-
top: 0.25em;
|
16
|
-
left: 0;
|
17
|
-
margin: 0;
|
18
|
-
}
|
8
|
+
@import "../uikit-overwrites";
|
19
9
|
|
20
|
-
|
21
|
-
|
22
|
-
|
10
|
+
.table-controls > .uk-icon {
|
11
|
+
min-height: 20px;
|
12
|
+
min-width: 20px;
|
23
13
|
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
$flatpickr-today-color: $global-warning-background;
|
2
|
+
$flatpickr-selected-color: $global-primary-background;
|
3
|
+
|
4
|
+
span.flatpickr-day {
|
5
|
+
font-weight: $base-body-font-weight;
|
6
|
+
|
7
|
+
&.today:not(.selected) {
|
8
|
+
border-bottom-color: $flatpickr-today-color;
|
9
|
+
|
10
|
+
&:hover {
|
11
|
+
background: $flatpickr-today-color;
|
12
|
+
border-color: $flatpickr-today-color;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
&.selected {
|
17
|
+
background: $flatpickr-selected-color;
|
18
|
+
border-color: $flatpickr-selected-color;
|
19
|
+
font-weight: 700;
|
20
|
+
|
21
|
+
&:hover {
|
22
|
+
background: darken($flatpickr-selected-color, 10%);
|
23
|
+
border-color: darken($flatpickr-selected-color, 10%);
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
.flatpickr-months {
|
29
|
+
.flatpickr-prev-month:hover,
|
30
|
+
.flatpickr-next-month:hover {
|
31
|
+
color: $flatpickr-today-color;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
span.flatpickr-weekday {
|
36
|
+
font-size: $global-small-font-size;
|
37
|
+
font-weight: $base-body-font-weight;
|
38
|
+
}
|
39
|
+
|
40
|
+
.flatpickr-current-month {
|
41
|
+
font-size: $global-font-size;
|
42
|
+
font-weight: $base-body-font-weight;
|
43
|
+
|
44
|
+
.flatpickr-monthDropdown-months {
|
45
|
+
font-weight: $base-body-font-weight;
|
46
|
+
}
|
47
|
+
}
|
@@ -10,7 +10,7 @@ module.exports = {
|
|
10
10
|
{ name: "ember-cli-showdown" },
|
11
11
|
{ name: "ember-composable-helpers" },
|
12
12
|
{ name: "ember-math-helpers" },
|
13
|
-
{ name: "ember-
|
13
|
+
{ name: "ember-flatpickr" },
|
14
14
|
{ name: "ember-power-select" },
|
15
15
|
{ name: "ember-autoresize-modifier" },
|
16
16
|
],
|
package/index.js
CHANGED
@@ -2,4 +2,16 @@
|
|
2
2
|
|
3
3
|
module.exports = {
|
4
4
|
name: require("./package").name,
|
5
|
+
|
6
|
+
included(...args) {
|
7
|
+
const app = this._findHost(this);
|
8
|
+
|
9
|
+
app.options.flatpickr = {
|
10
|
+
locales: ["de", "fr"],
|
11
|
+
theme: "airbnb",
|
12
|
+
...(app.options.flatpickr ?? {}),
|
13
|
+
};
|
14
|
+
|
15
|
+
this._super.included.apply(this, args);
|
16
|
+
},
|
5
17
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@projectcaluma/ember-form",
|
3
|
-
"version": "11.0.0-beta.
|
3
|
+
"version": "11.0.0-beta.40",
|
4
4
|
"description": "Ember addon for rendering Caluma forms.",
|
5
5
|
"keywords": [
|
6
6
|
"ember-addon"
|
@@ -9,70 +9,80 @@
|
|
9
9
|
"homepage": "https://docs.caluma.io/ember-caluma",
|
10
10
|
"repository": "github:projectcaluma/ember-caluma",
|
11
11
|
"scripts": {
|
12
|
-
"test": "npm
|
12
|
+
"test": "concurrently \"npm:lint\" \"npm:test:*\" --names \"lint,test:\"",
|
13
13
|
"test:ember": "ember test",
|
14
14
|
"test:ember-compatibility": "ember try:each"
|
15
15
|
},
|
16
16
|
"dependencies": {
|
17
|
-
"@
|
18
|
-
"@
|
19
|
-
"@
|
20
|
-
"
|
21
|
-
"
|
22
|
-
"ember-
|
17
|
+
"@ember/string": "^3.0.0",
|
18
|
+
"@embroider/macros": "^1.10.0",
|
19
|
+
"@embroider/util": "^1.9.0",
|
20
|
+
"@glimmer/component": "^1.1.2",
|
21
|
+
"@glimmer/tracking": "^1.1.2",
|
22
|
+
"@projectcaluma/ember-core": "^11.0.0-beta.40",
|
23
|
+
"ember-apollo-client": "~4.0.2",
|
24
|
+
"ember-auto-import": "^2.5.0",
|
25
|
+
"ember-autoresize-modifier": "^0.6.0",
|
23
26
|
"ember-cli-babel": "^7.26.11",
|
24
|
-
"ember-cli-htmlbars": "^6.
|
27
|
+
"ember-cli-htmlbars": "^6.1.1",
|
25
28
|
"ember-cli-showdown": "^6.0.1",
|
26
29
|
"ember-composable-helpers": "^5.0.0",
|
27
|
-
"ember-
|
28
|
-
"ember-
|
30
|
+
"ember-concurrency": "^2.3.7",
|
31
|
+
"ember-fetch": "^8.1.2",
|
32
|
+
"ember-flatpickr": "^3.2.3",
|
33
|
+
"ember-in-viewport": "^4.1.0",
|
29
34
|
"ember-intl": "^5.7.2",
|
30
|
-
"ember-math-helpers": "^
|
31
|
-
"ember-
|
32
|
-
"ember-
|
33
|
-
"ember-
|
34
|
-
"ember-
|
35
|
-
"ember-validators": "^4.1.0",
|
35
|
+
"ember-math-helpers": "^3.0.0",
|
36
|
+
"ember-power-select": "^6.0.1",
|
37
|
+
"ember-resources": "^5.6.0",
|
38
|
+
"ember-uikit": "^6.1.1",
|
39
|
+
"ember-validators": "^4.1.2",
|
36
40
|
"graphql": "^15.8.0",
|
37
41
|
"jexl": "^2.3.0",
|
38
42
|
"lodash.isequal": "^4.5.0",
|
39
|
-
"
|
43
|
+
"luxon": "^3.1.1",
|
40
44
|
"tracked-toolbox": "^1.2.3"
|
41
45
|
},
|
42
46
|
"devDependencies": {
|
43
47
|
"@ember/optional-features": "2.0.0",
|
44
|
-
"@ember/test-helpers": "2.
|
45
|
-
"@embroider/test-setup": "
|
46
|
-
"@faker-js/faker": "6.0
|
47
|
-
"@projectcaluma/ember-testing": "
|
48
|
-
"@projectcaluma/ember-workflow": "11.0.0-beta.
|
48
|
+
"@ember/test-helpers": "2.7.0",
|
49
|
+
"@embroider/test-setup": "2.0.2",
|
50
|
+
"@faker-js/faker": "7.6.0",
|
51
|
+
"@projectcaluma/ember-testing": "11.0.0-beta.40",
|
52
|
+
"@projectcaluma/ember-workflow": "^11.0.0-beta.40",
|
49
53
|
"broccoli-asset-rev": "3.0.0",
|
50
|
-
"
|
54
|
+
"concurrently": "7.6.0",
|
55
|
+
"ember-cli": "4.9.2",
|
51
56
|
"ember-cli-code-coverage": "1.0.3",
|
52
|
-
"ember-cli-dependency-checker": "3.
|
57
|
+
"ember-cli-dependency-checker": "3.3.1",
|
53
58
|
"ember-cli-inject-live-reload": "2.1.0",
|
54
|
-
"ember-cli-mirage": "
|
59
|
+
"ember-cli-mirage": "3.0.0-alpha.3",
|
55
60
|
"ember-cli-sri": "2.1.1",
|
56
61
|
"ember-cli-terser": "4.0.2",
|
57
|
-
"ember-disable-prototype-extensions": "1.1.3",
|
58
|
-
"ember-export-application-global": "2.0.1",
|
59
62
|
"ember-load-initializers": "2.1.2",
|
60
|
-
"ember-
|
61
|
-
"ember-qunit": "5.1.5",
|
63
|
+
"ember-qunit": "6.1.1",
|
62
64
|
"ember-resolver": "8.0.3",
|
63
|
-
"ember-source": "
|
65
|
+
"ember-source": "4.9.3",
|
64
66
|
"ember-source-channel-url": "3.0.0",
|
65
67
|
"ember-try": "2.0.0",
|
66
68
|
"loader.js": "4.7.0",
|
67
|
-
"miragejs": "0.1.
|
68
|
-
"
|
69
|
-
"qunit": "2.17.2",
|
69
|
+
"miragejs": "0.1.46",
|
70
|
+
"qunit": "2.19.3",
|
70
71
|
"qunit-dom": "2.0.0",
|
71
|
-
"uuid": "
|
72
|
-
"webpack": "5.
|
72
|
+
"uuid": "9.0.0",
|
73
|
+
"webpack": "5.75.0"
|
74
|
+
},
|
75
|
+
"peerDependencies": {
|
76
|
+
"@projectcaluma/ember-workflow": "^11.0.0-beta.40",
|
77
|
+
"ember-source": "^3.28.0 || ^4.0.0"
|
78
|
+
},
|
79
|
+
"peerDependenciesMeta": {
|
80
|
+
"@projectcaluma/ember-workflow": {
|
81
|
+
"optional": true
|
82
|
+
}
|
73
83
|
},
|
74
84
|
"engines": {
|
75
|
-
"node": "
|
85
|
+
"node": "14.* || 16.* || >= 18"
|
76
86
|
},
|
77
87
|
"ember": {
|
78
88
|
"edition": "octane"
|
package/translations/de.yaml
CHANGED
@@ -12,6 +12,10 @@ caluma:
|
|
12
12
|
optionNotAvailable: "Diese Option ist nicht mehr verfügbar"
|
13
13
|
info: "Mehr Informationen"
|
14
14
|
|
15
|
+
error:
|
16
|
+
intro: "Oh nein, auf unserer Seite ist etwas schief gelaufen. Ihre Antwort konnte nicht gespeichert werden."
|
17
|
+
details: "Technische Details:"
|
18
|
+
|
15
19
|
navigation:
|
16
20
|
next: "Weiter"
|
17
21
|
previous: "Zurück"
|
@@ -34,7 +38,6 @@ caluma:
|
|
34
38
|
options-empty: "Keine Optionen vorhanden"
|
35
39
|
search-placeholder: "Hier tippen um zu suchen"
|
36
40
|
search-empty: "Keine Optionen gefunden"
|
37
|
-
null: "Keine Auswahl"
|
38
41
|
|
39
42
|
validation:
|
40
43
|
blank: "Dieses Feld darf nicht leer gelassen werden"
|
@@ -43,11 +46,8 @@ caluma:
|
|
43
46
|
greaterThanOrEqualTo: "Die Eingabe in diesem Feld darf nicht kleiner als {gte} sein"
|
44
47
|
lessThanOrEqualTo: "Die Eingabe in diesem Feld darf nicht grösser als {lte} sein"
|
45
48
|
notAnInteger: "Bitte geben Sie eine ganze Zahl ein"
|
46
|
-
inclusion: "
|
49
|
+
inclusion: '"{label}" ist kein gültiger Wert für dieses Feld'
|
50
|
+
deleteFailed: "Beim Löschen ist ein Fehler aufgetreten."
|
47
51
|
uploadFailed: "Beim Hochladen ist ein Fehler aufgetreten."
|
48
52
|
format: "{errorMsg}"
|
49
53
|
table: "Mindestens eine Zeile der Tabelle wurde nicht korrekt ausgefüllt"
|
50
|
-
|
51
|
-
pikaday:
|
52
|
-
month-previous: "Vorheriger Monat"
|
53
|
-
month-next: "Nächster Monat"
|