react-better-html 1.1.236 → 1.1.238
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 +13 -3
- package/dist/index.d.ts +13 -3
- package/dist/index.js +122 -61
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +123 -61
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Color, BetterCoreProviderConfig, DeepPartialRecord, OmitProps, BetterCoreConfig, IconName, AnyOtherString, PartialRecord, AssetName, LoaderName, PickValue, Country } from 'react-better-core';
|
|
2
|
-
export { API, APIConfigItem, APIError, APIResponse, AnyOtherString, AssetName, AssetsConfig, Color, ColorName, ColorTheme, Colors, Country, DeepPartialRecord, ExcludeOptions, HttpHeaders as HttpHeader, HttpMethod, IconName, IconsConfig, LoaderConfig, LoaderName, OmitProps, PartialRecord, PickAllRequired, PickValue, Styles, Theme, ThemeConfig, Unsubscribe, UrlQuery, colorThemeControls, countries, darkenColor, desaturateColor, eventPreventDefault, eventPreventStop, eventStopPropagation, formatPhoneNumber, generateApi, generateEventEmitter, generateRandomString, getPluralWord, isApiError, lightenColor, loaderControls, log, saturateColor, useBooleanState, useDebounceState, useLoader, useLoaderControls, useTheme } from 'react-better-core';
|
|
2
|
+
export { API, APIConfigItem, APIError, APIResponse, AnyOtherString, AssetName, AssetsConfig, Color, ColorName, ColorTheme, Colors, Country, DeepPartialRecord, ExcludeOptions, HttpHeaders as HttpHeader, HttpMethod, IconName, IconsConfig, LoaderConfig, LoaderName, OmitProps, PartialRecord, PickAllRequired, PickValue, Styles, Theme, ThemeConfig, Unsubscribe, UrlQuery, calculateColorContrast, colorThemeControls, countries, darkenColor, desaturateColor, eventPreventDefault, eventPreventStop, eventStopPropagation, formatPhoneNumber, generateApi, generateEventEmitter, generateRandomString, getPluralWord, isApiError, lightenColor, loaderControls, log, saturateColor, useBooleanState, useDebounceState, useLoader, useLoaderControls, useTheme } from 'react-better-core';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { ComponentProps, ReactNode } from 'react';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
@@ -582,6 +582,7 @@ type PageHolderProps = {
|
|
|
582
582
|
type PageHolderComponentType = {
|
|
583
583
|
(props: ComponentPropWithRef<HTMLDivElement, PageHolderProps>): React.ReactElement;
|
|
584
584
|
center: (props: ComponentPropWithRef<HTMLDivElement, PageHolderProps & {
|
|
585
|
+
height?: React.CSSProperties["height"];
|
|
585
586
|
pageBackgroundColor?: React.CSSProperties["backgroundColor"];
|
|
586
587
|
pageBackgroundImage?: React.CSSProperties["backgroundImage"];
|
|
587
588
|
contentMaxWidth?: React.CSSProperties["maxWidth"];
|
|
@@ -591,7 +592,7 @@ type PageHolderComponentType = {
|
|
|
591
592
|
sideComponent?: React.ReactNode;
|
|
592
593
|
/** @default "right" */
|
|
593
594
|
sideComponentPosition?: "left" | "right";
|
|
594
|
-
}>) => React.ReactElement;
|
|
595
|
+
} & ComponentMarginProps>) => React.ReactElement;
|
|
595
596
|
};
|
|
596
597
|
declare const PageHolderComponent: PageHolderComponentType;
|
|
597
598
|
declare const PageHolder: typeof PageHolderComponent & {
|
|
@@ -1030,11 +1031,20 @@ type SideMenuProps = {
|
|
|
1030
1031
|
withCloseButton?: boolean;
|
|
1031
1032
|
widthMobileHandle?: boolean;
|
|
1032
1033
|
absoluteComponent?: React.ReactNode;
|
|
1033
|
-
|
|
1034
|
+
itemsAdditionalComponent?: React.ReactNode;
|
|
1035
|
+
betweenItemsAdditionalComponent?: React.ReactNode;
|
|
1036
|
+
bottomItemsAdditionalComponent?: React.ReactNode;
|
|
1034
1037
|
isLoading?: boolean;
|
|
1035
1038
|
/** @default backgroundContent */
|
|
1036
1039
|
backgroundColor?: React.CSSProperties["backgroundColor"];
|
|
1040
|
+
/** @default primary */
|
|
1041
|
+
activeItemColor?: string;
|
|
1042
|
+
hoverItemColor?: string;
|
|
1043
|
+
gap?: React.CSSProperties["gap"];
|
|
1037
1044
|
paddingTop?: React.CSSProperties["paddingTop"];
|
|
1045
|
+
paddingBottom?: React.CSSProperties["paddingBottom"];
|
|
1046
|
+
renderItemsHolder?: (items: React.ReactNode) => React.ReactNode;
|
|
1047
|
+
renderBottomItemsHolder?: (items: React.ReactNode) => React.ReactNode;
|
|
1038
1048
|
};
|
|
1039
1049
|
type SideMenuComponentType = {
|
|
1040
1050
|
(props: SideMenuProps): React.ReactElement;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Color, BetterCoreProviderConfig, DeepPartialRecord, OmitProps, BetterCoreConfig, IconName, AnyOtherString, PartialRecord, AssetName, LoaderName, PickValue, Country } from 'react-better-core';
|
|
2
|
-
export { API, APIConfigItem, APIError, APIResponse, AnyOtherString, AssetName, AssetsConfig, Color, ColorName, ColorTheme, Colors, Country, DeepPartialRecord, ExcludeOptions, HttpHeaders as HttpHeader, HttpMethod, IconName, IconsConfig, LoaderConfig, LoaderName, OmitProps, PartialRecord, PickAllRequired, PickValue, Styles, Theme, ThemeConfig, Unsubscribe, UrlQuery, colorThemeControls, countries, darkenColor, desaturateColor, eventPreventDefault, eventPreventStop, eventStopPropagation, formatPhoneNumber, generateApi, generateEventEmitter, generateRandomString, getPluralWord, isApiError, lightenColor, loaderControls, log, saturateColor, useBooleanState, useDebounceState, useLoader, useLoaderControls, useTheme } from 'react-better-core';
|
|
2
|
+
export { API, APIConfigItem, APIError, APIResponse, AnyOtherString, AssetName, AssetsConfig, Color, ColorName, ColorTheme, Colors, Country, DeepPartialRecord, ExcludeOptions, HttpHeaders as HttpHeader, HttpMethod, IconName, IconsConfig, LoaderConfig, LoaderName, OmitProps, PartialRecord, PickAllRequired, PickValue, Styles, Theme, ThemeConfig, Unsubscribe, UrlQuery, calculateColorContrast, colorThemeControls, countries, darkenColor, desaturateColor, eventPreventDefault, eventPreventStop, eventStopPropagation, formatPhoneNumber, generateApi, generateEventEmitter, generateRandomString, getPluralWord, isApiError, lightenColor, loaderControls, log, saturateColor, useBooleanState, useDebounceState, useLoader, useLoaderControls, useTheme } from 'react-better-core';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { ComponentProps, ReactNode } from 'react';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
@@ -582,6 +582,7 @@ type PageHolderProps = {
|
|
|
582
582
|
type PageHolderComponentType = {
|
|
583
583
|
(props: ComponentPropWithRef<HTMLDivElement, PageHolderProps>): React.ReactElement;
|
|
584
584
|
center: (props: ComponentPropWithRef<HTMLDivElement, PageHolderProps & {
|
|
585
|
+
height?: React.CSSProperties["height"];
|
|
585
586
|
pageBackgroundColor?: React.CSSProperties["backgroundColor"];
|
|
586
587
|
pageBackgroundImage?: React.CSSProperties["backgroundImage"];
|
|
587
588
|
contentMaxWidth?: React.CSSProperties["maxWidth"];
|
|
@@ -591,7 +592,7 @@ type PageHolderComponentType = {
|
|
|
591
592
|
sideComponent?: React.ReactNode;
|
|
592
593
|
/** @default "right" */
|
|
593
594
|
sideComponentPosition?: "left" | "right";
|
|
594
|
-
}>) => React.ReactElement;
|
|
595
|
+
} & ComponentMarginProps>) => React.ReactElement;
|
|
595
596
|
};
|
|
596
597
|
declare const PageHolderComponent: PageHolderComponentType;
|
|
597
598
|
declare const PageHolder: typeof PageHolderComponent & {
|
|
@@ -1030,11 +1031,20 @@ type SideMenuProps = {
|
|
|
1030
1031
|
withCloseButton?: boolean;
|
|
1031
1032
|
widthMobileHandle?: boolean;
|
|
1032
1033
|
absoluteComponent?: React.ReactNode;
|
|
1033
|
-
|
|
1034
|
+
itemsAdditionalComponent?: React.ReactNode;
|
|
1035
|
+
betweenItemsAdditionalComponent?: React.ReactNode;
|
|
1036
|
+
bottomItemsAdditionalComponent?: React.ReactNode;
|
|
1034
1037
|
isLoading?: boolean;
|
|
1035
1038
|
/** @default backgroundContent */
|
|
1036
1039
|
backgroundColor?: React.CSSProperties["backgroundColor"];
|
|
1040
|
+
/** @default primary */
|
|
1041
|
+
activeItemColor?: string;
|
|
1042
|
+
hoverItemColor?: string;
|
|
1043
|
+
gap?: React.CSSProperties["gap"];
|
|
1037
1044
|
paddingTop?: React.CSSProperties["paddingTop"];
|
|
1045
|
+
paddingBottom?: React.CSSProperties["paddingBottom"];
|
|
1046
|
+
renderItemsHolder?: (items: React.ReactNode) => React.ReactNode;
|
|
1047
|
+
renderBottomItemsHolder?: (items: React.ReactNode) => React.ReactNode;
|
|
1038
1048
|
};
|
|
1039
1049
|
type SideMenuComponentType = {
|
|
1040
1050
|
(props: SideMenuProps): React.ReactElement;
|
package/dist/index.js
CHANGED
|
@@ -57,6 +57,7 @@ __export(index_exports, {
|
|
|
57
57
|
Tooltip: () => Tooltip_default,
|
|
58
58
|
alertControls: () => alertControls,
|
|
59
59
|
alertsPlugin: () => alertsPlugin,
|
|
60
|
+
calculateColorContrast: () => import_react_better_core30.calculateColorContrast,
|
|
60
61
|
colorThemeControls: () => import_react_better_core30.colorThemeControls,
|
|
61
62
|
countries: () => import_react_better_core30.countries,
|
|
62
63
|
darkenColor: () => import_react_better_core30.darkenColor,
|
|
@@ -3356,6 +3357,7 @@ var PageHolderComponent = (0, import_react15.forwardRef)(function PageHolder({ n
|
|
|
3356
3357
|
);
|
|
3357
3358
|
});
|
|
3358
3359
|
PageHolderComponent.center = (0, import_react15.forwardRef)(function Center({
|
|
3360
|
+
height,
|
|
3359
3361
|
pageBackgroundColor,
|
|
3360
3362
|
pageBackgroundImage,
|
|
3361
3363
|
contentMaxWidth,
|
|
@@ -3398,18 +3400,29 @@ PageHolderComponent.center = (0, import_react15.forwardRef)(function Center({
|
|
|
3398
3400
|
}
|
|
3399
3401
|
),
|
|
3400
3402
|
sideComponentPosition === "left" && withSideComponent && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Div_default, { width: "50%" }),
|
|
3401
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3402
|
-
|
|
3403
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3404
|
+
Div_default.column,
|
|
3403
3405
|
{
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3406
|
+
position: "relative",
|
|
3407
|
+
width: `${withSideComponent ? 50 : 100}%`,
|
|
3408
|
+
height,
|
|
3409
|
+
alignItems: "center",
|
|
3410
|
+
zIndex: 2,
|
|
3411
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3412
|
+
ContentTag,
|
|
3413
|
+
{
|
|
3414
|
+
width: `calc(100% - ${theme2.styles.space * 2}px)`,
|
|
3415
|
+
maxWidth: !noMaxContentWidth ? contentMaxWidth ?? app.contentMaxWidth / 2 : void 0,
|
|
3416
|
+
height,
|
|
3417
|
+
marginInline: theme2.styles.space,
|
|
3418
|
+
marginBlock: theme2.styles.space,
|
|
3419
|
+
...props,
|
|
3420
|
+
ref,
|
|
3421
|
+
children
|
|
3422
|
+
}
|
|
3423
|
+
)
|
|
3411
3424
|
}
|
|
3412
|
-
)
|
|
3425
|
+
),
|
|
3413
3426
|
sideComponentPosition === "right" && withSideComponent && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Div_default, { width: "50%" }),
|
|
3414
3427
|
withSideComponent && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3415
3428
|
Div_default,
|
|
@@ -5563,7 +5576,12 @@ var FormComponent = (0, import_react23.forwardRef)(function Form({
|
|
|
5563
5576
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Div_default, { width: "100%", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("form", { name, onSubmit: onSubmit ?? form?.onSubmit, ref, children: [
|
|
5564
5577
|
gap !== void 0 || withDividers ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Div_default.column, { gap: gap ?? (withDividers ? theme2.styles.space : theme2.styles.gap), children: withDividers ? import_react23.Children.toArray(children).map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react23.Fragment, { children: [
|
|
5565
5578
|
child,
|
|
5566
|
-
index < import_react23.Children.toArray(children).length - 1 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
5579
|
+
index < import_react23.Children.toArray(children).length - 1 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
5580
|
+
Divider_default.horizontal,
|
|
5581
|
+
{
|
|
5582
|
+
width: theme2.styles.borderWidth === 0 ? 1 : theme2.styles.borderWidth
|
|
5583
|
+
}
|
|
5584
|
+
)
|
|
5567
5585
|
] }, index)) : children }) : children,
|
|
5568
5586
|
submitButtonText && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
5569
5587
|
Div_default.row,
|
|
@@ -7006,7 +7024,15 @@ TooltipComponent.item = (0, import_react28.forwardRef)(function Item({
|
|
|
7006
7024
|
});
|
|
7007
7025
|
TooltipComponent.divider = (0, import_react28.forwardRef)(function DividerComponent(props, ref) {
|
|
7008
7026
|
const theme2 = (0, import_react_better_core26.useTheme)();
|
|
7009
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
7027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
7028
|
+
Divider_default.horizontal,
|
|
7029
|
+
{
|
|
7030
|
+
width: theme2.styles.borderWidth === 0 ? 1 : theme2.styles.borderWidth,
|
|
7031
|
+
marginBlock: theme2.styles.gap,
|
|
7032
|
+
...props,
|
|
7033
|
+
ref
|
|
7034
|
+
}
|
|
7035
|
+
);
|
|
7010
7036
|
});
|
|
7011
7037
|
TooltipComponent.sectionTitle = (0, import_react28.forwardRef)(function SectionTitle({ text, ...props }, ref) {
|
|
7012
7038
|
const theme2 = (0, import_react_better_core26.useTheme)();
|
|
@@ -7337,7 +7363,7 @@ var FoldableComponent = (0, import_react30.forwardRef)(function Foldable({
|
|
|
7337
7363
|
]
|
|
7338
7364
|
}
|
|
7339
7365
|
),
|
|
7340
|
-
/* @__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, { width: theme2.styles.borderWidth }) }),
|
|
7366
|
+
/* @__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, { width: theme2.styles.borderWidth === 0 ? 1 : theme2.styles.borderWidth }) }),
|
|
7341
7367
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
7342
7368
|
Div_default,
|
|
7343
7369
|
{
|
|
@@ -7385,7 +7411,13 @@ var useSideMenuContext = () => {
|
|
|
7385
7411
|
}
|
|
7386
7412
|
return context;
|
|
7387
7413
|
};
|
|
7388
|
-
var MenuItemComponent = (0, import_react31.memo)(function MenuItemComponent2({
|
|
7414
|
+
var MenuItemComponent = (0, import_react31.memo)(function MenuItemComponent2({
|
|
7415
|
+
item,
|
|
7416
|
+
backgroundColor,
|
|
7417
|
+
activeItemColor,
|
|
7418
|
+
hoverItemColor,
|
|
7419
|
+
onClick
|
|
7420
|
+
}) {
|
|
7389
7421
|
const reactRouterDomPlugin2 = usePlugin("react-router-dom");
|
|
7390
7422
|
if (!reactRouterDomPlugin2) {
|
|
7391
7423
|
throw new Error(
|
|
@@ -7426,6 +7458,7 @@ var MenuItemComponent = (0, import_react31.memo)(function MenuItemComponent2({ i
|
|
|
7426
7458
|
const lineHeight = 20;
|
|
7427
7459
|
const lineWidth = 2;
|
|
7428
7460
|
const lineEndRadius = iconSize / 2 + iconGap * 2;
|
|
7461
|
+
const backgroundColorContrast = activeItemColor ? (0, import_react_better_core29.calculateColorContrast)(activeItemColor, theme2.colors.primary) : 21;
|
|
7429
7462
|
const content = /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7430
7463
|
Tooltip_default,
|
|
7431
7464
|
{
|
|
@@ -7444,24 +7477,33 @@ var MenuItemComponent = (0, import_react31.memo)(function MenuItemComponent2({ i
|
|
|
7444
7477
|
alignItems: "center",
|
|
7445
7478
|
gap: iconGap,
|
|
7446
7479
|
whiteSpace: "nowrap",
|
|
7447
|
-
backgroundColor: isActive ? colorTheme === "dark" ? (0, import_react_better_core29.lightenColor)(theme2.colors.primary, 0.7) : (0, import_react_better_core29.lightenColor)(theme2.colors.primary, 0.85) : readyBackgroundColor,
|
|
7480
|
+
backgroundColor: isActive ? activeItemColor ?? (colorTheme === "dark" ? (0, import_react_better_core29.lightenColor)(theme2.colors.primary, 0.7) : (0, import_react_better_core29.lightenColor)(theme2.colors.primary, 0.85)) : readyBackgroundColor,
|
|
7481
|
+
backgroundColorHover: hoverItemColor,
|
|
7448
7482
|
borderRadius: theme2.styles.borderRadius,
|
|
7449
7483
|
paddingBlock,
|
|
7450
7484
|
paddingLeft: isCollapsed ? theme2.styles.space : paddingLeft,
|
|
7451
7485
|
paddingRight: theme2.styles.space,
|
|
7452
|
-
filterHover: `brightness(${colorTheme === "dark" ? isActive ? 0.8 : 1.3 : isActive ? 0.8 : 0.95})
|
|
7486
|
+
filterHover: !hoverItemColor ? `brightness(${colorTheme === "dark" ? isActive ? 0.8 : 1.3 : isActive ? 0.8 : 0.95})` : void 0,
|
|
7453
7487
|
overflow: isCollapsed ? "hidden" : void 0,
|
|
7454
7488
|
cursor: item.disabled ? "not-allowed" : "pointer",
|
|
7455
7489
|
opacity: item.disabled ? 0.6 : void 0,
|
|
7456
7490
|
onClick: onClickElement,
|
|
7457
7491
|
children: [
|
|
7458
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7492
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7493
|
+
Icon_default,
|
|
7494
|
+
{
|
|
7495
|
+
name: item.iconName,
|
|
7496
|
+
color: isActive && backgroundColorContrast < 7 ? theme2.colors.base : theme2.colors.primary,
|
|
7497
|
+
size: iconSize,
|
|
7498
|
+
flexShrink: 0
|
|
7499
|
+
}
|
|
7500
|
+
),
|
|
7459
7501
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7460
7502
|
Text_default,
|
|
7461
7503
|
{
|
|
7462
7504
|
flex: 1,
|
|
7463
7505
|
lineHeight: `${lineHeight}px`,
|
|
7464
|
-
color: isActive ? theme2.colors.primary : theme2.colors.textPrimary,
|
|
7506
|
+
color: isActive ? backgroundColorContrast < 7 ? theme2.colors.base : theme2.colors.primary : theme2.colors.textPrimary,
|
|
7465
7507
|
opacity: isCollapsed ? 0 : void 0,
|
|
7466
7508
|
transition: theme2.styles.transition,
|
|
7467
7509
|
children: item.text
|
|
@@ -7596,10 +7638,18 @@ var SideMenuComponent = function SideMenu({
|
|
|
7596
7638
|
withCloseButton,
|
|
7597
7639
|
widthMobileHandle,
|
|
7598
7640
|
absoluteComponent,
|
|
7599
|
-
|
|
7641
|
+
itemsAdditionalComponent,
|
|
7642
|
+
betweenItemsAdditionalComponent,
|
|
7643
|
+
bottomItemsAdditionalComponent,
|
|
7600
7644
|
isLoading,
|
|
7601
7645
|
backgroundColor,
|
|
7602
|
-
|
|
7646
|
+
activeItemColor,
|
|
7647
|
+
hoverItemColor,
|
|
7648
|
+
gap,
|
|
7649
|
+
paddingTop,
|
|
7650
|
+
paddingBottom,
|
|
7651
|
+
renderItemsHolder,
|
|
7652
|
+
renderBottomItemsHolder
|
|
7603
7653
|
}) {
|
|
7604
7654
|
const theme2 = (0, import_react_better_core29.useTheme)();
|
|
7605
7655
|
const mediaQuery = useMediaQuery();
|
|
@@ -7624,9 +7674,53 @@ var SideMenuComponent = function SideMenu({
|
|
|
7624
7674
|
const sideMenuCollapsedWidth = theme2.styles.space + theme2.styles.space * 2 + 16 + theme2.styles.space;
|
|
7625
7675
|
const readyBackgroundColor = backgroundColor ?? theme2.colors.backgroundContent;
|
|
7626
7676
|
const logoSize = sideMenuCollapsedWidth - theme2.styles.space * 2;
|
|
7677
|
+
const itemsComponent = /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7678
|
+
Div_default.column,
|
|
7679
|
+
{
|
|
7680
|
+
width: "100%",
|
|
7681
|
+
height: "100%",
|
|
7682
|
+
overflowY: !isCollapsed ? "auto" : void 0,
|
|
7683
|
+
paddingInline: !renderItemsHolder ? theme2.styles.space : void 0,
|
|
7684
|
+
paddingBottom: !renderItemsHolder ? !isCollapsable && !readyBottomItems ? theme2.styles.space : void 0 : void 0,
|
|
7685
|
+
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)(
|
|
7686
|
+
MenuItemComponent,
|
|
7687
|
+
{
|
|
7688
|
+
item,
|
|
7689
|
+
backgroundColor: readyBackgroundColor,
|
|
7690
|
+
activeItemColor,
|
|
7691
|
+
hoverItemColor,
|
|
7692
|
+
onClick: onClickXButton
|
|
7693
|
+
},
|
|
7694
|
+
item.text
|
|
7695
|
+
)) })
|
|
7696
|
+
}
|
|
7697
|
+
);
|
|
7698
|
+
const bottomItemsComponent = /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7699
|
+
Div_default.column,
|
|
7700
|
+
{
|
|
7701
|
+
borderTop: mediaQuery.size1000 ? `solid ${theme2.styles.borderWidth}px ${theme2.colors.border}` : void 0,
|
|
7702
|
+
gap: theme2.styles.gap / 2,
|
|
7703
|
+
marginTop: "auto",
|
|
7704
|
+
paddingTop: mediaQuery.size1000 ? theme2.styles.space : void 0,
|
|
7705
|
+
paddingInline: !renderItemsHolder ? theme2.styles.space : void 0,
|
|
7706
|
+
paddingBottom: !renderItemsHolder ? !isCollapsable ? theme2.styles.space : void 0 : void 0,
|
|
7707
|
+
children: readyBottomItems?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7708
|
+
MenuItemComponent,
|
|
7709
|
+
{
|
|
7710
|
+
item,
|
|
7711
|
+
backgroundColor: readyBackgroundColor,
|
|
7712
|
+
activeItemColor,
|
|
7713
|
+
hoverItemColor,
|
|
7714
|
+
onClick: onClickXButton
|
|
7715
|
+
},
|
|
7716
|
+
item.text
|
|
7717
|
+
))
|
|
7718
|
+
}
|
|
7719
|
+
);
|
|
7627
7720
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SideMenuContextProvider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
7628
7721
|
Div_default.column,
|
|
7629
7722
|
{
|
|
7723
|
+
as: "aside",
|
|
7630
7724
|
position: "fixed",
|
|
7631
7725
|
width: mediaQuery.size1000 ? "100%" : isCollapsed ? sideMenuCollapsedWidth : sideMenuWidth,
|
|
7632
7726
|
height: `calc(100svh - ${topSpace}px)`,
|
|
@@ -7636,11 +7730,12 @@ var SideMenuComponent = function SideMenu({
|
|
|
7636
7730
|
borderRight: `solid ${theme2.styles.borderWidth}px ${theme2.colors.border}`,
|
|
7637
7731
|
transform: !mediaQuery.size1000 || sideMenuIsOpenMobile ? "translateX(0)" : "translateX(-100%)",
|
|
7638
7732
|
paddingTop: paddingTop ?? (logoAssetName || logoUrl ? theme2.styles.gap : theme2.styles.space),
|
|
7733
|
+
paddingBottom,
|
|
7639
7734
|
transition: mediaQuery.size1000 ? !isCollapsed ? `transform ${theme2.styles.transition}` : "none" : theme2.styles.transition,
|
|
7640
7735
|
userSelect: "none",
|
|
7641
7736
|
zIndex: 10,
|
|
7642
7737
|
children: [
|
|
7643
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Div_default.column, { width: "100%", height: "100%", gap: theme2.styles.space, children: [
|
|
7738
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Div_default.column, { width: "100%", height: "100%", gap: gap ?? theme2.styles.space, children: [
|
|
7644
7739
|
(logoAssetName || logoUrl || withCloseButton && mediaQuery.size1000) && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Div_default.row, { alignItems: "center", paddingInline: theme2.styles.space, children: [
|
|
7645
7740
|
(logoAssetName || logoUrl) && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LinkComponentTag, { to: "/", href: "/", onClick: onClickXButton, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
7646
7741
|
Div_default.row,
|
|
@@ -7678,48 +7773,13 @@ var SideMenuComponent = function SideMenu({
|
|
|
7678
7773
|
) }),
|
|
7679
7774
|
withCloseButton && mediaQuery.size1000 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button_default.icon, { icon: "XMark", marginLeft: "auto", onClick: onClickXButton })
|
|
7680
7775
|
] }),
|
|
7776
|
+
itemsAdditionalComponent,
|
|
7681
7777
|
!isLoading ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
width: "100%",
|
|
7686
|
-
height: "100%",
|
|
7687
|
-
overflowY: !isCollapsed ? "auto" : void 0,
|
|
7688
|
-
paddingInline: theme2.styles.space,
|
|
7689
|
-
paddingBottom: !isCollapsable && !readyBottomItems ? theme2.styles.space : void 0,
|
|
7690
|
-
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)(
|
|
7691
|
-
MenuItemComponent,
|
|
7692
|
-
{
|
|
7693
|
-
item,
|
|
7694
|
-
backgroundColor: readyBackgroundColor,
|
|
7695
|
-
onClick: onClickXButton
|
|
7696
|
-
},
|
|
7697
|
-
item.text
|
|
7698
|
-
)) })
|
|
7699
|
-
}
|
|
7700
|
-
),
|
|
7701
|
-
readyBottomItems && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7702
|
-
Div_default.column,
|
|
7703
|
-
{
|
|
7704
|
-
borderTop: mediaQuery.size1000 ? `solid ${theme2.styles.borderWidth}px ${theme2.colors.border}` : void 0,
|
|
7705
|
-
gap: theme2.styles.gap / 2,
|
|
7706
|
-
marginTop: "auto",
|
|
7707
|
-
paddingTop: mediaQuery.size1000 ? theme2.styles.space : void 0,
|
|
7708
|
-
paddingInline: theme2.styles.space,
|
|
7709
|
-
paddingBottom: !isCollapsable ? theme2.styles.space : void 0,
|
|
7710
|
-
children: readyBottomItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7711
|
-
MenuItemComponent,
|
|
7712
|
-
{
|
|
7713
|
-
item,
|
|
7714
|
-
backgroundColor: readyBackgroundColor,
|
|
7715
|
-
onClick: onClickXButton
|
|
7716
|
-
},
|
|
7717
|
-
item.text
|
|
7718
|
-
))
|
|
7719
|
-
}
|
|
7720
|
-
)
|
|
7778
|
+
renderItemsHolder ? renderItemsHolder(itemsComponent) : itemsComponent,
|
|
7779
|
+
betweenItemsAdditionalComponent,
|
|
7780
|
+
readyBottomItems && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_jsx_runtime28.Fragment, { children: renderBottomItemsHolder ? renderBottomItemsHolder(bottomItemsComponent) : bottomItemsComponent })
|
|
7721
7781
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Div_default, { flex: 1, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Loader_default.box, { text: isCollapsed ? "" : void 0 }) }),
|
|
7722
|
-
|
|
7782
|
+
bottomItemsAdditionalComponent,
|
|
7723
7783
|
isCollapsable && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7724
7784
|
Div_default,
|
|
7725
7785
|
{
|
|
@@ -7908,6 +7968,7 @@ var SideMenu_default = SideMenu2;
|
|
|
7908
7968
|
Tooltip,
|
|
7909
7969
|
alertControls,
|
|
7910
7970
|
alertsPlugin,
|
|
7971
|
+
calculateColorContrast,
|
|
7911
7972
|
colorThemeControls,
|
|
7912
7973
|
countries,
|
|
7913
7974
|
darkenColor,
|