@frontile/changeset-form 0.13.1 → 0.14.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.
@@ -3,21 +3,53 @@
3
3
  {{on "submit" (fn this.handleSubmit @changeset)}}
4
4
  {{on "reset" (fn this.handleReset @changeset)}}
5
5
  >
6
- <ChangesetForm::Context @changeset={{@changeset}} as |Form|>
7
- {{yield
8
- (hash
9
- Input=(component Form.Input hasSubmitted=this.hasSubmitted showError=@alwaysShowErrors)
10
- Textarea=(component Form.Textarea hasSubmitted=this.hasSubmitted showError=@alwaysShowErrors)
11
- Select=(component Form.Select hasSubmitted=this.hasSubmitted showError=@alwaysShowErrors)
12
- Checkbox=(component Form.Checkbox hasSubmitted=this.hasSubmitted showError=@alwaysShowErrors)
13
- CheckboxGroup=(component
14
- Form.CheckboxGroup hasSubmitted=this.hasSubmitted showError=@alwaysShowErrors
15
- )
16
- Radio=(component Form.Radio hasSubmitted=this.hasSubmitted showError=@alwaysShowErrors)
17
- RadioGroup=(component Form.RadioGroup hasSubmitted=this.hasSubmitted showError=@alwaysShowErrors)
6
+
7
+ {{yield
8
+ (hash
9
+ Input=(component
10
+ "changeset-form/fields/input"
11
+ changeset=@changeset
12
+ hasSubmitted=this.hasSubmitted
13
+ showError=@alwaysShowErrors
18
14
  )
19
- @changeset
20
- (hash hasSubmitted=this.hasSubmitted)
21
- }}
22
- </ChangesetForm::Context>
15
+ Textarea=(component
16
+ "changeset-form/fields/textarea"
17
+ changeset=@changeset
18
+ hasSubmitted=this.hasSubmitted
19
+ showError=@alwaysShowErrors
20
+ )
21
+ Select=(component
22
+ "changeset-form/fields/select"
23
+ changeset=@changeset
24
+ hasSubmitted=this.hasSubmitted
25
+ showError=@alwaysShowErrors
26
+ )
27
+ Checkbox=(component
28
+ "changeset-form/fields/checkbox"
29
+ changeset=@changeset
30
+ hasSubmitted=this.hasSubmitted
31
+ showError=@alwaysShowErrors
32
+ )
33
+ CheckboxGroup=(component
34
+ "changeset-form/fields/checkbox-group"
35
+ changeset=@changeset
36
+ hasSubmitted=this.hasSubmitted
37
+ showError=@alwaysShowErrors
38
+ )
39
+ Radio=(component
40
+ "changeset-form/fields/radio"
41
+ changeset=@changeset
42
+ hasSubmitted=this.hasSubmitted
43
+ showError=@alwaysShowErrors
44
+ )
45
+ RadioGroup=(component
46
+ "changeset-form/fields/radio-group"
47
+ changeset=@changeset
48
+ hasSubmitted=this.hasSubmitted
49
+ showError=@alwaysShowErrors
50
+ )
51
+ state=(hash hasSubmitted=this.hasSubmitted)
52
+ )
53
+ }}
54
+
23
55
  </form>
@@ -7,79 +7,81 @@ order: 1
7
7
  This shows how to have a complete form using `ChangesetForm`.
8
8
 
9
9
  ```hbs template
10
- <ChangesetForm @changeset={{changeset this.model this.validations}} as |Form changeset|>
11
- <Form.Input
12
- @label="First Name"
13
- @fieldName="firstName"
14
- placeholder="What is your first name?"
15
- />
16
- <Form.Input
17
- @label="Last Name"
18
- @fieldName="lastName"
19
- @containerClass="mt-4"
20
- placeholder="What is your family name?"
21
- />
22
- <Form.Input
23
- @label="Email Address"
24
- @fieldName="email"
25
- type="email"
26
- @containerClass="mt-4"
27
- />
28
- <Form.Textarea
29
- @label="Comments"
30
- @fieldName="comments"
31
- @containerClass="mt-4"
32
- />
33
- <Form.Select
34
- @label="Countries"
35
- @fieldName="countries"
36
- @isMultiple={{true}}
37
- @options={{this.countries}}
38
- @allowClear={{true}}
39
- @containerClass="mt-4" as |option|
40
- >
41
- {{option}}
42
- </Form.Select>
43
- <Form.CheckboxGroup
44
- @groupName="coreValues"
45
- @label="Core Values"
46
- @containerClass="mt-4" as |Checkbox|
47
- >
48
- <Checkbox @label="Hungry" @fieldName="hungry" />
49
- <Checkbox @label="Humble" @fieldName="humble" />
50
- <Checkbox @label="Curious" @fieldName="curious" />
51
- </Form.CheckboxGroup>
52
- <Form.RadioGroup
53
- @label="Favorite Meal"
54
- @containerClass="mt-4"
55
- @fieldName="favoriteMeal" as |Radio|
56
- >
57
- <Radio @label="Breakfast" @value="breakfast" />
58
- <Radio @label="Lunch" @value="lunch" />
59
- <Radio @label="Dinner" @value="dinner" />
60
- </Form.RadioGroup>
61
- <Button
62
- @type="submit"
63
- @intent="primary"
64
- disabled={{changeset.isInvalid}}
65
- class="mt-4"
66
- >
67
- Save
68
- </Button>
69
- <Button
70
- @type="reset"
71
- @appearance="outlined"
72
- >
73
- Reset
74
- </Button>
75
- <div class="mt-4">
76
- <code>
77
- <p>isPristine: {{changeset.isPristine}}</p>
78
- <p>isValid: {{changeset.isValid}}</p>
79
- <p>isInvalid: {{changeset.isInvalid}}</p>
80
- </code>
81
- </div>
82
- </ChangesetForm>
10
+ {{#let (changeset this.model this.validations) as |changeset|}}
11
+ <ChangesetForm @changeset={{changeset}} as |Form|>
12
+ <Form.Input
13
+ @label='First Name'
14
+ @fieldName='firstName'
15
+ placeholder='What is your first name?'
16
+ />
17
+ <Form.Input
18
+ @label='Last Name'
19
+ @fieldName='lastName'
20
+ @containerClass='mt-4'
21
+ placeholder='What is your family name?'
22
+ />
23
+ <Form.Input
24
+ @label='Email Address'
25
+ @fieldName='email'
26
+ type='email'
27
+ @containerClass='mt-4'
28
+ />
29
+ <Form.Textarea
30
+ @label='Comments'
31
+ @fieldName='comments'
32
+ @containerClass='mt-4'
33
+ />
34
+ <Form.Select
35
+ @label='Countries'
36
+ @fieldName='countries'
37
+ @isMultiple={{true}}
38
+ @options={{this.countries}}
39
+ @allowClear={{true}}
40
+ @containerClass='mt-4'
41
+ as |option|
42
+ >
43
+ {{option}}
44
+ </Form.Select>
45
+ <Form.CheckboxGroup
46
+ @groupName='coreValues'
47
+ @label='Core Values'
48
+ @containerClass='mt-4'
49
+ as |Checkbox|
50
+ >
51
+ <Checkbox @label='Hungry' @fieldName='hungry' />
52
+ <Checkbox @label='Humble' @fieldName='humble' />
53
+ <Checkbox @label='Curious' @fieldName='curious' />
54
+ </Form.CheckboxGroup>
55
+ <Form.RadioGroup
56
+ @label='Favorite Meal'
57
+ @containerClass='mt-4'
58
+ @fieldName='favoriteMeal'
59
+ as |Radio|
60
+ >
61
+ <Radio @label='Breakfast' @value='breakfast' />
62
+ <Radio @label='Lunch' @value='lunch' />
63
+ <Radio @label='Dinner' @value='dinner' />
64
+ </Form.RadioGroup>
65
+ <Button
66
+ @type='submit'
67
+ @intent='primary'
68
+ disabled={{changeset.isInvalid}}
69
+ class='mt-4'
70
+ >
71
+ Save
72
+ </Button>
73
+ <Button @type='reset' @appearance='outlined'>
74
+ Reset
75
+ </Button>
76
+ <div class='mt-4'>
77
+ <code>
78
+ <p>isPristine: {{changeset.isPristine}}</p>
79
+ <p>isValid: {{changeset.isValid}}</p>
80
+ <p>isInvalid: {{changeset.isInvalid}}</p>
81
+ </code>
82
+ </div>
83
+ </ChangesetForm>
84
+ {{/let}}
83
85
  ```
84
86
 
85
87
  ```ts component
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontile/changeset-form",
3
- "version": "0.13.1",
3
+ "version": "0.14.0",
4
4
  "description": "Component Library for Ember Octane apps: ChangesetForm",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -22,30 +22,30 @@
22
22
  "postpack": "ember ts:clean"
23
23
  },
24
24
  "dependencies": {
25
- "@frontile/forms": "^0.13.1",
26
- "ember-changeset": "^3.15.0",
27
- "ember-changeset-validations": "^3.16.0",
25
+ "@frontile/forms": "^0.14.0",
26
+ "ember-changeset": "^4.0.0",
27
+ "ember-changeset-validations": "^4.0.0",
28
28
  "ember-cli-babel": "^7.26.11",
29
29
  "ember-cli-htmlbars": "^6.0.1",
30
- "ember-cli-typescript": "^4.2.1"
30
+ "ember-cli-typescript": "^5.0.0"
31
31
  },
32
32
  "devDependencies": {
33
- "@babel/core": "^7.15.8",
33
+ "@babel/core": "^7.17.8",
34
34
  "@ember/optional-features": "^2.0.0",
35
35
  "@ember/test-helpers": "^2.6.0",
36
- "@embroider/test-setup": "^1.0.0",
37
- "@frontile/core": "^0.13.1",
36
+ "@embroider/test-setup": "^1.5.0",
37
+ "@frontile/core": "^0.14.0",
38
38
  "@glimmer/component": "^1.0.4",
39
39
  "@glimmer/tracking": "^1.0.4",
40
40
  "@types/ember-qunit": "^5.0.0",
41
41
  "@types/ember-resolver": "^5.0.11",
42
42
  "@types/ember__application": "^4.0.0",
43
43
  "@types/ember__array": "^4.0.1",
44
- "@types/ember__component": "^4.0.2",
45
- "@types/ember__debug": "^4.0.0",
44
+ "@types/ember__component": "^4.0.4",
45
+ "@types/ember__debug": "^4.0.1",
46
46
  "@types/ember__error": "^4.0.0",
47
- "@types/ember__object": "^4.0.0",
48
- "@types/ember__routing": "^4.0.2",
47
+ "@types/ember__object": "^4.0.1",
48
+ "@types/ember__routing": "^4.0.4",
49
49
  "@types/ember__runloop": "^4.0.0",
50
50
  "@types/ember__service": "^4.0.0",
51
51
  "@types/ember__string": "^3.0.9",
@@ -55,27 +55,25 @@
55
55
  "@types/htmlbars-inline-precompile": "^3.0.0",
56
56
  "@types/qunit": "^2.11.3",
57
57
  "@types/rsvp": "^4.0.4",
58
- "autoprefixer": "^10.4.2",
59
58
  "broccoli-asset-rev": "^3.0.0",
60
- "ember-auto-import": "^2.4.0",
61
- "ember-cli": "~4.1.1",
59
+ "ember-auto-import": "^2.4.1",
60
+ "ember-cli": "^4.2.0",
62
61
  "ember-cli-dependency-checker": "^3.2.0",
63
62
  "ember-cli-inject-live-reload": "^2.1.0",
64
- "ember-cli-postcss": "^8.0.0",
65
63
  "ember-cli-typescript-blueprints": "^3.0.0",
66
64
  "ember-cli-uglify": "^3.0.0",
67
65
  "ember-disable-prototype-extensions": "^1.1.3",
68
66
  "ember-load-initializers": "^2.1.2",
69
67
  "ember-qunit": "^5.1.5",
70
68
  "ember-resolver": "^8.0.3",
71
- "ember-source": "~4.1.0",
69
+ "ember-source": "^4.3.0",
72
70
  "ember-try": "^2.0.0",
73
71
  "loader.js": "^4.7.0",
74
- "qunit": "^2.17.2",
72
+ "qunit": "^2.18.0",
75
73
  "qunit-dom": "^2.0.0",
76
- "tailwindcss": "^2.2.16",
77
- "typescript": "^4.5.5",
78
- "webpack": "^5.67.0"
74
+ "tailwindcss": "^3.0.23",
75
+ "typescript": "^4.6.2",
76
+ "webpack": "^5.70.0"
79
77
  },
80
78
  "engines": {
81
79
  "node": ">= 10.*"
@@ -89,5 +87,5 @@
89
87
  "ember-addon": {
90
88
  "configPath": "tests/dummy/config"
91
89
  },
92
- "gitHead": "ce67c17c6426abd0df9dfb2acfeb95f3ab63bbf4"
90
+ "gitHead": "d6e03521904b6e523018a74f85c2fe3bce34b4f9"
93
91
  }
@@ -0,0 +1,3 @@
1
+ import Config from 'dummy/config/environment';
2
+
3
+ export default Config;
@@ -1,15 +0,0 @@
1
- {{yield
2
- (hash
3
- Input=(component "changeset-form/fields/input" changeset=@changeset)
4
- Textarea=(component "changeset-form/fields/textarea" changeset=@changeset)
5
- Select=(component "changeset-form/fields/select" changeset=@changeset)
6
- Checkbox=(component "changeset-form/fields/checkbox" changeset=@changeset)
7
- CheckboxGroup=(component
8
- "changeset-form/fields/checkbox-group" changeset=@changeset
9
- )
10
- Radio=(component "changeset-form/fields/radio" changeset=@changeset)
11
- RadioGroup=(component
12
- "changeset-form/fields/radio-group" changeset=@changeset
13
- )
14
- )
15
- }}
@@ -1 +0,0 @@
1
- export { default } from '@frontile/changeset-form/components/changeset-form/context';