@helpwave/hightide 0.6.10 → 0.6.11
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.
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7451,7 +7451,7 @@ var FormStore = class {
|
|
|
7451
7451
|
return this.values[key];
|
|
7452
7452
|
}
|
|
7453
7453
|
getAllValues() {
|
|
7454
|
-
return
|
|
7454
|
+
return this.values;
|
|
7455
7455
|
}
|
|
7456
7456
|
setValue(key, value, triggerUpdate = false) {
|
|
7457
7457
|
if (this.values[key] !== value) {
|
|
@@ -7478,7 +7478,7 @@ var FormStore = class {
|
|
|
7478
7478
|
type: "onUpdate",
|
|
7479
7479
|
key: "ALL",
|
|
7480
7480
|
updatedKeys: Object.keys(values),
|
|
7481
|
-
update:
|
|
7481
|
+
update: values,
|
|
7482
7482
|
values: this.values,
|
|
7483
7483
|
hasErrors: this.getHasError(),
|
|
7484
7484
|
errors: this.getErrors()
|
|
@@ -7490,19 +7490,19 @@ var FormStore = class {
|
|
|
7490
7490
|
return !!this.touched[key];
|
|
7491
7491
|
}
|
|
7492
7492
|
getAllTouched() {
|
|
7493
|
-
return
|
|
7493
|
+
return this.touched;
|
|
7494
7494
|
}
|
|
7495
7495
|
setTouched(key, isTouched = true) {
|
|
7496
7496
|
if (this.touched[key] === isTouched) return;
|
|
7497
7497
|
this.touched[key] = isTouched;
|
|
7498
|
-
this.notify({ type: "onTouched", key, value: this.values[key], values:
|
|
7498
|
+
this.notify({ type: "onTouched", key, value: this.values[key], values: this.values });
|
|
7499
7499
|
}
|
|
7500
7500
|
// Error and Validation
|
|
7501
7501
|
getHasError() {
|
|
7502
7502
|
return Object.values(this.errors).some((value) => value !== void 0 && value !== null);
|
|
7503
7503
|
}
|
|
7504
7504
|
getErrors() {
|
|
7505
|
-
return
|
|
7505
|
+
return this.errors;
|
|
7506
7506
|
}
|
|
7507
7507
|
getError(key) {
|
|
7508
7508
|
return this.errors[key];
|
|
@@ -7514,7 +7514,7 @@ var FormStore = class {
|
|
|
7514
7514
|
} else {
|
|
7515
7515
|
this.errors[key] = error;
|
|
7516
7516
|
}
|
|
7517
|
-
this.notify({ type: "onError", key, value: this.values[key], error, values:
|
|
7517
|
+
this.notify({ type: "onError", key, value: this.values[key], error, values: this.values });
|
|
7518
7518
|
}
|
|
7519
7519
|
getHasTriedSubmitting() {
|
|
7520
7520
|
return this.hasTriedSubmitting;
|
|
@@ -7570,8 +7570,8 @@ var FormStore = class {
|
|
|
7570
7570
|
type: "onSubmit",
|
|
7571
7571
|
key: "ALL",
|
|
7572
7572
|
hasErrors,
|
|
7573
|
-
errors:
|
|
7574
|
-
values:
|
|
7573
|
+
errors: this.errors,
|
|
7574
|
+
values: this.values
|
|
7575
7575
|
});
|
|
7576
7576
|
}
|
|
7577
7577
|
reset() {
|
|
@@ -7579,10 +7579,10 @@ var FormStore = class {
|
|
|
7579
7579
|
this.hasTriedSubmitting = false;
|
|
7580
7580
|
this.touched = {};
|
|
7581
7581
|
Object.keys(this.initialValues).forEach((key) => {
|
|
7582
|
-
this.notify({ type: "onChange", key, value: this.values[key], values:
|
|
7582
|
+
this.notify({ type: "onChange", key, value: this.values[key], values: this.values });
|
|
7583
7583
|
});
|
|
7584
7584
|
this.validateAll();
|
|
7585
|
-
this.notify({ type: "reset", key: "ALL", values:
|
|
7585
|
+
this.notify({ type: "reset", key: "ALL", values: this.values, errors: this.errors });
|
|
7586
7586
|
}
|
|
7587
7587
|
};
|
|
7588
7588
|
|