beesoft-components 0.3.0-1 → 0.3.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.
Files changed (32) hide show
  1. package/build/index.cjs.js +449 -731
  2. package/build/index.js +449 -731
  3. package/build/index.min.js +6 -6
  4. package/build/index.min.js.gz +0 -0
  5. package/build/types/src/components/form/date-time/date-time-format-creator.d.ts +28 -0
  6. package/build/types/src/components/form/date-time/date-time-functions.d.ts +0 -2
  7. package/build/types/src/components/form/date-time/date-time.reducer.d.ts +1 -4
  8. package/build/types/src/components/form/date-time/hooks/get-date-time-format.hook.d.ts +4 -0
  9. package/build/types/src/components/form/input/formatted-input/formatted-input.component.d.ts +1 -3
  10. package/build/types/src/components/form/input/formatted-input/parser/format-instance-collection.d.ts +1 -1
  11. package/build/types/src/components/form/input/formatted-input/parser/format-navigator.d.ts +1 -1
  12. package/build/types/src/components/form/input/formatted-input/parser/format-parser.d.ts +1 -1
  13. package/build/types/src/components/form/input/formatted-input/parser/format-renderer.d.ts +1 -1
  14. package/build/types/src/components/form/input/formatted-input/parser/input-rule-processor.d.ts +1 -1
  15. package/build/types/src/components/form/input/formatted-input/parser/input-slot-collection.d.ts +1 -1
  16. package/build/types/src/components/form/input/formatted-input/parser/key-processor.d.ts +1 -1
  17. package/build/types/src/components/form/input/formatted-input/parser/parser.interfaces.d.ts +1 -1
  18. package/build/types/src/components/form/input/formatted-input/parser/part-entry-creator.d.ts +1 -1
  19. package/build/types/src/components/form/input/formatted-input/parser/part-entry-iterator.d.ts +1 -1
  20. package/build/types/src/components/overlay/overlay-panel/overlay-panel.component.d.ts +2 -1
  21. package/package.json +1 -1
  22. package/build/types/src/components/form/input/formatted-input/formats/date/day-month-year/format.d.ts +0 -3
  23. package/build/types/src/components/form/input/formatted-input/formats/date/month-day-year/format.d.ts +0 -3
  24. package/build/types/src/components/form/input/formatted-input/formats/date/year-month-day/format.d.ts +0 -3
  25. package/build/types/src/components/form/input/formatted-input/formats/date-range/day-month-year/format.d.ts +0 -3
  26. package/build/types/src/components/form/input/formatted-input/formats/date-range/month-day-year/format.d.ts +0 -3
  27. package/build/types/src/components/form/input/formatted-input/formats/date-range/year-month-day/format.d.ts +0 -3
  28. package/build/types/src/components/form/input/formatted-input/formats/index.d.ts +0 -9
  29. package/build/types/src/components/form/input/formatted-input/formats/input-format.enums.d.ts +0 -11
  30. package/build/types/src/components/form/input/formatted-input/formats/time/12-hour/format.d.ts +0 -3
  31. package/build/types/src/components/form/input/formatted-input/formats/time/24-hour/format.d.ts +0 -3
  32. /package/build/types/src/components/form/input/formatted-input/{formats/input-format.interfaces.d.ts → input-format.interfaces.d.ts} +0 -0
@@ -66,6 +66,16 @@ function __generator(thisArg, body) {
66
66
  } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
67
67
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
68
68
  }
69
+ }
70
+
71
+ function __spreadArray(to, from, pack) {
72
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
73
+ if (ar || !(i in from)) {
74
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
75
+ ar[i] = from[i];
76
+ }
77
+ }
78
+ return to.concat(ar || Array.prototype.slice.call(from));
69
79
  }
70
80
 
71
81
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -30277,7 +30287,7 @@ var DomHandler = (function () {
30277
30287
  }());
30278
30288
 
30279
30289
  function OverlayPanel(_a) {
30280
- var visible = _a.visible, target = _a.target, _b = _a.targetPosition, targetPosition = _b === void 0 ? DomTargetPosition.BottomLeft : _b, _c = _a.elementAlignment, elementAlignment = _c === void 0 ? DomElementAlignment.TopLeft : _c, _d = _a.shouldTargetCloseOverlay, shouldTargetCloseOverlay = _d === void 0 ? true : _d, _e = _a.shouldMatchTargetWidth, shouldMatchTargetWidth = _e === void 0 ? false : _e, _f = _a.shouldScrollCloseOverlay, shouldScrollCloseOverlay = _f === void 0 ? false : _f, _g = _a.shouldCheckZIndex, shouldCheckZIndex = _g === void 0 ? false : _g, _h = _a.shouldRemainOnScreen, shouldRemainOnScreen = _h === void 0 ? false : _h, _j = _a.unmountWhenHidden, unmountWhenHidden = _j === void 0 ? false : _j, _k = _a.transitionDuration, transitionDuration = _k === void 0 ? 400 : _k, _l = _a.showTransitionOptions, showTransitionOptions = _l === void 0 ? 'cubic-bezier(0, 0, 0.2, 1)' : _l, _m = _a.hideTransitionOptions, hideTransitionOptions = _m === void 0 ? 'linear' : _m, shown = _a.shown, hidden = _a.hidden, markupCreated = _a.markupCreated, children = _a.children;
30290
+ var visible = _a.visible, target = _a.target, _b = _a.targetPosition, targetPosition = _b === void 0 ? DomTargetPosition.BottomLeft : _b, _c = _a.elementAlignment, elementAlignment = _c === void 0 ? DomElementAlignment.TopLeft : _c, _d = _a.shouldTargetCloseOverlay, shouldTargetCloseOverlay = _d === void 0 ? true : _d, _e = _a.shouldMatchTargetWidth, shouldMatchTargetWidth = _e === void 0 ? false : _e, _f = _a.shouldScrollCloseOverlay, shouldScrollCloseOverlay = _f === void 0 ? false : _f, _g = _a.shouldCheckZIndex, shouldCheckZIndex = _g === void 0 ? false : _g, _h = _a.shouldRemainOnScreen, shouldRemainOnScreen = _h === void 0 ? false : _h, _j = _a.unmountWhenHidden, unmountWhenHidden = _j === void 0 ? false : _j, _k = _a.transitionDuration, transitionDuration = _k === void 0 ? 400 : _k, _l = _a.showTransitionOptions, showTransitionOptions = _l === void 0 ? 'cubic-bezier(0, 0, 0.2, 1)' : _l, _m = _a.hideTransitionOptions, hideTransitionOptions = _m === void 0 ? 'linear' : _m, shown = _a.shown, hidden = _a.hidden, isClickedWithin = _a.isClickedWithin, markupCreated = _a.markupCreated, children = _a.children;
30281
30291
  var _o = React.useState(-1), zIndex = _o[0], setZIndex = _o[1];
30282
30292
  var _p = React.useState(visible), visibility = _p[0], setVisibility = _p[1];
30283
30293
  var _q = React.useState(false), dimensionsChangedFlag = _q[0], setDimensionsChangedFlag = _q[1];
@@ -30307,7 +30317,7 @@ function OverlayPanel(_a) {
30307
30317
  (_b = resizeObserver.current) === null || _b === void 0 ? void 0 : _b.disconnect();
30308
30318
  }
30309
30319
  };
30310
- }, []);
30320
+ }, [shouldRemainOnScreen]);
30311
30321
  React.useEffect(function () {
30312
30322
  if (target && shouldScrollCloseOverlay) {
30313
30323
  finalTarget.current = getTargetElement(target);
@@ -30381,7 +30391,14 @@ function OverlayPanel(_a) {
30381
30391
  if (!shouldTargetCloseOverlay && finalTarget.current) {
30382
30392
  otherElements = [finalTarget.current];
30383
30393
  }
30384
- var clickListener = function (clickedWithin) { return !clickedWithin && setVisibility(false); };
30394
+ var clickListener = function (clickedWithin) {
30395
+ if (clickedWithin) {
30396
+ isClickedWithin === null || isClickedWithin === void 0 ? void 0 : isClickedWithin();
30397
+ }
30398
+ else {
30399
+ setVisibility(false);
30400
+ }
30401
+ };
30385
30402
  listenerRef.current = bindDocumentClickListener(panelRef.current, clickListener, otherElements);
30386
30403
  if (shouldScrollCloseOverlay) {
30387
30404
  scrollListenerRef.current = lodashExports.throttle(function (event) { return panelRef.current && isEventOutsideTarget(event, panelRef.current) && setVisibility(false); }, 100, { leading: true });
@@ -30433,19 +30450,6 @@ function OverlayPanel(_a) {
30433
30450
  } })));
30434
30451
  }
30435
30452
 
30436
- var FormattedInputDefaultFormats;
30437
- (function (FormattedInputDefaultFormats) {
30438
- FormattedInputDefaultFormats[FormattedInputDefaultFormats["DateDayMonthYear"] = 0] = "DateDayMonthYear";
30439
- FormattedInputDefaultFormats[FormattedInputDefaultFormats["DateMonthDayYear"] = 1] = "DateMonthDayYear";
30440
- FormattedInputDefaultFormats[FormattedInputDefaultFormats["DateYearMonthDay"] = 2] = "DateYearMonthDay";
30441
- FormattedInputDefaultFormats[FormattedInputDefaultFormats["DateRangeDayMonthYear"] = 3] = "DateRangeDayMonthYear";
30442
- FormattedInputDefaultFormats[FormattedInputDefaultFormats["DateRangeMonthDayYear"] = 4] = "DateRangeMonthDayYear";
30443
- FormattedInputDefaultFormats[FormattedInputDefaultFormats["DateRangeYearMonthDay"] = 5] = "DateRangeYearMonthDay";
30444
- FormattedInputDefaultFormats[FormattedInputDefaultFormats["Time12Hour"] = 6] = "Time12Hour";
30445
- FormattedInputDefaultFormats[FormattedInputDefaultFormats["Time24Hour"] = 7] = "Time24Hour";
30446
- FormattedInputDefaultFormats[FormattedInputDefaultFormats["Custom"] = 8] = "Custom";
30447
- })(FormattedInputDefaultFormats || (FormattedInputDefaultFormats = {}));
30448
-
30449
30453
  // Unique ID creation requires a high quality random # generator. In the browser we therefore
30450
30454
  // require the crypto API and do not support built-in fallback to lower quality random number
30451
30455
  // generators (like Math.random()).
@@ -30754,7 +30758,7 @@ var InputSlotCollection = (function () {
30754
30758
  finalSlotIndex = i;
30755
30759
  }
30756
30760
  }
30757
- return this.inputSlots[finalSlotIndex];
30761
+ return this.inputSlots[finalSlotIndex > -1 ? finalSlotIndex : 0];
30758
30762
  };
30759
30763
  InputSlotCollection.prototype.allSlotsCompleted = function () {
30760
30764
  return this.inputSlots.every(function (slot) { return slot.isComplete; });
@@ -31060,7 +31064,12 @@ var InputRuleProcessor = (function () {
31060
31064
  this.addToInputSlot(key);
31061
31065
  inputSlot.isComplete = true;
31062
31066
  this.formatRenderer.render();
31063
- this.formatNavigator.moveToNextInputPart();
31067
+ if (!this.formatNavigator.isAtLastPart()) {
31068
+ this.formatNavigator.moveToNextInputPart();
31069
+ }
31070
+ else {
31071
+ this.formatNavigator.moveCursorRight();
31072
+ }
31064
31073
  }
31065
31074
  else {
31066
31075
  this.addToInputSlot(key);
@@ -31203,7 +31212,7 @@ var FormatParser = (function () {
31203
31212
  var _this = this;
31204
31213
  this.isInputFocused = true;
31205
31214
  this.formatRenderer.render();
31206
- setTimeout(function () { return _this.formatNavigator.setCursorToCurrentPosition(); });
31215
+ setTimeout(function () { return _this.formatNavigator.findCursorPosition(); });
31207
31216
  };
31208
31217
  FormatParser.prototype.inputBlurred = function () {
31209
31218
  this.isInputFocused = false;
@@ -31257,630 +31266,74 @@ var FormatParser = (function () {
31257
31266
  return FormatParser;
31258
31267
  }());
31259
31268
 
31260
- var format$7 = {
31261
- formatParts: [
31262
- {
31263
- characterCount: 2,
31264
- placeholder: 'D',
31265
- inputText: '_',
31266
- isSeparator: false,
31267
- allCharactersRequired: false,
31268
- valueType: FormatValueType.Numeric,
31269
- minimumValue: 1,
31270
- maximumValue: 31,
31271
- exceedingMaximumValueCausesTab: true,
31272
- padWithZeros: true,
31273
- },
31274
- {
31275
- characterCount: 1,
31276
- placeholder: '/',
31277
- inputText: '/',
31278
- isSeparator: true,
31279
- },
31280
- {
31281
- characterCount: 2,
31282
- placeholder: 'M',
31283
- inputText: '_',
31284
- isSeparator: false,
31285
- allCharactersRequired: false,
31286
- valueType: FormatValueType.Numeric,
31287
- minimumValue: 1,
31288
- maximumValue: 12,
31289
- exceedingMaximumValueCausesTab: true,
31290
- padWithZeros: true,
31291
- },
31292
- {
31293
- characterCount: 1,
31294
- placeholder: '/',
31295
- inputText: '/',
31296
- isSeparator: true,
31297
- },
31298
- {
31299
- characterCount: 4,
31300
- placeholder: 'Y',
31301
- inputText: '_',
31302
- isSeparator: false,
31303
- allCharactersRequired: true,
31304
- valueType: FormatValueType.Numeric,
31305
- },
31306
- ],
31307
- };
31308
-
31309
- var format$6 = {
31310
- formatParts: [
31311
- {
31312
- characterCount: 2,
31313
- placeholder: 'M',
31314
- inputText: '_',
31315
- isSeparator: false,
31316
- allCharactersRequired: false,
31317
- valueType: FormatValueType.Numeric,
31318
- minimumValue: 1,
31319
- maximumValue: 12,
31320
- exceedingMaximumValueCausesTab: true,
31321
- padWithZeros: true,
31322
- },
31323
- {
31324
- characterCount: 1,
31325
- placeholder: '/',
31326
- inputText: '/',
31327
- isSeparator: true,
31328
- },
31329
- {
31330
- characterCount: 2,
31331
- placeholder: 'D',
31332
- inputText: '_',
31333
- isSeparator: false,
31334
- allCharactersRequired: false,
31335
- valueType: FormatValueType.Numeric,
31336
- minimumValue: 1,
31337
- maximumValue: 31,
31338
- exceedingMaximumValueCausesTab: true,
31339
- padWithZeros: true,
31340
- },
31341
- {
31342
- characterCount: 1,
31343
- placeholder: '/',
31344
- inputText: '/',
31345
- isSeparator: true,
31346
- },
31347
- {
31348
- characterCount: 4,
31349
- placeholder: 'Y',
31350
- inputText: '_',
31351
- isSeparator: false,
31352
- allCharactersRequired: true,
31353
- valueType: FormatValueType.Numeric,
31354
- },
31355
- ],
31269
+ var FormattedInput = function (props, ref) {
31270
+ var _a = props.value, value = _a === void 0 ? '' : _a, format = props.format, _b = props.readOnly, readOnly = _b === void 0 ? false : _b, _c = props.debounceTime, debounceTime = _c === void 0 ? 800 : _c, _d = props.fillContainer, fillContainer = _d === void 0 ? true : _d, leftElement = props.leftElement, rightElement = props.rightElement, className = props.className, leftElementClassName = props.leftElementClassName, rightElementClassName = props.rightElementClassName, _e = props.isSingleLine, isSingleLine = _e === void 0 ? false : _e, _f = props.allowSingleLineScroll, allowSingleLineScroll = _f === void 0 ? false : _f, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur, onElementCreate = props.onElementCreate, onLeftElementClick = props.onLeftElementClick, onRightElementClick = props.onRightElementClick;
31271
+ var inputRef = React.useRef();
31272
+ var inputElementRef = React.useRef();
31273
+ var formatParser = React.useRef();
31274
+ React.useEffect(function () {
31275
+ return function () {
31276
+ var _a;
31277
+ (_a = formatParser.current) === null || _a === void 0 ? void 0 : _a.dispose();
31278
+ };
31279
+ }, []);
31280
+ React.useEffect(function () {
31281
+ var _a;
31282
+ (_a = formatParser.current) === null || _a === void 0 ? void 0 : _a.inputValuePassed(value);
31283
+ }, [value]);
31284
+ React.useEffect(function () {
31285
+ var _a, _b, _c;
31286
+ (_a = formatParser.current) === null || _a === void 0 ? void 0 : _a.dispose();
31287
+ if (format) {
31288
+ formatParser.current = new FormatParser(format, value);
31289
+ if (inputElementRef.current) {
31290
+ (_b = formatParser.current) === null || _b === void 0 ? void 0 : _b.inputElementCreated(inputElementRef.current);
31291
+ }
31292
+ (_c = formatParser.current) === null || _c === void 0 ? void 0 : _c.registerFormatChangeEvent(onFormatChange);
31293
+ }
31294
+ }, [format]);
31295
+ var onFormatChange = React.useCallback(function (value) {
31296
+ onChange === null || onChange === void 0 ? void 0 : onChange(value);
31297
+ }, [onChange]);
31298
+ var onFocusHandler = React.useCallback(function (event) {
31299
+ var _a;
31300
+ (_a = formatParser.current) === null || _a === void 0 ? void 0 : _a.inputFocused();
31301
+ onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
31302
+ }, [onFocus]);
31303
+ var onBlurHandler = React.useCallback(function (event) {
31304
+ var _a;
31305
+ (_a = formatParser.current) === null || _a === void 0 ? void 0 : _a.inputBlurred();
31306
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
31307
+ }, [onBlur]);
31308
+ var onMouseUpHandler = React.useCallback(function () {
31309
+ var _a;
31310
+ (_a = formatParser.current) === null || _a === void 0 ? void 0 : _a.mouseUpHandler();
31311
+ }, []);
31312
+ var onKeyDownHandler = React.useCallback(function (event) {
31313
+ var _a;
31314
+ (_a = formatParser.current) === null || _a === void 0 ? void 0 : _a.keyDownHandler(event);
31315
+ }, []);
31316
+ var onInputRefCreated = React.useCallback(function (ref) {
31317
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
31318
+ (_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.inputElement) === null || _b === void 0 ? void 0 : _b.removeEventListener('keydown', onKeyDownHandler);
31319
+ (_d = (_c = inputRef.current) === null || _c === void 0 ? void 0 : _c.inputElement) === null || _d === void 0 ? void 0 : _d.removeEventListener('mouseup', onMouseUpHandler);
31320
+ inputRef.current = ref;
31321
+ (_f = (_e = inputRef.current) === null || _e === void 0 ? void 0 : _e.inputElement) === null || _f === void 0 ? void 0 : _f.addEventListener('keydown', onKeyDownHandler);
31322
+ (_h = (_g = inputRef.current) === null || _g === void 0 ? void 0 : _g.inputElement) === null || _h === void 0 ? void 0 : _h.addEventListener('mouseup', onMouseUpHandler);
31323
+ inputElementRef.current = (_j = inputRef.current) === null || _j === void 0 ? void 0 : _j.inputElement;
31324
+ }, []);
31325
+ var focus = React.useCallback(function () {
31326
+ var _a;
31327
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
31328
+ }, []);
31329
+ React.useImperativeHandle(ref, function () { return ({
31330
+ focus: focus,
31331
+ }); });
31332
+ return (jsxRuntime.jsx(ContentEditableInput$1, { ref: function (refElement) { return refElement && onInputRefCreated(refElement); }, readOnly: readOnly, debounceTime: debounceTime, fillContainer: fillContainer, leftElement: leftElement, rightElement: rightElement, className: className, leftElementClassName: leftElementClassName, rightElementClassName: rightElementClassName, isSingleLine: isSingleLine, allowSingleLineScroll: allowSingleLineScroll, onFocus: onFocusHandler, onBlur: onBlurHandler, onElementCreate: onElementCreate, onLeftElementClick: onLeftElementClick, onRightElementClick: onRightElementClick }));
31356
31333
  };
31334
+ var FormattedInput$1 = React.memo(React.forwardRef(FormattedInput));
31357
31335
 
31358
- var format$5 = {
31359
- formatParts: [
31360
- {
31361
- characterCount: 4,
31362
- placeholder: 'Y',
31363
- inputText: '_',
31364
- isSeparator: false,
31365
- allCharactersRequired: true,
31366
- valueType: FormatValueType.Numeric,
31367
- },
31368
- {
31369
- characterCount: 1,
31370
- placeholder: '-',
31371
- inputText: '-',
31372
- isSeparator: true,
31373
- },
31374
- {
31375
- characterCount: 2,
31376
- placeholder: 'M',
31377
- inputText: '_',
31378
- isSeparator: false,
31379
- allCharactersRequired: false,
31380
- valueType: FormatValueType.Numeric,
31381
- minimumValue: 1,
31382
- maximumValue: 12,
31383
- exceedingMaximumValueCausesTab: true,
31384
- padWithZeros: true,
31385
- },
31386
- {
31387
- characterCount: 1,
31388
- placeholder: '-',
31389
- inputText: '-',
31390
- isSeparator: true,
31391
- },
31392
- {
31393
- characterCount: 2,
31394
- placeholder: 'D',
31395
- inputText: '_',
31396
- isSeparator: false,
31397
- allCharactersRequired: false,
31398
- valueType: FormatValueType.Numeric,
31399
- minimumValue: 1,
31400
- maximumValue: 31,
31401
- exceedingMaximumValueCausesError: true,
31402
- padWithZeros: true,
31403
- },
31404
- ],
31405
- };
31406
-
31407
- var format$4 = {
31408
- formatParts: [
31409
- {
31410
- characterCount: 2,
31411
- placeholder: 'D',
31412
- inputText: '_',
31413
- isSeparator: false,
31414
- allCharactersRequired: false,
31415
- valueType: FormatValueType.Numeric,
31416
- minimumValue: 1,
31417
- maximumValue: 31,
31418
- exceedingMaximumValueCausesTab: true,
31419
- padWithZeros: true,
31420
- },
31421
- {
31422
- characterCount: 1,
31423
- placeholder: '/',
31424
- inputText: '/',
31425
- isSeparator: true,
31426
- },
31427
- {
31428
- characterCount: 2,
31429
- placeholder: 'M',
31430
- inputText: '_',
31431
- isSeparator: false,
31432
- allCharactersRequired: false,
31433
- valueType: FormatValueType.Numeric,
31434
- minimumValue: 1,
31435
- maximumValue: 12,
31436
- exceedingMaximumValueCausesTab: true,
31437
- padWithZeros: true,
31438
- },
31439
- {
31440
- characterCount: 1,
31441
- placeholder: '/',
31442
- inputText: '/',
31443
- isSeparator: true,
31444
- },
31445
- {
31446
- characterCount: 4,
31447
- placeholder: 'Y',
31448
- inputText: '_',
31449
- isSeparator: false,
31450
- allCharactersRequired: true,
31451
- valueType: FormatValueType.Numeric,
31452
- },
31453
- {
31454
- characterCount: 3,
31455
- placeholder: ' - ',
31456
- inputText: ' - ',
31457
- isSeparator: true,
31458
- },
31459
- {
31460
- characterCount: 2,
31461
- placeholder: 'D',
31462
- inputText: '_',
31463
- isSeparator: false,
31464
- allCharactersRequired: false,
31465
- valueType: FormatValueType.Numeric,
31466
- minimumValue: 1,
31467
- maximumValue: 31,
31468
- exceedingMaximumValueCausesTab: true,
31469
- padWithZeros: true,
31470
- },
31471
- {
31472
- characterCount: 1,
31473
- placeholder: '/',
31474
- inputText: '/',
31475
- isSeparator: true,
31476
- },
31477
- {
31478
- characterCount: 2,
31479
- placeholder: 'M',
31480
- inputText: '_',
31481
- isSeparator: false,
31482
- allCharactersRequired: false,
31483
- valueType: FormatValueType.Numeric,
31484
- minimumValue: 1,
31485
- maximumValue: 12,
31486
- exceedingMaximumValueCausesTab: true,
31487
- padWithZeros: true,
31488
- },
31489
- {
31490
- characterCount: 1,
31491
- placeholder: '/',
31492
- inputText: '/',
31493
- isSeparator: true,
31494
- },
31495
- {
31496
- characterCount: 4,
31497
- placeholder: 'Y',
31498
- inputText: '_',
31499
- isSeparator: false,
31500
- allCharactersRequired: true,
31501
- valueType: FormatValueType.Numeric,
31502
- },
31503
- ],
31504
- };
31505
-
31506
- var format$3 = {
31507
- formatParts: [
31508
- {
31509
- characterCount: 2,
31510
- placeholder: 'M',
31511
- inputText: '_',
31512
- isSeparator: false,
31513
- allCharactersRequired: false,
31514
- valueType: FormatValueType.Numeric,
31515
- minimumValue: 1,
31516
- maximumValue: 12,
31517
- exceedingMaximumValueCausesTab: true,
31518
- padWithZeros: true,
31519
- },
31520
- {
31521
- characterCount: 1,
31522
- placeholder: '/',
31523
- inputText: '/',
31524
- isSeparator: true,
31525
- },
31526
- {
31527
- characterCount: 2,
31528
- placeholder: 'D',
31529
- inputText: '_',
31530
- isSeparator: false,
31531
- allCharactersRequired: false,
31532
- valueType: FormatValueType.Numeric,
31533
- minimumValue: 1,
31534
- maximumValue: 31,
31535
- exceedingMaximumValueCausesTab: true,
31536
- padWithZeros: true,
31537
- },
31538
- {
31539
- characterCount: 1,
31540
- placeholder: '/',
31541
- inputText: '/',
31542
- isSeparator: true,
31543
- },
31544
- {
31545
- characterCount: 4,
31546
- placeholder: 'Y',
31547
- inputText: '_',
31548
- isSeparator: false,
31549
- allCharactersRequired: true,
31550
- valueType: FormatValueType.Numeric,
31551
- },
31552
- {
31553
- characterCount: 3,
31554
- placeholder: ' - ',
31555
- inputText: ' - ',
31556
- isSeparator: true,
31557
- },
31558
- {
31559
- characterCount: 2,
31560
- placeholder: 'M',
31561
- inputText: '_',
31562
- isSeparator: false,
31563
- allCharactersRequired: false,
31564
- valueType: FormatValueType.Numeric,
31565
- minimumValue: 1,
31566
- maximumValue: 12,
31567
- exceedingMaximumValueCausesTab: true,
31568
- padWithZeros: true,
31569
- },
31570
- {
31571
- characterCount: 1,
31572
- placeholder: '/',
31573
- inputText: '/',
31574
- isSeparator: true,
31575
- },
31576
- {
31577
- characterCount: 2,
31578
- placeholder: 'D',
31579
- inputText: '_',
31580
- isSeparator: false,
31581
- allCharactersRequired: false,
31582
- valueType: FormatValueType.Numeric,
31583
- minimumValue: 1,
31584
- maximumValue: 31,
31585
- exceedingMaximumValueCausesTab: true,
31586
- padWithZeros: true,
31587
- },
31588
- {
31589
- characterCount: 1,
31590
- placeholder: '/',
31591
- inputText: '/',
31592
- isSeparator: true,
31593
- },
31594
- {
31595
- characterCount: 4,
31596
- placeholder: 'Y',
31597
- inputText: '_',
31598
- isSeparator: false,
31599
- allCharactersRequired: true,
31600
- valueType: FormatValueType.Numeric,
31601
- },
31602
- ],
31603
- };
31604
-
31605
- var format$2 = {
31606
- formatParts: [
31607
- {
31608
- characterCount: 4,
31609
- placeholder: 'Y',
31610
- inputText: '_',
31611
- isSeparator: false,
31612
- allCharactersRequired: true,
31613
- valueType: FormatValueType.Numeric,
31614
- },
31615
- {
31616
- characterCount: 1,
31617
- placeholder: '-',
31618
- inputText: '-',
31619
- isSeparator: true,
31620
- },
31621
- {
31622
- characterCount: 2,
31623
- placeholder: 'M',
31624
- inputText: '_',
31625
- isSeparator: false,
31626
- allCharactersRequired: false,
31627
- valueType: FormatValueType.Numeric,
31628
- minimumValue: 1,
31629
- maximumValue: 12,
31630
- exceedingMaximumValueCausesTab: true,
31631
- padWithZeros: true,
31632
- },
31633
- {
31634
- characterCount: 1,
31635
- placeholder: '-',
31636
- inputText: '-',
31637
- isSeparator: true,
31638
- },
31639
- {
31640
- characterCount: 2,
31641
- placeholder: 'D',
31642
- inputText: '_',
31643
- isSeparator: false,
31644
- allCharactersRequired: false,
31645
- valueType: FormatValueType.Numeric,
31646
- minimumValue: 1,
31647
- maximumValue: 31,
31648
- exceedingMaximumValueCausesTab: true,
31649
- padWithZeros: true,
31650
- },
31651
- {
31652
- characterCount: 3,
31653
- placeholder: ' - ',
31654
- inputText: ' - ',
31655
- isSeparator: true,
31656
- },
31657
- {
31658
- characterCount: 4,
31659
- placeholder: 'Y',
31660
- inputText: '_',
31661
- isSeparator: false,
31662
- allCharactersRequired: true,
31663
- valueType: FormatValueType.Numeric,
31664
- },
31665
- {
31666
- characterCount: 1,
31667
- placeholder: '-',
31668
- inputText: '-',
31669
- isSeparator: true,
31670
- },
31671
- {
31672
- characterCount: 2,
31673
- placeholder: 'M',
31674
- inputText: '_',
31675
- isSeparator: false,
31676
- allCharactersRequired: false,
31677
- valueType: FormatValueType.Numeric,
31678
- minimumValue: 1,
31679
- maximumValue: 12,
31680
- exceedingMaximumValueCausesTab: true,
31681
- padWithZeros: true,
31682
- },
31683
- {
31684
- characterCount: 1,
31685
- placeholder: '/',
31686
- inputText: '/',
31687
- isSeparator: true,
31688
- },
31689
- {
31690
- characterCount: 2,
31691
- placeholder: 'D',
31692
- inputText: '_',
31693
- isSeparator: false,
31694
- allCharactersRequired: false,
31695
- valueType: FormatValueType.Numeric,
31696
- minimumValue: 1,
31697
- maximumValue: 31,
31698
- exceedingMaximumValueCausesError: true,
31699
- padWithZeros: true,
31700
- },
31701
- ],
31702
- };
31703
-
31704
- var format$1 = {
31705
- formatParts: [
31706
- {
31707
- characterCount: 2,
31708
- placeholder: 'H',
31709
- inputText: '_',
31710
- isSeparator: false,
31711
- allCharactersRequired: false,
31712
- valueType: FormatValueType.Numeric,
31713
- minimumValue: 1,
31714
- maximumValue: 12,
31715
- exceedingMaximumValueCausesTab: true,
31716
- padWithZeros: true,
31717
- },
31718
- {
31719
- characterCount: 1,
31720
- placeholder: ':',
31721
- inputText: ':',
31722
- isSeparator: true,
31723
- },
31724
- {
31725
- characterCount: 2,
31726
- placeholder: 'M',
31727
- inputText: '_',
31728
- isSeparator: false,
31729
- allCharactersRequired: false,
31730
- valueType: FormatValueType.Numeric,
31731
- minimumValue: 0,
31732
- maximumValue: 59,
31733
- exceedingMaximumValueCausesError: true,
31734
- padWithZeros: true,
31735
- },
31736
- {
31737
- characterCount: 1,
31738
- placeholder: ' ',
31739
- inputText: ' ',
31740
- isSeparator: true,
31741
- },
31742
- {
31743
- characterCount: 2,
31744
- inputText: '_',
31745
- isSeparator: false,
31746
- possibleValues: ['AM', 'PM'],
31747
- },
31748
- ],
31749
- };
31750
-
31751
- var format = {
31752
- formatParts: [
31753
- {
31754
- characterCount: 2,
31755
- placeholder: 'H',
31756
- inputText: '_',
31757
- isSeparator: false,
31758
- allCharactersRequired: false,
31759
- valueType: FormatValueType.Numeric,
31760
- minimumValue: 0,
31761
- maximumValue: 23,
31762
- exceedingMaximumValueCausesTab: true,
31763
- padWithZeros: true,
31764
- },
31765
- {
31766
- characterCount: 1,
31767
- placeholder: ':',
31768
- inputText: ':',
31769
- isSeparator: true,
31770
- },
31771
- {
31772
- characterCount: 2,
31773
- placeholder: 'M',
31774
- inputText: '_',
31775
- isSeparator: false,
31776
- allCharactersRequired: false,
31777
- valueType: FormatValueType.Numeric,
31778
- minimumValue: 1,
31779
- maximumValue: 59,
31780
- exceedingMaximumValueCausesError: true,
31781
- padWithZeros: true,
31782
- },
31783
- ],
31784
- };
31785
-
31786
- var FormattedInput = function (props, ref) {
31787
- var _a = props.value, value = _a === void 0 ? '' : _a, format$8 = props.format, _b = props.defaultFormat, defaultFormat = _b === void 0 ? FormattedInputDefaultFormats.Custom : _b, _c = props.readOnly, readOnly = _c === void 0 ? false : _c, _d = props.debounceTime, debounceTime = _d === void 0 ? 800 : _d, _e = props.fillContainer, fillContainer = _e === void 0 ? true : _e, leftElement = props.leftElement, rightElement = props.rightElement, className = props.className, leftElementClassName = props.leftElementClassName, rightElementClassName = props.rightElementClassName, _f = props.isSingleLine, isSingleLine = _f === void 0 ? false : _f, _g = props.allowSingleLineScroll, allowSingleLineScroll = _g === void 0 ? false : _g, onChange = props.onChange, onFocus = props.onFocus, onBlur = props.onBlur, onElementCreate = props.onElementCreate, onLeftElementClick = props.onLeftElementClick, onRightElementClick = props.onRightElementClick;
31788
- var inputRef = React.useRef();
31789
- var inputElementRef = React.useRef();
31790
- var formatParser = React.useRef();
31791
- React.useEffect(function () {
31792
- return function () {
31793
- var _a;
31794
- (_a = formatParser.current) === null || _a === void 0 ? void 0 : _a.dispose();
31795
- };
31796
- }, []);
31797
- React.useEffect(function () {
31798
- var _a;
31799
- (_a = formatParser.current) === null || _a === void 0 ? void 0 : _a.inputValuePassed(value);
31800
- }, [value]);
31801
- React.useEffect(function () {
31802
- var _a, _b, _c;
31803
- (_a = formatParser.current) === null || _a === void 0 ? void 0 : _a.dispose();
31804
- if (defaultFormat !== FormattedInputDefaultFormats.Custom) {
31805
- var formatSetting = getPreDefinedFormat(defaultFormat);
31806
- if (!formatSetting) {
31807
- throw new Error('The selected format does not exist');
31808
- }
31809
- formatParser.current = new FormatParser(formatSetting, value);
31810
- }
31811
- else {
31812
- if (!format$8) {
31813
- throw new Error('The format property is required when the default format is custom');
31814
- }
31815
- formatParser.current = new FormatParser(format$8, value);
31816
- }
31817
- if (inputElementRef.current) {
31818
- (_b = formatParser.current) === null || _b === void 0 ? void 0 : _b.inputElementCreated(inputElementRef.current);
31819
- }
31820
- (_c = formatParser.current) === null || _c === void 0 ? void 0 : _c.registerFormatChangeEvent(onFormatChange);
31821
- }, [defaultFormat, format$8]);
31822
- var onFormatChange = React.useCallback(function (value) {
31823
- onChange === null || onChange === void 0 ? void 0 : onChange(value);
31824
- }, [onChange]);
31825
- var getPreDefinedFormat = React.useCallback(function (format$8) {
31826
- switch (format$8) {
31827
- case FormattedInputDefaultFormats.DateDayMonthYear:
31828
- return format$7;
31829
- case FormattedInputDefaultFormats.DateMonthDayYear:
31830
- return format$6;
31831
- case FormattedInputDefaultFormats.DateYearMonthDay:
31832
- return format$5;
31833
- case FormattedInputDefaultFormats.DateRangeDayMonthYear:
31834
- return format$4;
31835
- case FormattedInputDefaultFormats.DateRangeMonthDayYear:
31836
- return format$3;
31837
- case FormattedInputDefaultFormats.DateRangeYearMonthDay:
31838
- return format$2;
31839
- case FormattedInputDefaultFormats.Time12Hour:
31840
- return format$1;
31841
- case FormattedInputDefaultFormats.Time24Hour:
31842
- return format;
31843
- }
31844
- }, []);
31845
- var onFocusHandler = React.useCallback(function (event) {
31846
- var _a;
31847
- (_a = formatParser.current) === null || _a === void 0 ? void 0 : _a.inputFocused();
31848
- onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
31849
- }, [onFocus]);
31850
- var onBlurHandler = React.useCallback(function (event) {
31851
- var _a;
31852
- (_a = formatParser.current) === null || _a === void 0 ? void 0 : _a.inputBlurred();
31853
- onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
31854
- }, [onBlur]);
31855
- var onMouseUpHandler = React.useCallback(function () {
31856
- var _a;
31857
- (_a = formatParser.current) === null || _a === void 0 ? void 0 : _a.mouseUpHandler();
31858
- }, []);
31859
- var onKeyDownHandler = React.useCallback(function (event) {
31860
- var _a;
31861
- (_a = formatParser.current) === null || _a === void 0 ? void 0 : _a.keyDownHandler(event);
31862
- }, []);
31863
- var onInputRefCreated = React.useCallback(function (ref) {
31864
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
31865
- (_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.inputElement) === null || _b === void 0 ? void 0 : _b.removeEventListener('keydown', onKeyDownHandler);
31866
- (_d = (_c = inputRef.current) === null || _c === void 0 ? void 0 : _c.inputElement) === null || _d === void 0 ? void 0 : _d.removeEventListener('mouseup', onMouseUpHandler);
31867
- inputRef.current = ref;
31868
- (_f = (_e = inputRef.current) === null || _e === void 0 ? void 0 : _e.inputElement) === null || _f === void 0 ? void 0 : _f.addEventListener('keydown', onKeyDownHandler);
31869
- (_h = (_g = inputRef.current) === null || _g === void 0 ? void 0 : _g.inputElement) === null || _h === void 0 ? void 0 : _h.addEventListener('mouseup', onMouseUpHandler);
31870
- inputElementRef.current = (_j = inputRef.current) === null || _j === void 0 ? void 0 : _j.inputElement;
31871
- }, []);
31872
- var focus = React.useCallback(function () {
31873
- var _a;
31874
- (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
31875
- }, []);
31876
- React.useImperativeHandle(ref, function () { return ({
31877
- focus: focus,
31878
- }); });
31879
- return (jsxRuntime.jsx(ContentEditableInput$1, { ref: function (refElement) { return refElement && onInputRefCreated(refElement); }, readOnly: readOnly, debounceTime: debounceTime, fillContainer: fillContainer, leftElement: leftElement, rightElement: rightElement, className: className, leftElementClassName: leftElementClassName, rightElementClassName: rightElementClassName, isSingleLine: isSingleLine, allowSingleLineScroll: allowSingleLineScroll, onFocus: onFocusHandler, onBlur: onBlurHandler, onElementCreate: onElementCreate, onLeftElementClick: onLeftElementClick, onRightElementClick: onRightElementClick }));
31880
- };
31881
- var FormattedInput$1 = React.memo(React.forwardRef(FormattedInput));
31882
-
31883
- var DateTimeContext = React.createContext(undefined);
31336
+ var DateTimeContext = React.createContext(undefined);
31884
31337
 
31885
31338
  function getMonthMatrix(matrixDate, locale, loadOtherMonths) {
31886
31339
  var _a, _b;
@@ -32046,25 +31499,6 @@ function loadLocale(localeToLoad) {
32046
31499
  });
32047
31500
  });
32048
31501
  }
32049
- function getDateFormatByLocale(locale) {
32050
- var year = 2023;
32051
- var month = 12;
32052
- var day = 20;
32053
- var date = new Date(year, month - 1, day);
32054
- var formattedDate = date.toLocaleDateString(locale, {
32055
- year: 'numeric',
32056
- month: 'numeric',
32057
- day: 'numeric',
32058
- });
32059
- return formattedDate.replace("".concat(year), 'YYYY').replace("".concat(month), 'MM').replace("".concat(day), 'DD');
32060
- }
32061
- function uses24HourTimeByLocale(locale) {
32062
- var date = new Date();
32063
- var hour = 18;
32064
- date.setHours(hour);
32065
- var timeParts = date.toLocaleTimeString(locale).split(':');
32066
- return timeParts[0] === '18';
32067
- }
32068
31502
  function createDefaultColors() {
32069
31503
  return {
32070
31504
  inputBgColor: 'bsc-bg-white',
@@ -32085,16 +31519,19 @@ function parseDate(dateValue, locale) {
32085
31519
  localDate = parse(dateValue, 'P HH:mm', new Date(), { locale: locale });
32086
31520
  if (!isNaN(localDate.valueOf()))
32087
31521
  return localDate;
32088
- localDate = parse(dateValue, 'P HH:mm aaa', new Date(), { locale: locale });
31522
+ localDate = parse(dateValue, 'P hh:mm a..aaa', new Date(), { locale: locale });
32089
31523
  if (!isNaN(localDate.valueOf()))
32090
31524
  return localDate;
32091
31525
  localDate = parse(dateValue, 'P HH:mm:ss', new Date(), { locale: locale });
32092
31526
  if (!isNaN(localDate.valueOf()))
32093
31527
  return localDate;
32094
- localDate = parse(dateValue, 'P HH:mm:ss aaa', new Date(), { locale: locale });
31528
+ localDate = parse(dateValue, 'P hh:mm:ss a..aaa', new Date(), { locale: locale });
32095
31529
  if (!isNaN(localDate.valueOf()))
32096
31530
  return localDate;
32097
31531
  localDate = parse(dateValue, 'P', new Date(), { locale: locale });
31532
+ if (!isNaN(localDate.valueOf()))
31533
+ return localDate;
31534
+ localDate = parse(dateValue, 'P p', new Date(), { locale: locale });
32098
31535
  if (!isNaN(localDate.valueOf()))
32099
31536
  return localDate;
32100
31537
  localDate = parse(dateValue, 'pp', new Date(), { locale: locale });
@@ -32169,7 +31606,7 @@ var DateTimeActionType;
32169
31606
  DateTimeActionType[DateTimeActionType["SetSelectedDateRange"] = 7] = "SetSelectedDateRange";
32170
31607
  DateTimeActionType[DateTimeActionType["SetSelectedStartDate"] = 8] = "SetSelectedStartDate";
32171
31608
  DateTimeActionType[DateTimeActionType["SetSelectedEndDate"] = 9] = "SetSelectedEndDate";
32172
- DateTimeActionType[DateTimeActionType["SetInputFormat"] = 10] = "SetInputFormat";
31609
+ DateTimeActionType[DateTimeActionType["SetTimeFormat"] = 10] = "SetTimeFormat";
32173
31610
  DateTimeActionType[DateTimeActionType["ClearDates"] = 11] = "ClearDates";
32174
31611
  DateTimeActionType[DateTimeActionType["InitializeDates"] = 12] = "InitializeDates";
32175
31612
  })(DateTimeActionType || (DateTimeActionType = {}));
@@ -32195,16 +31632,13 @@ var reducer = function (state, action) {
32195
31632
  return __assign(__assign({}, state), { selectedStartDate: action.selectedStartDate, selectedEndDate: undefined });
32196
31633
  case DateTimeActionType.SetSelectedEndDate:
32197
31634
  return __assign(__assign({}, state), { selectedEndDate: action.selectedEndDate });
32198
- case DateTimeActionType.SetInputFormat:
32199
- return __assign(__assign({}, state), { timeFormat: action.inputFormat === FormattedInputDefaultFormats.Time24Hour
32200
- ? TimeFormatType.TwentyFourHour
32201
- : action.timeFormat || TimeFormatType.TwelveHour, inputFormat: action.inputFormat });
31635
+ case DateTimeActionType.SetTimeFormat:
31636
+ return __assign(__assign({}, state), { timeFormat: action.timeFormat || state.timeFormat });
32202
31637
  case DateTimeActionType.ClearDates:
32203
31638
  return {
32204
31639
  currentSelector: state.currentSelector,
32205
31640
  currentViewDate: state.currentViewDate,
32206
31641
  timeFormat: state.timeFormat,
32207
- inputFormat: state.inputFormat,
32208
31642
  dateInitialized: true,
32209
31643
  };
32210
31644
  case DateTimeActionType.InitializeDates:
@@ -32668,17 +32102,341 @@ function DateTimeYearSelector(_a) {
32668
32102
  }) })) }))] })));
32669
32103
  }
32670
32104
 
32105
+ var DateTimeFormatCreator = (function () {
32106
+ function DateTimeFormatCreator(dateSelection, localeCode) {
32107
+ this.dateSelection = dateSelection;
32108
+ var year = 2023;
32109
+ var month = 12;
32110
+ var day = 20;
32111
+ var date = new Date(year, month - 1, day);
32112
+ var format = date.toLocaleDateString(localeCode, {
32113
+ year: 'numeric',
32114
+ month: 'numeric',
32115
+ day: 'numeric',
32116
+ });
32117
+ this.dateFormat = format.replace("".concat(year), 'YYYY').replace("".concat(month), 'MM').replace("".concat(day), 'DD');
32118
+ var time = new Date();
32119
+ var hour = 18;
32120
+ var minute = 24;
32121
+ var second = 37;
32122
+ var milliseconds = 317;
32123
+ time.setHours(hour, minute, second, milliseconds);
32124
+ var testTimeFormat = time.toLocaleTimeString(localeCode);
32125
+ this.use24HourTime = testTimeFormat.startsWith('18');
32126
+ this.timeFormat = testTimeFormat
32127
+ .replace("".concat(this.use24HourTime ? hour : '6'), 'HH')
32128
+ .replace("".concat(minute), 'MM')
32129
+ .replace("".concat(second), 'SS')
32130
+ .replace("".concat(milliseconds), 'LLL');
32131
+ this.createDateParts();
32132
+ }
32133
+ Object.defineProperty(DateTimeFormatCreator.prototype, "is24HourTime", {
32134
+ get: function () {
32135
+ return this.use24HourTime;
32136
+ },
32137
+ enumerable: false,
32138
+ configurable: true
32139
+ });
32140
+ DateTimeFormatCreator.prototype.createInputFormat = function () {
32141
+ var inputFormat = {
32142
+ deleteShiftsFormatPart: false,
32143
+ formatParts: [],
32144
+ };
32145
+ switch (this.dateSelection) {
32146
+ case DateSelectionType.DateOnly:
32147
+ return this.createDateFormat(inputFormat);
32148
+ case DateSelectionType.TimeOnly:
32149
+ return this.createTimeFormat(inputFormat);
32150
+ case DateSelectionType.DateRange:
32151
+ return this.createDateRangeFormat(inputFormat);
32152
+ case DateSelectionType.DateTime:
32153
+ return this.createDateTimeFormat(inputFormat);
32154
+ }
32155
+ };
32156
+ DateTimeFormatCreator.prototype.createDateFormat = function (inputFormat) {
32157
+ var _a, _b, _c;
32158
+ if (this.dateFormat.startsWith('MM')) {
32159
+ (_a = inputFormat.formatParts).push.apply(_a, this.createMonthDayYearFormatParts());
32160
+ }
32161
+ else if (this.dateFormat.startsWith('DD')) {
32162
+ (_b = inputFormat.formatParts).push.apply(_b, this.createDayMonthYearFormatParts());
32163
+ }
32164
+ else {
32165
+ (_c = inputFormat.formatParts).push.apply(_c, this.createYearMonthDayFormatParts());
32166
+ }
32167
+ return inputFormat;
32168
+ };
32169
+ DateTimeFormatCreator.prototype.createTimeFormat = function (inputFormat) {
32170
+ var _a, _b;
32171
+ if (!this.use24HourTime) {
32172
+ (_a = inputFormat.formatParts).push.apply(_a, this.createTwelveHourFormatParts());
32173
+ }
32174
+ else {
32175
+ (_b = inputFormat.formatParts).push.apply(_b, this.createTwentyFourHourFormatParts());
32176
+ }
32177
+ return inputFormat;
32178
+ };
32179
+ DateTimeFormatCreator.prototype.createDateRangeFormat = function (inputFormat) {
32180
+ var _a;
32181
+ var formatParts = [];
32182
+ if (this.dateFormat.startsWith('MM')) {
32183
+ formatParts.push.apply(formatParts, this.createMonthDayYearFormatParts());
32184
+ }
32185
+ else if (this.dateFormat.startsWith('DD')) {
32186
+ formatParts.push.apply(formatParts, this.createDayMonthYearFormatParts());
32187
+ }
32188
+ else {
32189
+ formatParts.push.apply(formatParts, this.createYearMonthDayFormatParts());
32190
+ }
32191
+ var dividerPart = {
32192
+ characterCount: 3,
32193
+ placeholder: ' - ',
32194
+ inputText: ' - ',
32195
+ isSeparator: true,
32196
+ };
32197
+ (_a = inputFormat.formatParts).push.apply(_a, __spreadArray(__spreadArray(__spreadArray([], formatParts, false), [dividerPart], false), formatParts, false));
32198
+ return inputFormat;
32199
+ };
32200
+ DateTimeFormatCreator.prototype.createDateTimeFormat = function (inputFormat) {
32201
+ var _a, _b, _c, _d, _e;
32202
+ if (this.dateFormat.startsWith('MM')) {
32203
+ (_a = inputFormat.formatParts).push.apply(_a, this.createMonthDayYearFormatParts());
32204
+ }
32205
+ else if (this.dateFormat.startsWith('DD')) {
32206
+ (_b = inputFormat.formatParts).push.apply(_b, this.createDayMonthYearFormatParts());
32207
+ }
32208
+ else {
32209
+ (_c = inputFormat.formatParts).push.apply(_c, this.createYearMonthDayFormatParts());
32210
+ }
32211
+ var dividerPart = {
32212
+ characterCount: 1,
32213
+ placeholder: ' ',
32214
+ inputText: ' ',
32215
+ isSeparator: true,
32216
+ };
32217
+ inputFormat.formatParts.push(dividerPart);
32218
+ if (!this.use24HourTime) {
32219
+ (_d = inputFormat.formatParts).push.apply(_d, this.createTwelveHourFormatParts());
32220
+ }
32221
+ else {
32222
+ (_e = inputFormat.formatParts).push.apply(_e, this.createTwentyFourHourFormatParts());
32223
+ }
32224
+ return inputFormat;
32225
+ };
32226
+ DateTimeFormatCreator.prototype.createMonthDayYearFormatParts = function () {
32227
+ if (this.monthPart && this.dayPart && this.yearPart) {
32228
+ var tempDateFormat = this.dateFormat.replace('MM', '');
32229
+ var placeholderIndex = tempDateFormat.indexOf('DD');
32230
+ var placeholderText = tempDateFormat.substring(0, placeholderIndex);
32231
+ tempDateFormat = tempDateFormat.replace(placeholderText, '').replace('DD', '');
32232
+ var placeholder1 = {
32233
+ characterCount: placeholderText.length,
32234
+ placeholder: placeholderText,
32235
+ inputText: placeholderText,
32236
+ isSeparator: true,
32237
+ };
32238
+ placeholderIndex = tempDateFormat.indexOf('YYYY');
32239
+ placeholderText = tempDateFormat.substring(0, placeholderIndex);
32240
+ var placeholder2 = {
32241
+ characterCount: placeholderText.length,
32242
+ placeholder: placeholderText,
32243
+ inputText: placeholderText,
32244
+ isSeparator: true,
32245
+ };
32246
+ return [this.monthPart, placeholder1, this.dayPart, placeholder2, this.yearPart];
32247
+ }
32248
+ return [];
32249
+ };
32250
+ DateTimeFormatCreator.prototype.createDayMonthYearFormatParts = function () {
32251
+ if (this.monthPart && this.dayPart && this.yearPart) {
32252
+ var tempDateFormat = this.dateFormat.replace('DD', '');
32253
+ var placeholderIndex = tempDateFormat.indexOf('MM');
32254
+ var placeholderText = tempDateFormat.substring(0, placeholderIndex);
32255
+ tempDateFormat = tempDateFormat.replace(placeholderText, '').replace('MM', '');
32256
+ var placeholder1 = {
32257
+ characterCount: placeholderText.length,
32258
+ placeholder: placeholderText,
32259
+ inputText: placeholderText,
32260
+ isSeparator: true,
32261
+ };
32262
+ placeholderIndex = tempDateFormat.indexOf('YYYY');
32263
+ placeholderText = tempDateFormat.substring(0, placeholderIndex);
32264
+ var placeholder2 = {
32265
+ characterCount: placeholderText.length,
32266
+ placeholder: placeholderText,
32267
+ inputText: placeholderText,
32268
+ isSeparator: true,
32269
+ };
32270
+ return [this.dayPart, placeholder1, this.monthPart, placeholder2, this.yearPart];
32271
+ }
32272
+ return [];
32273
+ };
32274
+ DateTimeFormatCreator.prototype.createYearMonthDayFormatParts = function () {
32275
+ if (this.monthPart && this.dayPart && this.yearPart) {
32276
+ var tempDateFormat = this.dateFormat.replace('YYYY', '');
32277
+ var placeholderIndex = tempDateFormat.indexOf('MM');
32278
+ var placeholderText = tempDateFormat.substring(0, placeholderIndex);
32279
+ tempDateFormat = tempDateFormat.replace(placeholderText, '').replace('MM', '');
32280
+ var placeholder1 = {
32281
+ characterCount: placeholderText.length,
32282
+ placeholder: placeholderText,
32283
+ inputText: placeholderText,
32284
+ isSeparator: true,
32285
+ };
32286
+ placeholderIndex = tempDateFormat.indexOf('DD');
32287
+ placeholderText = tempDateFormat.substring(0, placeholderIndex);
32288
+ var placeholder2 = {
32289
+ characterCount: placeholderText.length,
32290
+ placeholder: placeholderText,
32291
+ inputText: placeholderText,
32292
+ isSeparator: true,
32293
+ };
32294
+ return [this.yearPart, placeholder1, this.monthPart, placeholder2, this.dayPart];
32295
+ }
32296
+ return [];
32297
+ };
32298
+ DateTimeFormatCreator.prototype.createTwelveHourFormatParts = function () {
32299
+ if (this.twelveHourPart && this.minutePart && this.meridianPart) {
32300
+ var tempTimeFormat = this.timeFormat.replace('HH', '');
32301
+ var placeholderIndex = tempTimeFormat.indexOf('MM');
32302
+ var placeholderText = tempTimeFormat.substring(0, placeholderIndex);
32303
+ var placeholder1 = {
32304
+ characterCount: placeholderText.length,
32305
+ placeholder: placeholderText,
32306
+ inputText: placeholderText,
32307
+ isSeparator: true,
32308
+ };
32309
+ var placeholder2 = {
32310
+ characterCount: 1,
32311
+ placeholder: ' ',
32312
+ inputText: ' ',
32313
+ isSeparator: true,
32314
+ };
32315
+ return [this.twelveHourPart, placeholder1, this.minutePart, placeholder2, this.meridianPart];
32316
+ }
32317
+ return [];
32318
+ };
32319
+ DateTimeFormatCreator.prototype.createTwentyFourHourFormatParts = function () {
32320
+ if (this.twentyFourHourPart && this.minutePart) {
32321
+ var tempTimeFormat = this.timeFormat.replace('HH', '');
32322
+ var placeholderIndex = tempTimeFormat.indexOf('MM');
32323
+ var placeholderText = tempTimeFormat.substring(0, placeholderIndex);
32324
+ var placeholder1 = {
32325
+ characterCount: placeholderText.length,
32326
+ placeholder: placeholderText,
32327
+ inputText: placeholderText,
32328
+ isSeparator: true,
32329
+ };
32330
+ return [this.twentyFourHourPart, placeholder1, this.minutePart];
32331
+ }
32332
+ return [];
32333
+ };
32334
+ DateTimeFormatCreator.prototype.createDateParts = function () {
32335
+ this.monthPart = {
32336
+ characterCount: 2,
32337
+ placeholder: 'M',
32338
+ inputText: '_',
32339
+ isSeparator: false,
32340
+ allCharactersRequired: false,
32341
+ valueType: FormatValueType.Numeric,
32342
+ minimumValue: 1,
32343
+ maximumValue: 12,
32344
+ exceedingMaximumValueCausesTab: true,
32345
+ padWithZeros: true,
32346
+ };
32347
+ this.dayPart = {
32348
+ characterCount: 2,
32349
+ placeholder: 'D',
32350
+ inputText: '_',
32351
+ isSeparator: false,
32352
+ allCharactersRequired: false,
32353
+ valueType: FormatValueType.Numeric,
32354
+ minimumValue: 1,
32355
+ maximumValue: 31,
32356
+ exceedingMaximumValueCausesTab: true,
32357
+ padWithZeros: true,
32358
+ };
32359
+ this.yearPart = {
32360
+ characterCount: 4,
32361
+ placeholder: 'Y',
32362
+ inputText: '_',
32363
+ isSeparator: false,
32364
+ allCharactersRequired: true,
32365
+ valueType: FormatValueType.Numeric,
32366
+ };
32367
+ this.twelveHourPart = {
32368
+ characterCount: 2,
32369
+ placeholder: 'H',
32370
+ inputText: '_',
32371
+ isSeparator: false,
32372
+ allCharactersRequired: false,
32373
+ valueType: FormatValueType.Numeric,
32374
+ minimumValue: 1,
32375
+ maximumValue: 12,
32376
+ exceedingMaximumValueCausesTab: true,
32377
+ padWithZeros: true,
32378
+ };
32379
+ this.twentyFourHourPart = {
32380
+ characterCount: 2,
32381
+ placeholder: 'H',
32382
+ inputText: '_',
32383
+ isSeparator: false,
32384
+ allCharactersRequired: false,
32385
+ valueType: FormatValueType.Numeric,
32386
+ minimumValue: 0,
32387
+ maximumValue: 23,
32388
+ exceedingMaximumValueCausesTab: true,
32389
+ padWithZeros: true,
32390
+ };
32391
+ this.minutePart = {
32392
+ characterCount: 2,
32393
+ placeholder: 'M',
32394
+ inputText: '_',
32395
+ isSeparator: false,
32396
+ allCharactersRequired: false,
32397
+ valueType: FormatValueType.Numeric,
32398
+ minimumValue: 0,
32399
+ maximumValue: 59,
32400
+ exceedingMaximumValueCausesError: true,
32401
+ padWithZeros: true,
32402
+ };
32403
+ this.meridianPart = {
32404
+ characterCount: 2,
32405
+ inputText: '_',
32406
+ isSeparator: false,
32407
+ valueType: FormatValueType.Text,
32408
+ possibleValues: ['AM', 'PM'],
32409
+ };
32410
+ };
32411
+ return DateTimeFormatCreator;
32412
+ }());
32413
+
32414
+ var useGetDateTimeFormat = function (dateSelection, localeCode) {
32415
+ var _a;
32416
+ var _b = React.useState(), inputFormat = _b[0], setInputFormat = _b[1];
32417
+ var formatCreator = React.useRef();
32418
+ React.useEffect(function () {
32419
+ if (localeCode && !inputFormat) {
32420
+ formatCreator.current = new DateTimeFormatCreator(dateSelection, localeCode);
32421
+ setInputFormat(formatCreator.current.createInputFormat());
32422
+ }
32423
+ }, [localeCode]);
32424
+ return [inputFormat, (_a = formatCreator.current) === null || _a === void 0 ? void 0 : _a.is24HourTime];
32425
+ };
32426
+
32671
32427
  function DateTime(_a) {
32672
32428
  var _b;
32673
32429
  var value = _a.value, _c = _a.readOnly, readOnly = _c === void 0 ? false : _c, label = _a.label, _d = _a.useDefaultDateValue, useDefaultDateValue = _d === void 0 ? false : _d, _e = _a.useFormattedInput, useFormattedInput = _e === void 0 ? false : _e, _f = _a.allowClear, allowClear = _f === void 0 ? false : _f, locale = _a.locale, className = _a.className, _g = _a.dateSelection, dateSelection = _g === void 0 ? DateSelectionType.DateTime : _g, dateFormat = _a.dateFormat, timeConstraints = _a.timeConstraints, icon = _a.icon, _h = _a.iconPosition, iconPosition = _h === void 0 ? CalendarIconPosition.Right : _h, inputElement = _a.inputElement, _j = _a.colors, colors = _j === void 0 ? createDefaultColors() : _j, selectableDate = _a.selectableDate, isValidDate = _a.isValidDate, onChange = _a.onChange, calendarTemplate = _a.calendarTemplate, dateScrollerTemplate = _a.dateScrollerTemplate, inputTemplate = _a.inputTemplate;
32674
32430
  var _k = React.useState(false), selectorOpen = _k[0], setSelectorOpen = _k[1];
32675
- var _l = React.useState(), dropDownTarget = _l[0], setDropDownTarget = _l[1];
32431
+ var _l = React.useState(), localeCode = _l[0], setLocaleCode = _l[1];
32432
+ var _m = React.useState(), dropDownTarget = _m[0], setDropDownTarget = _m[1];
32676
32433
  var isFormattedInput = React.useRef();
32677
32434
  var inputElementChanged = React.useRef(false);
32678
32435
  var language = React.useRef(locale || getBrowserLanguage());
32679
32436
  var loadedLocale = React.useRef();
32680
32437
  var inputElementRef = React.useRef();
32681
32438
  var dropDownTargetRef = React.useRef();
32439
+ var _o = useGetDateTimeFormat(dateSelection, localeCode), inputFormat = _o[0], use24HourTime = _o[1];
32682
32440
  var contextProps = React.useRef({
32683
32441
  calendarTemplate: calendarTemplate,
32684
32442
  dateScrollerTemplate: dateScrollerTemplate,
@@ -32704,64 +32462,13 @@ function DateTime(_a) {
32704
32462
  }
32705
32463
  }, [value, loadedLocale.current]);
32706
32464
  React.useEffect(function () {
32707
- if (dateSelection && loadedLocale.current && loadedLocale.current.code) {
32708
- var dateFormatString = getDateFormatByLocale(loadedLocale.current.code);
32709
- if (dateSelection === DateSelectionType.DateOnly) {
32710
- if (dateFormatString === 'DD/MM/YYYY') {
32711
- dispatcher({
32712
- type: DateTimeActionType.SetInputFormat,
32713
- inputFormat: FormattedInputDefaultFormats.DateDayMonthYear,
32714
- });
32715
- }
32716
- else if (dateFormatString === 'MM/DD/YYYY') {
32717
- dispatcher({
32718
- type: DateTimeActionType.SetInputFormat,
32719
- inputFormat: FormattedInputDefaultFormats.DateMonthDayYear,
32720
- });
32721
- }
32722
- else if (dateFormatString === 'YYYY/MM/DD') {
32723
- dispatcher({
32724
- type: DateTimeActionType.SetInputFormat,
32725
- inputFormat: FormattedInputDefaultFormats.DateYearMonthDay,
32726
- });
32727
- }
32728
- }
32729
- else if (dateSelection === DateSelectionType.TimeOnly) {
32730
- if (uses24HourTimeByLocale(loadedLocale.current.code)) {
32731
- dispatcher({
32732
- type: DateTimeActionType.SetInputFormat,
32733
- inputFormat: FormattedInputDefaultFormats.Time24Hour,
32734
- });
32735
- }
32736
- else {
32737
- dispatcher({
32738
- type: DateTimeActionType.SetInputFormat,
32739
- inputFormat: FormattedInputDefaultFormats.Time12Hour,
32740
- });
32741
- }
32742
- }
32743
- else if (dateSelection === DateSelectionType.DateRange) {
32744
- if (dateFormatString === 'DD/MM/YYYY') {
32745
- dispatcher({
32746
- type: DateTimeActionType.SetInputFormat,
32747
- inputFormat: FormattedInputDefaultFormats.DateRangeDayMonthYear,
32748
- });
32749
- }
32750
- else if (dateFormatString === 'MM/DD/YYYY') {
32751
- dispatcher({
32752
- type: DateTimeActionType.SetInputFormat,
32753
- inputFormat: FormattedInputDefaultFormats.DateRangeMonthDayYear,
32754
- });
32755
- }
32756
- else if (dateFormatString === 'YYYY/MM/DD') {
32757
- dispatcher({
32758
- type: DateTimeActionType.SetInputFormat,
32759
- inputFormat: FormattedInputDefaultFormats.DateRangeYearMonthDay,
32760
- });
32761
- }
32762
- }
32465
+ if (use24HourTime) {
32466
+ dispatcher({
32467
+ type: DateTimeActionType.SetTimeFormat,
32468
+ timeFormat: use24HourTime ? TimeFormatType.TwentyFourHour : TimeFormatType.TwelveHour,
32469
+ });
32763
32470
  }
32764
- }, [dateSelection, loadedLocale.current]);
32471
+ }, [use24HourTime]);
32765
32472
  React.useEffect(function () {
32766
32473
  if (inputElement) {
32767
32474
  inputElementRef.current = inputElement;
@@ -32770,6 +32477,7 @@ function DateTime(_a) {
32770
32477
  var loadLocaleObject = function (localeToLoad) {
32771
32478
  loadLocale(localeToLoad)
32772
32479
  .then(function (locale) {
32480
+ setLocaleCode(locale.code);
32773
32481
  loadedLocale.current = locale;
32774
32482
  var defaultDate = getDateValue();
32775
32483
  if (value || useDefaultDateValue) {
@@ -32808,11 +32516,21 @@ function DateTime(_a) {
32808
32516
  timeFormat: TimeFormatType.TwelveHour,
32809
32517
  dateInitialized: false,
32810
32518
  };
32811
- var _m = React.useReducer(reducer, initialState), state = _m[0], dispatcher = _m[1];
32519
+ var _p = React.useReducer(reducer, initialState), state = _p[0], dispatcher = _p[1];
32812
32520
  var onFocus = function () {
32813
32521
  setDropDownElement();
32814
32522
  setSelectorOpen(true);
32815
32523
  };
32524
+ var onBlur = React.useMemo(function () {
32525
+ return lodashExports.debounce(function () {
32526
+ setSelectorOpen(false);
32527
+ }, 250);
32528
+ }, []);
32529
+ var onCalendarClick = React.useMemo(function () {
32530
+ return lodashExports.debounce(function () {
32531
+ onBlur.cancel();
32532
+ }, 5);
32533
+ }, [onBlur]);
32816
32534
  var onInput = function (event) {
32817
32535
  var dateString = event.target.innerText;
32818
32536
  onDateStringChange(dateString);
@@ -32854,7 +32572,7 @@ function DateTime(_a) {
32854
32572
  onChange === null || onChange === void 0 ? void 0 : onChange();
32855
32573
  }
32856
32574
  };
32857
- var onCalendarClick = function () {
32575
+ var onCalendarIconClick = function () {
32858
32576
  setDropDownElement();
32859
32577
  setSelectorOpen(!selectorOpen);
32860
32578
  };
@@ -32962,10 +32680,10 @@ function DateTime(_a) {
32962
32680
  ? {}
32963
32681
  : iconPosition === CalendarIconPosition.Right
32964
32682
  ? {
32965
- rightElement: (jsxRuntime.jsxs("div", __assign({ className: "bsc-flex" }, { children: [allowClear && !readOnly && (jsxRuntime.jsx("div", { children: jsxRuntime.jsx(FontAwesomeIcon, { className: "bsc-cursor-pointer bsc-text-sm", icon: ['fas', 'times'], size: "sm", onClick: onClearClick }) })), jsxRuntime.jsx("div", __assign({ className: "bsc-ml-2" }, { children: icon || (jsxRuntime.jsx(FontAwesomeIcon, { className: !readOnly ? 'bsc-cursor-pointer' : undefined, icon: ['far', 'calendar-alt'], onClick: !readOnly ? onCalendarClick : undefined })) }))] }))),
32683
+ rightElement: (jsxRuntime.jsxs("div", __assign({ className: "bsc-flex" }, { children: [allowClear && !readOnly && (jsxRuntime.jsx("div", { children: jsxRuntime.jsx(FontAwesomeIcon, { className: "bsc-cursor-pointer bsc-text-sm", icon: ['fas', 'times'], size: "sm", onClick: onClearClick }) })), jsxRuntime.jsx("div", __assign({ className: "bsc-ml-2" }, { children: icon || (jsxRuntime.jsx(FontAwesomeIcon, { className: !readOnly ? 'bsc-cursor-pointer' : undefined, icon: ['far', 'calendar-alt'], onClick: !readOnly ? onCalendarIconClick : undefined })) }))] }))),
32966
32684
  }
32967
32685
  : {
32968
- leftElement: (jsxRuntime.jsxs("div", __assign({ className: "bsc-flex" }, { children: [jsxRuntime.jsx("div", __assign({ className: "bsc-mr-2" }, { children: icon || (jsxRuntime.jsx(FontAwesomeIcon, { className: !readOnly ? 'bsc-cursor-pointer' : undefined, icon: ['far', 'calendar-alt'], onClick: !readOnly ? onCalendarClick : undefined })) })), allowClear && !readOnly && (jsxRuntime.jsx("div", { children: jsxRuntime.jsx(FontAwesomeIcon, { className: "bsc-cursor-pointer bsc-text-sm", icon: ['fas', 'times'], size: "sm", onClick: onClearClick }) }))] }))),
32686
+ leftElement: (jsxRuntime.jsxs("div", __assign({ className: "bsc-flex" }, { children: [jsxRuntime.jsx("div", __assign({ className: "bsc-mr-2" }, { children: icon || (jsxRuntime.jsx(FontAwesomeIcon, { className: !readOnly ? 'bsc-cursor-pointer' : undefined, icon: ['far', 'calendar-alt'], onClick: !readOnly ? onCalendarIconClick : undefined })) })), allowClear && !readOnly && (jsxRuntime.jsx("div", { children: jsxRuntime.jsx(FontAwesomeIcon, { className: "bsc-cursor-pointer bsc-text-sm", icon: ['fas', 'times'], size: "sm", onClick: onClearClick }) }))] }))),
32969
32687
  };
32970
32688
  var inputTemplateProps = {
32971
32689
  label: label,
@@ -32983,7 +32701,7 @@ function DateTime(_a) {
32983
32701
  _b["".concat((colors === null || colors === void 0 ? void 0 : colors.readOnlyInputBgColor) || 'bsc-bg-gray-200')] = readOnly,
32984
32702
  _b["".concat((colors === null || colors === void 0 ? void 0 : colors.inputBgColor) || 'bsc-bg-white')] = !readOnly,
32985
32703
  _b), "dark:bsc-bg-black ".concat(colors === null || colors === void 0 ? void 0 : colors.inputBorderColor, " bc-dt-input"), className);
32986
- return (jsxRuntime.jsx(DateTimeContext.Provider, __assign({ value: contextProps.current }, { children: jsxRuntime.jsxs("div", __assign({ className: "bc-date-time" }, { children: [label && jsxRuntime.jsx("label", __assign({ className: "dark:bsc-text-white bc-dt-label" }, { children: label })), jsxRuntime.jsx(TemplateOutlet, __assign({ props: inputTemplateProps, template: template }, { children: useFormattedInput === false || state.inputFormat === undefined ? (jsxRuntime.jsx(ContentEditableInput$1, __assign({ value: getValue(), readOnly: readOnly, className: inputStyles, onFocus: onFocus, onInput: onInput, onElementCreate: function (element) { return onInputElementCreated(element, false); } }, inputProps))) : (jsxRuntime.jsx(FormattedInput$1, __assign({ value: getValue(), readOnly: readOnly, className: inputStyles, onFocus: onFocus, onChange: onFormatStringChange, onElementCreate: function (element) { return onInputElementCreated(element, true); }, defaultFormat: state.inputFormat }, inputProps))) })), jsxRuntime.jsx(OverlayPanel, __assign({ visible: selectorOpen, target: dropDownTarget, shouldTargetCloseOverlay: false, shouldScrollCloseOverlay: true, shouldCheckZIndex: true, shouldRemainOnScreen: true, hidden: onDateTimeHidden, unmountWhenHidden: true }, { children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [state.currentSelector === DateTimeActionType.DaySelector &&
32704
+ return (jsxRuntime.jsx(DateTimeContext.Provider, __assign({ value: contextProps.current }, { children: jsxRuntime.jsxs("div", __assign({ className: "bc-date-time" }, { children: [label && jsxRuntime.jsx("label", __assign({ className: "dark:bsc-text-white bc-dt-label" }, { children: label })), jsxRuntime.jsx(TemplateOutlet, __assign({ props: inputTemplateProps, template: template }, { children: useFormattedInput === false ? (jsxRuntime.jsx(ContentEditableInput$1, __assign({ value: getValue(), readOnly: readOnly, className: inputStyles, onFocus: onFocus, onBlur: onBlur, onInput: onInput, onElementCreate: function (element) { return onInputElementCreated(element, false); } }, inputProps))) : (jsxRuntime.jsx(FormattedInput$1, __assign({ value: getValue(), readOnly: readOnly, className: inputStyles, format: inputFormat, onFocus: onFocus, onBlur: onBlur, onChange: onFormatStringChange, onElementCreate: function (element) { return onInputElementCreated(element, true); } }, inputProps))) })), jsxRuntime.jsx(OverlayPanel, __assign({ visible: selectorOpen, target: dropDownTarget, shouldTargetCloseOverlay: false, shouldScrollCloseOverlay: true, shouldCheckZIndex: true, shouldRemainOnScreen: true, hidden: onDateTimeHidden, isClickedWithin: onCalendarClick, unmountWhenHidden: true }, { children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [state.currentSelector === DateTimeActionType.DaySelector &&
32987
32705
  canShowDateSelectors &&
32988
32706
  state.dateInitialized &&
32989
32707
  loadedLocale.current && (jsxRuntime.jsx(DateTimeDaySelector, { selectedDate: state.selectedDate, viewDate: state.currentViewDate, locale: loadedLocale.current, showTimeSelector: dateSelection === DateSelectionType.DateTime, selectableDate: selectableDate, isValidDate: isValidDate, dispatcher: dispatcher, onChange: onChange })), state.currentSelector === DateTimeActionType.MonthSelector &&