- Added missing
format
property to<TimePicker />
. Updated deps
- Added check for promise for
handleChange
to setsuffixIcon
internally
- Added
suffixIcon
prop to<Select />
passed to<Input />
internally
- Now
uiUpload
instead of$uiUpload
is used for submit method internally for<Upload />
- Now
$refs
instead ofrefs
is used for submit method internally for<Upload />
<Input />
,<Select />
,<Form />
propautocomplete
changed tooff
instead ofnew-password
. https://stackoverflow.com/a/16130452
- Default
Notification
duration changed to 10s (you can change it by passing it manually)
- Method
remove
in ArrayField
- Now all
name/id
html attributes arecamelCased
to avoid errors with difficult selectors
isRequired
validator to handlefalse
values if needed
- Handle nil
Plain Object
value onreinitialize
same as nilArray
- Added test to handle both cases
isRequired
validator to not pass empty string with spaces
- Flag
performAllChecksOnSave
to perform all checks on save
- Pass
form state
to scopedSlot
word-break
property to Notification message
- Two props to
isEditDisabled
,isRemoveDisabled
for a FileList
- Pass
isConfirmSubmit
parameter tosubmitHandler
- Ability to pass a title to Notification
- Wrap
handleRemove
into Promise to handle sync remove handler the same way as async
- Pass
handleRemoveFile
to customFileList
inside<Upload />
only whenhandleRemove
has passed
white-space: pre
styles to<Popover />
changed topre-line
- Loading state for save button
white-space: pre
styles to Confirmation<Popover />
- Prop
allowSubmitPristineForm
to submit a pristine form
- Prop
normalize
to normalize value before set to store - See example at Basic Form — Fill Username, Password, click Enter
- Find an Object with values at
user
property
- Ability to not watch
initialValues
by passingdoNotWatchInitialValues
prop
url
validator. Too much cost in the vendor bundle
- Now
handleFocusToInvalidField
search in particular form to focus field
- Sometimes you need to show confirmation popover only when you get a response from server
- Now you can do it by passing
confirmHandler
property among existing confirm popover properties - Just pass your async callback and return from it boolean value
true
will indicatevue-form
that popover needs to be visible
- Do not submit pristine form
- Store now is not disabled when
isPristine
. Just submit button whensave
is not available
- Do not disable submit button when save is available while form is pristine
- Removed bottom margin for form buttons when position equals
label
- Sometimes store flag
isDisabled
returned0
instead offalse
- Apply
allButtonsDisabled
to internalCancel/Save
buttons
- scopedSlot prop
isDirty
=>dirty
- NoFieldsForm no more blocked by
pristine
state - Update internal value for
allButtonsDisabled
Dirty
state to every form control- Show error only for
touched + dirty
controls - Added
dirty
state to form at store - Pass isDirty to
scopedSlot
- Don't do anything on
pristine
state (!dirty
)
- Pass
submitting
state toscopedSlot
- Ability to render form content inside scopedSlot
- If you're using this approach you can use available options passed to scopedSlot:
- allButtonsDisabled — Boolean
- isSubmitButtonDisabled — Boolean
- submitButtonClassName — String
- handleSubmit — Function
- handleCancel — Function
- Demo — Scoped Slots Form
<Button />
component now not just a plainelement-ui
<Button />
- Now it's my own implementation from main project that I'm working on
- It automatically handles promises inside
on-click
callback - But you should explicitly
return
this promise from handler - Button will have a spinner until promise fullfilled
- zIndex for fixed buttons container
- zIndex for fixed buttons container
- Now submit button will be disabled if some form level validations are failed
- Dependencies
DatePicker
value format fromM/d/yyyy
toyyyy-MM-dd
- Second type for
trueLabel
andfalseLabel
— Number
<DatePicker />
doesn't supporton-clear
by default — fixed.
- Support for
handleClear
method for<DatePicker />
,<Input />
,<Select />
,<TimePicker />
- Prop Type for
reserveKeyword
on<Select />
- Removed unnecessary
console.log
- Support for
<OptionGroup />
for<Select />
component - You need to pass an object contains properties
groupLabel
andoptions
to generate<OptionGroup />
- prop
required
as 5th argument torenderComponent
method
- Do not pass
valueKey
prop to<UISelect />
<VueFormItem />
component as lite copy of<FormItem />
- Initial solution to use
vue-form
without<Form />
wrapper
- Array fields of initial values now doing deepClone instead a reference
- Array fields of initial values now doing deepClone instead a reference
- Ability to pass
disabled
prop to<Select />
<Option />
- Validation on register for existing value in store
- Removed
<Autocomplete />
component <ArrayField />
components' parts are doingsetValue
andaddFormField
on register
- Disable fields during async validations
- Move call of
asyncValidators
toon-change
event for<Select />
instead ofon-blur
.on-blur
emits before change
disabled
property. Now you can pass an object withid
andmessage
fields to showmessage
as<Notification />
and scroll to element byid
omitFormItemLabel
now is aprop
for<Checkbox />
and<Radio />
- Call
handleModelChange
andv-model
update onreset
createCleanFormValue
now uses internally methodremoveFormField
- User offsetTop of offsetParent to scroll to element on error
- Pass the name of the
<Upload />
to<FileList />
- Export of
VueFormPlugin
- Export of
VueFormPlugin
- Support for
VueFormPlugin
- Just use it like any other plugin:
import Vue from 'vue'
import { VueFormPlugin } from '@detools/vue-form'
// `size` is the only available option for now
Vue.use(VueFormPlugin, { size: 'small' })
- Preserve white space in the
<Notification />
- Support for prop
keepValueOnRemove
on<Form />
- If you will use this prop — value of any control won't be cleared on remove
- Check correct mangled validator name for
isRequired
- Check correct mangled validator name for
isRequired
- Support for
handleRowClick
prop for<FileList />
inside<Upload />
- Support for
required
prop for every form control - You can pass
required={null}
if you do not want to show asterisk
- Support for
required
prop for<FormItem />
- Now
isRequired
validator will add an element-ui asterisk for required fields
valueKey
andlabelKey
can be functions that accept option as argument
- Check if field is a part of Array by regexp
- Check response before setValue on success
<Upload />
- Unsubscribe from
validateOnReinitialize
if form control is hidden
- Support to pass a component as File List to
<Upload />
- Support to pass a component as File List to
<Upload />
- Support to render custom File List under
<Upload />
- Do not
setTouched
on change<Upload />
- Do not change uid of every file inside render
<Upload />
control did not remove itemsonRemove
- Smooth
HTMLElement.scrollIntoView()
does not work in Chrome
- Replace
HTMLElement.focus()
withHTMLElement.scrollIntoView()
- Use
file.id
asfile.uid
if it exists to keep initialValues of form withUpload
controls consistent
<Autocomplete />
,<Input />
,<Select />
propautocomplete
changed tonew-password
instead ofoff
. https://stackoverflow.com/a/50927328/1671555
onChange
event for<RadioGroup />
- Return state value for an
Array
field instead of emptyArray
- Pass
label
prop from<ArrayField />
to child
- Pass
setValue
prop from<ArrayField />
to child
- In 3.6.14 I have removed default value (0) for prop
value
- Now I have added a separate prop
defaultValue
- You can use this field in cases where user has removed any value from field, but this field does not support empty value (for example it can be
0
)
- Pass
null
onsubmit
when value of control becameundefined
<DatePicker />
propeditable
istrue
by default
- Removed
handleModelChange
prop - Now just pass value to v-model that you've used inside
handleModelChange
- On
Select
eventonBlur
emits the same time asonChange
it produces an error state for required fields for 1 second - Now
onBlur
event onSelect
does not set control astouched
- Pass mixin-level callback
handleFieldChange
to controls
- Defaut
precision
prop for<InputNumber />
set to0
- Defaut
step
prop for<InputNumber />
set to1
- Prefer only String
placeholder
prop for<InputNumber />
<InputNumber />
does not have default0
value.- Instead if this, now you can pass a
placeholder
prop (default is0
)
pickerOptions
prop for<DatePicker />
is anObject
- Do not merge arrays inside
values
on submit
- Imports inside
<Popover />
to Element UI
- Every import of Element UI component now absolute path to module inside
lib
- Check
error
field insideError
on failed submission
- Default internal value for
<Upload />
is anArray
- Default format for
<DatePicker />
isM/d/yyyy
- Default value format for
<Timepicker />
isHH:mm:ss
- Replace
<TimeSelect />
with<TimePicker />
<Timepicker />
proppickerOptions
.Array
=>Object
- Scroll to first invalid field on try to submit
- Pass
statusIcon
prop to<Form />
.true
by default
- Pass
disabled
state torenderExtraButtons
- Ability to pass
disabled
attribute asString
message about error that exists outside form and does not accept us to submit form
- Do not show any errors on Save
- Ability to add extra buttons between Cancel and Save
- Destroy store on
<Form />
destroy
Phone
andisNumber
validators
Phone
validator
Phone
validator
- Simple
Phone
validator — like isNumber, but withlength
property length
equals 10 by default (US)
<Select />
component propdefault-first-option
now depends onremote
orconfigurable
- If these props are
true
thendefault-first-option
istrue
.
<Upload />
correctly handle file remove
- Now confirm button in
Popover
autofocused pragrammaticaly
- Validators
isNumber
,url
no more check if value is defined
- Added
url
validator, based onuri-js
- Back
<br />
between message and buttons
- Confirm button in
Popover
now hasautoFocus
when rendered
confirmNo
,confirmYes
,confirmWidth
,confirmPlacement
,confirmTrigger
props to<Form />
- Do not transform to
String
null or undefined<Autocomplete />
value
- Margin for wrapped submit button
- Confirmation
<Popover />
- Submit button has been wrapped with it
- Passed value to UIAutocomplete converted to
String
- import for
isNumber
validator
isNumber
validator
zIndex
property for sticky buttons
- Support for prop
buttonsSticky
— Boolean
- Support for prop
buttonsClassName
— String - Support for prop
buttonsStyles
— [Object, Array]
- Support for nested fields
options
prop for autocomplete
- Flag that indicates about "is field part of "
reset
property renamed tocancel
handleReset
callback nowhandleCancel
, because personally I didn't use any reset button, but every time I have aCancel
button- Demo site now moved on from
Github Pages
toNetlify
initialValues
now track changes viawatch
instead ofupdated
callbackSECRET_VUE_FORM_METHOD
moved to store at all
length
validatorArrayField
'smove
method- On success form level sync validation (if exists)
syncErrors
no more cleared - On failed form level sync validation error messages now merge with existing errors
- Field Level Sync Error messages have high priority
- Validators now can react on any changes. See Dynamic Validators Form
- All time when
vue-form
needs to validate some value — it uses actual validators - Values now validate on
reinitializeValues
- Independent store to keep form state
- Tests for this store
- Do deep equal of
initialValues
vialodash.isEqual
onupdated
vue-form
now passes itself initial value to every component- User no need to define
fileList
if he passedinitalValues
toForm
- Pass
fileList
prop asfile-list
prop to<Upload />
- Can't use value for now as
file-list
prop
- Pass
<Upload />
value asfile-list
prop to UI component - Add default noop value for
handleModelChange
- Call
handleModelChange
onreinitialize
<Button />
component fromelement-ui
, just for convenience
- When form field has removed from form — it value won't be passed to submit
- Added
append
,prepend
props to<Input />
- Merge values for submit instead of destructuring
<Upload />
control
- Check
<Autocomplete />
initial value. If it's string — use it. If there is a default value for this control — use it.
<Autocomplete />
control
- Omit Boolean type from
label
prop<FormItem />
- Do not pass
label
prop to<Checkbox />
- Do not pass
label
prop to<Input />
and<InputNumber />
label
prop now accepts[String, Boolean]
- Every unrecognized props applied to
ArrayField
passed torenderField
asextra
prop
ArrayField
now also supportsFormItem
Props- If you want to pass an empty label to a Control due to
element-ui
limitations — now you can. It won't be aname
prop anymore. - But if you will pass a
label
that meanslabel={true}
you will get a labelstartCase(name)
marginTop
for buttons container
renderComponent
now acceptscreateElement
as 3rd argument
renderField
now supports not only a function as prop value, also it supports any Component- A Component will get
{ data, fields, name }
options, wheredata
is an Array,fields
is an Object with methods to manipulate that Array,name
is a String passed as aname
toArrayField
component
import Form, { ArrayField } from '@detools/vue-form'
import Tasklist from '@/components/Tasklist'
// OK
const renderAsFunction = {
render() {
methods: {
renderTasklist({ data, fields, name }) {
return <Tasklist data={data} fields={fields} name={name} />
},
},
return (
<Form>
<ArrayField name="tasklist" renderField={this.renderTasklist} />
</Form>
)
}
}
// NOW OK
const renderAsComponent = {
render() {
return (
<Form>
<ArrayField name="tasklist" renderField={Tasklist} />
</Form>
)
}
}
- Reinitialization for all values types except Array
- Reinitialization for Array values
- Rename
ConnectedCheckboxGroupMixin
=>ConnectedArrayFieldMixin
- Use
ConnectedArrayFieldMixin
forConnectedArrayField
,ConnectedCheckboxGroup
ArrayField
controlArray Field Form
to explain howArrayField
works
length
validator. Now it supports arraysAll Validations Form
demo
- Internal
manageTouchedFieldsState
method - Passing touched state from vue-form to control
- Common methods were moved to
ConnectedControlMixin
- Form submission when async validation in progress
How to test:
- Open Inline Validators Form
- Type
123456
=> clickSubmit
- You will get an async error — form won't submit
- Type
github
=> clickSubmit
- Form will be submitted after async form validation
- Form level sync validation. Demo
asyncValidators
will be called only onblur
event- As before, they will be called only if there is no sync errors
asyncValidators
property to every Form Control- They will validate only if there is no sync errors or sync validators
- Every Form Control now accepts
validators
—Array prop instead ofvalidate
// Now
import { Input, validators } from '@detools/vue-form'
const After = {
render() {
return <Input validators={[validators.isRequired()]} />
},
}
// Before
import { Input, validations } from '@detools/vue-form'
const Before = {
render() {
return <Input validate={validations.validate([validations.isRequired()])} />
},
}
isRequired
validator now supports Arrays, Objects.
<Notification />
component to show notifications on success/error
isRequired
validator
<Form />
has attribute novalidate by default
buttonsPosition
prop validator for<Form />
- Support for immediate changes handler
handleModelChange
- Example for immediate changes form
<ImmediateForm />
- Example
<AsyncValidationForm />
renamed to<AsyncSubmitForm />
- Support for integrated FormItem for all components via
formItem
prop <RadioGroup />
<CheckboxGroup />