@ballistix.digital/react-components 4.0.0 → 4.2.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.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React, { FC, ReactNode, RefObject, MouseEvent as MouseEvent$1, ReactElement, ChangeEventHandler, FocusEventHandler, HTMLInputTypeAttribute, Dispatch, SetStateAction, ElementType, ChangeEvent } from 'react';
1
+ import React, { FC, ReactNode, RefObject, MouseEvent as MouseEvent$1, ReactElement, ChangeEventHandler, FocusEventHandler, MouseEventHandler, KeyboardEventHandler, HTMLInputTypeAttribute, Dispatch, SetStateAction, ElementType, ChangeEvent } from 'react';
2
2
  import { DeepPartialType } from 'types/DeepPartialType';
3
3
  import { IconName } from '@fortawesome/fontawesome-svg-core';
4
4
  import { Placement } from '@floating-ui/react';
@@ -207,18 +207,24 @@ type TInputGroupFormProps = {
207
207
  htmlType: 'area';
208
208
  onChange: ChangeEventHandler<HTMLTextAreaElement>;
209
209
  onBlur: FocusEventHandler<HTMLTextAreaElement>;
210
+ onClick?: MouseEventHandler<HTMLTextAreaElement>;
211
+ onKeyDown?: KeyboardEventHandler<HTMLTextAreaElement>;
210
212
  onClear?: never;
211
213
  trailing?: string | ReactNode;
212
214
  } | {
213
215
  htmlType: 'text' | 'date';
214
216
  onChange: ChangeEventHandler<HTMLInputElement>;
215
217
  onBlur: FocusEventHandler<HTMLInputElement>;
218
+ onClick?: MouseEventHandler<HTMLInputElement>;
219
+ onKeyDown?: KeyboardEventHandler<HTMLInputElement>;
216
220
  onClear?: () => void;
217
221
  trailing?: never;
218
222
  } | {
219
223
  htmlType: Exclude<HTMLInputTypeAttribute, 'text' | 'date'>;
220
224
  onChange: ChangeEventHandler<HTMLInputElement>;
221
225
  onBlur: FocusEventHandler<HTMLInputElement>;
226
+ onClick?: MouseEventHandler<HTMLInputElement>;
227
+ onKeyDown?: KeyboardEventHandler<HTMLInputElement>;
222
228
  onClear?: never;
223
229
  trailing?: string | ReactNode;
224
230
  });
@@ -492,6 +498,10 @@ declare const base$e: {
492
498
  tableWrapperWithLeftSide: string;
493
499
  table: {
494
500
  container: string;
501
+ pinnedColumns: {
502
+ left: string;
503
+ right: string;
504
+ };
495
505
  head: {
496
506
  container: string;
497
507
  row: string;
@@ -503,6 +513,7 @@ declare const base$e: {
503
513
  };
504
514
  cell: {
505
515
  container: string;
516
+ wrapper: string;
506
517
  text: string;
507
518
  sortIndicator: {
508
519
  container: string;
@@ -517,12 +528,14 @@ declare const base$e: {
517
528
  body: {
518
529
  container: string;
519
530
  row: string;
531
+ striped: string;
520
532
  column: {
521
533
  pinned: {
522
534
  cell: string;
523
535
  };
524
536
  };
525
537
  cell: string;
538
+ sticky: string;
526
539
  checkbox: string;
527
540
  indicator: string;
528
541
  };
@@ -1043,7 +1056,8 @@ type TDateRangeMenuFormProps = {
1043
1056
  endDate: string;
1044
1057
  }) => void;
1045
1058
  onClear?: (name: string) => void;
1046
- onBlur?: any;
1059
+ onBlur?: () => void;
1060
+ onClick?: MouseEventHandler<HTMLDivElement>;
1047
1061
  styles?: TDateRangeMenuFormStyles;
1048
1062
  };
1049
1063
  declare const DateRangeMenu: FC<TDateRangeMenuFormProps>;
package/dist/index.esm.js CHANGED
@@ -782,7 +782,7 @@ var styles$q = {
782
782
  var InputGroupForm = function (props) {
783
783
  var _a;
784
784
  var _b;
785
- var name = props.name, _c = props.htmlType, htmlType = _c === void 0 ? 'text' : _c, label = props.label, description = props.description, placeholder = props.placeholder, leading = props.leading, trailing = props.trailing, required = props.required, value = props.value, mask = props.mask, min = props.min, max = props.max, maxLength = props.maxLength, rows = props.rows, error = props.error, _d = props.type, type = _d === void 0 ? 'normal' : _d, isDisabled = props.isDisabled, _e = props.isRequired, isRequired = _e === void 0 ? false : _e, _f = props.isTouched, isTouched = _f === void 0 ? false : _f, _g = props.isSolo, isSolo = _g === void 0 ? false : _g, onChange = props.onChange, onClear = props.onClear, onBlur = props.onBlur, stylesOverrides = props.styles;
785
+ var name = props.name, _c = props.htmlType, htmlType = _c === void 0 ? 'text' : _c, label = props.label, description = props.description, placeholder = props.placeholder, leading = props.leading, trailing = props.trailing, required = props.required, value = props.value, mask = props.mask, min = props.min, max = props.max, maxLength = props.maxLength, rows = props.rows, error = props.error, _d = props.type, type = _d === void 0 ? 'normal' : _d, isDisabled = props.isDisabled, _e = props.isRequired, isRequired = _e === void 0 ? false : _e, _f = props.isTouched, isTouched = _f === void 0 ? false : _f, _g = props.isSolo, isSolo = _g === void 0 ? false : _g, onChange = props.onChange, onClear = props.onClear, onBlur = props.onBlur, onClick = props.onClick, onKeyDown = props.onKeyDown, stylesOverrides = props.styles;
786
786
  var isValid = error === undefined;
787
787
  var ref = useMask({
788
788
  mask: mask === null || mask === void 0 ? void 0 : mask.mask,
@@ -802,7 +802,7 @@ var InputGroupForm = function (props) {
802
802
  var inputDataCy = "form-input-".concat(name);
803
803
  var errorDataCy = "form-input-error-".concat(name);
804
804
  return (jsxs("div", { className: styles.container, children: [jsxs("div", { className: styles.head, children: [label && (jsx("label", { htmlFor: name, className: styles.label, children: label })), !required && !isRequired && typeof label === 'string' && (jsx("span", { className: styles.hint, children: "Optional" })), required && required({ isRequired: isRequired })] }), jsxs("div", { className: styles.body, children: [leading && jsx("div", { className: styles.leading, children: leading }), !htmlType ||
805
- (htmlType !== 'area' && (jsxs("div", { className: "flex items-center", children: [jsx("input", { type: mask !== undefined ? 'text' : htmlType, ref: mask && ref, name: name, id: name, "data-cy": inputDataCy, className: toClassName(styles.input, htmlType === 'color' && '!h-10'), placeholder: placeholder, defaultValue: isSolo ? value : undefined, value: isSolo ? undefined : value, min: min, max: max, maxLength: maxLength, disabled: isDisabled, onChange: onChange, onBlur: onBlur }), htmlType === 'text' && isClearable && (jsx("div", { className: "right-5 px-2 absolute cursor-pointer hover:opacity-60", onClick: onClear, children: jsx(IconElement, { accessor: "times", className: "text-gray-500" }) })), htmlType === 'date' && isClearable && (jsx("div", { className: "right-10 px-2 absolute cursor-pointer hover:opacity-60", onClick: onClear, children: jsx(IconElement, { accessor: "times", className: "text-gray-500" }) }))] }))), htmlType === 'area' && (jsx("textarea", { rows: rows, name: name, id: name, "data-cy": inputDataCy, className: styles.input, placeholder: placeholder, defaultValue: isSolo ? value : undefined, value: isSolo ? undefined : value, maxLength: maxLength, disabled: isDisabled, onChange: onChange, onBlur: onBlur })), type === 'floored' && (jsx("div", { className: "absolute inset-x-0 bottom-0 border-t border-gray-300 peer-focus:border-t-2 peer-focus:border-primary-600", "aria-hidden": "true" })), trailing && isValid && (jsx("div", { className: styles.trailing, children: trailing })), isTouched && !isValid && (jsx("div", { className: styles.trailing, children: invalidIcon }))] }), jsxs("div", { className: styles.foot, children: [description && !(error && isTouched) && (jsx("p", { className: styles.description, children: description })), error && isTouched && (jsx("p", { className: styles.error, "data-cy": errorDataCy, children: error }))] })] }));
805
+ (htmlType !== 'area' && (jsxs("div", { className: "flex items-center", children: [jsx("input", { type: mask !== undefined ? 'text' : htmlType, ref: mask && ref, name: name, id: name, "data-cy": inputDataCy, className: toClassName(styles.input, htmlType === 'color' && '!h-10'), placeholder: placeholder, defaultValue: isSolo ? value : undefined, value: isSolo ? undefined : value, min: min, max: max, maxLength: maxLength, disabled: isDisabled, onChange: onChange, onBlur: onBlur, onClick: onClick, onKeyDown: onKeyDown }), htmlType === 'text' && isClearable && (jsx("div", { className: "right-5 px-2 absolute cursor-pointer hover:opacity-60", onClick: onClear, children: jsx(IconElement, { accessor: "times", className: "text-gray-500" }) })), htmlType === 'date' && isClearable && (jsx("div", { className: "right-10 px-2 absolute cursor-pointer hover:opacity-60", onClick: onClear, children: jsx(IconElement, { accessor: "times", className: "text-gray-500" }) }))] }))), htmlType === 'area' && (jsx("textarea", { rows: rows, name: name, id: name, "data-cy": inputDataCy, className: styles.input, placeholder: placeholder, defaultValue: isSolo ? value : undefined, value: isSolo ? undefined : value, maxLength: maxLength, disabled: isDisabled, onChange: onChange, onBlur: onBlur, onClick: onClick, onKeyDown: onKeyDown })), type === 'floored' && (jsx("div", { className: "absolute inset-x-0 bottom-0 border-t border-gray-300 peer-focus:border-t-2 peer-focus:border-primary-600", "aria-hidden": "true" })), trailing && isValid && (jsx("div", { className: styles.trailing, children: trailing })), isTouched && !isValid && (jsx("div", { className: styles.trailing, children: invalidIcon }))] }), jsxs("div", { className: styles.foot, children: [description && !(error && isTouched) && (jsx("p", { className: styles.description, children: description })), error && isTouched && (jsx("p", { className: styles.error, "data-cy": errorDataCy, children: error }))] })] }));
806
806
  };
807
807
 
808
808
  var base$l = {
@@ -6001,11 +6001,13 @@ var TableList2 = function (props) {
6001
6001
  zIndex: isDragging ? 1 : 0,
6002
6002
  position: 'relative',
6003
6003
  };
6004
- return (jsx("tr", { ref: setNodeRef, style: style, onClick: function () { return onRowClick && onRowClick(row); }, className: toClassName(styles.body.table.body.row, ((_b = config.options) === null || _b === void 0 ? void 0 : _b.isStriped) && index % 2 === 0 && 'bg-gray-50'), children: map(row.getVisibleCells(), function (cell) {
6004
+ return (jsx("tr", { ref: setNodeRef, style: style, onClick: function () { return onRowClick && onRowClick(row); }, className: toClassName(styles.body.table.body.row, ((_b = config.options) === null || _b === void 0 ? void 0 : _b.isStriped) &&
6005
+ index % 2 === 0 &&
6006
+ styles.body.table.body.striped), children: map(row.getVisibleCells(), function (cell) {
6005
6007
  var _a, _b, _c;
6006
6008
  return (jsx("td", { className: toClassName(styles.body.table.body.cell, ((_a = config === null || config === void 0 ? void 0 : config.options) === null || _a === void 0 ? void 0 : _a.hasStickyHeader) &&
6007
6009
  index !== ((_c = (_b = table === null || table === void 0 ? void 0 : table.getState()) === null || _b === void 0 ? void 0 : _b.pagination) === null || _c === void 0 ? void 0 : _c.pageSize) - 1 &&
6008
- 'border-b border-gray-200'), style: { width: cell.column.getSize() }, children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id));
6010
+ styles.body.table.body.sticky), style: { width: cell.column.getSize() }, children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id));
6009
6011
  }) }, row.id));
6010
6012
  };
6011
6013
  var sensors = useSensors(useSensor(MouseSensor, {}), useSensor(TouchSensor, {}), useSensor(KeyboardSensor, {}));
@@ -6028,8 +6030,6 @@ var TableList2 = function (props) {
6028
6030
  var isPinned = column.getIsPinned();
6029
6031
  var isLastLeftPinnedColumn = column.id == ((_c = last((_b = (_a = config.options) === null || _a === void 0 ? void 0 : _a.columnPinning) === null || _b === void 0 ? void 0 : _b.left)) === null || _c === void 0 ? void 0 : _c.name);
6030
6032
  var isFirstRightPinnedColumn = column.id == ((_f = first((_e = (_d = config.options) === null || _d === void 0 ? void 0 : _d.columnPinning) === null || _e === void 0 ? void 0 : _e.right)) === null || _f === void 0 ? void 0 : _f.name);
6031
- if (isFirstRightPinnedColumn)
6032
- console.log(column.id);
6033
6033
  var width = (_l = find(concat((_h = (_g = config.options) === null || _g === void 0 ? void 0 : _g.columnPinning) === null || _h === void 0 ? void 0 : _h.left, (_k = (_j = config.options) === null || _j === void 0 ? void 0 : _j.columnPinning) === null || _k === void 0 ? void 0 : _k.right), {
6034
6034
  name: column.id,
6035
6035
  })) === null || _l === void 0 ? void 0 : _l.size;
@@ -6038,9 +6038,9 @@ var TableList2 = function (props) {
6038
6038
  maxWidth: width,
6039
6039
  minWidth: width,
6040
6040
  boxShadow: isLastLeftPinnedColumn
6041
- ? '-4px 0 4px -4px gray inset'
6041
+ ? styles.body.table.pinnedColumns.left
6042
6042
  : isFirstRightPinnedColumn
6043
- ? '4px 0 4px -4px gray inset'
6043
+ ? styles.body.table.pinnedColumns.right
6044
6044
  : undefined,
6045
6045
  left: isPinned === 'left'
6046
6046
  ? "".concat(getPinnedColumnsWidth('left', column.id), "px")
@@ -6063,11 +6063,11 @@ var TableList2 = function (props) {
6063
6063
  ? ChevronUpIcon
6064
6064
  : ChevronDownIcon;
6065
6065
  }
6066
- return (jsx("th", { colSpan: header.colSpan, className: toClassName(styles.body.table.head.cell.container, 'border-b', header.column.getCanSort() && 'cursor-pointer', header.column.getIsPinned() &&
6066
+ return (jsx("th", { colSpan: header.colSpan, className: toClassName(styles.body.table.head.cell.container, header.column.getCanSort() && 'cursor-pointer', header.column.getIsPinned() &&
6067
6067
  styles.body.table.head.column.pinned.cell), onClick: header.column.getToggleSortingHandler(), style: __assign$1({ minWidth: !!header.column.columnDef.size &&
6068
6068
  header.column.columnDef.size !== 150
6069
6069
  ? "".concat(header.column.columnDef.size, "px")
6070
- : 'auto' }, getCommonPinningStyles(header.column)), children: jsxs("div", { className: "grid gap-x-1 items-center", style: {
6070
+ : 'auto' }, getCommonPinningStyles(header.column)), children: jsxs("div", { className: styles.body.table.head.cell.wrapper, style: {
6071
6071
  gridTemplateColumns: '1fr auto',
6072
6072
  }, children: [header.isPlaceholder ? null : (jsx("div", { className: styles.body.table.head.cell.text, children: flexRender(header.column.columnDef.header, header.getContext()) })), header.column.getCanSort() && (jsx("span", { className: toClassName(styles.body.table.head.cell.sortIndicator
6073
6073
  .container, header.column.getIsSorted()
@@ -6076,22 +6076,22 @@ var TableList2 = function (props) {
6076
6076
  : styles.body.table.head.cell
6077
6077
  .sortIndicator.isNotSorted), children: jsx(SortIconElement, { className: toClassName(styles.body.table.head.cell.sortIndicator
6078
6078
  .icon.container), "aria-hidden": "true" }) }))] }) }, header.id));
6079
- }) }, headerGroup.id)); }) }), !isLoading && (jsx("tbody", { className: "border", children: isDraggable ? (jsx(SortableContext, { items: map(config.data, function (entity) {
6079
+ }) }, headerGroup.id)); }) }), !isLoading && (jsx("tbody", { className: styles.body.table.body.container, children: isDraggable ? (jsx(SortableContext, { items: map(config.data, function (entity) {
6080
6080
  return get(entity, dragConfig === null || dragConfig === void 0 ? void 0 : dragConfig.rowIdentifierKey);
6081
6081
  }), strategy: verticalListSortingStrategy, children: map(table === null || table === void 0 ? void 0 : table.getRowModel().rows, function (row, index) { return (jsx(DraggableRow, { row: row, index: index }, get(row.original, dragConfig === null || dragConfig === void 0 ? void 0 : dragConfig.rowIdentifierKey))); }) })) : (map(table === null || table === void 0 ? void 0 : table.getRowModel().rows, function (row, index) {
6082
6082
  var _a;
6083
6083
  return (jsx("tr", { onClick: function () { return onRowClick && onRowClick(row); }, className: toClassName(styles.body.table.body.row, ((_a = config.options) === null || _a === void 0 ? void 0 : _a.isStriped) &&
6084
6084
  index % 2 === 0 &&
6085
- 'bg-gray-50'), children: map(row.getVisibleCells(), function (cell) {
6085
+ styles.body.table.body.striped), children: map(row.getVisibleCells(), function (cell) {
6086
6086
  var _a, _b, _c;
6087
6087
  return (jsx("td", { className: toClassName(styles.body.table.body.cell, ((_a = config === null || config === void 0 ? void 0 : config.options) === null || _a === void 0 ? void 0 : _a.hasStickyHeader) &&
6088
6088
  index !==
6089
6089
  ((_c = (_b = table === null || table === void 0 ? void 0 : table.getState()) === null || _b === void 0 ? void 0 : _b.pagination) === null || _c === void 0 ? void 0 : _c.pageSize) -
6090
6090
  1 &&
6091
- 'border-b border-gray-200', cell.column.getIsPinned() &&
6091
+ styles.body.table.body.sticky, cell.column.getIsPinned() &&
6092
6092
  styles.body.table.body.column.pinned.cell), style: __assign$1({ width: cell.column.getSize() }, getCommonPinningStyles(cell.column)), children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id));
6093
6093
  }) }, row.id));
6094
- })) }))] }), isEmpty(table === null || table === void 0 ? void 0 : table.getRowModel().rows) && !isLoading && (jsx(Fragment, { children: ((_v = config === null || config === void 0 ? void 0 : config.options) === null || _v === void 0 ? void 0 : _v.emptyComponent) ? ((_w = config === null || config === void 0 ? void 0 : config.options) === null || _w === void 0 ? void 0 : _w.emptyComponent) : (jsx("div", { className: "w-full flex justify-center my-2", children: "There is no data to show..." })) })), isLoading && (jsx("div", { className: "flex flex-col gap-y-2 w-full pt-5", children: times(8, function (index) { return (jsxs("div", { className: "flex gap-2", children: [jsx("div", { className: "w-20 h-12 rounded-md bg-gray-100 animate-pulse" }), jsx("div", { className: "w-full h-12 rounded-md bg-gray-100 animate-pulse" })] }, index)); }) }))] })] }) }) }), foot && jsx("div", { className: styles.foot, children: foot(state) })] }));
6094
+ })) }))] }), isEmpty(table === null || table === void 0 ? void 0 : table.getRowModel().rows) && !isLoading && (jsx(Fragment, { children: ((_v = config === null || config === void 0 ? void 0 : config.options) === null || _v === void 0 ? void 0 : _v.emptyComponent) ? ((_w = config === null || config === void 0 ? void 0 : config.options) === null || _w === void 0 ? void 0 : _w.emptyComponent) : (jsx("div", { className: styles$g.empty, children: "There is no data to show..." })) })), isLoading && (jsx("div", { className: styles$g.loading.container, children: times(8, function (index) { return (jsxs("div", { className: styles$g.loading.row.container, children: [jsx("div", { className: styles$g.loading.row.first }), jsx("div", { className: styles$g.loading.row.last })] }, index)); }) }))] })] }) }) }), foot && jsx("div", { className: styles.foot, children: foot(state) })] }));
6095
6095
  return isDraggable ? (jsx(DndContext, { collisionDetection: closestCenter, modifiers: [restrictToVerticalAxis], onDragEnd: onDragEnd, sensors: sensors, children: Content })) : (Content);
6096
6096
  };
6097
6097
 
@@ -6107,6 +6107,10 @@ var base$c = {
6107
6107
  tableWrapperWithLeftSide: '!min-w-max w-full',
6108
6108
  table: {
6109
6109
  container: 'min-w-full border-separate border-spacing-0',
6110
+ pinnedColumns: {
6111
+ left: '-4px 0 4px -4px gray inset',
6112
+ right: '4px 0 4px -4px gray inset',
6113
+ },
6110
6114
  head: {
6111
6115
  container: '',
6112
6116
  row: '',
@@ -6117,7 +6121,8 @@ var base$c = {
6117
6121
  },
6118
6122
  },
6119
6123
  cell: {
6120
- container: ' py-3.5 px-3 text-left text-sm font-semibold text-gray-900 group',
6124
+ container: 'py-3.5 px-3 text-left text-sm font-semibold text-gray-900 group border-b',
6125
+ wrapper: 'grid gap-x-1 items-center',
6121
6126
  text: 'whitespace-normal break-words',
6122
6127
  sortIndicator: {
6123
6128
  container: 'ml-2 inline-flex items-center rounded',
@@ -6130,14 +6135,16 @@ var base$c = {
6130
6135
  },
6131
6136
  },
6132
6137
  body: {
6133
- container: 'divide-y divide-gray-200 border-t',
6138
+ container: 'border',
6134
6139
  row: '',
6140
+ striped: 'bg-gray-50',
6135
6141
  column: {
6136
6142
  pinned: {
6137
6143
  cell: 'bg-white sticky z-10 overflow-hidden text-ellipsis',
6138
6144
  },
6139
6145
  },
6140
6146
  cell: 'whitespace-nowrap py-2.5 px-3 text-sm text-gray-500',
6147
+ sticky: 'border-b border-gray-200',
6141
6148
  checkbox: 'absolute left-4 top-1/2 -mt-2 h-4 w-4 rounded border-gray-300 text-primary-600 focus:ring-primary-500 sm:left-6',
6142
6149
  indicator: 'absolute inset-y-0 left-0 w-0.5 bg-primary-600',
6143
6150
  },
@@ -6148,6 +6155,15 @@ var base$c = {
6148
6155
  };
6149
6156
  var styles$g = {
6150
6157
  base: base$c,
6158
+ loading: {
6159
+ container: 'flex flex-col gap-y-2 w-full pt-5',
6160
+ row: {
6161
+ container: 'flex gap-2',
6162
+ first: 'w-20 h-12 rounded-md bg-gray-100 animate-pulse',
6163
+ last: 'w-full h-12 rounded-md bg-gray-100 animate-pulse',
6164
+ },
6165
+ },
6166
+ empty: 'w-full flex justify-center my-2',
6151
6167
  };
6152
6168
 
6153
6169
  var createColumnHelper = function () {
@@ -6988,7 +7004,7 @@ var DateRangeMenu = function (props) {
6988
7004
  var _a;
6989
7005
  var _b = props.name, name = _b === void 0 ? 'date-menu-form' : _b, _c = props.size, size = _c === void 0 ? 'compact' : _c, label = props.label, _d = props.i18n, i18n = _d === void 0 ? 'en' : _d, description = props.description, placeholder = props.placeholder, separator = props.separator, startFrom = props.startFrom, _e = props.displayFormat, displayFormat = _e === void 0 ? 'DD.MM.YYYY' : _e, _f = props.direction, direction = _f === void 0 ? 'down' : _f, minDate = props.minDate, maxDate = props.maxDate, _g = props.startWeekOn, startWeekOn = _g === void 0 ? 'mon' : _g, _h = props.icon, icon = _h === void 0 ? function (isEmpty) {
6990
7006
  return isEmpty ? (jsx(IconElement, { accessor: "calendar" })) : (jsx(IconElement, { accessor: "xmark", className: "text-black" }));
6991
- } : _h, required = props.required, defaultValue = props.value, error = props.error, _j = props.type, type = _j === void 0 ? 'normal' : _j, _k = props.isRequired, isRequired = _k === void 0 ? false : _k, _l = props.isTouched, isTouched = _l === void 0 ? false : _l, isDisabled = props.isDisabled, _m = props.isSolo, isSolo = _m === void 0 ? false : _m, _o = props.isRanged, isRanged = _o === void 0 ? false : _o, onChange = props.onChange, onClear = props.onClear, onBlur = props.onBlur, stylesOverrides = props.styles;
7007
+ } : _h, required = props.required, defaultValue = props.value, error = props.error, _j = props.type, type = _j === void 0 ? 'normal' : _j, _k = props.isRequired, isRequired = _k === void 0 ? false : _k, _l = props.isTouched, isTouched = _l === void 0 ? false : _l, isDisabled = props.isDisabled, _m = props.isSolo, isSolo = _m === void 0 ? false : _m, _o = props.isRanged, isRanged = _o === void 0 ? false : _o, onChange = props.onChange, onClear = props.onClear, onBlur = props.onBlur, onClick = props.onClick, stylesOverrides = props.styles;
6992
7008
  var isValid = error === undefined;
6993
7009
  var _p = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : {
6994
7010
  startDate: null,
@@ -7055,7 +7071,7 @@ var DateRangeMenu = function (props) {
7055
7071
  }
7056
7072
  return function () { return removeEventListener('keydown', callback); };
7057
7073
  }, [handleValueChange, isRanged, separator]);
7058
- return (jsxs("div", { className: styles.container, children: [jsxs("div", { className: styles.head, children: [label && (jsx("label", { htmlFor: name, className: styles.label, children: label })), !required && !isRequired && typeof label === 'string' && (jsx("span", { className: styles.hint, children: "Optional" })), required && required({ isRequired: isRequired })] }), jsxs("div", { className: styles.container, "data-cy": inputDataCy, ref: $datepickerInputRef, children: [jsx(Datepicker, { inputName: name, inputId: name, i18n: i18n, useRange: size === 'expanded', placeholder: placeholder, asSingle: !isRanged, separator: separator, startFrom: startFrom, displayFormat: displayFormat, disabled: isDisabled, popoverDirection: direction, minDate: minDate, maxDate: maxDate, toggleIcon: icon,
7074
+ return (jsxs("div", { className: styles.container, children: [jsxs("div", { className: styles.head, children: [label && (jsx("label", { htmlFor: name, className: styles.label, children: label })), !required && !isRequired && typeof label === 'string' && (jsx("span", { className: styles.hint, children: "Optional" })), required && required({ isRequired: isRequired })] }), jsxs("div", { className: styles.container, "data-cy": inputDataCy, ref: $datepickerInputRef, onClick: onClick, children: [jsx(Datepicker, { inputName: name, inputId: name, i18n: i18n, useRange: size === 'expanded', placeholder: placeholder, asSingle: !isRanged, separator: separator, startFrom: startFrom, displayFormat: displayFormat, disabled: isDisabled, popoverDirection: direction, minDate: minDate, maxDate: maxDate, toggleIcon: icon,
7059
7075
  //
7060
7076
  value: state,
7061
7077
  //