Skip to content

Commit b9878c6

Browse files
committed
[3.0.0] Move form state management to independent store
1 parent 7206d95 commit b9878c6

File tree

26 files changed

+2191
-899
lines changed

26 files changed

+2191
-899
lines changed

CHANGELOG.md

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
## 3.0.0
2+
3+
### Breaking changes
4+
5+
- `handleReset` callback now `handleCancel`, because personally I didn't use any reset button, but every time I have a `Cancel` button
6+
- Demo site now moved on from `Github Pages` to [`Netlify`](https://detools-vue-form.netlify.com)
7+
8+
### Updated
9+
10+
- `initialValues` now track changes via `watch` instead of `updated` callback
11+
- `SECRET_VUE_FORM_METHOD` moved to store at all
12+
13+
### Fixed
14+
15+
- `length` validator
16+
- `ArrayField`'s `move` method
17+
- On success form level sync validation (if exists) `syncErrors` no more cleared
18+
- On failed form level sync validation error messages now merge with existing errors
19+
- Field Level Sync Error messages [have high priority](https://github.com/detools/vue-form/pull/12/files#diff-cc347fc7d9ff2647f1b2670fce6f2d0cR134)
20+
- Validators now can react on any changes. See [**Dynamic Validators Form**](https://detools-vue-form.netlify.com/#/dynamic-validators-form)
21+
- All time when `vue-form` needs to validate some value — it uses actual validators
22+
- Values now validate on `reinitializeValues`
23+
24+
### Added
25+
26+
- Independent store to keep form state
27+
- [Tests for this store](https://github.com/detools/vue-form/pull/12/files#diff-c1514b4bdc660c0a5cf1c0155331e290)
28+
129
## 2.7.8
230

331
### Fixed
@@ -180,14 +208,14 @@ const renderAsComponent = {
180208
### Added
181209

182210
- [`FieldArray`](/VueForm/components/ConnectedFieldArray.js) control
183-
- [`Array Field Form`](https://detools.github.io/vue-form/#/array-field-form) to explain how `FieldArray` works
211+
- [`Array Field Form`](https://detools-vue-form.netlify.com/#/array-field-form) to explain how `FieldArray` works
184212

185213
## 2.4.2
186214

187215
### Updated
188216

189217
- `length` validator. Now it supports arrays
190-
- [`All Validations Form` demo](https://detools.github.io/vue-form/#/all-validations-form)
218+
- [`All Validations Form` demo](https://detools-vue-form.netlify.com/#/all-validations-form)
191219

192220
## 2.4.1
193221

@@ -210,7 +238,7 @@ const renderAsComponent = {
210238

211239
How to test:
212240

213-
1. Open [Inline Validators Form](https://detools.github.io/vue-form/#/inline-validators-form)
241+
1. Open [Inline Validators Form](https://detools-vue-form.netlify.com/#/inline-validators-form)
214242
2. Type `123456` => click `Submit`
215243
3. You will get an async error — form won't submit
216244
4. Type `github` => click `Submit`
@@ -220,7 +248,7 @@ How to test:
220248

221249
### Added
222250

223-
- Form level sync validation. [Demo](https://detools.github.io/vue-form/#/sync-validation-form)
251+
- Form level sync validation. [Demo](https://detools-vue-form.netlify.com/#/sync-validation-form)
224252

225253
## 2.2.0
226254

@@ -246,16 +274,20 @@ How to test:
246274
// Now
247275
import { Input, validators } from '@detools/vue-form'
248276

249-
<Input
250-
validators={[validators.isRequired()]}
251-
/>
277+
const After = {
278+
render() {
279+
return <Input validators={[validators.isRequired()]} />
280+
},
281+
}
252282

253283
// Before
254284
import { Input, validations } from '@detools/vue-form'
255285

256-
<Input
257-
validate={validations.validate([validations.isRequired()])}
258-
/>
286+
const Before = {
287+
render() {
288+
return <Input validate={validations.validate([validations.isRequired()])} />
289+
},
290+
}
259291
```
260292

261293
### Updated
@@ -291,7 +323,7 @@ import { Input, validations } from '@detools/vue-form'
291323
### Added:
292324

293325
- Support for immediate changes handler `handleModelChange`
294-
- Example for immediate changes form [`<ImmediateForm />`](https://detools.github.io/vue-form#immediate-form)
326+
- Example for immediate changes form [`<ImmediateForm />`](https://detools-vue-form.netlify.com#immediate-form)
295327

296328
### Changed:
297329

README.md

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default {
5959
## More Examples
6060

6161
See source in [example/src](/example/src) folder.
62-
See demo at [https://detools.github.io/vue-form](https://detools.github.io/vue-form)
62+
See demo at [https://detools-vue-form.netlify.com](https://detools-vue-form.netlify.com)
6363

6464
## Available Connected Components
6565

@@ -80,40 +80,6 @@ See demo at [https://detools.github.io/vue-form](https://detools.github.io/vue-f
8080

8181
## Changelog
8282

83-
- [2.7.8](/CHANGELOG.md#278)
84-
- [2.7.7](/CHANGELOG.md#277)
85-
- [2.7.6](/CHANGELOG.md#276)
86-
- [2.7.5](/CHANGELOG.md#275)
87-
- [2.7.4](/CHANGELOG.md#274)
88-
- [2.7.3](/CHANGELOG.md#273)
89-
- [2.7.2](/CHANGELOG.md#272)
90-
- [2.7.1](/CHANGELOG.md#271)
91-
- [2.7.0](/CHANGELOG.md#270)
92-
- [2.6.1](/CHANGELOG.md#261)
93-
- [2.6.0](/CHANGELOG.md#260)
94-
- [2.5.11](/CHANGELOG.md#2511)
95-
- [2.5.10](/CHANGELOG.md#2510)
96-
- [2.5.9](/CHANGELOG.md#259)
97-
- [2.5.8](/CHANGELOG.md#258)
98-
- [2.5.7](/CHANGELOG.md#257)
99-
- [2.5.6](/CHANGELOG.md#256)
100-
- [2.5.5](/CHANGELOG.md#255)
101-
- [2.5.4](/CHANGELOG.md#254)
102-
- [2.5.3](/CHANGELOG.md#253)
103-
- [2.5.2](/CHANGELOG.md#252)
104-
- [2.5.1](/CHANGELOG.md#251)
105-
- [2.5.0](/CHANGELOG.md#250)
106-
- [2.4.2](/CHANGELOG.md#242)
107-
- [2.4.1](/CHANGELOG.md#241)
108-
- [2.4.0](/CHANGELOG.md#240)
109-
- [2.3.1](/CHANGELOG.md#231)
110-
- [2.3.0](/CHANGELOG.md#230)
111-
- [2.2.0](/CHANGELOG.md#220)
112-
- [2.1.0](/CHANGELOG.md#210)
113-
- [2.0.0](/CHANGELOG.md#200)
114-
- [1.5.0](/CHANGELOG.md#150)
115-
- [1.4.4](/CHANGELOG.md#144)
116-
- [1.4.3](/CHANGELOG.md#143)
117-
- [1.4.2](/CHANGELOG.md#142)
118-
- [1.4.1](/CHANGELOG.md#141)
119-
- [1.4.0](/CHANGELOG.md#140)
83+
- [3.0.0](/CHANGELOG.md#300)
84+
- [2.x.x](/CHANGELOG.md#278)
85+
- [1.x.x](/CHANGELOG.md#150)

VueForm/components/ConnectedArrayField.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export default {
9999
const nextArray = [
100100
...arrayWithout.slice(0, toIndex),
101101
elementToMove,
102-
...arrayWithout.slice(toIndex + 1),
102+
...arrayWithout.slice(toIndex),
103103
]
104104

105105
this.setValue(nextArray)

0 commit comments

Comments
 (0)