react-better-html 1.1.115 → 1.1.117
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 +62 -7
- package/dist/index.d.ts +62 -7
- package/dist/index.js +473 -73
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +478 -78
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -660,6 +660,7 @@ type TableFilterData = {
|
|
|
660
660
|
type TextColumn<DataItem> = {
|
|
661
661
|
type: "text";
|
|
662
662
|
keyName?: keyof DataItem;
|
|
663
|
+
getTextProps?: ((item: DataItem, index: number) => TextProps) | TextProps;
|
|
663
664
|
format?: (item: DataItem, index: number) => string;
|
|
664
665
|
};
|
|
665
666
|
type ElementColumn<DataItem> = {
|
|
@@ -668,13 +669,16 @@ type ElementColumn<DataItem> = {
|
|
|
668
669
|
};
|
|
669
670
|
type ImageColumn<DataItem> = {
|
|
670
671
|
type: "image";
|
|
671
|
-
|
|
672
|
-
getImageSrc?: (item: DataItem, index: number) => string;
|
|
673
|
-
imageProps?: ImageProps;
|
|
672
|
+
getImageProps?: ((item: DataItem, index: number) => ImageProps) | ImageProps;
|
|
674
673
|
};
|
|
675
|
-
type CheckboxColumn = {
|
|
674
|
+
type CheckboxColumn<DataItem> = {
|
|
676
675
|
type: "checkbox";
|
|
677
|
-
|
|
676
|
+
getToggleInputProps?: ((item: DataItem, index: number) => ToggleInputProps<DataItem>) | ToggleInputProps<DataItem>;
|
|
677
|
+
};
|
|
678
|
+
type ExpandColumn<DataItem> = {
|
|
679
|
+
type: "expand";
|
|
680
|
+
onlyOneExpanded?: boolean;
|
|
681
|
+
render?: (item: DataItem, index: number) => ReactNode;
|
|
678
682
|
};
|
|
679
683
|
type NumberFilter<DataItem> = {
|
|
680
684
|
filter?: "number";
|
|
@@ -696,7 +700,7 @@ type TableColumn<DataItem> = {
|
|
|
696
700
|
minWidth?: string | number;
|
|
697
701
|
maxWidth?: string | number;
|
|
698
702
|
align?: "left" | "center" | "right";
|
|
699
|
-
} & (TextColumn<DataItem> | ElementColumn<DataItem> | ImageColumn<DataItem> | CheckboxColumn) & (NumberFilter<DataItem> | DateFilter<DataItem> | ListFilter<DataItem>);
|
|
703
|
+
} & (TextColumn<DataItem> | ElementColumn<DataItem> | ImageColumn<DataItem> | CheckboxColumn<DataItem> | ExpandColumn<DataItem>) & (NumberFilter<DataItem> | DateFilter<DataItem> | ListFilter<DataItem>);
|
|
700
704
|
type TableProps<DataItem> = {
|
|
701
705
|
columns: TableColumn<DataItem>[];
|
|
702
706
|
data: DataItem[];
|
|
@@ -727,6 +731,57 @@ type TableComponentType = {
|
|
|
727
731
|
declare const TableComponent: TableComponentType;
|
|
728
732
|
declare const Table: typeof TableComponent;
|
|
729
733
|
|
|
734
|
+
type TooltipPosition = "top" | "bottom" | "left" | "right";
|
|
735
|
+
type TooltipAlign = "left" | "center" | "right" | "top" | "bottom";
|
|
736
|
+
type TooltipProps = {
|
|
737
|
+
/** @default "bottom" */
|
|
738
|
+
position?: TooltipPosition;
|
|
739
|
+
/** @default "hover" */
|
|
740
|
+
trigger?: "hover" | "click";
|
|
741
|
+
/** @default "center" */
|
|
742
|
+
align?: TooltipAlign;
|
|
743
|
+
content: React.ReactNode;
|
|
744
|
+
contentWidth?: React.CSSProperties["width"];
|
|
745
|
+
contentMinWidth?: React.CSSProperties["minWidth"];
|
|
746
|
+
withArrow?: boolean;
|
|
747
|
+
isSmall?: boolean;
|
|
748
|
+
backgroundColor?: string;
|
|
749
|
+
asContextMenu?: boolean;
|
|
750
|
+
onOpen?: () => void;
|
|
751
|
+
onClose?: () => void;
|
|
752
|
+
children: React.ReactNode;
|
|
753
|
+
};
|
|
754
|
+
type TooltipRef = {
|
|
755
|
+
isOpen: boolean;
|
|
756
|
+
open: () => void;
|
|
757
|
+
close: () => void;
|
|
758
|
+
};
|
|
759
|
+
type TooltipComponent = {
|
|
760
|
+
(props: ComponentPropWithRef<TooltipRef, TooltipProps>): React.ReactElement;
|
|
761
|
+
item: <Value>(props: ComponentPropWithRef<HTMLDivElement, TooltipItemProps<Value>>) => React.ReactElement;
|
|
762
|
+
divider: (props: ComponentPropWithRef<HTMLDivElement, HorizontalDividerProps>) => React.ReactElement;
|
|
763
|
+
sectionTitle: (props: ComponentPropWithRef<HTMLParagraphElement, TooltipSectionTitleProps>) => React.ReactElement;
|
|
764
|
+
};
|
|
765
|
+
declare const TooltipComponent: TooltipComponent;
|
|
766
|
+
type TooltipItemProps<Value = unknown> = {
|
|
767
|
+
icon?: IconName | AnyOtherString;
|
|
768
|
+
text?: string;
|
|
769
|
+
description?: string;
|
|
770
|
+
isActive?: boolean;
|
|
771
|
+
value?: Value;
|
|
772
|
+
id?: string;
|
|
773
|
+
onClick?: () => void;
|
|
774
|
+
onClickWithValue?: (value: Value) => void;
|
|
775
|
+
};
|
|
776
|
+
type TooltipSectionTitleProps = OmitProps<TextProps, "children"> & {
|
|
777
|
+
text?: string;
|
|
778
|
+
};
|
|
779
|
+
declare const Tooltip: typeof TooltipComponent & {
|
|
780
|
+
item: typeof TooltipComponent.item;
|
|
781
|
+
divider: typeof TooltipComponent.divider;
|
|
782
|
+
sectionTitle: typeof TooltipComponent.sectionTitle;
|
|
783
|
+
};
|
|
784
|
+
|
|
730
785
|
type TabGroup = {
|
|
731
786
|
name: string;
|
|
732
787
|
selectedTab: string;
|
|
@@ -865,4 +920,4 @@ declare const isMobileDevice: boolean;
|
|
|
865
920
|
|
|
866
921
|
declare const reactRouterDomPlugin: BetterHtmlPlugin;
|
|
867
922
|
|
|
868
|
-
export { type AppConfig, type AssetName, type AssetsConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default as BetterHtmlProvider, type BetterHtmlProviderValue, type BrowserName, Button, type ButtonProps, Chip, type ChipProps, type Color, type ColorName, type ColorTheme, ColorThemeSwitch, type ColorThemeSwitchProps, type Colors, type DeepPartialRecord, Div, type DivProps, _default$3 as Divider, Dropdown, type DropdownOption, type DropdownProps, type ExcludeOptions, Foldable, type FoldableProps, type FoldableRef, Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default$5 as Icon, type IconName, type IconProps, type IconsConfig, _default$4 as Image, type ImageProps, InputField, type InputFieldProps, _default$1 as Label, type LabelProps, Loader, type LoaderConfig, type LoaderName, type LoaderProps, Modal, type ModalProps, type ModalRef, type OmitProps, PageHeader, type PageHeaderProps, PageHolder, type PageHolderProps, type PartialRecord, type PickAllRequired, type PickValue, type PluginName, type Styles, type TabGroup, Table, type TableColumn, type TableProps, type TableRef, Tabs, type TabsProps, type TabsRef, Text, type TextAs, type TextProps, type TextareaFieldProps, type Theme, type ThemeConfig, _default$2 as ToggleInput, type ToggleInputProps, type ToggleInputRef, type VerticalDividerProps, colorThemeControls, countries, darkenColor, desaturateColor, formatPhoneNumber, generateRandomString, getBrowser, getFormErrorObject, isMobileDevice, lightenColor, loaderControls, reactRouterDomPlugin, saturateColor, useBetterHtmlContext, useBooleanState, useDebounceState, useForm, useLoader, useLoaderControls, useMediaQuery, usePageResize, usePageScroll, useTheme, useUrlQuery };
|
|
923
|
+
export { type AppConfig, type AssetName, type AssetsConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default as BetterHtmlProvider, type BetterHtmlProviderValue, type BrowserName, Button, type ButtonProps, Chip, type ChipProps, type Color, type ColorName, type ColorTheme, ColorThemeSwitch, type ColorThemeSwitchProps, type Colors, type DeepPartialRecord, Div, type DivProps, _default$3 as Divider, Dropdown, type DropdownOption, type DropdownProps, type ExcludeOptions, Foldable, type FoldableProps, type FoldableRef, Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default$5 as Icon, type IconName, type IconProps, type IconsConfig, _default$4 as Image, type ImageProps, InputField, type InputFieldProps, _default$1 as Label, type LabelProps, Loader, type LoaderConfig, type LoaderName, type LoaderProps, Modal, type ModalProps, type ModalRef, type OmitProps, PageHeader, type PageHeaderProps, PageHolder, type PageHolderProps, type PartialRecord, type PickAllRequired, type PickValue, type PluginName, type Styles, type TabGroup, Table, type TableColumn, type TableProps, type TableRef, Tabs, type TabsProps, type TabsRef, Text, type TextAs, type TextProps, type TextareaFieldProps, type Theme, type ThemeConfig, _default$2 as ToggleInput, type ToggleInputProps, type ToggleInputRef, Tooltip, type TooltipProps, type TooltipRef, type VerticalDividerProps, colorThemeControls, countries, darkenColor, desaturateColor, formatPhoneNumber, generateRandomString, getBrowser, getFormErrorObject, isMobileDevice, lightenColor, loaderControls, reactRouterDomPlugin, saturateColor, useBetterHtmlContext, useBooleanState, useDebounceState, useForm, useLoader, useLoaderControls, useMediaQuery, usePageResize, usePageScroll, useTheme, useUrlQuery };
|
package/dist/index.d.ts
CHANGED
|
@@ -660,6 +660,7 @@ type TableFilterData = {
|
|
|
660
660
|
type TextColumn<DataItem> = {
|
|
661
661
|
type: "text";
|
|
662
662
|
keyName?: keyof DataItem;
|
|
663
|
+
getTextProps?: ((item: DataItem, index: number) => TextProps) | TextProps;
|
|
663
664
|
format?: (item: DataItem, index: number) => string;
|
|
664
665
|
};
|
|
665
666
|
type ElementColumn<DataItem> = {
|
|
@@ -668,13 +669,16 @@ type ElementColumn<DataItem> = {
|
|
|
668
669
|
};
|
|
669
670
|
type ImageColumn<DataItem> = {
|
|
670
671
|
type: "image";
|
|
671
|
-
|
|
672
|
-
getImageSrc?: (item: DataItem, index: number) => string;
|
|
673
|
-
imageProps?: ImageProps;
|
|
672
|
+
getImageProps?: ((item: DataItem, index: number) => ImageProps) | ImageProps;
|
|
674
673
|
};
|
|
675
|
-
type CheckboxColumn = {
|
|
674
|
+
type CheckboxColumn<DataItem> = {
|
|
676
675
|
type: "checkbox";
|
|
677
|
-
|
|
676
|
+
getToggleInputProps?: ((item: DataItem, index: number) => ToggleInputProps<DataItem>) | ToggleInputProps<DataItem>;
|
|
677
|
+
};
|
|
678
|
+
type ExpandColumn<DataItem> = {
|
|
679
|
+
type: "expand";
|
|
680
|
+
onlyOneExpanded?: boolean;
|
|
681
|
+
render?: (item: DataItem, index: number) => ReactNode;
|
|
678
682
|
};
|
|
679
683
|
type NumberFilter<DataItem> = {
|
|
680
684
|
filter?: "number";
|
|
@@ -696,7 +700,7 @@ type TableColumn<DataItem> = {
|
|
|
696
700
|
minWidth?: string | number;
|
|
697
701
|
maxWidth?: string | number;
|
|
698
702
|
align?: "left" | "center" | "right";
|
|
699
|
-
} & (TextColumn<DataItem> | ElementColumn<DataItem> | ImageColumn<DataItem> | CheckboxColumn) & (NumberFilter<DataItem> | DateFilter<DataItem> | ListFilter<DataItem>);
|
|
703
|
+
} & (TextColumn<DataItem> | ElementColumn<DataItem> | ImageColumn<DataItem> | CheckboxColumn<DataItem> | ExpandColumn<DataItem>) & (NumberFilter<DataItem> | DateFilter<DataItem> | ListFilter<DataItem>);
|
|
700
704
|
type TableProps<DataItem> = {
|
|
701
705
|
columns: TableColumn<DataItem>[];
|
|
702
706
|
data: DataItem[];
|
|
@@ -727,6 +731,57 @@ type TableComponentType = {
|
|
|
727
731
|
declare const TableComponent: TableComponentType;
|
|
728
732
|
declare const Table: typeof TableComponent;
|
|
729
733
|
|
|
734
|
+
type TooltipPosition = "top" | "bottom" | "left" | "right";
|
|
735
|
+
type TooltipAlign = "left" | "center" | "right" | "top" | "bottom";
|
|
736
|
+
type TooltipProps = {
|
|
737
|
+
/** @default "bottom" */
|
|
738
|
+
position?: TooltipPosition;
|
|
739
|
+
/** @default "hover" */
|
|
740
|
+
trigger?: "hover" | "click";
|
|
741
|
+
/** @default "center" */
|
|
742
|
+
align?: TooltipAlign;
|
|
743
|
+
content: React.ReactNode;
|
|
744
|
+
contentWidth?: React.CSSProperties["width"];
|
|
745
|
+
contentMinWidth?: React.CSSProperties["minWidth"];
|
|
746
|
+
withArrow?: boolean;
|
|
747
|
+
isSmall?: boolean;
|
|
748
|
+
backgroundColor?: string;
|
|
749
|
+
asContextMenu?: boolean;
|
|
750
|
+
onOpen?: () => void;
|
|
751
|
+
onClose?: () => void;
|
|
752
|
+
children: React.ReactNode;
|
|
753
|
+
};
|
|
754
|
+
type TooltipRef = {
|
|
755
|
+
isOpen: boolean;
|
|
756
|
+
open: () => void;
|
|
757
|
+
close: () => void;
|
|
758
|
+
};
|
|
759
|
+
type TooltipComponent = {
|
|
760
|
+
(props: ComponentPropWithRef<TooltipRef, TooltipProps>): React.ReactElement;
|
|
761
|
+
item: <Value>(props: ComponentPropWithRef<HTMLDivElement, TooltipItemProps<Value>>) => React.ReactElement;
|
|
762
|
+
divider: (props: ComponentPropWithRef<HTMLDivElement, HorizontalDividerProps>) => React.ReactElement;
|
|
763
|
+
sectionTitle: (props: ComponentPropWithRef<HTMLParagraphElement, TooltipSectionTitleProps>) => React.ReactElement;
|
|
764
|
+
};
|
|
765
|
+
declare const TooltipComponent: TooltipComponent;
|
|
766
|
+
type TooltipItemProps<Value = unknown> = {
|
|
767
|
+
icon?: IconName | AnyOtherString;
|
|
768
|
+
text?: string;
|
|
769
|
+
description?: string;
|
|
770
|
+
isActive?: boolean;
|
|
771
|
+
value?: Value;
|
|
772
|
+
id?: string;
|
|
773
|
+
onClick?: () => void;
|
|
774
|
+
onClickWithValue?: (value: Value) => void;
|
|
775
|
+
};
|
|
776
|
+
type TooltipSectionTitleProps = OmitProps<TextProps, "children"> & {
|
|
777
|
+
text?: string;
|
|
778
|
+
};
|
|
779
|
+
declare const Tooltip: typeof TooltipComponent & {
|
|
780
|
+
item: typeof TooltipComponent.item;
|
|
781
|
+
divider: typeof TooltipComponent.divider;
|
|
782
|
+
sectionTitle: typeof TooltipComponent.sectionTitle;
|
|
783
|
+
};
|
|
784
|
+
|
|
730
785
|
type TabGroup = {
|
|
731
786
|
name: string;
|
|
732
787
|
selectedTab: string;
|
|
@@ -865,4 +920,4 @@ declare const isMobileDevice: boolean;
|
|
|
865
920
|
|
|
866
921
|
declare const reactRouterDomPlugin: BetterHtmlPlugin;
|
|
867
922
|
|
|
868
|
-
export { type AppConfig, type AssetName, type AssetsConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default as BetterHtmlProvider, type BetterHtmlProviderValue, type BrowserName, Button, type ButtonProps, Chip, type ChipProps, type Color, type ColorName, type ColorTheme, ColorThemeSwitch, type ColorThemeSwitchProps, type Colors, type DeepPartialRecord, Div, type DivProps, _default$3 as Divider, Dropdown, type DropdownOption, type DropdownProps, type ExcludeOptions, Foldable, type FoldableProps, type FoldableRef, Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default$5 as Icon, type IconName, type IconProps, type IconsConfig, _default$4 as Image, type ImageProps, InputField, type InputFieldProps, _default$1 as Label, type LabelProps, Loader, type LoaderConfig, type LoaderName, type LoaderProps, Modal, type ModalProps, type ModalRef, type OmitProps, PageHeader, type PageHeaderProps, PageHolder, type PageHolderProps, type PartialRecord, type PickAllRequired, type PickValue, type PluginName, type Styles, type TabGroup, Table, type TableColumn, type TableProps, type TableRef, Tabs, type TabsProps, type TabsRef, Text, type TextAs, type TextProps, type TextareaFieldProps, type Theme, type ThemeConfig, _default$2 as ToggleInput, type ToggleInputProps, type ToggleInputRef, type VerticalDividerProps, colorThemeControls, countries, darkenColor, desaturateColor, formatPhoneNumber, generateRandomString, getBrowser, getFormErrorObject, isMobileDevice, lightenColor, loaderControls, reactRouterDomPlugin, saturateColor, useBetterHtmlContext, useBooleanState, useDebounceState, useForm, useLoader, useLoaderControls, useMediaQuery, usePageResize, usePageScroll, useTheme, useUrlQuery };
|
|
923
|
+
export { type AppConfig, type AssetName, type AssetsConfig, type BetterHtmlConfig, type BetterHtmlPlugin, _default as BetterHtmlProvider, type BetterHtmlProviderValue, type BrowserName, Button, type ButtonProps, Chip, type ChipProps, type Color, type ColorName, type ColorTheme, ColorThemeSwitch, type ColorThemeSwitchProps, type Colors, type DeepPartialRecord, Div, type DivProps, _default$3 as Divider, Dropdown, type DropdownOption, type DropdownProps, type ExcludeOptions, Foldable, type FoldableProps, type FoldableRef, Form, type FormProps, FormRow, type FormRowProps, type HorizontalDividerProps, _default$5 as Icon, type IconName, type IconProps, type IconsConfig, _default$4 as Image, type ImageProps, InputField, type InputFieldProps, _default$1 as Label, type LabelProps, Loader, type LoaderConfig, type LoaderName, type LoaderProps, Modal, type ModalProps, type ModalRef, type OmitProps, PageHeader, type PageHeaderProps, PageHolder, type PageHolderProps, type PartialRecord, type PickAllRequired, type PickValue, type PluginName, type Styles, type TabGroup, Table, type TableColumn, type TableProps, type TableRef, Tabs, type TabsProps, type TabsRef, Text, type TextAs, type TextProps, type TextareaFieldProps, type Theme, type ThemeConfig, _default$2 as ToggleInput, type ToggleInputProps, type ToggleInputRef, Tooltip, type TooltipProps, type TooltipRef, type VerticalDividerProps, colorThemeControls, countries, darkenColor, desaturateColor, formatPhoneNumber, generateRandomString, getBrowser, getFormErrorObject, isMobileDevice, lightenColor, loaderControls, reactRouterDomPlugin, saturateColor, useBetterHtmlContext, useBooleanState, useDebounceState, useForm, useLoader, useLoaderControls, useMediaQuery, usePageResize, usePageScroll, useTheme, useUrlQuery };
|