react-better-html 1.1.196 → 1.1.198
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 +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +120 -89
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +121 -90
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -5827,7 +5827,7 @@ var DropdownComponent = forwardRef10(function Dropdown({
|
|
|
5827
5827
|
filter: isFocused2 ? isDisabled ? "brightness(0.95)" : "brightness(0.9)" : void 0,
|
|
5828
5828
|
filterHover: focusedOptionIndex === void 0 && !isDisabled ? "brightness(0.9)" : void 0,
|
|
5829
5829
|
cursor: isDisabled ? "not-allowed" : "pointer",
|
|
5830
|
-
padding: `${theme2.styles.
|
|
5830
|
+
padding: `${theme2.styles.gap}px ${theme2.styles.space}px`,
|
|
5831
5831
|
value: option,
|
|
5832
5832
|
onClickWithValue: onClickOption,
|
|
5833
5833
|
onMouseMove: () => setFocusedOptionIndex(void 0),
|
|
@@ -6743,6 +6743,13 @@ InputFieldComponent.phoneNumber = forwardRef11(function PhoneNumber({ label, val
|
|
|
6743
6743
|
] }),
|
|
6744
6744
|
[]
|
|
6745
6745
|
);
|
|
6746
|
+
const onChangeDropdown = useCallback9(
|
|
6747
|
+
(value2) => {
|
|
6748
|
+
setDropdownValue(value2);
|
|
6749
|
+
onChangeValue?.(value2 ? `+${value2}${inputFieldValue}` : inputFieldValue);
|
|
6750
|
+
},
|
|
6751
|
+
[onChangeValue, inputFieldValue]
|
|
6752
|
+
);
|
|
6746
6753
|
const onChangeValueElement = useCallback9(
|
|
6747
6754
|
(value2) => {
|
|
6748
6755
|
const readyValue = value2.replace(/\D/g, "");
|
|
@@ -6807,7 +6814,7 @@ InputFieldComponent.phoneNumber = forwardRef11(function PhoneNumber({ label, val
|
|
|
6807
6814
|
defaultValue,
|
|
6808
6815
|
value: dropdownValue,
|
|
6809
6816
|
disabled: props.disabled,
|
|
6810
|
-
onChange:
|
|
6817
|
+
onChange: onChangeDropdown,
|
|
6811
6818
|
withoutClearButton: true,
|
|
6812
6819
|
withoutRenderingOptionsWhenClosed: true
|
|
6813
6820
|
}
|
|
@@ -8607,7 +8614,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
8607
8614
|
)
|
|
8608
8615
|
] })
|
|
8609
8616
|
},
|
|
8610
|
-
value.value
|
|
8617
|
+
value.value.toString()
|
|
8611
8618
|
);
|
|
8612
8619
|
}) : /* @__PURE__ */ jsx23(Text_default.unknown, { children: "No values" }) })
|
|
8613
8620
|
] }),
|
|
@@ -8679,11 +8686,11 @@ var tooltipPositionStyle = (props) => ({
|
|
|
8679
8686
|
}
|
|
8680
8687
|
});
|
|
8681
8688
|
var TooltipContainer = styled13.div.withConfig({
|
|
8682
|
-
shouldForwardProp: (prop) => !["theme", "position", "align", "withArrow", "arrowSize", "isOpen", "gap"].includes(prop)
|
|
8689
|
+
shouldForwardProp: (prop) => !["theme", "position", "align", "pointerEvents", "withArrow", "arrowSize", "isOpen", "gap"].includes(prop)
|
|
8683
8690
|
})`
|
|
8684
8691
|
position: absolute;
|
|
8685
8692
|
opacity: ${(props) => props.isOpen ? 1 : 0};
|
|
8686
|
-
pointer-events: ${(props) => props.isOpen ?
|
|
8693
|
+
pointer-events: ${(props) => props.isOpen ? props.pointerEvents : "none"};
|
|
8687
8694
|
transition: ${(props) => props.theme.styles.transition};
|
|
8688
8695
|
z-index: 1000;
|
|
8689
8696
|
|
|
@@ -8766,8 +8773,10 @@ var TooltipComponent = forwardRef16(function Tooltip({
|
|
|
8766
8773
|
content,
|
|
8767
8774
|
contentWidth,
|
|
8768
8775
|
contentMinWidth,
|
|
8776
|
+
contentPointerEvents = "auto",
|
|
8769
8777
|
childrenWrapperWidth = "fit-content",
|
|
8770
8778
|
childrenWrapperHeight,
|
|
8779
|
+
disabled,
|
|
8771
8780
|
withArrow,
|
|
8772
8781
|
isSmall,
|
|
8773
8782
|
backgroundColor,
|
|
@@ -8789,6 +8798,7 @@ var TooltipComponent = forwardRef16(function Tooltip({
|
|
|
8789
8798
|
const outsideScreenGap = theme2.styles.gap / 2;
|
|
8790
8799
|
const totalGap = arrowSize + gap;
|
|
8791
8800
|
const openTooltip = useCallback13(() => {
|
|
8801
|
+
if (disabled) return;
|
|
8792
8802
|
if (closeTimerRef.current) clearTimeout(closeTimerRef.current);
|
|
8793
8803
|
setIsOpen(true);
|
|
8794
8804
|
setIsOpenLate(true);
|
|
@@ -8811,7 +8821,7 @@ var TooltipComponent = forwardRef16(function Tooltip({
|
|
|
8811
8821
|
}
|
|
8812
8822
|
}, 1);
|
|
8813
8823
|
onOpen?.();
|
|
8814
|
-
}, [onOpen, outsideScreenGap, totalGap]);
|
|
8824
|
+
}, [disabled, onOpen, outsideScreenGap, totalGap]);
|
|
8815
8825
|
const closeTooltip = useCallback13(() => {
|
|
8816
8826
|
setIsOpen(false);
|
|
8817
8827
|
closeTimerRef.current = setTimeout(() => setIsOpenLate(false), 300);
|
|
@@ -8887,6 +8897,7 @@ var TooltipComponent = forwardRef16(function Tooltip({
|
|
|
8887
8897
|
theme: theme2,
|
|
8888
8898
|
position,
|
|
8889
8899
|
align,
|
|
8900
|
+
pointerEvents: contentPointerEvents,
|
|
8890
8901
|
withArrow,
|
|
8891
8902
|
arrowSize,
|
|
8892
8903
|
gap,
|
|
@@ -9355,7 +9366,7 @@ var Foldable_default = Foldable2;
|
|
|
9355
9366
|
|
|
9356
9367
|
// src/components/SideMenu.tsx
|
|
9357
9368
|
import { memo as memo27, useCallback as useCallback16, useEffect as useEffect15, useMemo as useMemo12 } from "react";
|
|
9358
|
-
import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
9369
|
+
import { Fragment as Fragment8, jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
9359
9370
|
var MenuItemComponent = memo27(function MenuItemComponent2({ item, backgroundColor, onClick }) {
|
|
9360
9371
|
const reactRouterDomPlugin2 = usePlugin("react-router-dom");
|
|
9361
9372
|
if (!reactRouterDomPlugin2) {
|
|
@@ -9367,14 +9378,20 @@ var MenuItemComponent = memo27(function MenuItemComponent2({ item, backgroundCol
|
|
|
9367
9378
|
const theme2 = useTheme();
|
|
9368
9379
|
const mediaQuery = useMediaQuery();
|
|
9369
9380
|
const location = reactRouterDomPluginConfig.useLocation();
|
|
9370
|
-
const { colorTheme, components, sideMenuIsCollapsed } = useBetterHtmlContextInternal();
|
|
9381
|
+
const { colorTheme, components, sideMenuIsCollapsed, setSideMenuIsCollapsed } = useBetterHtmlContextInternal();
|
|
9371
9382
|
const [isOpened, setIsOpened] = useBooleanState();
|
|
9383
|
+
const isCollapsed = sideMenuIsCollapsed && !mediaQuery.size1000;
|
|
9372
9384
|
const onClickElement = useCallback16(() => {
|
|
9373
9385
|
if (item.disabled) return;
|
|
9374
|
-
if (item.
|
|
9375
|
-
|
|
9376
|
-
|
|
9377
|
-
|
|
9386
|
+
if (item.children) {
|
|
9387
|
+
setSideMenuIsCollapsed.setFalse();
|
|
9388
|
+
if (isCollapsed) setTimeout(setIsOpened.setTrue, 0.1 * 1e3);
|
|
9389
|
+
else setIsOpened.toggle();
|
|
9390
|
+
} else {
|
|
9391
|
+
if (item.onClickCloseSideMenu !== false) onClick?.();
|
|
9392
|
+
item.onClick?.(item);
|
|
9393
|
+
}
|
|
9394
|
+
}, [onClick, item, isCollapsed]);
|
|
9378
9395
|
const isActive = item.href ? location.pathname === "/" ? location.pathname === item.href : location.pathname.startsWith(item.href) && item.href !== "/" : false;
|
|
9379
9396
|
const readyBackgroundColor = backgroundColor ?? theme2.colors.backgroundContent;
|
|
9380
9397
|
const iconSize = 16;
|
|
@@ -9384,46 +9401,57 @@ var MenuItemComponent = memo27(function MenuItemComponent2({ item, backgroundCol
|
|
|
9384
9401
|
const lineHeight = 20;
|
|
9385
9402
|
const lineWidth = 2;
|
|
9386
9403
|
const lineEndRadius = iconSize / 2 + iconGap * 2;
|
|
9387
|
-
const content = /* @__PURE__ */
|
|
9388
|
-
|
|
9404
|
+
const content = /* @__PURE__ */ jsx27(
|
|
9405
|
+
Tooltip_default,
|
|
9389
9406
|
{
|
|
9390
|
-
|
|
9391
|
-
|
|
9392
|
-
|
|
9393
|
-
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
|
|
9397
|
-
|
|
9398
|
-
|
|
9399
|
-
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
9403
|
-
|
|
9404
|
-
|
|
9405
|
-
|
|
9406
|
-
|
|
9407
|
-
{
|
|
9408
|
-
|
|
9409
|
-
|
|
9410
|
-
|
|
9411
|
-
|
|
9412
|
-
|
|
9413
|
-
|
|
9414
|
-
|
|
9415
|
-
|
|
9416
|
-
|
|
9417
|
-
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
|
|
9425
|
-
|
|
9426
|
-
|
|
9407
|
+
content: /* @__PURE__ */ jsx27(Text_default, { whiteSpace: "nowrap", children: item.text }),
|
|
9408
|
+
contentPointerEvents: "none",
|
|
9409
|
+
withArrow: true,
|
|
9410
|
+
childrenWrapperWidth: "100%",
|
|
9411
|
+
disabled: !isCollapsed,
|
|
9412
|
+
position: "right",
|
|
9413
|
+
children: /* @__PURE__ */ jsxs23(
|
|
9414
|
+
Div_default.row,
|
|
9415
|
+
{
|
|
9416
|
+
alignItems: "center",
|
|
9417
|
+
gap: iconGap,
|
|
9418
|
+
whiteSpace: "nowrap",
|
|
9419
|
+
backgroundColor: isActive ? colorTheme === "dark" ? lightenColor(theme2.colors.primary, 0.7) : lightenColor(theme2.colors.primary, 0.85) : readyBackgroundColor,
|
|
9420
|
+
borderRadius: theme2.styles.borderRadius,
|
|
9421
|
+
paddingBlock,
|
|
9422
|
+
paddingLeft: isCollapsed ? theme2.styles.space : paddingLeft,
|
|
9423
|
+
paddingRight: theme2.styles.space,
|
|
9424
|
+
filterHover: `brightness(${colorTheme === "dark" ? isActive ? 0.8 : 1.3 : isActive ? 0.8 : 0.95})`,
|
|
9425
|
+
overflow: isCollapsed ? "hidden" : void 0,
|
|
9426
|
+
cursor: item.disabled ? "not-allowed" : "pointer",
|
|
9427
|
+
opacity: item.disabled ? 0.6 : void 0,
|
|
9428
|
+
onClick: onClickElement,
|
|
9429
|
+
children: [
|
|
9430
|
+
/* @__PURE__ */ jsx27(Icon_default, { name: item.iconName, color: theme2.colors.primary, size: iconSize, flexShrink: 0 }),
|
|
9431
|
+
/* @__PURE__ */ jsx27(
|
|
9432
|
+
Text_default,
|
|
9433
|
+
{
|
|
9434
|
+
flex: 1,
|
|
9435
|
+
lineHeight: `${lineHeight}px`,
|
|
9436
|
+
color: isActive ? theme2.colors.primary : theme2.colors.textPrimary,
|
|
9437
|
+
opacity: isCollapsed ? 0 : void 0,
|
|
9438
|
+
transition: theme2.styles.transition,
|
|
9439
|
+
children: item.text
|
|
9440
|
+
}
|
|
9441
|
+
),
|
|
9442
|
+
item.children && /* @__PURE__ */ jsx27(
|
|
9443
|
+
Icon_default,
|
|
9444
|
+
{
|
|
9445
|
+
name: "chevronDown",
|
|
9446
|
+
color: theme2.colors.textSecondary,
|
|
9447
|
+
size: 14,
|
|
9448
|
+
transform: isOpened ? "rotate(180deg)" : void 0,
|
|
9449
|
+
transition: theme2.styles.transition
|
|
9450
|
+
}
|
|
9451
|
+
)
|
|
9452
|
+
]
|
|
9453
|
+
}
|
|
9454
|
+
)
|
|
9427
9455
|
}
|
|
9428
9456
|
);
|
|
9429
9457
|
useEffect15(() => {
|
|
@@ -9512,6 +9540,7 @@ var SideMenuComponent = function SideMenu({
|
|
|
9512
9540
|
widthMobileHandle,
|
|
9513
9541
|
absoluteComponent,
|
|
9514
9542
|
additionalComponent,
|
|
9543
|
+
isLoading,
|
|
9515
9544
|
backgroundColor,
|
|
9516
9545
|
paddingTop
|
|
9517
9546
|
}) {
|
|
@@ -9584,45 +9613,47 @@ var SideMenuComponent = function SideMenu({
|
|
|
9584
9613
|
) }),
|
|
9585
9614
|
withCloseButton && mediaQuery.size1000 && /* @__PURE__ */ jsx27(Button_default.icon, { icon: "XMark", marginLeft: "auto", onClick: onClickXButton })
|
|
9586
9615
|
] }),
|
|
9587
|
-
/* @__PURE__ */
|
|
9588
|
-
|
|
9589
|
-
|
|
9590
|
-
|
|
9591
|
-
|
|
9592
|
-
|
|
9593
|
-
|
|
9594
|
-
|
|
9595
|
-
|
|
9596
|
-
|
|
9597
|
-
|
|
9598
|
-
|
|
9599
|
-
|
|
9600
|
-
|
|
9601
|
-
|
|
9602
|
-
|
|
9603
|
-
|
|
9604
|
-
|
|
9605
|
-
|
|
9606
|
-
|
|
9607
|
-
|
|
9608
|
-
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
|
|
9613
|
-
|
|
9614
|
-
|
|
9615
|
-
|
|
9616
|
-
|
|
9617
|
-
|
|
9618
|
-
|
|
9619
|
-
|
|
9620
|
-
|
|
9621
|
-
|
|
9622
|
-
|
|
9623
|
-
|
|
9624
|
-
|
|
9625
|
-
|
|
9616
|
+
!isLoading ? /* @__PURE__ */ jsxs23(Fragment8, { children: [
|
|
9617
|
+
/* @__PURE__ */ jsx27(
|
|
9618
|
+
Div_default.column,
|
|
9619
|
+
{
|
|
9620
|
+
width: "100%",
|
|
9621
|
+
height: "100%",
|
|
9622
|
+
overflowY: !isCollapsed ? "auto" : void 0,
|
|
9623
|
+
paddingInline: theme2.styles.space,
|
|
9624
|
+
paddingBottom: !isCollapsable && !readyBottomItems ? theme2.styles.space : void 0,
|
|
9625
|
+
children: /* @__PURE__ */ jsx27(Div_default.column, { gap: theme2.styles.gap / 2, children: readyItems.map((item) => /* @__PURE__ */ jsx27(
|
|
9626
|
+
MenuItemComponent,
|
|
9627
|
+
{
|
|
9628
|
+
item,
|
|
9629
|
+
backgroundColor: readyBackgroundColor,
|
|
9630
|
+
onClick: onClickXButton
|
|
9631
|
+
},
|
|
9632
|
+
item.text
|
|
9633
|
+
)) })
|
|
9634
|
+
}
|
|
9635
|
+
),
|
|
9636
|
+
readyBottomItems && /* @__PURE__ */ jsx27(
|
|
9637
|
+
Div_default.column,
|
|
9638
|
+
{
|
|
9639
|
+
borderTop: mediaQuery.size1000 ? `solid 1px ${theme2.colors.border}` : void 0,
|
|
9640
|
+
gap: theme2.styles.gap / 2,
|
|
9641
|
+
marginTop: "auto",
|
|
9642
|
+
paddingTop: mediaQuery.size1000 ? theme2.styles.space : void 0,
|
|
9643
|
+
paddingInline: theme2.styles.space,
|
|
9644
|
+
paddingBottom: !isCollapsable ? theme2.styles.space : void 0,
|
|
9645
|
+
children: readyBottomItems.map((item) => /* @__PURE__ */ jsx27(
|
|
9646
|
+
MenuItemComponent,
|
|
9647
|
+
{
|
|
9648
|
+
item,
|
|
9649
|
+
backgroundColor: readyBackgroundColor,
|
|
9650
|
+
onClick: onClickXButton
|
|
9651
|
+
},
|
|
9652
|
+
item.text
|
|
9653
|
+
))
|
|
9654
|
+
}
|
|
9655
|
+
)
|
|
9656
|
+
] }) : /* @__PURE__ */ jsx27(Div_default, { flex: 1, children: /* @__PURE__ */ jsx27(Loader_default.box, { text: isCollapsed ? "" : void 0 }) }),
|
|
9626
9657
|
additionalComponent,
|
|
9627
9658
|
isCollapsable && /* @__PURE__ */ jsx27(
|
|
9628
9659
|
Div_default,
|