cja-phoenix 0.14.3 → 0.14.5
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/cja-phoenix.es.js
CHANGED
|
@@ -1839,13 +1839,26 @@ const Om = (e, t) => {
|
|
|
1839
1839
|
}), Am = (e, t) => {
|
|
1840
1840
|
const a = (t == null ? void 0 : t.format) == "mm/yyyy" ? 2 : 3, n = (t == null ? void 0 : t.format) == "mm/yyyy" ? 1 : 2;
|
|
1841
1841
|
let r = go().transform(
|
|
1842
|
-
(s, i) =>
|
|
1843
|
-
).
|
|
1842
|
+
(s, i) => i == "phone_number" || i instanceof Date ? s : i
|
|
1843
|
+
).transform((s) => {
|
|
1844
|
+
if (s.split) {
|
|
1845
|
+
const i = s.split("/");
|
|
1846
|
+
switch (t == null ? void 0 : t.format) {
|
|
1847
|
+
case "dd/mm/yyyy":
|
|
1848
|
+
if (i.length == 3 || i[2].length == 4)
|
|
1849
|
+
return new Date(i.reverse().join("-"));
|
|
1850
|
+
case "mm/yyyy":
|
|
1851
|
+
if (i.length == 2 || i[1].length == 4)
|
|
1852
|
+
return new Date(i.reverse().join("-"));
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
return s;
|
|
1856
|
+
}).typeError(e.invalid).test(
|
|
1844
1857
|
"dateTest",
|
|
1845
1858
|
e.invalid,
|
|
1846
1859
|
(s, i) => i.originalValue.split("/").length == a && i.originalValue.split("/")[n].length == 4
|
|
1847
1860
|
);
|
|
1848
|
-
return e.required && (r = r.required(e.required)), (t == null ? void 0 : t.
|
|
1861
|
+
return e.required && (r = r.required(e.required)), (t == null ? void 0 : t.minDate) && e.minDate && (r = r.min(t.minDate, e.minDate)), (t == null ? void 0 : t.maxDate) && e.maxDate && (r = r.max(t.maxDate, e.maxDate)), r;
|
|
1849
1862
|
}, Im = (e) => {
|
|
1850
1863
|
let t = Xa().transform((a) => a).min(9, e.invalid).test("nifTest", e.invalid, (a) => {
|
|
1851
1864
|
if (!a)
|
|
@@ -10,10 +10,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
10
10
|
type: import("vue").PropType<"vertical" | "horizontal">;
|
|
11
11
|
default: string;
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
minDate: {
|
|
14
14
|
type: import("vue").PropType<string>;
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
maxDate: {
|
|
17
17
|
type: import("vue").PropType<string>;
|
|
18
18
|
};
|
|
19
19
|
size: {
|
|
@@ -64,10 +64,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
64
64
|
type: import("vue").PropType<"vertical" | "horizontal">;
|
|
65
65
|
default: string;
|
|
66
66
|
};
|
|
67
|
-
|
|
67
|
+
minDate: {
|
|
68
68
|
type: import("vue").PropType<string>;
|
|
69
69
|
};
|
|
70
|
-
|
|
70
|
+
maxDate: {
|
|
71
71
|
type: import("vue").PropType<string>;
|
|
72
72
|
};
|
|
73
73
|
size: {
|
package/package.json
CHANGED
|
@@ -165,16 +165,26 @@ export const date = (
|
|
|
165
165
|
let validation = yup
|
|
166
166
|
.date()
|
|
167
167
|
.transform((v, ogV) =>
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
ogV.split("/").length == 3 &&
|
|
171
|
-
ogV.split("/")[2].length == 4) ||
|
|
172
|
-
(options?.format == "mm/yyyy" &&
|
|
173
|
-
ogV.split("/").length == 2 &&
|
|
174
|
-
ogV.split("/")[1].length == 4)
|
|
175
|
-
? new Date(ogV.split("/").reverse().join("-"))
|
|
176
|
-
: v
|
|
168
|
+
// ogV as "phone_number" is still as of yet unexplained
|
|
169
|
+
ogV == "phone_number" || ogV instanceof Date ? v : ogV
|
|
177
170
|
)
|
|
171
|
+
.transform((v) => {
|
|
172
|
+
if (v.split) {
|
|
173
|
+
const vArr = v.split("/");
|
|
174
|
+
|
|
175
|
+
switch (options?.format) {
|
|
176
|
+
case "dd/mm/yyyy":
|
|
177
|
+
if (vArr.length == 3 || vArr[2].length == 4)
|
|
178
|
+
return new Date(vArr.reverse().join("-"));
|
|
179
|
+
|
|
180
|
+
case "mm/yyyy":
|
|
181
|
+
if (vArr.length == 2 || vArr[1].length == 4)
|
|
182
|
+
return new Date(vArr.reverse().join("-"));
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return v;
|
|
187
|
+
})
|
|
178
188
|
.typeError(messages.invalid)
|
|
179
189
|
.test(
|
|
180
190
|
"dateTest",
|
|
@@ -188,14 +198,12 @@ export const date = (
|
|
|
188
198
|
validation = validation.required(messages.required);
|
|
189
199
|
}
|
|
190
200
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
if (options?.maxDate && messages.maxDate) {
|
|
194
|
-
validation = validation.min(options.maxDate, messages.maxDate);
|
|
201
|
+
if (options?.minDate && messages.minDate) {
|
|
202
|
+
validation = validation.min(options.minDate, messages.minDate);
|
|
195
203
|
}
|
|
196
204
|
|
|
197
|
-
if (options?.
|
|
198
|
-
validation = validation.max(options.
|
|
205
|
+
if (options?.maxDate && messages.maxDate) {
|
|
206
|
+
validation = validation.max(options.maxDate, messages.maxDate);
|
|
199
207
|
}
|
|
200
208
|
|
|
201
209
|
return validation;
|