@ember-eui/validated-form 1.0.0 → 1.0.4
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/addon/components/validated-form/field-base/index.js +12 -10
- package/addon/components/validated-form/field-checkbox-group/index.hbs +1 -0
- package/addon/components/validated-form/field-checkbox-group/index.js +1 -1
- package/addon/components/validated-form/field-combo-box/index.hbs +1 -0
- package/addon/components/validated-form/field-combo-box/index.js +1 -6
- package/addon/components/validated-form/field-dual-range-slider/index.hbs +1 -0
- package/addon/components/validated-form/field-number/index.hbs +1 -0
- package/addon/components/validated-form/field-password/index.hbs +1 -0
- package/addon/components/validated-form/field-radio-group/index.hbs +1 -0
- package/addon/components/validated-form/field-radio-group/index.js +1 -1
- package/addon/components/validated-form/field-range-slider/index.hbs +1 -0
- package/addon/components/validated-form/field-select/index.hbs +1 -0
- package/addon/components/validated-form/field-switch/index.hbs +1 -0
- package/addon/components/validated-form/field-text/index.hbs +1 -0
- package/addon/components/validated-form/field-text-area/index.hbs +1 -0
- package/package.json +3 -3
|
@@ -62,28 +62,25 @@ export default class ValidatedFormFieldBase extends Component {
|
|
|
62
62
|
return this.args.options || [];
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
setValidationMessages() {
|
|
66
|
-
this._validationErrorMessages = buildValidationMessages.call(
|
|
67
|
-
this,
|
|
68
|
-
this.validationProperty
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
65
|
get validationErrorMessages() {
|
|
73
66
|
return this._validationErrorMessages;
|
|
74
67
|
}
|
|
75
68
|
|
|
76
69
|
constructor() {
|
|
77
70
|
super(...arguments);
|
|
78
|
-
this.setValidationMessages();
|
|
79
71
|
this.args.register?.(this);
|
|
80
72
|
}
|
|
81
73
|
|
|
74
|
+
//Should be executed by the child on start
|
|
82
75
|
@action
|
|
83
|
-
|
|
84
|
-
|
|
76
|
+
setValidationMessages() {
|
|
77
|
+
this._validationErrorMessages = buildValidationMessages.call(
|
|
78
|
+
this,
|
|
79
|
+
this.validationProperty
|
|
80
|
+
);
|
|
85
81
|
}
|
|
86
82
|
|
|
83
|
+
//Should be executed by the child on value update
|
|
87
84
|
@action
|
|
88
85
|
didUpdateValue() {
|
|
89
86
|
later(() => {
|
|
@@ -92,6 +89,11 @@ export default class ValidatedFormFieldBase extends Component {
|
|
|
92
89
|
});
|
|
93
90
|
}
|
|
94
91
|
|
|
92
|
+
@action
|
|
93
|
+
notifyValidityChange() {
|
|
94
|
+
notifyValidityChange.call(this);
|
|
95
|
+
}
|
|
96
|
+
|
|
95
97
|
@action
|
|
96
98
|
setIsTouched(val) {
|
|
97
99
|
this.isTouched = val;
|
|
@@ -5,7 +5,7 @@ import { maybeUnwrapProxy } from '@ember-eui/core/utils/maybe-unwrap-proxy';
|
|
|
5
5
|
export default class ValidatedFormFieldCheckboxGroup extends ValidatedFormFieldBase {
|
|
6
6
|
get value() {
|
|
7
7
|
let value = maybeUnwrapProxy(this.args.value);
|
|
8
|
-
return value?.toArray() || value;
|
|
8
|
+
return value?.toArray?.() || value;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
get arrayToMap() {
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import ValidatedFormFieldBase from '../field-base';
|
|
2
2
|
import { action } from '@ember/object';
|
|
3
|
-
import { isArray } from '@ember/array';
|
|
4
3
|
|
|
5
4
|
export default class ValidatedFormFieldComboBox extends ValidatedFormFieldBase {
|
|
6
5
|
validationProperty = 'args.selectedOptions';
|
|
7
6
|
|
|
8
7
|
@action
|
|
9
8
|
handleChange(options) {
|
|
10
|
-
|
|
11
|
-
if (this.args.singleSelection) {
|
|
12
|
-
value = isArray(options) ? options[0] : null;
|
|
13
|
-
}
|
|
14
|
-
this.args.onChange(value);
|
|
9
|
+
this.args.onChange(options);
|
|
15
10
|
this.notifyValidityChange();
|
|
16
11
|
}
|
|
17
12
|
}
|
|
@@ -4,7 +4,7 @@ import { maybeUnwrapProxy } from '@ember-eui/core/utils/maybe-unwrap-proxy';
|
|
|
4
4
|
export default class ValidatedFormFieldRadioGroup extends ValidatedFormFieldBase {
|
|
5
5
|
get value() {
|
|
6
6
|
let value = maybeUnwrapProxy(this.args.value);
|
|
7
|
-
return value?.toArray() || value;
|
|
7
|
+
return value?.toArray?.() || value;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
get arrayToMap() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-eui/validated-form",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "The default blueprint for ember-cli addons.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"postpack": "ember ts:clean"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@ember-eui/core": "^1.0.
|
|
28
|
+
"@ember-eui/core": "^1.0.4",
|
|
29
29
|
"ember-cli-babel": "^7.21.0",
|
|
30
30
|
"ember-cli-htmlbars": "^5.2.0",
|
|
31
31
|
"ember-cli-typescript": "^4.1.0",
|
|
@@ -104,5 +104,5 @@
|
|
|
104
104
|
"volta": {
|
|
105
105
|
"node": "12.22.1"
|
|
106
106
|
},
|
|
107
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "b7b1ff62f14fe2879cf05b0f4d29406e78d8acb8"
|
|
108
108
|
}
|