@kong-ui-public/forms 4.0.8 → 4.0.9
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/forms.es.js +15 -30
- package/package.json +2 -2
package/dist/forms.es.js
CHANGED
|
@@ -878,8 +878,7 @@ function cl(e, t, n) {
|
|
|
878
878
|
if (l[v] === g)
|
|
879
879
|
continue e;
|
|
880
880
|
t && l.push(g), s.push(m);
|
|
881
|
-
} else
|
|
882
|
-
a(l, g, n) || (l !== s && l.push(g), s.push(m));
|
|
881
|
+
} else a(l, g, n) || (l !== s && l.push(g), s.push(m));
|
|
883
882
|
}
|
|
884
883
|
return s;
|
|
885
884
|
}
|
|
@@ -1326,29 +1325,25 @@ const Le = {
|
|
|
1326
1325
|
},
|
|
1327
1326
|
number(e, t, n, i = ne) {
|
|
1328
1327
|
const a = de(e, t.required, i);
|
|
1329
|
-
if (a != null)
|
|
1330
|
-
return a;
|
|
1328
|
+
if (a != null) return a;
|
|
1331
1329
|
const r = [];
|
|
1332
1330
|
return El(e) ? (!X(t.min) && e < t.min && r.push(W(i.numberTooSmall, t.min)), !X(t.max) && e > t.max && r.push(W(i.numberTooBig, t.max))) : r.push(W(i.invalidNumber)), r;
|
|
1333
1331
|
},
|
|
1334
1332
|
integer(e, t, n, i = ne) {
|
|
1335
1333
|
const a = de(e, t.required, i);
|
|
1336
|
-
if (a != null)
|
|
1337
|
-
return a;
|
|
1334
|
+
if (a != null) return a;
|
|
1338
1335
|
const r = Le.number(e, t, n, i);
|
|
1339
1336
|
return Fl(e) || r.push(W(i.invalidInteger)), r;
|
|
1340
1337
|
},
|
|
1341
1338
|
double(e, t, n, i = ne) {
|
|
1342
1339
|
const a = de(e, t.required, i);
|
|
1343
|
-
if (a != null)
|
|
1344
|
-
return a;
|
|
1340
|
+
if (a != null) return a;
|
|
1345
1341
|
if (!Ft(e) || isNaN(e))
|
|
1346
1342
|
return [W(i.invalidNumber)];
|
|
1347
1343
|
},
|
|
1348
1344
|
string(e, t, n, i = ne) {
|
|
1349
1345
|
const a = de(e, t.required, i);
|
|
1350
|
-
if (a != null)
|
|
1351
|
-
return a;
|
|
1346
|
+
if (a != null) return a;
|
|
1352
1347
|
const r = [];
|
|
1353
1348
|
return Ue(e) ? (!X(t.min) && e.length < t.min && r.push(W(i.textTooSmall, e.length, t.min)), !X(t.max) && e.length > t.max && r.push(W(i.textTooBig, e.length, t.max))) : r.push(W(i.thisNotText)), r;
|
|
1354
1349
|
},
|
|
@@ -1368,8 +1363,7 @@ const Le = {
|
|
|
1368
1363
|
},
|
|
1369
1364
|
date(e, t, n, i = ne) {
|
|
1370
1365
|
const a = de(e, t.required, i);
|
|
1371
|
-
if (a != null)
|
|
1372
|
-
return a;
|
|
1366
|
+
if (a != null) return a;
|
|
1373
1367
|
const r = new Date(e);
|
|
1374
1368
|
if (isNaN(r.getDate()))
|
|
1375
1369
|
return [W(i.invalidDate)];
|
|
@@ -1386,29 +1380,25 @@ const Le = {
|
|
|
1386
1380
|
},
|
|
1387
1381
|
regexp(e, t, n, i = ne) {
|
|
1388
1382
|
const a = de(e, t.required, i);
|
|
1389
|
-
if (a != null)
|
|
1390
|
-
return a;
|
|
1383
|
+
if (a != null) return a;
|
|
1391
1384
|
if (!X(t.pattern) && !new RegExp(t.pattern).test(e))
|
|
1392
1385
|
return [W(i.invalidFormat)];
|
|
1393
1386
|
},
|
|
1394
1387
|
email(e, t, n, i = ne) {
|
|
1395
1388
|
const a = de(e, t.required, i);
|
|
1396
|
-
if (a != null)
|
|
1397
|
-
return a;
|
|
1389
|
+
if (a != null) return a;
|
|
1398
1390
|
if (!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e))
|
|
1399
1391
|
return [W(i.invalidEmail)];
|
|
1400
1392
|
},
|
|
1401
1393
|
url(e, t, n, i = ne) {
|
|
1402
1394
|
const a = de(e, t.required, i);
|
|
1403
|
-
if (a != null)
|
|
1404
|
-
return a;
|
|
1395
|
+
if (a != null) return a;
|
|
1405
1396
|
if (!/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g.test(e))
|
|
1406
1397
|
return [W(i.invalidURL)];
|
|
1407
1398
|
},
|
|
1408
1399
|
creditCard(e, t, n, i = ne) {
|
|
1409
1400
|
const a = de(e, t.required, i);
|
|
1410
|
-
if (a != null)
|
|
1411
|
-
return a;
|
|
1401
|
+
if (a != null) return a;
|
|
1412
1402
|
const r = /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/, o = e.replace(/[^0-9]+/g, "");
|
|
1413
1403
|
if (!r.test(o))
|
|
1414
1404
|
return [W(i.invalidCard)];
|
|
@@ -1420,15 +1410,13 @@ const Le = {
|
|
|
1420
1410
|
},
|
|
1421
1411
|
alpha(e, t, n, i = ne) {
|
|
1422
1412
|
const a = de(e, t.required, i);
|
|
1423
|
-
if (a != null)
|
|
1424
|
-
return a;
|
|
1413
|
+
if (a != null) return a;
|
|
1425
1414
|
if (!/^[a-zA-Z]*$/.test(e))
|
|
1426
1415
|
return [W(i.invalidTextContainNumber)];
|
|
1427
1416
|
},
|
|
1428
1417
|
alphaNumeric(e, t, n, i = ne) {
|
|
1429
1418
|
const a = de(e, t.required, i);
|
|
1430
|
-
if (a != null)
|
|
1431
|
-
return a;
|
|
1419
|
+
if (a != null) return a;
|
|
1432
1420
|
if (!/^[a-zA-Z0-9]*$/.test(e))
|
|
1433
1421
|
return [W(i.invalidTextContainSpec)];
|
|
1434
1422
|
}
|
|
@@ -2671,8 +2659,7 @@ const _u = {
|
|
|
2671
2659
|
offset: n,
|
|
2672
2660
|
...e
|
|
2673
2661
|
});
|
|
2674
|
-
if (t.push(...i.data.data), n = i.data.offset, !n)
|
|
2675
|
-
break;
|
|
2662
|
+
if (t.push(...i.data.data), n = i.data.offset, !n) break;
|
|
2676
2663
|
}
|
|
2677
2664
|
return t.slice(0, Ct);
|
|
2678
2665
|
},
|
|
@@ -2802,8 +2789,7 @@ const Vi = /* @__PURE__ */ K(Iu, [["render", Eu]]), $u = {
|
|
|
2802
2789
|
this.value || (this.value = {});
|
|
2803
2790
|
},
|
|
2804
2791
|
mounted() {
|
|
2805
|
-
if (!this.value)
|
|
2806
|
-
return;
|
|
2792
|
+
if (!this.value) return;
|
|
2807
2793
|
const e = Object.keys(this.value), t = {};
|
|
2808
2794
|
for (let n = 0; n < e.length; n++) {
|
|
2809
2795
|
const i = e[n];
|
|
@@ -3800,8 +3786,7 @@ const cm = {
|
|
|
3800
3786
|
methods: {
|
|
3801
3787
|
// Should field type have a label?
|
|
3802
3788
|
fieldTypeHasLabel(e) {
|
|
3803
|
-
if (X(e.label))
|
|
3804
|
-
return !1;
|
|
3789
|
+
if (X(e.label)) return !1;
|
|
3805
3790
|
let t = "";
|
|
3806
3791
|
switch (e.type === "input" ? t = e.inputType : t = e.type, t) {
|
|
3807
3792
|
case "button":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/forms",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/forms.umd.js",
|
|
6
6
|
"module": "./dist/forms.es.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@kong/kongponents": "^9.0.8",
|
|
41
|
-
"vue": "^3.4.
|
|
41
|
+
"vue": "^3.4.31",
|
|
42
42
|
"@kong-ui-public/i18n": "^2.2.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|