@timardex/cluemart-shared 1.5.504 → 1.5.505
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/{chunk-A3BCQJII.mjs → chunk-UA64PDR4.mjs} +2 -2
- package/dist/{chunk-XNMKWMNF.mjs → chunk-VJIFUOVU.mjs} +76 -75
- package/dist/chunk-VJIFUOVU.mjs.map +1 -0
- package/dist/formFields/index.cjs +8 -5
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.mjs +2 -2
- package/dist/hooks/index.cjs +21 -18
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/index.cjs +88 -85
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +88 -85
- package/dist/index.mjs.map +1 -1
- package/dist/utils/index.cjs +75 -72
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-XNMKWMNF.mjs.map +0 -1
- /package/dist/{chunk-A3BCQJII.mjs.map → chunk-UA64PDR4.mjs.map} +0 -0
|
@@ -43,8 +43,8 @@ import {
|
|
|
43
43
|
vendorStallSize,
|
|
44
44
|
vendorStartDateFields,
|
|
45
45
|
vendorTable
|
|
46
|
-
} from "../chunk-
|
|
47
|
-
import "../chunk-
|
|
46
|
+
} from "../chunk-UA64PDR4.mjs";
|
|
47
|
+
import "../chunk-VJIFUOVU.mjs";
|
|
48
48
|
import "../chunk-534WN2SR.mjs";
|
|
49
49
|
import "../chunk-7GWVTPXL.mjs";
|
|
50
50
|
export {
|
package/dist/hooks/index.cjs
CHANGED
|
@@ -163,7 +163,7 @@ var React = __toESM(require("react"));
|
|
|
163
163
|
var import_react_hook_form = require("react-hook-form");
|
|
164
164
|
|
|
165
165
|
// src/yupSchema/global.ts
|
|
166
|
-
var
|
|
166
|
+
var import_dayjs3 = __toESM(require("dayjs"));
|
|
167
167
|
var import_customParseFormat2 = __toESM(require("dayjs/plugin/customParseFormat.js"));
|
|
168
168
|
var import_isSameOrAfter2 = __toESM(require("dayjs/plugin/isSameOrAfter.js"));
|
|
169
169
|
var yup = __toESM(require("yup"));
|
|
@@ -276,18 +276,21 @@ var EnumEventDateStatus = /* @__PURE__ */ ((EnumEventDateStatus2) => {
|
|
|
276
276
|
return EnumEventDateStatus2;
|
|
277
277
|
})(EnumEventDateStatus || {});
|
|
278
278
|
|
|
279
|
-
// src/utils/
|
|
279
|
+
// src/utils/dailyClueGame.ts
|
|
280
280
|
var import_dayjs = __toESM(require("dayjs"));
|
|
281
|
+
|
|
282
|
+
// src/utils/date.ts
|
|
283
|
+
var import_dayjs2 = __toESM(require("dayjs"));
|
|
281
284
|
var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat.js"));
|
|
282
285
|
var import_isSameOrAfter = __toESM(require("dayjs/plugin/isSameOrAfter.js"));
|
|
283
286
|
var import_timezone = __toESM(require("dayjs/plugin/timezone.js"));
|
|
284
287
|
var import_utc = __toESM(require("dayjs/plugin/utc.js"));
|
|
285
288
|
var dateFormat = "DD-MM-YYYY";
|
|
286
289
|
var timeFormat = "HH:mm";
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
290
|
+
import_dayjs2.default.extend(import_customParseFormat.default);
|
|
291
|
+
import_dayjs2.default.extend(import_utc.default);
|
|
292
|
+
import_dayjs2.default.extend(import_timezone.default);
|
|
293
|
+
import_dayjs2.default.extend(import_isSameOrAfter.default);
|
|
291
294
|
|
|
292
295
|
// src/utils/utils.ts
|
|
293
296
|
var mapArrayToOptions = (items) => items.map((item) => ({
|
|
@@ -366,8 +369,8 @@ var noLeadingZeros = (fieldName, options = {}) => {
|
|
|
366
369
|
return true;
|
|
367
370
|
};
|
|
368
371
|
};
|
|
369
|
-
|
|
370
|
-
|
|
372
|
+
import_dayjs3.default.extend(import_isSameOrAfter2.default);
|
|
373
|
+
import_dayjs3.default.extend(import_customParseFormat2.default);
|
|
371
374
|
var emailRequiredSchema = yup.string().email("Invalid email address").required("Email is required").label("Email").transform(
|
|
372
375
|
(value) => typeof value === "string" ? value.trim().toLowerCase() : value
|
|
373
376
|
);
|
|
@@ -398,12 +401,12 @@ var contactDetailsSchema = yup.object({
|
|
|
398
401
|
landlinePhone: landlinePhoneSchema
|
|
399
402
|
}).nullable().default(void 0);
|
|
400
403
|
var endDateNotInPastTest = yup.string().test("not-in-past", "End date cannot be in the past", (value) => {
|
|
401
|
-
const now = (0,
|
|
402
|
-
return value ? (0,
|
|
404
|
+
const now = (0, import_dayjs3.default)();
|
|
405
|
+
return value ? (0, import_dayjs3.default)(value, dateFormat, true).isSameOrAfter(now, "day") : false;
|
|
403
406
|
});
|
|
404
407
|
var startDateNotInPastTest = yup.string().test("not-in-past", "Start date cannot be in the past", (value) => {
|
|
405
|
-
const now = (0,
|
|
406
|
-
return value ? (0,
|
|
408
|
+
const now = (0, import_dayjs3.default)();
|
|
409
|
+
return value ? (0, import_dayjs3.default)(value, dateFormat, true).isSameOrAfter(now, "day") : false;
|
|
407
410
|
});
|
|
408
411
|
var endDateAfterStartDateTest = yup.string().test(
|
|
409
412
|
"end-after-start",
|
|
@@ -411,8 +414,8 @@ var endDateAfterStartDateTest = yup.string().test(
|
|
|
411
414
|
function(value) {
|
|
412
415
|
const { startDate } = this.parent;
|
|
413
416
|
if (!startDate || !value) return false;
|
|
414
|
-
return (0,
|
|
415
|
-
(0,
|
|
417
|
+
return (0, import_dayjs3.default)(value, dateFormat, true).isSameOrAfter(
|
|
418
|
+
(0, import_dayjs3.default)(startDate, dateFormat, true),
|
|
416
419
|
"day"
|
|
417
420
|
);
|
|
418
421
|
}
|
|
@@ -423,12 +426,12 @@ var endTimeMustBeAfterStartTimeTest = yup.string().test(
|
|
|
423
426
|
function(value) {
|
|
424
427
|
const { startDate, endDate, startTime } = this.parent;
|
|
425
428
|
if (!startDate || !endDate || !startTime || !value) return false;
|
|
426
|
-
const startDateTime = (0,
|
|
429
|
+
const startDateTime = (0, import_dayjs3.default)(
|
|
427
430
|
`${startDate} ${startTime}`,
|
|
428
431
|
`${dateFormat} ${timeFormat}`,
|
|
429
432
|
true
|
|
430
433
|
);
|
|
431
|
-
const endDateTime = (0,
|
|
434
|
+
const endDateTime = (0, import_dayjs3.default)(
|
|
432
435
|
`${endDate} ${value}`,
|
|
433
436
|
`${dateFormat} ${timeFormat}`,
|
|
434
437
|
true
|
|
@@ -440,10 +443,10 @@ var startTimeCannotBeInPastTest = yup.string().test(
|
|
|
440
443
|
"valid-start-time",
|
|
441
444
|
"Start time cannot be in the past",
|
|
442
445
|
function(value) {
|
|
443
|
-
const now = (0,
|
|
446
|
+
const now = (0, import_dayjs3.default)();
|
|
444
447
|
const { startDate } = this.parent;
|
|
445
448
|
if (!startDate || !value) return false;
|
|
446
|
-
const startDateTime = (0,
|
|
449
|
+
const startDateTime = (0, import_dayjs3.default)(
|
|
447
450
|
`${startDate} ${value}`,
|
|
448
451
|
`${dateFormat} ${timeFormat}`,
|
|
449
452
|
true
|