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