react-better-html 1.1.120 → 1.1.121
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 +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +96 -79
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +96 -79
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6890,7 +6890,10 @@ var TableStyledComponent = styled10.table.withConfig({
|
|
|
6890
6890
|
transition: ${props.theme.styles.transition};
|
|
6891
6891
|
|
|
6892
6892
|
&:not(.isHeader):not(.isFooter):not(.withoutHover):hover {
|
|
6893
|
-
|
|
6893
|
+
background-color: ${darkenColor(
|
|
6894
|
+
props.theme.colors.backgroundContent,
|
|
6895
|
+
props.colorTheme === "light" ? 0.05 : 0.15
|
|
6896
|
+
)};
|
|
6894
6897
|
}
|
|
6895
6898
|
` : ""}
|
|
6896
6899
|
|
|
@@ -6991,7 +6994,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
6991
6994
|
filterModalRef.current?.close();
|
|
6992
6995
|
}
|
|
6993
6996
|
});
|
|
6994
|
-
const
|
|
6997
|
+
const expandColumn = useMemo7(() => columns.find((column) => column.type === "expand"), [columns]);
|
|
6995
6998
|
const renderCellContent = useCallback10(
|
|
6996
6999
|
(column, item, itemIndex) => {
|
|
6997
7000
|
switch (column.type) {
|
|
@@ -7015,6 +7018,9 @@ var TableComponent = forwardRef15(function Table({
|
|
|
7015
7018
|
{
|
|
7016
7019
|
checked: checkedValue,
|
|
7017
7020
|
value: item,
|
|
7021
|
+
onClick: (event) => {
|
|
7022
|
+
event.stopPropagation();
|
|
7023
|
+
},
|
|
7018
7024
|
onChange: (checked, value) => {
|
|
7019
7025
|
setCheckedItems(
|
|
7020
7026
|
(oldValue) => oldValue.map(
|
|
@@ -7046,10 +7052,10 @@ var TableComponent = forwardRef15(function Table({
|
|
|
7046
7052
|
);
|
|
7047
7053
|
const onClickRowElement = useCallback10(
|
|
7048
7054
|
(item, index) => {
|
|
7049
|
-
if (
|
|
7055
|
+
if (expandColumn) {
|
|
7050
7056
|
setExpandedRows((oldValue) => {
|
|
7051
7057
|
if (oldValue[index] === void 0) {
|
|
7052
|
-
const newValue =
|
|
7058
|
+
const newValue = expandColumn.onlyOneExpanded ? [] : [...oldValue];
|
|
7053
7059
|
newValue[index] = true;
|
|
7054
7060
|
return newValue;
|
|
7055
7061
|
}
|
|
@@ -7057,7 +7063,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
7057
7063
|
});
|
|
7058
7064
|
} else onClickRow?.(item, index);
|
|
7059
7065
|
},
|
|
7060
|
-
[onClickRow,
|
|
7066
|
+
[onClickRow, expandColumn]
|
|
7061
7067
|
);
|
|
7062
7068
|
const onClickAllCheckboxesElement = useCallback10(
|
|
7063
7069
|
(checked) => {
|
|
@@ -7190,9 +7196,9 @@ var TableComponent = forwardRef15(function Table({
|
|
|
7190
7196
|
);
|
|
7191
7197
|
const renderExpandedRow = useCallback10(
|
|
7192
7198
|
(...props2) => {
|
|
7193
|
-
const
|
|
7194
|
-
if (!
|
|
7195
|
-
return
|
|
7199
|
+
const expandColumn2 = columns.find((column) => column.type === "expand");
|
|
7200
|
+
if (!expandColumn2) return;
|
|
7201
|
+
return expandColumn2.render?.(...props2);
|
|
7196
7202
|
},
|
|
7197
7203
|
[columns]
|
|
7198
7204
|
);
|
|
@@ -7313,7 +7319,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
7313
7319
|
TableStyledComponent,
|
|
7314
7320
|
{
|
|
7315
7321
|
isStriped,
|
|
7316
|
-
withHover: onClickRow !== void 0 ||
|
|
7322
|
+
withHover: onClickRow !== void 0 || expandColumn !== void 0,
|
|
7317
7323
|
withStickyHeader,
|
|
7318
7324
|
colorTheme,
|
|
7319
7325
|
theme: theme2,
|
|
@@ -7359,12 +7365,15 @@ var TableComponent = forwardRef15(function Table({
|
|
|
7359
7365
|
/* @__PURE__ */ jsx20(
|
|
7360
7366
|
"tr",
|
|
7361
7367
|
{
|
|
7362
|
-
className: onClickRow ||
|
|
7368
|
+
className: onClickRow || expandColumn ? "isClickable" : void 0,
|
|
7363
7369
|
onClick: () => onClickRowElement(item, rowIndex),
|
|
7364
7370
|
children: columns.map((column, colIndex) => /* @__PURE__ */ jsx20(
|
|
7365
7371
|
TdStyledComponent,
|
|
7366
7372
|
{
|
|
7367
7373
|
textAlign: column.align,
|
|
7374
|
+
onClick: (event) => {
|
|
7375
|
+
if (column.clickStopPropagation) event.stopPropagation();
|
|
7376
|
+
},
|
|
7368
7377
|
children: renderCellContent(column, item, rowIndex)
|
|
7369
7378
|
},
|
|
7370
7379
|
column.type + column.label + colIndex
|
|
@@ -7509,17 +7518,15 @@ var TableComponent = forwardRef15(function Table({
|
|
|
7509
7518
|
] }) }),
|
|
7510
7519
|
openedFilterColumn.presets && /* @__PURE__ */ jsxs16(Div_default.column, { gap: theme2.styles.gap / 2, children: [
|
|
7511
7520
|
/* @__PURE__ */ jsx20(Label_default, { text: "Presets" }),
|
|
7512
|
-
/* @__PURE__ */ jsx20(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: openedFilterColumn.presets.map((preset) =>
|
|
7513
|
-
|
|
7514
|
-
|
|
7515
|
-
|
|
7516
|
-
|
|
7517
|
-
|
|
7518
|
-
|
|
7519
|
-
|
|
7520
|
-
|
|
7521
|
-
);
|
|
7522
|
-
}) })
|
|
7521
|
+
/* @__PURE__ */ jsx20(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: openedFilterColumn.presets.map((preset) => /* @__PURE__ */ jsx20(
|
|
7522
|
+
Button_default.secondary,
|
|
7523
|
+
{
|
|
7524
|
+
text: filterPresetsText[preset],
|
|
7525
|
+
value: preset,
|
|
7526
|
+
onClickWithValue: onClickFilterPreset
|
|
7527
|
+
},
|
|
7528
|
+
preset
|
|
7529
|
+
)) })
|
|
7523
7530
|
] })
|
|
7524
7531
|
]
|
|
7525
7532
|
}
|
|
@@ -7824,64 +7831,74 @@ var TooltipComponent = forwardRef16(function Tooltip({
|
|
|
7824
7831
|
},
|
|
7825
7832
|
[isOpen, openTooltip, closeTooltip]
|
|
7826
7833
|
);
|
|
7827
|
-
return /* @__PURE__ */ jsxs17(
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
|
|
7833
|
-
|
|
7834
|
-
|
|
7835
|
-
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
7839
|
-
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
7865
|
-
|
|
7866
|
-
|
|
7867
|
-
|
|
7868
|
-
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
|
|
7878
|
-
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
7834
|
+
return /* @__PURE__ */ jsxs17(
|
|
7835
|
+
Div_default,
|
|
7836
|
+
{
|
|
7837
|
+
position: "relative",
|
|
7838
|
+
width: "fit-content",
|
|
7839
|
+
onClick: onClickHolder,
|
|
7840
|
+
onMouseEnter,
|
|
7841
|
+
onMouseLeave,
|
|
7842
|
+
children: [
|
|
7843
|
+
/* @__PURE__ */ jsx21(Div_default, { width: "fit-content", isTabAccessed, ref: triggerHolderRef, children }),
|
|
7844
|
+
/* @__PURE__ */ jsx21(
|
|
7845
|
+
TooltipContainer,
|
|
7846
|
+
{
|
|
7847
|
+
theme: theme2,
|
|
7848
|
+
position,
|
|
7849
|
+
align,
|
|
7850
|
+
withArrow,
|
|
7851
|
+
arrowSize,
|
|
7852
|
+
gap,
|
|
7853
|
+
isOpen,
|
|
7854
|
+
role: "tooltip",
|
|
7855
|
+
ref: tooltipContainerRef,
|
|
7856
|
+
children: (isOpen || isOpenLate) && /* @__PURE__ */ jsxs17(Div_default, { position: "relative", ref: contentRef, children: [
|
|
7857
|
+
/* @__PURE__ */ jsx21(
|
|
7858
|
+
Div_default.box,
|
|
7859
|
+
{
|
|
7860
|
+
position: "relative",
|
|
7861
|
+
width: contentWidth,
|
|
7862
|
+
minWidth: contentMinWidth,
|
|
7863
|
+
backgroundColor: backgroundColor ?? theme2.colors.backgroundContent,
|
|
7864
|
+
boxShadow: "0px 10px 20px #00000020",
|
|
7865
|
+
paddingBlock: isSmall ? theme2.styles.gap / 2 : theme2.styles.gap,
|
|
7866
|
+
paddingInline: asContextMenu ? 0 : isSmall ? theme2.styles.space / 2 : theme2.styles.space,
|
|
7867
|
+
overflow: asContextMenu ? "hidden" : void 0,
|
|
7868
|
+
children: content
|
|
7869
|
+
}
|
|
7870
|
+
),
|
|
7871
|
+
/* @__PURE__ */ jsx21(
|
|
7872
|
+
Div_default,
|
|
7873
|
+
{
|
|
7874
|
+
position: "absolute",
|
|
7875
|
+
width: position === "left" || position === "right" ? totalGap : "100%",
|
|
7876
|
+
height: position === "top" || position === "bottom" ? totalGap : "100%",
|
|
7877
|
+
top: position === "top" ? "100%" : position === "bottom" ? void 0 : 0,
|
|
7878
|
+
bottom: position === "bottom" ? "100%" : position === "top" ? void 0 : 0,
|
|
7879
|
+
left: position === "left" ? "100%" : position === "right" ? void 0 : 0,
|
|
7880
|
+
right: position === "right" ? "100%" : position === "left" ? void 0 : 0,
|
|
7881
|
+
borderTopLeftRadius: 999,
|
|
7882
|
+
borderTopRightRadius: 999
|
|
7883
|
+
}
|
|
7884
|
+
),
|
|
7885
|
+
withArrow && /* @__PURE__ */ jsx21(
|
|
7886
|
+
Arrow,
|
|
7887
|
+
{
|
|
7888
|
+
position,
|
|
7889
|
+
align,
|
|
7890
|
+
sideSpace: theme2.styles.borderRadius,
|
|
7891
|
+
size: arrowSize,
|
|
7892
|
+
color: backgroundColor ?? theme2.colors.backgroundContent,
|
|
7893
|
+
isOpen
|
|
7894
|
+
}
|
|
7895
|
+
)
|
|
7896
|
+
] })
|
|
7897
|
+
}
|
|
7898
|
+
)
|
|
7899
|
+
]
|
|
7900
|
+
}
|
|
7901
|
+
);
|
|
7885
7902
|
});
|
|
7886
7903
|
TooltipComponent.item = forwardRef16(function Item({ icon, text, description, isActive, value, id, onClick, onClickWithValue }, ref) {
|
|
7887
7904
|
const theme2 = useTheme();
|