react-better-html 1.1.235 → 1.1.237
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 +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +73 -46
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +73 -46
- 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, 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, 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, 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';
|
|
@@ -1030,11 +1030,17 @@ type SideMenuProps = {
|
|
|
1030
1030
|
withCloseButton?: boolean;
|
|
1031
1031
|
widthMobileHandle?: boolean;
|
|
1032
1032
|
absoluteComponent?: React.ReactNode;
|
|
1033
|
-
|
|
1033
|
+
itemsAdditionalComponent?: React.ReactNode;
|
|
1034
|
+
betweenItemsAdditionalComponent?: React.ReactNode;
|
|
1035
|
+
bottomItemsAdditionalComponent?: React.ReactNode;
|
|
1034
1036
|
isLoading?: boolean;
|
|
1035
1037
|
/** @default backgroundContent */
|
|
1036
1038
|
backgroundColor?: React.CSSProperties["backgroundColor"];
|
|
1039
|
+
gap?: React.CSSProperties["gap"];
|
|
1037
1040
|
paddingTop?: React.CSSProperties["paddingTop"];
|
|
1041
|
+
paddingBottom?: React.CSSProperties["paddingBottom"];
|
|
1042
|
+
renderItemsHolder?: (items: React.ReactNode) => React.ReactNode;
|
|
1043
|
+
renderBottomItemsHolder?: (items: React.ReactNode) => React.ReactNode;
|
|
1038
1044
|
};
|
|
1039
1045
|
type SideMenuComponentType = {
|
|
1040
1046
|
(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, 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, 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, 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';
|
|
@@ -1030,11 +1030,17 @@ type SideMenuProps = {
|
|
|
1030
1030
|
withCloseButton?: boolean;
|
|
1031
1031
|
widthMobileHandle?: boolean;
|
|
1032
1032
|
absoluteComponent?: React.ReactNode;
|
|
1033
|
-
|
|
1033
|
+
itemsAdditionalComponent?: React.ReactNode;
|
|
1034
|
+
betweenItemsAdditionalComponent?: React.ReactNode;
|
|
1035
|
+
bottomItemsAdditionalComponent?: React.ReactNode;
|
|
1034
1036
|
isLoading?: boolean;
|
|
1035
1037
|
/** @default backgroundContent */
|
|
1036
1038
|
backgroundColor?: React.CSSProperties["backgroundColor"];
|
|
1039
|
+
gap?: React.CSSProperties["gap"];
|
|
1037
1040
|
paddingTop?: React.CSSProperties["paddingTop"];
|
|
1041
|
+
paddingBottom?: React.CSSProperties["paddingBottom"];
|
|
1042
|
+
renderItemsHolder?: (items: React.ReactNode) => React.ReactNode;
|
|
1043
|
+
renderBottomItemsHolder?: (items: React.ReactNode) => React.ReactNode;
|
|
1038
1044
|
};
|
|
1039
1045
|
type SideMenuComponentType = {
|
|
1040
1046
|
(props: SideMenuProps): React.ReactElement;
|
package/dist/index.js
CHANGED
|
@@ -76,6 +76,7 @@ __export(index_exports, {
|
|
|
76
76
|
getBrowser: () => getBrowser,
|
|
77
77
|
getFormErrorObject: () => getFormErrorObject,
|
|
78
78
|
getPluralWord: () => import_react_better_core30.getPluralWord,
|
|
79
|
+
isApiError: () => import_react_better_core30.isApiError,
|
|
79
80
|
isMobileDevice: () => isMobileDevice,
|
|
80
81
|
lightenColor: () => import_react_better_core30.lightenColor,
|
|
81
82
|
loaderControls: () => import_react_better_core30.loaderControls,
|
|
@@ -5562,7 +5563,12 @@ var FormComponent = (0, import_react23.forwardRef)(function Form({
|
|
|
5562
5563
|
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: [
|
|
5563
5564
|
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: [
|
|
5564
5565
|
child,
|
|
5565
|
-
index < import_react23.Children.toArray(children).length - 1 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
5566
|
+
index < import_react23.Children.toArray(children).length - 1 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
5567
|
+
Divider_default.horizontal,
|
|
5568
|
+
{
|
|
5569
|
+
width: theme2.styles.borderWidth === 0 ? 1 : theme2.styles.borderWidth
|
|
5570
|
+
}
|
|
5571
|
+
)
|
|
5566
5572
|
] }, index)) : children }) : children,
|
|
5567
5573
|
submitButtonText && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
5568
5574
|
Div_default.row,
|
|
@@ -7005,7 +7011,15 @@ TooltipComponent.item = (0, import_react28.forwardRef)(function Item({
|
|
|
7005
7011
|
});
|
|
7006
7012
|
TooltipComponent.divider = (0, import_react28.forwardRef)(function DividerComponent(props, ref) {
|
|
7007
7013
|
const theme2 = (0, import_react_better_core26.useTheme)();
|
|
7008
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
7014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
7015
|
+
Divider_default.horizontal,
|
|
7016
|
+
{
|
|
7017
|
+
width: theme2.styles.borderWidth === 0 ? 1 : theme2.styles.borderWidth,
|
|
7018
|
+
marginBlock: theme2.styles.gap,
|
|
7019
|
+
...props,
|
|
7020
|
+
ref
|
|
7021
|
+
}
|
|
7022
|
+
);
|
|
7009
7023
|
});
|
|
7010
7024
|
TooltipComponent.sectionTitle = (0, import_react28.forwardRef)(function SectionTitle({ text, ...props }, ref) {
|
|
7011
7025
|
const theme2 = (0, import_react_better_core26.useTheme)();
|
|
@@ -7336,7 +7350,7 @@ var FoldableComponent = (0, import_react30.forwardRef)(function Foldable({
|
|
|
7336
7350
|
]
|
|
7337
7351
|
}
|
|
7338
7352
|
),
|
|
7339
|
-
/* @__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 }) }),
|
|
7353
|
+
/* @__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 }) }),
|
|
7340
7354
|
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
7341
7355
|
Div_default,
|
|
7342
7356
|
{
|
|
@@ -7595,10 +7609,16 @@ var SideMenuComponent = function SideMenu({
|
|
|
7595
7609
|
withCloseButton,
|
|
7596
7610
|
widthMobileHandle,
|
|
7597
7611
|
absoluteComponent,
|
|
7598
|
-
|
|
7612
|
+
itemsAdditionalComponent,
|
|
7613
|
+
betweenItemsAdditionalComponent,
|
|
7614
|
+
bottomItemsAdditionalComponent,
|
|
7599
7615
|
isLoading,
|
|
7600
7616
|
backgroundColor,
|
|
7601
|
-
|
|
7617
|
+
gap,
|
|
7618
|
+
paddingTop,
|
|
7619
|
+
paddingBottom,
|
|
7620
|
+
renderItemsHolder,
|
|
7621
|
+
renderBottomItemsHolder
|
|
7602
7622
|
}) {
|
|
7603
7623
|
const theme2 = (0, import_react_better_core29.useTheme)();
|
|
7604
7624
|
const mediaQuery = useMediaQuery();
|
|
@@ -7623,9 +7643,49 @@ var SideMenuComponent = function SideMenu({
|
|
|
7623
7643
|
const sideMenuCollapsedWidth = theme2.styles.space + theme2.styles.space * 2 + 16 + theme2.styles.space;
|
|
7624
7644
|
const readyBackgroundColor = backgroundColor ?? theme2.colors.backgroundContent;
|
|
7625
7645
|
const logoSize = sideMenuCollapsedWidth - theme2.styles.space * 2;
|
|
7646
|
+
const itemsComponent = /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7647
|
+
Div_default.column,
|
|
7648
|
+
{
|
|
7649
|
+
width: "100%",
|
|
7650
|
+
height: "100%",
|
|
7651
|
+
overflowY: !isCollapsed ? "auto" : void 0,
|
|
7652
|
+
paddingInline: !renderItemsHolder ? theme2.styles.space : void 0,
|
|
7653
|
+
paddingBottom: !renderItemsHolder ? !isCollapsable && !readyBottomItems ? theme2.styles.space : void 0 : void 0,
|
|
7654
|
+
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)(
|
|
7655
|
+
MenuItemComponent,
|
|
7656
|
+
{
|
|
7657
|
+
item,
|
|
7658
|
+
backgroundColor: readyBackgroundColor,
|
|
7659
|
+
onClick: onClickXButton
|
|
7660
|
+
},
|
|
7661
|
+
item.text
|
|
7662
|
+
)) })
|
|
7663
|
+
}
|
|
7664
|
+
);
|
|
7665
|
+
const bottomItemsComponent = /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7666
|
+
Div_default.column,
|
|
7667
|
+
{
|
|
7668
|
+
borderTop: mediaQuery.size1000 ? `solid ${theme2.styles.borderWidth}px ${theme2.colors.border}` : void 0,
|
|
7669
|
+
gap: theme2.styles.gap / 2,
|
|
7670
|
+
marginTop: "auto",
|
|
7671
|
+
paddingTop: mediaQuery.size1000 ? theme2.styles.space : void 0,
|
|
7672
|
+
paddingInline: !renderItemsHolder ? theme2.styles.space : void 0,
|
|
7673
|
+
paddingBottom: !renderItemsHolder ? !isCollapsable ? theme2.styles.space : void 0 : void 0,
|
|
7674
|
+
children: readyBottomItems?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7675
|
+
MenuItemComponent,
|
|
7676
|
+
{
|
|
7677
|
+
item,
|
|
7678
|
+
backgroundColor: readyBackgroundColor,
|
|
7679
|
+
onClick: onClickXButton
|
|
7680
|
+
},
|
|
7681
|
+
item.text
|
|
7682
|
+
))
|
|
7683
|
+
}
|
|
7684
|
+
);
|
|
7626
7685
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SideMenuContextProvider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
7627
7686
|
Div_default.column,
|
|
7628
7687
|
{
|
|
7688
|
+
as: "aside",
|
|
7629
7689
|
position: "fixed",
|
|
7630
7690
|
width: mediaQuery.size1000 ? "100%" : isCollapsed ? sideMenuCollapsedWidth : sideMenuWidth,
|
|
7631
7691
|
height: `calc(100svh - ${topSpace}px)`,
|
|
@@ -7635,11 +7695,12 @@ var SideMenuComponent = function SideMenu({
|
|
|
7635
7695
|
borderRight: `solid ${theme2.styles.borderWidth}px ${theme2.colors.border}`,
|
|
7636
7696
|
transform: !mediaQuery.size1000 || sideMenuIsOpenMobile ? "translateX(0)" : "translateX(-100%)",
|
|
7637
7697
|
paddingTop: paddingTop ?? (logoAssetName || logoUrl ? theme2.styles.gap : theme2.styles.space),
|
|
7698
|
+
paddingBottom,
|
|
7638
7699
|
transition: mediaQuery.size1000 ? !isCollapsed ? `transform ${theme2.styles.transition}` : "none" : theme2.styles.transition,
|
|
7639
7700
|
userSelect: "none",
|
|
7640
7701
|
zIndex: 10,
|
|
7641
7702
|
children: [
|
|
7642
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Div_default.column, { width: "100%", height: "100%", gap: theme2.styles.space, children: [
|
|
7703
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Div_default.column, { width: "100%", height: "100%", gap: gap ?? theme2.styles.space, children: [
|
|
7643
7704
|
(logoAssetName || logoUrl || withCloseButton && mediaQuery.size1000) && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Div_default.row, { alignItems: "center", paddingInline: theme2.styles.space, children: [
|
|
7644
7705
|
(logoAssetName || logoUrl) && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LinkComponentTag, { to: "/", href: "/", onClick: onClickXButton, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
7645
7706
|
Div_default.row,
|
|
@@ -7677,48 +7738,13 @@ var SideMenuComponent = function SideMenu({
|
|
|
7677
7738
|
) }),
|
|
7678
7739
|
withCloseButton && mediaQuery.size1000 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Button_default.icon, { icon: "XMark", marginLeft: "auto", onClick: onClickXButton })
|
|
7679
7740
|
] }),
|
|
7741
|
+
itemsAdditionalComponent,
|
|
7680
7742
|
!isLoading ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
width: "100%",
|
|
7685
|
-
height: "100%",
|
|
7686
|
-
overflowY: !isCollapsed ? "auto" : void 0,
|
|
7687
|
-
paddingInline: theme2.styles.space,
|
|
7688
|
-
paddingBottom: !isCollapsable && !readyBottomItems ? theme2.styles.space : void 0,
|
|
7689
|
-
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)(
|
|
7690
|
-
MenuItemComponent,
|
|
7691
|
-
{
|
|
7692
|
-
item,
|
|
7693
|
-
backgroundColor: readyBackgroundColor,
|
|
7694
|
-
onClick: onClickXButton
|
|
7695
|
-
},
|
|
7696
|
-
item.text
|
|
7697
|
-
)) })
|
|
7698
|
-
}
|
|
7699
|
-
),
|
|
7700
|
-
readyBottomItems && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7701
|
-
Div_default.column,
|
|
7702
|
-
{
|
|
7703
|
-
borderTop: mediaQuery.size1000 ? `solid ${theme2.styles.borderWidth}px ${theme2.colors.border}` : void 0,
|
|
7704
|
-
gap: theme2.styles.gap / 2,
|
|
7705
|
-
marginTop: "auto",
|
|
7706
|
-
paddingTop: mediaQuery.size1000 ? theme2.styles.space : void 0,
|
|
7707
|
-
paddingInline: theme2.styles.space,
|
|
7708
|
-
paddingBottom: !isCollapsable ? theme2.styles.space : void 0,
|
|
7709
|
-
children: readyBottomItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7710
|
-
MenuItemComponent,
|
|
7711
|
-
{
|
|
7712
|
-
item,
|
|
7713
|
-
backgroundColor: readyBackgroundColor,
|
|
7714
|
-
onClick: onClickXButton
|
|
7715
|
-
},
|
|
7716
|
-
item.text
|
|
7717
|
-
))
|
|
7718
|
-
}
|
|
7719
|
-
)
|
|
7743
|
+
renderItemsHolder ? renderItemsHolder(itemsComponent) : itemsComponent,
|
|
7744
|
+
betweenItemsAdditionalComponent,
|
|
7745
|
+
readyBottomItems && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_jsx_runtime28.Fragment, { children: renderBottomItemsHolder ? renderBottomItemsHolder(bottomItemsComponent) : bottomItemsComponent })
|
|
7720
7746
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Div_default, { flex: 1, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Loader_default.box, { text: isCollapsed ? "" : void 0 }) }),
|
|
7721
|
-
|
|
7747
|
+
bottomItemsAdditionalComponent,
|
|
7722
7748
|
isCollapsable && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7723
7749
|
Div_default,
|
|
7724
7750
|
{
|
|
@@ -7926,6 +7952,7 @@ var SideMenu_default = SideMenu2;
|
|
|
7926
7952
|
getBrowser,
|
|
7927
7953
|
getFormErrorObject,
|
|
7928
7954
|
getPluralWord,
|
|
7955
|
+
isApiError,
|
|
7929
7956
|
isMobileDevice,
|
|
7930
7957
|
lightenColor,
|
|
7931
7958
|
loaderControls,
|