react-better-html 1.1.112 → 1.1.114
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 +157 -136
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +156 -136
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.d.mts
CHANGED
|
@@ -855,6 +855,9 @@ declare const loaderControls: {
|
|
|
855
855
|
startLoading: (loaderName: LoaderName | AnyOtherString) => void;
|
|
856
856
|
stopLoading: (loaderName: LoaderName | AnyOtherString) => void;
|
|
857
857
|
};
|
|
858
|
+
declare const colorThemeControls: {
|
|
859
|
+
toggleTheme: (theme?: ColorTheme) => void;
|
|
860
|
+
};
|
|
858
861
|
|
|
859
862
|
declare const countries: Country[];
|
|
860
863
|
|
|
@@ -862,4 +865,4 @@ declare const isMobileDevice: boolean;
|
|
|
862
865
|
|
|
863
866
|
declare const reactRouterDomPlugin: BetterHtmlPlugin;
|
|
864
867
|
|
|
865
|
-
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, countries, darkenColor, desaturateColor, formatPhoneNumber, generateRandomString, getBrowser, getFormErrorObject, isMobileDevice, lightenColor, loaderControls, reactRouterDomPlugin, saturateColor, useBetterHtmlContext, useBooleanState, useDebounceState, useForm, useLoader, useLoaderControls, useMediaQuery, usePageResize, usePageScroll, useTheme, useUrlQuery };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -855,6 +855,9 @@ declare const loaderControls: {
|
|
|
855
855
|
startLoading: (loaderName: LoaderName | AnyOtherString) => void;
|
|
856
856
|
stopLoading: (loaderName: LoaderName | AnyOtherString) => void;
|
|
857
857
|
};
|
|
858
|
+
declare const colorThemeControls: {
|
|
859
|
+
toggleTheme: (theme?: ColorTheme) => void;
|
|
860
|
+
};
|
|
858
861
|
|
|
859
862
|
declare const countries: Country[];
|
|
860
863
|
|
|
@@ -862,4 +865,4 @@ declare const isMobileDevice: boolean;
|
|
|
862
865
|
|
|
863
866
|
declare const reactRouterDomPlugin: BetterHtmlPlugin;
|
|
864
867
|
|
|
865
|
-
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, countries, darkenColor, desaturateColor, formatPhoneNumber, generateRandomString, getBrowser, getFormErrorObject, isMobileDevice, lightenColor, loaderControls, reactRouterDomPlugin, saturateColor, useBetterHtmlContext, useBooleanState, useDebounceState, useForm, useLoader, useLoaderControls, useMediaQuery, usePageResize, usePageScroll, useTheme, useUrlQuery };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -52,6 +52,7 @@ __export(index_exports, {
|
|
|
52
52
|
Tabs: () => Tabs_default,
|
|
53
53
|
Text: () => Text_default,
|
|
54
54
|
ToggleInput: () => ToggleInput_default,
|
|
55
|
+
colorThemeControls: () => colorThemeControls,
|
|
55
56
|
countries: () => countries,
|
|
56
57
|
darkenColor: () => darkenColor,
|
|
57
58
|
desaturateColor: () => desaturateColor,
|
|
@@ -2899,6 +2900,7 @@ var Divider_default = {
|
|
|
2899
2900
|
|
|
2900
2901
|
// src/components/Modal.tsx
|
|
2901
2902
|
var import_react11 = require("react");
|
|
2903
|
+
var import_react_dom = require("react-dom");
|
|
2902
2904
|
var import_styled_components8 = __toESM(require("styled-components"));
|
|
2903
2905
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2904
2906
|
var DialogStylesElement = import_styled_components8.default.dialog.withConfig({
|
|
@@ -2995,101 +2997,104 @@ var ModalComponent = (0, import_react11.forwardRef)(function Modal({
|
|
|
2995
2997
|
},
|
|
2996
2998
|
[onClickOpen, onClickClose, isOpened]
|
|
2997
2999
|
);
|
|
2998
|
-
return
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3000
|
+
return (0, import_react_dom.createPortal)(
|
|
3001
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3002
|
+
DialogStylesElement,
|
|
3003
|
+
{
|
|
3004
|
+
theme: theme2,
|
|
3005
|
+
colorTheme,
|
|
3006
|
+
opacity: !isOpened ? 0 : 1,
|
|
3007
|
+
onClose: onClickClose,
|
|
3008
|
+
ref: dialogRef,
|
|
3009
|
+
children: isOpenedLate ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3010
|
+
Div_default.column,
|
|
3011
|
+
{
|
|
3012
|
+
position: "relative",
|
|
3013
|
+
width: "100%",
|
|
3014
|
+
maxWidth: maxWidth ?? app.contentMaxWidth / 1.3,
|
|
3015
|
+
minHeight: `calc(100% - ${theme2.styles.space * 2}px)`,
|
|
3016
|
+
alignItems: "center",
|
|
3017
|
+
justifyContent: "center",
|
|
3018
|
+
marginBlock: theme2.styles.space,
|
|
3019
|
+
marginInline: "auto",
|
|
3020
|
+
transform: `translateY(${theme2.styles.space}px)`,
|
|
3021
|
+
transition: theme2.styles.transition,
|
|
3022
|
+
animation: isOpened ? "fadeInAnimation 0.2s ease forwards" : "fadeOutAnimation 0.2s ease forwards",
|
|
3023
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
3024
|
+
Div_default,
|
|
3025
|
+
{
|
|
3026
|
+
position: "relative",
|
|
3027
|
+
width: "100%",
|
|
3028
|
+
minHeight: 32 + theme2.styles.space * 2,
|
|
3029
|
+
backgroundColor: theme2.colors.backgroundBase,
|
|
3030
|
+
borderRadius: theme2.styles.borderRadius * 2,
|
|
3031
|
+
paddingInline: !title ? theme2.styles.space + theme2.styles.gap : void 0,
|
|
3032
|
+
paddingBlock: !title ? theme2.styles.space : void 0,
|
|
3033
|
+
overflow,
|
|
3034
|
+
children: [
|
|
3035
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
3036
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
3037
|
+
Div_default.row,
|
|
3038
|
+
{
|
|
3039
|
+
alignItems: "center",
|
|
3040
|
+
gap: theme2.styles.gap,
|
|
3041
|
+
backgroundColor: headerBackgroundColor,
|
|
3042
|
+
borderTopLeftRadius: theme2.styles.borderRadius * 2 - 1,
|
|
3043
|
+
borderTopRightRadius: theme2.styles.borderRadius * 2 - 1,
|
|
3044
|
+
paddingInline: theme2.styles.space + theme2.styles.gap,
|
|
3045
|
+
paddingBlock: theme2.styles.space,
|
|
3046
|
+
transition: theme2.styles.transition,
|
|
3047
|
+
children: [
|
|
3048
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
|
|
3049
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3050
|
+
Text_default,
|
|
3051
|
+
{
|
|
3052
|
+
as: "h1",
|
|
3053
|
+
color: titleColor ?? theme2.colors.textPrimary,
|
|
3054
|
+
transition: theme2.styles.transition,
|
|
3055
|
+
children: title
|
|
3056
|
+
}
|
|
3057
|
+
),
|
|
3058
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3059
|
+
Text_default,
|
|
3060
|
+
{
|
|
3061
|
+
color: descriptionColor ?? theme2.colors.textSecondary,
|
|
3062
|
+
transition: theme2.styles.transition,
|
|
3063
|
+
children: description
|
|
3064
|
+
}
|
|
3065
|
+
)
|
|
3066
|
+
] }),
|
|
3046
3067
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3047
|
-
|
|
3048
|
-
{
|
|
3049
|
-
as: "h1",
|
|
3050
|
-
color: titleColor ?? theme2.colors.textPrimary,
|
|
3051
|
-
transition: theme2.styles.transition,
|
|
3052
|
-
children: title
|
|
3053
|
-
}
|
|
3054
|
-
),
|
|
3055
|
-
description && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3056
|
-
Text_default,
|
|
3068
|
+
Button_default.icon,
|
|
3057
3069
|
{
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3070
|
+
icon: "XMark",
|
|
3071
|
+
marginTop: 1,
|
|
3072
|
+
iconColor: titleColor,
|
|
3073
|
+
onClick: onClickClose,
|
|
3074
|
+
transition: theme2.styles.transition
|
|
3061
3075
|
}
|
|
3062
3076
|
)
|
|
3063
|
-
]
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
]
|
|
3077
|
+
]
|
|
3078
|
+
}
|
|
3079
|
+
),
|
|
3080
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Divider_default.horizontal, {})
|
|
3081
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Div_default, { position: "absolute", top: theme2.styles.space, right: theme2.styles.space, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Button_default.icon, { icon: "XMark", onClick: onClickClose }) }),
|
|
3082
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3083
|
+
Div_default,
|
|
3084
|
+
{
|
|
3085
|
+
paddingInline: title ? theme2.styles.space + theme2.styles.gap : void 0,
|
|
3086
|
+
paddingBlock: title ? theme2.styles.space : void 0,
|
|
3087
|
+
children
|
|
3075
3088
|
}
|
|
3076
|
-
)
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
}
|
|
3086
|
-
)
|
|
3087
|
-
]
|
|
3088
|
-
}
|
|
3089
|
-
)
|
|
3090
|
-
}
|
|
3091
|
-
) : void 0
|
|
3092
|
-
}
|
|
3089
|
+
)
|
|
3090
|
+
]
|
|
3091
|
+
}
|
|
3092
|
+
)
|
|
3093
|
+
}
|
|
3094
|
+
) : void 0
|
|
3095
|
+
}
|
|
3096
|
+
),
|
|
3097
|
+
document.body
|
|
3093
3098
|
);
|
|
3094
3099
|
});
|
|
3095
3100
|
ModalComponent.confirmation = (0, import_react11.forwardRef)(function Confirmation({ continueButtonLoaderName, onContinue, onCancel, ...props }, ref) {
|
|
@@ -3104,7 +3109,7 @@ ModalComponent.confirmation = (0, import_react11.forwardRef)(function Confirmati
|
|
|
3104
3109
|
modalRef.current?.close();
|
|
3105
3110
|
}, [onContinue]);
|
|
3106
3111
|
(0, import_react11.useImperativeHandle)(ref, () => modalRef.current, []);
|
|
3107
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
3112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(ModalComponent, { title: "Are you sure?", maxWidth: 660, ...props, ref: modalRef, children: [
|
|
3108
3113
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text_default, { color: theme2.colors.textSecondary, children: "Do you really want to continue? This action may be irreversible." }),
|
|
3109
3114
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
3110
3115
|
Div_default.row,
|
|
@@ -3133,7 +3138,7 @@ ModalComponent.destructive = (0, import_react11.forwardRef)(function Destructive
|
|
|
3133
3138
|
modalRef.current?.close();
|
|
3134
3139
|
}, [onDelete]);
|
|
3135
3140
|
(0, import_react11.useImperativeHandle)(ref, () => modalRef.current, []);
|
|
3136
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
3141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(ModalComponent, { title: "Are you sure?", maxWidth: 660, ...props, ref: modalRef, children: [
|
|
3137
3142
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text_default, { color: theme2.colors.textSecondary, children: "Do you really want to continue with the deleting of the item? This action may be irreversible." }),
|
|
3138
3143
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
3139
3144
|
Div_default.row,
|
|
@@ -3198,6 +3203,7 @@ PageHolderComponent.center = (0, import_react12.forwardRef)(function Center({
|
|
|
3198
3203
|
const mediaQuery = useMediaQuery();
|
|
3199
3204
|
const { app } = useBetterHtmlContextInternal();
|
|
3200
3205
|
const breakingPoint = mediaQuery.size1000;
|
|
3206
|
+
const withSideImage = (sideImageSrc || sideImageName) && !breakingPoint;
|
|
3201
3207
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3202
3208
|
Div_default.row,
|
|
3203
3209
|
{
|
|
@@ -3207,8 +3213,8 @@ PageHolderComponent.center = (0, import_react12.forwardRef)(function Center({
|
|
|
3207
3213
|
justifyContent: "center",
|
|
3208
3214
|
backgroundColor: pageBackgroundColor,
|
|
3209
3215
|
children: [
|
|
3210
|
-
sideImagePosition === "left" &&
|
|
3211
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Div_default.column, { width: `${
|
|
3216
|
+
sideImagePosition === "left" && withSideImage && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Div_default, { width: "50%" }),
|
|
3217
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Div_default.column, { width: `${withSideImage ? 50 : 100}%`, alignItems: "center", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
3212
3218
|
Div_default.box,
|
|
3213
3219
|
{
|
|
3214
3220
|
width: `calc(100% - ${theme2.styles.space}px * 2)`,
|
|
@@ -3220,8 +3226,8 @@ PageHolderComponent.center = (0, import_react12.forwardRef)(function Center({
|
|
|
3220
3226
|
children
|
|
3221
3227
|
}
|
|
3222
3228
|
) }),
|
|
3223
|
-
sideImagePosition === "right" &&
|
|
3224
|
-
|
|
3229
|
+
sideImagePosition === "right" && withSideImage && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Div_default, { width: "50%" }),
|
|
3230
|
+
withSideImage && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3225
3231
|
Div_default,
|
|
3226
3232
|
{
|
|
3227
3233
|
position: "fixed",
|
|
@@ -6817,6 +6823,45 @@ var FormRow_default = FormRow2;
|
|
|
6817
6823
|
|
|
6818
6824
|
// src/components/ColorThemeSwitch.tsx
|
|
6819
6825
|
var import_react22 = require("react");
|
|
6826
|
+
|
|
6827
|
+
// src/utils/variableFunctions.ts
|
|
6828
|
+
var checkBetterHtmlContextValue = (value, functionsName) => {
|
|
6829
|
+
if (value === void 0) {
|
|
6830
|
+
throw new Error(
|
|
6831
|
+
`\`${functionsName}()\` must be used within a \`<BetterHtmlProvider>\`. Make sure to add one at the root of your component tree.`
|
|
6832
|
+
);
|
|
6833
|
+
}
|
|
6834
|
+
return value !== void 0;
|
|
6835
|
+
};
|
|
6836
|
+
var loaderControls = {
|
|
6837
|
+
startLoading: (loaderName) => {
|
|
6838
|
+
if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "loaderControls.startLoading")) return;
|
|
6839
|
+
externalBetterHtmlContextValue.setLoaders((oldValue) => ({
|
|
6840
|
+
...oldValue,
|
|
6841
|
+
[loaderName.toString()]: true
|
|
6842
|
+
}));
|
|
6843
|
+
},
|
|
6844
|
+
stopLoading: (loaderName) => {
|
|
6845
|
+
if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "loaderControls.stopLoading")) return;
|
|
6846
|
+
externalBetterHtmlContextValue.setLoaders((oldValue) => ({
|
|
6847
|
+
...oldValue,
|
|
6848
|
+
[loaderName.toString()]: false
|
|
6849
|
+
}));
|
|
6850
|
+
}
|
|
6851
|
+
};
|
|
6852
|
+
var colorThemeControls = {
|
|
6853
|
+
toggleTheme: (theme2) => {
|
|
6854
|
+
if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "colorThemeControls.toggleTheme")) return;
|
|
6855
|
+
const currentColorTheme = externalBetterHtmlContextValue.colorTheme;
|
|
6856
|
+
const newColorTheme = theme2 ?? (currentColorTheme === "dark" ? "light" : "dark");
|
|
6857
|
+
setTimeout(() => {
|
|
6858
|
+
window.document.body.parentElement?.setAttribute("data-theme", newColorTheme);
|
|
6859
|
+
localStorage.setItem("theme", newColorTheme);
|
|
6860
|
+
}, 0.01 * 1e3);
|
|
6861
|
+
}
|
|
6862
|
+
};
|
|
6863
|
+
|
|
6864
|
+
// src/components/ColorThemeSwitch.tsx
|
|
6820
6865
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
6821
6866
|
var ColorThemeSwitchComponent = function ColorThemeSwitch({
|
|
6822
6867
|
withMoon,
|
|
@@ -6829,13 +6874,7 @@ var ColorThemeSwitchComponent = function ColorThemeSwitch({
|
|
|
6829
6874
|
}
|
|
6830
6875
|
});
|
|
6831
6876
|
(0, import_react22.useEffect)(() => {
|
|
6832
|
-
|
|
6833
|
-
window.document.body.parentElement?.setAttribute("data-theme", form.values.darkMode ? "dark" : "light");
|
|
6834
|
-
localStorage.setItem("theme", form.values.darkMode ? "dark" : "light");
|
|
6835
|
-
}, 0.2 * 1e3);
|
|
6836
|
-
return () => {
|
|
6837
|
-
clearTimeout(timeout);
|
|
6838
|
-
};
|
|
6877
|
+
colorThemeControls.toggleTheme(form.values.darkMode ? "dark" : "light");
|
|
6839
6878
|
}, [form.values.darkMode]);
|
|
6840
6879
|
(0, import_react22.useEffect)(() => {
|
|
6841
6880
|
const html = document.querySelector("html");
|
|
@@ -6914,7 +6953,7 @@ var TableStyledComponent = import_styled_components11.default.table.withConfig({
|
|
|
6914
6953
|
transition: ${props.theme.styles.transition};
|
|
6915
6954
|
|
|
6916
6955
|
&:not(.isHeader):not(.isFooter):not(.withoutHover):hover {
|
|
6917
|
-
filter: brightness(${props.colorTheme === "light" ?
|
|
6956
|
+
filter: brightness(${props.colorTheme === "light" ? 0.95 : 0.7});
|
|
6918
6957
|
}
|
|
6919
6958
|
` : ""}
|
|
6920
6959
|
|
|
@@ -7239,7 +7278,7 @@ var TableComponent = (0, import_react23.forwardRef)(function Table({
|
|
|
7239
7278
|
[]
|
|
7240
7279
|
);
|
|
7241
7280
|
}, [data, openedFilterColumn]);
|
|
7242
|
-
const pageCountInternal = pageCount ?? (pageSize !== void 0 ? Math.ceil(
|
|
7281
|
+
const pageCountInternal = pageCount ?? (pageSize !== void 0 ? Math.ceil(dataAfterFilter.length / pageSize) : 1);
|
|
7243
7282
|
const paginationItems = (0, import_react23.useMemo)(() => {
|
|
7244
7283
|
const halfRange = Math.floor(maximumVisiblePages / 2);
|
|
7245
7284
|
let startPage = Math.max(1, currentPage - halfRange);
|
|
@@ -7532,11 +7571,18 @@ var TableComponent = (0, import_react23.forwardRef)(function Table({
|
|
|
7532
7571
|
onClickWithValue: onClickFilterListItem,
|
|
7533
7572
|
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Div_default.row, { alignItems: "center", gap: theme2.styles.gap / 2, children: [
|
|
7534
7573
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text_default, { children: value.value }),
|
|
7535
|
-
openedFilterColumn.withTotalNumber && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
7536
|
-
|
|
7537
|
-
|
|
7538
|
-
|
|
7539
|
-
|
|
7574
|
+
openedFilterColumn.withTotalNumber && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
7575
|
+
Text_default,
|
|
7576
|
+
{
|
|
7577
|
+
fontSize: 14,
|
|
7578
|
+
color: isActive ? theme2.colors.base + "c0" : theme2.colors.textSecondary,
|
|
7579
|
+
children: [
|
|
7580
|
+
"(",
|
|
7581
|
+
value.count,
|
|
7582
|
+
")"
|
|
7583
|
+
]
|
|
7584
|
+
}
|
|
7585
|
+
)
|
|
7540
7586
|
] })
|
|
7541
7587
|
},
|
|
7542
7588
|
value.value
|
|
@@ -7861,32 +7907,6 @@ var Foldable2 = (0, import_react25.memo)(FoldableComponent);
|
|
|
7861
7907
|
Foldable2.box = FoldableComponent.box;
|
|
7862
7908
|
var Foldable_default = Foldable2;
|
|
7863
7909
|
|
|
7864
|
-
// src/utils/variableFunctions.ts
|
|
7865
|
-
var checkBetterHtmlContextValue = (value, functionsName) => {
|
|
7866
|
-
if (value === void 0) {
|
|
7867
|
-
throw new Error(
|
|
7868
|
-
`\`${functionsName}()\` must be used within a \`<BetterHtmlProvider>\`. Make sure to add one at the root of your component tree.`
|
|
7869
|
-
);
|
|
7870
|
-
}
|
|
7871
|
-
return value !== void 0;
|
|
7872
|
-
};
|
|
7873
|
-
var loaderControls = {
|
|
7874
|
-
startLoading: (loaderName) => {
|
|
7875
|
-
if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "loaderControls.startLoading")) return;
|
|
7876
|
-
externalBetterHtmlContextValue.setLoaders((oldValue) => ({
|
|
7877
|
-
...oldValue,
|
|
7878
|
-
[loaderName.toString()]: true
|
|
7879
|
-
}));
|
|
7880
|
-
},
|
|
7881
|
-
stopLoading: (loaderName) => {
|
|
7882
|
-
if (!checkBetterHtmlContextValue(externalBetterHtmlContextValue, "loaderControls.stopLoading")) return;
|
|
7883
|
-
externalBetterHtmlContextValue.setLoaders((oldValue) => ({
|
|
7884
|
-
...oldValue,
|
|
7885
|
-
[loaderName.toString()]: false
|
|
7886
|
-
}));
|
|
7887
|
-
}
|
|
7888
|
-
};
|
|
7889
|
-
|
|
7890
7910
|
// src/plugins/react-router-dom.ts
|
|
7891
7911
|
var import_react_router_dom2 = require("react-router-dom");
|
|
7892
7912
|
var reactRouterDomPlugin = {
|
|
@@ -7923,6 +7943,7 @@ var reactRouterDomPlugin = {
|
|
|
7923
7943
|
Tabs,
|
|
7924
7944
|
Text,
|
|
7925
7945
|
ToggleInput,
|
|
7946
|
+
colorThemeControls,
|
|
7926
7947
|
countries,
|
|
7927
7948
|
darkenColor,
|
|
7928
7949
|
desaturateColor,
|