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.js
CHANGED
|
@@ -48,6 +48,7 @@ __export(index_exports, {
|
|
|
48
48
|
Modal: () => Modal_default,
|
|
49
49
|
PageHeader: () => PageHeader_default,
|
|
50
50
|
PageHolder: () => PageHolder_default,
|
|
51
|
+
Pagination: () => Pagination_default,
|
|
51
52
|
SideMenu: () => SideMenu_default,
|
|
52
53
|
Table: () => Table_default,
|
|
53
54
|
Tabs: () => Tabs_default,
|
|
@@ -105,7 +106,6 @@ var isMobileDevice = /Mobi|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Op
|
|
|
105
106
|
|
|
106
107
|
// src/utils/hooks.ts
|
|
107
108
|
var import_react10 = require("react");
|
|
108
|
-
var import_react_router_dom2 = require("react-router-dom");
|
|
109
109
|
|
|
110
110
|
// src/constants/css.ts
|
|
111
111
|
var cssProps = {
|
|
@@ -1649,7 +1649,8 @@ var defaultReactRouterDomPluginOptions = {
|
|
|
1649
1649
|
useNavigate: import_react_router_dom.useNavigate,
|
|
1650
1650
|
useLocation: import_react_router_dom.useLocation,
|
|
1651
1651
|
useInRouterContext: import_react_router_dom.useInRouterContext,
|
|
1652
|
-
useSearchParams: import_react_router_dom.useSearchParams
|
|
1652
|
+
useSearchParams: import_react_router_dom.useSearchParams,
|
|
1653
|
+
createSearchParams: import_react_router_dom.createSearchParams
|
|
1653
1654
|
};
|
|
1654
1655
|
var reactRouterDomPlugin = (options) => ({
|
|
1655
1656
|
name: "react-router-dom",
|
|
@@ -3209,6 +3210,7 @@ function useUrlQuery() {
|
|
|
3209
3210
|
}
|
|
3210
3211
|
const navigate = reactRouterDomPluginConfig.useNavigate();
|
|
3211
3212
|
const [searchParams] = reactRouterDomPluginConfig.useSearchParams();
|
|
3213
|
+
const createSearchParams2 = reactRouterDomPluginConfig.createSearchParams;
|
|
3212
3214
|
const setQuery = (0, import_react10.useCallback)(
|
|
3213
3215
|
(query, keepHistory = true) => {
|
|
3214
3216
|
const currentSearchParams = {};
|
|
@@ -3217,7 +3219,7 @@ function useUrlQuery() {
|
|
|
3217
3219
|
});
|
|
3218
3220
|
navigate(
|
|
3219
3221
|
{
|
|
3220
|
-
search: (
|
|
3222
|
+
search: createSearchParams2({
|
|
3221
3223
|
...currentSearchParams,
|
|
3222
3224
|
...Object.fromEntries(Object.entries(query).map(([key, value]) => [key, value.toString()]))
|
|
3223
3225
|
}).toString()
|
|
@@ -3290,7 +3292,7 @@ var PageHeaderComponent = (0, import_react12.forwardRef)(function PageHeader({
|
|
|
3290
3292
|
imageUrl,
|
|
3291
3293
|
imageSize = 60,
|
|
3292
3294
|
title,
|
|
3293
|
-
titleAs,
|
|
3295
|
+
titleAs = "h1",
|
|
3294
3296
|
titleColor,
|
|
3295
3297
|
titleRightElement,
|
|
3296
3298
|
description,
|
|
@@ -3329,7 +3331,7 @@ var PageHeaderComponent = (0, import_react12.forwardRef)(function PageHeader({
|
|
|
3329
3331
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3330
3332
|
Text_default,
|
|
3331
3333
|
{
|
|
3332
|
-
as: titleAs
|
|
3334
|
+
as: titleAs,
|
|
3333
3335
|
textAlign,
|
|
3334
3336
|
color: titleColor ?? (lightMode ? theme2.colors.base : theme2.colors.textPrimary),
|
|
3335
3337
|
children: title
|
|
@@ -7799,9 +7801,124 @@ ColorThemeSwitch2.withText = ColorThemeSwitchComponent.withText;
|
|
|
7799
7801
|
var ColorThemeSwitch_default = ColorThemeSwitch2;
|
|
7800
7802
|
|
|
7801
7803
|
// src/components/Table.tsx
|
|
7802
|
-
var
|
|
7804
|
+
var import_react26 = require("react");
|
|
7803
7805
|
var import_styled_components13 = __toESM(require("styled-components"));
|
|
7806
|
+
|
|
7807
|
+
// src/components/Pagination.tsx
|
|
7808
|
+
var import_react25 = require("react");
|
|
7804
7809
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
7810
|
+
var PaginationComponent = function Pagination({
|
|
7811
|
+
currentPage = 1,
|
|
7812
|
+
itemsLength = 0,
|
|
7813
|
+
itemsPerPage,
|
|
7814
|
+
pageCount,
|
|
7815
|
+
maximumVisiblePages: maximumVisiblePages2 = 11,
|
|
7816
|
+
onClickPreviousPage,
|
|
7817
|
+
onClickNextPage,
|
|
7818
|
+
onChangePage
|
|
7819
|
+
}) {
|
|
7820
|
+
const theme2 = useTheme();
|
|
7821
|
+
const mediaQuery = useMediaQuery();
|
|
7822
|
+
const [currentPageInternal, setCurrentPage] = (0, import_react25.useState)(currentPage);
|
|
7823
|
+
const pageCountInternal = pageCount ?? (itemsPerPage !== void 0 ? Math.ceil(itemsLength / itemsPerPage) : 1);
|
|
7824
|
+
const onClickPreviousPageElement = (0, import_react25.useCallback)(() => {
|
|
7825
|
+
const newPage = currentPageInternal <= 1 ? 1 : currentPageInternal - 1;
|
|
7826
|
+
setCurrentPage(newPage);
|
|
7827
|
+
onClickPreviousPage?.(newPage);
|
|
7828
|
+
}, [currentPageInternal, onClickPreviousPage]);
|
|
7829
|
+
const onClickNextPageElement = (0, import_react25.useCallback)(() => {
|
|
7830
|
+
const newPage = currentPageInternal >= pageCountInternal ? pageCountInternal : currentPageInternal + 1;
|
|
7831
|
+
setCurrentPage(newPage);
|
|
7832
|
+
onClickNextPage?.(newPage);
|
|
7833
|
+
}, [currentPageInternal, pageCountInternal, onClickNextPage]);
|
|
7834
|
+
const paginationItems = (0, import_react25.useMemo)(() => {
|
|
7835
|
+
const halfRange = Math.floor(maximumVisiblePages2 / 2);
|
|
7836
|
+
let startPage = Math.max(1, currentPageInternal - halfRange);
|
|
7837
|
+
let endPage = Math.min(pageCountInternal, currentPageInternal + halfRange);
|
|
7838
|
+
if (endPage - startPage + 1 < maximumVisiblePages2) {
|
|
7839
|
+
startPage = Math.max(1, endPage - maximumVisiblePages2 + 1);
|
|
7840
|
+
endPage = Math.min(pageCountInternal, startPage + maximumVisiblePages2 - 1);
|
|
7841
|
+
}
|
|
7842
|
+
return Array.from(
|
|
7843
|
+
{
|
|
7844
|
+
length: endPage - startPage + 1
|
|
7845
|
+
},
|
|
7846
|
+
(_, index) => startPage + index
|
|
7847
|
+
);
|
|
7848
|
+
}, [pageCountInternal, currentPageInternal]);
|
|
7849
|
+
(0, import_react25.useEffect)(() => {
|
|
7850
|
+
onChangePage?.(currentPageInternal);
|
|
7851
|
+
}, [currentPageInternal, onChangePage]);
|
|
7852
|
+
(0, import_react25.useEffect)(() => {
|
|
7853
|
+
setCurrentPage(currentPage);
|
|
7854
|
+
}, [currentPage]);
|
|
7855
|
+
const mobileFooterBreakingPoint = mediaQuery.size700 && pageCountInternal > maximumVisiblePages2 / 1.4;
|
|
7856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Div_default.row, { alignItems: "center", justifyContent: "center", gap: theme2.styles.gap * 2, children: [
|
|
7857
|
+
pageCountInternal > maximumVisiblePages2 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
7858
|
+
Button_default.icon,
|
|
7859
|
+
{
|
|
7860
|
+
icon: "doubleChevronLeft",
|
|
7861
|
+
disabled: currentPageInternal === 1,
|
|
7862
|
+
value: 1,
|
|
7863
|
+
onClickWithValue: setCurrentPage
|
|
7864
|
+
}
|
|
7865
|
+
),
|
|
7866
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Button_default.icon, { icon: "chevronLeft", disabled: currentPageInternal === 1, onClick: onClickPreviousPageElement }),
|
|
7867
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
7868
|
+
Div_default.row,
|
|
7869
|
+
{
|
|
7870
|
+
alignItems: "center",
|
|
7871
|
+
justifyContent: "center",
|
|
7872
|
+
flexWrap: mobileFooterBreakingPoint ? "wrap" : void 0,
|
|
7873
|
+
gap: theme2.styles.gap,
|
|
7874
|
+
children: paginationItems.map((pageIndex) => {
|
|
7875
|
+
const isActive = currentPageInternal === pageIndex;
|
|
7876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
7877
|
+
Div_default,
|
|
7878
|
+
{
|
|
7879
|
+
cursor: "pointer",
|
|
7880
|
+
userSelect: "none",
|
|
7881
|
+
value: pageIndex,
|
|
7882
|
+
onClickWithValue: setCurrentPage,
|
|
7883
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
7884
|
+
Text_default,
|
|
7885
|
+
{
|
|
7886
|
+
fontWeight: isActive ? 700 : 400,
|
|
7887
|
+
color: isActive ? theme2.colors.primary : theme2.colors.textSecondary,
|
|
7888
|
+
transition: theme2.styles.transition,
|
|
7889
|
+
children: pageIndex
|
|
7890
|
+
}
|
|
7891
|
+
)
|
|
7892
|
+
},
|
|
7893
|
+
pageIndex
|
|
7894
|
+
);
|
|
7895
|
+
})
|
|
7896
|
+
}
|
|
7897
|
+
),
|
|
7898
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
7899
|
+
Button_default.icon,
|
|
7900
|
+
{
|
|
7901
|
+
icon: "chevronRight",
|
|
7902
|
+
disabled: currentPageInternal === pageCountInternal,
|
|
7903
|
+
onClick: onClickNextPageElement
|
|
7904
|
+
}
|
|
7905
|
+
),
|
|
7906
|
+
pageCountInternal > maximumVisiblePages2 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
7907
|
+
Button_default.icon,
|
|
7908
|
+
{
|
|
7909
|
+
icon: "doubleChevronRight",
|
|
7910
|
+
disabled: currentPageInternal === pageCountInternal,
|
|
7911
|
+
onClickWithValue: setCurrentPage,
|
|
7912
|
+
value: pageCountInternal
|
|
7913
|
+
}
|
|
7914
|
+
)
|
|
7915
|
+
] });
|
|
7916
|
+
};
|
|
7917
|
+
var Pagination2 = (0, import_react25.memo)(PaginationComponent);
|
|
7918
|
+
var Pagination_default = Pagination2;
|
|
7919
|
+
|
|
7920
|
+
// src/components/Table.tsx
|
|
7921
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
7805
7922
|
var defaultImageWidth = 160;
|
|
7806
7923
|
var maximumVisiblePages = 11;
|
|
7807
7924
|
var TableStyledComponent = import_styled_components13.default.table.withConfig({
|
|
@@ -7946,7 +8063,7 @@ var filterPresetsText = {
|
|
|
7946
8063
|
nextMonth: "Next month",
|
|
7947
8064
|
nextYear: "Next year"
|
|
7948
8065
|
};
|
|
7949
|
-
var TableComponent = (0,
|
|
8066
|
+
var TableComponent = (0, import_react26.forwardRef)(function Table({
|
|
7950
8067
|
name,
|
|
7951
8068
|
columns,
|
|
7952
8069
|
data,
|
|
@@ -7972,14 +8089,14 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
7972
8089
|
const theme2 = useTheme();
|
|
7973
8090
|
const mediaQuery = useMediaQuery();
|
|
7974
8091
|
const { colorTheme } = useBetterHtmlContextInternal();
|
|
7975
|
-
const filterModalRef = (0,
|
|
7976
|
-
const readyColumns = (0,
|
|
7977
|
-
const columnsRef = (0,
|
|
8092
|
+
const filterModalRef = (0, import_react26.useRef)(null);
|
|
8093
|
+
const readyColumns = (0, import_react26.useMemo)(() => columns.filter((column) => !column.hidden), [columns]);
|
|
8094
|
+
const columnsRef = (0, import_react26.useRef)(readyColumns);
|
|
7978
8095
|
columnsRef.current = readyColumns;
|
|
7979
|
-
const [checkedItems, setCheckedItems] = (0,
|
|
7980
|
-
const [expandedRows, setExpandedRows] = (0,
|
|
7981
|
-
const [currentPage, setCurrentPage] = (0,
|
|
7982
|
-
const [filterData, setFilterData] = (0,
|
|
8096
|
+
const [checkedItems, setCheckedItems] = (0, import_react26.useState)([]);
|
|
8097
|
+
const [expandedRows, setExpandedRows] = (0, import_react26.useState)([]);
|
|
8098
|
+
const [currentPage, setCurrentPage] = (0, import_react26.useState)(1);
|
|
8099
|
+
const [filterData, setFilterData] = (0, import_react26.useState)(() => {
|
|
7983
8100
|
if (!memoizeFilters || !name) return {};
|
|
7984
8101
|
const localStorageData = JSON.parse(localStorage.getItem(`react-better-html-table-filters-${name}`) || "{}");
|
|
7985
8102
|
const timestamp = localStorageData.timestamp;
|
|
@@ -7988,8 +8105,8 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
7988
8105
|
if (timeDiff > memoizeFiltersLifespan) return {};
|
|
7989
8106
|
return data2;
|
|
7990
8107
|
});
|
|
7991
|
-
const [openedFilterColumnIndex, setOpenedFilterColumnIndex] = (0,
|
|
7992
|
-
const [filterListSelectedItems, setFilterListSelectedItems] = (0,
|
|
8108
|
+
const [openedFilterColumnIndex, setOpenedFilterColumnIndex] = (0, import_react26.useState)();
|
|
8109
|
+
const [filterListSelectedItems, setFilterListSelectedItems] = (0, import_react26.useState)();
|
|
7993
8110
|
const openedFilterData = openedFilterColumnIndex !== void 0 ? filterData[openedFilterColumnIndex] : void 0;
|
|
7994
8111
|
const openedFilterColumn = openedFilterColumnIndex !== void 0 ? readyColumns[openedFilterColumnIndex] : void 0;
|
|
7995
8112
|
const filterForm = useForm({
|
|
@@ -8019,26 +8136,26 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8019
8136
|
filterModalRef.current?.close();
|
|
8020
8137
|
}
|
|
8021
8138
|
});
|
|
8022
|
-
const expandColumn = (0,
|
|
8023
|
-
const renderCellContent = (0,
|
|
8139
|
+
const expandColumn = (0, import_react26.useMemo)(() => readyColumns.find((column) => column.type === "expand"), [readyColumns]);
|
|
8140
|
+
const renderCellContent = (0, import_react26.useCallback)(
|
|
8024
8141
|
(column, item, itemIndex) => {
|
|
8025
8142
|
switch (column.type) {
|
|
8026
8143
|
case "text": {
|
|
8027
8144
|
const value = column.keyName ? item[column.keyName] : void 0;
|
|
8028
8145
|
const textProps = (typeof column.getTextProps === "function" ? column.getTextProps?.(item, itemIndex) : column.getTextProps) ?? {};
|
|
8029
|
-
return /* @__PURE__ */ (0,
|
|
8146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text_default, { ...textProps, children: column.format?.(item, itemIndex) ?? String(value ?? "") });
|
|
8030
8147
|
}
|
|
8031
8148
|
case "element": {
|
|
8032
|
-
return column.render?.(item, itemIndex) ?? /* @__PURE__ */ (0,
|
|
8149
|
+
return column.render?.(item, itemIndex) ?? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, {});
|
|
8033
8150
|
}
|
|
8034
8151
|
case "image": {
|
|
8035
8152
|
const imageProps = (typeof column.getImageProps === "function" ? column.getImageProps?.(item, itemIndex) : column.getImageProps) ?? {};
|
|
8036
|
-
return /* @__PURE__ */ (0,
|
|
8153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Image_default, { width: "100%", borderRadius: theme2.styles.borderRadius / 2, ...imageProps });
|
|
8037
8154
|
}
|
|
8038
8155
|
case "checkbox": {
|
|
8039
8156
|
const { onChange, ...toggleInputProps } = (typeof column.getToggleInputProps === "function" ? column.getToggleInputProps?.(item, itemIndex) : column.getToggleInputProps) ?? {};
|
|
8040
8157
|
const checkedValue = checkedItems[itemIndex];
|
|
8041
|
-
return /* @__PURE__ */ (0,
|
|
8158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
8042
8159
|
ToggleInput_default.checkbox,
|
|
8043
8160
|
{
|
|
8044
8161
|
checked: checkedValue,
|
|
@@ -8059,7 +8176,7 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8059
8176
|
);
|
|
8060
8177
|
}
|
|
8061
8178
|
case "expand": {
|
|
8062
|
-
return /* @__PURE__ */ (0,
|
|
8179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Div_default, { isTabAccessed: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
8063
8180
|
Icon_default,
|
|
8064
8181
|
{
|
|
8065
8182
|
name: "chevronDown",
|
|
@@ -8069,13 +8186,13 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8069
8186
|
) });
|
|
8070
8187
|
}
|
|
8071
8188
|
default: {
|
|
8072
|
-
return /* @__PURE__ */ (0,
|
|
8189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, {});
|
|
8073
8190
|
}
|
|
8074
8191
|
}
|
|
8075
8192
|
},
|
|
8076
8193
|
[theme2, checkedItems, expandedRows]
|
|
8077
8194
|
);
|
|
8078
|
-
const onClickRowElement = (0,
|
|
8195
|
+
const onClickRowElement = (0, import_react26.useCallback)(
|
|
8079
8196
|
(item, index) => {
|
|
8080
8197
|
if (expandColumn) {
|
|
8081
8198
|
setExpandedRows((oldValue) => {
|
|
@@ -8092,14 +8209,14 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8092
8209
|
},
|
|
8093
8210
|
[onClickRow, expandColumn]
|
|
8094
8211
|
);
|
|
8095
|
-
const onClickAllCheckboxesElement = (0,
|
|
8212
|
+
const onClickAllCheckboxesElement = (0, import_react26.useCallback)(
|
|
8096
8213
|
(checked) => {
|
|
8097
8214
|
onClickAllCheckboxes?.(checked);
|
|
8098
8215
|
setCheckedItems(data.map(() => checked));
|
|
8099
8216
|
},
|
|
8100
8217
|
[onClickAllCheckboxes, data]
|
|
8101
8218
|
);
|
|
8102
|
-
const onClickFilterButton = (0,
|
|
8219
|
+
const onClickFilterButton = (0, import_react26.useCallback)(
|
|
8103
8220
|
(columnIndex) => {
|
|
8104
8221
|
const thisFilterData = filterData[columnIndex];
|
|
8105
8222
|
if (thisFilterData?.type === "number" || thisFilterData?.type === "date" || thisFilterData?.type === "date-time") {
|
|
@@ -8115,12 +8232,12 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8115
8232
|
},
|
|
8116
8233
|
[filterData]
|
|
8117
8234
|
);
|
|
8118
|
-
const onCloseFilterModal = (0,
|
|
8235
|
+
const onCloseFilterModal = (0, import_react26.useCallback)(() => {
|
|
8119
8236
|
setTimeout(() => setOpenedFilterColumnIndex(void 0), 0.2 * 1e3);
|
|
8120
8237
|
setFilterListSelectedItems(void 0);
|
|
8121
8238
|
filterForm.reset();
|
|
8122
8239
|
}, []);
|
|
8123
|
-
const onClickCancelFormFilter = (0,
|
|
8240
|
+
const onClickCancelFormFilter = (0, import_react26.useCallback)(() => {
|
|
8124
8241
|
if (openedFilterColumnIndex === void 0) return;
|
|
8125
8242
|
setFilterData(
|
|
8126
8243
|
(oldValue) => Object.entries({
|
|
@@ -8133,7 +8250,7 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8133
8250
|
);
|
|
8134
8251
|
filterModalRef.current?.close();
|
|
8135
8252
|
}, [openedFilterColumnIndex]);
|
|
8136
|
-
const onClickFilterListItem = (0,
|
|
8253
|
+
const onClickFilterListItem = (0, import_react26.useCallback)(
|
|
8137
8254
|
(value) => setFilterListSelectedItems((oldValue) => {
|
|
8138
8255
|
if (!oldValue) return [value];
|
|
8139
8256
|
if (oldValue.includes(value)) return oldValue.filter((item) => item !== value);
|
|
@@ -8141,7 +8258,7 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8141
8258
|
}),
|
|
8142
8259
|
[]
|
|
8143
8260
|
);
|
|
8144
|
-
const onClickFilterPreset = (0,
|
|
8261
|
+
const onClickFilterPreset = (0, import_react26.useCallback)(
|
|
8145
8262
|
(preset) => {
|
|
8146
8263
|
const getValueForDate = (date) => {
|
|
8147
8264
|
if (openedFilterColumn?.filter === "date") return date.toISOString().split("T")[0];
|
|
@@ -8226,7 +8343,7 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8226
8343
|
},
|
|
8227
8344
|
[openedFilterColumn]
|
|
8228
8345
|
);
|
|
8229
|
-
const renderExpandedRow = (0,
|
|
8346
|
+
const renderExpandedRow = (0, import_react26.useCallback)(
|
|
8230
8347
|
(...props2) => {
|
|
8231
8348
|
const expandColumn2 = readyColumns.find((column) => column.type === "expand");
|
|
8232
8349
|
if (!expandColumn2) return;
|
|
@@ -8234,7 +8351,7 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8234
8351
|
},
|
|
8235
8352
|
[readyColumns]
|
|
8236
8353
|
);
|
|
8237
|
-
const dataAfterFilter = (0,
|
|
8354
|
+
const dataAfterFilter = (0, import_react26.useMemo)(
|
|
8238
8355
|
() => data.filter(
|
|
8239
8356
|
(item) => Object.entries(filterData).every(([columnIndex, filter]) => {
|
|
8240
8357
|
if (!filter) return true;
|
|
@@ -8263,17 +8380,17 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8263
8380
|
),
|
|
8264
8381
|
[data, filterData]
|
|
8265
8382
|
);
|
|
8266
|
-
const dataAfterPagination = (0,
|
|
8383
|
+
const dataAfterPagination = (0, import_react26.useMemo)(() => {
|
|
8267
8384
|
if (pageSize === void 0) return dataAfterFilter;
|
|
8268
8385
|
if (pageCount !== void 0) return dataAfterFilter;
|
|
8269
8386
|
const pageStartItemIndex = (currentPage - 1) * (pageSize ?? 0);
|
|
8270
8387
|
const pageEndItemIndex = pageStartItemIndex + (pageSize ?? 0);
|
|
8271
8388
|
return dataAfterFilter.slice(pageStartItemIndex, pageEndItemIndex);
|
|
8272
8389
|
}, [dataAfterFilter, pageSize, currentPage, pageCount]);
|
|
8273
|
-
const everythingIsChecked = (0,
|
|
8390
|
+
const everythingIsChecked = (0, import_react26.useMemo)(() => {
|
|
8274
8391
|
return data.length > 0 && checkedItems.every((checked) => checked) && checkedItems.length === data.length;
|
|
8275
8392
|
}, [data, checkedItems]);
|
|
8276
|
-
const possibleFilterListValues = (0,
|
|
8393
|
+
const possibleFilterListValues = (0, import_react26.useMemo)(() => {
|
|
8277
8394
|
if (!openedFilterColumn) return [];
|
|
8278
8395
|
return data.reduce((previousValue, currentValue) => {
|
|
8279
8396
|
const valueFromList = openedFilterColumn.filter === "list" && openedFilterColumn.getValueForList ? openedFilterColumn.getValueForList(currentValue) : void 0;
|
|
@@ -8302,39 +8419,18 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8302
8419
|
}, []);
|
|
8303
8420
|
}, [data, openedFilterColumn, filterForm.values.search]);
|
|
8304
8421
|
const pageCountInternal = pageCount ?? (pageSize !== void 0 ? Math.ceil(dataAfterFilter.length / pageSize) : 1);
|
|
8305
|
-
const
|
|
8306
|
-
const halfRange = Math.floor(maximumVisiblePages / 2);
|
|
8307
|
-
let startPage = Math.max(1, currentPage - halfRange);
|
|
8308
|
-
let endPage = Math.min(pageCountInternal, currentPage + halfRange);
|
|
8309
|
-
if (endPage - startPage + 1 < maximumVisiblePages) {
|
|
8310
|
-
startPage = Math.max(1, endPage - maximumVisiblePages + 1);
|
|
8311
|
-
endPage = Math.min(pageCountInternal, startPage + maximumVisiblePages - 1);
|
|
8312
|
-
}
|
|
8313
|
-
return Array.from(
|
|
8314
|
-
{
|
|
8315
|
-
length: endPage - startPage + 1
|
|
8316
|
-
},
|
|
8317
|
-
(_, index) => startPage + index
|
|
8318
|
-
);
|
|
8319
|
-
}, [pageCountInternal, currentPage]);
|
|
8320
|
-
const onClickNextPage = (0, import_react25.useCallback)(() => {
|
|
8321
|
-
setCurrentPage((oldValue) => oldValue >= pageCountInternal ? pageCountInternal : oldValue + 1);
|
|
8322
|
-
}, [pageCountInternal]);
|
|
8323
|
-
const onClickPreviousPage = (0, import_react25.useCallback)(() => {
|
|
8324
|
-
setCurrentPage((oldValue) => oldValue <= 1 ? 1 : oldValue - 1);
|
|
8325
|
-
}, []);
|
|
8326
|
-
const onClickSelectAllFilterListItems = (0, import_react25.useCallback)(
|
|
8422
|
+
const onClickSelectAllFilterListItems = (0, import_react26.useCallback)(
|
|
8327
8423
|
() => setFilterListSelectedItems(possibleFilterListValues.map((item) => item.value)),
|
|
8328
8424
|
[possibleFilterListValues]
|
|
8329
8425
|
);
|
|
8330
|
-
const onClickDeselectAllFilterListItems = (0,
|
|
8331
|
-
(0,
|
|
8426
|
+
const onClickDeselectAllFilterListItems = (0, import_react26.useCallback)(() => setFilterListSelectedItems([]), []);
|
|
8427
|
+
(0, import_react26.useEffect)(() => {
|
|
8332
8428
|
onChangePage?.(currentPage);
|
|
8333
8429
|
}, [onChangePage, currentPage]);
|
|
8334
|
-
(0,
|
|
8430
|
+
(0, import_react26.useEffect)(() => {
|
|
8335
8431
|
onChangeFilter?.(filterData);
|
|
8336
8432
|
}, [onChangeFilter, filterData]);
|
|
8337
|
-
(0,
|
|
8433
|
+
(0, import_react26.useEffect)(() => {
|
|
8338
8434
|
if (!memoizeFilters) return;
|
|
8339
8435
|
if (!name) return;
|
|
8340
8436
|
localStorage.setItem(
|
|
@@ -8345,10 +8441,10 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8345
8441
|
})
|
|
8346
8442
|
);
|
|
8347
8443
|
}, [memoizeFilters, name, filterData]);
|
|
8348
|
-
(0,
|
|
8444
|
+
(0, import_react26.useEffect)(() => {
|
|
8349
8445
|
onChangeFilterDataValue?.(dataAfterFilter);
|
|
8350
8446
|
}, [onChangeFilterDataValue, dataAfterFilter]);
|
|
8351
|
-
(0,
|
|
8447
|
+
(0, import_react26.useImperativeHandle)(
|
|
8352
8448
|
ref,
|
|
8353
8449
|
() => {
|
|
8354
8450
|
return {
|
|
@@ -8362,8 +8458,8 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8362
8458
|
);
|
|
8363
8459
|
const withFooter = pageSize !== void 0 && pageCountInternal > 1;
|
|
8364
8460
|
const mobileFooterBreakingPoint = mediaQuery.size700 && pageCountInternal > maximumVisiblePages / 1.4;
|
|
8365
|
-
return /* @__PURE__ */ (0,
|
|
8366
|
-
/* @__PURE__ */ (0,
|
|
8461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
8462
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
8367
8463
|
Div_default,
|
|
8368
8464
|
{
|
|
8369
8465
|
border: `1px solid ${theme2.colors.border}`,
|
|
@@ -8371,7 +8467,7 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8371
8467
|
overflow: !containsOverflowComponents ? "auto" : void 0,
|
|
8372
8468
|
...props,
|
|
8373
8469
|
ref: wrapperComponentRef,
|
|
8374
|
-
children: /* @__PURE__ */ (0,
|
|
8470
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
8375
8471
|
TableStyledComponent,
|
|
8376
8472
|
{
|
|
8377
8473
|
isStriped,
|
|
@@ -8382,14 +8478,14 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8382
8478
|
containsOverflowComponents,
|
|
8383
8479
|
withFooter,
|
|
8384
8480
|
children: [
|
|
8385
|
-
/* @__PURE__ */ (0,
|
|
8481
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("tr", { className: "isHeader", children: readyColumns.map((column, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
8386
8482
|
ThStyledComponent,
|
|
8387
8483
|
{
|
|
8388
8484
|
width: column.width ?? (column.type === "image" ? defaultImageWidth : column.type === "checkbox" ? 26 : column.type === "expand" ? 16 : void 0),
|
|
8389
8485
|
minWidth: column.minWidth,
|
|
8390
8486
|
maxWidth: column.maxWidth,
|
|
8391
8487
|
textAlign: column.align,
|
|
8392
|
-
children: /* @__PURE__ */ (0,
|
|
8488
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
8393
8489
|
Div_default.row,
|
|
8394
8490
|
{
|
|
8395
8491
|
width: "100%",
|
|
@@ -8397,15 +8493,15 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8397
8493
|
justifyContent: column.filter ? "space-between" : column.align === "center" ? "center" : column.align === "right" ? "flex-end" : "flex-start",
|
|
8398
8494
|
gap: theme2.styles.gap,
|
|
8399
8495
|
children: [
|
|
8400
|
-
column.type === "checkbox" && onClickAllCheckboxes ? /* @__PURE__ */ (0,
|
|
8496
|
+
column.type === "checkbox" && onClickAllCheckboxes ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
8401
8497
|
ToggleInput_default.checkbox,
|
|
8402
8498
|
{
|
|
8403
8499
|
checked: everythingIsChecked,
|
|
8404
8500
|
disabled: data.length === 0,
|
|
8405
8501
|
onChange: onClickAllCheckboxesElement
|
|
8406
8502
|
}
|
|
8407
|
-
) : column.label ? column.renderLabel ? column.renderLabel(column.label) : /* @__PURE__ */ (0,
|
|
8408
|
-
column.filter && /* @__PURE__ */ (0,
|
|
8503
|
+
) : column.label ? column.renderLabel ? column.renderLabel(column.label) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text_default, { children: column.label }) : void 0,
|
|
8504
|
+
column.filter && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
8409
8505
|
Button_default.icon,
|
|
8410
8506
|
{
|
|
8411
8507
|
icon: "filter",
|
|
@@ -8420,14 +8516,14 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8420
8516
|
},
|
|
8421
8517
|
column.type + column.label + index
|
|
8422
8518
|
)) }) }),
|
|
8423
|
-
/* @__PURE__ */ (0,
|
|
8424
|
-
/* @__PURE__ */ (0,
|
|
8519
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("tbody", { children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("tr", { className: "withoutHover", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("td", { className: "noData", colSpan: readyColumns.length, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Loader_default.box, {}) }) }) : dataAfterPagination.length > 0 ? dataAfterPagination.map((item, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react26.Fragment, { children: [
|
|
8520
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
8425
8521
|
"tr",
|
|
8426
8522
|
{
|
|
8427
8523
|
className: isInsideTableExpandRow && onClickRow === void 0 && expandColumn === void 0 ? "withoutHover" : void 0,
|
|
8428
8524
|
style: getRowStyle?.(item, rowIndex),
|
|
8429
8525
|
onClick: () => onClickRowElement(item, rowIndex),
|
|
8430
|
-
children: readyColumns.map((column, colIndex) => /* @__PURE__ */ (0,
|
|
8526
|
+
children: readyColumns.map((column, colIndex) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
8431
8527
|
TdStyledComponent,
|
|
8432
8528
|
{
|
|
8433
8529
|
textAlign: column.align,
|
|
@@ -8440,9 +8536,9 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8440
8536
|
))
|
|
8441
8537
|
}
|
|
8442
8538
|
),
|
|
8443
|
-
expandedRows[rowIndex] && /* @__PURE__ */ (0,
|
|
8444
|
-
] }, JSON.stringify(item) + rowIndex)) : /* @__PURE__ */ (0,
|
|
8445
|
-
withFooter && /* @__PURE__ */ (0,
|
|
8539
|
+
expandedRows[rowIndex] && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("tr", { className: "withoutHover isExpandRow", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("td", { colSpan: readyColumns.length, children: renderExpandedRow(item, rowIndex) }) })
|
|
8540
|
+
] }, JSON.stringify(item) + rowIndex)) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("tr", { className: "withoutHover", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("td", { className: "noData", colSpan: readyColumns.length, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text_default.unknown, { children: noDataItemsMessage }) }) }) }),
|
|
8541
|
+
withFooter && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("tfoot", { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("tr", { className: "isFooter", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("td", { colSpan: readyColumns.length, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
8446
8542
|
Div_default.column,
|
|
8447
8543
|
{
|
|
8448
8544
|
position: "relative",
|
|
@@ -8451,7 +8547,7 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8451
8547
|
flexReverse: true,
|
|
8452
8548
|
gap: theme2.styles.gap / 2,
|
|
8453
8549
|
children: [
|
|
8454
|
-
/* @__PURE__ */ (0,
|
|
8550
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
8455
8551
|
Text_default,
|
|
8456
8552
|
{
|
|
8457
8553
|
position: mobileFooterBreakingPoint ? "relative" : "absolute",
|
|
@@ -8466,73 +8562,17 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8466
8562
|
]
|
|
8467
8563
|
}
|
|
8468
8564
|
),
|
|
8469
|
-
/* @__PURE__ */ (0,
|
|
8470
|
-
|
|
8471
|
-
|
|
8472
|
-
|
|
8473
|
-
|
|
8474
|
-
|
|
8475
|
-
|
|
8476
|
-
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
|
|
8480
|
-
Button_default.icon,
|
|
8481
|
-
{
|
|
8482
|
-
icon: "chevronLeft",
|
|
8483
|
-
disabled: currentPage === 1,
|
|
8484
|
-
onClick: onClickPreviousPage
|
|
8485
|
-
}
|
|
8486
|
-
),
|
|
8487
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
8488
|
-
Div_default.row,
|
|
8489
|
-
{
|
|
8490
|
-
alignItems: "center",
|
|
8491
|
-
justifyContent: "center",
|
|
8492
|
-
flexWrap: mobileFooterBreakingPoint ? "wrap" : void 0,
|
|
8493
|
-
gap: theme2.styles.gap,
|
|
8494
|
-
children: paginationItems.map((pageIndex) => {
|
|
8495
|
-
const isActive = currentPage === pageIndex;
|
|
8496
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
8497
|
-
Div_default,
|
|
8498
|
-
{
|
|
8499
|
-
cursor: "pointer",
|
|
8500
|
-
userSelect: "none",
|
|
8501
|
-
value: pageIndex,
|
|
8502
|
-
onClickWithValue: setCurrentPage,
|
|
8503
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
8504
|
-
Text_default,
|
|
8505
|
-
{
|
|
8506
|
-
fontWeight: isActive ? 700 : 400,
|
|
8507
|
-
color: isActive ? theme2.colors.primary : theme2.colors.textSecondary,
|
|
8508
|
-
transition: theme2.styles.transition,
|
|
8509
|
-
children: pageIndex
|
|
8510
|
-
}
|
|
8511
|
-
)
|
|
8512
|
-
},
|
|
8513
|
-
pageIndex
|
|
8514
|
-
);
|
|
8515
|
-
})
|
|
8516
|
-
}
|
|
8517
|
-
),
|
|
8518
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
8519
|
-
Button_default.icon,
|
|
8520
|
-
{
|
|
8521
|
-
icon: "chevronRight",
|
|
8522
|
-
disabled: currentPage === pageCountInternal,
|
|
8523
|
-
onClick: onClickNextPage
|
|
8524
|
-
}
|
|
8525
|
-
),
|
|
8526
|
-
pageCountInternal > maximumVisiblePages && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
8527
|
-
Button_default.icon,
|
|
8528
|
-
{
|
|
8529
|
-
icon: "doubleChevronRight",
|
|
8530
|
-
disabled: currentPage === pageCountInternal,
|
|
8531
|
-
onClickWithValue: setCurrentPage,
|
|
8532
|
-
value: pageCountInternal
|
|
8533
|
-
}
|
|
8534
|
-
)
|
|
8535
|
-
] })
|
|
8565
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
8566
|
+
Pagination_default,
|
|
8567
|
+
{
|
|
8568
|
+
currentPage,
|
|
8569
|
+
itemsLength: dataAfterFilter.length,
|
|
8570
|
+
itemsPerPage: pageSize,
|
|
8571
|
+
pageCount,
|
|
8572
|
+
maximumVisiblePages,
|
|
8573
|
+
onChangePage: setCurrentPage
|
|
8574
|
+
}
|
|
8575
|
+
)
|
|
8536
8576
|
]
|
|
8537
8577
|
}
|
|
8538
8578
|
) }) }) })
|
|
@@ -8541,26 +8581,26 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8541
8581
|
)
|
|
8542
8582
|
}
|
|
8543
8583
|
),
|
|
8544
|
-
/* @__PURE__ */ (0,
|
|
8584
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
8545
8585
|
Modal_default,
|
|
8546
8586
|
{
|
|
8547
8587
|
title: `Filter ${openedFilterColumn?.label ?? ""}`,
|
|
8548
8588
|
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" : "",
|
|
8549
8589
|
onClose: onCloseFilterModal,
|
|
8550
8590
|
ref: filterModalRef,
|
|
8551
|
-
children: openedFilterColumn ? openedFilterColumn.filter === "number" ? /* @__PURE__ */ (0,
|
|
8591
|
+
children: openedFilterColumn ? openedFilterColumn.filter === "number" ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
8552
8592
|
Form_default,
|
|
8553
8593
|
{
|
|
8554
8594
|
form: filterForm,
|
|
8555
8595
|
submitButtonText: "Filter",
|
|
8556
8596
|
cancelButtonText: "Clear",
|
|
8557
8597
|
onClickCancel: openedFilterData ? onClickCancelFormFilter : void 0,
|
|
8558
|
-
children: /* @__PURE__ */ (0,
|
|
8559
|
-
/* @__PURE__ */ (0,
|
|
8560
|
-
/* @__PURE__ */ (0,
|
|
8598
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(FormRow_default, { children: [
|
|
8599
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(InputField_default, { type: "number", label: "Min", ...filterForm.getInputFieldProps("min") }),
|
|
8600
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(InputField_default, { type: "number", label: "Max", ...filterForm.getInputFieldProps("max") })
|
|
8561
8601
|
] })
|
|
8562
8602
|
}
|
|
8563
|
-
) : openedFilterColumn.filter === "date" || openedFilterColumn.filter === "date-time" ? /* @__PURE__ */ (0,
|
|
8603
|
+
) : openedFilterColumn.filter === "date" || openedFilterColumn.filter === "date-time" ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
8564
8604
|
Form_default,
|
|
8565
8605
|
{
|
|
8566
8606
|
form: filterForm,
|
|
@@ -8569,16 +8609,16 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8569
8609
|
cancelButtonText: "Clear",
|
|
8570
8610
|
onClickCancel: openedFilterData ? onClickCancelFormFilter : void 0,
|
|
8571
8611
|
children: [
|
|
8572
|
-
/* @__PURE__ */ (0,
|
|
8573
|
-
/* @__PURE__ */ (0,
|
|
8574
|
-
/* @__PURE__ */ (0,
|
|
8575
|
-
] }) : /* @__PURE__ */ (0,
|
|
8576
|
-
/* @__PURE__ */ (0,
|
|
8577
|
-
/* @__PURE__ */ (0,
|
|
8612
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormRow_default, { children: openedFilterColumn.filter === "date" ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
8613
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(InputField_default.date, { label: "Min", ...filterForm.getInputFieldProps("min") }),
|
|
8614
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(InputField_default.date, { label: "Max", ...filterForm.getInputFieldProps("max") })
|
|
8615
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
8616
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(InputField_default.dateTime, { label: "Min", ...filterForm.getInputFieldProps("min") }),
|
|
8617
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(InputField_default.dateTime, { label: "Max", ...filterForm.getInputFieldProps("max") })
|
|
8578
8618
|
] }) }),
|
|
8579
|
-
openedFilterColumn.presets && /* @__PURE__ */ (0,
|
|
8580
|
-
/* @__PURE__ */ (0,
|
|
8581
|
-
/* @__PURE__ */ (0,
|
|
8619
|
+
openedFilterColumn.presets && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Div_default.column, { gap: theme2.styles.gap / 2, children: [
|
|
8620
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Label_default, { text: "Presets" }),
|
|
8621
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Div_default.row, { alignItems: "center", flexWrap: "wrap", gap: theme2.styles.gap, children: openedFilterColumn.presets.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
8582
8622
|
Button_default.secondary,
|
|
8583
8623
|
{
|
|
8584
8624
|
text: filterPresetsText[preset],
|
|
@@ -8591,14 +8631,14 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8591
8631
|
] })
|
|
8592
8632
|
]
|
|
8593
8633
|
}
|
|
8594
|
-
) : openedFilterColumn.filter === "list" ? /* @__PURE__ */ (0,
|
|
8634
|
+
) : openedFilterColumn.filter === "list" ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
8595
8635
|
Form_default,
|
|
8596
8636
|
{
|
|
8597
8637
|
gap: theme2.styles.space,
|
|
8598
8638
|
submitButtonText: "Filter",
|
|
8599
8639
|
cancelButtonText: "Clear",
|
|
8600
|
-
renderActionButtons: /* @__PURE__ */ (0,
|
|
8601
|
-
/* @__PURE__ */ (0,
|
|
8640
|
+
renderActionButtons: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Div_default.row, { marginRight: "auto", alignItems: "center", gap: theme2.styles.gap, children: [
|
|
8641
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
8602
8642
|
Button_default.secondary,
|
|
8603
8643
|
{
|
|
8604
8644
|
text: "Select All",
|
|
@@ -8607,7 +8647,7 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8607
8647
|
onClick: onClickSelectAllFilterListItems
|
|
8608
8648
|
}
|
|
8609
8649
|
),
|
|
8610
|
-
/* @__PURE__ */ (0,
|
|
8650
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
8611
8651
|
Button_default.secondary,
|
|
8612
8652
|
{
|
|
8613
8653
|
text: "Deselect All",
|
|
@@ -8620,7 +8660,7 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8620
8660
|
onClickCancel: openedFilterData ? onClickCancelFormFilter : void 0,
|
|
8621
8661
|
onSubmit: filterForm.onSubmit,
|
|
8622
8662
|
children: [
|
|
8623
|
-
openedFilterColumn?.withSearch && /* @__PURE__ */ (0,
|
|
8663
|
+
openedFilterColumn?.withSearch && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FormRow_default, { oneItemOnly: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
8624
8664
|
InputField_default.search,
|
|
8625
8665
|
{
|
|
8626
8666
|
label: "Search",
|
|
@@ -8628,19 +8668,19 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8628
8668
|
...filterForm.getInputFieldProps("search")
|
|
8629
8669
|
}
|
|
8630
8670
|
) }),
|
|
8631
|
-
/* @__PURE__ */ (0,
|
|
8632
|
-
/* @__PURE__ */ (0,
|
|
8633
|
-
/* @__PURE__ */ (0,
|
|
8671
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Div_default.column, { gap: theme2.styles.gap / 2, children: [
|
|
8672
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Label_default, { text: "Possible values" }),
|
|
8673
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Div_default.row, { flexWrap: "wrap", gap: theme2.styles.gap, children: possibleFilterListValues.length > 0 ? possibleFilterListValues.map((value) => {
|
|
8634
8674
|
const isActive = filterListSelectedItems?.includes(value.value);
|
|
8635
|
-
return /* @__PURE__ */ (0,
|
|
8675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
8636
8676
|
Div_default.box,
|
|
8637
8677
|
{
|
|
8638
8678
|
isActive,
|
|
8639
8679
|
value: value.value,
|
|
8640
8680
|
onClickWithValue: onClickFilterListItem,
|
|
8641
|
-
children: /* @__PURE__ */ (0,
|
|
8642
|
-
/* @__PURE__ */ (0,
|
|
8643
|
-
openedFilterColumn.withTotalNumber && /* @__PURE__ */ (0,
|
|
8681
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Div_default.row, { alignItems: "center", gap: theme2.styles.gap / 2, children: [
|
|
8682
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text_default, { children: value.label || value.value }),
|
|
8683
|
+
openedFilterColumn.withTotalNumber && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
8644
8684
|
Text_default,
|
|
8645
8685
|
{
|
|
8646
8686
|
fontSize: 14,
|
|
@@ -8656,23 +8696,23 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
|
|
|
8656
8696
|
},
|
|
8657
8697
|
value.value
|
|
8658
8698
|
);
|
|
8659
|
-
}) : /* @__PURE__ */ (0,
|
|
8699
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text_default.unknown, { children: "No values" }) })
|
|
8660
8700
|
] }),
|
|
8661
|
-
/* @__PURE__ */ (0,
|
|
8701
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Div_default, {})
|
|
8662
8702
|
]
|
|
8663
8703
|
}
|
|
8664
|
-
) : /* @__PURE__ */ (0,
|
|
8704
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text_default.unknown, { children: "Unknown filter" }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Loader_default.box, {})
|
|
8665
8705
|
}
|
|
8666
8706
|
)
|
|
8667
8707
|
] });
|
|
8668
8708
|
});
|
|
8669
|
-
var Table2 = (0,
|
|
8709
|
+
var Table2 = (0, import_react26.memo)(TableComponent);
|
|
8670
8710
|
var Table_default = Table2;
|
|
8671
8711
|
|
|
8672
8712
|
// src/components/Tooltip.tsx
|
|
8673
|
-
var
|
|
8713
|
+
var import_react27 = require("react");
|
|
8674
8714
|
var import_styled_components14 = __toESM(require("styled-components"));
|
|
8675
|
-
var
|
|
8715
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
8676
8716
|
var tooltipContainerStyle = (props) => ({
|
|
8677
8717
|
top: import_styled_components14.css`
|
|
8678
8718
|
bottom: calc(100% + ${props.gap}px + ${props.arrowSize}px);
|
|
@@ -8774,10 +8814,10 @@ var arrowStyle = (props, borderWidth) => ({
|
|
|
8774
8814
|
transform: !borderWidth && props.align === "center" ? "translateY(-50%);" : void 0
|
|
8775
8815
|
}
|
|
8776
8816
|
});
|
|
8777
|
-
var Arrow = (0,
|
|
8817
|
+
var Arrow = (0, import_react27.memo)(function Arrow2(props) {
|
|
8778
8818
|
const theme2 = useTheme();
|
|
8779
8819
|
const { position, size } = props;
|
|
8780
|
-
const outerProps = (0,
|
|
8820
|
+
const outerProps = (0, import_react27.useMemo)(
|
|
8781
8821
|
() => ({
|
|
8782
8822
|
...props,
|
|
8783
8823
|
color: theme2.colors.border
|
|
@@ -8785,7 +8825,7 @@ var Arrow = (0, import_react26.memo)(function Arrow2(props) {
|
|
|
8785
8825
|
[props, theme2]
|
|
8786
8826
|
);
|
|
8787
8827
|
const borderWidth = 1;
|
|
8788
|
-
return /* @__PURE__ */ (0,
|
|
8828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
8789
8829
|
Div_default,
|
|
8790
8830
|
{
|
|
8791
8831
|
position: "absolute",
|
|
@@ -8793,7 +8833,7 @@ var Arrow = (0, import_react26.memo)(function Arrow2(props) {
|
|
|
8793
8833
|
height: 0,
|
|
8794
8834
|
border: `${size}px solid transparent`,
|
|
8795
8835
|
...arrowStyle(outerProps)[position],
|
|
8796
|
-
children: /* @__PURE__ */ (0,
|
|
8836
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
8797
8837
|
Div_default,
|
|
8798
8838
|
{
|
|
8799
8839
|
position: "absolute",
|
|
@@ -8806,7 +8846,7 @@ var Arrow = (0, import_react26.memo)(function Arrow2(props) {
|
|
|
8806
8846
|
}
|
|
8807
8847
|
);
|
|
8808
8848
|
});
|
|
8809
|
-
var TooltipComponent = (0,
|
|
8849
|
+
var TooltipComponent = (0, import_react27.forwardRef)(function Tooltip({
|
|
8810
8850
|
position = "bottom",
|
|
8811
8851
|
trigger = "hover",
|
|
8812
8852
|
align = "center",
|
|
@@ -8825,17 +8865,17 @@ var TooltipComponent = (0, import_react26.forwardRef)(function Tooltip({
|
|
|
8825
8865
|
children
|
|
8826
8866
|
}, ref) {
|
|
8827
8867
|
const theme2 = useTheme();
|
|
8828
|
-
const triggerHolderRef = (0,
|
|
8829
|
-
const contentRef = (0,
|
|
8830
|
-
const tooltipContainerRef = (0,
|
|
8831
|
-
const closeTimerRef = (0,
|
|
8832
|
-
const [isOpen, setIsOpen] = (0,
|
|
8833
|
-
const [isOpenLate, setIsOpenLate] = (0,
|
|
8868
|
+
const triggerHolderRef = (0, import_react27.useRef)(null);
|
|
8869
|
+
const contentRef = (0, import_react27.useRef)(null);
|
|
8870
|
+
const tooltipContainerRef = (0, import_react27.useRef)(null);
|
|
8871
|
+
const closeTimerRef = (0, import_react27.useRef)(void 0);
|
|
8872
|
+
const [isOpen, setIsOpen] = (0, import_react27.useState)(false);
|
|
8873
|
+
const [isOpenLate, setIsOpenLate] = (0, import_react27.useState)(false);
|
|
8834
8874
|
const arrowSize = withArrow ? theme2.styles.gap : 0;
|
|
8835
8875
|
const gap = theme2.styles.gap / 2;
|
|
8836
8876
|
const outsideScreenGap = theme2.styles.gap / 2;
|
|
8837
8877
|
const totalGap = arrowSize + gap;
|
|
8838
|
-
const openTooltip = (0,
|
|
8878
|
+
const openTooltip = (0, import_react27.useCallback)(() => {
|
|
8839
8879
|
if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
|
|
8840
8880
|
setIsOpen(true);
|
|
8841
8881
|
setIsOpenLate(true);
|
|
@@ -8859,18 +8899,18 @@ var TooltipComponent = (0, import_react26.forwardRef)(function Tooltip({
|
|
|
8859
8899
|
}, 1);
|
|
8860
8900
|
onOpen?.();
|
|
8861
8901
|
}, [onOpen, outsideScreenGap, totalGap]);
|
|
8862
|
-
const closeTooltip = (0,
|
|
8902
|
+
const closeTooltip = (0, import_react27.useCallback)(() => {
|
|
8863
8903
|
setIsOpen(false);
|
|
8864
8904
|
closeTimerRef.current = setTimeout(() => setIsOpenLate(false), 300);
|
|
8865
8905
|
onClose?.();
|
|
8866
8906
|
}, [onClose]);
|
|
8867
|
-
const onMouseEnter = (0,
|
|
8907
|
+
const onMouseEnter = (0, import_react27.useCallback)(() => {
|
|
8868
8908
|
if (trigger === "hover") openTooltip();
|
|
8869
8909
|
}, [trigger, openTooltip]);
|
|
8870
|
-
const onMouseLeave = (0,
|
|
8910
|
+
const onMouseLeave = (0, import_react27.useCallback)(() => {
|
|
8871
8911
|
if (trigger === "hover") closeTooltip();
|
|
8872
8912
|
}, [trigger, closeTooltip]);
|
|
8873
|
-
const onClickHolder = (0,
|
|
8913
|
+
const onClickHolder = (0, import_react27.useCallback)(
|
|
8874
8914
|
(event) => {
|
|
8875
8915
|
if (trigger === "click") {
|
|
8876
8916
|
if (!isOpen) openTooltip();
|
|
@@ -8879,7 +8919,7 @@ var TooltipComponent = (0, import_react26.forwardRef)(function Tooltip({
|
|
|
8879
8919
|
},
|
|
8880
8920
|
[trigger, openTooltip, isOpen, closeTooltip]
|
|
8881
8921
|
);
|
|
8882
|
-
const onClickOutside = (0,
|
|
8922
|
+
const onClickOutside = (0, import_react27.useCallback)(
|
|
8883
8923
|
(event) => {
|
|
8884
8924
|
if (!isOpen) return;
|
|
8885
8925
|
if (trigger !== "click") return;
|
|
@@ -8889,7 +8929,7 @@ var TooltipComponent = (0, import_react26.forwardRef)(function Tooltip({
|
|
|
8889
8929
|
},
|
|
8890
8930
|
[trigger, isOpen, closeTooltip]
|
|
8891
8931
|
);
|
|
8892
|
-
(0,
|
|
8932
|
+
(0, import_react27.useEffect)(() => {
|
|
8893
8933
|
if (trigger === "click") {
|
|
8894
8934
|
document.addEventListener("mousedown", onClickOutside);
|
|
8895
8935
|
return () => {
|
|
@@ -8897,7 +8937,7 @@ var TooltipComponent = (0, import_react26.forwardRef)(function Tooltip({
|
|
|
8897
8937
|
};
|
|
8898
8938
|
}
|
|
8899
8939
|
}, [trigger, onClickOutside]);
|
|
8900
|
-
(0,
|
|
8940
|
+
(0, import_react27.useImperativeHandle)(
|
|
8901
8941
|
ref,
|
|
8902
8942
|
() => {
|
|
8903
8943
|
return {
|
|
@@ -8908,7 +8948,7 @@ var TooltipComponent = (0, import_react26.forwardRef)(function Tooltip({
|
|
|
8908
8948
|
},
|
|
8909
8949
|
[isOpen, openTooltip, closeTooltip]
|
|
8910
8950
|
);
|
|
8911
|
-
return /* @__PURE__ */ (0,
|
|
8951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
8912
8952
|
Div_default,
|
|
8913
8953
|
{
|
|
8914
8954
|
position: "relative",
|
|
@@ -8918,7 +8958,7 @@ var TooltipComponent = (0, import_react26.forwardRef)(function Tooltip({
|
|
|
8918
8958
|
onMouseEnter,
|
|
8919
8959
|
onMouseLeave,
|
|
8920
8960
|
children: [
|
|
8921
|
-
/* @__PURE__ */ (0,
|
|
8961
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
8922
8962
|
Div_default,
|
|
8923
8963
|
{
|
|
8924
8964
|
width: childrenWrapperWidth,
|
|
@@ -8928,7 +8968,7 @@ var TooltipComponent = (0, import_react26.forwardRef)(function Tooltip({
|
|
|
8928
8968
|
children
|
|
8929
8969
|
}
|
|
8930
8970
|
),
|
|
8931
|
-
/* @__PURE__ */ (0,
|
|
8971
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
8932
8972
|
TooltipContainer,
|
|
8933
8973
|
{
|
|
8934
8974
|
theme: theme2,
|
|
@@ -8940,8 +8980,8 @@ var TooltipComponent = (0, import_react26.forwardRef)(function Tooltip({
|
|
|
8940
8980
|
isOpen,
|
|
8941
8981
|
role: "tooltip",
|
|
8942
8982
|
ref: tooltipContainerRef,
|
|
8943
|
-
children: (isOpen || isOpenLate) && /* @__PURE__ */ (0,
|
|
8944
|
-
/* @__PURE__ */ (0,
|
|
8983
|
+
children: (isOpen || isOpenLate) && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Div_default, { position: "relative", ref: contentRef, children: [
|
|
8984
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
8945
8985
|
Div_default.box,
|
|
8946
8986
|
{
|
|
8947
8987
|
position: "relative",
|
|
@@ -8955,7 +8995,7 @@ var TooltipComponent = (0, import_react26.forwardRef)(function Tooltip({
|
|
|
8955
8995
|
children: content
|
|
8956
8996
|
}
|
|
8957
8997
|
),
|
|
8958
|
-
/* @__PURE__ */ (0,
|
|
8998
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
8959
8999
|
Div_default,
|
|
8960
9000
|
{
|
|
8961
9001
|
position: "absolute",
|
|
@@ -8969,7 +9009,7 @@ var TooltipComponent = (0, import_react26.forwardRef)(function Tooltip({
|
|
|
8969
9009
|
borderTopRightRadius: 999
|
|
8970
9010
|
}
|
|
8971
9011
|
),
|
|
8972
|
-
withArrow && /* @__PURE__ */ (0,
|
|
9012
|
+
withArrow && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
8973
9013
|
Arrow,
|
|
8974
9014
|
{
|
|
8975
9015
|
position,
|
|
@@ -8987,7 +9027,7 @@ var TooltipComponent = (0, import_react26.forwardRef)(function Tooltip({
|
|
|
8987
9027
|
}
|
|
8988
9028
|
);
|
|
8989
9029
|
});
|
|
8990
|
-
TooltipComponent.item = (0,
|
|
9030
|
+
TooltipComponent.item = (0, import_react27.forwardRef)(function Item({
|
|
8991
9031
|
icon,
|
|
8992
9032
|
iconColor,
|
|
8993
9033
|
text,
|
|
@@ -9001,7 +9041,7 @@ TooltipComponent.item = (0, import_react26.forwardRef)(function Item({
|
|
|
9001
9041
|
onClickWithValue
|
|
9002
9042
|
}, ref) {
|
|
9003
9043
|
const theme2 = useTheme();
|
|
9004
|
-
return /* @__PURE__ */ (0,
|
|
9044
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
9005
9045
|
Div_default.row,
|
|
9006
9046
|
{
|
|
9007
9047
|
alignItems: "center",
|
|
@@ -9019,22 +9059,22 @@ TooltipComponent.item = (0, import_react26.forwardRef)(function Item({
|
|
|
9019
9059
|
onClickWithValue: !disabled ? onClickWithValue : void 0,
|
|
9020
9060
|
ref,
|
|
9021
9061
|
children: [
|
|
9022
|
-
icon && /* @__PURE__ */ (0,
|
|
9023
|
-
/* @__PURE__ */ (0,
|
|
9024
|
-
/* @__PURE__ */ (0,
|
|
9025
|
-
description && /* @__PURE__ */ (0,
|
|
9062
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon_default, { name: icon, color: iconColor ?? (!isActive ? theme2.colors.textSecondary : void 0) }),
|
|
9063
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
|
|
9064
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text_default, { fontWeight: isActive ? 700 : void 0, color: textColor ?? theme2.colors.textPrimary, children: text }),
|
|
9065
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text_default, { fontSize: 14, color: theme2.colors.textSecondary, children: description })
|
|
9026
9066
|
] })
|
|
9027
9067
|
]
|
|
9028
9068
|
}
|
|
9029
9069
|
);
|
|
9030
9070
|
});
|
|
9031
|
-
TooltipComponent.divider = (0,
|
|
9071
|
+
TooltipComponent.divider = (0, import_react27.forwardRef)(function DividerComponent(props, ref) {
|
|
9032
9072
|
const theme2 = useTheme();
|
|
9033
|
-
return /* @__PURE__ */ (0,
|
|
9073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Divider_default.horizontal, { marginBlock: theme2.styles.gap, ...props, ref });
|
|
9034
9074
|
});
|
|
9035
|
-
TooltipComponent.sectionTitle = (0,
|
|
9075
|
+
TooltipComponent.sectionTitle = (0, import_react27.forwardRef)(function SectionTitle({ text, ...props }, ref) {
|
|
9036
9076
|
const theme2 = useTheme();
|
|
9037
|
-
return /* @__PURE__ */ (0,
|
|
9077
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
9038
9078
|
Text_default,
|
|
9039
9079
|
{
|
|
9040
9080
|
fontSize: 12,
|
|
@@ -9048,26 +9088,26 @@ TooltipComponent.sectionTitle = (0, import_react26.forwardRef)(function SectionT
|
|
|
9048
9088
|
}
|
|
9049
9089
|
);
|
|
9050
9090
|
});
|
|
9051
|
-
var Tooltip2 = (0,
|
|
9091
|
+
var Tooltip2 = (0, import_react27.memo)(TooltipComponent);
|
|
9052
9092
|
Tooltip2.item = TooltipComponent.item;
|
|
9053
9093
|
Tooltip2.divider = TooltipComponent.divider;
|
|
9054
9094
|
Tooltip2.sectionTitle = TooltipComponent.sectionTitle;
|
|
9055
9095
|
var Tooltip_default = Tooltip2;
|
|
9056
9096
|
|
|
9057
9097
|
// src/components/Tabs.tsx
|
|
9058
|
-
var
|
|
9059
|
-
var
|
|
9098
|
+
var import_react28 = require("react");
|
|
9099
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
9060
9100
|
var tabBottomLineWidth = 2;
|
|
9061
9101
|
var tabDotSize = 6;
|
|
9062
9102
|
var defaultTabName = "tab";
|
|
9063
|
-
var TabsComponent = (0,
|
|
9103
|
+
var TabsComponent = (0, import_react28.forwardRef)(function Tabs({ tabs, name, accentColor, style = "default", onChange, children, ...props }, ref) {
|
|
9064
9104
|
const reactRouterDomPlugin2 = usePlugin("react-router-dom");
|
|
9065
9105
|
const theme2 = useTheme();
|
|
9066
9106
|
const urlQuery = reactRouterDomPlugin2 ? useUrlQuery() : void 0;
|
|
9067
9107
|
const { colorTheme, componentsState } = useBetterHtmlContextInternal();
|
|
9068
|
-
const firstRenderPassedRef = (0,
|
|
9069
|
-
const tabsRef = (0,
|
|
9070
|
-
const [selectedTab, setSelectedTab] = (0,
|
|
9108
|
+
const firstRenderPassedRef = (0, import_react28.useRef)(false);
|
|
9109
|
+
const tabsRef = (0, import_react28.useRef)({});
|
|
9110
|
+
const [selectedTab, setSelectedTab] = (0, import_react28.useState)(() => {
|
|
9071
9111
|
const selectedTabValue = tabs[0] ?? "";
|
|
9072
9112
|
if (urlQuery) {
|
|
9073
9113
|
const tabQueryValue = urlQuery.getQuery(name ?? defaultTabName);
|
|
@@ -9076,9 +9116,9 @@ var TabsComponent = (0, import_react27.forwardRef)(function Tabs({ tabs, name, a
|
|
|
9076
9116
|
}
|
|
9077
9117
|
return selectedTabValue;
|
|
9078
9118
|
});
|
|
9079
|
-
const [rerenderState, setRerenderState] = (0,
|
|
9119
|
+
const [rerenderState, setRerenderState] = (0, import_react28.useState)(0);
|
|
9080
9120
|
const tabsGap = style === "box" ? theme2.styles.gap / 2 : 0;
|
|
9081
|
-
const onClickTab = (0,
|
|
9121
|
+
const onClickTab = (0, import_react28.useCallback)(
|
|
9082
9122
|
(tab) => {
|
|
9083
9123
|
setSelectedTab(tab);
|
|
9084
9124
|
onChange?.(tab);
|
|
@@ -9090,11 +9130,11 @@ var TabsComponent = (0, import_react27.forwardRef)(function Tabs({ tabs, name, a
|
|
|
9090
9130
|
},
|
|
9091
9131
|
[onChange, name, urlQuery]
|
|
9092
9132
|
);
|
|
9093
|
-
const width = (0,
|
|
9133
|
+
const width = (0, import_react28.useMemo)(
|
|
9094
9134
|
() => tabsRef.current[selectedTab]?.getBoundingClientRect().width ?? 0,
|
|
9095
9135
|
[rerenderState, selectedTab]
|
|
9096
9136
|
);
|
|
9097
|
-
const leftSpacing = (0,
|
|
9137
|
+
const leftSpacing = (0, import_react28.useMemo)(() => {
|
|
9098
9138
|
const selectedTabIndex = tabs.findIndex((tab) => tab === selectedTab);
|
|
9099
9139
|
let spacing = 0;
|
|
9100
9140
|
Object.values(tabsRef.current).forEach((tab, index) => {
|
|
@@ -9102,7 +9142,7 @@ var TabsComponent = (0, import_react27.forwardRef)(function Tabs({ tabs, name, a
|
|
|
9102
9142
|
});
|
|
9103
9143
|
return spacing;
|
|
9104
9144
|
}, [selectedTab, tabs, tabsGap]);
|
|
9105
|
-
(0,
|
|
9145
|
+
(0, import_react28.useEffect)(() => {
|
|
9106
9146
|
const timeout = setTimeout(() => {
|
|
9107
9147
|
setRerenderState(Math.random());
|
|
9108
9148
|
firstRenderPassedRef.current = true;
|
|
@@ -9111,7 +9151,7 @@ var TabsComponent = (0, import_react27.forwardRef)(function Tabs({ tabs, name, a
|
|
|
9111
9151
|
clearTimeout(timeout);
|
|
9112
9152
|
};
|
|
9113
9153
|
}, []);
|
|
9114
|
-
(0,
|
|
9154
|
+
(0, import_react28.useEffect)(() => {
|
|
9115
9155
|
componentsState.tabs.setTabGroups((oldValue) => {
|
|
9116
9156
|
const thisTabGroup = oldValue.find((item) => item.name === (name ?? defaultTabName));
|
|
9117
9157
|
if (thisTabGroup) {
|
|
@@ -9132,20 +9172,20 @@ var TabsComponent = (0, import_react27.forwardRef)(function Tabs({ tabs, name, a
|
|
|
9132
9172
|
}
|
|
9133
9173
|
});
|
|
9134
9174
|
}, [selectedTab, name]);
|
|
9135
|
-
(0,
|
|
9175
|
+
(0, import_react28.useEffect)(() => {
|
|
9136
9176
|
tabsRef.current[selectedTab]?.scrollIntoView({
|
|
9137
9177
|
behavior: firstRenderPassedRef.current ? "smooth" : void 0,
|
|
9138
9178
|
block: "nearest"
|
|
9139
9179
|
});
|
|
9140
9180
|
}, [selectedTab]);
|
|
9141
|
-
(0,
|
|
9181
|
+
(0, import_react28.useEffect)(() => {
|
|
9142
9182
|
return () => {
|
|
9143
9183
|
componentsState.tabs.setTabGroups(
|
|
9144
9184
|
(oldValue) => oldValue.filter((item) => item.name !== (name ?? defaultTabName))
|
|
9145
9185
|
);
|
|
9146
9186
|
};
|
|
9147
9187
|
}, []);
|
|
9148
|
-
(0,
|
|
9188
|
+
(0, import_react28.useImperativeHandle)(
|
|
9149
9189
|
ref,
|
|
9150
9190
|
() => {
|
|
9151
9191
|
return {
|
|
@@ -9155,11 +9195,11 @@ var TabsComponent = (0, import_react27.forwardRef)(function Tabs({ tabs, name, a
|
|
|
9155
9195
|
},
|
|
9156
9196
|
[selectedTab, onClickTab]
|
|
9157
9197
|
);
|
|
9158
|
-
return /* @__PURE__ */ (0,
|
|
9159
|
-
/* @__PURE__ */ (0,
|
|
9160
|
-
/* @__PURE__ */ (0,
|
|
9198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Div_default.column, { width: "100%", gap: theme2.styles.space, ...props, children: [
|
|
9199
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Div_default, { position: "relative", className: "react-better-html-no-scrollbar", overflowY: "auto", children: [
|
|
9200
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Div_default.row, { position: "relative", width: "fit-content", gap: tabsGap, userSelect: "none", children: tabs.map((tab) => {
|
|
9161
9201
|
const selected = tab === selectedTab;
|
|
9162
|
-
return /* @__PURE__ */ (0,
|
|
9202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
9163
9203
|
Div_default,
|
|
9164
9204
|
{
|
|
9165
9205
|
position: "relative",
|
|
@@ -9180,7 +9220,7 @@ var TabsComponent = (0, import_react27.forwardRef)(function Tabs({ tabs, name, a
|
|
|
9180
9220
|
tabsRef.current[tab] = ref2;
|
|
9181
9221
|
},
|
|
9182
9222
|
children: [
|
|
9183
|
-
componentsState.tabs.tabsWithDots.includes(tab) && /* @__PURE__ */ (0,
|
|
9223
|
+
componentsState.tabs.tabsWithDots.includes(tab) && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
9184
9224
|
Div_default,
|
|
9185
9225
|
{
|
|
9186
9226
|
position: "absolute",
|
|
@@ -9193,7 +9233,7 @@ var TabsComponent = (0, import_react27.forwardRef)(function Tabs({ tabs, name, a
|
|
|
9193
9233
|
transition: theme2.styles.transition
|
|
9194
9234
|
}
|
|
9195
9235
|
),
|
|
9196
|
-
/* @__PURE__ */ (0,
|
|
9236
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
9197
9237
|
Text_default,
|
|
9198
9238
|
{
|
|
9199
9239
|
fontWeight: 700,
|
|
@@ -9208,7 +9248,7 @@ var TabsComponent = (0, import_react27.forwardRef)(function Tabs({ tabs, name, a
|
|
|
9208
9248
|
tab
|
|
9209
9249
|
);
|
|
9210
9250
|
}) }),
|
|
9211
|
-
style !== "box" && /* @__PURE__ */ (0,
|
|
9251
|
+
style !== "box" && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
9212
9252
|
Div_default,
|
|
9213
9253
|
{
|
|
9214
9254
|
position: "absolute",
|
|
@@ -9221,16 +9261,16 @@ var TabsComponent = (0, import_react27.forwardRef)(function Tabs({ tabs, name, a
|
|
|
9221
9261
|
}
|
|
9222
9262
|
)
|
|
9223
9263
|
] }),
|
|
9224
|
-
children && /* @__PURE__ */ (0,
|
|
9264
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Div_default, { width: "100%", children })
|
|
9225
9265
|
] });
|
|
9226
9266
|
});
|
|
9227
9267
|
TabsComponent.content = function Content({ tab, tabWithDot, tabsGroupName, isInitialTab, children }) {
|
|
9228
9268
|
const { componentsState } = useBetterHtmlContextInternal();
|
|
9229
|
-
const thisTabGroupData = (0,
|
|
9269
|
+
const thisTabGroupData = (0, import_react28.useMemo)(
|
|
9230
9270
|
() => componentsState.tabs.tabGroups.find((item) => item.name === (tabsGroupName ?? defaultTabName)),
|
|
9231
9271
|
[componentsState.tabs, tabsGroupName]
|
|
9232
9272
|
);
|
|
9233
|
-
(0,
|
|
9273
|
+
(0, import_react28.useEffect)(() => {
|
|
9234
9274
|
if (tabWithDot) {
|
|
9235
9275
|
componentsState.tabs.setTabsWithDots?.((oldValue) => oldValue.includes(tab) ? oldValue : [...oldValue, tab]);
|
|
9236
9276
|
} else {
|
|
@@ -9239,22 +9279,27 @@ TabsComponent.content = function Content({ tab, tabWithDot, tabsGroupName, isIni
|
|
|
9239
9279
|
);
|
|
9240
9280
|
}
|
|
9241
9281
|
}, [tabWithDot]);
|
|
9242
|
-
return (thisTabGroupData ? thisTabGroupData.selectedTab === tab : isInitialTab) ? /* @__PURE__ */ (0,
|
|
9282
|
+
return (thisTabGroupData ? thisTabGroupData.selectedTab === tab : isInitialTab) ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Div_default, { width: "100%", children }) : void 0;
|
|
9243
9283
|
};
|
|
9244
|
-
var Tabs2 = (0,
|
|
9284
|
+
var Tabs2 = (0, import_react28.memo)(TabsComponent);
|
|
9245
9285
|
Tabs2.content = TabsComponent.content;
|
|
9246
9286
|
var Tabs_default = Tabs2;
|
|
9247
9287
|
|
|
9248
9288
|
// src/components/Foldable.tsx
|
|
9249
|
-
var
|
|
9250
|
-
var
|
|
9289
|
+
var import_react29 = require("react");
|
|
9290
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
9251
9291
|
var animationDurationClose = 0.15;
|
|
9252
9292
|
var animationDurationOpen = animationDurationClose * 2;
|
|
9253
|
-
var FoldableComponent = (0,
|
|
9293
|
+
var FoldableComponent = (0, import_react29.forwardRef)(function Foldable({
|
|
9254
9294
|
isOpen: controlledIsOpen,
|
|
9255
9295
|
defaultOpen = false,
|
|
9256
9296
|
title,
|
|
9297
|
+
titleAs = "h3",
|
|
9298
|
+
titleColor,
|
|
9299
|
+
titleRightElement,
|
|
9257
9300
|
description,
|
|
9301
|
+
descriptionColor,
|
|
9302
|
+
rightElement,
|
|
9258
9303
|
icon,
|
|
9259
9304
|
image,
|
|
9260
9305
|
headerPaddingBlock,
|
|
@@ -9265,23 +9310,23 @@ var FoldableComponent = (0, import_react28.forwardRef)(function Foldable({
|
|
|
9265
9310
|
...props
|
|
9266
9311
|
}, ref) {
|
|
9267
9312
|
const theme2 = useTheme();
|
|
9268
|
-
const bodyRef = (0,
|
|
9313
|
+
const bodyRef = (0, import_react29.useRef)(null);
|
|
9269
9314
|
const [internalIsOpen, setInternalIsOpen] = useBooleanState(defaultOpen);
|
|
9270
|
-
const [bodyVirtualHeight, setBodyVirtualHeight] = (0,
|
|
9315
|
+
const [bodyVirtualHeight, setBodyVirtualHeight] = (0, import_react29.useState)();
|
|
9271
9316
|
const isOpen = controlledIsOpen !== void 0 ? controlledIsOpen : internalIsOpen;
|
|
9272
|
-
const open = (0,
|
|
9317
|
+
const open = (0, import_react29.useCallback)(() => {
|
|
9273
9318
|
if (controlledIsOpen === void 0) setInternalIsOpen.setTrue();
|
|
9274
9319
|
onOpenChange?.(true);
|
|
9275
9320
|
}, [controlledIsOpen, onOpenChange]);
|
|
9276
|
-
const close = (0,
|
|
9321
|
+
const close = (0, import_react29.useCallback)(() => {
|
|
9277
9322
|
if (controlledIsOpen === void 0) setInternalIsOpen.setFalse();
|
|
9278
9323
|
onOpenChange?.(false);
|
|
9279
9324
|
}, [controlledIsOpen, onOpenChange]);
|
|
9280
|
-
const toggleOpen = (0,
|
|
9325
|
+
const toggleOpen = (0, import_react29.useCallback)(() => {
|
|
9281
9326
|
if (controlledIsOpen === void 0) setInternalIsOpen.toggle();
|
|
9282
9327
|
onOpenChange?.(!isOpen);
|
|
9283
9328
|
}, [controlledIsOpen, isOpen, onOpenChange]);
|
|
9284
|
-
(0,
|
|
9329
|
+
(0, import_react29.useEffect)(() => {
|
|
9285
9330
|
if (!bodyRef.current) return;
|
|
9286
9331
|
const body = bodyRef.current;
|
|
9287
9332
|
setBodyVirtualHeight(body.scrollHeight * 2);
|
|
@@ -9292,7 +9337,7 @@ var FoldableComponent = (0, import_react28.forwardRef)(function Foldable({
|
|
|
9292
9337
|
clearTimeout(timeout);
|
|
9293
9338
|
};
|
|
9294
9339
|
}, [isOpen]);
|
|
9295
|
-
(0,
|
|
9340
|
+
(0, import_react29.useEffect)(() => {
|
|
9296
9341
|
if (!isOpen) return;
|
|
9297
9342
|
if (!bodyRef.current) return;
|
|
9298
9343
|
const observer = new ResizeObserver(() => {
|
|
@@ -9304,7 +9349,7 @@ var FoldableComponent = (0, import_react28.forwardRef)(function Foldable({
|
|
|
9304
9349
|
observer.disconnect();
|
|
9305
9350
|
};
|
|
9306
9351
|
}, [isOpen]);
|
|
9307
|
-
(0,
|
|
9352
|
+
(0, import_react29.useImperativeHandle)(
|
|
9308
9353
|
ref,
|
|
9309
9354
|
() => {
|
|
9310
9355
|
return {
|
|
@@ -9316,28 +9361,41 @@ var FoldableComponent = (0, import_react28.forwardRef)(function Foldable({
|
|
|
9316
9361
|
},
|
|
9317
9362
|
[open, close, toggleOpen, isOpen]
|
|
9318
9363
|
);
|
|
9319
|
-
return /* @__PURE__ */ (0,
|
|
9320
|
-
renderHeader ? renderHeader(isOpen, toggleOpen) : /* @__PURE__ */ (0,
|
|
9364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Div_default.column, { width: "100%", ...props, children: [
|
|
9365
|
+
renderHeader ? renderHeader(isOpen, toggleOpen) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
9321
9366
|
Div_default.row,
|
|
9322
9367
|
{
|
|
9323
9368
|
width: "100%",
|
|
9324
9369
|
alignItems: "center",
|
|
9325
|
-
gap: theme2.styles.
|
|
9370
|
+
gap: theme2.styles.space,
|
|
9326
9371
|
paddingBlock: headerPaddingBlock ?? theme2.styles.gap,
|
|
9327
9372
|
paddingInline: headerPaddingInline,
|
|
9328
9373
|
cursor: "pointer",
|
|
9329
9374
|
onClick: toggleOpen,
|
|
9330
9375
|
userSelect: "none",
|
|
9331
9376
|
children: [
|
|
9332
|
-
/* @__PURE__ */ (0,
|
|
9333
|
-
icon && /* @__PURE__ */ (0,
|
|
9334
|
-
image && /* @__PURE__ */ (0,
|
|
9335
|
-
/* @__PURE__ */ (0,
|
|
9336
|
-
title && /* @__PURE__ */ (0,
|
|
9337
|
-
|
|
9377
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Div_default.row, { flex: 1, alignItems: "center", gap: theme2.styles.space, children: [
|
|
9378
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Icon_default, { name: icon, size: 20, flexShrink: 0 }),
|
|
9379
|
+
image && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Image_default.profileImage, { name: image, size: 24, flexShrink: 0 }),
|
|
9380
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Div_default.column, { gap: theme2.styles.gap / 2, children: [
|
|
9381
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Div_default.row, { alignItems: "center", gap: theme2.styles.space, children: [
|
|
9382
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
9383
|
+
Text_default,
|
|
9384
|
+
{
|
|
9385
|
+
as: titleAs,
|
|
9386
|
+
fontWeight: 700,
|
|
9387
|
+
lineHeight: "20px",
|
|
9388
|
+
color: titleColor ?? theme2.colors.textPrimary,
|
|
9389
|
+
children: title
|
|
9390
|
+
}
|
|
9391
|
+
),
|
|
9392
|
+
titleRightElement
|
|
9393
|
+
] }),
|
|
9394
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text_default, { color: descriptionColor ?? theme2.colors.textSecondary, children: description })
|
|
9338
9395
|
] })
|
|
9339
9396
|
] }),
|
|
9340
|
-
|
|
9397
|
+
rightElement,
|
|
9398
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
9341
9399
|
Icon_default,
|
|
9342
9400
|
{
|
|
9343
9401
|
name: "chevronDown",
|
|
@@ -9348,8 +9406,8 @@ var FoldableComponent = (0, import_react28.forwardRef)(function Foldable({
|
|
|
9348
9406
|
]
|
|
9349
9407
|
}
|
|
9350
9408
|
),
|
|
9351
|
-
/* @__PURE__ */ (0,
|
|
9352
|
-
/* @__PURE__ */ (0,
|
|
9409
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Div_default, { height: isOpen ? 1 : 0, opacity: isOpen ? 1 : 0, transition: theme2.styles.transition, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Divider_default.horizontal, {}) }),
|
|
9410
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
9353
9411
|
Div_default,
|
|
9354
9412
|
{
|
|
9355
9413
|
maxHeight: isOpen ? bodyVirtualHeight : 0,
|
|
@@ -9358,14 +9416,14 @@ var FoldableComponent = (0, import_react28.forwardRef)(function Foldable({
|
|
|
9358
9416
|
overflow: !isOpen ? "hidden" : void 0,
|
|
9359
9417
|
pointerEvents: !isOpen ? "none" : void 0,
|
|
9360
9418
|
ref: bodyRef,
|
|
9361
|
-
children: /* @__PURE__ */ (0,
|
|
9419
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Div_default, { paddingBlock: theme2.styles.gap, paddingInline: headerPaddingInline, children })
|
|
9362
9420
|
}
|
|
9363
9421
|
)
|
|
9364
9422
|
] });
|
|
9365
9423
|
});
|
|
9366
|
-
FoldableComponent.box = (0,
|
|
9424
|
+
FoldableComponent.box = (0, import_react29.forwardRef)(function Box3({ ...props }, ref) {
|
|
9367
9425
|
const theme2 = useTheme();
|
|
9368
|
-
return /* @__PURE__ */ (0,
|
|
9426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
9369
9427
|
FoldableComponent,
|
|
9370
9428
|
{
|
|
9371
9429
|
backgroundColor: theme2.colors.backgroundContent,
|
|
@@ -9378,14 +9436,14 @@ FoldableComponent.box = (0, import_react28.forwardRef)(function Box3({ ...props
|
|
|
9378
9436
|
}
|
|
9379
9437
|
);
|
|
9380
9438
|
});
|
|
9381
|
-
var Foldable2 = (0,
|
|
9439
|
+
var Foldable2 = (0, import_react29.memo)(FoldableComponent);
|
|
9382
9440
|
Foldable2.box = FoldableComponent.box;
|
|
9383
9441
|
var Foldable_default = Foldable2;
|
|
9384
9442
|
|
|
9385
9443
|
// src/components/SideMenu.tsx
|
|
9386
|
-
var
|
|
9387
|
-
var
|
|
9388
|
-
var MenuItemComponent = (0,
|
|
9444
|
+
var import_react30 = require("react");
|
|
9445
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
9446
|
+
var MenuItemComponent = (0, import_react30.memo)(function MenuItemComponent2({ item, backgroundColor, onClick }) {
|
|
9389
9447
|
const reactRouterDomPlugin2 = usePlugin("react-router-dom");
|
|
9390
9448
|
if (!reactRouterDomPlugin2) {
|
|
9391
9449
|
throw new Error(
|
|
@@ -9398,7 +9456,7 @@ var MenuItemComponent = (0, import_react29.memo)(function MenuItemComponent2({ i
|
|
|
9398
9456
|
const location = reactRouterDomPluginConfig.useLocation();
|
|
9399
9457
|
const { colorTheme, components, sideMenuIsCollapsed } = useBetterHtmlContextInternal();
|
|
9400
9458
|
const [isOpened, setIsOpened] = useBooleanState();
|
|
9401
|
-
const onClickElement = (0,
|
|
9459
|
+
const onClickElement = (0, import_react30.useCallback)(() => {
|
|
9402
9460
|
if (item.disabled) return;
|
|
9403
9461
|
if (item.onClickCloseSideMenu !== false) onClick?.();
|
|
9404
9462
|
item.onClick?.(item);
|
|
@@ -9413,7 +9471,7 @@ var MenuItemComponent = (0, import_react29.memo)(function MenuItemComponent2({ i
|
|
|
9413
9471
|
const lineHeight = 20;
|
|
9414
9472
|
const lineWidth = 2;
|
|
9415
9473
|
const lineEndRadius = iconSize / 2 + iconGap * 2;
|
|
9416
|
-
const content = /* @__PURE__ */ (0,
|
|
9474
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
9417
9475
|
Div_default.row,
|
|
9418
9476
|
{
|
|
9419
9477
|
alignItems: "center",
|
|
@@ -9430,8 +9488,8 @@ var MenuItemComponent = (0, import_react29.memo)(function MenuItemComponent2({ i
|
|
|
9430
9488
|
opacity: item.disabled ? 0.6 : void 0,
|
|
9431
9489
|
onClick: item.children ? setIsOpened.toggle : onClickElement,
|
|
9432
9490
|
children: [
|
|
9433
|
-
/* @__PURE__ */ (0,
|
|
9434
|
-
/* @__PURE__ */ (0,
|
|
9491
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon_default, { name: item.iconName, color: theme2.colors.primary, size: iconSize, flexShrink: 0 }),
|
|
9492
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
9435
9493
|
Text_default,
|
|
9436
9494
|
{
|
|
9437
9495
|
flex: 1,
|
|
@@ -9442,7 +9500,7 @@ var MenuItemComponent = (0, import_react29.memo)(function MenuItemComponent2({ i
|
|
|
9442
9500
|
children: item.text
|
|
9443
9501
|
}
|
|
9444
9502
|
),
|
|
9445
|
-
item.children && /* @__PURE__ */ (0,
|
|
9503
|
+
item.children && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
9446
9504
|
Icon_default,
|
|
9447
9505
|
{
|
|
9448
9506
|
name: "chevronDown",
|
|
@@ -9455,7 +9513,7 @@ var MenuItemComponent = (0, import_react29.memo)(function MenuItemComponent2({ i
|
|
|
9455
9513
|
]
|
|
9456
9514
|
}
|
|
9457
9515
|
);
|
|
9458
|
-
(0,
|
|
9516
|
+
(0, import_react30.useEffect)(() => {
|
|
9459
9517
|
if (!item.children) return;
|
|
9460
9518
|
const toBeOpened = item.children.some(
|
|
9461
9519
|
(child) => child.href ? location.pathname === "/" ? location.pathname === child.href : location.pathname.startsWith(child.href) && child.href !== "/" : false
|
|
@@ -9463,9 +9521,9 @@ var MenuItemComponent = (0, import_react29.memo)(function MenuItemComponent2({ i
|
|
|
9463
9521
|
setIsOpened.setState(toBeOpened);
|
|
9464
9522
|
}, [item]);
|
|
9465
9523
|
const LinkComponentTag = components.button?.tagReplacement?.linkComponent ?? "a";
|
|
9466
|
-
return /* @__PURE__ */ (0,
|
|
9467
|
-
item.href ? /* @__PURE__ */ (0,
|
|
9468
|
-
item.children && /* @__PURE__ */ (0,
|
|
9524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Div_default, { width: "100%", children: [
|
|
9525
|
+
item.href ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LinkComponentTag, { to: item.href, href: item.href, onClick: onClickElement, children: content }) : content,
|
|
9526
|
+
item.children && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
9469
9527
|
Div_default.column,
|
|
9470
9528
|
{
|
|
9471
9529
|
position: "relative",
|
|
@@ -9476,7 +9534,7 @@ var MenuItemComponent = (0, import_react29.memo)(function MenuItemComponent2({ i
|
|
|
9476
9534
|
overflow: "hidden",
|
|
9477
9535
|
transition: `max-height ${theme2.styles.transition}, margin-top ${theme2.styles.transition}`,
|
|
9478
9536
|
children: [
|
|
9479
|
-
item.children.map((child) => /* @__PURE__ */ (0,
|
|
9537
|
+
item.children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
9480
9538
|
MenuItemComponent2,
|
|
9481
9539
|
{
|
|
9482
9540
|
item: child,
|
|
@@ -9485,7 +9543,7 @@ var MenuItemComponent = (0, import_react29.memo)(function MenuItemComponent2({ i
|
|
|
9485
9543
|
},
|
|
9486
9544
|
child.text
|
|
9487
9545
|
)),
|
|
9488
|
-
/* @__PURE__ */ (0,
|
|
9546
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
9489
9547
|
Div_default,
|
|
9490
9548
|
{
|
|
9491
9549
|
position: "absolute",
|
|
@@ -9494,7 +9552,7 @@ var MenuItemComponent = (0, import_react29.memo)(function MenuItemComponent2({ i
|
|
|
9494
9552
|
left: paddingLeft + iconSize / 2,
|
|
9495
9553
|
zIndex: -1,
|
|
9496
9554
|
children: [
|
|
9497
|
-
/* @__PURE__ */ (0,
|
|
9555
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
9498
9556
|
Div_default,
|
|
9499
9557
|
{
|
|
9500
9558
|
position: "relative",
|
|
@@ -9504,7 +9562,7 @@ var MenuItemComponent = (0, import_react29.memo)(function MenuItemComponent2({ i
|
|
|
9504
9562
|
zIndex: 1
|
|
9505
9563
|
}
|
|
9506
9564
|
),
|
|
9507
|
-
/* @__PURE__ */ (0,
|
|
9565
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
9508
9566
|
Div_default,
|
|
9509
9567
|
{
|
|
9510
9568
|
position: "absolute",
|
|
@@ -9544,11 +9602,11 @@ var SideMenuComponent = function SideMenu({
|
|
|
9544
9602
|
const theme2 = useTheme();
|
|
9545
9603
|
const mediaQuery = useMediaQuery();
|
|
9546
9604
|
const { components, sideMenuIsCollapsed, setSideMenuIsCollapsed, sideMenuIsOpenMobile, setSideMenuIsOpenMobile } = useBetterHtmlContextInternal();
|
|
9547
|
-
const onClickXButton = (0,
|
|
9605
|
+
const onClickXButton = (0, import_react30.useCallback)(() => {
|
|
9548
9606
|
setSideMenuIsOpenMobile.setFalse();
|
|
9549
9607
|
}, []);
|
|
9550
|
-
const readyItems = (0,
|
|
9551
|
-
const readyBottomItems = (0,
|
|
9608
|
+
const readyItems = (0, import_react30.useMemo)(() => items.filter((item) => !item.hidden), [items]);
|
|
9609
|
+
const readyBottomItems = (0, import_react30.useMemo)(() => bottomItems?.filter((item) => !item.hidden), [bottomItems]);
|
|
9552
9610
|
const isCollapsable = collapsable && !mediaQuery.size1000;
|
|
9553
9611
|
const isCollapsed = sideMenuIsCollapsed && !mediaQuery.size1000;
|
|
9554
9612
|
const LinkComponentTag = components.button?.tagReplacement?.linkComponent ?? "a";
|
|
@@ -9556,7 +9614,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9556
9614
|
const sideMenuCollapsedWidth = theme2.styles.space + theme2.styles.space * 2 + 16 + theme2.styles.space;
|
|
9557
9615
|
const readyBackgroundColor = backgroundColor ?? theme2.colors.backgroundContent;
|
|
9558
9616
|
const logoSize = sideMenuCollapsedWidth - theme2.styles.space * 2;
|
|
9559
|
-
return /* @__PURE__ */ (0,
|
|
9617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
9560
9618
|
Div_default.column,
|
|
9561
9619
|
{
|
|
9562
9620
|
position: "fixed",
|
|
@@ -9572,9 +9630,9 @@ var SideMenuComponent = function SideMenu({
|
|
|
9572
9630
|
userSelect: "none",
|
|
9573
9631
|
zIndex: 10,
|
|
9574
9632
|
children: [
|
|
9575
|
-
/* @__PURE__ */ (0,
|
|
9576
|
-
(logoAssetName || logoUrl || withCloseButton && mediaQuery.size1000) && /* @__PURE__ */ (0,
|
|
9577
|
-
(logoAssetName || logoUrl) && /* @__PURE__ */ (0,
|
|
9633
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Div_default.column, { width: "100%", height: "100%", gap: theme2.styles.space, children: [
|
|
9634
|
+
(logoAssetName || logoUrl || withCloseButton && mediaQuery.size1000) && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Div_default.row, { alignItems: "center", paddingInline: theme2.styles.space, children: [
|
|
9635
|
+
(logoAssetName || logoUrl) && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LinkComponentTag, { to: "/", href: "/", onClick: onClickXButton, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
9578
9636
|
Div_default.row,
|
|
9579
9637
|
{
|
|
9580
9638
|
alignItems: "center",
|
|
@@ -9583,7 +9641,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9583
9641
|
whiteSpace: "nowrap",
|
|
9584
9642
|
gap: theme2.styles.gap,
|
|
9585
9643
|
children: [
|
|
9586
|
-
/* @__PURE__ */ (0,
|
|
9644
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
9587
9645
|
Image_default,
|
|
9588
9646
|
{
|
|
9589
9647
|
name: logoAssetName,
|
|
@@ -9593,7 +9651,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9593
9651
|
objectFit: "contain"
|
|
9594
9652
|
}
|
|
9595
9653
|
),
|
|
9596
|
-
logoText && /* @__PURE__ */ (0,
|
|
9654
|
+
logoText && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
9597
9655
|
Text_default,
|
|
9598
9656
|
{
|
|
9599
9657
|
fontFamily: logoFontFamily,
|
|
@@ -9608,9 +9666,9 @@ var SideMenuComponent = function SideMenu({
|
|
|
9608
9666
|
]
|
|
9609
9667
|
}
|
|
9610
9668
|
) }),
|
|
9611
|
-
withCloseButton && mediaQuery.size1000 && /* @__PURE__ */ (0,
|
|
9669
|
+
withCloseButton && mediaQuery.size1000 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button_default.icon, { icon: "XMark", marginLeft: "auto", onClick: onClickXButton })
|
|
9612
9670
|
] }),
|
|
9613
|
-
/* @__PURE__ */ (0,
|
|
9671
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
9614
9672
|
Div_default.column,
|
|
9615
9673
|
{
|
|
9616
9674
|
width: "100%",
|
|
@@ -9618,7 +9676,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9618
9676
|
overflowY: "auto",
|
|
9619
9677
|
paddingInline: theme2.styles.space,
|
|
9620
9678
|
paddingBottom: !isCollapsable && !readyBottomItems ? theme2.styles.space : void 0,
|
|
9621
|
-
children: /* @__PURE__ */ (0,
|
|
9679
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Div_default.column, { gap: theme2.styles.gap / 2, children: readyItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
9622
9680
|
MenuItemComponent,
|
|
9623
9681
|
{
|
|
9624
9682
|
item,
|
|
@@ -9629,7 +9687,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9629
9687
|
)) })
|
|
9630
9688
|
}
|
|
9631
9689
|
),
|
|
9632
|
-
readyBottomItems && /* @__PURE__ */ (0,
|
|
9690
|
+
readyBottomItems && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
9633
9691
|
Div_default.column,
|
|
9634
9692
|
{
|
|
9635
9693
|
borderTop: mediaQuery.size1000 ? `solid 1px ${theme2.colors.border}` : void 0,
|
|
@@ -9638,7 +9696,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9638
9696
|
paddingTop: mediaQuery.size1000 ? theme2.styles.space : void 0,
|
|
9639
9697
|
paddingInline: theme2.styles.space,
|
|
9640
9698
|
paddingBottom: !isCollapsable ? theme2.styles.space : void 0,
|
|
9641
|
-
children: readyBottomItems.map((item) => /* @__PURE__ */ (0,
|
|
9699
|
+
children: readyBottomItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
9642
9700
|
MenuItemComponent,
|
|
9643
9701
|
{
|
|
9644
9702
|
item,
|
|
@@ -9649,14 +9707,14 @@ var SideMenuComponent = function SideMenu({
|
|
|
9649
9707
|
))
|
|
9650
9708
|
}
|
|
9651
9709
|
),
|
|
9652
|
-
isCollapsable && /* @__PURE__ */ (0,
|
|
9710
|
+
isCollapsable && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
9653
9711
|
Div_default,
|
|
9654
9712
|
{
|
|
9655
9713
|
borderTop: `solid 1px ${theme2.colors.border}`,
|
|
9656
9714
|
marginTop: !readyBottomItems ? "auto" : void 0,
|
|
9657
9715
|
paddingInline: theme2.styles.space,
|
|
9658
9716
|
paddingBlock: theme2.styles.space,
|
|
9659
|
-
children: /* @__PURE__ */ (0,
|
|
9717
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
9660
9718
|
Div_default.row,
|
|
9661
9719
|
{
|
|
9662
9720
|
alignItems: "center",
|
|
@@ -9668,7 +9726,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9668
9726
|
isTabAccessed: true,
|
|
9669
9727
|
paddingBlock: theme2.styles.gap,
|
|
9670
9728
|
onClick: setSideMenuIsCollapsed.toggle,
|
|
9671
|
-
children: /* @__PURE__ */ (0,
|
|
9729
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
9672
9730
|
Icon_default,
|
|
9673
9731
|
{
|
|
9674
9732
|
name: "chevronRight",
|
|
@@ -9683,7 +9741,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9683
9741
|
}
|
|
9684
9742
|
)
|
|
9685
9743
|
] }),
|
|
9686
|
-
widthMobileHandle && /* @__PURE__ */ (0,
|
|
9744
|
+
widthMobileHandle && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
9687
9745
|
Div_default.row,
|
|
9688
9746
|
{
|
|
9689
9747
|
position: "absolute",
|
|
@@ -9703,7 +9761,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9703
9761
|
transform: !mediaQuery.size1000 ? "translateX(-100%)" : void 0,
|
|
9704
9762
|
transition: theme2.styles.transition,
|
|
9705
9763
|
onClick: setSideMenuIsOpenMobile.toggle,
|
|
9706
|
-
children: /* @__PURE__ */ (0,
|
|
9764
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
9707
9765
|
Icon_default,
|
|
9708
9766
|
{
|
|
9709
9767
|
name: "chevronRight",
|
|
@@ -9725,7 +9783,7 @@ SideMenuComponent.pageHolder = function SideMenuPageHolder({ outsideComponent, .
|
|
|
9725
9783
|
const { components, sideMenuIsCollapsed } = useBetterHtmlContextInternal();
|
|
9726
9784
|
const sideMenuWidth = components.sideMenu?.width ?? defaultSideMenuWidth;
|
|
9727
9785
|
const sideMenuCollapsedWidth = theme2.styles.space + theme2.styles.space * 2 + 16 + theme2.styles.space;
|
|
9728
|
-
return /* @__PURE__ */ (0,
|
|
9786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
9729
9787
|
Div_default,
|
|
9730
9788
|
{
|
|
9731
9789
|
position: "relative",
|
|
@@ -9734,7 +9792,7 @@ SideMenuComponent.pageHolder = function SideMenuPageHolder({ outsideComponent, .
|
|
|
9734
9792
|
transition: theme2.styles.transition,
|
|
9735
9793
|
children: [
|
|
9736
9794
|
outsideComponent,
|
|
9737
|
-
/* @__PURE__ */ (0,
|
|
9795
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(PageHolder_default, { ...props })
|
|
9738
9796
|
]
|
|
9739
9797
|
}
|
|
9740
9798
|
);
|
|
@@ -9744,7 +9802,7 @@ SideMenuComponent.burgerButton = function BurgerButton() {
|
|
|
9744
9802
|
const { sideMenuIsOpenMobile, setSideMenuIsOpenMobile } = useBetterHtmlContextInternal();
|
|
9745
9803
|
const [isHovered, setIsHovered] = useBooleanState();
|
|
9746
9804
|
const width = 2;
|
|
9747
|
-
return /* @__PURE__ */ (0,
|
|
9805
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
9748
9806
|
Div_default,
|
|
9749
9807
|
{
|
|
9750
9808
|
position: "relative",
|
|
@@ -9756,7 +9814,7 @@ SideMenuComponent.burgerButton = function BurgerButton() {
|
|
|
9756
9814
|
onMouseOut: setIsHovered.setFalse,
|
|
9757
9815
|
onClick: setSideMenuIsOpenMobile.toggle,
|
|
9758
9816
|
children: [
|
|
9759
|
-
/* @__PURE__ */ (0,
|
|
9817
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
9760
9818
|
Div_default,
|
|
9761
9819
|
{
|
|
9762
9820
|
position: "absolute",
|
|
@@ -9770,7 +9828,7 @@ SideMenuComponent.burgerButton = function BurgerButton() {
|
|
|
9770
9828
|
transition: theme2.styles.transition
|
|
9771
9829
|
}
|
|
9772
9830
|
),
|
|
9773
|
-
/* @__PURE__ */ (0,
|
|
9831
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
9774
9832
|
Div_default,
|
|
9775
9833
|
{
|
|
9776
9834
|
position: "absolute",
|
|
@@ -9785,7 +9843,7 @@ SideMenuComponent.burgerButton = function BurgerButton() {
|
|
|
9785
9843
|
transition: theme2.styles.transition
|
|
9786
9844
|
}
|
|
9787
9845
|
),
|
|
9788
|
-
/* @__PURE__ */ (0,
|
|
9846
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
9789
9847
|
Div_default,
|
|
9790
9848
|
{
|
|
9791
9849
|
position: "absolute",
|
|
@@ -9803,7 +9861,7 @@ SideMenuComponent.burgerButton = function BurgerButton() {
|
|
|
9803
9861
|
}
|
|
9804
9862
|
);
|
|
9805
9863
|
};
|
|
9806
|
-
var SideMenu2 = (0,
|
|
9864
|
+
var SideMenu2 = (0, import_react30.memo)(SideMenuComponent);
|
|
9807
9865
|
SideMenu2.pageHolder = SideMenuComponent.pageHolder;
|
|
9808
9866
|
SideMenu2.burgerButton = SideMenuComponent.burgerButton;
|
|
9809
9867
|
var SideMenu_default = SideMenu2;
|
|
@@ -9892,6 +9950,7 @@ function generateLocalStorage() {
|
|
|
9892
9950
|
Modal,
|
|
9893
9951
|
PageHeader,
|
|
9894
9952
|
PageHolder,
|
|
9953
|
+
Pagination,
|
|
9895
9954
|
SideMenu,
|
|
9896
9955
|
Table,
|
|
9897
9956
|
Tabs,
|