react-better-html 1.1.222 → 1.1.224
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 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +29 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -306,13 +306,13 @@ type PageHeaderProps = {
|
|
|
306
306
|
imageSize?: number;
|
|
307
307
|
/** @default false */
|
|
308
308
|
imageAzProfileImage?: boolean;
|
|
309
|
-
title?: string;
|
|
309
|
+
title?: string | React.ReactNode;
|
|
310
310
|
/** @default "h1" */
|
|
311
311
|
titleAs?: TextAs;
|
|
312
312
|
/** @default textPrimary */
|
|
313
313
|
titleColor?: React.CSSProperties["color"];
|
|
314
314
|
titleRightElement?: React.ReactNode;
|
|
315
|
-
description?: string;
|
|
315
|
+
description?: string | React.ReactNode;
|
|
316
316
|
/** @default textSecondary */
|
|
317
317
|
descriptionColor?: React.CSSProperties["color"];
|
|
318
318
|
textAlign?: React.CSSProperties["textAlign"];
|
|
@@ -998,6 +998,7 @@ type SideMenuItem = {
|
|
|
998
998
|
href?: string;
|
|
999
999
|
disabled?: boolean;
|
|
1000
1000
|
hidden?: boolean;
|
|
1001
|
+
withDot?: boolean;
|
|
1001
1002
|
children?: SideMenuItem[];
|
|
1002
1003
|
/** @default true */
|
|
1003
1004
|
onClickCloseSideMenu?: boolean;
|
|
@@ -1094,4 +1095,4 @@ type LocalStoragePluginOptions = {
|
|
|
1094
1095
|
declare const defaultLocalStoragePluginOptions: Required<LocalStoragePluginOptions>;
|
|
1095
1096
|
declare const localStoragePlugin: BetterHtmlPluginConstructor<LocalStoragePluginOptions>;
|
|
1096
1097
|
|
|
1097
|
-
export { type Alert, type AlertDisplay, type AlertDuration, type AlertType, type AlertsPluginOptions, type AppConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default$5 as BetterHtmlProvider, type BetterHtmlProviderConfig, type BrowserName, Button, type ButtonProps, Chip, type ChipProps, ColorThemeSwitch, type ColorThemeSwitchProps, type ComponentHoverStyle, type ComponentMarginProps, type ComponentPaddingProps, Div, type DivProps, _default$1 as Divider, Dropdown, type DropdownOption, type DropdownProps, Foldable, type FoldableProps, type FoldableRef, Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default$3 as Icon, type IconProps, _default$2 as Image, type ImageProps, InputField, type InputFieldProps, _default as Label, type LabelProps, Loader, type LoaderProps, type LocalStoragePluginOptions, Modal, type ModalProps, type ModalRef, PageHeader, type PageHeaderProps, PageHolder, type PageHolderProps, Pagination, type PluginName, type ReactRouterDomPluginOptions, SideMenu, type SideMenuItem, type TabGroup, Table, type TableColumn, type TableFilterData, type TableListFilterListItem, type TableProps, type TableRef, Tabs, type TabsProps, type TabsRef, Text, type TextAs, type TextProps, type TextareaFieldProps, _default$4 as ToggleInput, type ToggleInputProps, type ToggleInputRef, Tooltip, type TooltipProps, type TooltipRef, type VerticalDividerProps, alertControls, alertsPlugin, defaultAlertsPluginOptions, defaultLocalStoragePluginOptions, defaultReactRouterDomPluginOptions, filterHover, generateLocalStorage, getBrowser, getFormErrorObject, isMobileDevice, localStoragePlugin, reactRouterDomPlugin, sideMenuControls, useAlertControls, useBetterHtmlContext, useForm, useMediaQuery, usePageResize, usePageScroll, useUrlQuery };
|
|
1098
|
+
export { type Alert, type AlertDisplay, type AlertDuration, type AlertType, type AlertsPluginOptions, type AppConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default$5 as BetterHtmlProvider, type BetterHtmlProviderConfig, type BrowserName, Button, type ButtonProps, Chip, type ChipProps, ColorThemeSwitch, type ColorThemeSwitchProps, type ComponentHoverStyle, type ComponentMarginProps, type ComponentPaddingProps, Div, type DivProps, _default$1 as Divider, Dropdown, type DropdownOption, type DropdownProps, Foldable, type FoldableProps, type FoldableRef, Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default$3 as Icon, type IconProps, _default$2 as Image, type ImageProps, InputField, type InputFieldProps, _default as Label, type LabelProps, Loader, type LoaderProps, type LocalStoragePluginOptions, Modal, type ModalProps, type ModalRef, PageHeader, type PageHeaderProps, PageHolder, type PageHolderProps, Pagination, type PluginName, type ReactRouterDomPluginOptions, SideMenu, type SideMenuItem, type SideMenuProps, type TabGroup, Table, type TableColumn, type TableFilterData, type TableListFilterListItem, type TableProps, type TableRef, Tabs, type TabsProps, type TabsRef, Text, type TextAs, type TextProps, type TextareaFieldProps, _default$4 as ToggleInput, type ToggleInputProps, type ToggleInputRef, Tooltip, type TooltipProps, type TooltipRef, type VerticalDividerProps, alertControls, alertsPlugin, defaultAlertsPluginOptions, defaultLocalStoragePluginOptions, defaultReactRouterDomPluginOptions, filterHover, generateLocalStorage, getBrowser, getFormErrorObject, isMobileDevice, localStoragePlugin, reactRouterDomPlugin, sideMenuControls, useAlertControls, useBetterHtmlContext, useForm, useMediaQuery, usePageResize, usePageScroll, useUrlQuery };
|
package/dist/index.d.ts
CHANGED
|
@@ -306,13 +306,13 @@ type PageHeaderProps = {
|
|
|
306
306
|
imageSize?: number;
|
|
307
307
|
/** @default false */
|
|
308
308
|
imageAzProfileImage?: boolean;
|
|
309
|
-
title?: string;
|
|
309
|
+
title?: string | React.ReactNode;
|
|
310
310
|
/** @default "h1" */
|
|
311
311
|
titleAs?: TextAs;
|
|
312
312
|
/** @default textPrimary */
|
|
313
313
|
titleColor?: React.CSSProperties["color"];
|
|
314
314
|
titleRightElement?: React.ReactNode;
|
|
315
|
-
description?: string;
|
|
315
|
+
description?: string | React.ReactNode;
|
|
316
316
|
/** @default textSecondary */
|
|
317
317
|
descriptionColor?: React.CSSProperties["color"];
|
|
318
318
|
textAlign?: React.CSSProperties["textAlign"];
|
|
@@ -998,6 +998,7 @@ type SideMenuItem = {
|
|
|
998
998
|
href?: string;
|
|
999
999
|
disabled?: boolean;
|
|
1000
1000
|
hidden?: boolean;
|
|
1001
|
+
withDot?: boolean;
|
|
1001
1002
|
children?: SideMenuItem[];
|
|
1002
1003
|
/** @default true */
|
|
1003
1004
|
onClickCloseSideMenu?: boolean;
|
|
@@ -1094,4 +1095,4 @@ type LocalStoragePluginOptions = {
|
|
|
1094
1095
|
declare const defaultLocalStoragePluginOptions: Required<LocalStoragePluginOptions>;
|
|
1095
1096
|
declare const localStoragePlugin: BetterHtmlPluginConstructor<LocalStoragePluginOptions>;
|
|
1096
1097
|
|
|
1097
|
-
export { type Alert, type AlertDisplay, type AlertDuration, type AlertType, type AlertsPluginOptions, type AppConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default$5 as BetterHtmlProvider, type BetterHtmlProviderConfig, type BrowserName, Button, type ButtonProps, Chip, type ChipProps, ColorThemeSwitch, type ColorThemeSwitchProps, type ComponentHoverStyle, type ComponentMarginProps, type ComponentPaddingProps, Div, type DivProps, _default$1 as Divider, Dropdown, type DropdownOption, type DropdownProps, Foldable, type FoldableProps, type FoldableRef, Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default$3 as Icon, type IconProps, _default$2 as Image, type ImageProps, InputField, type InputFieldProps, _default as Label, type LabelProps, Loader, type LoaderProps, type LocalStoragePluginOptions, Modal, type ModalProps, type ModalRef, PageHeader, type PageHeaderProps, PageHolder, type PageHolderProps, Pagination, type PluginName, type ReactRouterDomPluginOptions, SideMenu, type SideMenuItem, type TabGroup, Table, type TableColumn, type TableFilterData, type TableListFilterListItem, type TableProps, type TableRef, Tabs, type TabsProps, type TabsRef, Text, type TextAs, type TextProps, type TextareaFieldProps, _default$4 as ToggleInput, type ToggleInputProps, type ToggleInputRef, Tooltip, type TooltipProps, type TooltipRef, type VerticalDividerProps, alertControls, alertsPlugin, defaultAlertsPluginOptions, defaultLocalStoragePluginOptions, defaultReactRouterDomPluginOptions, filterHover, generateLocalStorage, getBrowser, getFormErrorObject, isMobileDevice, localStoragePlugin, reactRouterDomPlugin, sideMenuControls, useAlertControls, useBetterHtmlContext, useForm, useMediaQuery, usePageResize, usePageScroll, useUrlQuery };
|
|
1098
|
+
export { type Alert, type AlertDisplay, type AlertDuration, type AlertType, type AlertsPluginOptions, type AppConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default$5 as BetterHtmlProvider, type BetterHtmlProviderConfig, type BrowserName, Button, type ButtonProps, Chip, type ChipProps, ColorThemeSwitch, type ColorThemeSwitchProps, type ComponentHoverStyle, type ComponentMarginProps, type ComponentPaddingProps, Div, type DivProps, _default$1 as Divider, Dropdown, type DropdownOption, type DropdownProps, Foldable, type FoldableProps, type FoldableRef, Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default$3 as Icon, type IconProps, _default$2 as Image, type ImageProps, InputField, type InputFieldProps, _default as Label, type LabelProps, Loader, type LoaderProps, type LocalStoragePluginOptions, Modal, type ModalProps, type ModalRef, PageHeader, type PageHeaderProps, PageHolder, type PageHolderProps, Pagination, type PluginName, type ReactRouterDomPluginOptions, SideMenu, type SideMenuItem, type SideMenuProps, type TabGroup, Table, type TableColumn, type TableFilterData, type TableListFilterListItem, type TableProps, type TableRef, Tabs, type TabsProps, type TabsRef, Text, type TextAs, type TextProps, type TextareaFieldProps, _default$4 as ToggleInput, type ToggleInputProps, type ToggleInputRef, Tooltip, type TooltipProps, type TooltipRef, type VerticalDividerProps, alertControls, alertsPlugin, defaultAlertsPluginOptions, defaultLocalStoragePluginOptions, defaultReactRouterDomPluginOptions, filterHover, generateLocalStorage, getBrowser, getFormErrorObject, isMobileDevice, localStoragePlugin, reactRouterDomPlugin, sideMenuControls, useAlertControls, useBetterHtmlContext, useForm, useMediaQuery, usePageResize, usePageScroll, useUrlQuery };
|
package/dist/index.js
CHANGED
|
@@ -1640,7 +1640,7 @@ var PageHeaderComponent = (0, import_react7.forwardRef)(function PageHeader({
|
|
|
1640
1640
|
justifyContent: textAlign === "center" ? "center" : textAlign === "right" ? "flex-end" : void 0,
|
|
1641
1641
|
gap: theme2.styles.space,
|
|
1642
1642
|
children: [
|
|
1643
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1643
|
+
typeof title === "string" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1644
1644
|
Text_default,
|
|
1645
1645
|
{
|
|
1646
1646
|
as: titleAs,
|
|
@@ -1648,12 +1648,12 @@ var PageHeaderComponent = (0, import_react7.forwardRef)(function PageHeader({
|
|
|
1648
1648
|
color: titleColor ?? (lightMode ? theme2.colors.base : theme2.colors.textPrimary),
|
|
1649
1649
|
children: title
|
|
1650
1650
|
}
|
|
1651
|
-
),
|
|
1651
|
+
) : title,
|
|
1652
1652
|
titleRightElement
|
|
1653
1653
|
]
|
|
1654
1654
|
}
|
|
1655
1655
|
),
|
|
1656
|
-
description && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1656
|
+
description && (typeof description === "string" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1657
1657
|
Text_default,
|
|
1658
1658
|
{
|
|
1659
1659
|
maxWidth: !mediaQuery.size600 ? app.contentMaxWidth * 0.6 : void 0,
|
|
@@ -1662,7 +1662,7 @@ var PageHeaderComponent = (0, import_react7.forwardRef)(function PageHeader({
|
|
|
1662
1662
|
opacity: lightMode ? 0.7 : void 0,
|
|
1663
1663
|
children: description
|
|
1664
1664
|
}
|
|
1665
|
-
)
|
|
1665
|
+
) : description)
|
|
1666
1666
|
]
|
|
1667
1667
|
}
|
|
1668
1668
|
),
|
|
@@ -1765,8 +1765,11 @@ DivComponent.grid = (0, import_react8.forwardRef)(function Grid(props, ref) {
|
|
|
1765
1765
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DivComponent, { display: "grid", ref, ...props });
|
|
1766
1766
|
});
|
|
1767
1767
|
DivComponent.box = (0, import_react8.forwardRef)(function Box({
|
|
1768
|
+
icon,
|
|
1769
|
+
image,
|
|
1768
1770
|
imageUrl,
|
|
1769
1771
|
imageSize,
|
|
1772
|
+
imageAzProfileImage,
|
|
1770
1773
|
title,
|
|
1771
1774
|
titleAs,
|
|
1772
1775
|
titleColor,
|
|
@@ -1815,8 +1818,11 @@ DivComponent.box = (0, import_react8.forwardRef)(function Box({
|
|
|
1815
1818
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1816
1819
|
PageHeader_default,
|
|
1817
1820
|
{
|
|
1821
|
+
icon,
|
|
1822
|
+
image,
|
|
1818
1823
|
imageUrl,
|
|
1819
1824
|
imageSize,
|
|
1825
|
+
imageAzProfileImage,
|
|
1820
1826
|
title,
|
|
1821
1827
|
titleAs,
|
|
1822
1828
|
titleColor,
|
|
@@ -7235,6 +7241,7 @@ var Foldable_default = Foldable2;
|
|
|
7235
7241
|
var import_react31 = require("react");
|
|
7236
7242
|
var import_react_better_core29 = require("react-better-core");
|
|
7237
7243
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
7244
|
+
var tabDotSize2 = 6;
|
|
7238
7245
|
var sideMenuContext = (0, import_react31.createContext)(void 0);
|
|
7239
7246
|
var SideMenuContextProvider = sideMenuContext.Provider;
|
|
7240
7247
|
var useSideMenuContext = () => {
|
|
@@ -7272,6 +7279,10 @@ var MenuItemComponent = (0, import_react31.memo)(function MenuItemComponent2({ i
|
|
|
7272
7279
|
item.onClick?.(item);
|
|
7273
7280
|
}
|
|
7274
7281
|
}, [onClick, item, isCollapsed]);
|
|
7282
|
+
const childrenHaveDot = (0, import_react31.useMemo)(
|
|
7283
|
+
() => item.children?.some((child) => child.withDot) ?? false,
|
|
7284
|
+
[item.children]
|
|
7285
|
+
);
|
|
7275
7286
|
const isActive = activeItem && item.href && activeItem.href === item.href;
|
|
7276
7287
|
const readyBackgroundColor = backgroundColor ?? theme2.colors.backgroundContent;
|
|
7277
7288
|
const iconSize = 16;
|
|
@@ -7331,6 +7342,20 @@ var MenuItemComponent = (0, import_react31.memo)(function MenuItemComponent2({ i
|
|
|
7331
7342
|
transform: isOpened ? "rotate(180deg)" : void 0,
|
|
7332
7343
|
transition: theme2.styles.transition
|
|
7333
7344
|
}
|
|
7345
|
+
),
|
|
7346
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7347
|
+
Div_default,
|
|
7348
|
+
{
|
|
7349
|
+
position: "absolute",
|
|
7350
|
+
top: (theme2.styles.space - tabDotSize2) / 2,
|
|
7351
|
+
right: (theme2.styles.space - tabDotSize2) / 2,
|
|
7352
|
+
width: tabDotSize2,
|
|
7353
|
+
height: tabDotSize2,
|
|
7354
|
+
backgroundColor: theme2.colors.primary,
|
|
7355
|
+
borderRadius: 999,
|
|
7356
|
+
opacity: item.withDot || childrenHaveDot && !isOpened ? 1 : 0,
|
|
7357
|
+
transition: theme2.styles.transition
|
|
7358
|
+
}
|
|
7334
7359
|
)
|
|
7335
7360
|
]
|
|
7336
7361
|
}
|