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.js CHANGED
@@ -1495,6 +1495,26 @@ var icons = {
1495
1495
  }
1496
1496
  ]
1497
1497
  },
1498
+ doubleChevronLeft: {
1499
+ width: 512,
1500
+ height: 512,
1501
+ paths: [
1502
+ {
1503
+ 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",
1504
+ type: "fill"
1505
+ }
1506
+ ]
1507
+ },
1508
+ doubleChevronRight: {
1509
+ width: 512,
1510
+ height: 512,
1511
+ paths: [
1512
+ {
1513
+ 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",
1514
+ type: "fill"
1515
+ }
1516
+ ]
1517
+ },
1498
1518
  eye: {
1499
1519
  width: 576,
1500
1520
  height: 512,
@@ -1534,6 +1554,16 @@ var icons = {
1534
1554
  type: "fill"
1535
1555
  }
1536
1556
  ]
1557
+ },
1558
+ filter: {
1559
+ width: 512,
1560
+ height: 512,
1561
+ paths: [
1562
+ {
1563
+ 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",
1564
+ type: "fill"
1565
+ }
1566
+ ]
1537
1567
  }
1538
1568
  };
1539
1569
 
@@ -2315,14 +2345,19 @@ DivComponent.column = (0, import_react3.forwardRef)(function Column({ flexRevers
2315
2345
  DivComponent.grid = (0, import_react3.forwardRef)(function Grid(props, ref) {
2316
2346
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DivComponent, { display: "grid", ref, ...props });
2317
2347
  });
2318
- DivComponent.box = (0, import_react3.forwardRef)(function Box(props, ref) {
2348
+ DivComponent.box = (0, import_react3.forwardRef)(function Box({ isActive, ...props }, ref) {
2319
2349
  const theme2 = useTheme();
2350
+ const withClick = props.onClick || props.onClickWithValue;
2320
2351
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2321
2352
  DivComponent,
2322
2353
  {
2323
- backgroundColor: theme2.colors.backgroundContent,
2324
- border: `1px solid ${theme2.colors.border}`,
2354
+ color: isActive ? theme2.colors.base : void 0,
2355
+ backgroundColor: isActive ? theme2.colors.primary : theme2.colors.backgroundContent,
2356
+ border: `1px solid ${isActive ? theme2.colors.primary : theme2.colors.border}`,
2325
2357
  borderRadius: theme2.styles.borderRadius,
2358
+ borderColorHover: withClick && !isActive ? theme2.colors.primary : void 0,
2359
+ filterHover: withClick && isActive ? "brightness(0.9)" : void 0,
2360
+ cursor: withClick ? "pointer" : void 0,
2326
2361
  paddingBlock: theme2.styles.gap,
2327
2362
  paddingInline: theme2.styles.space,
2328
2363
  ref,
@@ -3130,7 +3165,7 @@ var Modal_default = Modal2;
3130
3165
  // src/components/PageHolder.tsx
3131
3166
  var import_react12 = require("react");
3132
3167
  var import_jsx_runtime10 = require("react/jsx-runtime");
3133
- var PageHolderComponent = (0, import_react12.forwardRef)(function PageHolder({ noMaxContentWidth, backgroundColor, children, ...props }, ref) {
3168
+ var PageHolderComponent = (0, import_react12.forwardRef)(function PageHolder({ noMaxContentWidth, children, ...props }, ref) {
3134
3169
  const theme2 = useTheme();
3135
3170
  const { app } = useBetterHtmlContextInternal();
3136
3171
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
@@ -3139,7 +3174,6 @@ var PageHolderComponent = (0, import_react12.forwardRef)(function PageHolder({ n
3139
3174
  as: "main",
3140
3175
  width: "100%",
3141
3176
  maxWidth: !noMaxContentWidth ? app.contentMaxWidth : void 0,
3142
- backgroundColor,
3143
3177
  margin: "0px auto",
3144
3178
  padding: theme2.styles.space,
3145
3179
  ...props,
@@ -3148,8 +3182,55 @@ var PageHolderComponent = (0, import_react12.forwardRef)(function PageHolder({ n
3148
3182
  }
3149
3183
  );
3150
3184
  });
3151
- PageHolderComponent.center = (0, import_react12.forwardRef)(function Center(props, ref) {
3152
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, {});
3185
+ PageHolderComponent.center = (0, import_react12.forwardRef)(function Center({
3186
+ decorationImageSrc,
3187
+ decorationImageName,
3188
+ decorationImagePosition = "right",
3189
+ noMaxContentWidth,
3190
+ children,
3191
+ ...props
3192
+ }, ref) {
3193
+ const theme2 = useTheme();
3194
+ const mediaQuery = useMediaQuery();
3195
+ const { app } = useBetterHtmlContextInternal();
3196
+ const breakingPoint = mediaQuery.size1000;
3197
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Div_default.row, { width: "100%", minHeight: "100svh", alignItems: "center", justifyContent: "center", children: [
3198
+ decorationImagePosition === "left" && !breakingPoint && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Div_default, { width: "50%" }),
3199
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3200
+ Div_default.column,
3201
+ {
3202
+ width: `${!breakingPoint && (decorationImageSrc || decorationImageName) ? 50 : 100}%`,
3203
+ alignItems: "center",
3204
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3205
+ Div_default.box,
3206
+ {
3207
+ width: `calc(100% - ${theme2.styles.space}px * 2)`,
3208
+ maxWidth: !noMaxContentWidth ? app.contentMaxWidth / 2 : void 0,
3209
+ marginInline: theme2.styles.space,
3210
+ marginBlock: theme2.styles.space,
3211
+ ...props,
3212
+ ref,
3213
+ children
3214
+ }
3215
+ )
3216
+ }
3217
+ ),
3218
+ decorationImagePosition === "right" && !breakingPoint && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Div_default, { width: "50%" }),
3219
+ (decorationImageSrc || decorationImageName) && !breakingPoint && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3220
+ Image_default,
3221
+ {
3222
+ position: "fixed",
3223
+ name: decorationImageName,
3224
+ src: decorationImageSrc,
3225
+ width: "50%",
3226
+ height: "100svh",
3227
+ top: 0,
3228
+ left: decorationImagePosition === "left" ? 0 : "auto",
3229
+ right: decorationImagePosition === "right" ? 0 : "auto",
3230
+ objectFit: "cover"
3231
+ }
3232
+ )
3233
+ ] });
3153
3234
  });
3154
3235
  var PageHolder2 = (0, import_react12.memo)(PageHolderComponent);
3155
3236
  PageHolder2.center = PageHolderComponent.center;
@@ -5508,10 +5589,19 @@ var InputElement = import_styled_components9.default.input.withConfig({
5508
5589
  cursor: not-allowed;
5509
5590
  }
5510
5591
 
5592
+ &::-webkit-outer-spin-button,
5593
+ &::-webkit-inner-spin-button {
5594
+ -webkit-appearance: none;
5595
+ margin: 0;
5596
+ }
5597
+
5598
+ &[type="number"] {
5599
+ -moz-appearance: textfield;
5600
+ }
5601
+
5511
5602
  &[type="date"],
5512
5603
  &[type="datetime-local"],
5513
5604
  &[type="time"] {
5514
- // min-height: 46px;
5515
5605
  -webkit-appearance: none;
5516
5606
  -moz-appearance: textfield;
5517
5607
 
@@ -5665,7 +5755,7 @@ var InputFieldComponent = (0, import_react18.forwardRef)(function InputField({
5665
5755
  onChangeValue?.(debouncedValue);
5666
5756
  }, [withDebounce, onChangeValue, debouncedValue]);
5667
5757
  const readyId = id ?? internalId;
5668
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Div_default.column, { width: "100%", gap: theme2.styles.gap, ...styledComponentStylesWithExcluded, children: [
5758
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Div_default.column, { width: "100%", gap: theme2.styles.gap / 2, ...styledComponentStylesWithExcluded, children: [
5669
5759
  label && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Label_default, { text: label, color: labelColor, required, isError: !!errorText, htmlFor: readyId }),
5670
5760
  /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Div_default, { position: "relative", width: "100%", ref: holderRef, children: [
5671
5761
  leftIcon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
@@ -5760,7 +5850,7 @@ InputFieldComponent.multiline = (0, import_react18.forwardRef)(function Multilin
5760
5850
  [onChange, onChangeValue]
5761
5851
  );
5762
5852
  const readyId = id ?? internalId;
5763
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Div_default.column, { gap: theme2.styles.gap, children: [
5853
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Div_default.column, { gap: theme2.styles.gap / 2, children: [
5764
5854
  label && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Label_default, { text: label, required, isError: !!errorText, htmlFor: readyId }),
5765
5855
  /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Div_default, { position: "relative", width: "100%", children: [
5766
5856
  leftIcon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
@@ -5911,7 +6001,7 @@ InputFieldComponent.phoneNumber = (0, import_react18.forwardRef)(function PhoneN
5911
6001
  setInputFieldValue(newValue.slice(country?.phoneNumberExtension.length + 1));
5912
6002
  }, [value]);
5913
6003
  const readyId = id ?? internalId;
5914
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Div_default.column, { width: "100%", gap: theme2.styles.gap, children: [
6004
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Div_default.column, { width: "100%", gap: theme2.styles.gap / 2, children: [
5915
6005
  label && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
5916
6006
  Label_default,
5917
6007
  {
@@ -5937,7 +6027,8 @@ InputFieldComponent.phoneNumber = (0, import_react18.forwardRef)(function PhoneN
5937
6027
  value: dropdownValue,
5938
6028
  disabled: props.disabled,
5939
6029
  onChange: setDropdownValue,
5940
- withoutClearButton: true
6030
+ withoutClearButton: true,
6031
+ withoutRenderingOptionsWhenClosed: true
5941
6032
  }
5942
6033
  ),
5943
6034
  /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
@@ -6593,11 +6684,13 @@ var FormComponent = (0, import_react20.forwardRef)(function Form({
6593
6684
  submitButtonLoaderName,
6594
6685
  submitButtonId,
6595
6686
  submitButtonIsDisabled,
6687
+ cancelButtonText,
6596
6688
  actionButtonsLocation = "right",
6597
6689
  gap,
6598
6690
  isSubmitting,
6599
6691
  isDestructive,
6600
6692
  withDividers,
6693
+ renderActionButtons,
6601
6694
  onClickCancel,
6602
6695
  onSubmit,
6603
6696
  children,
@@ -6625,7 +6718,8 @@ var FormComponent = (0, import_react20.forwardRef)(function Form({
6625
6718
  gap: theme2.styles.gap,
6626
6719
  marginTop: theme2.styles.space,
6627
6720
  children: [
6628
- onClickCancel && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button_default.secondary, { text: "Cancel", onClick: onClickCancel }),
6721
+ renderActionButtons,
6722
+ onClickCancel && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Button_default.secondary, { text: cancelButtonText ?? "Cancel", onClick: onClickCancel }),
6629
6723
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6630
6724
  SubmitButtonTag,
6631
6725
  {
@@ -6766,6 +6860,7 @@ var import_react23 = require("react");
6766
6860
  var import_styled_components11 = __toESM(require("styled-components"));
6767
6861
  var import_jsx_runtime21 = require("react/jsx-runtime");
6768
6862
  var defaultImageWidth = 120;
6863
+ var maximumVisiblePages = 11;
6769
6864
  var TableStyledComponent = import_styled_components11.default.table.withConfig({
6770
6865
  shouldForwardProp: (prop) => !["isStriped", "withHover", "withStickyHeader", "colorTheme", "theme"].includes(prop)
6771
6866
  })`
@@ -6781,6 +6876,10 @@ var TableStyledComponent = import_styled_components11.default.table.withConfig({
6781
6876
  font-weight: 700;
6782
6877
  }
6783
6878
 
6879
+ &.isFooter {
6880
+ background-color: ${(props) => props.theme.colors.backgroundSecondary};
6881
+ }
6882
+
6784
6883
  &.isClickable {
6785
6884
  cursor: pointer;
6786
6885
  }
@@ -6829,6 +6928,19 @@ var TdStyledComponent = import_styled_components11.default.td.withConfig({
6829
6928
  })`
6830
6929
  ${(props) => props.textAlign ? `text-align: ${props.textAlign} !important;` : ""}
6831
6930
  `;
6931
+ var filterPresetsText = {
6932
+ today: "Today",
6933
+ yesterday: "Yesterday",
6934
+ thisWeek: "This week",
6935
+ thisMonth: "This month",
6936
+ thisYear: "This year",
6937
+ lastWeek: "Last week",
6938
+ lastMonth: "Last month",
6939
+ lastYear: "Last year",
6940
+ nextWeek: "Next week",
6941
+ nextMonth: "Next month",
6942
+ nextYear: "Next year"
6943
+ };
6832
6944
  var TableComponent = (0, import_react23.forwardRef)(function Table({
6833
6945
  columns,
6834
6946
  data,
@@ -6836,13 +6948,51 @@ var TableComponent = (0, import_react23.forwardRef)(function Table({
6836
6948
  isLoading,
6837
6949
  withStickyHeader,
6838
6950
  noDataItemsMessage = "No data available",
6951
+ pageSize,
6952
+ pageCount,
6839
6953
  onClickRow,
6840
6954
  onClickAllCheckboxes,
6955
+ onChangePage,
6956
+ onChangeFilter,
6841
6957
  ...props
6842
6958
  }, ref) {
6843
- const { colorTheme } = useBetterHtmlContextInternal();
6844
6959
  const theme2 = useTheme();
6960
+ const mediumScreen = useMediaQuery();
6961
+ const { colorTheme } = useBetterHtmlContextInternal();
6962
+ const filterModalRef = (0, import_react23.useRef)(null);
6845
6963
  const [checkedItems, setCheckedItems] = (0, import_react23.useState)([]);
6964
+ const [currentPage, setCurrentPage] = (0, import_react23.useState)(1);
6965
+ const [filterData, setFilterData] = (0, import_react23.useState)({});
6966
+ const [openedFilterColumnIndex, setOpenedFilterColumnIndex] = (0, import_react23.useState)();
6967
+ const [filterListSelectedItems, setFilterListSelectedItems] = (0, import_react23.useState)();
6968
+ const openedFilterData = openedFilterColumnIndex ? filterData[openedFilterColumnIndex] : void 0;
6969
+ const openedFilterColumn = openedFilterColumnIndex ? columns[openedFilterColumnIndex] : void 0;
6970
+ const filterForm = useForm({
6971
+ defaultValues: {
6972
+ min: void 0,
6973
+ max: void 0
6974
+ },
6975
+ onSubmit: (values) => {
6976
+ if (!openedFilterColumn?.filter) return;
6977
+ if (openedFilterColumnIndex === void 0) return;
6978
+ setFilterData((oldValue) => ({
6979
+ ...oldValue,
6980
+ [openedFilterColumnIndex]: openedFilterColumn.filter === "number" ? {
6981
+ type: openedFilterColumn.filter,
6982
+ min: values.min,
6983
+ max: values.max
6984
+ } : openedFilterColumn.filter === "date" || openedFilterColumn.filter === "date-time" ? {
6985
+ type: openedFilterColumn.filter,
6986
+ min: values.min,
6987
+ max: values.max
6988
+ } : openedFilterColumn.filter === "list" ? {
6989
+ type: openedFilterColumn.filter,
6990
+ list: filterListSelectedItems
6991
+ } : void 0
6992
+ }));
6993
+ filterModalRef.current?.close();
6994
+ }
6995
+ });
6846
6996
  const renderCellContent = (0, import_react23.useCallback)(
6847
6997
  (column, item, index) => {
6848
6998
  switch (column.type) {
@@ -6895,57 +7045,489 @@ var TableComponent = (0, import_react23.forwardRef)(function Table({
6895
7045
  },
6896
7046
  [onClickAllCheckboxes, data]
6897
7047
  );
7048
+ const onClickFilterButton = (0, import_react23.useCallback)(
7049
+ (columnIndex) => {
7050
+ const thisFilterData = filterData[columnIndex];
7051
+ if (thisFilterData?.type === "number" || thisFilterData?.type === "date" || thisFilterData?.type === "date-time") {
7052
+ filterForm.setFieldsValue({
7053
+ min: thisFilterData.min ?? void 0,
7054
+ max: thisFilterData.max ?? void 0
7055
+ });
7056
+ } else if (thisFilterData?.type === "list") {
7057
+ setFilterListSelectedItems(thisFilterData.list);
7058
+ }
7059
+ setOpenedFilterColumnIndex(columnIndex);
7060
+ filterModalRef.current?.open();
7061
+ },
7062
+ [filterData]
7063
+ );
7064
+ const onCloseFilterModal = (0, import_react23.useCallback)(() => {
7065
+ setTimeout(() => setOpenedFilterColumnIndex(void 0), 0.2 * 1e3);
7066
+ setFilterListSelectedItems(void 0);
7067
+ filterForm.reset();
7068
+ }, []);
7069
+ const onClickCancelFormFilter = (0, import_react23.useCallback)(() => {
7070
+ if (openedFilterColumnIndex === void 0) return;
7071
+ setFilterData((oldValue) => ({
7072
+ ...oldValue,
7073
+ [openedFilterColumnIndex]: void 0
7074
+ }));
7075
+ filterModalRef.current?.close();
7076
+ }, [openedFilterColumnIndex]);
7077
+ const onClickFilterListItem = (0, import_react23.useCallback)(
7078
+ (value) => setFilterListSelectedItems((oldValue) => {
7079
+ if (!oldValue) return [value];
7080
+ if (oldValue.includes(value)) return oldValue.filter((item) => item !== value);
7081
+ return [...oldValue, value];
7082
+ }),
7083
+ []
7084
+ );
7085
+ const onClickFilterPreset = (0, import_react23.useCallback)(
7086
+ (preset) => {
7087
+ const getValueForDate = (date) => {
7088
+ if (openedFilterColumn?.filter === "date") return date.toISOString().split("T")[0];
7089
+ return date.toISOString();
7090
+ };
7091
+ switch (preset) {
7092
+ case "today":
7093
+ filterForm.setFieldsValue({
7094
+ min: getValueForDate(/* @__PURE__ */ new Date()),
7095
+ max: getValueForDate(/* @__PURE__ */ new Date())
7096
+ });
7097
+ break;
7098
+ case "yesterday":
7099
+ filterForm.setFieldsValue({
7100
+ min: getValueForDate(new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() - 1))),
7101
+ max: getValueForDate(new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() - 1)))
7102
+ });
7103
+ break;
7104
+ case "thisWeek":
7105
+ filterForm.setFieldsValue({
7106
+ min: getValueForDate(new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() - 7))),
7107
+ max: getValueForDate(/* @__PURE__ */ new Date())
7108
+ });
7109
+ break;
7110
+ case "thisMonth":
7111
+ filterForm.setFieldsValue({
7112
+ min: getValueForDate(new Date((/* @__PURE__ */ new Date()).setMonth((/* @__PURE__ */ new Date()).getMonth() - 1))),
7113
+ max: getValueForDate(/* @__PURE__ */ new Date())
7114
+ });
7115
+ break;
7116
+ case "thisYear":
7117
+ filterForm.setFieldsValue({
7118
+ min: getValueForDate(new Date((/* @__PURE__ */ new Date()).setFullYear((/* @__PURE__ */ new Date()).getFullYear() - 1))),
7119
+ max: getValueForDate(/* @__PURE__ */ new Date())
7120
+ });
7121
+ break;
7122
+ case "lastWeek":
7123
+ filterForm.setFieldsValue({
7124
+ min: getValueForDate(new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() - 7))),
7125
+ max: getValueForDate(new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() - 1)))
7126
+ });
7127
+ break;
7128
+ case "lastMonth":
7129
+ filterForm.setFieldsValue({
7130
+ min: getValueForDate(new Date((/* @__PURE__ */ new Date()).setMonth((/* @__PURE__ */ new Date()).getMonth() - 1))),
7131
+ max: getValueForDate(new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() - 1)))
7132
+ });
7133
+ break;
7134
+ case "lastYear":
7135
+ filterForm.setFieldsValue({
7136
+ min: getValueForDate(new Date((/* @__PURE__ */ new Date()).setFullYear((/* @__PURE__ */ new Date()).getFullYear() - 1))),
7137
+ max: getValueForDate(new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() - 1)))
7138
+ });
7139
+ break;
7140
+ case "nextWeek":
7141
+ filterForm.setFieldsValue({
7142
+ min: getValueForDate(new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() + 7))),
7143
+ max: getValueForDate(new Date((/* @__PURE__ */ new Date()).setDate((/* @__PURE__ */ new Date()).getDate() + 7)))
7144
+ });
7145
+ break;
7146
+ case "nextMonth":
7147
+ filterForm.setFieldsValue({
7148
+ min: getValueForDate(new Date((/* @__PURE__ */ new Date()).setMonth((/* @__PURE__ */ new Date()).getMonth() + 1))),
7149
+ max: getValueForDate(new Date((/* @__PURE__ */ new Date()).setMonth((/* @__PURE__ */ new Date()).getMonth() + 1)))
7150
+ });
7151
+ break;
7152
+ case "nextYear":
7153
+ filterForm.setFieldsValue({
7154
+ min: getValueForDate(new Date((/* @__PURE__ */ new Date()).setFullYear((/* @__PURE__ */ new Date()).getFullYear() + 1))),
7155
+ max: getValueForDate(new Date((/* @__PURE__ */ new Date()).setFullYear((/* @__PURE__ */ new Date()).getFullYear() + 1)))
7156
+ });
7157
+ break;
7158
+ default:
7159
+ break;
7160
+ }
7161
+ },
7162
+ [openedFilterColumn]
7163
+ );
7164
+ const dataAfterFilter = (0, import_react23.useMemo)(
7165
+ () => data.filter(
7166
+ (item) => Object.entries(filterData).every(([columnIndex, filter]) => {
7167
+ if (!filter) return true;
7168
+ const column = columns[parseInt(columnIndex)];
7169
+ if (!column) return true;
7170
+ if (column.filter === "number" && filter.type === "number") {
7171
+ const itemValue = column.getValue?.(item) ?? (column.type === "text" && column.keyName ? Number(item[column.keyName]) : 0);
7172
+ if (filter.min !== void 0 && itemValue < filter.min) return false;
7173
+ if (filter.max !== void 0 && itemValue > filter.max) return false;
7174
+ } else if (column.filter === "date" && filter.type === "date" || column.filter === "date-time" && filter.type === "date-time") {
7175
+ const minDate = filter.min ? new Date(filter.min) : void 0;
7176
+ const maxDate = filter.max ? new Date(filter.max) : void 0;
7177
+ const itemValue = column.getValue?.(item) ?? new Date(column.type === "text" && column.keyName ? String(item[column.keyName]) : "");
7178
+ if (filter.min !== void 0 && minDate && itemValue < minDate) return false;
7179
+ if (filter.max !== void 0 && maxDate && itemValue > maxDate) return false;
7180
+ } else if (column.filter === "list" && filter.type === "list") {
7181
+ const itemValue = column.getValueForList?.(item) ?? (column.type === "text" && column.keyName ? String(item[column.keyName]) : "");
7182
+ if (!filter.list?.includes(itemValue)) return false;
7183
+ }
7184
+ return true;
7185
+ })
7186
+ ),
7187
+ [data, filterData, columns]
7188
+ );
7189
+ const dataAfterPagination = (0, import_react23.useMemo)(() => {
7190
+ if (pageSize === void 0) return dataAfterFilter;
7191
+ const pageStartItemIndex = (currentPage - 1) * (pageSize ?? 0);
7192
+ const pageEndItemIndex = pageStartItemIndex + (pageSize ?? 0);
7193
+ return dataAfterFilter.slice(pageStartItemIndex, pageEndItemIndex);
7194
+ }, [dataAfterFilter, pageSize, currentPage]);
6898
7195
  const everythingIsChecked = (0, import_react23.useMemo)(() => {
6899
7196
  return checkedItems.every((checked) => checked) && checkedItems.length === data.length;
6900
7197
  }, [data, checkedItems]);
6901
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
6902
- Div_default,
6903
- {
6904
- border: `1px solid ${theme2.colors.border}`,
6905
- borderRadius: theme2.styles.borderRadius * 2,
6906
- overflow: "auto",
6907
- ...props,
6908
- ref,
6909
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
6910
- TableStyledComponent,
6911
- {
6912
- isStriped,
6913
- withHover: onClickRow !== void 0,
6914
- withStickyHeader,
6915
- colorTheme,
6916
- theme: theme2,
6917
- children: [
6918
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tr", { className: "isHeader", children: columns.map((column, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
6919
- ThStyledComponent,
6920
- {
6921
- width: column.type === "image" ? defaultImageWidth : column.type === "checkbox" ? 26 : column.width,
6922
- minWidth: column.minWidth,
6923
- maxWidth: column.maxWidth,
6924
- textAlign: column.align,
6925
- children: column.label ?? (column.type === "checkbox" && onClickAllCheckboxes ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
6926
- ToggleInput_default.checkbox,
6927
- {
6928
- checked: everythingIsChecked,
6929
- onChange: onClickAllCheckboxesElement
6930
- }
6931
- ) : "")
6932
- },
6933
- column.type + column.label + index
6934
- )) }) }),
6935
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tbody", { children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { className: "noData", colSpan: columns.length, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Loader_default.box, {}) }) }) : data.length > 0 ? data.map((item, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
6936
- "tr",
6937
- {
6938
- className: onClickRow ? "isClickable" : void 0,
6939
- onClick: () => onClickRowElement(item, rowIndex),
6940
- children: columns.map((column, colIndex) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TdStyledComponent, { textAlign: column.align, children: renderCellContent(column, item, rowIndex) }, column.type + column.label + colIndex))
6941
- },
6942
- JSON.stringify(item) + rowIndex
6943
- )) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { className: "noData", colSpan: columns.length, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text_default.unknown, { children: noDataItemsMessage }) }) }) })
6944
- ]
7198
+ const possibleFilterListValues = (0, import_react23.useMemo)(() => {
7199
+ if (!openedFilterColumn) return [];
7200
+ return data.reduce(
7201
+ (previousValue, currentValue) => {
7202
+ const value = openedFilterColumn.type === "text" && openedFilterColumn.keyName ? String(currentValue[openedFilterColumn.keyName]) : void 0;
7203
+ if (value !== void 0) {
7204
+ if (previousValue.some((item) => item.value === value)) {
7205
+ previousValue = previousValue.map(
7206
+ (item) => item.value === value ? {
7207
+ ...item,
7208
+ count: item.count + 1
7209
+ } : item
7210
+ );
7211
+ } else
7212
+ previousValue.push({
7213
+ value,
7214
+ count: 1
7215
+ });
6945
7216
  }
6946
- )
7217
+ return previousValue;
7218
+ },
7219
+ []
7220
+ );
7221
+ }, [data, openedFilterColumn]);
7222
+ const pageCountInternal = pageCount ?? (pageSize !== void 0 ? Math.ceil(dataAfterPagination.length / pageSize) : 1);
7223
+ const paginationItems = (0, import_react23.useMemo)(() => {
7224
+ const halfRange = Math.floor(maximumVisiblePages / 2);
7225
+ let startPage = Math.max(1, currentPage - halfRange);
7226
+ let endPage = Math.min(pageCountInternal, currentPage + halfRange);
7227
+ if (endPage - startPage + 1 < maximumVisiblePages) {
7228
+ startPage = Math.max(1, endPage - maximumVisiblePages + 1);
7229
+ endPage = Math.min(pageCountInternal, startPage + maximumVisiblePages - 1);
6947
7230
  }
7231
+ return Array.from(
7232
+ {
7233
+ length: endPage - startPage + 1
7234
+ },
7235
+ (_, index) => startPage + index
7236
+ );
7237
+ }, [pageCountInternal, currentPage]);
7238
+ const onClickNextPage = (0, import_react23.useCallback)(() => {
7239
+ setCurrentPage((oldValue) => oldValue >= pageCountInternal ? pageCountInternal : oldValue + 1);
7240
+ }, [pageCountInternal]);
7241
+ const onClickPreviousPage = (0, import_react23.useCallback)(() => {
7242
+ setCurrentPage((oldValue) => oldValue <= 1 ? 1 : oldValue - 1);
7243
+ }, []);
7244
+ const onClickSelectAllFilterListItems = (0, import_react23.useCallback)(
7245
+ () => setFilterListSelectedItems(possibleFilterListValues.map((item) => item.value)),
7246
+ [possibleFilterListValues]
6948
7247
  );
7248
+ const onClickDeselectAllFilterListItems = (0, import_react23.useCallback)(() => setFilterListSelectedItems([]), []);
7249
+ (0, import_react23.useEffect)(() => {
7250
+ onChangePage?.(currentPage);
7251
+ }, [onChangePage, currentPage]);
7252
+ (0, import_react23.useEffect)(() => {
7253
+ onChangeFilter?.(filterData);
7254
+ }, [onChangeFilter, filterData]);
7255
+ (0, import_react23.useImperativeHandle)(
7256
+ ref,
7257
+ () => {
7258
+ return {
7259
+ currentPage,
7260
+ setCurrentPage,
7261
+ pagesCount: pageCountInternal,
7262
+ setCheckedItems
7263
+ };
7264
+ },
7265
+ [currentPage, setCurrentPage, pageCountInternal, setCheckedItems]
7266
+ );
7267
+ const mobileFooterBreakingPoint = mediumScreen.size700 && pageCountInternal > maximumVisiblePages / 1.4;
7268
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
7269
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7270
+ Div_default,
7271
+ {
7272
+ border: `1px solid ${theme2.colors.border}`,
7273
+ borderRadius: theme2.styles.borderRadius * 2,
7274
+ overflow: "auto",
7275
+ ...props,
7276
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
7277
+ TableStyledComponent,
7278
+ {
7279
+ isStriped,
7280
+ withHover: onClickRow !== void 0,
7281
+ withStickyHeader,
7282
+ colorTheme,
7283
+ theme: theme2,
7284
+ children: [
7285
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tr", { className: "isHeader", children: columns.map((column, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7286
+ ThStyledComponent,
7287
+ {
7288
+ width: column.type === "image" ? defaultImageWidth : column.type === "checkbox" ? 26 : column.width,
7289
+ minWidth: column.minWidth,
7290
+ maxWidth: column.maxWidth,
7291
+ textAlign: column.align,
7292
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
7293
+ Div_default.row,
7294
+ {
7295
+ width: "100%",
7296
+ alignItems: "center",
7297
+ justifyContent: "space-between",
7298
+ gap: theme2.styles.gap,
7299
+ children: [
7300
+ column.type === "checkbox" && onClickAllCheckboxes ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7301
+ ToggleInput_default.checkbox,
7302
+ {
7303
+ checked: everythingIsChecked,
7304
+ onChange: onClickAllCheckboxesElement
7305
+ }
7306
+ ) : column.label ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text_default, { children: column.label }) : void 0,
7307
+ column.filter && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7308
+ Button_default.icon,
7309
+ {
7310
+ icon: "filter",
7311
+ color: filterData[index] ? theme2.colors.primary : theme2.colors.textSecondary,
7312
+ value: index,
7313
+ onClickWithValue: onClickFilterButton
7314
+ }
7315
+ )
7316
+ ]
7317
+ }
7318
+ )
7319
+ },
7320
+ column.type + column.label + index
7321
+ )) }) }),
7322
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tbody", { children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { className: "noData", colSpan: columns.length, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Loader_default.box, {}) }) }) : dataAfterPagination.length > 0 ? dataAfterPagination.map((item, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7323
+ "tr",
7324
+ {
7325
+ className: onClickRow ? "isClickable" : void 0,
7326
+ onClick: () => onClickRowElement(item, rowIndex),
7327
+ children: columns.map((column, colIndex) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TdStyledComponent, { textAlign: column.align, children: renderCellContent(column, item, rowIndex) }, column.type + column.label + colIndex))
7328
+ },
7329
+ JSON.stringify(item) + rowIndex
7330
+ )) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { className: "noData", colSpan: columns.length, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text_default.unknown, { children: noDataItemsMessage }) }) }) }),
7331
+ pageSize !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tfoot", { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tr", { className: "isFooter", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { colSpan: columns.length, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
7332
+ Div_default.column,
7333
+ {
7334
+ position: "relative",
7335
+ width: "100%",
7336
+ justifyContent: "center",
7337
+ flexReverse: true,
7338
+ gap: theme2.styles.gap / 2,
7339
+ children: [
7340
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
7341
+ Text_default,
7342
+ {
7343
+ position: mobileFooterBreakingPoint ? "relative" : "absolute",
7344
+ top: !mobileFooterBreakingPoint ? "50%" : void 0,
7345
+ color: theme2.colors.textSecondary,
7346
+ transform: !mobileFooterBreakingPoint ? "translateY(-50%)" : void 0,
7347
+ userSelect: "none",
7348
+ children: [
7349
+ currentPage,
7350
+ " / ",
7351
+ pageCountInternal
7352
+ ]
7353
+ }
7354
+ ),
7355
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Div_default.row, { alignItems: "center", justifyContent: "center", gap: theme2.styles.gap * 2, children: [
7356
+ pageCountInternal > maximumVisiblePages && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7357
+ Button_default.icon,
7358
+ {
7359
+ icon: "doubleChevronLeft",
7360
+ disabled: currentPage === 1,
7361
+ value: 1,
7362
+ onClickWithValue: setCurrentPage
7363
+ }
7364
+ ),
7365
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7366
+ Button_default.icon,
7367
+ {
7368
+ icon: "chevronLeft",
7369
+ disabled: currentPage === 1,
7370
+ onClick: onClickPreviousPage
7371
+ }
7372
+ ),
7373
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7374
+ Div_default.row,
7375
+ {
7376
+ alignItems: "center",
7377
+ justifyContent: "center",
7378
+ flexWrap: mobileFooterBreakingPoint ? "wrap" : void 0,
7379
+ gap: theme2.styles.gap,
7380
+ children: paginationItems.map((pageIndex) => {
7381
+ const isActive = currentPage === pageIndex;
7382
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7383
+ Div_default,
7384
+ {
7385
+ cursor: "pointer",
7386
+ userSelect: "none",
7387
+ value: pageIndex,
7388
+ onClickWithValue: setCurrentPage,
7389
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7390
+ Text_default,
7391
+ {
7392
+ fontWeight: isActive ? 700 : 400,
7393
+ color: isActive ? theme2.colors.primary : theme2.colors.textSecondary,
7394
+ transition: theme2.styles.transition,
7395
+ children: pageIndex
7396
+ }
7397
+ )
7398
+ },
7399
+ pageIndex
7400
+ );
7401
+ })
7402
+ }
7403
+ ),
7404
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7405
+ Button_default.icon,
7406
+ {
7407
+ icon: "chevronRight",
7408
+ disabled: currentPage === pageCountInternal,
7409
+ onClick: onClickNextPage
7410
+ }
7411
+ ),
7412
+ pageCountInternal > maximumVisiblePages && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7413
+ Button_default.icon,
7414
+ {
7415
+ icon: "doubleChevronRight",
7416
+ disabled: currentPage === pageCountInternal,
7417
+ onClickWithValue: setCurrentPage,
7418
+ value: pageCountInternal
7419
+ }
7420
+ )
7421
+ ] })
7422
+ ]
7423
+ }
7424
+ ) }) }) })
7425
+ ]
7426
+ }
7427
+ )
7428
+ }
7429
+ ),
7430
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7431
+ Modal_default,
7432
+ {
7433
+ title: `Filter ${openedFilterColumn?.label}`,
7434
+ 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" : "",
7435
+ onClose: onCloseFilterModal,
7436
+ ref: filterModalRef,
7437
+ children: openedFilterColumn ? openedFilterColumn.filter === "number" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7438
+ Form_default,
7439
+ {
7440
+ form: filterForm,
7441
+ submitButtonText: "Filter",
7442
+ cancelButtonText: "Clear",
7443
+ onClickCancel: openedFilterData ? onClickCancelFormFilter : void 0,
7444
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(FormRow_default, { children: [
7445
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(InputField_default, { type: "number", label: "Min", ...filterForm.getInputFieldProps("min") }),
7446
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(InputField_default, { type: "number", label: "Max", ...filterForm.getInputFieldProps("max") })
7447
+ ] })
7448
+ }
7449
+ ) : openedFilterColumn.filter === "date" || openedFilterColumn.filter === "date-time" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
7450
+ Form_default,
7451
+ {
7452
+ form: filterForm,
7453
+ gap: theme2.styles.gap,
7454
+ submitButtonText: "Filter",
7455
+ cancelButtonText: "Clear",
7456
+ onClickCancel: openedFilterData ? onClickCancelFormFilter : void 0,
7457
+ children: [
7458
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(FormRow_default, { children: [
7459
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(InputField_default.date, { label: "Min", ...filterForm.getInputFieldProps("min") }),
7460
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(InputField_default.date, { label: "Max", ...filterForm.getInputFieldProps("max") })
7461
+ ] }),
7462
+ openedFilterColumn.presets && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Div_default.column, { gap: theme2.styles.gap / 2, children: [
7463
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Label_default, { text: "Presets" }),
7464
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: openedFilterColumn.presets.map((preset) => {
7465
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7466
+ Button_default.secondary,
7467
+ {
7468
+ text: filterPresetsText[preset],
7469
+ value: preset,
7470
+ onClickWithValue: onClickFilterPreset
7471
+ },
7472
+ preset
7473
+ );
7474
+ }) })
7475
+ ] })
7476
+ ]
7477
+ }
7478
+ ) : openedFilterColumn.filter === "list" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7479
+ Form_default,
7480
+ {
7481
+ submitButtonText: "Filter",
7482
+ cancelButtonText: "Clear",
7483
+ renderActionButtons: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Div_default.row, { marginRight: "auto", alignItems: "center", gap: theme2.styles.gap, children: [
7484
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7485
+ Button_default.secondary,
7486
+ {
7487
+ text: "Select All",
7488
+ disabled: possibleFilterListValues.length === filterListSelectedItems?.length,
7489
+ onClick: onClickSelectAllFilterListItems
7490
+ }
7491
+ ),
7492
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7493
+ Button_default.secondary,
7494
+ {
7495
+ text: "Deselect All",
7496
+ disabled: !filterListSelectedItems?.length,
7497
+ onClick: onClickDeselectAllFilterListItems
7498
+ }
7499
+ )
7500
+ ] }),
7501
+ onClickCancel: openedFilterData ? onClickCancelFormFilter : void 0,
7502
+ onSubmit: filterForm.onSubmit,
7503
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Div_default.column, { gap: theme2.styles.gap / 2, marginBottom: theme2.styles.space, children: [
7504
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Label_default, { text: "Possible values" }),
7505
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Div_default.row, { flexWrap: "wrap", gap: theme2.styles.gap, children: possibleFilterListValues.map((value) => {
7506
+ const isActive = filterListSelectedItems?.includes(value.value);
7507
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7508
+ Div_default.box,
7509
+ {
7510
+ isActive,
7511
+ value: value.value,
7512
+ onClickWithValue: onClickFilterListItem,
7513
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Div_default.row, { alignItems: "center", gap: theme2.styles.gap / 2, children: [
7514
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text_default, { children: value.value }),
7515
+ openedFilterColumn.withTotalNumber && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text_default, { fontSize: 14, color: theme2.colors.textSecondary, children: [
7516
+ "(",
7517
+ value.count,
7518
+ ")"
7519
+ ] })
7520
+ ] })
7521
+ },
7522
+ value.value
7523
+ );
7524
+ }) })
7525
+ ] })
7526
+ }
7527
+ ) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text_default.unknown, { children: "Unknown filter" }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Loader_default.box, {})
7528
+ }
7529
+ )
7530
+ ] });
6949
7531
  });
6950
7532
  var Table2 = (0, import_react23.memo)(TableComponent);
6951
7533
  var Table_default = Table2;