@ember-eui/validated-form 4.2.6 → 5.0.0-alpha.1
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-checkbox-group/index.hbs +1 -0
- package/addon/components/validated-form/field-combo-box/index.hbs +1 -1
- package/addon/components/validated-form/field-dual-range-slider/index.hbs +4 -4
- package/addon/components/validated-form/field-dual-range-slider/index.js +10 -1
- package/addon/components/validated-form/field-number/index.hbs +3 -3
- package/addon/components/validated-form/field-range-slider/index.hbs +3 -3
- package/addon/components/validated-form/index.hbs +3 -3
- package/docs/{validated-form-usage-demo → validated-form-demo}/demo1.md +12 -7
- package/docs/validated-form.md +1 -0
- package/package.json +3 -3
- package/docs/installation.md +0 -7
- package/docs/validated-form-usage.md +0 -1
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<EuiDualRange
|
|
21
21
|
class={{@fieldClasses}}
|
|
22
22
|
form={{@formId}}
|
|
23
|
-
@value={{
|
|
23
|
+
@value={{@value}}
|
|
24
24
|
@fullWidth={{@fullWidth}}
|
|
25
25
|
@isInvalid={{this.isInvalidAndTouched}}
|
|
26
26
|
@levels={{@levels}}
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
@inputRef={{@inputRef}}
|
|
48
48
|
@controlOnly={{@controlOnly}}
|
|
49
49
|
@autoSize={{@autoSize}}
|
|
50
|
-
@
|
|
51
|
-
@
|
|
50
|
+
@isPrependProvided={{has-block "prepend"}}
|
|
51
|
+
@isAppendProvided={{has-block "append"}}
|
|
52
52
|
@isFakeMinBlock={{not (has-block "min")}}
|
|
53
53
|
@isFakeMaxBlock={{not (has-block "max")}}
|
|
54
54
|
autofocus={{@autofocus}}
|
|
@@ -69,4 +69,4 @@
|
|
|
69
69
|
</:append>
|
|
70
70
|
</EuiDualRange>
|
|
71
71
|
</EuiFormRow>
|
|
72
|
-
{{/let}}
|
|
72
|
+
{{/let}}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
import ValidatedFormFieldBase from '../field-base';
|
|
2
|
+
import { action } from '@ember/object';
|
|
2
3
|
|
|
3
|
-
export default class ValidatedFormFieldRangeSlider extends ValidatedFormFieldBase {
|
|
4
|
+
export default class ValidatedFormFieldRangeSlider extends ValidatedFormFieldBase {
|
|
5
|
+
@action
|
|
6
|
+
handleChange(e) {
|
|
7
|
+
// The received event for the dual range is an array with [min, max] as strings
|
|
8
|
+
const value = [Number(e[0]), Number(e[1])];
|
|
9
|
+
this.args.onChange(value);
|
|
10
|
+
this.notifyValidityChange();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
@controlOnly={{@controlOnly}}
|
|
36
36
|
@compressed={{@compressed}}
|
|
37
37
|
@id={{theId}}
|
|
38
|
-
@
|
|
39
|
-
@
|
|
38
|
+
@isPrependProvided={{has-block "prepend"}}
|
|
39
|
+
@isAppendProvided={{has-block "append"}}
|
|
40
40
|
autofocus={{@autofocus}}
|
|
41
41
|
placeholder={{@placeholder}}
|
|
42
42
|
...attributes
|
|
@@ -51,4 +51,4 @@
|
|
|
51
51
|
</:append>
|
|
52
52
|
</EuiFieldNumber>
|
|
53
53
|
</EuiFormRow>
|
|
54
|
-
{{/let}}
|
|
54
|
+
{{/let}}
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
@inputRef={{@inputRef}}
|
|
48
48
|
@controlOnly={{@controlOnly}}
|
|
49
49
|
@autoSize={{@autoSize}}
|
|
50
|
-
@
|
|
51
|
-
@
|
|
50
|
+
@isPrependProvided={{has-block "prepend"}}
|
|
51
|
+
@isAppendProvided={{has-block "append"}}
|
|
52
52
|
@isFakeMinBlock={{not (has-block "min")}}
|
|
53
53
|
@isFakeMaxBlock={{not (has-block "max")}}
|
|
54
54
|
@isFakeValueBlock={{not (has-block "value")}}
|
|
@@ -82,4 +82,4 @@
|
|
|
82
82
|
</:append>
|
|
83
83
|
</EuiRange>
|
|
84
84
|
</EuiFormRow>
|
|
85
|
-
{{/let}}
|
|
85
|
+
{{/let}}
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
onValidityChange=this.onChildValidityChange
|
|
81
81
|
fullWidth=@fullWidth
|
|
82
82
|
formId=formId
|
|
83
|
-
|
|
83
|
+
isDisabled=@isDisabled
|
|
84
84
|
)
|
|
85
85
|
FieldCheckboxGroup=(component
|
|
86
86
|
"validated-form/field-checkbox-group"
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
formId=formId
|
|
113
113
|
disabled=@isDisabled
|
|
114
114
|
)
|
|
115
|
-
|
|
115
|
+
FieldDualRangeSlider=(component
|
|
116
116
|
"validated-form/field-dual-range-slider"
|
|
117
117
|
register=this.register
|
|
118
118
|
unregister=this.unregister
|
|
@@ -145,4 +145,4 @@
|
|
|
145
145
|
)
|
|
146
146
|
}}
|
|
147
147
|
</EuiForm>
|
|
148
|
-
{{/let}}
|
|
148
|
+
{{/let}}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Validated form
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
It used `ember-validators` by default. To provide describe validations ergonomically you'd just pass a hash where each key is a valid
|
|
6
|
-
ember-valitador validator, `length`, `presence`, `number` and the values, the `config` expected by those.
|
|
3
|
+
<EuiText>
|
|
4
|
+
<p>Inspired on <strong>ember-paper</strong>'s <EuiCode>{{t "validated_form.ember_paper"}}</EuiCode></p>
|
|
7
5
|
|
|
8
|
-
<
|
|
6
|
+
<p>The idea is simple, <strong>ValidatedForm</strong> yields most basic <strong>@ember-eui/core</strong> components with some wiring to keep the form state on sync.</p>
|
|
7
|
+
|
|
8
|
+
<p>It uses <EuiLink @target="_blank" @href="https://github.com/offirgolan/ember-validators">ember-validators</EuiLink> by default to describe the validations. To provide the validations ergonomically you'd just pass a hash where each key is a valid
|
|
9
|
+
ember-valitador validator, <EuiCode>length</EuiCode>, <EuiCode>presence</EuiCode>, <EuiCode>number</EuiCode>, the values and the <EuiCode>config</EuiCode> expected by those.</p>
|
|
10
|
+
|
|
11
|
+
<p><EuiCodeBlock @isCopyable={{true}}>ember install @ember-eui/validated-form</EuiCodeBlock></p>
|
|
12
|
+
|
|
13
|
+
</EuiText>
|
|
9
14
|
|
|
10
15
|
```hbs template
|
|
11
16
|
<ValidatedForm as |Form|>
|
|
@@ -23,7 +28,7 @@ ember-valitador validator, `length`, `presence`, `number` and the values, the `c
|
|
|
23
28
|
@label='Markdown'
|
|
24
29
|
@onChange={{set this.data 'markdownText'}}
|
|
25
30
|
@validations={{hash presence=(hash presence=true)}}
|
|
26
|
-
@error={{array
|
|
31
|
+
@error={{array 'one error'}}
|
|
27
32
|
/>
|
|
28
33
|
<Form.FieldSelect
|
|
29
34
|
@onChange={{set this.data 'fieldSelect'}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!-- empty on purpose -->
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ember-eui/validated-form",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-alpha.1",
|
|
4
4
|
"description": "The default blueprint for ember-cli addons.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"postpack": "ember ts:clean"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@ember-eui/core": "^
|
|
31
|
+
"@ember-eui/core": "^5.0.0-alpha.1",
|
|
32
32
|
"ember-cli-babel": "^7.26.11",
|
|
33
33
|
"ember-cli-htmlbars": "^6.0.1",
|
|
34
34
|
"ember-cli-typescript": "4.2.1",
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
"volta": {
|
|
116
116
|
"extends": "../../package.json"
|
|
117
117
|
},
|
|
118
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "8274d7d27c55ed0fafc1c3e0228c8cd70dd4bccc"
|
|
119
119
|
}
|
package/docs/installation.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# Usage
|