@frontile/forms 0.12.0 → 0.13.0

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.
@@ -11,6 +11,8 @@ interface FormCheckboxGroupArgs {
11
11
  hasSubmitted?: boolean;
12
12
  /** If has errors */
13
13
  hasError?: boolean;
14
+ /** Force displaying errors */
15
+ showError?: boolean;
14
16
  /** A list of errors or a single text describing the error */
15
17
  errors?: string[] | string;
16
18
  /** CSS classes to be added in the container element */
@@ -32,7 +34,9 @@ export default class FormCheckboxGroup extends Component<FormCheckboxGroupArgs>
32
34
  }
33
35
 
34
36
  if (
35
- (this.args.hasSubmitted || this.shouldShowErrorFeedback) &&
37
+ (this.args.showError ||
38
+ this.args.hasSubmitted ||
39
+ this.shouldShowErrorFeedback) &&
36
40
  this.args.errors &&
37
41
  this.args.errors.length > 0
38
42
  ) {
@@ -23,6 +23,8 @@ interface FormInputArgs {
23
23
  hasSubmitted?: boolean;
24
24
  /** If has errors */
25
25
  hasError?: boolean;
26
+ /** Force displaying errors */
27
+ showError?: boolean;
26
28
  /** A list of errors or a single text describing the error */
27
29
  errors?: string[] | string;
28
30
  /** CSS classes to be added in the container element */
@@ -52,7 +54,9 @@ export class FormInputBase extends Component<FormInputArgs> {
52
54
  }
53
55
 
54
56
  if (
55
- (this.args.hasSubmitted || this.shouldShowErrorFeedback) &&
57
+ (this.args.showError ||
58
+ this.args.hasSubmitted ||
59
+ this.shouldShowErrorFeedback) &&
56
60
  this.args.errors &&
57
61
  this.args.errors.length > 0
58
62
  ) {
@@ -12,6 +12,8 @@ interface FormRadioGroupArgs {
12
12
  hasSubmitted?: boolean;
13
13
  /** If has errors */
14
14
  hasError?: boolean;
15
+ /** Force displaying errors */
16
+ showError?: boolean;
15
17
  /** A list of errors or a single text describing the error */
16
18
  errors?: string[] | string;
17
19
  /** CSS classes to be added in the container element */
@@ -34,7 +36,9 @@ export default class FormRadioGroup extends Component<FormRadioGroupArgs> {
34
36
  }
35
37
 
36
38
  if (
37
- (this.args.hasSubmitted || this.shouldShowErrorFeedback) &&
39
+ (this.args.showError ||
40
+ this.args.hasSubmitted ||
41
+ this.shouldShowErrorFeedback) &&
38
42
  this.args.errors &&
39
43
  this.args.errors.length > 0
40
44
  ) {
@@ -1,7 +1,6 @@
1
1
  <FormField
2
2
  @size={{@size}}
3
- class={{use-frontile-class "form-select" @size class=@containerClass}}
4
- as |f|
3
+ class={{use-frontile-class "form-select" @size class=@containerClass}} as |f|
5
4
  >
6
5
  {{#if @label}}
7
6
  <f.Label
@@ -14,14 +13,16 @@
14
13
  {{/if}}
15
14
 
16
15
  {{#if @hint}}
17
- <f.Hint
18
- class={{use-frontile-class "form-select" @size part="hint"}}
19
- >
16
+ <f.Hint class={{use-frontile-class "form-select" @size part="hint"}}>
20
17
  {{@hint}}
21
18
  </f.Hint>
22
19
  {{/if}}
23
20
 
24
- {{#let (component (if @isMultiple "power-select-multiple" "power-select")) as |Component|}}
21
+ {{#let
22
+ (if
23
+ @isMultiple (component "power-select-multiple") (component "power-select")
24
+ ) as |Component|
25
+ }}
25
26
  <Component
26
27
  ...attributes
27
28
  @onChange={{this.handleChange}}
@@ -29,10 +30,16 @@
29
30
  @onBlur={{this.handleFocusOut}}
30
31
  @onOpen={{this.handleOpen}}
31
32
  @onClose={{this.handleClose}}
32
- @ariaDescribedBy="{{if @hint f.hintId}}{{if this.showErrorFeedback (concat " " f.feedbackId)}}{{if @ariaDescribedBy (concat " " @ariaDescribedBy)}}"
33
- @ariaLabelledBy="{{if @label f.id}}{{if @ariaLabelledBy (concat " "@ariaLabelledBy)}}"
33
+ @ariaDescribedBy="{{if @hint f.hintId}}{{
34
+ if this.showErrorFeedback (concat " " f.feedbackId)
35
+ }}{{if @ariaDescribedBy (concat " " @ariaDescribedBy)}}"
36
+ @ariaLabelledBy="{{if @label f.id}}{{
37
+ if @ariaLabelledBy (concat " " @ariaLabelledBy)
38
+ }}"
34
39
  @ariaInvalid={{if this.showErrorFeedback "true"}}
35
- @triggerClass="{{@triggerClass}} {{if @size (concat "ember-power-select-trigger-" @size)}} {{use-frontile-class "form-select" @size part="select"}}"
40
+ @triggerClass="{{@triggerClass}} {{
41
+ if @size (concat "ember-power-select-trigger-" @size)
42
+ }} {{use-frontile-class "form-select" @size part="select"}}"
36
43
  @highlightOnHover={{@highlightOnHover}}
37
44
  @placeholderComponent={{@placeholderComponent}}
38
45
  @searchMessage={{@searchMessage}}
@@ -79,8 +86,7 @@
79
86
  @optionsComponent={{@optionsComponent}}
80
87
  @extra={{@extra}}
81
88
  @groupComponent={{@groupComponent}}
82
- @afterOptionsComponent={{@afterOptionsComponent}}
83
- as |option term|
89
+ @afterOptionsComponent={{@afterOptionsComponent}} as |option term|
84
90
  >
85
91
  {{yield option term}}
86
92
  </Component>
@@ -92,4 +98,4 @@
92
98
  @errors={{@errors}}
93
99
  />
94
100
  {{/if}}
95
- </FormField>
101
+ </FormField>
@@ -16,6 +16,8 @@ interface FormSelectArgs extends PowerSelectArgs {
16
16
  hasSubmitted?: boolean;
17
17
  /** If has errors */
18
18
  hasError?: boolean;
19
+ /** Force displaying errors */
20
+ showError?: boolean;
19
21
  /** A list of errors or a single text describing the error */
20
22
  errors?: string[] | string;
21
23
  /** CSS classes to be added in the container element */
@@ -47,7 +49,9 @@ export default class FormSelect extends Component<FormSelectArgs> {
47
49
  }
48
50
 
49
51
  if (
50
- (this.args.hasSubmitted || this.shouldShowErrorFeedback) &&
52
+ (this.args.showError ||
53
+ this.args.hasSubmitted ||
54
+ this.shouldShowErrorFeedback) &&
51
55
  this.args.errors &&
52
56
  this.args.errors.length > 0
53
57
  ) {
@@ -8,6 +8,8 @@ interface FormCheckboxGroupArgs {
8
8
  hasSubmitted?: boolean;
9
9
  /** If has errors */
10
10
  hasError?: boolean;
11
+ /** Force displaying errors */
12
+ showError?: boolean;
11
13
  /** A list of errors or a single text describing the error */
12
14
  errors?: string[] | string;
13
15
  /** CSS classes to be added in the container element */
@@ -18,6 +18,8 @@ interface FormInputArgs {
18
18
  hasSubmitted?: boolean;
19
19
  /** If has errors */
20
20
  hasError?: boolean;
21
+ /** Force displaying errors */
22
+ showError?: boolean;
21
23
  /** A list of errors or a single text describing the error */
22
24
  errors?: string[] | string;
23
25
  /** CSS classes to be added in the container element */
@@ -9,6 +9,8 @@ interface FormRadioGroupArgs {
9
9
  hasSubmitted?: boolean;
10
10
  /** If has errors */
11
11
  hasError?: boolean;
12
+ /** Force displaying errors */
13
+ showError?: boolean;
12
14
  /** A list of errors or a single text describing the error */
13
15
  errors?: string[] | string;
14
16
  /** CSS classes to be added in the container element */
@@ -9,6 +9,8 @@ interface FormSelectArgs extends PowerSelectArgs {
9
9
  hasSubmitted?: boolean;
10
10
  /** If has errors */
11
11
  hasError?: boolean;
12
+ /** Force displaying errors */
13
+ showError?: boolean;
12
14
  /** A list of errors or a single text describing the error */
13
15
  errors?: string[] | string;
14
16
  /** CSS classes to be added in the container element */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontile/forms",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "Component Library for Ember Octane apps: Forms",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -22,49 +22,61 @@
22
22
  "postpack": "ember ts:clean"
23
23
  },
24
24
  "dependencies": {
25
- "@frontile/core": "^0.12.0",
26
- "@frontile/tailwindcss-plugin-helpers": "^0.12.0",
27
- "ember-cli-babel": "^7.26.6",
28
- "ember-cli-htmlbars": "^5.7.1",
29
- "ember-cli-typescript": "^4.1.0",
30
- "ember-power-select": "4.1.5",
31
- "ember-test-selectors": "^5.3.0",
25
+ "@frontile/core": "^0.13.0",
26
+ "@frontile/tailwindcss-plugin-helpers": "^0.13.0",
27
+ "ember-cli-babel": "^7.26.11",
28
+ "ember-cli-htmlbars": "^6.0.1",
29
+ "ember-cli-typescript": "^4.2.1",
30
+ "ember-power-select": "5.0.3",
31
+ "ember-test-selectors": "^6.0.0",
32
32
  "tailwindcss-ember-power-select": "^0.4.1"
33
33
  },
34
34
  "devDependencies": {
35
- "@babel/core": "^7.14.3",
35
+ "@babel/core": "^7.15.8",
36
36
  "@ember/optional-features": "^2.0.0",
37
- "@ember/test-helpers": "^2.2.5",
37
+ "@ember/test-helpers": "^2.6.0",
38
+ "@embroider/test-setup": "^1.0.0",
38
39
  "@glimmer/component": "^1.0.4",
39
40
  "@glimmer/tracking": "^1.0.4",
40
- "@types/ember": "^3.16.5",
41
- "@types/ember-qunit": "^3.4.13",
42
- "@types/ember-resolver": "^5.0.10",
43
- "@types/ember__test-helpers": "^2.0.0",
44
- "@types/qunit": "^2.11.1",
45
- "@types/rsvp": "^4.0.3",
46
- "autoprefixer": "^10.2.6",
41
+ "@types/ember-qunit": "^5.0.0",
42
+ "@types/ember-resolver": "^5.0.11",
43
+ "@types/ember__application": "^4.0.0",
44
+ "@types/ember__array": "^4.0.1",
45
+ "@types/ember__component": "^4.0.1",
46
+ "@types/ember__debug": "^4.0.0",
47
+ "@types/ember__error": "^4.0.0",
48
+ "@types/ember__object": "^4.0.0",
49
+ "@types/ember__routing": "^4.0.2",
50
+ "@types/ember__runloop": "^4.0.0",
51
+ "@types/ember__service": "^4.0.0",
52
+ "@types/ember__string": "^3.0.9",
53
+ "@types/ember__template": "^4.0.0",
54
+ "@types/ember__test": "^4.0.0",
55
+ "@types/ember__test-helpers": "^2.6.1",
56
+ "@types/htmlbars-inline-precompile": "^3.0.0",
57
+ "@types/qunit": "^2.11.3",
58
+ "@types/rsvp": "^4.0.4",
59
+ "autoprefixer": "^10.4.2",
47
60
  "broccoli-asset-rev": "^3.0.0",
48
- "ember-auto-import": "^2.0.1",
49
- "ember-cli": "3.26.1",
61
+ "ember-auto-import": "^2.4.0",
62
+ "ember-cli": "4.1.1",
50
63
  "ember-cli-dependency-checker": "^3.2.0",
51
- "ember-cli-inject-live-reload": "^2.0.1",
52
- "ember-cli-postcss": "^7.0.1",
64
+ "ember-cli-inject-live-reload": "^2.1.0",
65
+ "ember-cli-postcss": "^8.0.0",
53
66
  "ember-cli-typescript-blueprints": "^3.0.0",
54
67
  "ember-cli-uglify": "^3.0.0",
55
68
  "ember-disable-prototype-extensions": "^1.1.3",
56
69
  "ember-load-initializers": "^2.1.2",
57
- "ember-maybe-import-regenerator": "^0.1.6",
58
- "ember-qunit": "^5.1.4",
59
- "ember-resolver": "^8.0.2",
60
- "ember-source": "^3.27.2",
61
- "ember-try": "^1.4.0",
70
+ "ember-qunit": "^5.1.5",
71
+ "ember-resolver": "^8.0.3",
72
+ "ember-source": "^4.1.0",
73
+ "ember-try": "^2.0.0",
62
74
  "loader.js": "^4.7.0",
63
- "qunit": "^2.15.0",
64
- "qunit-dom": "^1.6.0",
65
- "tailwindcss": "^2.1.2",
66
- "typescript": "^4.3.2",
67
- "webpack": "^5.38.1"
75
+ "qunit": "^2.17.2",
76
+ "qunit-dom": "^2.0.0",
77
+ "tailwindcss": "^2.2.16",
78
+ "typescript": "^4.5.5",
79
+ "webpack": "^5.67.0"
68
80
  },
69
81
  "engines": {
70
82
  "node": ">= 10.*"
@@ -81,5 +93,5 @@
81
93
  "ember-power-select"
82
94
  ]
83
95
  },
84
- "gitHead": "574e455639ee67f4724c3b501dfcb88d7b8b4e1e"
96
+ "gitHead": "ad5dc7420f12b0cb0af4daa52cd51bf5bbc189be"
85
97
  }