@razorpay/blade 12.49.2 → 12.49.4
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/build/lib/native/components/VisuallyHidden/ScreenReaderStyles.js +2 -2
- package/build/lib/native/components/VisuallyHidden/ScreenReaderStyles.js.map +1 -1
- package/build/lib/native/components/index.js +1 -1
- package/build/lib/web/development/components/DatePicker/BaseDatePicker.web.js +1 -1
- package/build/lib/web/development/components/DatePicker/BaseDatePicker.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/DateInput.web.js +13 -1
- package/build/lib/web/development/components/DatePicker/DateInput.web.js.map +1 -1
- package/build/lib/web/development/components/DatePicker/utils.js +190 -22
- package/build/lib/web/development/components/DatePicker/utils.js.map +1 -1
- package/build/lib/web/development/components/Form/Selector/SelectorInput.web.js +9 -4
- package/build/lib/web/development/components/Form/Selector/SelectorInput.web.js.map +1 -1
- package/build/lib/web/development/components/VisuallyHidden/ScreenReaderStyles.js +19 -1
- package/build/lib/web/development/components/VisuallyHidden/ScreenReaderStyles.js.map +1 -1
- package/build/lib/web/development/components/VisuallyHidden/index.web.js +1 -1
- package/build/lib/web/development/components/index.js +1 -1
- package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js +1 -1
- package/build/lib/web/production/components/DatePicker/BaseDatePicker.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/DateInput.web.js +13 -1
- package/build/lib/web/production/components/DatePicker/DateInput.web.js.map +1 -1
- package/build/lib/web/production/components/DatePicker/utils.js +190 -22
- package/build/lib/web/production/components/DatePicker/utils.js.map +1 -1
- package/build/lib/web/production/components/Form/Selector/SelectorInput.web.js +9 -4
- package/build/lib/web/production/components/Form/Selector/SelectorInput.web.js.map +1 -1
- package/build/lib/web/production/components/VisuallyHidden/ScreenReaderStyles.js +19 -1
- package/build/lib/web/production/components/VisuallyHidden/ScreenReaderStyles.js.map +1 -1
- package/build/lib/web/production/components/VisuallyHidden/index.web.js +1 -1
- package/build/lib/web/production/components/index.js +1 -1
- package/build/types/components/index.d.ts +2 -1
- package/build/types/components/index.native.d.ts +2 -1
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
|
5
5
|
var _excluded = ["formatter"];
|
|
6
6
|
dayjs.extend(customParseFormat);
|
|
7
7
|
var dayjs_locales = ['af', 'ar', 'ar-dz', 'ar-kw', 'ar-ly', 'ar-ma', 'ar-sa', 'ar-tn', 'az', 'be', 'bg', 'bm', 'bn', 'bo', 'br', 'bs', 'ca', 'cs', 'cv', 'cy', 'da', 'de', 'de-at', 'de-ch', 'dv', 'el', 'en', 'en-au', 'en-ca', 'en-gb', 'en-ie', 'en-il', 'en-nz', 'en-SG', 'eo', 'es', 'es-do', 'es-us', 'et', 'eu', 'fa', 'fi', 'fo', 'fr', 'fr-ca', 'fr-ch', 'fy', 'ga', 'gd', 'gl', 'gom-latn', 'gu', 'he', 'hi', 'hr', 'hu', 'hy-am', 'id', 'is', 'it', 'it-ch', 'ja', 'jv', 'ka', 'kk', 'km', 'kn', 'ko', 'ku', 'ky', 'lb', 'lo', 'lt', 'lv', 'me', 'mi', 'mk', 'ml', 'mn', 'mr', 'ms', 'ms-my', 'mt', 'my', 'nb', 'ne', 'nl', 'nl-be', 'nn', 'oc-lnc', 'pa-in', 'pl', 'pt', 'pt-br', 'ro', 'ru', 'sd', 'se', 'si', 'sk', 'sl', 'sq', 'sr', 'sr-cyrl', 'ss', 'sv', 'sw', 'ta', 'te', 'tet', 'tg', 'th', 'tl-ph', 'tlh', 'tr', 'tzl', 'tzm', 'tzm-latn', 'ug-cn', 'uk', 'ur', 'uz', 'uz-latn', 'vi', 'x-pseudo', 'yo', 'zh-cn', 'zh-hk', 'zh-tw'];
|
|
8
|
+
var MONTH_NAMES = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
|
8
9
|
|
|
9
10
|
// https://github.com/iamkun/dayjs/issues/732#issuecomment-554383261
|
|
10
11
|
function patchLocale(locale) {
|
|
@@ -136,12 +137,12 @@ var getTextInputFormat = function getTextInputFormat(formatStr, isRangeInput) {
|
|
|
136
137
|
* @example
|
|
137
138
|
* // Invalid date (non-existent)
|
|
138
139
|
* validateDateComponents("31/02/2024")
|
|
139
|
-
* // → { isValid: false, error: "
|
|
140
|
+
* // → { isValid: false, error: "Please enter a valid date" }
|
|
140
141
|
*
|
|
141
142
|
* @example
|
|
142
143
|
* // Invalid year range
|
|
143
144
|
* validateDateComponents("25/12/999")
|
|
144
|
-
* // → { isValid: false, error: "
|
|
145
|
+
* // → { isValid: false, error: "Year must be between 1000 and 3000" }
|
|
145
146
|
*
|
|
146
147
|
* @example
|
|
147
148
|
* // Empty input
|
|
@@ -163,7 +164,7 @@ var validateDateComponents = function validateDateComponents(dateStr) {
|
|
|
163
164
|
if (!parsed.isValid()) {
|
|
164
165
|
return {
|
|
165
166
|
isValid: false,
|
|
166
|
-
error: '
|
|
167
|
+
error: 'Please enter a valid date'
|
|
167
168
|
};
|
|
168
169
|
}
|
|
169
170
|
|
|
@@ -172,7 +173,7 @@ var validateDateComponents = function validateDateComponents(dateStr) {
|
|
|
172
173
|
if (year < 1000 || year > 3000) {
|
|
173
174
|
return {
|
|
174
175
|
isValid: false,
|
|
175
|
-
error: '
|
|
176
|
+
error: 'Year must be between 1000 and 3000'
|
|
176
177
|
};
|
|
177
178
|
}
|
|
178
179
|
|
|
@@ -289,14 +290,14 @@ var parseSpecialSingleFormat = function parseSpecialSingleFormat(inputValue, for
|
|
|
289
290
|
* @example
|
|
290
291
|
* // Invalid date with error
|
|
291
292
|
* validateAndParseDateInput("31/02/2024", false, "DD/MM/YYYY")
|
|
292
|
-
* // → { shouldBlock: true, error: "
|
|
293
|
+
* // → { shouldBlock: true, error: "Please enter a valid date in DD/MM/YYYY format" }
|
|
293
294
|
*
|
|
294
295
|
* @example
|
|
295
296
|
* // Date excluded by constraint
|
|
296
297
|
* validateAndParseDateInput("25/12/2024", false, "DD/MM/YYYY", {
|
|
297
298
|
* excludeDate: (date) => date.getDay() === 0 // No Sundays
|
|
298
299
|
* })
|
|
299
|
-
* // → { shouldBlock: true, error: "
|
|
300
|
+
* // → { shouldBlock: true, error: "This date is not available for selection" }
|
|
300
301
|
*
|
|
301
302
|
* @example
|
|
302
303
|
* // Special format - year only
|
|
@@ -325,27 +326,50 @@ var validateAndParseDateInput = function validateAndParseDateInput(inputValue, i
|
|
|
325
326
|
} else if (specialParse.shouldBlock) {
|
|
326
327
|
return {
|
|
327
328
|
shouldBlock: true,
|
|
328
|
-
error: '
|
|
329
|
+
error: 'Please enter a valid date'
|
|
329
330
|
};
|
|
330
331
|
}
|
|
331
332
|
}
|
|
332
333
|
if (isRange) {
|
|
333
|
-
var _parts$, _parts$2, _parts$
|
|
334
|
+
var _parts$, _parts$2, _parts$5, _parts$6;
|
|
334
335
|
// Split range input on en dash separator (e.g., "25/12/2024 – 31/12/2024")
|
|
335
336
|
var parts = inputValue.split(/\s*–\s*/);
|
|
336
337
|
|
|
337
|
-
// Block incomplete input
|
|
338
|
+
// Enhanced: Block incomplete input with partial validation
|
|
338
339
|
if ((_parts$ = parts[0]) !== null && _parts$ !== void 0 && _parts$.trim() && parts[0].trim().length < 10 || (_parts$2 = parts[1]) !== null && _parts$2 !== void 0 && _parts$2.trim() && parts[1].trim().length < 10) {
|
|
340
|
+
var _parts$3, _parts$4;
|
|
341
|
+
// Check start date part if it exists and has content
|
|
342
|
+
if ((_parts$3 = parts[0]) !== null && _parts$3 !== void 0 && _parts$3.trim()) {
|
|
343
|
+
var startPartialValidation = validatePartialDateSimple(parts[0].trim());
|
|
344
|
+
if (!startPartialValidation.isValid) {
|
|
345
|
+
return {
|
|
346
|
+
shouldBlock: true,
|
|
347
|
+
error: "Start date: ".concat(startPartialValidation.error)
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
// Check end date part if it exists and has content
|
|
353
|
+
if ((_parts$4 = parts[1]) !== null && _parts$4 !== void 0 && _parts$4.trim()) {
|
|
354
|
+
var endPartialValidation = validatePartialDateSimple(parts[1].trim());
|
|
355
|
+
if (!endPartialValidation.isValid) {
|
|
356
|
+
return {
|
|
357
|
+
shouldBlock: true,
|
|
358
|
+
error: "End date: ".concat(endPartialValidation.error)
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// If partial validation passes, allow continued typing
|
|
339
364
|
return {
|
|
340
|
-
shouldBlock:
|
|
341
|
-
error: 'Invalid date'
|
|
365
|
+
shouldBlock: false
|
|
342
366
|
};
|
|
343
367
|
}
|
|
344
368
|
var startDate = null;
|
|
345
369
|
var endDate = null;
|
|
346
370
|
|
|
347
371
|
// Validate and parse start date if it looks complete (10+ chars = DD/MM/YYYY)
|
|
348
|
-
if ((_parts$
|
|
372
|
+
if ((_parts$5 = parts[0]) !== null && _parts$5 !== void 0 && _parts$5.trim() && parts[0].trim().length >= 10) {
|
|
349
373
|
var startValidation = validateDateComponents(parts[0].trim());
|
|
350
374
|
if (!startValidation.isValid) {
|
|
351
375
|
return {
|
|
@@ -358,7 +382,7 @@ var validateAndParseDateInput = function validateAndParseDateInput(inputValue, i
|
|
|
358
382
|
}
|
|
359
383
|
|
|
360
384
|
// Validate and parse end date if it looks complete
|
|
361
|
-
if ((_parts$
|
|
385
|
+
if ((_parts$6 = parts[1]) !== null && _parts$6 !== void 0 && _parts$6.trim() && parts[1].trim().length >= 10) {
|
|
362
386
|
var endValidation = validateDateComponents(parts[1].trim());
|
|
363
387
|
if (!endValidation.isValid) {
|
|
364
388
|
return {
|
|
@@ -383,25 +407,25 @@ var validateAndParseDateInput = function validateAndParseDateInput(inputValue, i
|
|
|
383
407
|
if (startDate && options.minDate && dayjs(startDate).isBefore(dayjs(options.minDate))) {
|
|
384
408
|
return {
|
|
385
409
|
shouldBlock: true,
|
|
386
|
-
error: 'Start date is
|
|
410
|
+
error: 'Start date is before the minimum allowed date'
|
|
387
411
|
};
|
|
388
412
|
}
|
|
389
413
|
if (startDate && options.maxDate && dayjs(startDate).isAfter(dayjs(options.maxDate))) {
|
|
390
414
|
return {
|
|
391
415
|
shouldBlock: true,
|
|
392
|
-
error: 'Start date is
|
|
416
|
+
error: 'Start date is after the maximum allowed date'
|
|
393
417
|
};
|
|
394
418
|
}
|
|
395
419
|
if (endDate && options.minDate && dayjs(endDate).isBefore(dayjs(options.minDate))) {
|
|
396
420
|
return {
|
|
397
421
|
shouldBlock: true,
|
|
398
|
-
error: 'End date is
|
|
422
|
+
error: 'End date is before the minimum allowed date'
|
|
399
423
|
};
|
|
400
424
|
}
|
|
401
425
|
if (endDate && options.maxDate && dayjs(endDate).isAfter(dayjs(options.maxDate))) {
|
|
402
426
|
return {
|
|
403
427
|
shouldBlock: true,
|
|
404
|
-
error: 'End date is
|
|
428
|
+
error: 'End date is after the maximum allowed date'
|
|
405
429
|
};
|
|
406
430
|
}
|
|
407
431
|
}
|
|
@@ -428,19 +452,19 @@ var validateAndParseDateInput = function validateAndParseDateInput(inputValue, i
|
|
|
428
452
|
if ((_options$excludeDate = options.excludeDate) !== null && _options$excludeDate !== void 0 && _options$excludeDate.call(options, parsedDate)) {
|
|
429
453
|
return {
|
|
430
454
|
shouldBlock: true,
|
|
431
|
-
error: '
|
|
455
|
+
error: 'This date is not available for selection'
|
|
432
456
|
};
|
|
433
457
|
}
|
|
434
458
|
if (options.minDate && dayjs(parsedDate).isBefore(dayjs(options.minDate))) {
|
|
435
459
|
return {
|
|
436
460
|
shouldBlock: true,
|
|
437
|
-
error: 'Date is
|
|
461
|
+
error: 'Date is before the minimum allowed date'
|
|
438
462
|
};
|
|
439
463
|
}
|
|
440
464
|
if (options.maxDate && dayjs(parsedDate).isAfter(dayjs(options.maxDate))) {
|
|
441
465
|
return {
|
|
442
466
|
shouldBlock: true,
|
|
443
|
-
error: 'Date is
|
|
467
|
+
error: 'Date is after the maximum allowed date'
|
|
444
468
|
};
|
|
445
469
|
}
|
|
446
470
|
}
|
|
@@ -450,14 +474,158 @@ var validateAndParseDateInput = function validateAndParseDateInput(inputValue, i
|
|
|
450
474
|
shouldBlock: false,
|
|
451
475
|
parsedValue: parsedDate || null
|
|
452
476
|
};
|
|
477
|
+
} else {
|
|
478
|
+
// Partial validation for incomplete single date
|
|
479
|
+
var partialValidation = validatePartialDateSimple(inputValue);
|
|
480
|
+
if (!partialValidation.isValid) {
|
|
481
|
+
return {
|
|
482
|
+
shouldBlock: true,
|
|
483
|
+
error: partialValidation.error
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// If partial validation passes, allow continued typing
|
|
488
|
+
return {
|
|
489
|
+
shouldBlock: false
|
|
490
|
+
};
|
|
453
491
|
}
|
|
454
492
|
|
|
455
|
-
//
|
|
493
|
+
// This line should not be reached, but keeping for safety
|
|
456
494
|
return {
|
|
457
495
|
shouldBlock: false
|
|
458
496
|
};
|
|
459
497
|
};
|
|
460
498
|
|
|
499
|
+
/**
|
|
500
|
+
* Simple partial date validation using / splitting
|
|
501
|
+
* Since special formats (MMM, MMMM, YYYY) are handled before this function
|
|
502
|
+
*
|
|
503
|
+
* @param input - The partial date input to validate
|
|
504
|
+
* @returns Object with validation result and optional error message
|
|
505
|
+
*
|
|
506
|
+
* @example
|
|
507
|
+
* // Valid partial input
|
|
508
|
+
* validatePartialDateSimple("15")
|
|
509
|
+
* // → { isValid: true }
|
|
510
|
+
*
|
|
511
|
+
* @example
|
|
512
|
+
* // Invalid day
|
|
513
|
+
* validatePartialDateSimple("35")
|
|
514
|
+
* // → { isValid: false, error: "Day cannot be greater than 31" }
|
|
515
|
+
*
|
|
516
|
+
* @example
|
|
517
|
+
* // Invalid month
|
|
518
|
+
* validatePartialDateSimple("15/13")
|
|
519
|
+
* // → { isValid: false, error: "Month cannot be greater than 12" }
|
|
520
|
+
*
|
|
521
|
+
* @example
|
|
522
|
+
* // Invalid day-month combination
|
|
523
|
+
* validatePartialDateSimple("30/02")
|
|
524
|
+
* // → { isValid: false, error: "February cannot have more than 29 days" }
|
|
525
|
+
*/
|
|
526
|
+
function validatePartialDateSimple(input) {
|
|
527
|
+
var _parts$7, _parts$8;
|
|
528
|
+
// Don't validate empty input - let user start typing
|
|
529
|
+
if (!(input !== null && input !== void 0 && input.trim())) {
|
|
530
|
+
return {
|
|
531
|
+
isValid: true
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// Split by / to get day, month parts
|
|
536
|
+
var parts = input.split('/');
|
|
537
|
+
|
|
538
|
+
// Validate day part (first part)
|
|
539
|
+
if (((_parts$7 = parts[0]) === null || _parts$7 === void 0 ? void 0 : _parts$7.length) >= 2) {
|
|
540
|
+
var dayStr = parts[0].trim();
|
|
541
|
+
if (dayStr.length > 0) {
|
|
542
|
+
var day = parseInt(dayStr, 10);
|
|
543
|
+
|
|
544
|
+
// Day must be valid number
|
|
545
|
+
if (isNaN(day)) {
|
|
546
|
+
return {
|
|
547
|
+
isValid: false,
|
|
548
|
+
error: 'Please enter a valid day (01-31)'
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
// Day cannot be greater than 31
|
|
553
|
+
if (day > 31) {
|
|
554
|
+
return {
|
|
555
|
+
isValid: false,
|
|
556
|
+
error: 'Day cannot be greater than 31'
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
// Day cannot be 00
|
|
561
|
+
if (day === 0) {
|
|
562
|
+
return {
|
|
563
|
+
isValid: false,
|
|
564
|
+
error: 'Day cannot be 00, please enter 01-31'
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
// Validate month part (second part)
|
|
571
|
+
if (((_parts$8 = parts[1]) === null || _parts$8 === void 0 ? void 0 : _parts$8.length) >= 2) {
|
|
572
|
+
var monthStr = parts[1].trim();
|
|
573
|
+
if (monthStr.length > 0) {
|
|
574
|
+
var _parts$9;
|
|
575
|
+
var month = parseInt(monthStr, 10);
|
|
576
|
+
|
|
577
|
+
// Month must be valid number
|
|
578
|
+
if (isNaN(month)) {
|
|
579
|
+
return {
|
|
580
|
+
isValid: false,
|
|
581
|
+
error: 'Please enter a valid month (01-12)'
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
// Month cannot be greater than 12
|
|
586
|
+
if (month > 12) {
|
|
587
|
+
return {
|
|
588
|
+
isValid: false,
|
|
589
|
+
error: 'Month cannot be greater than 12'
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
// Month cannot be 00
|
|
594
|
+
if (month === 0) {
|
|
595
|
+
return {
|
|
596
|
+
isValid: false,
|
|
597
|
+
error: 'Month cannot be 00, please enter 01-12'
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
// Basic day-month validation (no DayJS needed)
|
|
602
|
+
var _day = (_parts$9 = parts[0]) !== null && _parts$9 !== void 0 && _parts$9.trim() ? parseInt(parts[0].trim(), 10) : NaN;
|
|
603
|
+
if (!isNaN(_day)) {
|
|
604
|
+
// February cannot have more than 29 days
|
|
605
|
+
if (month === 2 && _day > 29) {
|
|
606
|
+
return {
|
|
607
|
+
isValid: false,
|
|
608
|
+
error: 'February cannot have more than 29 days'
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
// Months with 30 days: April(4), June(6), September(9), November(11)
|
|
613
|
+
if ([4, 6, 9, 11].includes(month) && _day > 30) {
|
|
614
|
+
return {
|
|
615
|
+
isValid: false,
|
|
616
|
+
error: "".concat(MONTH_NAMES[month - 1], " cannot have more than 30 days")
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
// If we get here, partial input is valid
|
|
624
|
+
return {
|
|
625
|
+
isValid: true
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
|
|
461
629
|
/**
|
|
462
630
|
* Removes date delimiters (slashes) from formatted date strings for internal processing
|
|
463
631
|
* Used to convert external formatted values to internal state for easier validation and length checks
|
|
@@ -485,5 +653,5 @@ var stripDelimiters = function stripDelimiters(str) {
|
|
|
485
653
|
return (_str$replace = str === null || str === void 0 ? void 0 : str.replace(/\//g, '')) !== null && _str$replace !== void 0 ? _str$replace : '';
|
|
486
654
|
};
|
|
487
655
|
|
|
488
|
-
export { convertIntlToDayjsLocale, finalInputFormat, getFormattedDate, getTextInputFormat, loadScript, rangeFormattedValue, rangeInputPlaceHolder, stripDelimiters, validateAndParseDateInput, validateDateComponents };
|
|
656
|
+
export { convertIntlToDayjsLocale, finalInputFormat, getFormattedDate, getTextInputFormat, loadScript, rangeFormattedValue, rangeInputPlaceHolder, stripDelimiters, validateAndParseDateInput, validateDateComponents, validatePartialDateSimple };
|
|
489
657
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../../../src/components/DatePicker/utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport type { DatePickerType, DatePickerValue } from '@mantine/dates';\nimport dayjs from 'dayjs';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\n\ndayjs.extend(customParseFormat);\n\nconst dayjs_locales = [\n 'af',\n 'ar',\n 'ar-dz',\n 'ar-kw',\n 'ar-ly',\n 'ar-ma',\n 'ar-sa',\n 'ar-tn',\n 'az',\n 'be',\n 'bg',\n 'bm',\n 'bn',\n 'bo',\n 'br',\n 'bs',\n 'ca',\n 'cs',\n 'cv',\n 'cy',\n 'da',\n 'de',\n 'de-at',\n 'de-ch',\n 'dv',\n 'el',\n 'en',\n 'en-au',\n 'en-ca',\n 'en-gb',\n 'en-ie',\n 'en-il',\n 'en-nz',\n 'en-SG',\n 'eo',\n 'es',\n 'es-do',\n 'es-us',\n 'et',\n 'eu',\n 'fa',\n 'fi',\n 'fo',\n 'fr',\n 'fr-ca',\n 'fr-ch',\n 'fy',\n 'ga',\n 'gd',\n 'gl',\n 'gom-latn',\n 'gu',\n 'he',\n 'hi',\n 'hr',\n 'hu',\n 'hy-am',\n 'id',\n 'is',\n 'it',\n 'it-ch',\n 'ja',\n 'jv',\n 'ka',\n 'kk',\n 'km',\n 'kn',\n 'ko',\n 'ku',\n 'ky',\n 'lb',\n 'lo',\n 'lt',\n 'lv',\n 'me',\n 'mi',\n 'mk',\n 'ml',\n 'mn',\n 'mr',\n 'ms',\n 'ms-my',\n 'mt',\n 'my',\n 'nb',\n 'ne',\n 'nl',\n 'nl-be',\n 'nn',\n 'oc-lnc',\n 'pa-in',\n 'pl',\n 'pt',\n 'pt-br',\n 'ro',\n 'ru',\n 'sd',\n 'se',\n 'si',\n 'sk',\n 'sl',\n 'sq',\n 'sr',\n 'sr-cyrl',\n 'ss',\n 'sv',\n 'sw',\n 'ta',\n 'te',\n 'tet',\n 'tg',\n 'th',\n 'tl-ph',\n 'tlh',\n 'tr',\n 'tzl',\n 'tzm',\n 'tzm-latn',\n 'ug-cn',\n 'uk',\n 'ur',\n 'uz',\n 'uz-latn',\n 'vi',\n 'x-pseudo',\n 'yo',\n 'zh-cn',\n 'zh-hk',\n 'zh-tw',\n];\n\n// https://github.com/iamkun/dayjs/issues/732#issuecomment-554383261\nfunction patchLocale(locale: string): string | boolean {\n if (['en', 'en-us'].includes(locale)) return 'en';\n if (locale === 'zn') return 'zh-cn';\n if (locale === 'no') return 'nb';\n if (dayjs_locales.includes(locale)) return locale;\n return false;\n}\n\nfunction convertIntlToDayjsLocale(lang: string): string {\n lang = lang.toLowerCase();\n const locale = patchLocale(lang) || (lang.includes('-') && patchLocale(lang.split('-')[0]));\n if (!locale) return 'en';\n\n return `${locale}`;\n}\n\nfunction isScriptLoaded(src: string): boolean {\n return Boolean(document.querySelector(`script[src=\"${src}\"]`));\n}\n\n/**\n * Used to dynamically load a script\n */\nfunction loadScript(src: string, callback?: () => void): void {\n if (isScriptLoaded(src)) {\n callback?.();\n return;\n }\n const localeScript = document.createElement('script');\n localeScript.async = true;\n localeScript.src = src;\n localeScript.onload = () => callback?.();\n document.head.appendChild(localeScript);\n}\n\ninterface DateFormatterInput {\n type: DatePickerType;\n date: DatePickerValue<DatePickerType>;\n locale: string;\n format: string;\n labelSeparator: string;\n}\n\ntype DateFormatter = (input: DateFormatterInput) => string;\n\nfunction defaultDateFormatter({ type, date, locale, format, labelSeparator }: DateFormatterInput) {\n const formatDate = (value: Date) => dayjs(value).locale(locale).format(format);\n\n if (type === 'default') {\n return date === null ? '' : formatDate(date as Date);\n }\n\n if (type === 'range' && Array.isArray(date)) {\n if (date[0] && date[1]) {\n return `${formatDate(date[0])} ${labelSeparator} ${formatDate(date[1])}`;\n }\n\n if (date[0]) {\n return `${formatDate(date[0])} ${labelSeparator} `;\n }\n\n return '';\n }\n\n return '';\n}\n\ninterface GetFormattedDateInput extends DateFormatterInput {\n formatter?: DateFormatter;\n}\n\nfunction getFormattedDate({ formatter, ...others }: GetFormattedDateInput) {\n return (formatter || defaultDateFormatter)(others);\n}\n\nconst rangeFormattedValue = (startValue: string, endValue: string) => {\n // Both values exist\n if (startValue && endValue) {\n if (startValue === endValue) {\n return startValue; // Same date, show single value\n }\n return `${startValue} – ${endValue}`; // Different dates, show range\n }\n\n // Only start value exists\n if (startValue) {\n return `${startValue} – `;\n }\n\n // Only end value exists\n if (endValue) {\n return ` – ${endValue}`;\n }\n\n // No values\n return '';\n};\n\nconst rangeInputPlaceHolder = (placeholder: string | undefined, format: string) => {\n if (placeholder) {\n return `${placeholder} – ${placeholder}`;\n }\n return `${format} – ${format}`;\n};\n\nconst finalInputFormat = (startValue: string, endValue: string, format: string | undefined) => {\n // For case: when start and end are the same, return the format\n if (startValue === endValue && (startValue || endValue)) {\n return format;\n }\n return `${format} – ${format}`;\n};\n\n/**\n * Converts date format string to TextInput pattern for masking.\n * TextInput format only recognizes # as input placeholder, so we replace\n * date characters (Y,M,D) with # while preserving delimiters.\n *\n * @example \"DD/MM/YYYY\" – \"##/##/####\"\n * @example \"MMMM\" – \"################\" (longest month: \"September\")\n * @example \"MMM\" – \"###\"\n */\nconst getTextInputFormat = (formatStr?: string, isRangeInput?: boolean): string => {\n if (!formatStr) {\n return isRangeInput ? '##/##/#### – ##/##/####' : '##/##/####';\n } else if (formatStr === 'MMMM') {\n return formatStr.replace(/MMMM/g, '#########');\n }\n return formatStr.replace(/[YMD]/g, '#');\n};\n\n/**\n * Validates date string using DayJS strict parsing and business rules\n *\n * @param dateStr - The date string to validate in DD/MM/YYYY format\n * @returns Object with validation result, error message if invalid, and parsed Date if valid\n *\n * @example\n * // Valid date\n * validateDateComponents(\"25/12/2024\")\n * // → { isValid: true, parsedDate: Date(2024, 11, 25) }\n *\n * @example\n * // Invalid date (non-existent)\n * validateDateComponents(\"31/02/2024\")\n * // → { isValid: false, error: \"Invalid date\" }\n *\n * @example\n * // Invalid year range\n * validateDateComponents(\"25/12/999\")\n * // → { isValid: false, error: \"Invalid year\" }\n *\n * @example\n * // Empty input\n * validateDateComponents(\"\")\n * // → { isValid: true }\n */\nconst validateDateComponents = (\n dateStr: string,\n): {\n isValid: boolean;\n error?: string;\n parsedDate?: Date;\n} => {\n // Empty strings are considered valid (user hasn't started typing)\n if (!dateStr?.trim()) {\n return { isValid: true };\n }\n\n // Use DayJS strict parsing to validate DD/MM/YYYY format and date existence\n const parsed = dayjs(dateStr, 'DD/MM/YYYY', true);\n\n // DayJS strict mode catches invalid days/months and non-existent dates (e.g., Feb 30th)\n if (!parsed.isValid()) {\n return { isValid: false, error: 'Invalid date' };\n }\n\n // Business rule: restrict year range to reasonable values for most applications\n const year = parsed.year();\n if (year < 1000 || year > 3000) {\n return { isValid: false, error: 'Invalid year' };\n }\n\n // Return both validation result AND parsed date to avoid double parsing\n return { isValid: true, parsedDate: parsed.toDate() };\n};\n\n/**\n * Detects and parses special single date formats (MMM, MMMM, YYYY)\n * These formats preserve current date/month/year and only change the specified component\n *\n * @param inputValue - The input string to parse\n * @param format - The expected format ('MMM', 'MMMM', or 'YYYY')\n * @returns Object with special format detection, parsed date, and validation result\n *\n * @example\n * // Year format - preserves current month/day, changes year\n * parseSpecialSingleFormat(\"2024\", \"YYYY\")\n * // → { isSpecialFormat: true, parsedDate: Date(2024, currentMonth, currentDay), shouldBlock: false }\n *\n * @example\n * // Short month format - preserves current day/year, changes month\n * parseSpecialSingleFormat(\"Aug\", \"MMM\")\n * // → { isSpecialFormat: true, parsedDate: Date(currentYear, 7, currentDay), shouldBlock: false }\n *\n * @example\n * // Full month format - preserves current day/year, changes month\n * parseSpecialSingleFormat(\"August\", \"MMMM\")\n * // → { isSpecialFormat: true, parsedDate: Date(currentYear, 7, currentDay), shouldBlock: false }\n *\n * @example\n * // Invalid year\n * parseSpecialSingleFormat(\"999\", \"YYYY\")\n * // → { isSpecialFormat: true, shouldBlock: true }\n *\n * @example\n * // Not a special format\n * parseSpecialSingleFormat(\"25/12/2024\", \"DD/MM/YYYY\")\n * // → { isSpecialFormat: false, shouldBlock: false }\n */\nconst parseSpecialSingleFormat = (\n inputValue: string,\n format?: string,\n): { isSpecialFormat: boolean; parsedDate?: Date; shouldBlock: boolean } => {\n if (!format) return { isSpecialFormat: false, shouldBlock: false };\n\n const trimmedInput = inputValue.trim();\n const today = new Date();\n\n // Handle year-only format (YYYY) - keep current month and day, change year\n if (format === 'YYYY' && /^\\d{4}$/.test(trimmedInput)) {\n const year = parseInt(trimmedInput, 10);\n if (year >= 1000 && year <= 3000) {\n return {\n isSpecialFormat: true,\n parsedDate: new Date(year, today.getMonth(), today.getDate()),\n shouldBlock: false,\n };\n } else {\n return {\n isSpecialFormat: true,\n shouldBlock: true,\n };\n }\n }\n\n // Handle month formats (MMM, MMMM) - keep current day and year, change month\n if ((format === 'MMM' || format === 'MMMM') && trimmedInput.length >= 3) {\n // Using DayJS to parse month names (handles both short \"Aug\" and full \"August\")\n const monthDate = dayjs(trimmedInput, format === 'MMM' ? 'MMM' : 'MMMM', true);\n\n if (!monthDate.isValid()) {\n return {\n isSpecialFormat: true,\n shouldBlock: true,\n };\n }\n return {\n isSpecialFormat: true,\n parsedDate: new Date(today.getFullYear(), monthDate.month(), today.getDate()),\n shouldBlock: false,\n };\n }\n\n return { isSpecialFormat: false, shouldBlock: false };\n};\n\n/**\n * Validates and parses date input with comprehensive error handling and constraint checking\n * Combines validation + parsing to avoid redundant operations and supports both single dates and ranges\n *\n * @param inputValue - The input string to validate and parse\n * @param isRange - Whether this is a range input (true) or single date (false)\n * @param format - The expected date format ('DD/MM/YYYY', 'MMM', 'MMMM', 'YYYY')\n * @param options - Additional validation constraints\n * @param options.excludeDate - Function to exclude specific dates (single dates only)\n * @param options.minDate - Minimum allowed date\n * @param options.maxDate - Maximum allowed date\n * @returns Object with shouldBlock flag, optional error message, and parsed values if valid\n *\n * @example\n * // Valid single date\n * validateAndParseDateInput(\"25/12/2024\", false, \"DD/MM/YYYY\")\n * // → { shouldBlock: false, parsedValue: Date(2024, 11, 25) }\n *\n * @example\n * // Valid range input\n * validateAndParseDateInput(\"25/12/2024 – 31/12/2024\", true, \"DD/MM/YYYY\")\n * // → { shouldBlock: false, parsedValue: [Date(2024, 11, 25), Date(2024, 11, 31)] }\n *\n * @example\n * // Invalid date with error\n * validateAndParseDateInput(\"31/02/2024\", false, \"DD/MM/YYYY\")\n * // → { shouldBlock: true, error: \"Invalid date\" }\n *\n * @example\n * // Date excluded by constraint\n * validateAndParseDateInput(\"25/12/2024\", false, \"DD/MM/YYYY\", {\n * excludeDate: (date) => date.getDay() === 0 // No Sundays\n * })\n * // → { shouldBlock: true, error: \"Date is not allowed\" }\n *\n * @example\n * // Special format - year only\n * validateAndParseDateInput(\"2024\", false, \"YYYY\")\n * // → { shouldBlock: false, parsedValue: Date(2024, currentMonth, currentDay) }\n *\n * @example\n * // Incomplete input - allow continued typing\n * validateAndParseDateInput(\"25/12\", false, \"DD/MM/YYYY\")\n * // → { shouldBlock: false } (no parsedValue, allows user to continue typing)\n */\nconst validateAndParseDateInput = (\n inputValue: string,\n isRange: boolean,\n format?: string,\n options?: {\n excludeDate?: (date: Date) => boolean;\n minDate?: Date;\n maxDate?: Date;\n },\n): {\n shouldBlock: boolean;\n error?: string;\n parsedValue?: Date | null | [Date | null, Date | null];\n} => {\n // Allow empty input - user hasn't started typing yet\n if (!inputValue?.trim()) return { shouldBlock: false };\n\n // Handle special single date formats (MMM, MMMM, YYYY) - skip normal validation\n if (!isRange && format) {\n const specialParse = parseSpecialSingleFormat(inputValue, format);\n if (specialParse.isSpecialFormat && !specialParse.shouldBlock) {\n return { shouldBlock: false, parsedValue: specialParse.parsedDate || null };\n } else if (specialParse.shouldBlock) {\n return { shouldBlock: true, error: 'Invalid date' };\n }\n }\n\n if (isRange) {\n // Split range input on en dash separator (e.g., \"25/12/2024 – 31/12/2024\")\n const parts = inputValue.split(/\\s*–\\s*/);\n\n // Block incomplete input to prevent premature validation (e.g., \"25/12/202\" is being typed)\n if (\n (parts[0]?.trim() && parts[0].trim().length < 10) ||\n (parts[1]?.trim() && parts[1].trim().length < 10)\n ) {\n return { shouldBlock: true, error: 'Invalid date' };\n }\n\n let startDate: Date | null = null;\n let endDate: Date | null = null;\n\n // Validate and parse start date if it looks complete (10+ chars = DD/MM/YYYY)\n if (parts[0]?.trim() && parts[0].trim().length >= 10) {\n const startValidation = validateDateComponents(parts[0].trim());\n if (!startValidation.isValid) {\n return { shouldBlock: true, error: `Start date: ${startValidation.error}` };\n }\n // Use the already-parsed date from validation to avoid double parsing\n startDate = startValidation.parsedDate || null;\n }\n\n // Validate and parse end date if it looks complete\n if (parts[1]?.trim() && parts[1].trim().length >= 10) {\n const endValidation = validateDateComponents(parts[1].trim());\n if (!endValidation.isValid) {\n return { shouldBlock: true, error: `End date: ${endValidation.error}` };\n }\n // Use the already-parsed date from validation to avoid double parsing\n endDate = endValidation.parsedDate || null;\n }\n\n // Business logic: start date cannot be after end date\n if (startDate && endDate && startDate > endDate) {\n return { shouldBlock: true, error: 'Start date cannot be greater than end date' };\n }\n\n // Additional validation for date range constraints\n if (options) {\n if (startDate && options.minDate && dayjs(startDate).isBefore(dayjs(options.minDate))) {\n return { shouldBlock: true, error: 'Start date is not allowed' };\n }\n if (startDate && options.maxDate && dayjs(startDate).isAfter(dayjs(options.maxDate))) {\n return { shouldBlock: true, error: 'Start date is not allowed' };\n }\n if (endDate && options.minDate && dayjs(endDate).isBefore(dayjs(options.minDate))) {\n return { shouldBlock: true, error: 'End date is not allowed' };\n }\n if (endDate && options.maxDate && dayjs(endDate).isAfter(dayjs(options.maxDate))) {\n return { shouldBlock: true, error: 'End date is not allowed' };\n }\n }\n\n // Return parsed dates ready for setControlledValue\n return { shouldBlock: false, parsedValue: [startDate, endDate] };\n } else if (inputValue.length >= 10) {\n // Single date: validate and parse if it looks complete\n const validation = validateDateComponents(inputValue);\n if (!validation.isValid) {\n return { shouldBlock: true, error: validation.error };\n }\n\n const parsedDate = validation.parsedDate;\n\n // Additional validation for single date constraints\n if (options && parsedDate) {\n if (options.excludeDate?.(parsedDate)) {\n return { shouldBlock: true, error: 'Date is not allowed' };\n }\n if (options.minDate && dayjs(parsedDate).isBefore(dayjs(options.minDate))) {\n return { shouldBlock: true, error: 'Date is not allowed' };\n }\n if (options.maxDate && dayjs(parsedDate).isAfter(dayjs(options.maxDate))) {\n return { shouldBlock: true, error: 'Date is not allowed' };\n }\n }\n\n // Return parsed date ready for setControlledValue\n return { shouldBlock: false, parsedValue: parsedDate || null };\n }\n\n // Input is incomplete but valid so far - allow continued typing\n return { shouldBlock: false };\n};\n\n/**\n * Removes date delimiters (slashes) from formatted date strings for internal processing\n * Used to convert external formatted values to internal state for easier validation and length checks\n *\n * @param str - The date string with delimiters\n * @returns String without delimiters, or empty string if input is null/undefined\n *\n * @example\n * // Remove slashes from single date\n * stripDelimiters(\"25/12/2024\")\n * // → \"25122024\"\n *\n * @example\n * // Handle null/undefined input\n * stripDelimiters(undefined)\n * // → \"\"\n *\n * @example\n * // Used for internal state conversion\n * stripDelimiters(\"31/12/2024\")\n * // → \"31122024\" (easier for length checks: inputValue.length === 8)\n */\nconst stripDelimiters = (str?: string): string => str?.replace(/\\//g, '') ?? '';\n\nexport {\n convertIntlToDayjsLocale,\n loadScript,\n getFormattedDate,\n rangeFormattedValue,\n rangeInputPlaceHolder,\n finalInputFormat,\n getTextInputFormat,\n validateDateComponents,\n validateAndParseDateInput,\n stripDelimiters,\n};\n"],"names":["dayjs","extend","customParseFormat","dayjs_locales","patchLocale","locale","includes","convertIntlToDayjsLocale","lang","toLowerCase","split","concat","isScriptLoaded","src","Boolean","document","querySelector","loadScript","callback","localeScript","createElement","async","onload","head","appendChild","defaultDateFormatter","_ref","type","date","format","labelSeparator","formatDate","value","Array","isArray","getFormattedDate","_ref2","formatter","others","_objectWithoutProperties","_excluded","rangeFormattedValue","startValue","endValue","rangeInputPlaceHolder","placeholder","finalInputFormat","getTextInputFormat","formatStr","isRangeInput","replace","validateDateComponents","dateStr","trim","isValid","parsed","error","year","parsedDate","toDate","parseSpecialSingleFormat","inputValue","isSpecialFormat","shouldBlock","trimmedInput","today","Date","test","parseInt","getMonth","getDate","length","monthDate","getFullYear","month","validateAndParseDateInput","isRange","options","specialParse","parsedValue","_parts$","_parts$2","_parts$3","_parts$4","parts","startDate","endDate","startValidation","endValidation","minDate","isBefore","maxDate","isAfter","validation","_options$excludeDate","excludeDate","call","stripDelimiters","str","_str$replace"],"mappings":";;;;;AAMAA,KAAK,CAACC,MAAM,CAACC,iBAAiB,CAAC,CAAA;AAE/B,IAAMC,aAAa,GAAG,CACpB,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ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AW,EAAE,KAAA;GAAO,CAAA;AAC/B,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMkC,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,GAAY,EAAA;AAAA,EAAA,IAAAC,YAAA,CAAA;AAAA,EAAA,OAAA,CAAAA,YAAA,GAAaD,GAAG,aAAHA,GAAG,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAHA,GAAG,CAAEhD,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,MAAA,IAAA,IAAAiD,YAAA,KAAAA,KAAAA,CAAAA,GAAAA,YAAA,GAAI,EAAE,CAAA;AAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../../../src/components/DatePicker/utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport type { DatePickerType, DatePickerValue } from '@mantine/dates';\nimport dayjs from 'dayjs';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\n\ndayjs.extend(customParseFormat);\n\nconst dayjs_locales = [\n 'af',\n 'ar',\n 'ar-dz',\n 'ar-kw',\n 'ar-ly',\n 'ar-ma',\n 'ar-sa',\n 'ar-tn',\n 'az',\n 'be',\n 'bg',\n 'bm',\n 'bn',\n 'bo',\n 'br',\n 'bs',\n 'ca',\n 'cs',\n 'cv',\n 'cy',\n 'da',\n 'de',\n 'de-at',\n 'de-ch',\n 'dv',\n 'el',\n 'en',\n 'en-au',\n 'en-ca',\n 'en-gb',\n 'en-ie',\n 'en-il',\n 'en-nz',\n 'en-SG',\n 'eo',\n 'es',\n 'es-do',\n 'es-us',\n 'et',\n 'eu',\n 'fa',\n 'fi',\n 'fo',\n 'fr',\n 'fr-ca',\n 'fr-ch',\n 'fy',\n 'ga',\n 'gd',\n 'gl',\n 'gom-latn',\n 'gu',\n 'he',\n 'hi',\n 'hr',\n 'hu',\n 'hy-am',\n 'id',\n 'is',\n 'it',\n 'it-ch',\n 'ja',\n 'jv',\n 'ka',\n 'kk',\n 'km',\n 'kn',\n 'ko',\n 'ku',\n 'ky',\n 'lb',\n 'lo',\n 'lt',\n 'lv',\n 'me',\n 'mi',\n 'mk',\n 'ml',\n 'mn',\n 'mr',\n 'ms',\n 'ms-my',\n 'mt',\n 'my',\n 'nb',\n 'ne',\n 'nl',\n 'nl-be',\n 'nn',\n 'oc-lnc',\n 'pa-in',\n 'pl',\n 'pt',\n 'pt-br',\n 'ro',\n 'ru',\n 'sd',\n 'se',\n 'si',\n 'sk',\n 'sl',\n 'sq',\n 'sr',\n 'sr-cyrl',\n 'ss',\n 'sv',\n 'sw',\n 'ta',\n 'te',\n 'tet',\n 'tg',\n 'th',\n 'tl-ph',\n 'tlh',\n 'tr',\n 'tzl',\n 'tzm',\n 'tzm-latn',\n 'ug-cn',\n 'uk',\n 'ur',\n 'uz',\n 'uz-latn',\n 'vi',\n 'x-pseudo',\n 'yo',\n 'zh-cn',\n 'zh-hk',\n 'zh-tw',\n];\n\nconst MONTH_NAMES = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n];\n\n// https://github.com/iamkun/dayjs/issues/732#issuecomment-554383261\nfunction patchLocale(locale: string): string | boolean {\n if (['en', 'en-us'].includes(locale)) return 'en';\n if (locale === 'zn') return 'zh-cn';\n if (locale === 'no') return 'nb';\n if (dayjs_locales.includes(locale)) return locale;\n return false;\n}\n\nfunction convertIntlToDayjsLocale(lang: string): string {\n lang = lang.toLowerCase();\n const locale = patchLocale(lang) || (lang.includes('-') && patchLocale(lang.split('-')[0]));\n if (!locale) return 'en';\n\n return `${locale}`;\n}\n\nfunction isScriptLoaded(src: string): boolean {\n return Boolean(document.querySelector(`script[src=\"${src}\"]`));\n}\n\n/**\n * Used to dynamically load a script\n */\nfunction loadScript(src: string, callback?: () => void): void {\n if (isScriptLoaded(src)) {\n callback?.();\n return;\n }\n const localeScript = document.createElement('script');\n localeScript.async = true;\n localeScript.src = src;\n localeScript.onload = () => callback?.();\n document.head.appendChild(localeScript);\n}\n\ninterface DateFormatterInput {\n type: DatePickerType;\n date: DatePickerValue<DatePickerType>;\n locale: string;\n format: string;\n labelSeparator: string;\n}\n\ntype DateFormatter = (input: DateFormatterInput) => string;\n\nfunction defaultDateFormatter({ type, date, locale, format, labelSeparator }: DateFormatterInput) {\n const formatDate = (value: Date) => dayjs(value).locale(locale).format(format);\n\n if (type === 'default') {\n return date === null ? '' : formatDate(date as Date);\n }\n\n if (type === 'range' && Array.isArray(date)) {\n if (date[0] && date[1]) {\n return `${formatDate(date[0])} ${labelSeparator} ${formatDate(date[1])}`;\n }\n\n if (date[0]) {\n return `${formatDate(date[0])} ${labelSeparator} `;\n }\n\n return '';\n }\n\n return '';\n}\n\ninterface GetFormattedDateInput extends DateFormatterInput {\n formatter?: DateFormatter;\n}\n\nfunction getFormattedDate({ formatter, ...others }: GetFormattedDateInput) {\n return (formatter || defaultDateFormatter)(others);\n}\n\nconst rangeFormattedValue = (startValue: string, endValue: string) => {\n // Both values exist\n if (startValue && endValue) {\n if (startValue === endValue) {\n return startValue; // Same date, show single value\n }\n return `${startValue} – ${endValue}`; // Different dates, show range\n }\n\n // Only start value exists\n if (startValue) {\n return `${startValue} – `;\n }\n\n // Only end value exists\n if (endValue) {\n return ` – ${endValue}`;\n }\n\n // No values\n return '';\n};\n\nconst rangeInputPlaceHolder = (placeholder: string | undefined, format: string) => {\n if (placeholder) {\n return `${placeholder} – ${placeholder}`;\n }\n return `${format} – ${format}`;\n};\n\nconst finalInputFormat = (startValue: string, endValue: string, format: string | undefined) => {\n // For case: when start and end are the same, return the format\n if (startValue === endValue && (startValue || endValue)) {\n return format;\n }\n return `${format} – ${format}`;\n};\n\n/**\n * Converts date format string to TextInput pattern for masking.\n * TextInput format only recognizes # as input placeholder, so we replace\n * date characters (Y,M,D) with # while preserving delimiters.\n *\n * @example \"DD/MM/YYYY\" – \"##/##/####\"\n * @example \"MMMM\" – \"################\" (longest month: \"September\")\n * @example \"MMM\" – \"###\"\n */\nconst getTextInputFormat = (formatStr?: string, isRangeInput?: boolean): string => {\n if (!formatStr) {\n return isRangeInput ? '##/##/#### – ##/##/####' : '##/##/####';\n } else if (formatStr === 'MMMM') {\n return formatStr.replace(/MMMM/g, '#########');\n }\n return formatStr.replace(/[YMD]/g, '#');\n};\n\n/**\n * Validates date string using DayJS strict parsing and business rules\n *\n * @param dateStr - The date string to validate in DD/MM/YYYY format\n * @returns Object with validation result, error message if invalid, and parsed Date if valid\n *\n * @example\n * // Valid date\n * validateDateComponents(\"25/12/2024\")\n * // → { isValid: true, parsedDate: Date(2024, 11, 25) }\n *\n * @example\n * // Invalid date (non-existent)\n * validateDateComponents(\"31/02/2024\")\n * // → { isValid: false, error: \"Please enter a valid date\" }\n *\n * @example\n * // Invalid year range\n * validateDateComponents(\"25/12/999\")\n * // → { isValid: false, error: \"Year must be between 1000 and 3000\" }\n *\n * @example\n * // Empty input\n * validateDateComponents(\"\")\n * // → { isValid: true }\n */\nconst validateDateComponents = (\n dateStr: string,\n): {\n isValid: boolean;\n error?: string;\n parsedDate?: Date;\n} => {\n // Empty strings are considered valid (user hasn't started typing)\n if (!dateStr?.trim()) {\n return { isValid: true };\n }\n\n // Use DayJS strict parsing to validate DD/MM/YYYY format and date existence\n const parsed = dayjs(dateStr, 'DD/MM/YYYY', true);\n\n // DayJS strict mode catches invalid days/months and non-existent dates (e.g., Feb 30th)\n if (!parsed.isValid()) {\n return { isValid: false, error: 'Please enter a valid date' };\n }\n\n // Business rule: restrict year range to reasonable values for most applications\n const year = parsed.year();\n if (year < 1000 || year > 3000) {\n return { isValid: false, error: 'Year must be between 1000 and 3000' };\n }\n\n // Return both validation result AND parsed date to avoid double parsing\n return { isValid: true, parsedDate: parsed.toDate() };\n};\n\n/**\n * Detects and parses special single date formats (MMM, MMMM, YYYY)\n * These formats preserve current date/month/year and only change the specified component\n *\n * @param inputValue - The input string to parse\n * @param format - The expected format ('MMM', 'MMMM', or 'YYYY')\n * @returns Object with special format detection, parsed date, and validation result\n *\n * @example\n * // Year format - preserves current month/day, changes year\n * parseSpecialSingleFormat(\"2024\", \"YYYY\")\n * // → { isSpecialFormat: true, parsedDate: Date(2024, currentMonth, currentDay), shouldBlock: false }\n *\n * @example\n * // Short month format - preserves current day/year, changes month\n * parseSpecialSingleFormat(\"Aug\", \"MMM\")\n * // → { isSpecialFormat: true, parsedDate: Date(currentYear, 7, currentDay), shouldBlock: false }\n *\n * @example\n * // Full month format - preserves current day/year, changes month\n * parseSpecialSingleFormat(\"August\", \"MMMM\")\n * // → { isSpecialFormat: true, parsedDate: Date(currentYear, 7, currentDay), shouldBlock: false }\n *\n * @example\n * // Invalid year\n * parseSpecialSingleFormat(\"999\", \"YYYY\")\n * // → { isSpecialFormat: true, shouldBlock: true }\n *\n * @example\n * // Not a special format\n * parseSpecialSingleFormat(\"25/12/2024\", \"DD/MM/YYYY\")\n * // → { isSpecialFormat: false, shouldBlock: false }\n */\nconst parseSpecialSingleFormat = (\n inputValue: string,\n format?: string,\n): { isSpecialFormat: boolean; parsedDate?: Date; shouldBlock: boolean } => {\n if (!format) return { isSpecialFormat: false, shouldBlock: false };\n\n const trimmedInput = inputValue.trim();\n const today = new Date();\n\n // Handle year-only format (YYYY) - keep current month and day, change year\n if (format === 'YYYY' && /^\\d{4}$/.test(trimmedInput)) {\n const year = parseInt(trimmedInput, 10);\n if (year >= 1000 && year <= 3000) {\n return {\n isSpecialFormat: true,\n parsedDate: new Date(year, today.getMonth(), today.getDate()),\n shouldBlock: false,\n };\n } else {\n return {\n isSpecialFormat: true,\n shouldBlock: true,\n };\n }\n }\n\n // Handle month formats (MMM, MMMM) - keep current day and year, change month\n if ((format === 'MMM' || format === 'MMMM') && trimmedInput.length >= 3) {\n // Using DayJS to parse month names (handles both short \"Aug\" and full \"August\")\n const monthDate = dayjs(trimmedInput, format === 'MMM' ? 'MMM' : 'MMMM', true);\n\n if (!monthDate.isValid()) {\n return {\n isSpecialFormat: true,\n shouldBlock: true,\n };\n }\n return {\n isSpecialFormat: true,\n parsedDate: new Date(today.getFullYear(), monthDate.month(), today.getDate()),\n shouldBlock: false,\n };\n }\n\n return { isSpecialFormat: false, shouldBlock: false };\n};\n\n/**\n * Validates and parses date input with comprehensive error handling and constraint checking\n * Combines validation + parsing to avoid redundant operations and supports both single dates and ranges\n *\n * @param inputValue - The input string to validate and parse\n * @param isRange - Whether this is a range input (true) or single date (false)\n * @param format - The expected date format ('DD/MM/YYYY', 'MMM', 'MMMM', 'YYYY')\n * @param options - Additional validation constraints\n * @param options.excludeDate - Function to exclude specific dates (single dates only)\n * @param options.minDate - Minimum allowed date\n * @param options.maxDate - Maximum allowed date\n * @returns Object with shouldBlock flag, optional error message, and parsed values if valid\n *\n * @example\n * // Valid single date\n * validateAndParseDateInput(\"25/12/2024\", false, \"DD/MM/YYYY\")\n * // → { shouldBlock: false, parsedValue: Date(2024, 11, 25) }\n *\n * @example\n * // Valid range input\n * validateAndParseDateInput(\"25/12/2024 – 31/12/2024\", true, \"DD/MM/YYYY\")\n * // → { shouldBlock: false, parsedValue: [Date(2024, 11, 25), Date(2024, 11, 31)] }\n *\n * @example\n * // Invalid date with error\n * validateAndParseDateInput(\"31/02/2024\", false, \"DD/MM/YYYY\")\n * // → { shouldBlock: true, error: \"Please enter a valid date in DD/MM/YYYY format\" }\n *\n * @example\n * // Date excluded by constraint\n * validateAndParseDateInput(\"25/12/2024\", false, \"DD/MM/YYYY\", {\n * excludeDate: (date) => date.getDay() === 0 // No Sundays\n * })\n * // → { shouldBlock: true, error: \"This date is not available for selection\" }\n *\n * @example\n * // Special format - year only\n * validateAndParseDateInput(\"2024\", false, \"YYYY\")\n * // → { shouldBlock: false, parsedValue: Date(2024, currentMonth, currentDay) }\n *\n * @example\n * // Incomplete input - allow continued typing\n * validateAndParseDateInput(\"25/12\", false, \"DD/MM/YYYY\")\n * // → { shouldBlock: false } (no parsedValue, allows user to continue typing)\n */\nconst validateAndParseDateInput = (\n inputValue: string,\n isRange: boolean,\n format?: string,\n options?: {\n excludeDate?: (date: Date) => boolean;\n minDate?: Date;\n maxDate?: Date;\n },\n): {\n shouldBlock: boolean;\n error?: string;\n parsedValue?: Date | null | [Date | null, Date | null];\n} => {\n // Allow empty input - user hasn't started typing yet\n if (!inputValue?.trim()) return { shouldBlock: false };\n\n // Handle special single date formats (MMM, MMMM, YYYY) - skip normal validation\n if (!isRange && format) {\n const specialParse = parseSpecialSingleFormat(inputValue, format);\n if (specialParse.isSpecialFormat && !specialParse.shouldBlock) {\n return { shouldBlock: false, parsedValue: specialParse.parsedDate || null };\n } else if (specialParse.shouldBlock) {\n return { shouldBlock: true, error: 'Please enter a valid date' };\n }\n }\n\n if (isRange) {\n // Split range input on en dash separator (e.g., \"25/12/2024 – 31/12/2024\")\n const parts = inputValue.split(/\\s*–\\s*/);\n\n // Enhanced: Block incomplete input with partial validation\n if (\n (parts[0]?.trim() && parts[0].trim().length < 10) ||\n (parts[1]?.trim() && parts[1].trim().length < 10)\n ) {\n // Check start date part if it exists and has content\n if (parts[0]?.trim()) {\n const startPartialValidation = validatePartialDateSimple(parts[0].trim());\n if (!startPartialValidation.isValid) {\n return { shouldBlock: true, error: `Start date: ${startPartialValidation.error}` };\n }\n }\n\n // Check end date part if it exists and has content\n if (parts[1]?.trim()) {\n const endPartialValidation = validatePartialDateSimple(parts[1].trim());\n if (!endPartialValidation.isValid) {\n return { shouldBlock: true, error: `End date: ${endPartialValidation.error}` };\n }\n }\n\n // If partial validation passes, allow continued typing\n return { shouldBlock: false };\n }\n\n let startDate: Date | null = null;\n let endDate: Date | null = null;\n\n // Validate and parse start date if it looks complete (10+ chars = DD/MM/YYYY)\n if (parts[0]?.trim() && parts[0].trim().length >= 10) {\n const startValidation = validateDateComponents(parts[0].trim());\n if (!startValidation.isValid) {\n return { shouldBlock: true, error: `Start date: ${startValidation.error}` };\n }\n // Use the already-parsed date from validation to avoid double parsing\n startDate = startValidation.parsedDate || null;\n }\n\n // Validate and parse end date if it looks complete\n if (parts[1]?.trim() && parts[1].trim().length >= 10) {\n const endValidation = validateDateComponents(parts[1].trim());\n if (!endValidation.isValid) {\n return { shouldBlock: true, error: `End date: ${endValidation.error}` };\n }\n // Use the already-parsed date from validation to avoid double parsing\n endDate = endValidation.parsedDate || null;\n }\n\n // Business logic: start date cannot be after end date\n if (startDate && endDate && startDate > endDate) {\n return { shouldBlock: true, error: 'Start date cannot be greater than end date' };\n }\n\n // Additional validation for date range constraints\n if (options) {\n if (startDate && options.minDate && dayjs(startDate).isBefore(dayjs(options.minDate))) {\n return { shouldBlock: true, error: 'Start date is before the minimum allowed date' };\n }\n if (startDate && options.maxDate && dayjs(startDate).isAfter(dayjs(options.maxDate))) {\n return { shouldBlock: true, error: 'Start date is after the maximum allowed date' };\n }\n if (endDate && options.minDate && dayjs(endDate).isBefore(dayjs(options.minDate))) {\n return { shouldBlock: true, error: 'End date is before the minimum allowed date' };\n }\n if (endDate && options.maxDate && dayjs(endDate).isAfter(dayjs(options.maxDate))) {\n return { shouldBlock: true, error: 'End date is after the maximum allowed date' };\n }\n }\n\n // Return parsed dates ready for setControlledValue\n return { shouldBlock: false, parsedValue: [startDate, endDate] };\n } else if (inputValue.length >= 10) {\n // Single date: validate and parse if it looks complete\n const validation = validateDateComponents(inputValue);\n if (!validation.isValid) {\n return { shouldBlock: true, error: validation.error };\n }\n\n const parsedDate = validation.parsedDate;\n\n // Additional validation for single date constraints\n if (options && parsedDate) {\n if (options.excludeDate?.(parsedDate)) {\n return { shouldBlock: true, error: 'This date is not available for selection' };\n }\n if (options.minDate && dayjs(parsedDate).isBefore(dayjs(options.minDate))) {\n return { shouldBlock: true, error: 'Date is before the minimum allowed date' };\n }\n if (options.maxDate && dayjs(parsedDate).isAfter(dayjs(options.maxDate))) {\n return { shouldBlock: true, error: 'Date is after the maximum allowed date' };\n }\n }\n\n // Return parsed date ready for setControlledValue\n return { shouldBlock: false, parsedValue: parsedDate || null };\n } else {\n // Partial validation for incomplete single date\n const partialValidation = validatePartialDateSimple(inputValue);\n if (!partialValidation.isValid) {\n return { shouldBlock: true, error: partialValidation.error };\n }\n\n // If partial validation passes, allow continued typing\n return { shouldBlock: false };\n }\n\n // This line should not be reached, but keeping for safety\n return { shouldBlock: false };\n};\n\n/**\n * Simple partial date validation using / splitting\n * Since special formats (MMM, MMMM, YYYY) are handled before this function\n *\n * @param input - The partial date input to validate\n * @returns Object with validation result and optional error message\n *\n * @example\n * // Valid partial input\n * validatePartialDateSimple(\"15\")\n * // → { isValid: true }\n *\n * @example\n * // Invalid day\n * validatePartialDateSimple(\"35\")\n * // → { isValid: false, error: \"Day cannot be greater than 31\" }\n *\n * @example\n * // Invalid month\n * validatePartialDateSimple(\"15/13\")\n * // → { isValid: false, error: \"Month cannot be greater than 12\" }\n *\n * @example\n * // Invalid day-month combination\n * validatePartialDateSimple(\"30/02\")\n * // → { isValid: false, error: \"February cannot have more than 29 days\" }\n */\nfunction validatePartialDateSimple(input: string): { isValid: boolean; error?: string } {\n // Don't validate empty input - let user start typing\n if (!input?.trim()) {\n return { isValid: true };\n }\n\n // Split by / to get day, month parts\n const parts = input.split('/');\n\n // Validate day part (first part)\n if (parts[0]?.length >= 2) {\n const dayStr = parts[0].trim();\n if (dayStr.length > 0) {\n const day = parseInt(dayStr, 10);\n\n // Day must be valid number\n if (isNaN(day)) {\n return { isValid: false, error: 'Please enter a valid day (01-31)' };\n }\n\n // Day cannot be greater than 31\n if (day > 31) {\n return { isValid: false, error: 'Day cannot be greater than 31' };\n }\n\n // Day cannot be 00\n if (day === 0) {\n return { isValid: false, error: 'Day cannot be 00, please enter 01-31' };\n }\n }\n }\n\n // Validate month part (second part)\n if (parts[1]?.length >= 2) {\n const monthStr = parts[1].trim();\n if (monthStr.length > 0) {\n const month = parseInt(monthStr, 10);\n\n // Month must be valid number\n if (isNaN(month)) {\n return { isValid: false, error: 'Please enter a valid month (01-12)' };\n }\n\n // Month cannot be greater than 12\n if (month > 12) {\n return { isValid: false, error: 'Month cannot be greater than 12' };\n }\n\n // Month cannot be 00\n if (month === 0) {\n return { isValid: false, error: 'Month cannot be 00, please enter 01-12' };\n }\n\n // Basic day-month validation (no DayJS needed)\n const day = parts[0]?.trim() ? parseInt(parts[0].trim(), 10) : NaN;\n if (!isNaN(day)) {\n // February cannot have more than 29 days\n if (month === 2 && day > 29) {\n return { isValid: false, error: 'February cannot have more than 29 days' };\n }\n\n // Months with 30 days: April(4), June(6), September(9), November(11)\n if ([4, 6, 9, 11].includes(month) && day > 30) {\n return {\n isValid: false,\n error: `${MONTH_NAMES[month - 1]} cannot have more than 30 days`,\n };\n }\n }\n }\n }\n\n // If we get here, partial input is valid\n return { isValid: true };\n}\n\n/**\n * Removes date delimiters (slashes) from formatted date strings for internal processing\n * Used to convert external formatted values to internal state for easier validation and length checks\n *\n * @param str - The date string with delimiters\n * @returns String without delimiters, or empty string if input is null/undefined\n *\n * @example\n * // Remove slashes from single date\n * stripDelimiters(\"25/12/2024\")\n * // → \"25122024\"\n *\n * @example\n * // Handle null/undefined input\n * stripDelimiters(undefined)\n * // → \"\"\n *\n * @example\n * // Used for internal state conversion\n * stripDelimiters(\"31/12/2024\")\n * // → \"31122024\" (easier for length checks: inputValue.length === 8)\n */\nconst stripDelimiters = (str?: string): string => str?.replace(/\\//g, '') ?? '';\n\nexport {\n convertIntlToDayjsLocale,\n loadScript,\n getFormattedDate,\n rangeFormattedValue,\n rangeInputPlaceHolder,\n finalInputFormat,\n getTextInputFormat,\n validateDateComponents,\n validateAndParseDateInput,\n validatePartialDateSimple,\n stripDelimiters,\n};\n"],"names":["dayjs","extend","customParseFormat","dayjs_locales","MONTH_NAMES","patchLocale","locale","includes","convertIntlToDayjsLocale","lang","toLowerCase","split","concat","isScriptLoaded","src","Boolean","document","querySelector","loadScript","callback","localeScript","createElement","async","onload","head","appendChild","defaultDateFormatter","_ref","type","date","format","labelSeparator","formatDate","value","Array","isArray","getFormattedDate","_ref2","formatter","others","_objectWithoutProperties","_excluded","rangeFormattedValue","startValue","endValue","rangeInputPlaceHolder","placeholder","finalInputFormat","getTextInputFormat","formatStr","isRangeInput","replace","validateDateComponents","dateStr","trim","isValid","parsed","error","year","parsedDate","toDate","parseSpecialSingleFormat","inputValue","isSpecialFormat","shouldBlock","trimmedInput","today","Date","test","parseInt","getMonth","getDate","length","monthDate","getFullYear","month","validateAndParseDateInput","isRange","options","specialParse","parsedValue","_parts$","_parts$2","_parts$5","_parts$6","parts","_parts$3","_parts$4","startPartialValidation","validatePartialDateSimple","endPartialValidation","startDate","endDate","startValidation","endValidation","minDate","isBefore","maxDate","isAfter","validation","_options$excludeDate","excludeDate","call","partialValidation","input","_parts$7","_parts$8","dayStr","day","isNaN","monthStr","_parts$9","NaN","stripDelimiters","str","_str$replace"],"mappings":";;;;;AAMAA,KAAK,CAACC,MAAM,CAACC,iBAAiB,CAAC,CAAA;AAE/B,IAAMC,aAAa,GAAG,CACpB,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,IAAI,EAC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A,IAAIjC,KAAK,KAAK,CAAC,IAAIiC,IAAG,GAAG,EAAE,EAAE;UAC3B,OAAO;AAAErD,YAAAA,OAAO,EAAE,KAAK;AAAEE,YAAAA,KAAK,EAAE,wCAAA;WAA0C,CAAA;AAC5E,SAAA;;AAEA;AACA,QAAA,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAClD,QAAQ,CAACoE,KAAK,CAAC,IAAIiC,IAAG,GAAG,EAAE,EAAE;UAC7C,OAAO;AACLrD,YAAAA,OAAO,EAAE,KAAK;YACdE,KAAK,EAAA,EAAA,CAAA7C,MAAA,CAAKR,WAAW,CAACuE,KAAK,GAAG,CAAC,CAAC,EAAA,gCAAA,CAAA;WACjC,CAAA;AACH,SAAA;AACF,OAAA;AACF,KAAA;AACF,GAAA;;AAEA;EACA,OAAO;AAAEpB,IAAAA,OAAO,EAAE,IAAA;GAAM,CAAA;AAC1B,CAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAM0D,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,GAAY,EAAA;AAAA,EAAA,IAAAC,YAAA,CAAA;AAAA,EAAA,OAAA,CAAAA,YAAA,GAAaD,GAAG,aAAHA,GAAG,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAHA,GAAG,CAAE/D,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,MAAA,IAAA,IAAAgE,YAAA,KAAAA,KAAAA,CAAAA,GAAAA,YAAA,GAAI,EAAE,CAAA;AAAA;;;;"}
|
|
@@ -11,10 +11,11 @@ import '../../../utils/makeAccessible/index.js';
|
|
|
11
11
|
import { useMergeRefs } from '../../../utils/useMergeRefs.js';
|
|
12
12
|
import '../../../utils/getFocusRingStyles/index.js';
|
|
13
13
|
import '../../../utils/makeAnalyticsAttribute/index.js';
|
|
14
|
+
import { useBottomSheetContext } from '../../BottomSheet/BottomSheetContext.js';
|
|
14
15
|
import { jsx } from 'react/jsx-runtime';
|
|
15
16
|
import { castWebType } from '../../../utils/platform/castUtils.js';
|
|
16
17
|
import { makeMotionTime } from '../../../utils/makeMotionTime/makeMotionTime.web.js';
|
|
17
|
-
import { screenReaderStyles } from '../../VisuallyHidden/ScreenReaderStyles.js';
|
|
18
|
+
import { legacyScreenReaderStyles, screenReaderStyles } from '../../VisuallyHidden/ScreenReaderStyles.js';
|
|
18
19
|
import { getFocusRingStyles } from '../../../utils/getFocusRingStyles/getFocusRingStyles.web.js';
|
|
19
20
|
import { makeAccessible } from '../../../utils/makeAccessible/makeAccessible.web.js';
|
|
20
21
|
import { makeAnalyticsAttribute } from '../../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
|
|
@@ -49,8 +50,9 @@ var StyledInput = /*#__PURE__*/styled.input.withConfig({
|
|
|
49
50
|
isChecked = _ref2.isChecked,
|
|
50
51
|
isDisabled = _ref2.isDisabled,
|
|
51
52
|
hasError = _ref2.hasError,
|
|
52
|
-
hoverTokens = _ref2.hoverTokens
|
|
53
|
-
|
|
53
|
+
hoverTokens = _ref2.hoverTokens,
|
|
54
|
+
shouldUseLegacyScreenReaderStyles = _ref2.shouldUseLegacyScreenReaderStyles;
|
|
55
|
+
return _objectSpread(_objectSpread({}, shouldUseLegacyScreenReaderStyles ? legacyScreenReaderStyles : screenReaderStyles), {}, {
|
|
54
56
|
'&:focus-visible + div': _objectSpread({}, getFocusRingStyles({
|
|
55
57
|
theme: theme
|
|
56
58
|
})),
|
|
@@ -77,13 +79,16 @@ var _SelectorInput = function _SelectorInput(_ref3, ref) {
|
|
|
77
79
|
// to be able to set the mixed value via setMixed() function
|
|
78
80
|
// TODO: replace with a generic `mergeRefs()` util if we do this in other places
|
|
79
81
|
var mergedRef = useMergeRefs(ref, inputProps.ref);
|
|
82
|
+
var _useBottomSheetContex = useBottomSheetContext(),
|
|
83
|
+
isInBottomSheet = _useBottomSheetContex.isInBottomSheet;
|
|
80
84
|
return /*#__PURE__*/jsx(StyledInput, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
81
85
|
id: id,
|
|
82
86
|
isChecked: isChecked,
|
|
83
87
|
isDisabled: isDisabled,
|
|
84
88
|
hasError: hasError,
|
|
85
89
|
tabIndex: tabIndex,
|
|
86
|
-
hoverTokens: hoverTokens
|
|
90
|
+
hoverTokens: hoverTokens,
|
|
91
|
+
shouldUseLegacyScreenReaderStyles: isInBottomSheet
|
|
87
92
|
}, inputProps), makeAccessible({
|
|
88
93
|
label: accessibilityLabel
|
|
89
94
|
})), makeAnalyticsAttribute(rest)), {}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectorInput.web.js","sources":["../../../../../../../src/components/Form/Selector/SelectorInput.web.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\nimport type { CSSObject } from 'styled-components';\nimport React from 'react';\nimport styled from 'styled-components';\nimport type { HoverProps, SelectorInputProps } from './types';\nimport getIn from '~utils/lodashButBetter/get';\nimport type { Theme } from '~components/BladeProvider';\nimport { castWebType } from '~utils';\nimport { screenReaderStyles } from '~components/VisuallyHidden';\nimport type { BladeElementRef } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeMotionTime } from '~utils/makeMotionTime';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { useMergeRefs } from '~utils/useMergeRefs';\nimport { getFocusRingStyles } from '~utils/getFocusRingStyles';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\n\nconst getHoverStyles = ({\n theme,\n isDisabled,\n hasError,\n isChecked,\n hoverTokens,\n}: { theme: Theme } & HoverProps): CSSObject => {\n if (isDisabled || hasError) return {};\n\n const checked = isChecked ? 'checked' : 'unchecked';\n const backgroundColor = hoverTokens.default.background[checked];\n const borderColor = hoverTokens.default.border?.[checked];\n\n return {\n borderColor: borderColor ? getIn(theme, borderColor) : undefined,\n backgroundColor: getIn(theme, backgroundColor),\n transitionTimingFunction: theme.motion.easing.standard as string,\n transitionDuration: castWebType(makeMotionTime(theme.motion.duration['2xquick'])),\n };\n};\n\nconst StyledInput = styled.input
|
|
1
|
+
{"version":3,"file":"SelectorInput.web.js","sources":["../../../../../../../src/components/Form/Selector/SelectorInput.web.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\nimport type { CSSObject } from 'styled-components';\nimport React from 'react';\nimport styled from 'styled-components';\nimport type { HoverProps, SelectorInputProps } from './types';\nimport getIn from '~utils/lodashButBetter/get';\nimport type { Theme } from '~components/BladeProvider';\nimport { castWebType } from '~utils';\nimport { screenReaderStyles, legacyScreenReaderStyles } from '~components/VisuallyHidden';\nimport type { BladeElementRef } from '~utils/types';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeMotionTime } from '~utils/makeMotionTime';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { useMergeRefs } from '~utils/useMergeRefs';\nimport { getFocusRingStyles } from '~utils/getFocusRingStyles';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport { useBottomSheetContext } from '~components/BottomSheet/BottomSheetContext';\n\nconst getHoverStyles = ({\n theme,\n isDisabled,\n hasError,\n isChecked,\n hoverTokens,\n}: { theme: Theme } & HoverProps): CSSObject => {\n if (isDisabled || hasError) return {};\n\n const checked = isChecked ? 'checked' : 'unchecked';\n const backgroundColor = hoverTokens.default.background[checked];\n const borderColor = hoverTokens.default.border?.[checked];\n\n return {\n borderColor: borderColor ? getIn(theme, borderColor) : undefined,\n backgroundColor: getIn(theme, backgroundColor),\n transitionTimingFunction: theme.motion.easing.standard as string,\n transitionDuration: castWebType(makeMotionTime(theme.motion.duration['2xquick'])),\n };\n};\n\nconst StyledInput = styled.input<\n HoverProps & {\n shouldUseLegacyScreenReaderStyles?: boolean;\n }\n>(({ theme, isChecked, isDisabled, hasError, hoverTokens, shouldUseLegacyScreenReaderStyles }) => ({\n ...(shouldUseLegacyScreenReaderStyles ? legacyScreenReaderStyles : screenReaderStyles),\n '&:focus-visible + div': {\n ...getFocusRingStyles({ theme }),\n },\n '&:hover + div': {\n ...getHoverStyles({ theme, isChecked, isDisabled, hasError, hoverTokens }),\n },\n}));\n\nconst _SelectorInput: React.ForwardRefRenderFunction<BladeElementRef, SelectorInputProps> = (\n {\n id,\n inputProps,\n isChecked,\n isDisabled,\n hasError,\n hoverTokens,\n tabIndex,\n accessibilityLabel,\n ...rest\n },\n ref,\n) => {\n // merging both refs because inputProps.ref needs to have access to indeterminate state\n // to be able to set the mixed value via setMixed() function\n // TODO: replace with a generic `mergeRefs()` util if we do this in other places\n const mergedRef = useMergeRefs(ref, inputProps.ref);\n const { isInBottomSheet } = useBottomSheetContext();\n\n return (\n <StyledInput\n id={id}\n isChecked={isChecked}\n isDisabled={isDisabled}\n hasError={hasError}\n tabIndex={tabIndex}\n hoverTokens={hoverTokens}\n shouldUseLegacyScreenReaderStyles={isInBottomSheet}\n {...inputProps}\n {...makeAccessible({ label: accessibilityLabel })}\n {...makeAnalyticsAttribute(rest)}\n ref={mergedRef}\n />\n );\n};\n\nconst SelectorInput = assignWithoutSideEffects(React.forwardRef(_SelectorInput), {\n displayName: 'SelectorInput',\n});\n\nexport { SelectorInput };\n"],"names":["getHoverStyles","_ref","_hoverTokens$default$","theme","isDisabled","hasError","isChecked","hoverTokens","checked","backgroundColor","background","borderColor","border","getIn","undefined","transitionTimingFunction","motion","easing","standard","transitionDuration","castWebType","makeMotionTime","duration","StyledInput","styled","input","withConfig","displayName","componentId","_ref2","shouldUseLegacyScreenReaderStyles","_objectSpread","legacyScreenReaderStyles","screenReaderStyles","getFocusRingStyles","_SelectorInput","_ref3","ref","id","inputProps","tabIndex","accessibilityLabel","rest","_objectWithoutProperties","_excluded","mergedRef","useMergeRefs","_useBottomSheetContex","useBottomSheetContext","isInBottomSheet","_jsx","makeAccessible","label","makeAnalyticsAttribute","SelectorInput","assignWithoutSideEffects","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,IAAMA,cAAc,GAAG,SAAjBA,cAAcA,CAAAC,IAAA,EAM4B;AAAA,EAAA,IAAAC,qBAAA,CAAA;AAAA,EAAA,IAL9CC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,UAAU,GAAAH,IAAA,CAAVG,UAAU;IACVC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;IACRC,SAAS,GAAAL,IAAA,CAATK,SAAS;IACTC,WAAW,GAAAN,IAAA,CAAXM,WAAW,CAAA;AAEX,EAAA,IAAIH,UAAU,IAAIC,QAAQ,EAAE,OAAO,EAAE,CAAA;AAErC,EAAA,IAAMG,OAAO,GAAGF,SAAS,GAAG,SAAS,GAAG,WAAW,CAAA;EACnD,IAAMG,eAAe,GAAGF,WAAW,CAAA,SAAA,CAAQ,CAACG,UAAU,CAACF,OAAO,CAAC,CAAA;AAC/D,EAAA,IAAMG,WAAW,GAAA,CAAAT,qBAAA,GAAGK,WAAW,CAAQ,SAAA,CAAA,CAACK,MAAM,MAAA,IAAA,IAAAV,qBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAA1BA,qBAAA,CAA6BM,OAAO,CAAC,CAAA;EAEzD,OAAO;IACLG,WAAW,EAAEA,WAAW,GAAGE,KAAK,CAACV,KAAK,EAAEQ,WAAW,CAAC,GAAGG,SAAS;AAChEL,IAAAA,eAAe,EAAEI,KAAK,CAACV,KAAK,EAAEM,eAAe,CAAC;AAC9CM,IAAAA,wBAAwB,EAAEZ,KAAK,CAACa,MAAM,CAACC,MAAM,CAACC,QAAkB;AAChEC,IAAAA,kBAAkB,EAAEC,WAAW,CAACC,cAAc,CAAClB,KAAK,CAACa,MAAM,CAACM,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAA;GACjF,CAAA;AACH,CAAC,CAAA;AA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