react-better-html 1.1.103 → 1.1.105

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.mjs CHANGED
@@ -1416,6 +1416,26 @@ var icons = {
1416
1416
  }
1417
1417
  ]
1418
1418
  },
1419
+ doubleChevronLeft: {
1420
+ width: 512,
1421
+ height: 512,
1422
+ paths: [
1423
+ {
1424
+ d: "M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160zm352-160l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L301.3 256 438.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0z",
1425
+ type: "fill"
1426
+ }
1427
+ ]
1428
+ },
1429
+ doubleChevronRight: {
1430
+ width: 512,
1431
+ height: 512,
1432
+ paths: [
1433
+ {
1434
+ d: "M470.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256 265.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160zm-352 160l160-160c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L210.7 256 73.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z",
1435
+ type: "fill"
1436
+ }
1437
+ ]
1438
+ },
1419
1439
  eye: {
1420
1440
  width: 576,
1421
1441
  height: 512,
@@ -1455,6 +1475,16 @@ var icons = {
1455
1475
  type: "fill"
1456
1476
  }
1457
1477
  ]
1478
+ },
1479
+ filter: {
1480
+ width: 512,
1481
+ height: 512,
1482
+ paths: [
1483
+ {
1484
+ d: "M3.9 54.9C10.5 40.9 24.5 32 40 32l432 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9 320 448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z",
1485
+ type: "fill"
1486
+ }
1487
+ ]
1458
1488
  }
1459
1489
  };
1460
1490
 
@@ -2236,14 +2266,19 @@ DivComponent.column = forwardRef(function Column({ flexReverse, invertFlexDirect
2236
2266
  DivComponent.grid = forwardRef(function Grid(props, ref) {
2237
2267
  return /* @__PURE__ */ jsx2(DivComponent, { display: "grid", ref, ...props });
2238
2268
  });
2239
- DivComponent.box = forwardRef(function Box(props, ref) {
2269
+ DivComponent.box = forwardRef(function Box({ isActive, ...props }, ref) {
2240
2270
  const theme2 = useTheme();
2271
+ const withClick = props.onClick || props.onClickWithValue;
2241
2272
  return /* @__PURE__ */ jsx2(
2242
2273
  DivComponent,
2243
2274
  {
2244
- backgroundColor: theme2.colors.backgroundContent,
2245
- border: `1px solid ${theme2.colors.border}`,
2275
+ color: isActive ? theme2.colors.base : void 0,
2276
+ backgroundColor: isActive ? theme2.colors.primary : theme2.colors.backgroundContent,
2277
+ border: `1px solid ${isActive ? theme2.colors.primary : theme2.colors.border}`,
2246
2278
  borderRadius: theme2.styles.borderRadius,
2279
+ borderColorHover: withClick && !isActive ? theme2.colors.primary : void 0,
2280
+ filterHover: withClick && isActive ? "brightness(0.9)" : void 0,
2281
+ cursor: withClick ? "pointer" : void 0,
2247
2282
  paddingBlock: theme2.styles.gap,
2248
2283
  paddingInline: theme2.styles.space,
2249
2284
  ref,
@@ -3050,8 +3085,8 @@ var Modal_default = Modal2;
3050
3085
 
3051
3086
  // src/components/PageHolder.tsx
3052
3087
  import { forwardRef as forwardRef7, memo as memo10 } from "react";
3053
- import { Fragment as Fragment3, jsx as jsx10 } from "react/jsx-runtime";
3054
- var PageHolderComponent = forwardRef7(function PageHolder({ noMaxContentWidth, backgroundColor, children, ...props }, ref) {
3088
+ import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
3089
+ var PageHolderComponent = forwardRef7(function PageHolder({ noMaxContentWidth, children, ...props }, ref) {
3055
3090
  const theme2 = useTheme();
3056
3091
  const { app } = useBetterHtmlContextInternal();
3057
3092
  return /* @__PURE__ */ jsx10(
@@ -3060,7 +3095,6 @@ var PageHolderComponent = forwardRef7(function PageHolder({ noMaxContentWidth, b
3060
3095
  as: "main",
3061
3096
  width: "100%",
3062
3097
  maxWidth: !noMaxContentWidth ? app.contentMaxWidth : void 0,
3063
- backgroundColor,
3064
3098
  margin: "0px auto",
3065
3099
  padding: theme2.styles.space,
3066
3100
  ...props,
@@ -3069,8 +3103,55 @@ var PageHolderComponent = forwardRef7(function PageHolder({ noMaxContentWidth, b
3069
3103
  }
3070
3104
  );
3071
3105
  });
3072
- PageHolderComponent.center = forwardRef7(function Center(props, ref) {
3073
- return /* @__PURE__ */ jsx10(Fragment3, {});
3106
+ PageHolderComponent.center = forwardRef7(function Center({
3107
+ decorationImageSrc,
3108
+ decorationImageName,
3109
+ decorationImagePosition = "right",
3110
+ noMaxContentWidth,
3111
+ children,
3112
+ ...props
3113
+ }, ref) {
3114
+ const theme2 = useTheme();
3115
+ const mediaQuery = useMediaQuery();
3116
+ const { app } = useBetterHtmlContextInternal();
3117
+ const breakingPoint = mediaQuery.size1000;
3118
+ return /* @__PURE__ */ jsxs6(Div_default.row, { width: "100%", minHeight: "100svh", alignItems: "center", justifyContent: "center", children: [
3119
+ decorationImagePosition === "left" && !breakingPoint && /* @__PURE__ */ jsx10(Div_default, { width: "50%" }),
3120
+ /* @__PURE__ */ jsx10(
3121
+ Div_default.column,
3122
+ {
3123
+ width: `${!breakingPoint && (decorationImageSrc || decorationImageName) ? 50 : 100}%`,
3124
+ alignItems: "center",
3125
+ children: /* @__PURE__ */ jsx10(
3126
+ Div_default.box,
3127
+ {
3128
+ width: `calc(100% - ${theme2.styles.space}px * 2)`,
3129
+ maxWidth: !noMaxContentWidth ? app.contentMaxWidth / 2 : void 0,
3130
+ marginInline: theme2.styles.space,
3131
+ marginBlock: theme2.styles.space,
3132
+ ...props,
3133
+ ref,
3134
+ children
3135
+ }
3136
+ )
3137
+ }
3138
+ ),
3139
+ decorationImagePosition === "right" && !breakingPoint && /* @__PURE__ */ jsx10(Div_default, { width: "50%" }),
3140
+ (decorationImageSrc || decorationImageName) && !breakingPoint && /* @__PURE__ */ jsx10(
3141
+ Image_default,
3142
+ {
3143
+ position: "fixed",
3144
+ name: decorationImageName,
3145
+ src: decorationImageSrc,
3146
+ width: "50%",
3147
+ height: "100svh",
3148
+ top: 0,
3149
+ left: decorationImagePosition === "left" ? 0 : "auto",
3150
+ right: decorationImagePosition === "right" ? 0 : "auto",
3151
+ objectFit: "cover"
3152
+ }
3153
+ )
3154
+ ] });
3074
3155
  });
3075
3156
  var PageHolder2 = memo10(PageHolderComponent);
3076
3157
  PageHolder2.center = PageHolderComponent.center;
@@ -3078,7 +3159,7 @@ var PageHolder_default = PageHolder2;
3078
3159
 
3079
3160
  // src/components/PageHeader.tsx
3080
3161
  import { forwardRef as forwardRef8, memo as memo11 } from "react";
3081
- import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
3162
+ import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
3082
3163
  var PageHeaderComponent = forwardRef8(function PageHeader({
3083
3164
  imageUrl,
3084
3165
  imageSize = 60,
@@ -3094,7 +3175,7 @@ var PageHeaderComponent = forwardRef8(function PageHeader({
3094
3175
  const theme2 = useTheme();
3095
3176
  const { app } = useBetterHtmlContextInternal();
3096
3177
  const mediaQuery = useMediaQuery();
3097
- return /* @__PURE__ */ jsxs6(
3178
+ return /* @__PURE__ */ jsxs7(
3098
3179
  Div_default.row,
3099
3180
  {
3100
3181
  alignItems: "center",
@@ -3103,14 +3184,14 @@ var PageHeaderComponent = forwardRef8(function PageHeader({
3103
3184
  ref,
3104
3185
  children: [
3105
3186
  imageUrl && /* @__PURE__ */ jsx11(Image_default.profileImage, { src: imageUrl, size: imageSize ?? (mediaQuery.size600 ? 46 : 60) }),
3106
- /* @__PURE__ */ jsxs6(
3187
+ /* @__PURE__ */ jsxs7(
3107
3188
  Div_default.column,
3108
3189
  {
3109
3190
  alignItems: textAlign === "center" ? "center" : textAlign === "right" ? "flex-end" : void 0,
3110
3191
  flex: 1,
3111
3192
  gap: theme2.styles.gap / 2,
3112
3193
  children: [
3113
- /* @__PURE__ */ jsxs6(
3194
+ /* @__PURE__ */ jsxs7(
3114
3195
  Div_default.row,
3115
3196
  {
3116
3197
  alignItems: "center",
@@ -4858,10 +4939,10 @@ var getFormErrorObject = (formValues) => {
4858
4939
 
4859
4940
  // src/components/Label.tsx
4860
4941
  import { memo as memo13 } from "react";
4861
- import { jsxs as jsxs7 } from "react/jsx-runtime";
4942
+ import { jsxs as jsxs8 } from "react/jsx-runtime";
4862
4943
  function Label({ text, required, isError, color, htmlFor }) {
4863
4944
  const theme2 = useTheme();
4864
- return /* @__PURE__ */ jsxs7(
4945
+ return /* @__PURE__ */ jsxs8(
4865
4946
  Text_default,
4866
4947
  {
4867
4948
  as: "label",
@@ -4873,7 +4954,7 @@ function Label({ text, required, isError, color, htmlFor }) {
4873
4954
  "aria-required": required,
4874
4955
  children: [
4875
4956
  text,
4876
- required && /* @__PURE__ */ jsxs7(Text_default, { as: "span", fontSize: 16, color: theme2.colors.error, children: [
4957
+ required && /* @__PURE__ */ jsxs8(Text_default, { as: "span", fontSize: 16, color: theme2.colors.error, children: [
4877
4958
  " ",
4878
4959
  "*"
4879
4960
  ] })
@@ -4885,7 +4966,7 @@ var Label_default = memo13(Label);
4885
4966
 
4886
4967
  // src/components/Dropdown.tsx
4887
4968
  import { forwardRef as forwardRef10, memo as memo14, useCallback as useCallback6, useEffect as useEffect5, useMemo as useMemo3, useRef as useRef3, useState as useState4 } from "react";
4888
- import { Fragment as Fragment4, jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
4969
+ import { Fragment as Fragment3, jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
4889
4970
  var DropdownComponent = forwardRef10(function Dropdown({
4890
4971
  label,
4891
4972
  labelColor,
@@ -5073,7 +5154,7 @@ var DropdownComponent = forwardRef10(function Dropdown({
5073
5154
  const displayValue = withSearch && isFocused ? searchQuery : selectedOption?.label ?? "";
5074
5155
  const withClearButton = isOpen && selectedOption;
5075
5156
  const readyPlaceholder = placeholder ? placeholder : `Select an ${label?.toLowerCase() ?? "option"}`;
5076
- return /* @__PURE__ */ jsx13(Div_default.column, { width: "100%", position: "relative", userSelect: "none", ...props, children: /* @__PURE__ */ jsxs8(Div_default.row, { position: "relative", width: "100%", children: [
5157
+ return /* @__PURE__ */ jsx13(Div_default.column, { width: "100%", position: "relative", userSelect: "none", ...props, children: /* @__PURE__ */ jsxs9(Div_default.row, { position: "relative", width: "100%", children: [
5077
5158
  /* @__PURE__ */ jsx13(
5078
5159
  InputField_default,
5079
5160
  {
@@ -5119,7 +5200,7 @@ var DropdownComponent = forwardRef10(function Dropdown({
5119
5200
  transition: theme2.styles.transition,
5120
5201
  role: "listbox",
5121
5202
  "aria-label": label,
5122
- children: isLoadingDebouncedSearchQuery || debounceIsLoading ? /* @__PURE__ */ jsx13(Div_default, { padding: `${theme2.styles.space / 2}px ${theme2.styles.space + theme2.styles.gap}px`, children: /* @__PURE__ */ jsx13(Loader_default.text, {}) }) : filteredOptions.length ? /* @__PURE__ */ jsx13(Fragment4, { children: (withoutRenderingOptionsWhenClosed ? isOpen || isOpenLate : true) ? renderedOptions : void 0 }) : /* @__PURE__ */ jsx13(Div_default, { padding: `${theme2.styles.space / 2}px ${theme2.styles.space + theme2.styles.gap}px`, children: /* @__PURE__ */ jsx13(Text_default.unknown, { textAlign: "left", children: debounceMinimumSymbolsRequired !== void 0 && searchQuery.length < debounceMinimumSymbolsRequired ? `Enter at least ${debounceMinimumSymbolsRequired} characters` : "No options" }) })
5203
+ children: isLoadingDebouncedSearchQuery || debounceIsLoading ? /* @__PURE__ */ jsx13(Div_default, { padding: `${theme2.styles.space / 2}px ${theme2.styles.space + theme2.styles.gap}px`, children: /* @__PURE__ */ jsx13(Loader_default.text, {}) }) : filteredOptions.length ? /* @__PURE__ */ jsx13(Fragment3, { children: (withoutRenderingOptionsWhenClosed ? isOpen || isOpenLate : true) ? renderedOptions : void 0 }) : /* @__PURE__ */ jsx13(Div_default, { padding: `${theme2.styles.space / 2}px ${theme2.styles.space + theme2.styles.gap}px`, children: /* @__PURE__ */ jsx13(Text_default.unknown, { textAlign: "left", children: debounceMinimumSymbolsRequired !== void 0 && searchQuery.length < debounceMinimumSymbolsRequired ? `Enter at least ${debounceMinimumSymbolsRequired} characters` : "No options" }) })
5123
5204
  }
5124
5205
  ),
5125
5206
  role: "combobox",
@@ -5131,7 +5212,7 @@ var DropdownComponent = forwardRef10(function Dropdown({
5131
5212
  ref: inputRef
5132
5213
  }
5133
5214
  ),
5134
- /* @__PURE__ */ jsxs8(
5215
+ /* @__PURE__ */ jsxs9(
5135
5216
  Div_default.row,
5136
5217
  {
5137
5218
  position: "absolute",
@@ -5180,7 +5261,7 @@ var DropdownComponent = forwardRef10(function Dropdown({
5180
5261
  DropdownComponent.countries = forwardRef10(function Countries({ ...props }, ref) {
5181
5262
  const theme2 = useTheme();
5182
5263
  const renderOption = useCallback6(
5183
- (option, index, isSelected) => /* @__PURE__ */ jsxs8(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
5264
+ (option, index, isSelected) => /* @__PURE__ */ jsxs9(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
5184
5265
  /* @__PURE__ */ jsx13(Image_default, { src: `https://flagcdn.com/w80/${option.data?.code.toString().toLowerCase()}.webp`, width: 20 }),
5185
5266
  /* @__PURE__ */ jsx13(Text_default, { children: option.label })
5186
5267
  ] }),
@@ -5215,7 +5296,7 @@ var Dropdown_default = Dropdown2;
5215
5296
 
5216
5297
  // src/components/Calendar.tsx
5217
5298
  import { useCallback as useCallback7, useMemo as useMemo4, useState as useState5, memo as memo15, useEffect as useEffect6 } from "react";
5218
- import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
5299
+ import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
5219
5300
  var getMonthName = (month, short = false) => {
5220
5301
  return [
5221
5302
  short ? "Jan" : "January",
@@ -5305,24 +5386,24 @@ function Calendar({ value, minDate, maxDate, onChange }) {
5305
5386
  setCurrentMonth(date.getMonth());
5306
5387
  setCurrentYear(date.getFullYear());
5307
5388
  }, [value]);
5308
- return /* @__PURE__ */ jsxs9(Div_default.column, { width: "100%", maxWidth: 320, gap: theme2.styles.gap, padding: theme2.styles.space / 2, userSelect: "none", children: [
5309
- /* @__PURE__ */ jsxs9(Div_default.row, { width: "100%", justifyContent: "space-between", alignItems: "center", children: [
5389
+ return /* @__PURE__ */ jsxs10(Div_default.column, { width: "100%", maxWidth: 320, gap: theme2.styles.gap, padding: theme2.styles.space / 2, userSelect: "none", children: [
5390
+ /* @__PURE__ */ jsxs10(Div_default.row, { width: "100%", justifyContent: "space-between", alignItems: "center", children: [
5310
5391
  /* @__PURE__ */ jsx14(Button_default.icon, { icon: "chevronLeft", onClick: onClickPreviousMonthButton }),
5311
- /* @__PURE__ */ jsxs9(Text_default, { fontWeight: 700, children: [
5392
+ /* @__PURE__ */ jsxs10(Text_default, { fontWeight: 700, children: [
5312
5393
  getMonthName(currentMonth),
5313
5394
  " ",
5314
5395
  currentYear
5315
5396
  ] }),
5316
5397
  /* @__PURE__ */ jsx14(Button_default.icon, { icon: "chevronRight", onClick: onClickNextMonthButton })
5317
5398
  ] }),
5318
- /* @__PURE__ */ jsxs9(Div_default.grid, { width: "100%", gridTemplateColumns: "repeat(7, 1fr)", gap: theme2.styles.gap / 2, children: [
5399
+ /* @__PURE__ */ jsxs10(Div_default.grid, { width: "100%", gridTemplateColumns: "repeat(7, 1fr)", gap: theme2.styles.gap / 2, children: [
5319
5400
  weekDaysIndex.map((day) => /* @__PURE__ */ jsx14(Div_default.row, { alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx14(Text_default, { fontSize: 14, fontWeight: 700, textAlign: "center", children: getWeekDayName(day, true) }) }, day)),
5320
5401
  days.map((day, index) => {
5321
5402
  const thisDayDate = new Date(currentYear, currentMonth, day);
5322
5403
  const isSelected = day !== void 0 && day === currentDate?.getDate() && currentMonth === currentDate.getMonth() && currentYear === currentDate.getFullYear();
5323
5404
  const isWeekend = thisDayDate.getDay() === 6 || thisDayDate.getDay() === 0;
5324
5405
  const isDisabled = minDate && thisDayDate.getTime() < minDate.getTime() || maxDate && thisDayDate.getTime() > maxDate.getTime();
5325
- return /* @__PURE__ */ jsxs9(
5406
+ return /* @__PURE__ */ jsxs10(
5326
5407
  Div_default.row,
5327
5408
  {
5328
5409
  position: "relative",
@@ -5366,7 +5447,7 @@ function Calendar({ value, minDate, maxDate, onChange }) {
5366
5447
  );
5367
5448
  })
5368
5449
  ] }),
5369
- /* @__PURE__ */ jsxs9(Div_default.row, { width: "100%", justifyContent: "space-between", alignItems: "center", children: [
5450
+ /* @__PURE__ */ jsxs10(Div_default.row, { width: "100%", justifyContent: "space-between", alignItems: "center", children: [
5370
5451
  /* @__PURE__ */ jsx14(Div_default, { isTabAccessed: true, cursor: "pointer", onClick: onClickClear, children: /* @__PURE__ */ jsx14(
5371
5452
  Text_default,
5372
5453
  {
@@ -5393,7 +5474,7 @@ function Calendar({ value, minDate, maxDate, onChange }) {
5393
5474
  var Calendar_default = memo15(Calendar);
5394
5475
 
5395
5476
  // src/components/InputField.tsx
5396
- import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
5477
+ import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
5397
5478
  var buttonWidth = 50;
5398
5479
  var colorPickerSpacing = 4;
5399
5480
  var colorPickerColorWidth = 12 + 27 + colorPickerSpacing;
@@ -5429,10 +5510,19 @@ var InputElement = styled8.input.withConfig({
5429
5510
  cursor: not-allowed;
5430
5511
  }
5431
5512
 
5513
+ &::-webkit-outer-spin-button,
5514
+ &::-webkit-inner-spin-button {
5515
+ -webkit-appearance: none;
5516
+ margin: 0;
5517
+ }
5518
+
5519
+ &[type="number"] {
5520
+ -moz-appearance: textfield;
5521
+ }
5522
+
5432
5523
  &[type="date"],
5433
5524
  &[type="datetime-local"],
5434
5525
  &[type="time"] {
5435
- // min-height: 46px;
5436
5526
  -webkit-appearance: none;
5437
5527
  -moz-appearance: textfield;
5438
5528
 
@@ -5586,9 +5676,9 @@ var InputFieldComponent = forwardRef11(function InputField({
5586
5676
  onChangeValue?.(debouncedValue);
5587
5677
  }, [withDebounce, onChangeValue, debouncedValue]);
5588
5678
  const readyId = id ?? internalId;
5589
- return /* @__PURE__ */ jsxs10(Div_default.column, { width: "100%", gap: theme2.styles.gap, ...styledComponentStylesWithExcluded, children: [
5679
+ return /* @__PURE__ */ jsxs11(Div_default.column, { width: "100%", gap: theme2.styles.gap / 2, ...styledComponentStylesWithExcluded, children: [
5590
5680
  label && /* @__PURE__ */ jsx15(Label_default, { text: label, color: labelColor, required, isError: !!errorText, htmlFor: readyId }),
5591
- /* @__PURE__ */ jsxs10(Div_default, { position: "relative", width: "100%", ref: holderRef, children: [
5681
+ /* @__PURE__ */ jsxs11(Div_default, { position: "relative", width: "100%", ref: holderRef, children: [
5592
5682
  leftIcon && /* @__PURE__ */ jsx15(
5593
5683
  Icon_default,
5594
5684
  {
@@ -5681,9 +5771,9 @@ InputFieldComponent.multiline = forwardRef11(function Multiline({
5681
5771
  [onChange, onChangeValue]
5682
5772
  );
5683
5773
  const readyId = id ?? internalId;
5684
- return /* @__PURE__ */ jsxs10(Div_default.column, { gap: theme2.styles.gap, children: [
5774
+ return /* @__PURE__ */ jsxs11(Div_default.column, { gap: theme2.styles.gap / 2, children: [
5685
5775
  label && /* @__PURE__ */ jsx15(Label_default, { text: label, required, isError: !!errorText, htmlFor: readyId }),
5686
- /* @__PURE__ */ jsxs10(Div_default, { position: "relative", width: "100%", children: [
5776
+ /* @__PURE__ */ jsxs11(Div_default, { position: "relative", width: "100%", children: [
5687
5777
  leftIcon && /* @__PURE__ */ jsx15(
5688
5778
  Icon_default,
5689
5779
  {
@@ -5787,7 +5877,7 @@ InputFieldComponent.phoneNumber = forwardRef11(function PhoneNumber({ label, val
5787
5877
  const [dropdownValue, setDropdownValue] = useState6();
5788
5878
  const [inputFieldValue, setInputFieldValue] = useState6(value?.toString() ?? "");
5789
5879
  const renderOption = useCallback8(
5790
- (option, index, isSelected) => /* @__PURE__ */ jsxs10(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
5880
+ (option, index, isSelected) => /* @__PURE__ */ jsxs11(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
5791
5881
  /* @__PURE__ */ jsx15(Image_default, { src: `https://flagcdn.com/w80/${option.data?.code.toString().toLowerCase()}.webp`, width: 20 }),
5792
5882
  /* @__PURE__ */ jsx15(Text_default, { children: option.label })
5793
5883
  ] }),
@@ -5832,7 +5922,7 @@ InputFieldComponent.phoneNumber = forwardRef11(function PhoneNumber({ label, val
5832
5922
  setInputFieldValue(newValue.slice(country?.phoneNumberExtension.length + 1));
5833
5923
  }, [value]);
5834
5924
  const readyId = id ?? internalId;
5835
- return /* @__PURE__ */ jsxs10(Div_default.column, { width: "100%", gap: theme2.styles.gap, children: [
5925
+ return /* @__PURE__ */ jsxs11(Div_default.column, { width: "100%", gap: theme2.styles.gap / 2, children: [
5836
5926
  label && /* @__PURE__ */ jsx15(
5837
5927
  Label_default,
5838
5928
  {
@@ -5843,7 +5933,7 @@ InputFieldComponent.phoneNumber = forwardRef11(function PhoneNumber({ label, val
5843
5933
  htmlFor: readyId
5844
5934
  }
5845
5935
  ),
5846
- /* @__PURE__ */ jsxs10(Div_default.row, { children: [
5936
+ /* @__PURE__ */ jsxs11(Div_default.row, { children: [
5847
5937
  /* @__PURE__ */ jsx15(
5848
5938
  Dropdown_default,
5849
5939
  {
@@ -5858,7 +5948,8 @@ InputFieldComponent.phoneNumber = forwardRef11(function PhoneNumber({ label, val
5858
5948
  value: dropdownValue,
5859
5949
  disabled: props.disabled,
5860
5950
  onChange: setDropdownValue,
5861
- withoutClearButton: true
5951
+ withoutClearButton: true,
5952
+ withoutRenderingOptionsWhenClosed: true
5862
5953
  }
5863
5954
  ),
5864
5955
  /* @__PURE__ */ jsx15(
@@ -5978,9 +6069,9 @@ InputFieldComponent.dateTime = forwardRef11(function DateTime({ minDate, maxDate
5978
6069
  overflow: "hidden",
5979
6070
  userSelect: "none",
5980
6071
  ...insideInputFieldComponentProps,
5981
- children: /* @__PURE__ */ jsxs10(Div_default.row, { gap: theme2.styles.space, children: [
6072
+ children: /* @__PURE__ */ jsxs11(Div_default.row, { gap: theme2.styles.space, children: [
5982
6073
  /* @__PURE__ */ jsx15(Calendar_default, { value: internalValue, minDate, maxDate, onChange }),
5983
- /* @__PURE__ */ jsxs10(
6074
+ /* @__PURE__ */ jsxs11(
5984
6075
  Div_default.row,
5985
6076
  {
5986
6077
  height: 276,
@@ -5989,7 +6080,7 @@ InputFieldComponent.dateTime = forwardRef11(function DateTime({ minDate, maxDate
5989
6080
  paddingBottom: theme2.styles.space / 2,
5990
6081
  paddingRight: theme2.styles.space / 2,
5991
6082
  children: [
5992
- /* @__PURE__ */ jsxs10(Div_default, { height: "100%", children: [
6083
+ /* @__PURE__ */ jsxs11(Div_default, { height: "100%", children: [
5993
6084
  /* @__PURE__ */ jsx15(Text_default, { fontSize: 14, fontWeight: 700, textAlign: "center", marginBottom: theme2.styles.gap / 2, children: "H" }),
5994
6085
  /* @__PURE__ */ jsx15(
5995
6086
  Div_default,
@@ -6022,7 +6113,7 @@ InputFieldComponent.dateTime = forwardRef11(function DateTime({ minDate, maxDate
6022
6113
  }
6023
6114
  )
6024
6115
  ] }),
6025
- /* @__PURE__ */ jsxs10(Div_default, { height: "100%", children: [
6116
+ /* @__PURE__ */ jsxs11(Div_default, { height: "100%", children: [
6026
6117
  /* @__PURE__ */ jsx15(Text_default, { fontSize: 14, fontWeight: 700, textAlign: "center", marginBottom: theme2.styles.gap / 2, children: "M" }),
6027
6118
  /* @__PURE__ */ jsx15(
6028
6119
  Div_default,
@@ -6118,7 +6209,7 @@ InputFieldComponent.time = forwardRef11(function Time({ ...props }, ref) {
6118
6209
  overflowY: "auto",
6119
6210
  userSelect: "none",
6120
6211
  ...insideInputFieldComponentProps,
6121
- children: /* @__PURE__ */ jsxs10(Div_default.row, { height: "100%", children: [
6212
+ children: /* @__PURE__ */ jsxs11(Div_default.row, { height: "100%", children: [
6122
6213
  /* @__PURE__ */ jsx15(Div_default, { className: "react-better-html-no-scrollbar", width: buttonWidth, height: "100%", overflowY: "auto", children: hours.map((hour) => {
6123
6214
  const isSelected = hour.toString() === valueHour;
6124
6215
  return /* @__PURE__ */ jsx15(
@@ -6223,7 +6314,7 @@ var InputField_default = InputField2;
6223
6314
  // src/components/ToggleInput.tsx
6224
6315
  import { forwardRef as forwardRef12, useCallback as useCallback9, useId as useId2, useState as useState7 } from "react";
6225
6316
  import styled9 from "styled-components";
6226
- import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
6317
+ import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
6227
6318
  var componentSize = 26;
6228
6319
  var switchComponentBallGap = 3;
6229
6320
  var switchComponentMouseDownDifference = 4;
@@ -6353,10 +6444,10 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
6353
6444
  onChange?.(newIsChecked, value);
6354
6445
  }, [checked, controlledChecked, onChange, value]);
6355
6446
  const readyId = id ?? internalId;
6356
- return /* @__PURE__ */ jsxs11(Div_default.column, { width: "100%", gap: theme2.styles.gap, ...styledComponentStylesWithExcluded, children: [
6447
+ return /* @__PURE__ */ jsxs12(Div_default.column, { width: "100%", gap: theme2.styles.gap, ...styledComponentStylesWithExcluded, children: [
6357
6448
  label && /* @__PURE__ */ jsx16(Label_default, { text: label, color: labelColor, required, isError: !!errorText, htmlFor: readyId }),
6358
- /* @__PURE__ */ jsxs11(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
6359
- /* @__PURE__ */ jsxs11(Div_default.row, { position: "relative", alignItems: "center", children: [
6449
+ /* @__PURE__ */ jsxs12(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
6450
+ /* @__PURE__ */ jsxs12(Div_default.row, { position: "relative", alignItems: "center", children: [
6360
6451
  /* @__PURE__ */ jsx16(
6361
6452
  InputElement2,
6362
6453
  {
@@ -6401,9 +6492,9 @@ var ToggleInputComponent = forwardRef12(function ToggleInput({
6401
6492
  }
6402
6493
  ) : void 0
6403
6494
  ] }),
6404
- text && /* @__PURE__ */ jsxs11(Text_default, { color, userSelect: "none", cursor: "pointer", onClick: onClickText, children: [
6495
+ text && /* @__PURE__ */ jsxs12(Text_default, { color, userSelect: "none", cursor: "pointer", onClick: onClickText, children: [
6405
6496
  text,
6406
- required && !label && /* @__PURE__ */ jsxs11(Text_default, { as: "span", fontSize: 16, color: theme2.colors.error, children: [
6497
+ required && !label && /* @__PURE__ */ jsxs12(Text_default, { as: "span", fontSize: 16, color: theme2.colors.error, children: [
6407
6498
  " ",
6408
6499
  "*"
6409
6500
  ] })
@@ -6458,7 +6549,7 @@ var ToggleInput_default = {
6458
6549
  onChange?.(newIsChecked, value);
6459
6550
  }, [disabled, checked, onChange, controlledChecked, value]);
6460
6551
  const readyId = id ?? internalId;
6461
- return /* @__PURE__ */ jsxs11(Div_default.column, { width: "fit-content", gap: theme2.styles.gap, ...styledComponentStylesWithExcluded, children: [
6552
+ return /* @__PURE__ */ jsxs12(Div_default.column, { width: "fit-content", gap: theme2.styles.gap, ...styledComponentStylesWithExcluded, children: [
6462
6553
  label && /* @__PURE__ */ jsx16(Label_default, { text: label, color: labelColor, required, isError: !!errorText, htmlFor: readyId }),
6463
6554
  /* @__PURE__ */ jsx16(
6464
6555
  Div_default.row,
@@ -6506,19 +6597,21 @@ var ToggleInput_default = {
6506
6597
  };
6507
6598
 
6508
6599
  // src/components/Form.tsx
6509
- import { Children, forwardRef as forwardRef13, Fragment as Fragment5, memo as memo17, useMemo as useMemo6 } from "react";
6510
- import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
6600
+ import { Children, forwardRef as forwardRef13, Fragment as Fragment4, memo as memo17, useMemo as useMemo6 } from "react";
6601
+ import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
6511
6602
  var FormComponent = forwardRef13(function Form({
6512
6603
  form,
6513
6604
  submitButtonText,
6514
6605
  submitButtonLoaderName,
6515
6606
  submitButtonId,
6516
6607
  submitButtonIsDisabled,
6608
+ cancelButtonText,
6517
6609
  actionButtonsLocation = "right",
6518
6610
  gap,
6519
6611
  isSubmitting,
6520
6612
  isDestructive,
6521
6613
  withDividers,
6614
+ renderActionButtons,
6522
6615
  onClickCancel,
6523
6616
  onSubmit,
6524
6617
  children,
@@ -6533,12 +6626,12 @@ var FormComponent = forwardRef13(function Form({
6533
6626
  }, [form]);
6534
6627
  const SubmitButtonTag = isDestructive ? Button_default.destructive : Button_default;
6535
6628
  const submitButtonIsDisabledFinal = submitButtonIsDisabled || submitButtonIsDisabledInternal;
6536
- return /* @__PURE__ */ jsx17(Div_default, { width: "100%", ...props, children: /* @__PURE__ */ jsxs12("form", { onSubmit: onSubmit ?? form?.onSubmit, ref, children: [
6537
- gap !== void 0 || withDividers ? /* @__PURE__ */ jsx17(Div_default.column, { gap: gap ?? (withDividers ? theme2.styles.space : theme2.styles.gap), children: withDividers ? Children.toArray(children).map((child, index) => /* @__PURE__ */ jsxs12(Fragment5, { children: [
6629
+ return /* @__PURE__ */ jsx17(Div_default, { width: "100%", ...props, children: /* @__PURE__ */ jsxs13("form", { onSubmit: onSubmit ?? form?.onSubmit, ref, children: [
6630
+ gap !== void 0 || withDividers ? /* @__PURE__ */ jsx17(Div_default.column, { gap: gap ?? (withDividers ? theme2.styles.space : theme2.styles.gap), children: withDividers ? Children.toArray(children).map((child, index) => /* @__PURE__ */ jsxs13(Fragment4, { children: [
6538
6631
  child,
6539
6632
  index < Children.toArray(children).length - 1 && /* @__PURE__ */ jsx17(Divider_default.horizontal, {})
6540
6633
  ] }, index)) : children }) : children,
6541
- submitButtonText && /* @__PURE__ */ jsxs12(
6634
+ submitButtonText && /* @__PURE__ */ jsxs13(
6542
6635
  Div_default.row,
6543
6636
  {
6544
6637
  alignItems: "center",
@@ -6546,7 +6639,8 @@ var FormComponent = forwardRef13(function Form({
6546
6639
  gap: theme2.styles.gap,
6547
6640
  marginTop: theme2.styles.space,
6548
6641
  children: [
6549
- onClickCancel && /* @__PURE__ */ jsx17(Button_default.secondary, { text: "Cancel", onClick: onClickCancel }),
6642
+ renderActionButtons,
6643
+ onClickCancel && /* @__PURE__ */ jsx17(Button_default.secondary, { text: cancelButtonText ?? "Cancel", onClick: onClickCancel }),
6550
6644
  /* @__PURE__ */ jsx17(
6551
6645
  SubmitButtonTag,
6552
6646
  {
@@ -6568,13 +6662,13 @@ var Form_default = Form2;
6568
6662
 
6569
6663
  // src/components/FormRow.tsx
6570
6664
  import { forwardRef as forwardRef14, memo as memo18 } from "react";
6571
- import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
6665
+ import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
6572
6666
  var FormRowComponent = forwardRef14(function FormRow({ oneItemOnly, noBreakingPoint, gap, children, ...props }, ref) {
6573
6667
  const theme2 = useTheme();
6574
6668
  const mediaQuery = useMediaQuery();
6575
6669
  const breakingPoint = !noBreakingPoint ? mediaQuery.size900 : false;
6576
6670
  const readyGap = breakingPoint || noBreakingPoint && mediaQuery.size900 ? theme2.styles.gap : theme2.styles.space * 2;
6577
- return /* @__PURE__ */ jsxs13(Div_default.row, { alignItems: "center", gap: gap ?? readyGap, invertFlexDirection: breakingPoint, ...props, ref, children: [
6671
+ return /* @__PURE__ */ jsxs14(Div_default.row, { alignItems: "center", gap: gap ?? readyGap, invertFlexDirection: breakingPoint, ...props, ref, children: [
6578
6672
  children,
6579
6673
  oneItemOnly && /* @__PURE__ */ jsx18(Div_default, { width: "100%" })
6580
6674
  ] });
@@ -6593,15 +6687,15 @@ FormRowComponent.withTitle = forwardRef14(function WithTitle({
6593
6687
  }, ref) {
6594
6688
  const theme2 = useTheme();
6595
6689
  const mediaQuery = useMediaQuery();
6596
- return /* @__PURE__ */ jsxs13(FormRowComponent, { ...props, ref, children: [
6597
- /* @__PURE__ */ jsxs13(Div_default.row, { width: "100%", alignItems: "center", gap: theme2.styles.space, children: [
6690
+ return /* @__PURE__ */ jsxs14(FormRowComponent, { ...props, ref, children: [
6691
+ /* @__PURE__ */ jsxs14(Div_default.row, { width: "100%", alignItems: "center", gap: theme2.styles.space, children: [
6598
6692
  icon && /* @__PURE__ */ jsx18(Icon_default, { name: icon }),
6599
- /* @__PURE__ */ jsxs13(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
6693
+ /* @__PURE__ */ jsxs14(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
6600
6694
  /* @__PURE__ */ jsx18(Text_default, { as: "h3", children: title }),
6601
6695
  description && /* @__PURE__ */ jsx18(Text_default, { color: theme2.colors.textSecondary, children: description })
6602
6696
  ] })
6603
6697
  ] }),
6604
- /* @__PURE__ */ jsxs13(
6698
+ /* @__PURE__ */ jsxs14(
6605
6699
  Div_default.row,
6606
6700
  {
6607
6701
  width: props.noBreakingPoint && mediaQuery.size900 ? void 0 : "100%",
@@ -6609,7 +6703,7 @@ FormRowComponent.withTitle = forwardRef14(function WithTitle({
6609
6703
  gap: theme2.styles.gap,
6610
6704
  children: [
6611
6705
  children,
6612
- withActions && /* @__PURE__ */ jsxs13(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
6706
+ withActions && /* @__PURE__ */ jsxs14(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
6613
6707
  onClickReset && /* @__PURE__ */ jsx18(Button_default.icon, { icon: "XMark", loaderName: resetButtonLoaderName, onClick: onClickReset }),
6614
6708
  /* @__PURE__ */ jsx18(Button_default.icon, { icon: "check", loaderName: saveButtonLoaderName, onClick: onClickSave })
6615
6709
  ] })
@@ -6624,7 +6718,7 @@ var FormRow_default = FormRow2;
6624
6718
 
6625
6719
  // src/components/ColorThemeSwitch.tsx
6626
6720
  import { memo as memo19, useEffect as useEffect8 } from "react";
6627
- import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
6721
+ import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
6628
6722
  var ColorThemeSwitchComponent = function ColorThemeSwitch({
6629
6723
  withMoon,
6630
6724
  className,
@@ -6672,7 +6766,7 @@ var ColorThemeSwitchComponent = function ColorThemeSwitch({
6672
6766
  };
6673
6767
  ColorThemeSwitchComponent.withText = function WithText({ withMoon, className, ...props }) {
6674
6768
  const theme2 = useTheme();
6675
- return /* @__PURE__ */ jsxs14(Div_default.row, { width: "fit-content", alignItems: "center", gap: theme2.styles.gap, userSelect: "none", ...props, children: [
6769
+ return /* @__PURE__ */ jsxs15(Div_default.row, { width: "fit-content", alignItems: "center", gap: theme2.styles.gap, userSelect: "none", ...props, children: [
6676
6770
  /* @__PURE__ */ jsx19(Text_default, { children: "Light" }),
6677
6771
  /* @__PURE__ */ jsx19(ColorThemeSwitchComponent, { withMoon, className }),
6678
6772
  /* @__PURE__ */ jsx19(Text_default, { children: "Dark" })
@@ -6683,10 +6777,20 @@ ColorThemeSwitch2.withText = ColorThemeSwitchComponent.withText;
6683
6777
  var ColorThemeSwitch_default = ColorThemeSwitch2;
6684
6778
 
6685
6779
  // src/components/Table.tsx
6686
- import { forwardRef as forwardRef15, memo as memo20, useCallback as useCallback10, useMemo as useMemo7, useState as useState8 } from "react";
6780
+ import {
6781
+ forwardRef as forwardRef15,
6782
+ memo as memo20,
6783
+ useCallback as useCallback10,
6784
+ useMemo as useMemo7,
6785
+ useState as useState8,
6786
+ useImperativeHandle as useImperativeHandle2,
6787
+ useRef as useRef5,
6788
+ useEffect as useEffect9
6789
+ } from "react";
6687
6790
  import styled10, { css as css2 } from "styled-components";
6688
- import { Fragment as Fragment6, jsx as jsx20, jsxs as jsxs15 } from "react/jsx-runtime";
6791
+ import { Fragment as Fragment5, jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
6689
6792
  var defaultImageWidth = 120;
6793
+ var maximumVisiblePages = 11;
6690
6794
  var TableStyledComponent = styled10.table.withConfig({
6691
6795
  shouldForwardProp: (prop) => !["isStriped", "withHover", "withStickyHeader", "colorTheme", "theme"].includes(prop)
6692
6796
  })`
@@ -6702,6 +6806,10 @@ var TableStyledComponent = styled10.table.withConfig({
6702
6806
  font-weight: 700;
6703
6807
  }
6704
6808
 
6809
+ &.isFooter {
6810
+ background-color: ${(props) => props.theme.colors.backgroundSecondary};
6811
+ }
6812
+
6705
6813
  &.isClickable {
6706
6814
  cursor: pointer;
6707
6815
  }
@@ -6750,6 +6858,19 @@ var TdStyledComponent = styled10.td.withConfig({
6750
6858
  })`
6751
6859
  ${(props) => props.textAlign ? `text-align: ${props.textAlign} !important;` : ""}
6752
6860
  `;
6861
+ var filterPresetsText = {
6862
+ today: "Today",
6863
+ yesterday: "Yesterday",
6864
+ thisWeek: "This week",
6865
+ thisMonth: "This month",
6866
+ thisYear: "This year",
6867
+ lastWeek: "Last week",
6868
+ lastMonth: "Last month",
6869
+ lastYear: "Last year",
6870
+ nextWeek: "Next week",
6871
+ nextMonth: "Next month",
6872
+ nextYear: "Next year"
6873
+ };
6753
6874
  var TableComponent = forwardRef15(function Table({
6754
6875
  columns,
6755
6876
  data,
@@ -6757,13 +6878,51 @@ var TableComponent = forwardRef15(function Table({
6757
6878
  isLoading,
6758
6879
  withStickyHeader,
6759
6880
  noDataItemsMessage = "No data available",
6881
+ pageSize,
6882
+ pageCount,
6760
6883
  onClickRow,
6761
6884
  onClickAllCheckboxes,
6885
+ onChangePage,
6886
+ onChangeFilter,
6762
6887
  ...props
6763
6888
  }, ref) {
6764
- const { colorTheme } = useBetterHtmlContextInternal();
6765
6889
  const theme2 = useTheme();
6890
+ const mediumScreen = useMediaQuery();
6891
+ const { colorTheme } = useBetterHtmlContextInternal();
6892
+ const filterModalRef = useRef5(null);
6766
6893
  const [checkedItems, setCheckedItems] = useState8([]);
6894
+ const [currentPage, setCurrentPage] = useState8(1);
6895
+ const [filterData, setFilterData] = useState8({});
6896
+ const [openedFilterColumnIndex, setOpenedFilterColumnIndex] = useState8();
6897
+ const [filterListSelectedItems, setFilterListSelectedItems] = useState8();
6898
+ const openedFilterData = openedFilterColumnIndex ? filterData[openedFilterColumnIndex] : void 0;
6899
+ const openedFilterColumn = openedFilterColumnIndex ? columns[openedFilterColumnIndex] : void 0;
6900
+ const filterForm = useForm({
6901
+ defaultValues: {
6902
+ min: void 0,
6903
+ max: void 0
6904
+ },
6905
+ onSubmit: (values) => {
6906
+ if (!openedFilterColumn?.filter) return;
6907
+ if (openedFilterColumnIndex === void 0) return;
6908
+ setFilterData((oldValue) => ({
6909
+ ...oldValue,
6910
+ [openedFilterColumnIndex]: openedFilterColumn.filter === "number" ? {
6911
+ type: openedFilterColumn.filter,
6912
+ min: values.min,
6913
+ max: values.max
6914
+ } : openedFilterColumn.filter === "date" || openedFilterColumn.filter === "date-time" ? {
6915
+ type: openedFilterColumn.filter,
6916
+ min: values.min,
6917
+ max: values.max
6918
+ } : openedFilterColumn.filter === "list" ? {
6919
+ type: openedFilterColumn.filter,
6920
+ list: filterListSelectedItems
6921
+ } : void 0
6922
+ }));
6923
+ filterModalRef.current?.close();
6924
+ }
6925
+ });
6767
6926
  const renderCellContent = useCallback10(
6768
6927
  (column, item, index) => {
6769
6928
  switch (column.type) {
@@ -6772,7 +6931,7 @@ var TableComponent = forwardRef15(function Table({
6772
6931
  return column.format ? column.format(item, index) : String(value ?? "");
6773
6932
  }
6774
6933
  case "element": {
6775
- return column.render?.(item, index) ?? /* @__PURE__ */ jsx20(Fragment6, {});
6934
+ return column.render?.(item, index) ?? /* @__PURE__ */ jsx20(Fragment5, {});
6776
6935
  }
6777
6936
  case "image": {
6778
6937
  const { type, keyName, ...props2 } = column;
@@ -6797,7 +6956,7 @@ var TableComponent = forwardRef15(function Table({
6797
6956
  );
6798
6957
  }
6799
6958
  default: {
6800
- return /* @__PURE__ */ jsx20(Fragment6, {});
6959
+ return /* @__PURE__ */ jsx20(Fragment5, {});
6801
6960
  }
6802
6961
  }
6803
6962
  },
@@ -6816,64 +6975,496 @@ var TableComponent = forwardRef15(function Table({
6816
6975
  },
6817
6976
  [onClickAllCheckboxes, data]
6818
6977
  );
6978
+ const onClickFilterButton = useCallback10(
6979
+ (columnIndex) => {
6980
+ const thisFilterData = filterData[columnIndex];
6981
+ if (thisFilterData?.type === "number" || thisFilterData?.type === "date" || thisFilterData?.type === "date-time") {
6982
+ filterForm.setFieldsValue({
6983
+ min: thisFilterData.min ?? void 0,
6984
+ max: thisFilterData.max ?? void 0
6985
+ });
6986
+ } else if (thisFilterData?.type === "list") {
6987
+ setFilterListSelectedItems(thisFilterData.list);
6988
+ }
6989
+ setOpenedFilterColumnIndex(columnIndex);
6990
+ filterModalRef.current?.open();
6991
+ },
6992
+ [filterData]
6993
+ );
6994
+ const onCloseFilterModal = useCallback10(() => {
6995
+ setTimeout(() => setOpenedFilterColumnIndex(void 0), 0.2 * 1e3);
6996
+ setFilterListSelectedItems(void 0);
6997
+ filterForm.reset();
6998
+ }, []);
6999
+ const onClickCancelFormFilter = useCallback10(() => {
7000
+ if (openedFilterColumnIndex === void 0) return;
7001
+ setFilterData((oldValue) => ({
7002
+ ...oldValue,
7003
+ [openedFilterColumnIndex]: void 0
7004
+ }));
7005
+ filterModalRef.current?.close();
7006
+ }, [openedFilterColumnIndex]);
7007
+ const onClickFilterListItem = useCallback10(
7008
+ (value) => setFilterListSelectedItems((oldValue) => {
7009
+ if (!oldValue) return [value];
7010
+ if (oldValue.includes(value)) return oldValue.filter((item) => item !== value);
7011
+ return [...oldValue, value];
7012
+ }),
7013
+ []
7014
+ );
7015
+ const onClickFilterPreset = useCallback10(
7016
+ (preset) => {
7017
+ const getValueForDate = (date) => {
7018
+ if (openedFilterColumn?.filter === "date") return date.toISOString().split("T")[0];
7019
+ return date.toISOString();
7020
+ };
7021
+ switch (preset) {
7022
+ case "today":
7023
+ filterForm.setFieldsValue({
7024
+ min: getValueForDate(/* @__PURE__ */ new Date()),
7025
+ max: getValueForDate(/* @__PURE__ */ new Date())
7026
+ });
7027
+ break;
7028
+ case "yesterday":
7029
+ filterForm.setFieldsValue({
7030
+ min: getValueForDate(new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() - 1))),
7031
+ max: getValueForDate(new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() - 1)))
7032
+ });
7033
+ break;
7034
+ case "thisWeek":
7035
+ filterForm.setFieldsValue({
7036
+ min: getValueForDate(new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() - 7))),
7037
+ max: getValueForDate(/* @__PURE__ */ new Date())
7038
+ });
7039
+ break;
7040
+ case "thisMonth":
7041
+ filterForm.setFieldsValue({
7042
+ min: getValueForDate(new Date((/* @__PURE__ */ new Date()).setMonth((/* @__PURE__ */ new Date()).getMonth() - 1))),
7043
+ max: getValueForDate(/* @__PURE__ */ new Date())
7044
+ });
7045
+ break;
7046
+ case "thisYear":
7047
+ filterForm.setFieldsValue({
7048
+ min: getValueForDate(new Date((/* @__PURE__ */ new Date()).setFullYear((/* @__PURE__ */ new Date()).getFullYear() - 1))),
7049
+ max: getValueForDate(/* @__PURE__ */ new Date())
7050
+ });
7051
+ break;
7052
+ case "lastWeek":
7053
+ filterForm.setFieldsValue({
7054
+ min: getValueForDate(new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() - 7))),
7055
+ max: getValueForDate(new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() - 1)))
7056
+ });
7057
+ break;
7058
+ case "lastMonth":
7059
+ filterForm.setFieldsValue({
7060
+ min: getValueForDate(new Date((/* @__PURE__ */ new Date()).setMonth((/* @__PURE__ */ new Date()).getMonth() - 1))),
7061
+ max: getValueForDate(new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() - 1)))
7062
+ });
7063
+ break;
7064
+ case "lastYear":
7065
+ filterForm.setFieldsValue({
7066
+ min: getValueForDate(new Date((/* @__PURE__ */ new Date()).setFullYear((/* @__PURE__ */ new Date()).getFullYear() - 1))),
7067
+ max: getValueForDate(new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() - 1)))
7068
+ });
7069
+ break;
7070
+ case "nextWeek":
7071
+ filterForm.setFieldsValue({
7072
+ min: getValueForDate(new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() + 7))),
7073
+ max: getValueForDate(new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() + 7)))
7074
+ });
7075
+ break;
7076
+ case "nextMonth":
7077
+ filterForm.setFieldsValue({
7078
+ min: getValueForDate(new Date((/* @__PURE__ */ new Date()).setMonth((/* @__PURE__ */ new Date()).getMonth() + 1))),
7079
+ max: getValueForDate(new Date((/* @__PURE__ */ new Date()).setMonth((/* @__PURE__ */ new Date()).getMonth() + 1)))
7080
+ });
7081
+ break;
7082
+ case "nextYear":
7083
+ filterForm.setFieldsValue({
7084
+ min: getValueForDate(new Date((/* @__PURE__ */ new Date()).setFullYear((/* @__PURE__ */ new Date()).getFullYear() + 1))),
7085
+ max: getValueForDate(new Date((/* @__PURE__ */ new Date()).setFullYear((/* @__PURE__ */ new Date()).getFullYear() + 1)))
7086
+ });
7087
+ break;
7088
+ default:
7089
+ break;
7090
+ }
7091
+ },
7092
+ [openedFilterColumn]
7093
+ );
7094
+ const dataAfterFilter = useMemo7(
7095
+ () => data.filter(
7096
+ (item) => Object.entries(filterData).every(([columnIndex, filter]) => {
7097
+ if (!filter) return true;
7098
+ const column = columns[parseInt(columnIndex)];
7099
+ if (!column) return true;
7100
+ if (column.filter === "number" && filter.type === "number") {
7101
+ const itemValue = column.getValue?.(item) ?? (column.type === "text" && column.keyName ? Number(item[column.keyName]) : 0);
7102
+ if (filter.min !== void 0 && itemValue < filter.min) return false;
7103
+ if (filter.max !== void 0 && itemValue > filter.max) return false;
7104
+ } else if (column.filter === "date" && filter.type === "date" || column.filter === "date-time" && filter.type === "date-time") {
7105
+ const minDate = filter.min ? new Date(filter.min) : void 0;
7106
+ const maxDate = filter.max ? new Date(filter.max) : void 0;
7107
+ const itemValue = column.getValue?.(item) ?? new Date(column.type === "text" && column.keyName ? String(item[column.keyName]) : "");
7108
+ if (filter.min !== void 0 && minDate && itemValue < minDate) return false;
7109
+ if (filter.max !== void 0 && maxDate && itemValue > maxDate) return false;
7110
+ } else if (column.filter === "list" && filter.type === "list") {
7111
+ const itemValue = column.getValueForList?.(item) ?? (column.type === "text" && column.keyName ? String(item[column.keyName]) : "");
7112
+ if (!filter.list?.includes(itemValue)) return false;
7113
+ }
7114
+ return true;
7115
+ })
7116
+ ),
7117
+ [data, filterData, columns]
7118
+ );
7119
+ const dataAfterPagination = useMemo7(() => {
7120
+ if (pageSize === void 0) return dataAfterFilter;
7121
+ const pageStartItemIndex = (currentPage - 1) * (pageSize ?? 0);
7122
+ const pageEndItemIndex = pageStartItemIndex + (pageSize ?? 0);
7123
+ return dataAfterFilter.slice(pageStartItemIndex, pageEndItemIndex);
7124
+ }, [dataAfterFilter, pageSize, currentPage]);
6819
7125
  const everythingIsChecked = useMemo7(() => {
6820
7126
  return checkedItems.every((checked) => checked) && checkedItems.length === data.length;
6821
7127
  }, [data, checkedItems]);
6822
- return /* @__PURE__ */ jsx20(
6823
- Div_default,
6824
- {
6825
- border: `1px solid ${theme2.colors.border}`,
6826
- borderRadius: theme2.styles.borderRadius * 2,
6827
- overflow: "auto",
6828
- ...props,
6829
- ref,
6830
- children: /* @__PURE__ */ jsxs15(
6831
- TableStyledComponent,
6832
- {
6833
- isStriped,
6834
- withHover: onClickRow !== void 0,
6835
- withStickyHeader,
6836
- colorTheme,
6837
- theme: theme2,
6838
- children: [
6839
- /* @__PURE__ */ jsx20("thead", { children: /* @__PURE__ */ jsx20("tr", { className: "isHeader", children: columns.map((column, index) => /* @__PURE__ */ jsx20(
6840
- ThStyledComponent,
6841
- {
6842
- width: column.type === "image" ? defaultImageWidth : column.type === "checkbox" ? 26 : column.width,
6843
- minWidth: column.minWidth,
6844
- maxWidth: column.maxWidth,
6845
- textAlign: column.align,
6846
- children: column.label ?? (column.type === "checkbox" && onClickAllCheckboxes ? /* @__PURE__ */ jsx20(
6847
- ToggleInput_default.checkbox,
6848
- {
6849
- checked: everythingIsChecked,
6850
- onChange: onClickAllCheckboxesElement
6851
- }
6852
- ) : "")
6853
- },
6854
- column.type + column.label + index
6855
- )) }) }),
6856
- /* @__PURE__ */ jsx20("tbody", { children: isLoading ? /* @__PURE__ */ jsx20("tr", { children: /* @__PURE__ */ jsx20("td", { className: "noData", colSpan: columns.length, children: /* @__PURE__ */ jsx20(Loader_default.box, {}) }) }) : data.length > 0 ? data.map((item, rowIndex) => /* @__PURE__ */ jsx20(
6857
- "tr",
6858
- {
6859
- className: onClickRow ? "isClickable" : void 0,
6860
- onClick: () => onClickRowElement(item, rowIndex),
6861
- children: columns.map((column, colIndex) => /* @__PURE__ */ jsx20(TdStyledComponent, { textAlign: column.align, children: renderCellContent(column, item, rowIndex) }, column.type + column.label + colIndex))
6862
- },
6863
- JSON.stringify(item) + rowIndex
6864
- )) : /* @__PURE__ */ jsx20("tr", { children: /* @__PURE__ */ jsx20("td", { className: "noData", colSpan: columns.length, children: /* @__PURE__ */ jsx20(Text_default.unknown, { children: noDataItemsMessage }) }) }) })
6865
- ]
7128
+ const possibleFilterListValues = useMemo7(() => {
7129
+ if (!openedFilterColumn) return [];
7130
+ return data.reduce(
7131
+ (previousValue, currentValue) => {
7132
+ const value = openedFilterColumn.type === "text" && openedFilterColumn.keyName ? String(currentValue[openedFilterColumn.keyName]) : void 0;
7133
+ if (value !== void 0) {
7134
+ if (previousValue.some((item) => item.value === value)) {
7135
+ previousValue = previousValue.map(
7136
+ (item) => item.value === value ? {
7137
+ ...item,
7138
+ count: item.count + 1
7139
+ } : item
7140
+ );
7141
+ } else
7142
+ previousValue.push({
7143
+ value,
7144
+ count: 1
7145
+ });
6866
7146
  }
6867
- )
7147
+ return previousValue;
7148
+ },
7149
+ []
7150
+ );
7151
+ }, [data, openedFilterColumn]);
7152
+ const pageCountInternal = pageCount ?? (pageSize !== void 0 ? Math.ceil(dataAfterPagination.length / pageSize) : 1);
7153
+ const paginationItems = useMemo7(() => {
7154
+ const halfRange = Math.floor(maximumVisiblePages / 2);
7155
+ let startPage = Math.max(1, currentPage - halfRange);
7156
+ let endPage = Math.min(pageCountInternal, currentPage + halfRange);
7157
+ if (endPage - startPage + 1 < maximumVisiblePages) {
7158
+ startPage = Math.max(1, endPage - maximumVisiblePages + 1);
7159
+ endPage = Math.min(pageCountInternal, startPage + maximumVisiblePages - 1);
6868
7160
  }
7161
+ return Array.from(
7162
+ {
7163
+ length: endPage - startPage + 1
7164
+ },
7165
+ (_, index) => startPage + index
7166
+ );
7167
+ }, [pageCountInternal, currentPage]);
7168
+ const onClickNextPage = useCallback10(() => {
7169
+ setCurrentPage((oldValue) => oldValue >= pageCountInternal ? pageCountInternal : oldValue + 1);
7170
+ }, [pageCountInternal]);
7171
+ const onClickPreviousPage = useCallback10(() => {
7172
+ setCurrentPage((oldValue) => oldValue <= 1 ? 1 : oldValue - 1);
7173
+ }, []);
7174
+ const onClickSelectAllFilterListItems = useCallback10(
7175
+ () => setFilterListSelectedItems(possibleFilterListValues.map((item) => item.value)),
7176
+ [possibleFilterListValues]
6869
7177
  );
7178
+ const onClickDeselectAllFilterListItems = useCallback10(() => setFilterListSelectedItems([]), []);
7179
+ useEffect9(() => {
7180
+ onChangePage?.(currentPage);
7181
+ }, [onChangePage, currentPage]);
7182
+ useEffect9(() => {
7183
+ onChangeFilter?.(filterData);
7184
+ }, [onChangeFilter, filterData]);
7185
+ useImperativeHandle2(
7186
+ ref,
7187
+ () => {
7188
+ return {
7189
+ currentPage,
7190
+ setCurrentPage,
7191
+ pagesCount: pageCountInternal,
7192
+ setCheckedItems
7193
+ };
7194
+ },
7195
+ [currentPage, setCurrentPage, pageCountInternal, setCheckedItems]
7196
+ );
7197
+ const mobileFooterBreakingPoint = mediumScreen.size700 && pageCountInternal > maximumVisiblePages / 1.4;
7198
+ return /* @__PURE__ */ jsxs16(Fragment5, { children: [
7199
+ /* @__PURE__ */ jsx20(
7200
+ Div_default,
7201
+ {
7202
+ border: `1px solid ${theme2.colors.border}`,
7203
+ borderRadius: theme2.styles.borderRadius * 2,
7204
+ overflow: "auto",
7205
+ ...props,
7206
+ children: /* @__PURE__ */ jsxs16(
7207
+ TableStyledComponent,
7208
+ {
7209
+ isStriped,
7210
+ withHover: onClickRow !== void 0,
7211
+ withStickyHeader,
7212
+ colorTheme,
7213
+ theme: theme2,
7214
+ children: [
7215
+ /* @__PURE__ */ jsx20("thead", { children: /* @__PURE__ */ jsx20("tr", { className: "isHeader", children: columns.map((column, index) => /* @__PURE__ */ jsx20(
7216
+ ThStyledComponent,
7217
+ {
7218
+ width: column.type === "image" ? defaultImageWidth : column.type === "checkbox" ? 26 : column.width,
7219
+ minWidth: column.minWidth,
7220
+ maxWidth: column.maxWidth,
7221
+ textAlign: column.align,
7222
+ children: /* @__PURE__ */ jsxs16(
7223
+ Div_default.row,
7224
+ {
7225
+ width: "100%",
7226
+ alignItems: "center",
7227
+ justifyContent: "space-between",
7228
+ gap: theme2.styles.gap,
7229
+ children: [
7230
+ column.type === "checkbox" && onClickAllCheckboxes ? /* @__PURE__ */ jsx20(
7231
+ ToggleInput_default.checkbox,
7232
+ {
7233
+ checked: everythingIsChecked,
7234
+ onChange: onClickAllCheckboxesElement
7235
+ }
7236
+ ) : column.label ? /* @__PURE__ */ jsx20(Text_default, { children: column.label }) : void 0,
7237
+ column.filter && /* @__PURE__ */ jsx20(
7238
+ Button_default.icon,
7239
+ {
7240
+ icon: "filter",
7241
+ color: filterData[index] ? theme2.colors.primary : theme2.colors.textSecondary,
7242
+ value: index,
7243
+ onClickWithValue: onClickFilterButton
7244
+ }
7245
+ )
7246
+ ]
7247
+ }
7248
+ )
7249
+ },
7250
+ column.type + column.label + index
7251
+ )) }) }),
7252
+ /* @__PURE__ */ jsx20("tbody", { children: isLoading ? /* @__PURE__ */ jsx20("tr", { children: /* @__PURE__ */ jsx20("td", { className: "noData", colSpan: columns.length, children: /* @__PURE__ */ jsx20(Loader_default.box, {}) }) }) : dataAfterPagination.length > 0 ? dataAfterPagination.map((item, rowIndex) => /* @__PURE__ */ jsx20(
7253
+ "tr",
7254
+ {
7255
+ className: onClickRow ? "isClickable" : void 0,
7256
+ onClick: () => onClickRowElement(item, rowIndex),
7257
+ children: columns.map((column, colIndex) => /* @__PURE__ */ jsx20(TdStyledComponent, { textAlign: column.align, children: renderCellContent(column, item, rowIndex) }, column.type + column.label + colIndex))
7258
+ },
7259
+ JSON.stringify(item) + rowIndex
7260
+ )) : /* @__PURE__ */ jsx20("tr", { children: /* @__PURE__ */ jsx20("td", { className: "noData", colSpan: columns.length, children: /* @__PURE__ */ jsx20(Text_default.unknown, { children: noDataItemsMessage }) }) }) }),
7261
+ pageSize !== void 0 && /* @__PURE__ */ jsx20("tfoot", { children: /* @__PURE__ */ jsx20("tr", { className: "isFooter", children: /* @__PURE__ */ jsx20("td", { colSpan: columns.length, children: /* @__PURE__ */ jsxs16(
7262
+ Div_default.column,
7263
+ {
7264
+ position: "relative",
7265
+ width: "100%",
7266
+ justifyContent: "center",
7267
+ flexReverse: true,
7268
+ gap: theme2.styles.gap / 2,
7269
+ children: [
7270
+ /* @__PURE__ */ jsxs16(
7271
+ Text_default,
7272
+ {
7273
+ position: mobileFooterBreakingPoint ? "relative" : "absolute",
7274
+ top: !mobileFooterBreakingPoint ? "50%" : void 0,
7275
+ color: theme2.colors.textSecondary,
7276
+ transform: !mobileFooterBreakingPoint ? "translateY(-50%)" : void 0,
7277
+ userSelect: "none",
7278
+ children: [
7279
+ currentPage,
7280
+ " / ",
7281
+ pageCountInternal
7282
+ ]
7283
+ }
7284
+ ),
7285
+ /* @__PURE__ */ jsxs16(Div_default.row, { alignItems: "center", justifyContent: "center", gap: theme2.styles.gap * 2, children: [
7286
+ pageCountInternal > maximumVisiblePages && /* @__PURE__ */ jsx20(
7287
+ Button_default.icon,
7288
+ {
7289
+ icon: "doubleChevronLeft",
7290
+ disabled: currentPage === 1,
7291
+ value: 1,
7292
+ onClickWithValue: setCurrentPage
7293
+ }
7294
+ ),
7295
+ /* @__PURE__ */ jsx20(
7296
+ Button_default.icon,
7297
+ {
7298
+ icon: "chevronLeft",
7299
+ disabled: currentPage === 1,
7300
+ onClick: onClickPreviousPage
7301
+ }
7302
+ ),
7303
+ /* @__PURE__ */ jsx20(
7304
+ Div_default.row,
7305
+ {
7306
+ alignItems: "center",
7307
+ justifyContent: "center",
7308
+ flexWrap: mobileFooterBreakingPoint ? "wrap" : void 0,
7309
+ gap: theme2.styles.gap,
7310
+ children: paginationItems.map((pageIndex) => {
7311
+ const isActive = currentPage === pageIndex;
7312
+ return /* @__PURE__ */ jsx20(
7313
+ Div_default,
7314
+ {
7315
+ cursor: "pointer",
7316
+ userSelect: "none",
7317
+ value: pageIndex,
7318
+ onClickWithValue: setCurrentPage,
7319
+ children: /* @__PURE__ */ jsx20(
7320
+ Text_default,
7321
+ {
7322
+ fontWeight: isActive ? 700 : 400,
7323
+ color: isActive ? theme2.colors.primary : theme2.colors.textSecondary,
7324
+ transition: theme2.styles.transition,
7325
+ children: pageIndex
7326
+ }
7327
+ )
7328
+ },
7329
+ pageIndex
7330
+ );
7331
+ })
7332
+ }
7333
+ ),
7334
+ /* @__PURE__ */ jsx20(
7335
+ Button_default.icon,
7336
+ {
7337
+ icon: "chevronRight",
7338
+ disabled: currentPage === pageCountInternal,
7339
+ onClick: onClickNextPage
7340
+ }
7341
+ ),
7342
+ pageCountInternal > maximumVisiblePages && /* @__PURE__ */ jsx20(
7343
+ Button_default.icon,
7344
+ {
7345
+ icon: "doubleChevronRight",
7346
+ disabled: currentPage === pageCountInternal,
7347
+ onClickWithValue: setCurrentPage,
7348
+ value: pageCountInternal
7349
+ }
7350
+ )
7351
+ ] })
7352
+ ]
7353
+ }
7354
+ ) }) }) })
7355
+ ]
7356
+ }
7357
+ )
7358
+ }
7359
+ ),
7360
+ /* @__PURE__ */ jsx20(
7361
+ Modal_default,
7362
+ {
7363
+ title: `Filter ${openedFilterColumn?.label}`,
7364
+ description: openedFilterColumn?.filter === "number" ? "Enter minimum and maximum values to filter" : openedFilterColumn?.filter === "date" || openedFilterColumn?.filter === "date-time" ? "Enter minimum and maximum dates to filter" : openedFilterColumn?.filter === "list" ? "Select values to filter from the list bellow" : "",
7365
+ onClose: onCloseFilterModal,
7366
+ ref: filterModalRef,
7367
+ children: openedFilterColumn ? openedFilterColumn.filter === "number" ? /* @__PURE__ */ jsx20(
7368
+ Form_default,
7369
+ {
7370
+ form: filterForm,
7371
+ submitButtonText: "Filter",
7372
+ cancelButtonText: "Clear",
7373
+ onClickCancel: openedFilterData ? onClickCancelFormFilter : void 0,
7374
+ children: /* @__PURE__ */ jsxs16(FormRow_default, { children: [
7375
+ /* @__PURE__ */ jsx20(InputField_default, { type: "number", label: "Min", ...filterForm.getInputFieldProps("min") }),
7376
+ /* @__PURE__ */ jsx20(InputField_default, { type: "number", label: "Max", ...filterForm.getInputFieldProps("max") })
7377
+ ] })
7378
+ }
7379
+ ) : openedFilterColumn.filter === "date" || openedFilterColumn.filter === "date-time" ? /* @__PURE__ */ jsxs16(
7380
+ Form_default,
7381
+ {
7382
+ form: filterForm,
7383
+ gap: theme2.styles.gap,
7384
+ submitButtonText: "Filter",
7385
+ cancelButtonText: "Clear",
7386
+ onClickCancel: openedFilterData ? onClickCancelFormFilter : void 0,
7387
+ children: [
7388
+ /* @__PURE__ */ jsxs16(FormRow_default, { children: [
7389
+ /* @__PURE__ */ jsx20(InputField_default.date, { label: "Min", ...filterForm.getInputFieldProps("min") }),
7390
+ /* @__PURE__ */ jsx20(InputField_default.date, { label: "Max", ...filterForm.getInputFieldProps("max") })
7391
+ ] }),
7392
+ openedFilterColumn.presets && /* @__PURE__ */ jsxs16(Div_default.column, { gap: theme2.styles.gap / 2, children: [
7393
+ /* @__PURE__ */ jsx20(Label_default, { text: "Presets" }),
7394
+ /* @__PURE__ */ jsx20(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: openedFilterColumn.presets.map((preset) => {
7395
+ return /* @__PURE__ */ jsx20(
7396
+ Button_default.secondary,
7397
+ {
7398
+ text: filterPresetsText[preset],
7399
+ value: preset,
7400
+ onClickWithValue: onClickFilterPreset
7401
+ },
7402
+ preset
7403
+ );
7404
+ }) })
7405
+ ] })
7406
+ ]
7407
+ }
7408
+ ) : openedFilterColumn.filter === "list" ? /* @__PURE__ */ jsx20(
7409
+ Form_default,
7410
+ {
7411
+ submitButtonText: "Filter",
7412
+ cancelButtonText: "Clear",
7413
+ renderActionButtons: /* @__PURE__ */ jsxs16(Div_default.row, { marginRight: "auto", alignItems: "center", gap: theme2.styles.gap, children: [
7414
+ /* @__PURE__ */ jsx20(
7415
+ Button_default.secondary,
7416
+ {
7417
+ text: "Select All",
7418
+ disabled: possibleFilterListValues.length === filterListSelectedItems?.length,
7419
+ onClick: onClickSelectAllFilterListItems
7420
+ }
7421
+ ),
7422
+ /* @__PURE__ */ jsx20(
7423
+ Button_default.secondary,
7424
+ {
7425
+ text: "Deselect All",
7426
+ disabled: !filterListSelectedItems?.length,
7427
+ onClick: onClickDeselectAllFilterListItems
7428
+ }
7429
+ )
7430
+ ] }),
7431
+ onClickCancel: openedFilterData ? onClickCancelFormFilter : void 0,
7432
+ onSubmit: filterForm.onSubmit,
7433
+ children: /* @__PURE__ */ jsxs16(Div_default.column, { gap: theme2.styles.gap / 2, marginBottom: theme2.styles.space, children: [
7434
+ /* @__PURE__ */ jsx20(Label_default, { text: "Possible values" }),
7435
+ /* @__PURE__ */ jsx20(Div_default.row, { flexWrap: "wrap", gap: theme2.styles.gap, children: possibleFilterListValues.map((value) => {
7436
+ const isActive = filterListSelectedItems?.includes(value.value);
7437
+ return /* @__PURE__ */ jsx20(
7438
+ Div_default.box,
7439
+ {
7440
+ isActive,
7441
+ value: value.value,
7442
+ onClickWithValue: onClickFilterListItem,
7443
+ children: /* @__PURE__ */ jsxs16(Div_default.row, { alignItems: "center", gap: theme2.styles.gap / 2, children: [
7444
+ /* @__PURE__ */ jsx20(Text_default, { children: value.value }),
7445
+ openedFilterColumn.withTotalNumber && /* @__PURE__ */ jsxs16(Text_default, { fontSize: 14, color: theme2.colors.textSecondary, children: [
7446
+ "(",
7447
+ value.count,
7448
+ ")"
7449
+ ] })
7450
+ ] })
7451
+ },
7452
+ value.value
7453
+ );
7454
+ }) })
7455
+ ] })
7456
+ }
7457
+ ) : /* @__PURE__ */ jsx20(Text_default.unknown, { children: "Unknown filter" }) : /* @__PURE__ */ jsx20(Loader_default.box, {})
7458
+ }
7459
+ )
7460
+ ] });
6870
7461
  });
6871
7462
  var Table2 = memo20(TableComponent);
6872
7463
  var Table_default = Table2;
6873
7464
 
6874
7465
  // src/components/Tabs.tsx
6875
- import { forwardRef as forwardRef16, memo as memo21, useCallback as useCallback11, useEffect as useEffect9, useImperativeHandle as useImperativeHandle2, useMemo as useMemo8, useRef as useRef5, useState as useState9 } from "react";
6876
- import { jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
7466
+ import { forwardRef as forwardRef16, memo as memo21, useCallback as useCallback11, useEffect as useEffect10, useImperativeHandle as useImperativeHandle3, useMemo as useMemo8, useRef as useRef6, useState as useState9 } from "react";
7467
+ import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
6877
7468
  var tabBottomLineWidth = 2;
6878
7469
  var tabDotSize = 6;
6879
7470
  var defaultTabName = "tab";
@@ -6882,8 +7473,8 @@ var TabsComponent = forwardRef16(function Tabs({ tabs, name, accentColor, style
6882
7473
  const theme2 = useTheme();
6883
7474
  const urlQuery = reactRouterDomPlugin2 ? useUrlQuery() : void 0;
6884
7475
  const { colorTheme, componentsState } = useBetterHtmlContextInternal();
6885
- const firstRenderPassedRef = useRef5(false);
6886
- const tabsRef = useRef5({});
7476
+ const firstRenderPassedRef = useRef6(false);
7477
+ const tabsRef = useRef6({});
6887
7478
  const [selectedTab, setSelectedTab] = useState9(() => {
6888
7479
  const selectedTabValue = tabs[0] ?? "";
6889
7480
  if (urlQuery) {
@@ -6919,7 +7510,7 @@ var TabsComponent = forwardRef16(function Tabs({ tabs, name, accentColor, style
6919
7510
  });
6920
7511
  return spacing;
6921
7512
  }, [selectedTab, tabs, tabsGap]);
6922
- useEffect9(() => {
7513
+ useEffect10(() => {
6923
7514
  const timeout = setTimeout(() => {
6924
7515
  setRerenderState(Math.random());
6925
7516
  firstRenderPassedRef.current = true;
@@ -6928,7 +7519,7 @@ var TabsComponent = forwardRef16(function Tabs({ tabs, name, accentColor, style
6928
7519
  clearTimeout(timeout);
6929
7520
  };
6930
7521
  }, []);
6931
- useEffect9(() => {
7522
+ useEffect10(() => {
6932
7523
  componentsState.tabs.setTabGroups((oldValue) => {
6933
7524
  const thisTabGroup = oldValue.find((item) => item.name === (name ?? defaultTabName));
6934
7525
  if (thisTabGroup) {
@@ -6949,20 +7540,20 @@ var TabsComponent = forwardRef16(function Tabs({ tabs, name, accentColor, style
6949
7540
  }
6950
7541
  });
6951
7542
  }, [selectedTab, name]);
6952
- useEffect9(() => {
7543
+ useEffect10(() => {
6953
7544
  tabsRef.current[selectedTab]?.scrollIntoView({
6954
7545
  behavior: firstRenderPassedRef.current ? "smooth" : void 0,
6955
7546
  block: "nearest"
6956
7547
  });
6957
7548
  }, [selectedTab]);
6958
- useEffect9(() => {
7549
+ useEffect10(() => {
6959
7550
  return () => {
6960
7551
  componentsState.tabs.setTabGroups(
6961
7552
  (oldValue) => oldValue.filter((item) => item.name !== (name ?? defaultTabName))
6962
7553
  );
6963
7554
  };
6964
7555
  }, []);
6965
- useImperativeHandle2(
7556
+ useImperativeHandle3(
6966
7557
  ref,
6967
7558
  () => {
6968
7559
  return {
@@ -6972,11 +7563,11 @@ var TabsComponent = forwardRef16(function Tabs({ tabs, name, accentColor, style
6972
7563
  },
6973
7564
  [selectedTab, onClickTab]
6974
7565
  );
6975
- return /* @__PURE__ */ jsxs16(Div_default.column, { width: "100%", gap: theme2.styles.space, ...props, children: [
6976
- /* @__PURE__ */ jsxs16(Div_default, { position: "relative", className: "react-better-html-no-scrollbar", overflowY: "auto", children: [
7566
+ return /* @__PURE__ */ jsxs17(Div_default.column, { width: "100%", gap: theme2.styles.space, ...props, children: [
7567
+ /* @__PURE__ */ jsxs17(Div_default, { position: "relative", className: "react-better-html-no-scrollbar", overflowY: "auto", children: [
6977
7568
  /* @__PURE__ */ jsx21(Div_default.row, { position: "relative", width: "fit-content", gap: tabsGap, userSelect: "none", children: tabs.map((tab) => {
6978
7569
  const selected = tab === selectedTab;
6979
- return /* @__PURE__ */ jsxs16(
7570
+ return /* @__PURE__ */ jsxs17(
6980
7571
  Div_default,
6981
7572
  {
6982
7573
  position: "relative",
@@ -7047,7 +7638,7 @@ TabsComponent.content = function Content({ tab, tabWithDot, tabsGroupName, isIni
7047
7638
  () => componentsState.tabs.tabGroups.find((item) => item.name === (tabsGroupName ?? defaultTabName)),
7048
7639
  [componentsState.tabs, tabsGroupName]
7049
7640
  );
7050
- useEffect9(() => {
7641
+ useEffect10(() => {
7051
7642
  if (tabWithDot) {
7052
7643
  componentsState.tabs.setTabsWithDots?.((oldValue) => oldValue.includes(tab) ? oldValue : [...oldValue, tab]);
7053
7644
  } else {
@@ -7063,8 +7654,8 @@ Tabs2.content = TabsComponent.content;
7063
7654
  var Tabs_default = Tabs2;
7064
7655
 
7065
7656
  // src/components/Foldable.tsx
7066
- import { forwardRef as forwardRef17, memo as memo22, useCallback as useCallback12, useEffect as useEffect10, useImperativeHandle as useImperativeHandle3, useRef as useRef6, useState as useState10 } from "react";
7067
- import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
7657
+ import { forwardRef as forwardRef17, memo as memo22, useCallback as useCallback12, useEffect as useEffect11, useImperativeHandle as useImperativeHandle4, useRef as useRef7, useState as useState10 } from "react";
7658
+ import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
7068
7659
  var animationDurationClose = 0.15;
7069
7660
  var animationDurationOpen = animationDurationClose * 2;
7070
7661
  var FoldableComponent = forwardRef17(function Foldable({
@@ -7082,7 +7673,7 @@ var FoldableComponent = forwardRef17(function Foldable({
7082
7673
  ...props
7083
7674
  }, ref) {
7084
7675
  const theme2 = useTheme();
7085
- const bodyRef = useRef6(null);
7676
+ const bodyRef = useRef7(null);
7086
7677
  const [internalIsOpen, setInternalIsOpen] = useBooleanState(defaultOpen);
7087
7678
  const [bodyVirtualHeight, setBodyVirtualHeight] = useState10(500);
7088
7679
  const isOpen = controlledIsOpen !== void 0 ? controlledIsOpen : internalIsOpen;
@@ -7098,11 +7689,11 @@ var FoldableComponent = forwardRef17(function Foldable({
7098
7689
  if (controlledIsOpen === void 0) setInternalIsOpen.toggle();
7099
7690
  onOpenChange?.(!isOpen);
7100
7691
  }, [controlledIsOpen, isOpen, onOpenChange]);
7101
- useEffect10(() => {
7692
+ useEffect11(() => {
7102
7693
  if (!bodyRef.current) return;
7103
7694
  setBodyVirtualHeight(Math.min(500, bodyRef.current.scrollHeight * 2));
7104
7695
  }, [isOpen]);
7105
- useImperativeHandle3(
7696
+ useImperativeHandle4(
7106
7697
  ref,
7107
7698
  () => {
7108
7699
  return {
@@ -7114,8 +7705,8 @@ var FoldableComponent = forwardRef17(function Foldable({
7114
7705
  },
7115
7706
  [open, close, toggleOpen, isOpen]
7116
7707
  );
7117
- return /* @__PURE__ */ jsxs17(Div_default.column, { width: "100%", ...props, children: [
7118
- renderHeader ? renderHeader(isOpen, toggleOpen) : /* @__PURE__ */ jsxs17(
7708
+ return /* @__PURE__ */ jsxs18(Div_default.column, { width: "100%", ...props, children: [
7709
+ renderHeader ? renderHeader(isOpen, toggleOpen) : /* @__PURE__ */ jsxs18(
7119
7710
  Div_default.row,
7120
7711
  {
7121
7712
  width: "100%",
@@ -7127,10 +7718,10 @@ var FoldableComponent = forwardRef17(function Foldable({
7127
7718
  onClick: toggleOpen,
7128
7719
  userSelect: "none",
7129
7720
  children: [
7130
- /* @__PURE__ */ jsxs17(Div_default.row, { flex: 1, alignItems: "center", gap: theme2.styles.space, children: [
7721
+ /* @__PURE__ */ jsxs18(Div_default.row, { flex: 1, alignItems: "center", gap: theme2.styles.space, children: [
7131
7722
  icon && /* @__PURE__ */ jsx22(Icon_default, { name: icon, size: 20, flexShrink: 0 }),
7132
7723
  image && /* @__PURE__ */ jsx22(Image_default.profileImage, { name: image, size: 24, flexShrink: 0 }),
7133
- /* @__PURE__ */ jsxs17(Div_default.column, { gap: theme2.styles.gap / 2, children: [
7724
+ /* @__PURE__ */ jsxs18(Div_default.column, { gap: theme2.styles.gap / 2, children: [
7134
7725
  title && /* @__PURE__ */ jsx22(Text_default, { as: "h3", fontWeight: 700, lineHeight: "20px", children: title }),
7135
7726
  description && /* @__PURE__ */ jsx22(Text_default, { color: theme2.colors.textSecondary, children: description })
7136
7727
  ] })