@ballistix.digital/react-components 3.3.0 → 3.3.1

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
@@ -446,6 +446,16 @@ type TTableListProps<TData> = {
446
446
  isStriped?: boolean;
447
447
  hasStickyHeader?: boolean;
448
448
  hasVerticalSeparators?: boolean;
449
+ columnPinning?: {
450
+ left?: {
451
+ name: string;
452
+ size: number;
453
+ }[];
454
+ right?: {
455
+ name: string;
456
+ size: number;
457
+ }[];
458
+ };
449
459
  };
450
460
  };
451
461
  isLoading?: boolean;
@@ -478,6 +488,7 @@ declare const base$e: {
478
488
  content: string;
479
489
  styleWrapper: string;
480
490
  tableWrapper: string;
491
+ tableWrapperWithLeftSide: string;
481
492
  table: {
482
493
  container: string;
483
494
  head: {
@@ -500,6 +511,11 @@ declare const base$e: {
500
511
  body: {
501
512
  container: string;
502
513
  row: string;
514
+ column: {
515
+ pinned: {
516
+ cell: string;
517
+ };
518
+ };
503
519
  cell: string;
504
520
  checkbox: string;
505
521
  indicator: string;
@@ -965,7 +981,29 @@ declare const base$6: {
965
981
  };
966
982
  type TSelectMenuFormStyles = DeepPartialType<typeof base$6>;
967
983
 
968
- type TDateMenuFormProps = {
984
+ type TDateMenuFormProps = Omit<TDateRangeMenuFormProps, 'value' | 'isRanged' | 'onChange'> & {
985
+ value?: string;
986
+ isRanged?: false;
987
+ onChange?: (value: string) => void;
988
+ };
989
+ declare const DateMenuForm: FC<TDateMenuFormProps>;
990
+
991
+ declare const base$5: {
992
+ container: string;
993
+ head: string;
994
+ body: string;
995
+ foot: string;
996
+ label: string;
997
+ hint: string;
998
+ leading: string;
999
+ input: string;
1000
+ trailing: string;
1001
+ description: string;
1002
+ error: string;
1003
+ };
1004
+ type TDateRangeMenuFormStyles = DeepPartialType<typeof base$5>;
1005
+
1006
+ type TDateRangeMenuFormProps = {
969
1007
  name: string;
970
1008
  type?: 'normal' | 'inset' | 'overlapping' | 'pill' | 'floored';
971
1009
  size?: 'compact' | 'expanded';
@@ -985,9 +1023,8 @@ type TDateMenuFormProps = {
985
1023
  isRequired: boolean;
986
1024
  }) => string | ReactNode;
987
1025
  value: {
988
- label: string;
989
- value: string;
990
- disabled?: boolean;
1026
+ startDate: string;
1027
+ endDate: string;
991
1028
  };
992
1029
  error?: string;
993
1030
  isRequired?: boolean;
@@ -1001,24 +1038,9 @@ type TDateMenuFormProps = {
1001
1038
  }) => void;
1002
1039
  onClear?: (name: string) => void;
1003
1040
  onBlur?: any;
1004
- styles?: TDateMenuFormStyles;
1005
- };
1006
- declare const DateMenuForm: FC<TDateMenuFormProps>;
1007
-
1008
- declare const base$5: {
1009
- container: string;
1010
- head: string;
1011
- body: string;
1012
- foot: string;
1013
- label: string;
1014
- hint: string;
1015
- leading: string;
1016
- input: string;
1017
- trailing: string;
1018
- description: string;
1019
- error: string;
1041
+ styles?: TDateRangeMenuFormStyles;
1020
1042
  };
1021
- type TDateMenuFormStyles = DeepPartialType<typeof base$5>;
1043
+ declare const DateRangeMenu: FC<TDateRangeMenuFormProps>;
1022
1044
 
1023
1045
  type TCheckboxInputGroupFormProps = {
1024
1046
  name: string;
@@ -1297,4 +1319,4 @@ type TReturn<TData> = {
1297
1319
  };
1298
1320
  declare const useExcel: <TData extends object>() => TReturn<TData>;
1299
1321
 
1300
- export { AddressInputGroupForm, BadgeElement$1 as AlertElement, AvatarElement, BadgeElement, BreadcrumbsNavigation, ButtonElement, ButtonGroupElement, CheckboxInputForm as CheckboxInput, ContainerLayout, DateMenuForm, DividerLayout, DropdownElement, FileInputGroupForm, IconElement, InputGroupForm, ListContainerLayout, MediaObjectLayout, ModalOverlay, NotificationOverlay, OpeningsHourInputGroupForm, PagePaginationNavigation, LayoutPanel as PanelLayout, PanelPaginationNavigation, SelectMenuForm, SlideOverOverlay, Switch as SwitchForm, type TAddressInputGroupFormProps, type TAddressInputGroupFormStyles, type TAddressInputGroupFormValue, type TButtonElementProps, type TCheckboxInputFormProps, type TCheckboxInputFormStyles, type TCheckboxInputGroupFormProps, type TCheckboxInputGroupFormStyles, type TDateMenuFormProps, type TDateMenuFormStyles, type TExcelCell, type TExcelRow, type TExcelSheet, type TFileInputGroupFormProps, type TFileInputGroupFormStyles, type TInputGroupFormProps, type TInputGroupStyles, type TModalOverlayProps, type TOpeningsHourInputGroupFormProps, type TOpeningsHourInputGroupFormStyles, type TSelectMenuFormProps, type TSelectMenuFormStyles, type TSwitchFormProps, type TSwitchStylesForm, type TTableListProps as TTableList2Props, type TTableListProps$1 as TTableListProps, type TTableListStyles$1 as TTableListStyles, TabNavigation, TableColumnOptionsCustom, TableExcelExportCustom as TableExportCustom, TableList, TableList2, TooltipElement, VerticalNavigation, CheckboxInputGroupForm as __DEPRECATED__CheckboxInputGroupForm, useExcel };
1322
+ export { AddressInputGroupForm, BadgeElement$1 as AlertElement, AvatarElement, BadgeElement, BreadcrumbsNavigation, ButtonElement, ButtonGroupElement, CheckboxInputForm as CheckboxInput, ContainerLayout, DateMenuForm, DateRangeMenu as DateRangeMenuForm, DividerLayout, DropdownElement, FileInputGroupForm, IconElement, InputGroupForm, ListContainerLayout, MediaObjectLayout, ModalOverlay, NotificationOverlay, OpeningsHourInputGroupForm, PagePaginationNavigation, LayoutPanel as PanelLayout, PanelPaginationNavigation, SelectMenuForm, SlideOverOverlay, Switch as SwitchForm, type TAddressInputGroupFormProps, type TAddressInputGroupFormStyles, type TAddressInputGroupFormValue, type TButtonElementProps, type TCheckboxInputFormProps, type TCheckboxInputFormStyles, type TCheckboxInputGroupFormProps, type TCheckboxInputGroupFormStyles, type TDateMenuFormProps, type TDateRangeMenuFormStyles as TDateMenuFormStyles, type TDateRangeMenuFormProps, type TDateRangeMenuFormStyles, type TExcelCell, type TExcelRow, type TExcelSheet, type TFileInputGroupFormProps, type TFileInputGroupFormStyles, type TInputGroupFormProps, type TInputGroupStyles, type TModalOverlayProps, type TOpeningsHourInputGroupFormProps, type TOpeningsHourInputGroupFormStyles, type TSelectMenuFormProps, type TSelectMenuFormStyles, type TSwitchFormProps, type TSwitchStylesForm, type TTableListProps as TTableList2Props, type TTableListProps$1 as TTableListProps, type TTableListStyles$1 as TTableListStyles, TabNavigation, TableColumnOptionsCustom, TableExcelExportCustom as TableExportCustom, TableList, TableList2, TooltipElement, VerticalNavigation, CheckboxInputGroupForm as __DEPRECATED__CheckboxInputGroupForm, useExcel };
package/dist/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { ArrowPathIcon, ChevronDownIcon, EllipsisVerticalIcon, ExclamationCircleIcon, ChevronDoubleLeftIcon, ChevronLeftIcon, ChevronRightIcon, ChevronDoubleRightIcon, ChevronUpIcon, ChevronUpDownIcon, HomeIcon, ArrowLongLeftIcon, ArrowLongRightIcon } from '@heroicons/react/20/solid';
3
- import { isArray, map, set, get, noop as noop$2, indexOf, toSafeInteger, pick, isEmpty, some, compact as compact$1, forEach, assign, includes, times, intersection, trim, lastIndexOf } from 'lodash';
3
+ import { isArray, map, set, get, noop as noop$2, indexOf, toSafeInteger, pick, isEmpty, some, compact as compact$1, forEach, assign, includes, findIndex, find, concat, times, intersection, trim, lastIndexOf } from 'lodash';
4
4
  import get$1 from 'lodash/get';
5
5
  import React, { useState, useMemo, useRef, Children, Fragment as Fragment$1, useEffect, useCallback, useLayoutEffect, createContext, memo, useReducer, forwardRef, useContext, cloneElement, useImperativeHandle, createElement, PureComponent, Component } from 'react';
6
6
  import { library } from '@fortawesome/fontawesome-svg-core';
@@ -5820,11 +5820,11 @@ var isValidState = function (state) {
5820
5820
  };
5821
5821
 
5822
5822
  var TableList2 = function (props) {
5823
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
5823
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
5824
5824
  var id = props.id, config = props.table, head = props.head, foot = props.foot, leftSide = props.leftSide, isLoading = props.isLoading, onRowClick = props.onRowClick, onChange = props.onChange, stylesOverrides = props.styles, dragConfig = props.dragConfig;
5825
- var _l = useState({}), columnVisibility = _l[0], setColumnVisibility = _l[1];
5826
- var _m = useState([]), columnOrder = _m[0], setColumnOrder = _m[1];
5827
- var _o = useState((_b = (_a = config.options) === null || _a === void 0 ? void 0 : _a.defaultSorting) !== null && _b !== void 0 ? _b : []), sorting = _o[0], setSorting = _o[1];
5825
+ var _x = useState({}), columnVisibility = _x[0], setColumnVisibility = _x[1];
5826
+ var _y = useState([]), columnOrder = _y[0], setColumnOrder = _y[1];
5827
+ var _z = useState((_b = (_a = config.options) === null || _a === void 0 ? void 0 : _a.defaultSorting) !== null && _b !== void 0 ? _b : []), sorting = _z[0], setSorting = _z[1];
5828
5828
  var handleGenerateStyle = function () {
5829
5829
  var result = deepCopyObject(styles$g.base);
5830
5830
  var keys = calculateNestedKeys(styles$g.base);
@@ -5894,6 +5894,7 @@ var TableList2 = function (props) {
5894
5894
  }
5895
5895
  ], config.columns, true) : config.columns,
5896
5896
  data: config.data,
5897
+ enableColumnPinning: true,
5897
5898
  state: {
5898
5899
  sorting: sorting,
5899
5900
  columnVisibility: columnVisibility,
@@ -5904,6 +5905,10 @@ var TableList2 = function (props) {
5904
5905
  ? __assign$1({ 'drag-handle': true }, initialVisibilityState) : initialVisibilityState,
5905
5906
  columnOrder: isDraggable
5906
5907
  ? __spreadArray(['drag-handle'], ((_e = (_d = config.options) === null || _d === void 0 ? void 0 : _d.defaultOrder) !== null && _e !== void 0 ? _e : []), true) : (_f = config.options) === null || _f === void 0 ? void 0 : _f.defaultOrder,
5908
+ columnPinning: {
5909
+ left: (_j = map((_h = (_g = config.options) === null || _g === void 0 ? void 0 : _g.columnPinning) === null || _h === void 0 ? void 0 : _h.left, 'name')) !== null && _j !== void 0 ? _j : [],
5910
+ right: (_m = map((_l = (_k = config.options) === null || _k === void 0 ? void 0 : _k.columnPinning) === null || _l === void 0 ? void 0 : _l.right, 'name')) !== null && _m !== void 0 ? _m : [],
5911
+ },
5907
5912
  },
5908
5913
  manualPagination: true,
5909
5914
  manualSorting: true,
@@ -5954,7 +5959,7 @@ var TableList2 = function (props) {
5954
5959
  }
5955
5960
  setColumnVisibility(visibility_1);
5956
5961
  }
5957
- }, [(_g = config === null || config === void 0 ? void 0 : config.options) === null || _g === void 0 ? void 0 : _g.defaultVisibility, id, table]);
5962
+ }, [(_o = config === null || config === void 0 ? void 0 : config.options) === null || _o === void 0 ? void 0 : _o.defaultVisibility, id, table]);
5958
5963
  useEffect(function () {
5959
5964
  var _a, _b, _c, _d;
5960
5965
  var savedOrder = (_a = getTableState(id)) === null || _a === void 0 ? void 0 : _a.columnOrder;
@@ -5969,7 +5974,7 @@ var TableList2 = function (props) {
5969
5974
  var mappedColumns = map(config.columns, function (column) { var _a; return ((_a = column === null || column === void 0 ? void 0 : column.id) !== null && _a !== void 0 ? _a : get(column, 'accessorKey')); });
5970
5975
  setColumnOrder(isDraggable ? __spreadArray(['drag-handle'], mappedColumns, true) : mappedColumns);
5971
5976
  }
5972
- }, [config.columns, (_h = config === null || config === void 0 ? void 0 : config.options) === null || _h === void 0 ? void 0 : _h.defaultOrder, id, isDraggable]);
5977
+ }, [config.columns, (_p = config === null || config === void 0 ? void 0 : config.options) === null || _p === void 0 ? void 0 : _p.defaultOrder, id, isDraggable]);
5973
5978
  // Write state to local storage when it changes
5974
5979
  useEffect(function () {
5975
5980
  if (state) {
@@ -6004,7 +6009,46 @@ var TableList2 = function (props) {
6004
6009
  }) }, row.id));
6005
6010
  };
6006
6011
  var sensors = useSensors(useSensor(MouseSensor, {}), useSensor(TouchSensor, {}), useSensor(KeyboardSensor, {}));
6007
- var Content = (jsxs("div", { className: styles.container, "data-cy": "table-list-".concat(id), children: [head && jsx("div", { className: styles.head, children: head(state) }), jsx("div", { className: styles.body.content, children: jsx("div", { className: styles.body.wrapper, children: jsxs("div", { className: styles.body.styleWrapper, children: [leftSide && (jsx("div", { className: styles.leftSide, children: leftSide(state) })), jsxs("div", { className: styles.body.tableWrapper, children: [jsxs("table", { className: styles.body.table.container, children: [jsx("thead", { className: styles.body.table.head.container, children: map(table === null || table === void 0 ? void 0 : table.getHeaderGroups(), function (headerGroup) { return (jsx("tr", { className: styles.body.table.head.row, children: map(headerGroup.headers, function (header) {
6012
+ var getPinnedColumnsWidth = useCallback(function (side, id) {
6013
+ var _a, _b, _c, _d;
6014
+ var pinnedColumns = map((_b = (_a = config.options) === null || _a === void 0 ? void 0 : _a.columnPinning) === null || _b === void 0 ? void 0 : _b[side], 'size');
6015
+ var pinnedColumnIndex = findIndex((_d = (_c = config.options) === null || _c === void 0 ? void 0 : _c.columnPinning) === null || _d === void 0 ? void 0 : _d[side], { name: id });
6016
+ if (pinnedColumnIndex === -1)
6017
+ return null;
6018
+ return pinnedColumns
6019
+ .slice(0, pinnedColumnIndex)
6020
+ .reduce(function (acc, size) { return acc + size; }, 0);
6021
+ }, [(_q = config.options) === null || _q === void 0 ? void 0 : _q.columnPinning]);
6022
+ var getCommonPinningStyles = useCallback(function (column) {
6023
+ var _a, _b, _c, _d, _e;
6024
+ var isPinned = column.getIsPinned();
6025
+ var isLastLeftPinnedColumn = isPinned === 'left' && column.getIsLastColumn('left');
6026
+ var isFirstRightPinnedColumn = isPinned === 'right' && column.getIsFirstColumn('right');
6027
+ var width = (_e = find(concat((_b = (_a = config.options) === null || _a === void 0 ? void 0 : _a.columnPinning) === null || _b === void 0 ? void 0 : _b.left, (_d = (_c = config.options) === null || _c === void 0 ? void 0 : _c.columnPinning) === null || _d === void 0 ? void 0 : _d.right), {
6028
+ name: column.id,
6029
+ })) === null || _e === void 0 ? void 0 : _e.size;
6030
+ return {
6031
+ width: width,
6032
+ maxWidth: width,
6033
+ minWidth: width,
6034
+ boxShadow: isLastLeftPinnedColumn
6035
+ ? '-4px 0 4px -4px gray inset'
6036
+ : isFirstRightPinnedColumn
6037
+ ? '4px 0 4px -4px gray inset'
6038
+ : undefined,
6039
+ left: isPinned === 'left'
6040
+ ? "".concat(getPinnedColumnsWidth('left', column.id), "px")
6041
+ : undefined,
6042
+ right: isPinned === 'right'
6043
+ ? "".concat(getPinnedColumnsWidth('right', column.id), "px")
6044
+ : undefined,
6045
+ };
6046
+ }, [
6047
+ (_s = (_r = config.options) === null || _r === void 0 ? void 0 : _r.columnPinning) === null || _s === void 0 ? void 0 : _s.left,
6048
+ (_u = (_t = config.options) === null || _t === void 0 ? void 0 : _t.columnPinning) === null || _u === void 0 ? void 0 : _u.right,
6049
+ getPinnedColumnsWidth,
6050
+ ]);
6051
+ var Content = (jsxs("div", { className: styles.container, "data-cy": "table-list-".concat(id), children: [head && jsx("div", { className: styles.head, children: head(state) }), jsx("div", { className: styles.body.content, children: jsx("div", { className: styles.body.wrapper, children: jsxs("div", { className: styles.body.styleWrapper, children: [leftSide && (jsx("div", { className: styles.leftSide, children: leftSide(state) })), jsxs("div", { className: toClassName(styles.body.tableWrapper, leftSide && styles.body.tableWrapperWithLeftSide), children: [jsxs("table", { className: styles.body.table.container, children: [jsx("thead", { className: styles.body.table.head.container, children: map(table === null || table === void 0 ? void 0 : table.getHeaderGroups(), function (headerGroup) { return (jsx("tr", { className: styles.body.table.head.row, children: map(headerGroup.headers, function (header) {
6008
6052
  // Default sort icon to show a user that the column is sortable
6009
6053
  var SortIconElement = ChevronUpDownIcon;
6010
6054
  if (header.column.getIsSorted()) {
@@ -6013,12 +6057,11 @@ var TableList2 = function (props) {
6013
6057
  ? ChevronUpIcon
6014
6058
  : ChevronDownIcon;
6015
6059
  }
6016
- return (jsx("th", { colSpan: header.colSpan, className: toClassName(styles.body.table.head.cell.container, 'border-b', header.column.getCanSort() && 'cursor-pointer'), onClick: header.column.getToggleSortingHandler(), style: {
6017
- minWidth: !!header.column.columnDef.size &&
6060
+ return (jsx("th", { colSpan: header.colSpan, className: toClassName(styles.body.table.head.cell.container, 'border-b', header.column.getCanSort() && 'cursor-pointer', header.column.getIsPinned() &&
6061
+ styles.body.table.body.column.pinned.cell), onClick: header.column.getToggleSortingHandler(), style: __assign$1({ minWidth: !!header.column.columnDef.size &&
6018
6062
  header.column.columnDef.size !== 150
6019
6063
  ? "".concat(header.column.columnDef.size, "px")
6020
- : 'auto',
6021
- }, children: jsxs("div", { className: "grid gap-x-1 items-center", style: {
6064
+ : 'auto' }, getCommonPinningStyles(header.column)), children: jsxs("div", { className: "grid gap-x-1 items-center", style: {
6022
6065
  gridTemplateColumns: '1fr auto',
6023
6066
  }, 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
6024
6067
  .container, header.column.getIsSorted()
@@ -6039,9 +6082,10 @@ var TableList2 = function (props) {
6039
6082
  index !==
6040
6083
  ((_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) -
6041
6084
  1 &&
6042
- 'border-b border-gray-200'), style: { width: cell.column.getSize() }, children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id));
6085
+ 'border-b border-gray-200', cell.column.getIsPinned() &&
6086
+ 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));
6043
6087
  }) }, row.id));
6044
- })) }))] }), isEmpty(table === null || table === void 0 ? void 0 : table.getRowModel().rows) && !isLoading && (jsx(Fragment, { children: ((_j = config === null || config === void 0 ? void 0 : config.options) === null || _j === void 0 ? void 0 : _j.emptyComponent) ? ((_k = config === null || config === void 0 ? void 0 : config.options) === null || _k === void 0 ? void 0 : _k.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) })] }));
6088
+ })) }))] }), 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) })] }));
6045
6089
  return isDraggable ? (jsx(DndContext, { collisionDetection: closestCenter, modifiers: [restrictToVerticalAxis], onDragEnd: onDragEnd, sensors: sensors, children: Content })) : (Content);
6046
6090
  };
6047
6091
 
@@ -6054,6 +6098,7 @@ var base$c = {
6054
6098
  content: '',
6055
6099
  styleWrapper: 'flex overflow-x-scroll overflow-y-visible',
6056
6100
  tableWrapper: 'inline-block min-w-full align-middle',
6101
+ tableWrapperWithLeftSide: '!min-w-max w-full',
6057
6102
  table: {
6058
6103
  container: 'min-w-full border-separate border-spacing-0',
6059
6104
  head: {
@@ -6076,6 +6121,11 @@ var base$c = {
6076
6121
  body: {
6077
6122
  container: 'divide-y divide-gray-200 border-t',
6078
6123
  row: '',
6124
+ column: {
6125
+ pinned: {
6126
+ cell: 'bg-white sticky z-10 overflow-hidden text-ellipsis',
6127
+ },
6128
+ },
6079
6129
  cell: 'whitespace-nowrap py-2.5 px-3 text-sm text-gray-500',
6080
6130
  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',
6081
6131
  indicator: 'absolute inset-y-0 left-0 w-0.5 bg-primary-600',
@@ -6835,6 +6885,95 @@ var TableExcelExportCustom = function (props) {
6835
6885
  };
6836
6886
 
6837
6887
  var DateMenuForm = function (props) {
6888
+ var onChange = props.onChange, defaultValue = props.value;
6889
+ var handleChange = useCallback(function (value) {
6890
+ onChange && onChange(value.startDate);
6891
+ }, [onChange]);
6892
+ var value = useMemo(function () {
6893
+ return defaultValue
6894
+ ? { startDate: defaultValue, endDate: defaultValue }
6895
+ : { startDate: '', endDate: '' };
6896
+ }, [defaultValue]);
6897
+ return (jsx(DateRangeMenu, __assign$1({}, props, { onChange: handleChange, isRanged: false, value: value })));
6898
+ };
6899
+
6900
+ var base$5 = {
6901
+ container: '',
6902
+ head: 'flex justify-between',
6903
+ body: 'relative rounded-md',
6904
+ foot: '',
6905
+ label: 'block font-medium text-gray-900',
6906
+ hint: 'text-xs text-gray-500',
6907
+ leading: 'pointer-events-none absolute inset-y-0 left-0 flex items-center',
6908
+ input: 'block w-full inline-flex',
6909
+ trailing: 'pointer-events-none absolute inset-y-0 right-0 flex items-center',
6910
+ description: 'text-gray-400 text-xs mt-1',
6911
+ error: 'text-red-500 text-xs ml-5 mt-1',
6912
+ };
6913
+ var leading$3 = {
6914
+ input: 'pl-10',
6915
+ };
6916
+ var trailing$3 = {};
6917
+ var normal$3 = {
6918
+ label: 'leading-6 text-sm mb-2',
6919
+ hint: 'leading-6',
6920
+ leading: 'pl-3',
6921
+ input: 'rounded-md border-gray-200 shadow-sm focus:border-primary-500 focus:ring-primary-500 sm:text-sm placeholder-gray-300',
6922
+ trailing: 'pr-3',
6923
+ description: 'mt-2 text-sm',
6924
+ };
6925
+ var inset$3 = {
6926
+ container: 'rounded-md px-3 pt-2.5 pb-1.5 shadow-sm ring-1 ring-inset ring-gray-300 focus-within:ring-2 focus-within:ring-primary-600',
6927
+ label: 'text-xs',
6928
+ hint: 'text-xs',
6929
+ input: 'border-0 !ring-0 p-0 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm pl-0',
6930
+ description: 'hidden',
6931
+ };
6932
+ var overlapping$3 = {
6933
+ container: 'relative',
6934
+ head: ' absolute flex justify-between items-center left-0 -top-2 right-0 mx-2 z-10 w-full',
6935
+ label: 'inline-block bg-white px-1 text-xs font-medium text-gray-900 ',
6936
+ hint: 'text-xs mr-4 bg-white px-1',
6937
+ input: 'block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6',
6938
+ description: 'hidden',
6939
+ };
6940
+ var pill$3 = {
6941
+ head: 'mx-px block px-4 text-sm font-medium leading-6 text-gray-900 mb-1 pr-6',
6942
+ foot: 'mx-px block px-4 text-sm font-medium leading-6 text-gray-900 mt-1 pr-6',
6943
+ input: 'block w-full rounded-full border-0 px-4 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6',
6944
+ trailing: 'pr-2',
6945
+ description: 'text-xs',
6946
+ };
6947
+ var floored$3 = {
6948
+ body: 'relative mt-2',
6949
+ label: 'block text-sm font-medium leading-6 text-gray-900',
6950
+ input: 'peer block w-full border-0 bg-gray-50 py-1.5 text-gray-900 focus:ring-0 sm:text-sm sm:leading-6 ring-0',
6951
+ description: 'text-xs mt-2',
6952
+ };
6953
+ var invalid$3 = {
6954
+ container: '!ring-red-500',
6955
+ input:
6956
+ // 'block w-full border border-transparent text-red-900 ring-1 ring-inset ring-red-300 placeholder:text-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500 sm:leading-6 pr-10',
6957
+ 'block w-full border border-transparent text-red-900 ring-1 ring-inset ring-red-300 placeholder:text-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500 pr-10',
6958
+ description: 'text-sm text-red-600',
6959
+ };
6960
+ var disabled$5 = {
6961
+ input: 'block w-full rounded-md border-0 text-gray-900 shadow-sm ring-1 ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-500 disabled:ring-gray-200',
6962
+ };
6963
+ var styles$7 = {
6964
+ base: base$5,
6965
+ leading: leading$3,
6966
+ trailing: trailing$3,
6967
+ normal: normal$3,
6968
+ inset: inset$3,
6969
+ overlapping: overlapping$3,
6970
+ pill: pill$3,
6971
+ floored: floored$3,
6972
+ invalid: invalid$3,
6973
+ disabled: disabled$5,
6974
+ };
6975
+
6976
+ var DateRangeMenu = function (props) {
6838
6977
  var _a;
6839
6978
  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) {
6840
6979
  return isEmpty ? (jsx(IconElement, { accessor: "calendar" })) : (jsx(IconElement, { accessor: "xmark", className: "text-black" }));
@@ -6916,82 +7055,6 @@ var DateMenuForm = function (props) {
6916
7055
  : (_a = error === null || error === void 0 ? void 0 : error.startDate) !== null && _a !== void 0 ? _a : error === null || error === void 0 ? void 0 : error.endDate }))] }))] })] }));
6917
7056
  };
6918
7057
 
6919
- var base$5 = {
6920
- container: '',
6921
- head: 'flex justify-between',
6922
- body: 'relative rounded-md',
6923
- foot: '',
6924
- label: 'block font-medium text-gray-900',
6925
- hint: 'text-xs text-gray-500',
6926
- leading: 'pointer-events-none absolute inset-y-0 left-0 flex items-center',
6927
- input: 'block w-full inline-flex',
6928
- trailing: 'pointer-events-none absolute inset-y-0 right-0 flex items-center',
6929
- description: 'text-gray-400 text-xs mt-1',
6930
- error: 'text-red-500 text-xs ml-5 mt-1',
6931
- };
6932
- var leading$3 = {
6933
- input: 'pl-10',
6934
- };
6935
- var trailing$3 = {};
6936
- var normal$3 = {
6937
- label: 'leading-6 text-sm mb-2',
6938
- hint: 'leading-6',
6939
- leading: 'pl-3',
6940
- input: 'rounded-md border-gray-200 shadow-sm focus:border-primary-500 focus:ring-primary-500 sm:text-sm placeholder-gray-300',
6941
- trailing: 'pr-3',
6942
- description: 'mt-2 text-sm',
6943
- };
6944
- var inset$3 = {
6945
- container: 'rounded-md px-3 pt-2.5 pb-1.5 shadow-sm ring-1 ring-inset ring-gray-300 focus-within:ring-2 focus-within:ring-primary-600',
6946
- label: 'text-xs',
6947
- hint: 'text-xs',
6948
- input: 'border-0 !ring-0 p-0 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm pl-0',
6949
- description: 'hidden',
6950
- };
6951
- var overlapping$3 = {
6952
- container: 'relative',
6953
- head: ' absolute flex justify-between items-center left-0 -top-2 right-0 mx-2 z-10 w-full',
6954
- label: 'inline-block bg-white px-1 text-xs font-medium text-gray-900 ',
6955
- hint: 'text-xs mr-4 bg-white px-1',
6956
- input: 'block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6',
6957
- description: 'hidden',
6958
- };
6959
- var pill$3 = {
6960
- head: 'mx-px block px-4 text-sm font-medium leading-6 text-gray-900 mb-1 pr-6',
6961
- foot: 'mx-px block px-4 text-sm font-medium leading-6 text-gray-900 mt-1 pr-6',
6962
- input: 'block w-full rounded-full border-0 px-4 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6',
6963
- trailing: 'pr-2',
6964
- description: 'text-xs',
6965
- };
6966
- var floored$3 = {
6967
- body: 'relative mt-2',
6968
- label: 'block text-sm font-medium leading-6 text-gray-900',
6969
- input: 'peer block w-full border-0 bg-gray-50 py-1.5 text-gray-900 focus:ring-0 sm:text-sm sm:leading-6 ring-0',
6970
- description: 'text-xs mt-2',
6971
- };
6972
- var invalid$3 = {
6973
- container: '!ring-red-500',
6974
- input:
6975
- // 'block w-full border border-transparent text-red-900 ring-1 ring-inset ring-red-300 placeholder:text-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500 sm:leading-6 pr-10',
6976
- 'block w-full border border-transparent text-red-900 ring-1 ring-inset ring-red-300 placeholder:text-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500 pr-10',
6977
- description: 'text-sm text-red-600',
6978
- };
6979
- var disabled$5 = {
6980
- input: 'block w-full rounded-md border-0 text-gray-900 shadow-sm ring-1 ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-500 disabled:ring-gray-200',
6981
- };
6982
- var styles$7 = {
6983
- base: base$5,
6984
- leading: leading$3,
6985
- trailing: trailing$3,
6986
- normal: normal$3,
6987
- inset: inset$3,
6988
- overlapping: overlapping$3,
6989
- pill: pill$3,
6990
- floored: floored$3,
6991
- invalid: invalid$3,
6992
- disabled: disabled$5,
6993
- };
6994
-
6995
7058
  var CheckboxInputGroupForm = function (props) {
6996
7059
  var name = props.name, form = props.form, options = props.options, values = props.values, isDisabled = props.isDisabled, stylesOverrides = props.styles;
6997
7060
  var handleGenerateStyle = function () {
@@ -15211,5 +15274,5 @@ var styles = {
15211
15274
  disabled: disabled,
15212
15275
  };
15213
15276
 
15214
- export { AddressInputGroupForm, BadgeElement$1 as AlertElement, AvatarElement, BadgeElement, BreadcrumbsNavigation, ButtonElement, ButtonGroupElement, CheckboxInputForm as CheckboxInput, ContainerLayout, DateMenuForm, DividerLayout, DropdownElement, FileInputGroupForm, IconElement, InputGroupForm, ListContainerLayout, MediaObjectLayout, ModalOverlay, NotificationOverlay, OpeningsHourInputGroupForm, PagePaginationNavigation, LayoutPanel as PanelLayout, PanelPaginationNavigation, SelectMenuForm, SlideOverOverlay, Switch as SwitchForm, TabNavigation, TableColumnOptionsCustom, TableExcelExportCustom as TableExportCustom, TableList, TableList2, TooltipElement, VerticalNavigation, CheckboxInputGroupForm as __DEPRECATED__CheckboxInputGroupForm, createColumnHelper, fromSelectMenuOptionToStringValue, useExcel };
15277
+ export { AddressInputGroupForm, BadgeElement$1 as AlertElement, AvatarElement, BadgeElement, BreadcrumbsNavigation, ButtonElement, ButtonGroupElement, CheckboxInputForm as CheckboxInput, ContainerLayout, DateMenuForm, DateRangeMenu as DateRangeMenuForm, DividerLayout, DropdownElement, FileInputGroupForm, IconElement, InputGroupForm, ListContainerLayout, MediaObjectLayout, ModalOverlay, NotificationOverlay, OpeningsHourInputGroupForm, PagePaginationNavigation, LayoutPanel as PanelLayout, PanelPaginationNavigation, SelectMenuForm, SlideOverOverlay, Switch as SwitchForm, TabNavigation, TableColumnOptionsCustom, TableExcelExportCustom as TableExportCustom, TableList, TableList2, TooltipElement, VerticalNavigation, CheckboxInputGroupForm as __DEPRECATED__CheckboxInputGroupForm, createColumnHelper, fromSelectMenuOptionToStringValue, useExcel };
15215
15278
  //# sourceMappingURL=index.esm.js.map