svelte-formula
Advanced tools
Changelog
[0.12.0] - 2022-07-01
isFormValid
correctly (thanks @macmillen)Changelog
[0.11.0] - 2021-04-13
aria-role
on items that already have a role setChangelog
[0.10.0] - 2021-03-12
New data-formula-bind
attribute for elements - allows the event bindings to be customised. If used the default
bindings are not made (so they must be also passed) - more than one event type can be bound to by using the pipe (|
)
separator.
<!-- Use other browser event types to bind to -->
<input type='text' name='myValue' data-formula-bind='mouseover' />
<!-- Bind to more than one event type, such as including the original event -->
<input type='text' name='myValue' data-formula-bind='mouseover|keyup' />
<!-- You can also emit your own custom events via elements inside custom components -->
<input type='number' name='myValue' data-formula-bind='customEvent' bind:this='{el}' />
<button on:click|preventDefault='{()' => el.dispatchEvent(new Event('customEvent'))}>Click Me</button>
options.preChanges
method that is called when a change has been detected, but before any values are read or stores
updated
options.postChanges
method that is called after all changes have been made to the stores, with the most recent form
values (this is functionally the same as formValues.subscribe(values => {}))
)
options.formValidators
now correctly update isFormValid
after other validity checks have been carried out instead
of before<input type="hidden">
fields now supported, both single and multi-value. Formula can only set the value of this
field via default values and cannot set the value ( but for example it can be changed in something
like options.preChanges
) - hidden fields have no events, so these are a special case where the values are read with
each update.number
, date
, time
and week
now bind to both keyup
and change
handlers to handle both valid
input cases on these elementsExisting attribute data-beaker-key
has been renamed to data-formula-name
- this allows a custom name to be used
instead of the <input name="...">
value
Existing attributes data-beaker-form
and data-beaker-row
now correctly data-formula-form
and data-formula-row
All event handlers wrapped in a setTimeout(()=> {}, 0)
to defer an update until after DOM tick, this allows elements
to ensure value changes have completed before reading
Changelog
[0.9.3] - 2021-03-11
novalidate
it set on form and there is a submissionChangelog
[0.9.2] - 2021-03-09
MutationObserver
- reverted code back to using a check for all rows and re-create forms
each time as tracking changes becomes too complex. New code in place that handles subscription correctly to child
stores for each form instance within the group and better extraction of values. This also fixes infinite loop bug
caused by new code.bind:value
Changelog
[0.9.1] - 2021-03-08
Changelog
[0.9.0] - 2021-03-08
reset
method - instead to reset a group of form instances call group.init
with the initial data that was
used to create the group.defaultValues
as an array (group.init
will always override this)formValidity
in Beaker stores is now an arrayMutationRecord
added and removed nodes to be the reference to form instances when adding
and removing dataChangelog
[0.8.7] - 2021-02-23
data-in-group
attribute set which allows for better filtering of groups from form dataChangelog
[0.8.6] - 2021-02-23
0.8.5
, and fixed typo in 0.8.4