react-better-html 1.1.192 → 1.1.194
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +31 -4
- package/dist/index.d.ts +31 -4
- package/dist/index.js +371 -312
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +355 -297
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -9,7 +9,6 @@ var isMobileDevice = /Mobi|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Op
|
|
|
9
9
|
|
|
10
10
|
// src/utils/hooks.ts
|
|
11
11
|
import { useCallback as useCallback4, useEffect as useEffect5, useMemo as useMemo3, useRef as useRef2, useState as useState3 } from "react";
|
|
12
|
-
import { createSearchParams } from "react-router-dom";
|
|
13
12
|
|
|
14
13
|
// src/constants/css.ts
|
|
15
14
|
var cssProps = {
|
|
@@ -1548,12 +1547,13 @@ var alertsPlugin = (options) => ({
|
|
|
1548
1547
|
});
|
|
1549
1548
|
|
|
1550
1549
|
// src/plugins/reactRouterDom.ts
|
|
1551
|
-
import { useInRouterContext, useLocation, useNavigate, useSearchParams } from "react-router-dom";
|
|
1550
|
+
import { createSearchParams, useInRouterContext, useLocation, useNavigate, useSearchParams } from "react-router-dom";
|
|
1552
1551
|
var defaultReactRouterDomPluginOptions = {
|
|
1553
1552
|
useNavigate,
|
|
1554
1553
|
useLocation,
|
|
1555
1554
|
useInRouterContext,
|
|
1556
|
-
useSearchParams
|
|
1555
|
+
useSearchParams,
|
|
1556
|
+
createSearchParams
|
|
1557
1557
|
};
|
|
1558
1558
|
var reactRouterDomPlugin = (options) => ({
|
|
1559
1559
|
name: "react-router-dom",
|
|
@@ -3113,6 +3113,7 @@ function useUrlQuery() {
|
|
|
3113
3113
|
}
|
|
3114
3114
|
const navigate = reactRouterDomPluginConfig.useNavigate();
|
|
3115
3115
|
const [searchParams] = reactRouterDomPluginConfig.useSearchParams();
|
|
3116
|
+
const createSearchParams2 = reactRouterDomPluginConfig.createSearchParams;
|
|
3116
3117
|
const setQuery = useCallback4(
|
|
3117
3118
|
(query, keepHistory = true) => {
|
|
3118
3119
|
const currentSearchParams = {};
|
|
@@ -3121,7 +3122,7 @@ function useUrlQuery() {
|
|
|
3121
3122
|
});
|
|
3122
3123
|
navigate(
|
|
3123
3124
|
{
|
|
3124
|
-
search:
|
|
3125
|
+
search: createSearchParams2({
|
|
3125
3126
|
...currentSearchParams,
|
|
3126
3127
|
...Object.fromEntries(Object.entries(query).map(([key, value]) => [key, value.toString()]))
|
|
3127
3128
|
}).toString()
|
|
@@ -3194,7 +3195,7 @@ var PageHeaderComponent = forwardRef5(function PageHeader({
|
|
|
3194
3195
|
imageUrl,
|
|
3195
3196
|
imageSize = 60,
|
|
3196
3197
|
title,
|
|
3197
|
-
titleAs,
|
|
3198
|
+
titleAs = "h1",
|
|
3198
3199
|
titleColor,
|
|
3199
3200
|
titleRightElement,
|
|
3200
3201
|
description,
|
|
@@ -3233,7 +3234,7 @@ var PageHeaderComponent = forwardRef5(function PageHeader({
|
|
|
3233
3234
|
/* @__PURE__ */ jsx10(
|
|
3234
3235
|
Text_default,
|
|
3235
3236
|
{
|
|
3236
|
-
as: titleAs
|
|
3237
|
+
as: titleAs,
|
|
3237
3238
|
textAlign,
|
|
3238
3239
|
color: titleColor ?? (lightMode ? theme2.colors.base : theme2.colors.textPrimary),
|
|
3239
3240
|
children: title
|
|
@@ -7705,17 +7706,132 @@ var ColorThemeSwitch_default = ColorThemeSwitch2;
|
|
|
7705
7706
|
// src/components/Table.tsx
|
|
7706
7707
|
import {
|
|
7707
7708
|
forwardRef as forwardRef15,
|
|
7708
|
-
memo as
|
|
7709
|
-
useCallback as
|
|
7710
|
-
useMemo as
|
|
7711
|
-
useState as
|
|
7709
|
+
memo as memo23,
|
|
7710
|
+
useCallback as useCallback12,
|
|
7711
|
+
useMemo as useMemo9,
|
|
7712
|
+
useState as useState10,
|
|
7712
7713
|
useImperativeHandle as useImperativeHandle2,
|
|
7713
7714
|
useRef as useRef6,
|
|
7714
|
-
useEffect as
|
|
7715
|
+
useEffect as useEffect11,
|
|
7715
7716
|
Fragment as Fragment6
|
|
7716
7717
|
} from "react";
|
|
7717
7718
|
import styled12, { css as css2 } from "styled-components";
|
|
7718
|
-
|
|
7719
|
+
|
|
7720
|
+
// src/components/Pagination.tsx
|
|
7721
|
+
import { memo as memo22, useCallback as useCallback11, useEffect as useEffect10, useMemo as useMemo8, useState as useState9 } from "react";
|
|
7722
|
+
import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
7723
|
+
var PaginationComponent = function Pagination({
|
|
7724
|
+
currentPage = 1,
|
|
7725
|
+
itemsLength = 0,
|
|
7726
|
+
itemsPerPage,
|
|
7727
|
+
pageCount,
|
|
7728
|
+
maximumVisiblePages: maximumVisiblePages2 = 11,
|
|
7729
|
+
onClickPreviousPage,
|
|
7730
|
+
onClickNextPage,
|
|
7731
|
+
onChangePage
|
|
7732
|
+
}) {
|
|
7733
|
+
const theme2 = useTheme();
|
|
7734
|
+
const mediaQuery = useMediaQuery();
|
|
7735
|
+
const [currentPageInternal, setCurrentPage] = useState9(currentPage);
|
|
7736
|
+
const pageCountInternal = pageCount ?? (itemsPerPage !== void 0 ? Math.ceil(itemsLength / itemsPerPage) : 1);
|
|
7737
|
+
const onClickPreviousPageElement = useCallback11(() => {
|
|
7738
|
+
const newPage = currentPageInternal <= 1 ? 1 : currentPageInternal - 1;
|
|
7739
|
+
setCurrentPage(newPage);
|
|
7740
|
+
onClickPreviousPage?.(newPage);
|
|
7741
|
+
}, [currentPageInternal, onClickPreviousPage]);
|
|
7742
|
+
const onClickNextPageElement = useCallback11(() => {
|
|
7743
|
+
const newPage = currentPageInternal >= pageCountInternal ? pageCountInternal : currentPageInternal + 1;
|
|
7744
|
+
setCurrentPage(newPage);
|
|
7745
|
+
onClickNextPage?.(newPage);
|
|
7746
|
+
}, [currentPageInternal, pageCountInternal, onClickNextPage]);
|
|
7747
|
+
const paginationItems = useMemo8(() => {
|
|
7748
|
+
const halfRange = Math.floor(maximumVisiblePages2 / 2);
|
|
7749
|
+
let startPage = Math.max(1, currentPageInternal - halfRange);
|
|
7750
|
+
let endPage = Math.min(pageCountInternal, currentPageInternal + halfRange);
|
|
7751
|
+
if (endPage - startPage + 1 < maximumVisiblePages2) {
|
|
7752
|
+
startPage = Math.max(1, endPage - maximumVisiblePages2 + 1);
|
|
7753
|
+
endPage = Math.min(pageCountInternal, startPage + maximumVisiblePages2 - 1);
|
|
7754
|
+
}
|
|
7755
|
+
return Array.from(
|
|
7756
|
+
{
|
|
7757
|
+
length: endPage - startPage + 1
|
|
7758
|
+
},
|
|
7759
|
+
(_, index) => startPage + index
|
|
7760
|
+
);
|
|
7761
|
+
}, [pageCountInternal, currentPageInternal]);
|
|
7762
|
+
useEffect10(() => {
|
|
7763
|
+
onChangePage?.(currentPageInternal);
|
|
7764
|
+
}, [currentPageInternal, onChangePage]);
|
|
7765
|
+
useEffect10(() => {
|
|
7766
|
+
setCurrentPage(currentPage);
|
|
7767
|
+
}, [currentPage]);
|
|
7768
|
+
const mobileFooterBreakingPoint = mediaQuery.size700 && pageCountInternal > maximumVisiblePages2 / 1.4;
|
|
7769
|
+
return /* @__PURE__ */ jsxs18(Div_default.row, { alignItems: "center", justifyContent: "center", gap: theme2.styles.gap * 2, children: [
|
|
7770
|
+
pageCountInternal > maximumVisiblePages2 && /* @__PURE__ */ jsx22(
|
|
7771
|
+
Button_default.icon,
|
|
7772
|
+
{
|
|
7773
|
+
icon: "doubleChevronLeft",
|
|
7774
|
+
disabled: currentPageInternal === 1,
|
|
7775
|
+
value: 1,
|
|
7776
|
+
onClickWithValue: setCurrentPage
|
|
7777
|
+
}
|
|
7778
|
+
),
|
|
7779
|
+
/* @__PURE__ */ jsx22(Button_default.icon, { icon: "chevronLeft", disabled: currentPageInternal === 1, onClick: onClickPreviousPageElement }),
|
|
7780
|
+
/* @__PURE__ */ jsx22(
|
|
7781
|
+
Div_default.row,
|
|
7782
|
+
{
|
|
7783
|
+
alignItems: "center",
|
|
7784
|
+
justifyContent: "center",
|
|
7785
|
+
flexWrap: mobileFooterBreakingPoint ? "wrap" : void 0,
|
|
7786
|
+
gap: theme2.styles.gap,
|
|
7787
|
+
children: paginationItems.map((pageIndex) => {
|
|
7788
|
+
const isActive = currentPageInternal === pageIndex;
|
|
7789
|
+
return /* @__PURE__ */ jsx22(
|
|
7790
|
+
Div_default,
|
|
7791
|
+
{
|
|
7792
|
+
cursor: "pointer",
|
|
7793
|
+
userSelect: "none",
|
|
7794
|
+
value: pageIndex,
|
|
7795
|
+
onClickWithValue: setCurrentPage,
|
|
7796
|
+
children: /* @__PURE__ */ jsx22(
|
|
7797
|
+
Text_default,
|
|
7798
|
+
{
|
|
7799
|
+
fontWeight: isActive ? 700 : 400,
|
|
7800
|
+
color: isActive ? theme2.colors.primary : theme2.colors.textSecondary,
|
|
7801
|
+
transition: theme2.styles.transition,
|
|
7802
|
+
children: pageIndex
|
|
7803
|
+
}
|
|
7804
|
+
)
|
|
7805
|
+
},
|
|
7806
|
+
pageIndex
|
|
7807
|
+
);
|
|
7808
|
+
})
|
|
7809
|
+
}
|
|
7810
|
+
),
|
|
7811
|
+
/* @__PURE__ */ jsx22(
|
|
7812
|
+
Button_default.icon,
|
|
7813
|
+
{
|
|
7814
|
+
icon: "chevronRight",
|
|
7815
|
+
disabled: currentPageInternal === pageCountInternal,
|
|
7816
|
+
onClick: onClickNextPageElement
|
|
7817
|
+
}
|
|
7818
|
+
),
|
|
7819
|
+
pageCountInternal > maximumVisiblePages2 && /* @__PURE__ */ jsx22(
|
|
7820
|
+
Button_default.icon,
|
|
7821
|
+
{
|
|
7822
|
+
icon: "doubleChevronRight",
|
|
7823
|
+
disabled: currentPageInternal === pageCountInternal,
|
|
7824
|
+
onClickWithValue: setCurrentPage,
|
|
7825
|
+
value: pageCountInternal
|
|
7826
|
+
}
|
|
7827
|
+
)
|
|
7828
|
+
] });
|
|
7829
|
+
};
|
|
7830
|
+
var Pagination2 = memo22(PaginationComponent);
|
|
7831
|
+
var Pagination_default = Pagination2;
|
|
7832
|
+
|
|
7833
|
+
// src/components/Table.tsx
|
|
7834
|
+
import { Fragment as Fragment7, jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
7719
7835
|
var defaultImageWidth = 160;
|
|
7720
7836
|
var maximumVisiblePages = 11;
|
|
7721
7837
|
var TableStyledComponent = styled12.table.withConfig({
|
|
@@ -7887,13 +8003,13 @@ var TableComponent = forwardRef15(function Table({
|
|
|
7887
8003
|
const mediaQuery = useMediaQuery();
|
|
7888
8004
|
const { colorTheme } = useBetterHtmlContextInternal();
|
|
7889
8005
|
const filterModalRef = useRef6(null);
|
|
7890
|
-
const readyColumns =
|
|
8006
|
+
const readyColumns = useMemo9(() => columns.filter((column) => !column.hidden), [columns]);
|
|
7891
8007
|
const columnsRef = useRef6(readyColumns);
|
|
7892
8008
|
columnsRef.current = readyColumns;
|
|
7893
|
-
const [checkedItems, setCheckedItems] =
|
|
7894
|
-
const [expandedRows, setExpandedRows] =
|
|
7895
|
-
const [currentPage, setCurrentPage] =
|
|
7896
|
-
const [filterData, setFilterData] =
|
|
8009
|
+
const [checkedItems, setCheckedItems] = useState10([]);
|
|
8010
|
+
const [expandedRows, setExpandedRows] = useState10([]);
|
|
8011
|
+
const [currentPage, setCurrentPage] = useState10(1);
|
|
8012
|
+
const [filterData, setFilterData] = useState10(() => {
|
|
7897
8013
|
if (!memoizeFilters || !name) return {};
|
|
7898
8014
|
const localStorageData = JSON.parse(localStorage.getItem(`react-better-html-table-filters-${name}`) || "{}");
|
|
7899
8015
|
const timestamp = localStorageData.timestamp;
|
|
@@ -7902,8 +8018,8 @@ var TableComponent = forwardRef15(function Table({
|
|
|
7902
8018
|
if (timeDiff > memoizeFiltersLifespan) return {};
|
|
7903
8019
|
return data2;
|
|
7904
8020
|
});
|
|
7905
|
-
const [openedFilterColumnIndex, setOpenedFilterColumnIndex] =
|
|
7906
|
-
const [filterListSelectedItems, setFilterListSelectedItems] =
|
|
8021
|
+
const [openedFilterColumnIndex, setOpenedFilterColumnIndex] = useState10();
|
|
8022
|
+
const [filterListSelectedItems, setFilterListSelectedItems] = useState10();
|
|
7907
8023
|
const openedFilterData = openedFilterColumnIndex !== void 0 ? filterData[openedFilterColumnIndex] : void 0;
|
|
7908
8024
|
const openedFilterColumn = openedFilterColumnIndex !== void 0 ? readyColumns[openedFilterColumnIndex] : void 0;
|
|
7909
8025
|
const filterForm = useForm({
|
|
@@ -7933,26 +8049,26 @@ var TableComponent = forwardRef15(function Table({
|
|
|
7933
8049
|
filterModalRef.current?.close();
|
|
7934
8050
|
}
|
|
7935
8051
|
});
|
|
7936
|
-
const expandColumn =
|
|
7937
|
-
const renderCellContent =
|
|
8052
|
+
const expandColumn = useMemo9(() => readyColumns.find((column) => column.type === "expand"), [readyColumns]);
|
|
8053
|
+
const renderCellContent = useCallback12(
|
|
7938
8054
|
(column, item, itemIndex) => {
|
|
7939
8055
|
switch (column.type) {
|
|
7940
8056
|
case "text": {
|
|
7941
8057
|
const value = column.keyName ? item[column.keyName] : void 0;
|
|
7942
8058
|
const textProps = (typeof column.getTextProps === "function" ? column.getTextProps?.(item, itemIndex) : column.getTextProps) ?? {};
|
|
7943
|
-
return /* @__PURE__ */
|
|
8059
|
+
return /* @__PURE__ */ jsx23(Text_default, { ...textProps, children: column.format?.(item, itemIndex) ?? String(value ?? "") });
|
|
7944
8060
|
}
|
|
7945
8061
|
case "element": {
|
|
7946
|
-
return column.render?.(item, itemIndex) ?? /* @__PURE__ */
|
|
8062
|
+
return column.render?.(item, itemIndex) ?? /* @__PURE__ */ jsx23(Fragment7, {});
|
|
7947
8063
|
}
|
|
7948
8064
|
case "image": {
|
|
7949
8065
|
const imageProps = (typeof column.getImageProps === "function" ? column.getImageProps?.(item, itemIndex) : column.getImageProps) ?? {};
|
|
7950
|
-
return /* @__PURE__ */
|
|
8066
|
+
return /* @__PURE__ */ jsx23(Image_default, { width: "100%", borderRadius: theme2.styles.borderRadius / 2, ...imageProps });
|
|
7951
8067
|
}
|
|
7952
8068
|
case "checkbox": {
|
|
7953
8069
|
const { onChange, ...toggleInputProps } = (typeof column.getToggleInputProps === "function" ? column.getToggleInputProps?.(item, itemIndex) : column.getToggleInputProps) ?? {};
|
|
7954
8070
|
const checkedValue = checkedItems[itemIndex];
|
|
7955
|
-
return /* @__PURE__ */
|
|
8071
|
+
return /* @__PURE__ */ jsx23(
|
|
7956
8072
|
ToggleInput_default.checkbox,
|
|
7957
8073
|
{
|
|
7958
8074
|
checked: checkedValue,
|
|
@@ -7973,7 +8089,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
7973
8089
|
);
|
|
7974
8090
|
}
|
|
7975
8091
|
case "expand": {
|
|
7976
|
-
return /* @__PURE__ */
|
|
8092
|
+
return /* @__PURE__ */ jsx23(Div_default, { isTabAccessed: true, children: /* @__PURE__ */ jsx23(
|
|
7977
8093
|
Icon_default,
|
|
7978
8094
|
{
|
|
7979
8095
|
name: "chevronDown",
|
|
@@ -7983,13 +8099,13 @@ var TableComponent = forwardRef15(function Table({
|
|
|
7983
8099
|
) });
|
|
7984
8100
|
}
|
|
7985
8101
|
default: {
|
|
7986
|
-
return /* @__PURE__ */
|
|
8102
|
+
return /* @__PURE__ */ jsx23(Fragment7, {});
|
|
7987
8103
|
}
|
|
7988
8104
|
}
|
|
7989
8105
|
},
|
|
7990
8106
|
[theme2, checkedItems, expandedRows]
|
|
7991
8107
|
);
|
|
7992
|
-
const onClickRowElement =
|
|
8108
|
+
const onClickRowElement = useCallback12(
|
|
7993
8109
|
(item, index) => {
|
|
7994
8110
|
if (expandColumn) {
|
|
7995
8111
|
setExpandedRows((oldValue) => {
|
|
@@ -8006,14 +8122,14 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8006
8122
|
},
|
|
8007
8123
|
[onClickRow, expandColumn]
|
|
8008
8124
|
);
|
|
8009
|
-
const onClickAllCheckboxesElement =
|
|
8125
|
+
const onClickAllCheckboxesElement = useCallback12(
|
|
8010
8126
|
(checked) => {
|
|
8011
8127
|
onClickAllCheckboxes?.(checked);
|
|
8012
8128
|
setCheckedItems(data.map(() => checked));
|
|
8013
8129
|
},
|
|
8014
8130
|
[onClickAllCheckboxes, data]
|
|
8015
8131
|
);
|
|
8016
|
-
const onClickFilterButton =
|
|
8132
|
+
const onClickFilterButton = useCallback12(
|
|
8017
8133
|
(columnIndex) => {
|
|
8018
8134
|
const thisFilterData = filterData[columnIndex];
|
|
8019
8135
|
if (thisFilterData?.type === "number" || thisFilterData?.type === "date" || thisFilterData?.type === "date-time") {
|
|
@@ -8029,12 +8145,12 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8029
8145
|
},
|
|
8030
8146
|
[filterData]
|
|
8031
8147
|
);
|
|
8032
|
-
const onCloseFilterModal =
|
|
8148
|
+
const onCloseFilterModal = useCallback12(() => {
|
|
8033
8149
|
setTimeout(() => setOpenedFilterColumnIndex(void 0), 0.2 * 1e3);
|
|
8034
8150
|
setFilterListSelectedItems(void 0);
|
|
8035
8151
|
filterForm.reset();
|
|
8036
8152
|
}, []);
|
|
8037
|
-
const onClickCancelFormFilter =
|
|
8153
|
+
const onClickCancelFormFilter = useCallback12(() => {
|
|
8038
8154
|
if (openedFilterColumnIndex === void 0) return;
|
|
8039
8155
|
setFilterData(
|
|
8040
8156
|
(oldValue) => Object.entries({
|
|
@@ -8047,7 +8163,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8047
8163
|
);
|
|
8048
8164
|
filterModalRef.current?.close();
|
|
8049
8165
|
}, [openedFilterColumnIndex]);
|
|
8050
|
-
const onClickFilterListItem =
|
|
8166
|
+
const onClickFilterListItem = useCallback12(
|
|
8051
8167
|
(value) => setFilterListSelectedItems((oldValue) => {
|
|
8052
8168
|
if (!oldValue) return [value];
|
|
8053
8169
|
if (oldValue.includes(value)) return oldValue.filter((item) => item !== value);
|
|
@@ -8055,7 +8171,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8055
8171
|
}),
|
|
8056
8172
|
[]
|
|
8057
8173
|
);
|
|
8058
|
-
const onClickFilterPreset =
|
|
8174
|
+
const onClickFilterPreset = useCallback12(
|
|
8059
8175
|
(preset) => {
|
|
8060
8176
|
const getValueForDate = (date) => {
|
|
8061
8177
|
if (openedFilterColumn?.filter === "date") return date.toISOString().split("T")[0];
|
|
@@ -8140,7 +8256,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8140
8256
|
},
|
|
8141
8257
|
[openedFilterColumn]
|
|
8142
8258
|
);
|
|
8143
|
-
const renderExpandedRow =
|
|
8259
|
+
const renderExpandedRow = useCallback12(
|
|
8144
8260
|
(...props2) => {
|
|
8145
8261
|
const expandColumn2 = readyColumns.find((column) => column.type === "expand");
|
|
8146
8262
|
if (!expandColumn2) return;
|
|
@@ -8148,7 +8264,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8148
8264
|
},
|
|
8149
8265
|
[readyColumns]
|
|
8150
8266
|
);
|
|
8151
|
-
const dataAfterFilter =
|
|
8267
|
+
const dataAfterFilter = useMemo9(
|
|
8152
8268
|
() => data.filter(
|
|
8153
8269
|
(item) => Object.entries(filterData).every(([columnIndex, filter]) => {
|
|
8154
8270
|
if (!filter) return true;
|
|
@@ -8177,17 +8293,17 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8177
8293
|
),
|
|
8178
8294
|
[data, filterData]
|
|
8179
8295
|
);
|
|
8180
|
-
const dataAfterPagination =
|
|
8296
|
+
const dataAfterPagination = useMemo9(() => {
|
|
8181
8297
|
if (pageSize === void 0) return dataAfterFilter;
|
|
8182
8298
|
if (pageCount !== void 0) return dataAfterFilter;
|
|
8183
8299
|
const pageStartItemIndex = (currentPage - 1) * (pageSize ?? 0);
|
|
8184
8300
|
const pageEndItemIndex = pageStartItemIndex + (pageSize ?? 0);
|
|
8185
8301
|
return dataAfterFilter.slice(pageStartItemIndex, pageEndItemIndex);
|
|
8186
8302
|
}, [dataAfterFilter, pageSize, currentPage, pageCount]);
|
|
8187
|
-
const everythingIsChecked =
|
|
8303
|
+
const everythingIsChecked = useMemo9(() => {
|
|
8188
8304
|
return data.length > 0 && checkedItems.every((checked) => checked) && checkedItems.length === data.length;
|
|
8189
8305
|
}, [data, checkedItems]);
|
|
8190
|
-
const possibleFilterListValues =
|
|
8306
|
+
const possibleFilterListValues = useMemo9(() => {
|
|
8191
8307
|
if (!openedFilterColumn) return [];
|
|
8192
8308
|
return data.reduce((previousValue, currentValue) => {
|
|
8193
8309
|
const valueFromList = openedFilterColumn.filter === "list" && openedFilterColumn.getValueForList ? openedFilterColumn.getValueForList(currentValue) : void 0;
|
|
@@ -8216,39 +8332,18 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8216
8332
|
}, []);
|
|
8217
8333
|
}, [data, openedFilterColumn, filterForm.values.search]);
|
|
8218
8334
|
const pageCountInternal = pageCount ?? (pageSize !== void 0 ? Math.ceil(dataAfterFilter.length / pageSize) : 1);
|
|
8219
|
-
const
|
|
8220
|
-
const halfRange = Math.floor(maximumVisiblePages / 2);
|
|
8221
|
-
let startPage = Math.max(1, currentPage - halfRange);
|
|
8222
|
-
let endPage = Math.min(pageCountInternal, currentPage + halfRange);
|
|
8223
|
-
if (endPage - startPage + 1 < maximumVisiblePages) {
|
|
8224
|
-
startPage = Math.max(1, endPage - maximumVisiblePages + 1);
|
|
8225
|
-
endPage = Math.min(pageCountInternal, startPage + maximumVisiblePages - 1);
|
|
8226
|
-
}
|
|
8227
|
-
return Array.from(
|
|
8228
|
-
{
|
|
8229
|
-
length: endPage - startPage + 1
|
|
8230
|
-
},
|
|
8231
|
-
(_, index) => startPage + index
|
|
8232
|
-
);
|
|
8233
|
-
}, [pageCountInternal, currentPage]);
|
|
8234
|
-
const onClickNextPage = useCallback11(() => {
|
|
8235
|
-
setCurrentPage((oldValue) => oldValue >= pageCountInternal ? pageCountInternal : oldValue + 1);
|
|
8236
|
-
}, [pageCountInternal]);
|
|
8237
|
-
const onClickPreviousPage = useCallback11(() => {
|
|
8238
|
-
setCurrentPage((oldValue) => oldValue <= 1 ? 1 : oldValue - 1);
|
|
8239
|
-
}, []);
|
|
8240
|
-
const onClickSelectAllFilterListItems = useCallback11(
|
|
8335
|
+
const onClickSelectAllFilterListItems = useCallback12(
|
|
8241
8336
|
() => setFilterListSelectedItems(possibleFilterListValues.map((item) => item.value)),
|
|
8242
8337
|
[possibleFilterListValues]
|
|
8243
8338
|
);
|
|
8244
|
-
const onClickDeselectAllFilterListItems =
|
|
8245
|
-
|
|
8339
|
+
const onClickDeselectAllFilterListItems = useCallback12(() => setFilterListSelectedItems([]), []);
|
|
8340
|
+
useEffect11(() => {
|
|
8246
8341
|
onChangePage?.(currentPage);
|
|
8247
8342
|
}, [onChangePage, currentPage]);
|
|
8248
|
-
|
|
8343
|
+
useEffect11(() => {
|
|
8249
8344
|
onChangeFilter?.(filterData);
|
|
8250
8345
|
}, [onChangeFilter, filterData]);
|
|
8251
|
-
|
|
8346
|
+
useEffect11(() => {
|
|
8252
8347
|
if (!memoizeFilters) return;
|
|
8253
8348
|
if (!name) return;
|
|
8254
8349
|
localStorage.setItem(
|
|
@@ -8259,7 +8354,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8259
8354
|
})
|
|
8260
8355
|
);
|
|
8261
8356
|
}, [memoizeFilters, name, filterData]);
|
|
8262
|
-
|
|
8357
|
+
useEffect11(() => {
|
|
8263
8358
|
onChangeFilterDataValue?.(dataAfterFilter);
|
|
8264
8359
|
}, [onChangeFilterDataValue, dataAfterFilter]);
|
|
8265
8360
|
useImperativeHandle2(
|
|
@@ -8276,8 +8371,8 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8276
8371
|
);
|
|
8277
8372
|
const withFooter = pageSize !== void 0 && pageCountInternal > 1;
|
|
8278
8373
|
const mobileFooterBreakingPoint = mediaQuery.size700 && pageCountInternal > maximumVisiblePages / 1.4;
|
|
8279
|
-
return /* @__PURE__ */
|
|
8280
|
-
/* @__PURE__ */
|
|
8374
|
+
return /* @__PURE__ */ jsxs19(Fragment7, { children: [
|
|
8375
|
+
/* @__PURE__ */ jsx23(
|
|
8281
8376
|
Div_default,
|
|
8282
8377
|
{
|
|
8283
8378
|
border: `1px solid ${theme2.colors.border}`,
|
|
@@ -8285,7 +8380,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8285
8380
|
overflow: !containsOverflowComponents ? "auto" : void 0,
|
|
8286
8381
|
...props,
|
|
8287
8382
|
ref: wrapperComponentRef,
|
|
8288
|
-
children: /* @__PURE__ */
|
|
8383
|
+
children: /* @__PURE__ */ jsxs19(
|
|
8289
8384
|
TableStyledComponent,
|
|
8290
8385
|
{
|
|
8291
8386
|
isStriped,
|
|
@@ -8296,14 +8391,14 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8296
8391
|
containsOverflowComponents,
|
|
8297
8392
|
withFooter,
|
|
8298
8393
|
children: [
|
|
8299
|
-
/* @__PURE__ */
|
|
8394
|
+
/* @__PURE__ */ jsx23("thead", { children: /* @__PURE__ */ jsx23("tr", { className: "isHeader", children: readyColumns.map((column, index) => /* @__PURE__ */ jsx23(
|
|
8300
8395
|
ThStyledComponent,
|
|
8301
8396
|
{
|
|
8302
8397
|
width: column.width ?? (column.type === "image" ? defaultImageWidth : column.type === "checkbox" ? 26 : column.type === "expand" ? 16 : void 0),
|
|
8303
8398
|
minWidth: column.minWidth,
|
|
8304
8399
|
maxWidth: column.maxWidth,
|
|
8305
8400
|
textAlign: column.align,
|
|
8306
|
-
children: /* @__PURE__ */
|
|
8401
|
+
children: /* @__PURE__ */ jsxs19(
|
|
8307
8402
|
Div_default.row,
|
|
8308
8403
|
{
|
|
8309
8404
|
width: "100%",
|
|
@@ -8311,15 +8406,15 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8311
8406
|
justifyContent: column.filter ? "space-between" : column.align === "center" ? "center" : column.align === "right" ? "flex-end" : "flex-start",
|
|
8312
8407
|
gap: theme2.styles.gap,
|
|
8313
8408
|
children: [
|
|
8314
|
-
column.type === "checkbox" && onClickAllCheckboxes ? /* @__PURE__ */
|
|
8409
|
+
column.type === "checkbox" && onClickAllCheckboxes ? /* @__PURE__ */ jsx23(
|
|
8315
8410
|
ToggleInput_default.checkbox,
|
|
8316
8411
|
{
|
|
8317
8412
|
checked: everythingIsChecked,
|
|
8318
8413
|
disabled: data.length === 0,
|
|
8319
8414
|
onChange: onClickAllCheckboxesElement
|
|
8320
8415
|
}
|
|
8321
|
-
) : column.label ? column.renderLabel ? column.renderLabel(column.label) : /* @__PURE__ */
|
|
8322
|
-
column.filter && /* @__PURE__ */
|
|
8416
|
+
) : column.label ? column.renderLabel ? column.renderLabel(column.label) : /* @__PURE__ */ jsx23(Text_default, { children: column.label }) : void 0,
|
|
8417
|
+
column.filter && /* @__PURE__ */ jsx23(
|
|
8323
8418
|
Button_default.icon,
|
|
8324
8419
|
{
|
|
8325
8420
|
icon: "filter",
|
|
@@ -8334,14 +8429,14 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8334
8429
|
},
|
|
8335
8430
|
column.type + column.label + index
|
|
8336
8431
|
)) }) }),
|
|
8337
|
-
/* @__PURE__ */
|
|
8338
|
-
/* @__PURE__ */
|
|
8432
|
+
/* @__PURE__ */ jsx23("tbody", { children: isLoading ? /* @__PURE__ */ jsx23("tr", { className: "withoutHover", children: /* @__PURE__ */ jsx23("td", { className: "noData", colSpan: readyColumns.length, children: /* @__PURE__ */ jsx23(Loader_default.box, {}) }) }) : dataAfterPagination.length > 0 ? dataAfterPagination.map((item, rowIndex) => /* @__PURE__ */ jsxs19(Fragment6, { children: [
|
|
8433
|
+
/* @__PURE__ */ jsx23(
|
|
8339
8434
|
"tr",
|
|
8340
8435
|
{
|
|
8341
8436
|
className: isInsideTableExpandRow && onClickRow === void 0 && expandColumn === void 0 ? "withoutHover" : void 0,
|
|
8342
8437
|
style: getRowStyle?.(item, rowIndex),
|
|
8343
8438
|
onClick: () => onClickRowElement(item, rowIndex),
|
|
8344
|
-
children: readyColumns.map((column, colIndex) => /* @__PURE__ */
|
|
8439
|
+
children: readyColumns.map((column, colIndex) => /* @__PURE__ */ jsx23(
|
|
8345
8440
|
TdStyledComponent,
|
|
8346
8441
|
{
|
|
8347
8442
|
textAlign: column.align,
|
|
@@ -8354,9 +8449,9 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8354
8449
|
))
|
|
8355
8450
|
}
|
|
8356
8451
|
),
|
|
8357
|
-
expandedRows[rowIndex] && /* @__PURE__ */
|
|
8358
|
-
] }, JSON.stringify(item) + rowIndex)) : /* @__PURE__ */
|
|
8359
|
-
withFooter && /* @__PURE__ */
|
|
8452
|
+
expandedRows[rowIndex] && /* @__PURE__ */ jsx23("tr", { className: "withoutHover isExpandRow", children: /* @__PURE__ */ jsx23("td", { colSpan: readyColumns.length, children: renderExpandedRow(item, rowIndex) }) })
|
|
8453
|
+
] }, JSON.stringify(item) + rowIndex)) : /* @__PURE__ */ jsx23("tr", { className: "withoutHover", children: /* @__PURE__ */ jsx23("td", { className: "noData", colSpan: readyColumns.length, children: /* @__PURE__ */ jsx23(Text_default.unknown, { children: noDataItemsMessage }) }) }) }),
|
|
8454
|
+
withFooter && /* @__PURE__ */ jsx23("tfoot", { children: /* @__PURE__ */ jsx23("tr", { className: "isFooter", children: /* @__PURE__ */ jsx23("td", { colSpan: readyColumns.length, children: /* @__PURE__ */ jsxs19(
|
|
8360
8455
|
Div_default.column,
|
|
8361
8456
|
{
|
|
8362
8457
|
position: "relative",
|
|
@@ -8365,7 +8460,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8365
8460
|
flexReverse: true,
|
|
8366
8461
|
gap: theme2.styles.gap / 2,
|
|
8367
8462
|
children: [
|
|
8368
|
-
/* @__PURE__ */
|
|
8463
|
+
/* @__PURE__ */ jsxs19(
|
|
8369
8464
|
Text_default,
|
|
8370
8465
|
{
|
|
8371
8466
|
position: mobileFooterBreakingPoint ? "relative" : "absolute",
|
|
@@ -8380,73 +8475,17 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8380
8475
|
]
|
|
8381
8476
|
}
|
|
8382
8477
|
),
|
|
8383
|
-
/* @__PURE__ */
|
|
8384
|
-
|
|
8385
|
-
|
|
8386
|
-
|
|
8387
|
-
|
|
8388
|
-
|
|
8389
|
-
|
|
8390
|
-
|
|
8391
|
-
|
|
8392
|
-
|
|
8393
|
-
|
|
8394
|
-
Button_default.icon,
|
|
8395
|
-
{
|
|
8396
|
-
icon: "chevronLeft",
|
|
8397
|
-
disabled: currentPage === 1,
|
|
8398
|
-
onClick: onClickPreviousPage
|
|
8399
|
-
}
|
|
8400
|
-
),
|
|
8401
|
-
/* @__PURE__ */ jsx22(
|
|
8402
|
-
Div_default.row,
|
|
8403
|
-
{
|
|
8404
|
-
alignItems: "center",
|
|
8405
|
-
justifyContent: "center",
|
|
8406
|
-
flexWrap: mobileFooterBreakingPoint ? "wrap" : void 0,
|
|
8407
|
-
gap: theme2.styles.gap,
|
|
8408
|
-
children: paginationItems.map((pageIndex) => {
|
|
8409
|
-
const isActive = currentPage === pageIndex;
|
|
8410
|
-
return /* @__PURE__ */ jsx22(
|
|
8411
|
-
Div_default,
|
|
8412
|
-
{
|
|
8413
|
-
cursor: "pointer",
|
|
8414
|
-
userSelect: "none",
|
|
8415
|
-
value: pageIndex,
|
|
8416
|
-
onClickWithValue: setCurrentPage,
|
|
8417
|
-
children: /* @__PURE__ */ jsx22(
|
|
8418
|
-
Text_default,
|
|
8419
|
-
{
|
|
8420
|
-
fontWeight: isActive ? 700 : 400,
|
|
8421
|
-
color: isActive ? theme2.colors.primary : theme2.colors.textSecondary,
|
|
8422
|
-
transition: theme2.styles.transition,
|
|
8423
|
-
children: pageIndex
|
|
8424
|
-
}
|
|
8425
|
-
)
|
|
8426
|
-
},
|
|
8427
|
-
pageIndex
|
|
8428
|
-
);
|
|
8429
|
-
})
|
|
8430
|
-
}
|
|
8431
|
-
),
|
|
8432
|
-
/* @__PURE__ */ jsx22(
|
|
8433
|
-
Button_default.icon,
|
|
8434
|
-
{
|
|
8435
|
-
icon: "chevronRight",
|
|
8436
|
-
disabled: currentPage === pageCountInternal,
|
|
8437
|
-
onClick: onClickNextPage
|
|
8438
|
-
}
|
|
8439
|
-
),
|
|
8440
|
-
pageCountInternal > maximumVisiblePages && /* @__PURE__ */ jsx22(
|
|
8441
|
-
Button_default.icon,
|
|
8442
|
-
{
|
|
8443
|
-
icon: "doubleChevronRight",
|
|
8444
|
-
disabled: currentPage === pageCountInternal,
|
|
8445
|
-
onClickWithValue: setCurrentPage,
|
|
8446
|
-
value: pageCountInternal
|
|
8447
|
-
}
|
|
8448
|
-
)
|
|
8449
|
-
] })
|
|
8478
|
+
/* @__PURE__ */ jsx23(
|
|
8479
|
+
Pagination_default,
|
|
8480
|
+
{
|
|
8481
|
+
currentPage,
|
|
8482
|
+
itemsLength: dataAfterFilter.length,
|
|
8483
|
+
itemsPerPage: pageSize,
|
|
8484
|
+
pageCount,
|
|
8485
|
+
maximumVisiblePages,
|
|
8486
|
+
onChangePage: setCurrentPage
|
|
8487
|
+
}
|
|
8488
|
+
)
|
|
8450
8489
|
]
|
|
8451
8490
|
}
|
|
8452
8491
|
) }) }) })
|
|
@@ -8455,26 +8494,26 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8455
8494
|
)
|
|
8456
8495
|
}
|
|
8457
8496
|
),
|
|
8458
|
-
/* @__PURE__ */
|
|
8497
|
+
/* @__PURE__ */ jsx23(
|
|
8459
8498
|
Modal_default,
|
|
8460
8499
|
{
|
|
8461
8500
|
title: `Filter ${openedFilterColumn?.label ?? ""}`,
|
|
8462
8501
|
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" : "",
|
|
8463
8502
|
onClose: onCloseFilterModal,
|
|
8464
8503
|
ref: filterModalRef,
|
|
8465
|
-
children: openedFilterColumn ? openedFilterColumn.filter === "number" ? /* @__PURE__ */
|
|
8504
|
+
children: openedFilterColumn ? openedFilterColumn.filter === "number" ? /* @__PURE__ */ jsx23(
|
|
8466
8505
|
Form_default,
|
|
8467
8506
|
{
|
|
8468
8507
|
form: filterForm,
|
|
8469
8508
|
submitButtonText: "Filter",
|
|
8470
8509
|
cancelButtonText: "Clear",
|
|
8471
8510
|
onClickCancel: openedFilterData ? onClickCancelFormFilter : void 0,
|
|
8472
|
-
children: /* @__PURE__ */
|
|
8473
|
-
/* @__PURE__ */
|
|
8474
|
-
/* @__PURE__ */
|
|
8511
|
+
children: /* @__PURE__ */ jsxs19(FormRow_default, { children: [
|
|
8512
|
+
/* @__PURE__ */ jsx23(InputField_default, { type: "number", label: "Min", ...filterForm.getInputFieldProps("min") }),
|
|
8513
|
+
/* @__PURE__ */ jsx23(InputField_default, { type: "number", label: "Max", ...filterForm.getInputFieldProps("max") })
|
|
8475
8514
|
] })
|
|
8476
8515
|
}
|
|
8477
|
-
) : openedFilterColumn.filter === "date" || openedFilterColumn.filter === "date-time" ? /* @__PURE__ */
|
|
8516
|
+
) : openedFilterColumn.filter === "date" || openedFilterColumn.filter === "date-time" ? /* @__PURE__ */ jsxs19(
|
|
8478
8517
|
Form_default,
|
|
8479
8518
|
{
|
|
8480
8519
|
form: filterForm,
|
|
@@ -8483,16 +8522,16 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8483
8522
|
cancelButtonText: "Clear",
|
|
8484
8523
|
onClickCancel: openedFilterData ? onClickCancelFormFilter : void 0,
|
|
8485
8524
|
children: [
|
|
8486
|
-
/* @__PURE__ */
|
|
8487
|
-
/* @__PURE__ */
|
|
8488
|
-
/* @__PURE__ */
|
|
8489
|
-
] }) : /* @__PURE__ */
|
|
8490
|
-
/* @__PURE__ */
|
|
8491
|
-
/* @__PURE__ */
|
|
8525
|
+
/* @__PURE__ */ jsx23(FormRow_default, { children: openedFilterColumn.filter === "date" ? /* @__PURE__ */ jsxs19(Fragment7, { children: [
|
|
8526
|
+
/* @__PURE__ */ jsx23(InputField_default.date, { label: "Min", ...filterForm.getInputFieldProps("min") }),
|
|
8527
|
+
/* @__PURE__ */ jsx23(InputField_default.date, { label: "Max", ...filterForm.getInputFieldProps("max") })
|
|
8528
|
+
] }) : /* @__PURE__ */ jsxs19(Fragment7, { children: [
|
|
8529
|
+
/* @__PURE__ */ jsx23(InputField_default.dateTime, { label: "Min", ...filterForm.getInputFieldProps("min") }),
|
|
8530
|
+
/* @__PURE__ */ jsx23(InputField_default.dateTime, { label: "Max", ...filterForm.getInputFieldProps("max") })
|
|
8492
8531
|
] }) }),
|
|
8493
|
-
openedFilterColumn.presets && /* @__PURE__ */
|
|
8494
|
-
/* @__PURE__ */
|
|
8495
|
-
/* @__PURE__ */
|
|
8532
|
+
openedFilterColumn.presets && /* @__PURE__ */ jsxs19(Div_default.column, { gap: theme2.styles.gap / 2, children: [
|
|
8533
|
+
/* @__PURE__ */ jsx23(Label_default, { text: "Presets" }),
|
|
8534
|
+
/* @__PURE__ */ jsx23(Div_default.row, { alignItems: "center", flexWrap: "wrap", gap: theme2.styles.gap, children: openedFilterColumn.presets.map((preset) => /* @__PURE__ */ jsx23(
|
|
8496
8535
|
Button_default.secondary,
|
|
8497
8536
|
{
|
|
8498
8537
|
text: filterPresetsText[preset],
|
|
@@ -8505,14 +8544,14 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8505
8544
|
] })
|
|
8506
8545
|
]
|
|
8507
8546
|
}
|
|
8508
|
-
) : openedFilterColumn.filter === "list" ? /* @__PURE__ */
|
|
8547
|
+
) : openedFilterColumn.filter === "list" ? /* @__PURE__ */ jsxs19(
|
|
8509
8548
|
Form_default,
|
|
8510
8549
|
{
|
|
8511
8550
|
gap: theme2.styles.space,
|
|
8512
8551
|
submitButtonText: "Filter",
|
|
8513
8552
|
cancelButtonText: "Clear",
|
|
8514
|
-
renderActionButtons: /* @__PURE__ */
|
|
8515
|
-
/* @__PURE__ */
|
|
8553
|
+
renderActionButtons: /* @__PURE__ */ jsxs19(Div_default.row, { marginRight: "auto", alignItems: "center", gap: theme2.styles.gap, children: [
|
|
8554
|
+
/* @__PURE__ */ jsx23(
|
|
8516
8555
|
Button_default.secondary,
|
|
8517
8556
|
{
|
|
8518
8557
|
text: "Select All",
|
|
@@ -8521,7 +8560,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8521
8560
|
onClick: onClickSelectAllFilterListItems
|
|
8522
8561
|
}
|
|
8523
8562
|
),
|
|
8524
|
-
/* @__PURE__ */
|
|
8563
|
+
/* @__PURE__ */ jsx23(
|
|
8525
8564
|
Button_default.secondary,
|
|
8526
8565
|
{
|
|
8527
8566
|
text: "Deselect All",
|
|
@@ -8534,7 +8573,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8534
8573
|
onClickCancel: openedFilterData ? onClickCancelFormFilter : void 0,
|
|
8535
8574
|
onSubmit: filterForm.onSubmit,
|
|
8536
8575
|
children: [
|
|
8537
|
-
openedFilterColumn?.withSearch && /* @__PURE__ */
|
|
8576
|
+
openedFilterColumn?.withSearch && /* @__PURE__ */ jsx23(FormRow_default, { oneItemOnly: true, children: /* @__PURE__ */ jsx23(
|
|
8538
8577
|
InputField_default.search,
|
|
8539
8578
|
{
|
|
8540
8579
|
label: "Search",
|
|
@@ -8542,19 +8581,19 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8542
8581
|
...filterForm.getInputFieldProps("search")
|
|
8543
8582
|
}
|
|
8544
8583
|
) }),
|
|
8545
|
-
/* @__PURE__ */
|
|
8546
|
-
/* @__PURE__ */
|
|
8547
|
-
/* @__PURE__ */
|
|
8584
|
+
/* @__PURE__ */ jsxs19(Div_default.column, { gap: theme2.styles.gap / 2, children: [
|
|
8585
|
+
/* @__PURE__ */ jsx23(Label_default, { text: "Possible values" }),
|
|
8586
|
+
/* @__PURE__ */ jsx23(Div_default.row, { flexWrap: "wrap", gap: theme2.styles.gap, children: possibleFilterListValues.length > 0 ? possibleFilterListValues.map((value) => {
|
|
8548
8587
|
const isActive = filterListSelectedItems?.includes(value.value);
|
|
8549
|
-
return /* @__PURE__ */
|
|
8588
|
+
return /* @__PURE__ */ jsx23(
|
|
8550
8589
|
Div_default.box,
|
|
8551
8590
|
{
|
|
8552
8591
|
isActive,
|
|
8553
8592
|
value: value.value,
|
|
8554
8593
|
onClickWithValue: onClickFilterListItem,
|
|
8555
|
-
children: /* @__PURE__ */
|
|
8556
|
-
/* @__PURE__ */
|
|
8557
|
-
openedFilterColumn.withTotalNumber && /* @__PURE__ */
|
|
8594
|
+
children: /* @__PURE__ */ jsxs19(Div_default.row, { alignItems: "center", gap: theme2.styles.gap / 2, children: [
|
|
8595
|
+
/* @__PURE__ */ jsx23(Text_default, { children: value.label || value.value }),
|
|
8596
|
+
openedFilterColumn.withTotalNumber && /* @__PURE__ */ jsxs19(
|
|
8558
8597
|
Text_default,
|
|
8559
8598
|
{
|
|
8560
8599
|
fontSize: 14,
|
|
@@ -8570,23 +8609,23 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8570
8609
|
},
|
|
8571
8610
|
value.value
|
|
8572
8611
|
);
|
|
8573
|
-
}) : /* @__PURE__ */
|
|
8612
|
+
}) : /* @__PURE__ */ jsx23(Text_default.unknown, { children: "No values" }) })
|
|
8574
8613
|
] }),
|
|
8575
|
-
/* @__PURE__ */
|
|
8614
|
+
/* @__PURE__ */ jsx23(Div_default, {})
|
|
8576
8615
|
]
|
|
8577
8616
|
}
|
|
8578
|
-
) : /* @__PURE__ */
|
|
8617
|
+
) : /* @__PURE__ */ jsx23(Text_default.unknown, { children: "Unknown filter" }) : /* @__PURE__ */ jsx23(Loader_default.box, {})
|
|
8579
8618
|
}
|
|
8580
8619
|
)
|
|
8581
8620
|
] });
|
|
8582
8621
|
});
|
|
8583
|
-
var Table2 =
|
|
8622
|
+
var Table2 = memo23(TableComponent);
|
|
8584
8623
|
var Table_default = Table2;
|
|
8585
8624
|
|
|
8586
8625
|
// src/components/Tooltip.tsx
|
|
8587
|
-
import { memo as
|
|
8626
|
+
import { memo as memo24, useCallback as useCallback13, useRef as useRef7, useState as useState11, useEffect as useEffect12, forwardRef as forwardRef16, useImperativeHandle as useImperativeHandle3, useMemo as useMemo10 } from "react";
|
|
8588
8627
|
import styled13, { css as css3 } from "styled-components";
|
|
8589
|
-
import { jsx as
|
|
8628
|
+
import { jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
8590
8629
|
var tooltipContainerStyle = (props) => ({
|
|
8591
8630
|
top: css3`
|
|
8592
8631
|
bottom: calc(100% + ${props.gap}px + ${props.arrowSize}px);
|
|
@@ -8688,10 +8727,10 @@ var arrowStyle = (props, borderWidth) => ({
|
|
|
8688
8727
|
transform: !borderWidth && props.align === "center" ? "translateY(-50%);" : void 0
|
|
8689
8728
|
}
|
|
8690
8729
|
});
|
|
8691
|
-
var Arrow =
|
|
8730
|
+
var Arrow = memo24(function Arrow2(props) {
|
|
8692
8731
|
const theme2 = useTheme();
|
|
8693
8732
|
const { position, size } = props;
|
|
8694
|
-
const outerProps =
|
|
8733
|
+
const outerProps = useMemo10(
|
|
8695
8734
|
() => ({
|
|
8696
8735
|
...props,
|
|
8697
8736
|
color: theme2.colors.border
|
|
@@ -8699,7 +8738,7 @@ var Arrow = memo23(function Arrow2(props) {
|
|
|
8699
8738
|
[props, theme2]
|
|
8700
8739
|
);
|
|
8701
8740
|
const borderWidth = 1;
|
|
8702
|
-
return /* @__PURE__ */
|
|
8741
|
+
return /* @__PURE__ */ jsx24(
|
|
8703
8742
|
Div_default,
|
|
8704
8743
|
{
|
|
8705
8744
|
position: "absolute",
|
|
@@ -8707,7 +8746,7 @@ var Arrow = memo23(function Arrow2(props) {
|
|
|
8707
8746
|
height: 0,
|
|
8708
8747
|
border: `${size}px solid transparent`,
|
|
8709
8748
|
...arrowStyle(outerProps)[position],
|
|
8710
|
-
children: /* @__PURE__ */
|
|
8749
|
+
children: /* @__PURE__ */ jsx24(
|
|
8711
8750
|
Div_default,
|
|
8712
8751
|
{
|
|
8713
8752
|
position: "absolute",
|
|
@@ -8743,13 +8782,13 @@ var TooltipComponent = forwardRef16(function Tooltip({
|
|
|
8743
8782
|
const contentRef = useRef7(null);
|
|
8744
8783
|
const tooltipContainerRef = useRef7(null);
|
|
8745
8784
|
const closeTimerRef = useRef7(void 0);
|
|
8746
|
-
const [isOpen, setIsOpen] =
|
|
8747
|
-
const [isOpenLate, setIsOpenLate] =
|
|
8785
|
+
const [isOpen, setIsOpen] = useState11(false);
|
|
8786
|
+
const [isOpenLate, setIsOpenLate] = useState11(false);
|
|
8748
8787
|
const arrowSize = withArrow ? theme2.styles.gap : 0;
|
|
8749
8788
|
const gap = theme2.styles.gap / 2;
|
|
8750
8789
|
const outsideScreenGap = theme2.styles.gap / 2;
|
|
8751
8790
|
const totalGap = arrowSize + gap;
|
|
8752
|
-
const openTooltip =
|
|
8791
|
+
const openTooltip = useCallback13(() => {
|
|
8753
8792
|
if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
|
|
8754
8793
|
setIsOpen(true);
|
|
8755
8794
|
setIsOpenLate(true);
|
|
@@ -8773,18 +8812,18 @@ var TooltipComponent = forwardRef16(function Tooltip({
|
|
|
8773
8812
|
}, 1);
|
|
8774
8813
|
onOpen?.();
|
|
8775
8814
|
}, [onOpen, outsideScreenGap, totalGap]);
|
|
8776
|
-
const closeTooltip =
|
|
8815
|
+
const closeTooltip = useCallback13(() => {
|
|
8777
8816
|
setIsOpen(false);
|
|
8778
8817
|
closeTimerRef.current = setTimeout(() => setIsOpenLate(false), 300);
|
|
8779
8818
|
onClose?.();
|
|
8780
8819
|
}, [onClose]);
|
|
8781
|
-
const onMouseEnter =
|
|
8820
|
+
const onMouseEnter = useCallback13(() => {
|
|
8782
8821
|
if (trigger === "hover") openTooltip();
|
|
8783
8822
|
}, [trigger, openTooltip]);
|
|
8784
|
-
const onMouseLeave =
|
|
8823
|
+
const onMouseLeave = useCallback13(() => {
|
|
8785
8824
|
if (trigger === "hover") closeTooltip();
|
|
8786
8825
|
}, [trigger, closeTooltip]);
|
|
8787
|
-
const onClickHolder =
|
|
8826
|
+
const onClickHolder = useCallback13(
|
|
8788
8827
|
(event) => {
|
|
8789
8828
|
if (trigger === "click") {
|
|
8790
8829
|
if (!isOpen) openTooltip();
|
|
@@ -8793,7 +8832,7 @@ var TooltipComponent = forwardRef16(function Tooltip({
|
|
|
8793
8832
|
},
|
|
8794
8833
|
[trigger, openTooltip, isOpen, closeTooltip]
|
|
8795
8834
|
);
|
|
8796
|
-
const onClickOutside =
|
|
8835
|
+
const onClickOutside = useCallback13(
|
|
8797
8836
|
(event) => {
|
|
8798
8837
|
if (!isOpen) return;
|
|
8799
8838
|
if (trigger !== "click") return;
|
|
@@ -8803,7 +8842,7 @@ var TooltipComponent = forwardRef16(function Tooltip({
|
|
|
8803
8842
|
},
|
|
8804
8843
|
[trigger, isOpen, closeTooltip]
|
|
8805
8844
|
);
|
|
8806
|
-
|
|
8845
|
+
useEffect12(() => {
|
|
8807
8846
|
if (trigger === "click") {
|
|
8808
8847
|
document.addEventListener("mousedown", onClickOutside);
|
|
8809
8848
|
return () => {
|
|
@@ -8822,7 +8861,7 @@ var TooltipComponent = forwardRef16(function Tooltip({
|
|
|
8822
8861
|
},
|
|
8823
8862
|
[isOpen, openTooltip, closeTooltip]
|
|
8824
8863
|
);
|
|
8825
|
-
return /* @__PURE__ */
|
|
8864
|
+
return /* @__PURE__ */ jsxs20(
|
|
8826
8865
|
Div_default,
|
|
8827
8866
|
{
|
|
8828
8867
|
position: "relative",
|
|
@@ -8832,7 +8871,7 @@ var TooltipComponent = forwardRef16(function Tooltip({
|
|
|
8832
8871
|
onMouseEnter,
|
|
8833
8872
|
onMouseLeave,
|
|
8834
8873
|
children: [
|
|
8835
|
-
/* @__PURE__ */
|
|
8874
|
+
/* @__PURE__ */ jsx24(
|
|
8836
8875
|
Div_default,
|
|
8837
8876
|
{
|
|
8838
8877
|
width: childrenWrapperWidth,
|
|
@@ -8842,7 +8881,7 @@ var TooltipComponent = forwardRef16(function Tooltip({
|
|
|
8842
8881
|
children
|
|
8843
8882
|
}
|
|
8844
8883
|
),
|
|
8845
|
-
/* @__PURE__ */
|
|
8884
|
+
/* @__PURE__ */ jsx24(
|
|
8846
8885
|
TooltipContainer,
|
|
8847
8886
|
{
|
|
8848
8887
|
theme: theme2,
|
|
@@ -8854,8 +8893,8 @@ var TooltipComponent = forwardRef16(function Tooltip({
|
|
|
8854
8893
|
isOpen,
|
|
8855
8894
|
role: "tooltip",
|
|
8856
8895
|
ref: tooltipContainerRef,
|
|
8857
|
-
children: (isOpen || isOpenLate) && /* @__PURE__ */
|
|
8858
|
-
/* @__PURE__ */
|
|
8896
|
+
children: (isOpen || isOpenLate) && /* @__PURE__ */ jsxs20(Div_default, { position: "relative", ref: contentRef, children: [
|
|
8897
|
+
/* @__PURE__ */ jsx24(
|
|
8859
8898
|
Div_default.box,
|
|
8860
8899
|
{
|
|
8861
8900
|
position: "relative",
|
|
@@ -8869,7 +8908,7 @@ var TooltipComponent = forwardRef16(function Tooltip({
|
|
|
8869
8908
|
children: content
|
|
8870
8909
|
}
|
|
8871
8910
|
),
|
|
8872
|
-
/* @__PURE__ */
|
|
8911
|
+
/* @__PURE__ */ jsx24(
|
|
8873
8912
|
Div_default,
|
|
8874
8913
|
{
|
|
8875
8914
|
position: "absolute",
|
|
@@ -8883,7 +8922,7 @@ var TooltipComponent = forwardRef16(function Tooltip({
|
|
|
8883
8922
|
borderTopRightRadius: 999
|
|
8884
8923
|
}
|
|
8885
8924
|
),
|
|
8886
|
-
withArrow && /* @__PURE__ */
|
|
8925
|
+
withArrow && /* @__PURE__ */ jsx24(
|
|
8887
8926
|
Arrow,
|
|
8888
8927
|
{
|
|
8889
8928
|
position,
|
|
@@ -8915,7 +8954,7 @@ TooltipComponent.item = forwardRef16(function Item({
|
|
|
8915
8954
|
onClickWithValue
|
|
8916
8955
|
}, ref) {
|
|
8917
8956
|
const theme2 = useTheme();
|
|
8918
|
-
return /* @__PURE__ */
|
|
8957
|
+
return /* @__PURE__ */ jsxs20(
|
|
8919
8958
|
Div_default.row,
|
|
8920
8959
|
{
|
|
8921
8960
|
alignItems: "center",
|
|
@@ -8933,10 +8972,10 @@ TooltipComponent.item = forwardRef16(function Item({
|
|
|
8933
8972
|
onClickWithValue: !disabled ? onClickWithValue : void 0,
|
|
8934
8973
|
ref,
|
|
8935
8974
|
children: [
|
|
8936
|
-
icon && /* @__PURE__ */
|
|
8937
|
-
/* @__PURE__ */
|
|
8938
|
-
/* @__PURE__ */
|
|
8939
|
-
description && /* @__PURE__ */
|
|
8975
|
+
icon && /* @__PURE__ */ jsx24(Icon_default, { name: icon, color: iconColor ?? (!isActive ? theme2.colors.textSecondary : void 0) }),
|
|
8976
|
+
/* @__PURE__ */ jsxs20(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
|
|
8977
|
+
/* @__PURE__ */ jsx24(Text_default, { fontWeight: isActive ? 700 : void 0, color: textColor ?? theme2.colors.textPrimary, children: text }),
|
|
8978
|
+
description && /* @__PURE__ */ jsx24(Text_default, { fontSize: 14, color: theme2.colors.textSecondary, children: description })
|
|
8940
8979
|
] })
|
|
8941
8980
|
]
|
|
8942
8981
|
}
|
|
@@ -8944,11 +8983,11 @@ TooltipComponent.item = forwardRef16(function Item({
|
|
|
8944
8983
|
});
|
|
8945
8984
|
TooltipComponent.divider = forwardRef16(function DividerComponent(props, ref) {
|
|
8946
8985
|
const theme2 = useTheme();
|
|
8947
|
-
return /* @__PURE__ */
|
|
8986
|
+
return /* @__PURE__ */ jsx24(Divider_default.horizontal, { marginBlock: theme2.styles.gap, ...props, ref });
|
|
8948
8987
|
});
|
|
8949
8988
|
TooltipComponent.sectionTitle = forwardRef16(function SectionTitle({ text, ...props }, ref) {
|
|
8950
8989
|
const theme2 = useTheme();
|
|
8951
|
-
return /* @__PURE__ */
|
|
8990
|
+
return /* @__PURE__ */ jsx24(
|
|
8952
8991
|
Text_default,
|
|
8953
8992
|
{
|
|
8954
8993
|
fontSize: 12,
|
|
@@ -8962,15 +9001,15 @@ TooltipComponent.sectionTitle = forwardRef16(function SectionTitle({ text, ...pr
|
|
|
8962
9001
|
}
|
|
8963
9002
|
);
|
|
8964
9003
|
});
|
|
8965
|
-
var Tooltip2 =
|
|
9004
|
+
var Tooltip2 = memo24(TooltipComponent);
|
|
8966
9005
|
Tooltip2.item = TooltipComponent.item;
|
|
8967
9006
|
Tooltip2.divider = TooltipComponent.divider;
|
|
8968
9007
|
Tooltip2.sectionTitle = TooltipComponent.sectionTitle;
|
|
8969
9008
|
var Tooltip_default = Tooltip2;
|
|
8970
9009
|
|
|
8971
9010
|
// src/components/Tabs.tsx
|
|
8972
|
-
import { forwardRef as forwardRef17, memo as
|
|
8973
|
-
import { jsx as
|
|
9011
|
+
import { forwardRef as forwardRef17, memo as memo25, useCallback as useCallback14, useEffect as useEffect13, useImperativeHandle as useImperativeHandle4, useMemo as useMemo11, useRef as useRef8, useState as useState12 } from "react";
|
|
9012
|
+
import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
8974
9013
|
var tabBottomLineWidth = 2;
|
|
8975
9014
|
var tabDotSize = 6;
|
|
8976
9015
|
var defaultTabName = "tab";
|
|
@@ -8981,7 +9020,7 @@ var TabsComponent = forwardRef17(function Tabs({ tabs, name, accentColor, style
|
|
|
8981
9020
|
const { colorTheme, componentsState } = useBetterHtmlContextInternal();
|
|
8982
9021
|
const firstRenderPassedRef = useRef8(false);
|
|
8983
9022
|
const tabsRef = useRef8({});
|
|
8984
|
-
const [selectedTab, setSelectedTab] =
|
|
9023
|
+
const [selectedTab, setSelectedTab] = useState12(() => {
|
|
8985
9024
|
const selectedTabValue = tabs[0] ?? "";
|
|
8986
9025
|
if (urlQuery) {
|
|
8987
9026
|
const tabQueryValue = urlQuery.getQuery(name ?? defaultTabName);
|
|
@@ -8990,9 +9029,9 @@ var TabsComponent = forwardRef17(function Tabs({ tabs, name, accentColor, style
|
|
|
8990
9029
|
}
|
|
8991
9030
|
return selectedTabValue;
|
|
8992
9031
|
});
|
|
8993
|
-
const [rerenderState, setRerenderState] =
|
|
9032
|
+
const [rerenderState, setRerenderState] = useState12(0);
|
|
8994
9033
|
const tabsGap = style === "box" ? theme2.styles.gap / 2 : 0;
|
|
8995
|
-
const onClickTab =
|
|
9034
|
+
const onClickTab = useCallback14(
|
|
8996
9035
|
(tab) => {
|
|
8997
9036
|
setSelectedTab(tab);
|
|
8998
9037
|
onChange?.(tab);
|
|
@@ -9004,11 +9043,11 @@ var TabsComponent = forwardRef17(function Tabs({ tabs, name, accentColor, style
|
|
|
9004
9043
|
},
|
|
9005
9044
|
[onChange, name, urlQuery]
|
|
9006
9045
|
);
|
|
9007
|
-
const width =
|
|
9046
|
+
const width = useMemo11(
|
|
9008
9047
|
() => tabsRef.current[selectedTab]?.getBoundingClientRect().width ?? 0,
|
|
9009
9048
|
[rerenderState, selectedTab]
|
|
9010
9049
|
);
|
|
9011
|
-
const leftSpacing =
|
|
9050
|
+
const leftSpacing = useMemo11(() => {
|
|
9012
9051
|
const selectedTabIndex = tabs.findIndex((tab) => tab === selectedTab);
|
|
9013
9052
|
let spacing = 0;
|
|
9014
9053
|
Object.values(tabsRef.current).forEach((tab, index) => {
|
|
@@ -9016,7 +9055,7 @@ var TabsComponent = forwardRef17(function Tabs({ tabs, name, accentColor, style
|
|
|
9016
9055
|
});
|
|
9017
9056
|
return spacing;
|
|
9018
9057
|
}, [selectedTab, tabs, tabsGap]);
|
|
9019
|
-
|
|
9058
|
+
useEffect13(() => {
|
|
9020
9059
|
const timeout = setTimeout(() => {
|
|
9021
9060
|
setRerenderState(Math.random());
|
|
9022
9061
|
firstRenderPassedRef.current = true;
|
|
@@ -9025,7 +9064,7 @@ var TabsComponent = forwardRef17(function Tabs({ tabs, name, accentColor, style
|
|
|
9025
9064
|
clearTimeout(timeout);
|
|
9026
9065
|
};
|
|
9027
9066
|
}, []);
|
|
9028
|
-
|
|
9067
|
+
useEffect13(() => {
|
|
9029
9068
|
componentsState.tabs.setTabGroups((oldValue) => {
|
|
9030
9069
|
const thisTabGroup = oldValue.find((item) => item.name === (name ?? defaultTabName));
|
|
9031
9070
|
if (thisTabGroup) {
|
|
@@ -9046,13 +9085,13 @@ var TabsComponent = forwardRef17(function Tabs({ tabs, name, accentColor, style
|
|
|
9046
9085
|
}
|
|
9047
9086
|
});
|
|
9048
9087
|
}, [selectedTab, name]);
|
|
9049
|
-
|
|
9088
|
+
useEffect13(() => {
|
|
9050
9089
|
tabsRef.current[selectedTab]?.scrollIntoView({
|
|
9051
9090
|
behavior: firstRenderPassedRef.current ? "smooth" : void 0,
|
|
9052
9091
|
block: "nearest"
|
|
9053
9092
|
});
|
|
9054
9093
|
}, [selectedTab]);
|
|
9055
|
-
|
|
9094
|
+
useEffect13(() => {
|
|
9056
9095
|
return () => {
|
|
9057
9096
|
componentsState.tabs.setTabGroups(
|
|
9058
9097
|
(oldValue) => oldValue.filter((item) => item.name !== (name ?? defaultTabName))
|
|
@@ -9069,11 +9108,11 @@ var TabsComponent = forwardRef17(function Tabs({ tabs, name, accentColor, style
|
|
|
9069
9108
|
},
|
|
9070
9109
|
[selectedTab, onClickTab]
|
|
9071
9110
|
);
|
|
9072
|
-
return /* @__PURE__ */
|
|
9073
|
-
/* @__PURE__ */
|
|
9074
|
-
/* @__PURE__ */
|
|
9111
|
+
return /* @__PURE__ */ jsxs21(Div_default.column, { width: "100%", gap: theme2.styles.space, ...props, children: [
|
|
9112
|
+
/* @__PURE__ */ jsxs21(Div_default, { position: "relative", className: "react-better-html-no-scrollbar", overflowY: "auto", children: [
|
|
9113
|
+
/* @__PURE__ */ jsx25(Div_default.row, { position: "relative", width: "fit-content", gap: tabsGap, userSelect: "none", children: tabs.map((tab) => {
|
|
9075
9114
|
const selected = tab === selectedTab;
|
|
9076
|
-
return /* @__PURE__ */
|
|
9115
|
+
return /* @__PURE__ */ jsxs21(
|
|
9077
9116
|
Div_default,
|
|
9078
9117
|
{
|
|
9079
9118
|
position: "relative",
|
|
@@ -9094,7 +9133,7 @@ var TabsComponent = forwardRef17(function Tabs({ tabs, name, accentColor, style
|
|
|
9094
9133
|
tabsRef.current[tab] = ref2;
|
|
9095
9134
|
},
|
|
9096
9135
|
children: [
|
|
9097
|
-
componentsState.tabs.tabsWithDots.includes(tab) && /* @__PURE__ */
|
|
9136
|
+
componentsState.tabs.tabsWithDots.includes(tab) && /* @__PURE__ */ jsx25(
|
|
9098
9137
|
Div_default,
|
|
9099
9138
|
{
|
|
9100
9139
|
position: "absolute",
|
|
@@ -9107,7 +9146,7 @@ var TabsComponent = forwardRef17(function Tabs({ tabs, name, accentColor, style
|
|
|
9107
9146
|
transition: theme2.styles.transition
|
|
9108
9147
|
}
|
|
9109
9148
|
),
|
|
9110
|
-
/* @__PURE__ */
|
|
9149
|
+
/* @__PURE__ */ jsx25(
|
|
9111
9150
|
Text_default,
|
|
9112
9151
|
{
|
|
9113
9152
|
fontWeight: 700,
|
|
@@ -9122,7 +9161,7 @@ var TabsComponent = forwardRef17(function Tabs({ tabs, name, accentColor, style
|
|
|
9122
9161
|
tab
|
|
9123
9162
|
);
|
|
9124
9163
|
}) }),
|
|
9125
|
-
style !== "box" && /* @__PURE__ */
|
|
9164
|
+
style !== "box" && /* @__PURE__ */ jsx25(
|
|
9126
9165
|
Div_default,
|
|
9127
9166
|
{
|
|
9128
9167
|
position: "absolute",
|
|
@@ -9135,16 +9174,16 @@ var TabsComponent = forwardRef17(function Tabs({ tabs, name, accentColor, style
|
|
|
9135
9174
|
}
|
|
9136
9175
|
)
|
|
9137
9176
|
] }),
|
|
9138
|
-
children && /* @__PURE__ */
|
|
9177
|
+
children && /* @__PURE__ */ jsx25(Div_default, { width: "100%", children })
|
|
9139
9178
|
] });
|
|
9140
9179
|
});
|
|
9141
9180
|
TabsComponent.content = function Content({ tab, tabWithDot, tabsGroupName, isInitialTab, children }) {
|
|
9142
9181
|
const { componentsState } = useBetterHtmlContextInternal();
|
|
9143
|
-
const thisTabGroupData =
|
|
9182
|
+
const thisTabGroupData = useMemo11(
|
|
9144
9183
|
() => componentsState.tabs.tabGroups.find((item) => item.name === (tabsGroupName ?? defaultTabName)),
|
|
9145
9184
|
[componentsState.tabs, tabsGroupName]
|
|
9146
9185
|
);
|
|
9147
|
-
|
|
9186
|
+
useEffect13(() => {
|
|
9148
9187
|
if (tabWithDot) {
|
|
9149
9188
|
componentsState.tabs.setTabsWithDots?.((oldValue) => oldValue.includes(tab) ? oldValue : [...oldValue, tab]);
|
|
9150
9189
|
} else {
|
|
@@ -9153,22 +9192,27 @@ TabsComponent.content = function Content({ tab, tabWithDot, tabsGroupName, isIni
|
|
|
9153
9192
|
);
|
|
9154
9193
|
}
|
|
9155
9194
|
}, [tabWithDot]);
|
|
9156
|
-
return (thisTabGroupData ? thisTabGroupData.selectedTab === tab : isInitialTab) ? /* @__PURE__ */
|
|
9195
|
+
return (thisTabGroupData ? thisTabGroupData.selectedTab === tab : isInitialTab) ? /* @__PURE__ */ jsx25(Div_default, { width: "100%", children }) : void 0;
|
|
9157
9196
|
};
|
|
9158
|
-
var Tabs2 =
|
|
9197
|
+
var Tabs2 = memo25(TabsComponent);
|
|
9159
9198
|
Tabs2.content = TabsComponent.content;
|
|
9160
9199
|
var Tabs_default = Tabs2;
|
|
9161
9200
|
|
|
9162
9201
|
// src/components/Foldable.tsx
|
|
9163
|
-
import { forwardRef as forwardRef18, memo as
|
|
9164
|
-
import { jsx as
|
|
9202
|
+
import { forwardRef as forwardRef18, memo as memo26, useCallback as useCallback15, useEffect as useEffect14, useImperativeHandle as useImperativeHandle5, useRef as useRef9, useState as useState13 } from "react";
|
|
9203
|
+
import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
9165
9204
|
var animationDurationClose = 0.15;
|
|
9166
9205
|
var animationDurationOpen = animationDurationClose * 2;
|
|
9167
9206
|
var FoldableComponent = forwardRef18(function Foldable({
|
|
9168
9207
|
isOpen: controlledIsOpen,
|
|
9169
9208
|
defaultOpen = false,
|
|
9170
9209
|
title,
|
|
9210
|
+
titleAs = "h3",
|
|
9211
|
+
titleColor,
|
|
9212
|
+
titleRightElement,
|
|
9171
9213
|
description,
|
|
9214
|
+
descriptionColor,
|
|
9215
|
+
rightElement,
|
|
9172
9216
|
icon,
|
|
9173
9217
|
image,
|
|
9174
9218
|
headerPaddingBlock,
|
|
@@ -9181,21 +9225,21 @@ var FoldableComponent = forwardRef18(function Foldable({
|
|
|
9181
9225
|
const theme2 = useTheme();
|
|
9182
9226
|
const bodyRef = useRef9(null);
|
|
9183
9227
|
const [internalIsOpen, setInternalIsOpen] = useBooleanState(defaultOpen);
|
|
9184
|
-
const [bodyVirtualHeight, setBodyVirtualHeight] =
|
|
9228
|
+
const [bodyVirtualHeight, setBodyVirtualHeight] = useState13();
|
|
9185
9229
|
const isOpen = controlledIsOpen !== void 0 ? controlledIsOpen : internalIsOpen;
|
|
9186
|
-
const open =
|
|
9230
|
+
const open = useCallback15(() => {
|
|
9187
9231
|
if (controlledIsOpen === void 0) setInternalIsOpen.setTrue();
|
|
9188
9232
|
onOpenChange?.(true);
|
|
9189
9233
|
}, [controlledIsOpen, onOpenChange]);
|
|
9190
|
-
const close =
|
|
9234
|
+
const close = useCallback15(() => {
|
|
9191
9235
|
if (controlledIsOpen === void 0) setInternalIsOpen.setFalse();
|
|
9192
9236
|
onOpenChange?.(false);
|
|
9193
9237
|
}, [controlledIsOpen, onOpenChange]);
|
|
9194
|
-
const toggleOpen =
|
|
9238
|
+
const toggleOpen = useCallback15(() => {
|
|
9195
9239
|
if (controlledIsOpen === void 0) setInternalIsOpen.toggle();
|
|
9196
9240
|
onOpenChange?.(!isOpen);
|
|
9197
9241
|
}, [controlledIsOpen, isOpen, onOpenChange]);
|
|
9198
|
-
|
|
9242
|
+
useEffect14(() => {
|
|
9199
9243
|
if (!bodyRef.current) return;
|
|
9200
9244
|
const body = bodyRef.current;
|
|
9201
9245
|
setBodyVirtualHeight(body.scrollHeight * 2);
|
|
@@ -9206,7 +9250,7 @@ var FoldableComponent = forwardRef18(function Foldable({
|
|
|
9206
9250
|
clearTimeout(timeout);
|
|
9207
9251
|
};
|
|
9208
9252
|
}, [isOpen]);
|
|
9209
|
-
|
|
9253
|
+
useEffect14(() => {
|
|
9210
9254
|
if (!isOpen) return;
|
|
9211
9255
|
if (!bodyRef.current) return;
|
|
9212
9256
|
const observer = new ResizeObserver(() => {
|
|
@@ -9230,28 +9274,41 @@ var FoldableComponent = forwardRef18(function Foldable({
|
|
|
9230
9274
|
},
|
|
9231
9275
|
[open, close, toggleOpen, isOpen]
|
|
9232
9276
|
);
|
|
9233
|
-
return /* @__PURE__ */
|
|
9234
|
-
renderHeader ? renderHeader(isOpen, toggleOpen) : /* @__PURE__ */
|
|
9277
|
+
return /* @__PURE__ */ jsxs22(Div_default.column, { width: "100%", ...props, children: [
|
|
9278
|
+
renderHeader ? renderHeader(isOpen, toggleOpen) : /* @__PURE__ */ jsxs22(
|
|
9235
9279
|
Div_default.row,
|
|
9236
9280
|
{
|
|
9237
9281
|
width: "100%",
|
|
9238
9282
|
alignItems: "center",
|
|
9239
|
-
gap: theme2.styles.
|
|
9283
|
+
gap: theme2.styles.space,
|
|
9240
9284
|
paddingBlock: headerPaddingBlock ?? theme2.styles.gap,
|
|
9241
9285
|
paddingInline: headerPaddingInline,
|
|
9242
9286
|
cursor: "pointer",
|
|
9243
9287
|
onClick: toggleOpen,
|
|
9244
9288
|
userSelect: "none",
|
|
9245
9289
|
children: [
|
|
9246
|
-
/* @__PURE__ */
|
|
9247
|
-
icon && /* @__PURE__ */
|
|
9248
|
-
image && /* @__PURE__ */
|
|
9249
|
-
/* @__PURE__ */
|
|
9250
|
-
title && /* @__PURE__ */
|
|
9251
|
-
|
|
9290
|
+
/* @__PURE__ */ jsxs22(Div_default.row, { flex: 1, alignItems: "center", gap: theme2.styles.space, children: [
|
|
9291
|
+
icon && /* @__PURE__ */ jsx26(Icon_default, { name: icon, size: 20, flexShrink: 0 }),
|
|
9292
|
+
image && /* @__PURE__ */ jsx26(Image_default.profileImage, { name: image, size: 24, flexShrink: 0 }),
|
|
9293
|
+
/* @__PURE__ */ jsxs22(Div_default.column, { gap: theme2.styles.gap / 2, children: [
|
|
9294
|
+
title && /* @__PURE__ */ jsxs22(Div_default.row, { alignItems: "center", gap: theme2.styles.space, children: [
|
|
9295
|
+
/* @__PURE__ */ jsx26(
|
|
9296
|
+
Text_default,
|
|
9297
|
+
{
|
|
9298
|
+
as: titleAs,
|
|
9299
|
+
fontWeight: 700,
|
|
9300
|
+
lineHeight: "20px",
|
|
9301
|
+
color: titleColor ?? theme2.colors.textPrimary,
|
|
9302
|
+
children: title
|
|
9303
|
+
}
|
|
9304
|
+
),
|
|
9305
|
+
titleRightElement
|
|
9306
|
+
] }),
|
|
9307
|
+
description && /* @__PURE__ */ jsx26(Text_default, { color: descriptionColor ?? theme2.colors.textSecondary, children: description })
|
|
9252
9308
|
] })
|
|
9253
9309
|
] }),
|
|
9254
|
-
|
|
9310
|
+
rightElement,
|
|
9311
|
+
/* @__PURE__ */ jsx26(
|
|
9255
9312
|
Icon_default,
|
|
9256
9313
|
{
|
|
9257
9314
|
name: "chevronDown",
|
|
@@ -9262,8 +9319,8 @@ var FoldableComponent = forwardRef18(function Foldable({
|
|
|
9262
9319
|
]
|
|
9263
9320
|
}
|
|
9264
9321
|
),
|
|
9265
|
-
/* @__PURE__ */
|
|
9266
|
-
/* @__PURE__ */
|
|
9322
|
+
/* @__PURE__ */ jsx26(Div_default, { height: isOpen ? 1 : 0, opacity: isOpen ? 1 : 0, transition: theme2.styles.transition, children: /* @__PURE__ */ jsx26(Divider_default.horizontal, {}) }),
|
|
9323
|
+
/* @__PURE__ */ jsx26(
|
|
9267
9324
|
Div_default,
|
|
9268
9325
|
{
|
|
9269
9326
|
maxHeight: isOpen ? bodyVirtualHeight : 0,
|
|
@@ -9272,14 +9329,14 @@ var FoldableComponent = forwardRef18(function Foldable({
|
|
|
9272
9329
|
overflow: !isOpen ? "hidden" : void 0,
|
|
9273
9330
|
pointerEvents: !isOpen ? "none" : void 0,
|
|
9274
9331
|
ref: bodyRef,
|
|
9275
|
-
children: /* @__PURE__ */
|
|
9332
|
+
children: /* @__PURE__ */ jsx26(Div_default, { paddingBlock: theme2.styles.gap, paddingInline: headerPaddingInline, children })
|
|
9276
9333
|
}
|
|
9277
9334
|
)
|
|
9278
9335
|
] });
|
|
9279
9336
|
});
|
|
9280
9337
|
FoldableComponent.box = forwardRef18(function Box3({ ...props }, ref) {
|
|
9281
9338
|
const theme2 = useTheme();
|
|
9282
|
-
return /* @__PURE__ */
|
|
9339
|
+
return /* @__PURE__ */ jsx26(
|
|
9283
9340
|
FoldableComponent,
|
|
9284
9341
|
{
|
|
9285
9342
|
backgroundColor: theme2.colors.backgroundContent,
|
|
@@ -9292,14 +9349,14 @@ FoldableComponent.box = forwardRef18(function Box3({ ...props }, ref) {
|
|
|
9292
9349
|
}
|
|
9293
9350
|
);
|
|
9294
9351
|
});
|
|
9295
|
-
var Foldable2 =
|
|
9352
|
+
var Foldable2 = memo26(FoldableComponent);
|
|
9296
9353
|
Foldable2.box = FoldableComponent.box;
|
|
9297
9354
|
var Foldable_default = Foldable2;
|
|
9298
9355
|
|
|
9299
9356
|
// src/components/SideMenu.tsx
|
|
9300
|
-
import { memo as
|
|
9301
|
-
import { jsx as
|
|
9302
|
-
var MenuItemComponent =
|
|
9357
|
+
import { memo as memo27, useCallback as useCallback16, useEffect as useEffect15, useMemo as useMemo12 } from "react";
|
|
9358
|
+
import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
9359
|
+
var MenuItemComponent = memo27(function MenuItemComponent2({ item, backgroundColor, onClick }) {
|
|
9303
9360
|
const reactRouterDomPlugin2 = usePlugin("react-router-dom");
|
|
9304
9361
|
if (!reactRouterDomPlugin2) {
|
|
9305
9362
|
throw new Error(
|
|
@@ -9312,7 +9369,7 @@ var MenuItemComponent = memo26(function MenuItemComponent2({ item, backgroundCol
|
|
|
9312
9369
|
const location = reactRouterDomPluginConfig.useLocation();
|
|
9313
9370
|
const { colorTheme, components, sideMenuIsCollapsed } = useBetterHtmlContextInternal();
|
|
9314
9371
|
const [isOpened, setIsOpened] = useBooleanState();
|
|
9315
|
-
const onClickElement =
|
|
9372
|
+
const onClickElement = useCallback16(() => {
|
|
9316
9373
|
if (item.disabled) return;
|
|
9317
9374
|
if (item.onClickCloseSideMenu !== false) onClick?.();
|
|
9318
9375
|
item.onClick?.(item);
|
|
@@ -9327,7 +9384,7 @@ var MenuItemComponent = memo26(function MenuItemComponent2({ item, backgroundCol
|
|
|
9327
9384
|
const lineHeight = 20;
|
|
9328
9385
|
const lineWidth = 2;
|
|
9329
9386
|
const lineEndRadius = iconSize / 2 + iconGap * 2;
|
|
9330
|
-
const content = /* @__PURE__ */
|
|
9387
|
+
const content = /* @__PURE__ */ jsxs23(
|
|
9331
9388
|
Div_default.row,
|
|
9332
9389
|
{
|
|
9333
9390
|
alignItems: "center",
|
|
@@ -9344,8 +9401,8 @@ var MenuItemComponent = memo26(function MenuItemComponent2({ item, backgroundCol
|
|
|
9344
9401
|
opacity: item.disabled ? 0.6 : void 0,
|
|
9345
9402
|
onClick: item.children ? setIsOpened.toggle : onClickElement,
|
|
9346
9403
|
children: [
|
|
9347
|
-
/* @__PURE__ */
|
|
9348
|
-
/* @__PURE__ */
|
|
9404
|
+
/* @__PURE__ */ jsx27(Icon_default, { name: item.iconName, color: theme2.colors.primary, size: iconSize, flexShrink: 0 }),
|
|
9405
|
+
/* @__PURE__ */ jsx27(
|
|
9349
9406
|
Text_default,
|
|
9350
9407
|
{
|
|
9351
9408
|
flex: 1,
|
|
@@ -9356,7 +9413,7 @@ var MenuItemComponent = memo26(function MenuItemComponent2({ item, backgroundCol
|
|
|
9356
9413
|
children: item.text
|
|
9357
9414
|
}
|
|
9358
9415
|
),
|
|
9359
|
-
item.children && /* @__PURE__ */
|
|
9416
|
+
item.children && /* @__PURE__ */ jsx27(
|
|
9360
9417
|
Icon_default,
|
|
9361
9418
|
{
|
|
9362
9419
|
name: "chevronDown",
|
|
@@ -9369,7 +9426,7 @@ var MenuItemComponent = memo26(function MenuItemComponent2({ item, backgroundCol
|
|
|
9369
9426
|
]
|
|
9370
9427
|
}
|
|
9371
9428
|
);
|
|
9372
|
-
|
|
9429
|
+
useEffect15(() => {
|
|
9373
9430
|
if (!item.children) return;
|
|
9374
9431
|
const toBeOpened = item.children.some(
|
|
9375
9432
|
(child) => child.href ? location.pathname === "/" ? location.pathname === child.href : location.pathname.startsWith(child.href) && child.href !== "/" : false
|
|
@@ -9377,9 +9434,9 @@ var MenuItemComponent = memo26(function MenuItemComponent2({ item, backgroundCol
|
|
|
9377
9434
|
setIsOpened.setState(toBeOpened);
|
|
9378
9435
|
}, [item]);
|
|
9379
9436
|
const LinkComponentTag = components.button?.tagReplacement?.linkComponent ?? "a";
|
|
9380
|
-
return /* @__PURE__ */
|
|
9381
|
-
item.href ? /* @__PURE__ */
|
|
9382
|
-
item.children && /* @__PURE__ */
|
|
9437
|
+
return /* @__PURE__ */ jsxs23(Div_default, { width: "100%", children: [
|
|
9438
|
+
item.href ? /* @__PURE__ */ jsx27(LinkComponentTag, { to: item.href, href: item.href, onClick: onClickElement, children: content }) : content,
|
|
9439
|
+
item.children && /* @__PURE__ */ jsxs23(
|
|
9383
9440
|
Div_default.column,
|
|
9384
9441
|
{
|
|
9385
9442
|
position: "relative",
|
|
@@ -9390,7 +9447,7 @@ var MenuItemComponent = memo26(function MenuItemComponent2({ item, backgroundCol
|
|
|
9390
9447
|
overflow: "hidden",
|
|
9391
9448
|
transition: `max-height ${theme2.styles.transition}, margin-top ${theme2.styles.transition}`,
|
|
9392
9449
|
children: [
|
|
9393
|
-
item.children.map((child) => /* @__PURE__ */
|
|
9450
|
+
item.children.map((child) => /* @__PURE__ */ jsx27(
|
|
9394
9451
|
MenuItemComponent2,
|
|
9395
9452
|
{
|
|
9396
9453
|
item: child,
|
|
@@ -9399,7 +9456,7 @@ var MenuItemComponent = memo26(function MenuItemComponent2({ item, backgroundCol
|
|
|
9399
9456
|
},
|
|
9400
9457
|
child.text
|
|
9401
9458
|
)),
|
|
9402
|
-
/* @__PURE__ */
|
|
9459
|
+
/* @__PURE__ */ jsxs23(
|
|
9403
9460
|
Div_default,
|
|
9404
9461
|
{
|
|
9405
9462
|
position: "absolute",
|
|
@@ -9408,7 +9465,7 @@ var MenuItemComponent = memo26(function MenuItemComponent2({ item, backgroundCol
|
|
|
9408
9465
|
left: paddingLeft + iconSize / 2,
|
|
9409
9466
|
zIndex: -1,
|
|
9410
9467
|
children: [
|
|
9411
|
-
/* @__PURE__ */
|
|
9468
|
+
/* @__PURE__ */ jsx27(
|
|
9412
9469
|
Div_default,
|
|
9413
9470
|
{
|
|
9414
9471
|
position: "relative",
|
|
@@ -9418,7 +9475,7 @@ var MenuItemComponent = memo26(function MenuItemComponent2({ item, backgroundCol
|
|
|
9418
9475
|
zIndex: 1
|
|
9419
9476
|
}
|
|
9420
9477
|
),
|
|
9421
|
-
/* @__PURE__ */
|
|
9478
|
+
/* @__PURE__ */ jsx27(
|
|
9422
9479
|
Div_default,
|
|
9423
9480
|
{
|
|
9424
9481
|
position: "absolute",
|
|
@@ -9458,11 +9515,11 @@ var SideMenuComponent = function SideMenu({
|
|
|
9458
9515
|
const theme2 = useTheme();
|
|
9459
9516
|
const mediaQuery = useMediaQuery();
|
|
9460
9517
|
const { components, sideMenuIsCollapsed, setSideMenuIsCollapsed, sideMenuIsOpenMobile, setSideMenuIsOpenMobile } = useBetterHtmlContextInternal();
|
|
9461
|
-
const onClickXButton =
|
|
9518
|
+
const onClickXButton = useCallback16(() => {
|
|
9462
9519
|
setSideMenuIsOpenMobile.setFalse();
|
|
9463
9520
|
}, []);
|
|
9464
|
-
const readyItems =
|
|
9465
|
-
const readyBottomItems =
|
|
9521
|
+
const readyItems = useMemo12(() => items.filter((item) => !item.hidden), [items]);
|
|
9522
|
+
const readyBottomItems = useMemo12(() => bottomItems?.filter((item) => !item.hidden), [bottomItems]);
|
|
9466
9523
|
const isCollapsable = collapsable && !mediaQuery.size1000;
|
|
9467
9524
|
const isCollapsed = sideMenuIsCollapsed && !mediaQuery.size1000;
|
|
9468
9525
|
const LinkComponentTag = components.button?.tagReplacement?.linkComponent ?? "a";
|
|
@@ -9470,7 +9527,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9470
9527
|
const sideMenuCollapsedWidth = theme2.styles.space + theme2.styles.space * 2 + 16 + theme2.styles.space;
|
|
9471
9528
|
const readyBackgroundColor = backgroundColor ?? theme2.colors.backgroundContent;
|
|
9472
9529
|
const logoSize = sideMenuCollapsedWidth - theme2.styles.space * 2;
|
|
9473
|
-
return /* @__PURE__ */
|
|
9530
|
+
return /* @__PURE__ */ jsxs23(
|
|
9474
9531
|
Div_default.column,
|
|
9475
9532
|
{
|
|
9476
9533
|
position: "fixed",
|
|
@@ -9486,9 +9543,9 @@ var SideMenuComponent = function SideMenu({
|
|
|
9486
9543
|
userSelect: "none",
|
|
9487
9544
|
zIndex: 10,
|
|
9488
9545
|
children: [
|
|
9489
|
-
/* @__PURE__ */
|
|
9490
|
-
(logoAssetName || logoUrl || withCloseButton && mediaQuery.size1000) && /* @__PURE__ */
|
|
9491
|
-
(logoAssetName || logoUrl) && /* @__PURE__ */
|
|
9546
|
+
/* @__PURE__ */ jsxs23(Div_default.column, { width: "100%", height: "100%", gap: theme2.styles.space, children: [
|
|
9547
|
+
(logoAssetName || logoUrl || withCloseButton && mediaQuery.size1000) && /* @__PURE__ */ jsxs23(Div_default.row, { alignItems: "center", paddingInline: theme2.styles.space, children: [
|
|
9548
|
+
(logoAssetName || logoUrl) && /* @__PURE__ */ jsx27(LinkComponentTag, { to: "/", href: "/", onClick: onClickXButton, children: /* @__PURE__ */ jsxs23(
|
|
9492
9549
|
Div_default.row,
|
|
9493
9550
|
{
|
|
9494
9551
|
alignItems: "center",
|
|
@@ -9497,7 +9554,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9497
9554
|
whiteSpace: "nowrap",
|
|
9498
9555
|
gap: theme2.styles.gap,
|
|
9499
9556
|
children: [
|
|
9500
|
-
/* @__PURE__ */
|
|
9557
|
+
/* @__PURE__ */ jsx27(
|
|
9501
9558
|
Image_default,
|
|
9502
9559
|
{
|
|
9503
9560
|
name: logoAssetName,
|
|
@@ -9507,7 +9564,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9507
9564
|
objectFit: "contain"
|
|
9508
9565
|
}
|
|
9509
9566
|
),
|
|
9510
|
-
logoText && /* @__PURE__ */
|
|
9567
|
+
logoText && /* @__PURE__ */ jsx27(
|
|
9511
9568
|
Text_default,
|
|
9512
9569
|
{
|
|
9513
9570
|
fontFamily: logoFontFamily,
|
|
@@ -9522,9 +9579,9 @@ var SideMenuComponent = function SideMenu({
|
|
|
9522
9579
|
]
|
|
9523
9580
|
}
|
|
9524
9581
|
) }),
|
|
9525
|
-
withCloseButton && mediaQuery.size1000 && /* @__PURE__ */
|
|
9582
|
+
withCloseButton && mediaQuery.size1000 && /* @__PURE__ */ jsx27(Button_default.icon, { icon: "XMark", marginLeft: "auto", onClick: onClickXButton })
|
|
9526
9583
|
] }),
|
|
9527
|
-
/* @__PURE__ */
|
|
9584
|
+
/* @__PURE__ */ jsx27(
|
|
9528
9585
|
Div_default.column,
|
|
9529
9586
|
{
|
|
9530
9587
|
width: "100%",
|
|
@@ -9532,7 +9589,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9532
9589
|
overflowY: "auto",
|
|
9533
9590
|
paddingInline: theme2.styles.space,
|
|
9534
9591
|
paddingBottom: !isCollapsable && !readyBottomItems ? theme2.styles.space : void 0,
|
|
9535
|
-
children: /* @__PURE__ */
|
|
9592
|
+
children: /* @__PURE__ */ jsx27(Div_default.column, { gap: theme2.styles.gap / 2, children: readyItems.map((item) => /* @__PURE__ */ jsx27(
|
|
9536
9593
|
MenuItemComponent,
|
|
9537
9594
|
{
|
|
9538
9595
|
item,
|
|
@@ -9543,7 +9600,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9543
9600
|
)) })
|
|
9544
9601
|
}
|
|
9545
9602
|
),
|
|
9546
|
-
readyBottomItems && /* @__PURE__ */
|
|
9603
|
+
readyBottomItems && /* @__PURE__ */ jsx27(
|
|
9547
9604
|
Div_default.column,
|
|
9548
9605
|
{
|
|
9549
9606
|
borderTop: mediaQuery.size1000 ? `solid 1px ${theme2.colors.border}` : void 0,
|
|
@@ -9552,7 +9609,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9552
9609
|
paddingTop: mediaQuery.size1000 ? theme2.styles.space : void 0,
|
|
9553
9610
|
paddingInline: theme2.styles.space,
|
|
9554
9611
|
paddingBottom: !isCollapsable ? theme2.styles.space : void 0,
|
|
9555
|
-
children: readyBottomItems.map((item) => /* @__PURE__ */
|
|
9612
|
+
children: readyBottomItems.map((item) => /* @__PURE__ */ jsx27(
|
|
9556
9613
|
MenuItemComponent,
|
|
9557
9614
|
{
|
|
9558
9615
|
item,
|
|
@@ -9563,14 +9620,14 @@ var SideMenuComponent = function SideMenu({
|
|
|
9563
9620
|
))
|
|
9564
9621
|
}
|
|
9565
9622
|
),
|
|
9566
|
-
isCollapsable && /* @__PURE__ */
|
|
9623
|
+
isCollapsable && /* @__PURE__ */ jsx27(
|
|
9567
9624
|
Div_default,
|
|
9568
9625
|
{
|
|
9569
9626
|
borderTop: `solid 1px ${theme2.colors.border}`,
|
|
9570
9627
|
marginTop: !readyBottomItems ? "auto" : void 0,
|
|
9571
9628
|
paddingInline: theme2.styles.space,
|
|
9572
9629
|
paddingBlock: theme2.styles.space,
|
|
9573
|
-
children: /* @__PURE__ */
|
|
9630
|
+
children: /* @__PURE__ */ jsx27(
|
|
9574
9631
|
Div_default.row,
|
|
9575
9632
|
{
|
|
9576
9633
|
alignItems: "center",
|
|
@@ -9582,7 +9639,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9582
9639
|
isTabAccessed: true,
|
|
9583
9640
|
paddingBlock: theme2.styles.gap,
|
|
9584
9641
|
onClick: setSideMenuIsCollapsed.toggle,
|
|
9585
|
-
children: /* @__PURE__ */
|
|
9642
|
+
children: /* @__PURE__ */ jsx27(
|
|
9586
9643
|
Icon_default,
|
|
9587
9644
|
{
|
|
9588
9645
|
name: "chevronRight",
|
|
@@ -9597,7 +9654,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9597
9654
|
}
|
|
9598
9655
|
)
|
|
9599
9656
|
] }),
|
|
9600
|
-
widthMobileHandle && /* @__PURE__ */
|
|
9657
|
+
widthMobileHandle && /* @__PURE__ */ jsx27(
|
|
9601
9658
|
Div_default.row,
|
|
9602
9659
|
{
|
|
9603
9660
|
position: "absolute",
|
|
@@ -9617,7 +9674,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9617
9674
|
transform: !mediaQuery.size1000 ? "translateX(-100%)" : void 0,
|
|
9618
9675
|
transition: theme2.styles.transition,
|
|
9619
9676
|
onClick: setSideMenuIsOpenMobile.toggle,
|
|
9620
|
-
children: /* @__PURE__ */
|
|
9677
|
+
children: /* @__PURE__ */ jsx27(
|
|
9621
9678
|
Icon_default,
|
|
9622
9679
|
{
|
|
9623
9680
|
name: "chevronRight",
|
|
@@ -9639,7 +9696,7 @@ SideMenuComponent.pageHolder = function SideMenuPageHolder({ outsideComponent, .
|
|
|
9639
9696
|
const { components, sideMenuIsCollapsed } = useBetterHtmlContextInternal();
|
|
9640
9697
|
const sideMenuWidth = components.sideMenu?.width ?? defaultSideMenuWidth;
|
|
9641
9698
|
const sideMenuCollapsedWidth = theme2.styles.space + theme2.styles.space * 2 + 16 + theme2.styles.space;
|
|
9642
|
-
return /* @__PURE__ */
|
|
9699
|
+
return /* @__PURE__ */ jsxs23(
|
|
9643
9700
|
Div_default,
|
|
9644
9701
|
{
|
|
9645
9702
|
position: "relative",
|
|
@@ -9648,7 +9705,7 @@ SideMenuComponent.pageHolder = function SideMenuPageHolder({ outsideComponent, .
|
|
|
9648
9705
|
transition: theme2.styles.transition,
|
|
9649
9706
|
children: [
|
|
9650
9707
|
outsideComponent,
|
|
9651
|
-
/* @__PURE__ */
|
|
9708
|
+
/* @__PURE__ */ jsx27(PageHolder_default, { ...props })
|
|
9652
9709
|
]
|
|
9653
9710
|
}
|
|
9654
9711
|
);
|
|
@@ -9658,7 +9715,7 @@ SideMenuComponent.burgerButton = function BurgerButton() {
|
|
|
9658
9715
|
const { sideMenuIsOpenMobile, setSideMenuIsOpenMobile } = useBetterHtmlContextInternal();
|
|
9659
9716
|
const [isHovered, setIsHovered] = useBooleanState();
|
|
9660
9717
|
const width = 2;
|
|
9661
|
-
return /* @__PURE__ */
|
|
9718
|
+
return /* @__PURE__ */ jsxs23(
|
|
9662
9719
|
Div_default,
|
|
9663
9720
|
{
|
|
9664
9721
|
position: "relative",
|
|
@@ -9670,7 +9727,7 @@ SideMenuComponent.burgerButton = function BurgerButton() {
|
|
|
9670
9727
|
onMouseOut: setIsHovered.setFalse,
|
|
9671
9728
|
onClick: setSideMenuIsOpenMobile.toggle,
|
|
9672
9729
|
children: [
|
|
9673
|
-
/* @__PURE__ */
|
|
9730
|
+
/* @__PURE__ */ jsx27(
|
|
9674
9731
|
Div_default,
|
|
9675
9732
|
{
|
|
9676
9733
|
position: "absolute",
|
|
@@ -9684,7 +9741,7 @@ SideMenuComponent.burgerButton = function BurgerButton() {
|
|
|
9684
9741
|
transition: theme2.styles.transition
|
|
9685
9742
|
}
|
|
9686
9743
|
),
|
|
9687
|
-
/* @__PURE__ */
|
|
9744
|
+
/* @__PURE__ */ jsx27(
|
|
9688
9745
|
Div_default,
|
|
9689
9746
|
{
|
|
9690
9747
|
position: "absolute",
|
|
@@ -9699,7 +9756,7 @@ SideMenuComponent.burgerButton = function BurgerButton() {
|
|
|
9699
9756
|
transition: theme2.styles.transition
|
|
9700
9757
|
}
|
|
9701
9758
|
),
|
|
9702
|
-
/* @__PURE__ */
|
|
9759
|
+
/* @__PURE__ */ jsx27(
|
|
9703
9760
|
Div_default,
|
|
9704
9761
|
{
|
|
9705
9762
|
position: "absolute",
|
|
@@ -9717,7 +9774,7 @@ SideMenuComponent.burgerButton = function BurgerButton() {
|
|
|
9717
9774
|
}
|
|
9718
9775
|
);
|
|
9719
9776
|
};
|
|
9720
|
-
var SideMenu2 =
|
|
9777
|
+
var SideMenu2 = memo27(SideMenuComponent);
|
|
9721
9778
|
SideMenu2.pageHolder = SideMenuComponent.pageHolder;
|
|
9722
9779
|
SideMenu2.burgerButton = SideMenuComponent.burgerButton;
|
|
9723
9780
|
var SideMenu_default = SideMenu2;
|
|
@@ -9805,6 +9862,7 @@ export {
|
|
|
9805
9862
|
Modal_default as Modal,
|
|
9806
9863
|
PageHeader_default as PageHeader,
|
|
9807
9864
|
PageHolder_default as PageHolder,
|
|
9865
|
+
Pagination_default as Pagination,
|
|
9808
9866
|
SideMenu_default as SideMenu,
|
|
9809
9867
|
Table_default as Table,
|
|
9810
9868
|
Tabs_default as Tabs,
|