@ember-eui/validated-form 7.1.4 → 8.0.0-beta.12

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.
Files changed (174) hide show
  1. package/addon-main.js +5 -0
  2. package/declarations/components/validated-form/field-base/index.d.ts +37 -0
  3. package/declarations/components/validated-form/field-base/index.d.ts.map +1 -0
  4. package/declarations/components/validated-form/field-base.d.ts +56 -0
  5. package/declarations/components/validated-form/field-base.d.ts.map +1 -0
  6. package/declarations/components/validated-form/field-checkbox-group/index.d.ts +8 -0
  7. package/declarations/components/validated-form/field-checkbox-group/index.d.ts.map +1 -0
  8. package/declarations/components/validated-form/field-checkbox-group.d.ts +30 -0
  9. package/declarations/components/validated-form/field-checkbox-group.d.ts.map +1 -0
  10. package/declarations/components/validated-form/field-combo-box/index.d.ts +5 -0
  11. package/declarations/components/validated-form/field-combo-box/index.d.ts.map +1 -0
  12. package/declarations/components/validated-form/field-combo-box.d.ts +27 -0
  13. package/declarations/components/validated-form/field-combo-box.d.ts.map +1 -0
  14. package/declarations/components/validated-form/field-dual-range-slider/index.d.ts +5 -0
  15. package/declarations/components/validated-form/field-dual-range-slider/index.d.ts.map +1 -0
  16. package/declarations/components/validated-form/field-dual-range-slider.d.ts +32 -0
  17. package/declarations/components/validated-form/field-dual-range-slider.d.ts.map +1 -0
  18. package/{addon/components/validated-form/field-markdown-editor/index.js → declarations/components/validated-form/field-markdown-editor/index.d.ts} +3 -8
  19. package/declarations/components/validated-form/field-markdown-editor/index.d.ts.map +1 -0
  20. package/declarations/components/validated-form/field-markdown-editor.d.ts +25 -0
  21. package/declarations/components/validated-form/field-markdown-editor.d.ts.map +1 -0
  22. package/{addon/components/validated-form/field-number/index.js → declarations/components/validated-form/field-number/index.d.ts} +3 -2
  23. package/declarations/components/validated-form/field-number/index.d.ts.map +1 -0
  24. package/declarations/components/validated-form/field-number.d.ts +24 -0
  25. package/declarations/components/validated-form/field-number.d.ts.map +1 -0
  26. package/{addon/components/validated-form/field-password/index.js → declarations/components/validated-form/field-password/index.d.ts} +3 -2
  27. package/declarations/components/validated-form/field-password/index.d.ts.map +1 -0
  28. package/declarations/components/validated-form/field-password.d.ts +24 -0
  29. package/declarations/components/validated-form/field-password.d.ts.map +1 -0
  30. package/declarations/components/validated-form/field-radio-group/index.d.ts +8 -0
  31. package/declarations/components/validated-form/field-radio-group/index.d.ts.map +1 -0
  32. package/declarations/components/validated-form/field-radio-group.d.ts +29 -0
  33. package/declarations/components/validated-form/field-radio-group.d.ts.map +1 -0
  34. package/{addon/components/validated-form/field-range-slider/index.js → declarations/components/validated-form/field-range-slider/index.d.ts} +3 -2
  35. package/declarations/components/validated-form/field-range-slider/index.d.ts.map +1 -0
  36. package/declarations/components/validated-form/field-range-slider.d.ts +28 -0
  37. package/declarations/components/validated-form/field-range-slider.d.ts.map +1 -0
  38. package/{addon/components/validated-form/field-select/index.js → declarations/components/validated-form/field-select/index.d.ts} +3 -2
  39. package/declarations/components/validated-form/field-select/index.d.ts.map +1 -0
  40. package/declarations/components/validated-form/field-select.d.ts +23 -0
  41. package/declarations/components/validated-form/field-select.d.ts.map +1 -0
  42. package/declarations/components/validated-form/field-switch/index.d.ts +5 -0
  43. package/declarations/components/validated-form/field-switch/index.d.ts.map +1 -0
  44. package/declarations/components/validated-form/field-switch.d.ts +24 -0
  45. package/declarations/components/validated-form/field-switch.d.ts.map +1 -0
  46. package/{addon/components/validated-form/field-text/index.js → declarations/components/validated-form/field-text/index.d.ts} +3 -2
  47. package/declarations/components/validated-form/field-text/index.d.ts.map +1 -0
  48. package/{addon/components/validated-form/field-text-area/index.js → declarations/components/validated-form/field-text-area/index.d.ts} +3 -2
  49. package/declarations/components/validated-form/field-text-area/index.d.ts.map +1 -0
  50. package/declarations/components/validated-form/field-text-area.d.ts +29 -0
  51. package/declarations/components/validated-form/field-text-area.d.ts.map +1 -0
  52. package/declarations/components/validated-form/field-text.d.ts +22 -0
  53. package/declarations/components/validated-form/field-text.d.ts.map +1 -0
  54. package/declarations/components/validated-form/index.d.ts +30 -0
  55. package/declarations/components/validated-form/index.d.ts.map +1 -0
  56. package/declarations/components/validated-form.d.ts +91 -0
  57. package/declarations/components/validated-form.d.ts.map +1 -0
  58. package/declarations/utils/build-validation-messages.d.ts +13 -0
  59. package/declarations/utils/build-validation-messages.d.ts.map +1 -0
  60. package/declarations/utils/get-messages.d.ts +11 -0
  61. package/declarations/utils/get-messages.d.ts.map +1 -0
  62. package/declarations/utils/validation-errors.d.ts +2 -0
  63. package/declarations/utils/validation-errors.d.ts.map +1 -0
  64. package/declarations/utils/with-defaults.d.ts +10 -0
  65. package/declarations/utils/with-defaults.d.ts.map +1 -0
  66. package/declarations/validators/messages.d.ts +4 -0
  67. package/declarations/validators/messages.d.ts.map +1 -0
  68. package/dist/_app_/components/validated-form/field-base.js +1 -0
  69. package/dist/_app_/components/validated-form/field-checkbox-group.js +1 -0
  70. package/dist/_app_/components/validated-form/field-combo-box.js +1 -0
  71. package/dist/_app_/components/validated-form/field-dual-range-slider.js +1 -0
  72. package/dist/_app_/components/validated-form/field-markdown-editor.js +1 -0
  73. package/dist/_app_/components/validated-form/field-number.js +1 -0
  74. package/dist/_app_/components/validated-form/field-password.js +1 -0
  75. package/dist/_app_/components/validated-form/field-radio-group.js +1 -0
  76. package/dist/_app_/components/validated-form/field-range-slider.js +1 -0
  77. package/dist/_app_/components/validated-form/field-select.js +1 -0
  78. package/dist/_app_/components/validated-form/field-switch.js +1 -0
  79. package/dist/_app_/components/validated-form/field-text-area.js +1 -0
  80. package/dist/_app_/components/validated-form/field-text.js +1 -0
  81. package/dist/_app_/components/validated-form.js +1 -0
  82. package/dist/_app_/utils/build-validation-messages.js +1 -0
  83. package/dist/_app_/utils/get-messages.js +1 -0
  84. package/dist/_app_/utils/validation-errors.js +1 -0
  85. package/dist/_app_/utils/with-defaults.js +1 -0
  86. package/dist/_app_/validators/messages.js +1 -0
  87. package/dist/components/validated-form/field-base.js +7 -0
  88. package/dist/components/validated-form/field-base.js.map +1 -0
  89. package/dist/components/validated-form/field-checkbox-group.js +104 -0
  90. package/dist/components/validated-form/field-checkbox-group.js.map +1 -0
  91. package/dist/components/validated-form/field-combo-box.js +106 -0
  92. package/dist/components/validated-form/field-combo-box.js.map +1 -0
  93. package/dist/components/validated-form/field-dual-range-slider.js +112 -0
  94. package/dist/components/validated-form/field-dual-range-slider.js.map +1 -0
  95. package/dist/components/validated-form/field-markdown-editor.js +102 -0
  96. package/dist/components/validated-form/field-markdown-editor.js.map +1 -0
  97. package/dist/components/validated-form/field-number.js +94 -0
  98. package/dist/components/validated-form/field-number.js.map +1 -0
  99. package/dist/components/validated-form/field-password.js +87 -0
  100. package/dist/components/validated-form/field-password.js.map +1 -0
  101. package/dist/components/validated-form/field-radio-group.js +102 -0
  102. package/dist/components/validated-form/field-radio-group.js.map +1 -0
  103. package/dist/components/validated-form/field-range-slider.js +119 -0
  104. package/dist/components/validated-form/field-range-slider.js.map +1 -0
  105. package/dist/components/validated-form/field-select.js +88 -0
  106. package/dist/components/validated-form/field-select.js.map +1 -0
  107. package/dist/components/validated-form/field-switch.js +87 -0
  108. package/dist/components/validated-form/field-switch.js.map +1 -0
  109. package/dist/components/validated-form/field-text-area.js +80 -0
  110. package/dist/components/validated-form/field-text-area.js.map +1 -0
  111. package/dist/components/validated-form/field-text.js +90 -0
  112. package/dist/components/validated-form/field-text.js.map +1 -0
  113. package/dist/components/validated-form.js +303 -0
  114. package/dist/components/validated-form.js.map +1 -0
  115. package/dist/field-base-t4F7Xj_I.js +185 -0
  116. package/dist/field-base-t4F7Xj_I.js.map +1 -0
  117. package/{addon → dist}/utils/build-validation-messages.js +13 -36
  118. package/dist/utils/build-validation-messages.js.map +1 -0
  119. package/{addon → dist}/utils/get-messages.js +6 -7
  120. package/dist/utils/get-messages.js.map +1 -0
  121. package/dist/utils/validation-errors.js +18 -0
  122. package/dist/utils/validation-errors.js.map +1 -0
  123. package/{addon → dist}/utils/with-defaults.js +5 -2
  124. package/dist/utils/with-defaults.js.map +1 -0
  125. package/dist/validators/messages.js +7 -0
  126. package/dist/validators/messages.js.map +1 -0
  127. package/package.json +116 -76
  128. package/addon/components/validated-form/field-base/index.js +0 -144
  129. package/addon/components/validated-form/field-checkbox-group/index.hbs +0 -47
  130. package/addon/components/validated-form/field-checkbox-group/index.js +0 -42
  131. package/addon/components/validated-form/field-combo-box/index.hbs +0 -65
  132. package/addon/components/validated-form/field-combo-box/index.js +0 -12
  133. package/addon/components/validated-form/field-dual-range-slider/index.hbs +0 -80
  134. package/addon/components/validated-form/field-dual-range-slider/index.js +0 -12
  135. package/addon/components/validated-form/field-markdown-editor/index.hbs +0 -61
  136. package/addon/components/validated-form/field-number/index.hbs +0 -63
  137. package/addon/components/validated-form/field-password/index.hbs +0 -56
  138. package/addon/components/validated-form/field-radio-group/index.hbs +0 -45
  139. package/addon/components/validated-form/field-radio-group/index.js +0 -39
  140. package/addon/components/validated-form/field-range-slider/index.hbs +0 -93
  141. package/addon/components/validated-form/field-select/index.hbs +0 -57
  142. package/addon/components/validated-form/field-switch/index.hbs +0 -48
  143. package/addon/components/validated-form/field-switch/index.js +0 -12
  144. package/addon/components/validated-form/field-text/index.hbs +0 -59
  145. package/addon/components/validated-form/field-text-area/index.hbs +0 -54
  146. package/addon/components/validated-form/index.hbs +0 -158
  147. package/addon/components/validated-form/index.js +0 -132
  148. package/addon/utils/validation-errors.js +0 -13
  149. package/addon/validators/messages.js +0 -4
  150. package/app/components/validated-form/field-base/index.js +0 -1
  151. package/app/components/validated-form/field-checkbox-group/index.js +0 -1
  152. package/app/components/validated-form/field-combo-box/index.js +0 -1
  153. package/app/components/validated-form/field-dual-range-slider/index.js +0 -1
  154. package/app/components/validated-form/field-markdown-editor/index.js +0 -1
  155. package/app/components/validated-form/field-number/index.js +0 -1
  156. package/app/components/validated-form/field-password/index.js +0 -1
  157. package/app/components/validated-form/field-radio-group/index.js +0 -1
  158. package/app/components/validated-form/field-range-slider/index.js +0 -1
  159. package/app/components/validated-form/field-select/index.js +0 -1
  160. package/app/components/validated-form/field-switch/index.js +0 -1
  161. package/app/components/validated-form/field-text/index.js +0 -1
  162. package/app/components/validated-form/field-text-area/index.js +0 -1
  163. package/app/components/validated-form/index.js +0 -1
  164. package/app/utils/build-validation-messages.js +0 -1
  165. package/app/utils/get-messages.js +0 -1
  166. package/app/utils/validation-errors.js +0 -1
  167. package/app/validators/messages.js +0 -1
  168. package/config/environment.js +0 -5
  169. package/docs/validated-form-demo/demo1.md +0 -162
  170. package/docs/validated-form.md +0 -1
  171. package/index.js +0 -5
  172. package/tsconfig.json +0 -27
  173. package/types/dummy/index.d.ts +0 -1
  174. package/types/global.d.ts +0 -22
@@ -1,61 +0,0 @@
1
- {{#let (arg-or-default @id (unique-id)) as |theId|}}
2
- <EuiFormRow
3
- class={{@rowClasses}}
4
- @extra={{this.rowExtra}}
5
- @labelType={{@labelType}}
6
- @display={{@display}}
7
- @hasEmptyLabelSpace={{@hasEmptyLabelSpace}}
8
- @fullWidth={{@fullWidth}}
9
- @hasChildLabel={{@hasChildLabel}}
10
- @label={{this.label}}
11
- @labelAppend={{@labelAppend}}
12
- @id={{theId}}
13
- @isInvalid={{this.isInvalidAndTouched}}
14
- @error={{this.validationErrorMessages}}
15
- @helpText={{@helpText}}
16
- @errorClasses={{@errorClasses}}
17
- @isFakeLabelBlock={{not (has-block "label")}}
18
- {{did-insert this.setValidationMessages}}
19
- {{did-update this.didUpdateValue @validations}}
20
- {{did-update this.didUpdateValue @value}}
21
- >
22
- <:label>
23
- {{yield to="label"}}
24
- </:label>
25
- <:field>
26
- {{#let
27
- (if
28
- @editorComponent
29
- (component (ensure-safe-component @editorComponent))
30
- (component "eui-markdown-editor")
31
- )
32
- as |MarkdownEditor|
33
- }}
34
- <MarkdownEditor
35
- class={{@fieldClasses}}
36
- form={{@formId}}
37
- aria-label={{@ariaLabel}}
38
- @value={{@value}}
39
- @isInvalid={{this.isInvalidAndTouched}}
40
- @disabled={{@disabled}}
41
- @editorId={{theId}}
42
- @onChange={{this.handleChange}}
43
- @ariaDescribedBy={{@ariaDescribedBy}}
44
- @ariaLabel={{@ariaLabel}}
45
- @ariaLabelledBy={{@ariaLabelledBy}}
46
- autofocus={{@autofocus}}
47
- placeholder={{@placeholder}}
48
- @onParse={{@onParse}}
49
- @parsingPluginList={{@parsingPluginList}}
50
- @uiPlugins={{@uiPlugins}}
51
- @height={{@height}}
52
- @maxHeight={{@maxHeight}}
53
- @autoExpandPreview={{@autoExpandPreview}}
54
- @initialViewMode={{@initialViewMode}}
55
- ...attributes
56
- {{on "blur" (fn this.setIsTouched true)}}
57
- />
58
- {{/let}}
59
- </:field>
60
- </EuiFormRow>
61
- {{/let}}
@@ -1,63 +0,0 @@
1
- {{#let (arg-or-default @id (unique-id)) as |theId|}}
2
- <EuiFormRow
3
- class={{@rowClasses}}
4
- @extra={{this.rowExtra}}
5
- @labelType={{@labelType}}
6
- @display={{@display}}
7
- @hasEmptyLabelSpace={{@hasEmptyLabelSpace}}
8
- @fullWidth={{@fullWidth}}
9
- @hasChildLabel={{@hasChildLabel}}
10
- @label={{this.label}}
11
- @labelAppend={{@labelAppend}}
12
- @id={{theId}}
13
- @isInvalid={{this.isInvalidAndTouched}}
14
- @error={{this.validationErrorMessages}}
15
- @helpText={{@helpText}}
16
- @errorClasses={{@errorClasses}}
17
- @isFakeLabelBlock={{not (has-block "label")}}
18
- {{did-insert this.setValidationMessages}}
19
- {{did-update this.didUpdateValue @validations}}
20
- {{did-update this.didUpdateValue @value}}
21
- >
22
- <:label>
23
- {{yield to="label"}}
24
- </:label>
25
-
26
- <:field>
27
- <EuiFieldNumber
28
- class={{@fieldClasses}}
29
- form={{@formId}}
30
- aria-label={{@ariaLabel}}
31
- @value={{@value}}
32
- @icon={{@icon}}
33
- @isInvalid={{this.isInvalidAndTouched}}
34
- @fullWidth={{@fullWidth}}
35
- @isLoading={{@isLoading}}
36
- @readOnly={{@readOnly}}
37
- @disabled={{@disabled}}
38
- @min={{@min}}
39
- @max={{@max}}
40
- @step={{@step}}
41
- @inputRef={{@inputRef}}
42
- @controlOnly={{@controlOnly}}
43
- @compressed={{@compressed}}
44
- @id={{theId}}
45
- @clear={{@clear}}
46
- @isPrependProvided={{has-block "prepend"}}
47
- @isAppendProvided={{has-block "append"}}
48
- autofocus={{@autofocus}}
49
- placeholder={{@placeholder}}
50
- ...attributes
51
- {{on "blur" (fn this.setIsTouched true)}}
52
- {{on "input" this.handleChange}}
53
- >
54
- <:prepend as |classes|>
55
- {{yield classes to="prepend"}}
56
- </:prepend>
57
- <:append as |classes|>
58
- {{yield classes to="append"}}
59
- </:append>
60
- </EuiFieldNumber>
61
- </:field>
62
- </EuiFormRow>
63
- {{/let}}
@@ -1,56 +0,0 @@
1
- {{#let (arg-or-default @id (unique-id)) as |theId|}}
2
- <EuiFormRow
3
- class={{@rowClasses}}
4
- @extra={{this.rowExtra}}
5
- @labelType={{@labelType}}
6
- @display={{@display}}
7
- @hasEmptyLabelSpace={{@hasEmptyLabelSpace}}
8
- @fullWidth={{@fullWidth}}
9
- @hasChildLabel={{@hasChildLabel}}
10
- @label={{this.label}}
11
- @labelAppend={{@labelAppend}}
12
- @id={{theId}}
13
- @isInvalid={{this.isInvalidAndTouched}}
14
- @error={{this.validationErrorMessages}}
15
- @helpText={{@helpText}}
16
- @errorClasses={{@errorClasses}}
17
- @isFakeLabelBlock={{not (has-block "label")}}
18
- {{did-insert this.setValidationMessages}}
19
- {{did-update this.didUpdateValue @validations}}
20
- {{did-update this.didUpdateValue @value}}
21
- >
22
- <:label>
23
- {{yield to="label"}}
24
- </:label>
25
- <:field>
26
- <EuiFieldPassword
27
- class={{@fieldClasses}}
28
- form={{@formId}}
29
- aria-label={{@ariaLabel}}
30
- @isInvalid={{this.isInvalidAndTouched}}
31
- @fullWidth={{@fullWidth}}
32
- @isLoading={{@isLoading}}
33
- @compressed={{@compressed}}
34
- @inputRef={{@inputRef}}
35
- @value={{@value}}
36
- @type={{@type}}
37
- @id={{theId}}
38
- @disabled={{@disabled}}
39
- @isFakePrependBlock={{not (has-block "prepend")}}
40
- @isFakeAppendBlock={{not (has-block "append")}}
41
- autofocus={{@autofocus}}
42
- placeholder={{@placeholder}}
43
- ...attributes
44
- {{on "blur" (fn this.setIsTouched true)}}
45
- {{on "input" this.handleChange}}
46
- >
47
- <:prepend as |classes|>
48
- {{yield classes to="prepend"}}
49
- </:prepend>
50
- <:append as |classes|>
51
- {{yield classes to="append"}}
52
- </:append>
53
- </EuiFieldPassword>
54
- </:field>
55
- </EuiFormRow>
56
- {{/let}}
@@ -1,45 +0,0 @@
1
- {{#let (arg-or-default @id (unique-id)) as |theId|}}
2
- <EuiFormRow
3
- class={{@rowClasses}}
4
- @extra={{this.rowExtra}}
5
- @labelType={{@labelType}}
6
- @display={{@display}}
7
- @hasEmptyLabelSpace={{@hasEmptyLabelSpace}}
8
- @fullWidth={{@fullWidth}}
9
- @hasChildLabel={{@hasChildLabel}}
10
- @label={{this.label}}
11
- @labelAppend={{@labelAppend}}
12
- @id={{theId}}
13
- @isInvalid={{this.isInvalidAndTouched}}
14
- @error={{this.validationErrorMessages}}
15
- @helpText={{@helpText}}
16
- @errorClasses={{@errorClasses}}
17
- @isFakeLabelBlock={{not (has-block "label")}}
18
- {{did-insert this.setValidationMessages}}
19
- {{did-update this.didUpdateValue @validations}}
20
- {{did-update this.didUpdateValue @value}}
21
- >
22
- <:label>
23
- {{yield to="label"}}
24
- </:label>
25
- <:field>
26
- <EuiRadioGroup
27
- class={{@fieldClasses}}
28
- @formId={{@formId}}
29
- aria-label={{@ariaLabel}}
30
- @disabled={{@disabled}}
31
- @valueKey={{@valueKey}}
32
- @labelKey={{@labelKey}}
33
- @compressed={{@compressed}}
34
- @name={{@name}}
35
- @options={{this.options}}
36
- @idSelected={{this.value}}
37
- @legend={{@legend}}
38
- @id={{theId}}
39
- @onChange={{this.handleChange}}
40
- autofocus={{@autofocus}}
41
- ...attributes
42
- />
43
- </:field>
44
- </EuiFormRow>
45
- {{/let}}
@@ -1,39 +0,0 @@
1
- import ValidatedFormFieldBase from '../field-base';
2
- import { action } from '@ember/object';
3
- import { maybeUnwrapProxy } from '@ember-eui/core/utils/maybe-unwrap-proxy';
4
- export default class ValidatedFormFieldRadioGroup extends ValidatedFormFieldBase {
5
- get value() {
6
- let value = maybeUnwrapProxy(this.args.value);
7
- return value?.toArray?.() || value;
8
- }
9
-
10
- get arrayToMap() {
11
- const currArr = this.args.value || [];
12
- return this.transformToMap(currArr);
13
- }
14
-
15
- transformToMap(value = []) {
16
- let valuesMap = value.reduce((acc, val) => {
17
- acc[val] = true;
18
- return acc;
19
- }, {});
20
- return valuesMap;
21
- }
22
-
23
- @action
24
- handleChange(optionId) {
25
- let value = this.value || [];
26
-
27
- const found = value.find((v) => v === optionId);
28
- let newArr = [];
29
-
30
- if (found) {
31
- newArr = value.filter((v) => v !== optionId);
32
- } else {
33
- newArr = [...value, optionId];
34
- }
35
-
36
- this.args.onChange?.(newArr);
37
- this.isTouched = true;
38
- }
39
- }
@@ -1,93 +0,0 @@
1
- {{#let (arg-or-default @id (unique-id)) as |theId|}}
2
- <EuiFormRow
3
- class={{@rowClasses}}
4
- @extra={{this.rowExtra}}
5
- @labelType={{@labelType}}
6
- @display={{@display}}
7
- @hasEmptyLabelSpace={{@hasEmptyLabelSpace}}
8
- @fullWidth={{@fullWidth}}
9
- @hasChildLabel={{@hasChildLabel}}
10
- @label={{this.label}}
11
- @labelAppend={{@labelAppend}}
12
- @id={{theId}}
13
- @isInvalid={{this.isInvalidAndTouched}}
14
- @error={{this.validationErrorMessages}}
15
- @helpText={{@helpText}}
16
- @errorClasses={{@errorClasses}}
17
- @isFakeLabelBlock={{not (has-block "label")}}
18
- {{did-insert this.setValidationMessages}}
19
- {{did-update this.didUpdateValue @validations}}
20
- {{did-update this.didUpdateValue @value}}
21
- >
22
- <:label>
23
- {{yield to="label"}}
24
- </:label>
25
-
26
- <:field>
27
- <EuiRange
28
- class={{@fieldClasses}}
29
- form={{@formId}}
30
- @compressed={{@compressed}}
31
- @readOnly={{@readOnly}}
32
- @fullWidth={{@fullWidth}}
33
- @id={{theId}}
34
- @levels={{@levels}}
35
- @step={{@step}}
36
- @showInput={{@showInput}}
37
- @showLabels={{@showLabels}}
38
- @showRange={{@showRange}}
39
- @showTicks={{@showTicks}}
40
- @showValue={{@showValue}}
41
- @disabled={{@disabled}}
42
- @ticks={{@ticks}}
43
- @tickInternval={{@tickInternval}}
44
- @valuePrepend={{@valuePrepend}}
45
- @valueAppend={{@valueAppend}}
46
- @onChange={{this.handleChange}}
47
- @value={{@value}}
48
- @max={{@max}}
49
- @isLoading={{@isLoading}}
50
- @min={{@min}}
51
- @icon={{@icon}}
52
- @side={{@side}}
53
- @isInvalid={{this.isInvalidAndTouched}}
54
- @inputRef={{@inputRef}}
55
- @controlOnly={{@controlOnly}}
56
- @autoSize={{@autoSize}}
57
- @isPrependProvided={{has-block "prepend"}}
58
- @isAppendProvided={{has-block "append"}}
59
- @isFakeMinBlock={{not (has-block "min")}}
60
- @isFakeMaxBlock={{not (has-block "max")}}
61
- @isFakeValueBlock={{not (has-block "value")}}
62
- @isFakeValuePrependBlock={{not (has-block "valuePrepend")}}
63
- @isFakeValueAppendBlock={{not (has-block "valueAppend")}}
64
- aria-label={{@ariaLabel}}
65
- autofocus={{@autofocus}}
66
- ...attributes
67
- {{on "blur" (fn this.setIsTouched true)}}
68
- >
69
- <:prepend as |classes|>
70
- {{yield classes to="prepend"}}
71
- </:prepend>
72
- <:min>
73
- {{yield to="min"}}
74
- </:min>
75
- <:valuePrepend>
76
- {{yield to="valuePrepend"}}
77
- </:valuePrepend>
78
- <:value>
79
- {{yield to="value"}}
80
- </:value>
81
- <:valueAppend>
82
- {{yield to="valueAppend"}}
83
- </:valueAppend>
84
- <:max>
85
- {{yield to="max"}}
86
- </:max>
87
- <:append as |classes|>
88
- {{yield classes to="append"}}
89
- </:append>
90
- </EuiRange>
91
- </:field>
92
- </EuiFormRow>
93
- {{/let}}
@@ -1,57 +0,0 @@
1
- {{#let (arg-or-default @id (unique-id)) as |theId|}}
2
- <EuiFormRow
3
- class={{@rowClasses}}
4
- @extra={{this.rowExtra}}
5
- @labelType={{@labelType}}
6
- @display={{@display}}
7
- @hasEmptyLabelSpace={{@hasEmptyLabelSpace}}
8
- @fullWidth={{@fullWidth}}
9
- @hasChildLabel={{@hasChildLabel}}
10
- @label={{this.label}}
11
- @labelAppend={{@labelAppend}}
12
- @id={{theId}}
13
- @isInvalid={{this.isInvalidAndTouched}}
14
- @error={{this.validationErrorMessages}}
15
- @helpText={{@helpText}}
16
- @errorClasses={{@errorClasses}}
17
- @isFakeLabelBlock={{not (has-block "label")}}
18
- {{did-insert this.setValidationMessages}}
19
- {{did-update this.didUpdateValue @validations}}
20
- {{did-update this.didUpdateValue @value}}
21
- >
22
- <:label>
23
- {{yield to="label"}}
24
- </:label>
25
-
26
- <:field>
27
- <EuiSelect
28
- aria-label={{@ariaLabel}}
29
- class={{@fieldClasses}}
30
- form={{@formId}}
31
- @options={{this.options}}
32
- @isInvalid={{this.isInvalidAndTouchedh}}
33
- @fullWidth={{@fullWidth}}
34
- @isLoading={{@isLoading}}
35
- @hasNoInitialSelection={{@hasNoInitialSelection}}
36
- @inputRef={{@inputRef}}
37
- @disabled={{@disabled}}
38
- @value={{@value}}
39
- @compressed={{@compressed}}
40
- @isFakePrependBlock={{not (has-block "prepend")}}
41
- @isFakeAppendBlock={{not (has-block "append")}}
42
- @id={{theId}}
43
- autofocus={{@autofocus}}
44
- ...attributes
45
- {{on "blur" (fn this.setIsTouched true)}}
46
- {{on "change" this.handleChange}}
47
- >
48
- <:prepend as |classes|>
49
- {{yield classes to="prepend"}}
50
- </:prepend>
51
- <:append as |classes|>
52
- {{yield classes to="append"}}
53
- </:append>
54
- </EuiSelect>
55
- </:field>
56
- </EuiFormRow>
57
- {{/let}}
@@ -1,48 +0,0 @@
1
- {{#let (arg-or-default @id (unique-id)) as |theId|}}
2
- <EuiFormRow
3
- class={{@rowClasses}}
4
- @extra={{this.rowExtra}}
5
- @labelType={{@labelType}}
6
- @display={{@display}}
7
- @hasEmptyLabelSpace={{@hasEmptyLabelSpace}}
8
- @fullWidth={{@fullWidth}}
9
- @hasChildLabel={{@hasChildLabel}}
10
- @label={{this.label}}
11
- @labelAppend={{@labelAppend}}
12
- @id={{theId}}
13
- @isInvalid={{this.isInvalidAndTouched}}
14
- @error={{this.validationErrorMessages}}
15
- @helpText={{@helpText}}
16
- @errorClasses={{@errorClasses}}
17
- @isFakeLabelBlock={{not (has-block "label")}}
18
- {{did-insert this.setValidationMessages}}
19
- {{did-update this.didUpdateValue @validations}}
20
- {{did-update this.didUpdateValue @value}}
21
- >
22
- <:label>
23
- {{yield to="label"}}
24
- </:label>
25
- <:field>
26
- <EuiSwitch
27
- class={{@fieldClasses}}
28
- form={{@formId}}
29
- aria-label={{@ariaLabel}}
30
- @id={{theId}}
31
- @showLabel={{@showLabel}}
32
- @label={{@switchLabel}}
33
- @checked={{@value}}
34
- @onChange={{this.handleChange}}
35
- @isFakeLabelBlock={{not (has-block "switch-label")}}
36
- @disabled={{@disabled}}
37
- @compressed={{@compressed}}
38
- @type={{@type}}
39
- {{on "blur" (fn this.setIsTouched true)}}
40
- ...attributes
41
- >
42
- <:label>
43
- {{yield to="switch-label"}}
44
- </:label>
45
- </EuiSwitch>
46
- </:field>
47
- </EuiFormRow>
48
- {{/let}}
@@ -1,12 +0,0 @@
1
- import ValidatedFormFieldBase from '../field-base';
2
- import { action } from '@ember/object';
3
-
4
- export default class ValidatedFormFieldSwitch extends ValidatedFormFieldBase {
5
- @action
6
- handleChange(e) {
7
- e.preventDefault();
8
- const checked = e.target.checked;
9
- this.args.onChange?.(checked, e);
10
- this.notifyValidityChange();
11
- }
12
- }
@@ -1,59 +0,0 @@
1
- {{#let (arg-or-default @id (unique-id)) as |theId|}}
2
- <EuiFormRow
3
- class={{@rowClasses}}
4
- @extra={{this.rowExtra}}
5
- @labelType={{@labelType}}
6
- @display={{@display}}
7
- @hasEmptyLabelSpace={{@hasEmptyLabelSpace}}
8
- @fullWidth={{@fullWidth}}
9
- @hasChildLabel={{@hasChildLabel}}
10
- @label={{this.label}}
11
- @labelAppend={{@labelAppend}}
12
- @id={{theId}}
13
- @isInvalid={{this.isInvalidAndTouched}}
14
- @error={{this.validationErrorMessages}}
15
- @helpText={{@helpText}}
16
- @errorClasses={{@errorClasses}}
17
- @isFakeLabelBlock={{not (has-block "label")}}
18
- {{did-insert this.setValidationMessages}}
19
- {{did-update this.didUpdateValue @validations}}
20
- {{did-update this.didUpdateValue @value}}
21
- >
22
- <:label>
23
- {{yield to="label"}}
24
- </:label>
25
- <:field>
26
- <EuiFieldText
27
- class={{@fieldClasses}}
28
- aria-label={{@ariaLabel}}
29
- form={{@formId}}
30
- @value={{@value}}
31
- @icon={{@icon}}
32
- @isInvalid={{this.isInvalidAndTouched}}
33
- @fullWidth={{@fullWidth}}
34
- @isLoading={{@isLoading}}
35
- @disabled={{@disabled}}
36
- @readOnly={{@readOnly}}
37
- @inputRef={{@inputRef}}
38
- @controlOnly={{@controlOnly}}
39
- @compressed={{@compressed}}
40
- @clear={{@clear}}
41
- @id={{theId}}
42
- @isFakePrependBlock={{not (has-block "prepend")}}
43
- @isFakeAppendBlock={{not (has-block "append")}}
44
- autofocus={{@autofocus}}
45
- placeholder={{@placeholder}}
46
- ...attributes
47
- {{on "blur" (fn this.setIsTouched true)}}
48
- {{on "input" this.handleChange}}
49
- >
50
- <:prepend as |classes|>
51
- {{yield classes to="prepend"}}
52
- </:prepend>
53
- <:append as |classes|>
54
- {{yield classes to="append"}}
55
- </:append>
56
- </EuiFieldText>
57
- </:field>
58
- </EuiFormRow>
59
- {{/let}}
@@ -1,54 +0,0 @@
1
- {{#let (arg-or-default @id (unique-id)) as |theId|}}
2
- <EuiFormRow
3
- class={{@rowClasses}}
4
- @extra={{this.rowExtra}}
5
- @labelType={{@labelType}}
6
- @display={{@display}}
7
- @hasEmptyLabelSpace={{@hasEmptyLabelSpace}}
8
- @fullWidth={{@fullWidth}}
9
- @hasChildLabel={{@hasChildLabel}}
10
- @label={{this.label}}
11
- @labelAppend={{@labelAppend}}
12
- @id={{theId}}
13
- @isInvalid={{this.isInvalidAndTouched}}
14
- @error={{this.validationErrorMessages}}
15
- @helpText={{@helpText}}
16
- @errorClasses={{@errorClasses}}
17
- @isFakeLabelBlock={{not (has-block "label")}}
18
- {{did-insert this.setValidationMessages}}
19
- {{did-update this.didUpdateValue @validations}}
20
- {{did-update this.didUpdateValue @value}}
21
- >
22
- <:label>
23
- {{yield to="label"}}
24
- </:label>
25
- <:field>
26
- <EuiTextArea
27
- class={{@fieldClasses}}
28
- form={{@formId}}
29
- aria-label={{@ariaLabel}}
30
- @value={{@value}}
31
- @isInvalid={{this.isInvalidAndTouched}}
32
- @fullWidth={{@fullWidth}}
33
- @compressed={{@compressed}}
34
- @resize={{@resize}}
35
- @disabled={{@disabled}}
36
- @inputRef={{@inputRef}}
37
- @id={{theId}}
38
- @rows={{@rows}}
39
- autofocus={{@autofocus}}
40
- placeholder={{@placeholder}}
41
- ...attributes
42
- {{on "blur" (fn this.setIsTouched true)}}
43
- {{on "input" this.handleChange}}
44
- >
45
- <:prepend as |classes|>
46
- {{yield classes to="prepend"}}
47
- </:prepend>
48
- <:append as |classes|>
49
- {{yield classes to="append"}}
50
- </:append>
51
- </EuiTextArea>
52
- </:field>
53
- </EuiFormRow>
54
- {{/let}}