@lytjs/plugin-form 6.8.0 → 6.9.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.
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -84,7 +84,7 @@ function validatePattern(value, pattern) {
|
|
|
84
84
|
const regex = typeof pattern === "string" ? new RegExp(pattern) : pattern;
|
|
85
85
|
return regex.test(String(value));
|
|
86
86
|
}
|
|
87
|
-
async function validateFieldValue(
|
|
87
|
+
async function validateFieldValue(_name, value, rules, allValues) {
|
|
88
88
|
const errors = [];
|
|
89
89
|
for (const rule of rules) {
|
|
90
90
|
let isValid = true;
|
|
@@ -123,7 +123,7 @@ async function validateFieldValue(name, value, rules, allValues) {
|
|
|
123
123
|
break;
|
|
124
124
|
}
|
|
125
125
|
if (!isValid) {
|
|
126
|
-
let message = rule.message || defaultMessages[rule.type];
|
|
126
|
+
let message = rule.message || defaultMessages[rule.type] || "\u6821\u9A8C\u5931\u8D25";
|
|
127
127
|
if (rule.type === "min" && rule.value != null) {
|
|
128
128
|
message = message.replace("{min}", String(rule.value));
|
|
129
129
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -59,7 +59,7 @@ function validatePattern(value, pattern) {
|
|
|
59
59
|
const regex = typeof pattern === "string" ? new RegExp(pattern) : pattern;
|
|
60
60
|
return regex.test(String(value));
|
|
61
61
|
}
|
|
62
|
-
async function validateFieldValue(
|
|
62
|
+
async function validateFieldValue(_name, value, rules, allValues) {
|
|
63
63
|
const errors = [];
|
|
64
64
|
for (const rule of rules) {
|
|
65
65
|
let isValid = true;
|
|
@@ -98,7 +98,7 @@ async function validateFieldValue(name, value, rules, allValues) {
|
|
|
98
98
|
break;
|
|
99
99
|
}
|
|
100
100
|
if (!isValid) {
|
|
101
|
-
let message = rule.message || defaultMessages[rule.type];
|
|
101
|
+
let message = rule.message || defaultMessages[rule.type] || "\u6821\u9A8C\u5931\u8D25";
|
|
102
102
|
if (rule.type === "min" && rule.value != null) {
|
|
103
103
|
message = message.replace("{min}", String(rule.value));
|
|
104
104
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lytjs/plugin-form",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.9.0",
|
|
4
4
|
"description": "LytJS official form plugin for form state management, validation, and submission",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"clean": "rm -rf dist"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@lytjs/core": "
|
|
33
|
-
"@lytjs/reactivity": "
|
|
32
|
+
"@lytjs/core": "^6.9.0",
|
|
33
|
+
"@lytjs/reactivity": "^6.9.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"tsup": "^8.0.0",
|