react-better-html 1.1.109 → 1.1.111
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 +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +42 -42
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +42 -42
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3104,9 +3104,11 @@ var PageHolderComponent = forwardRef7(function PageHolder({ noMaxContentWidth, c
|
|
|
3104
3104
|
);
|
|
3105
3105
|
});
|
|
3106
3106
|
PageHolderComponent.center = forwardRef7(function Center({
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3107
|
+
sideImageSrc,
|
|
3108
|
+
sideImageName,
|
|
3109
|
+
sideImagePosition = "right",
|
|
3110
|
+
sideImageAlignment = "center",
|
|
3111
|
+
sideImageFooter,
|
|
3110
3112
|
noMaxContentWidth,
|
|
3111
3113
|
children,
|
|
3112
3114
|
...props
|
|
@@ -3116,39 +3118,45 @@ PageHolderComponent.center = forwardRef7(function Center({
|
|
|
3116
3118
|
const { app } = useBetterHtmlContextInternal();
|
|
3117
3119
|
const breakingPoint = mediaQuery.size1000;
|
|
3118
3120
|
return /* @__PURE__ */ jsxs6(Div_default.row, { width: "100%", minHeight: "100svh", alignItems: "center", justifyContent: "center", children: [
|
|
3119
|
-
|
|
3120
|
-
/* @__PURE__ */ jsx10(
|
|
3121
|
-
Div_default.
|
|
3121
|
+
sideImagePosition === "left" && !breakingPoint && /* @__PURE__ */ jsx10(Div_default, { width: "50%" }),
|
|
3122
|
+
/* @__PURE__ */ jsx10(Div_default.column, { width: `${!breakingPoint && (sideImageSrc || sideImageName) ? 50 : 100}%`, alignItems: "center", children: /* @__PURE__ */ jsx10(
|
|
3123
|
+
Div_default.box,
|
|
3122
3124
|
{
|
|
3123
|
-
width:
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
marginInline: theme2.styles.space,
|
|
3131
|
-
marginBlock: theme2.styles.space,
|
|
3132
|
-
...props,
|
|
3133
|
-
ref,
|
|
3134
|
-
children
|
|
3135
|
-
}
|
|
3136
|
-
)
|
|
3125
|
+
width: `calc(100% - ${theme2.styles.space}px * 2)`,
|
|
3126
|
+
maxWidth: !noMaxContentWidth ? app.contentMaxWidth / 2 : void 0,
|
|
3127
|
+
marginInline: theme2.styles.space,
|
|
3128
|
+
marginBlock: theme2.styles.space,
|
|
3129
|
+
...props,
|
|
3130
|
+
ref,
|
|
3131
|
+
children
|
|
3137
3132
|
}
|
|
3138
|
-
),
|
|
3139
|
-
|
|
3140
|
-
(
|
|
3141
|
-
|
|
3133
|
+
) }),
|
|
3134
|
+
sideImagePosition === "right" && !breakingPoint && /* @__PURE__ */ jsx10(Div_default, { width: "50%" }),
|
|
3135
|
+
(sideImageSrc || sideImageName) && !breakingPoint && /* @__PURE__ */ jsxs6(
|
|
3136
|
+
Div_default,
|
|
3142
3137
|
{
|
|
3143
3138
|
position: "fixed",
|
|
3144
|
-
name: decorationImageName,
|
|
3145
|
-
src: decorationImageSrc,
|
|
3146
3139
|
width: "50%",
|
|
3147
3140
|
height: "100svh",
|
|
3148
3141
|
top: 0,
|
|
3149
|
-
left:
|
|
3150
|
-
right:
|
|
3151
|
-
|
|
3142
|
+
left: sideImagePosition === "left" ? 0 : "auto",
|
|
3143
|
+
right: sideImagePosition === "right" ? 0 : "auto",
|
|
3144
|
+
children: [
|
|
3145
|
+
/* @__PURE__ */ jsx10(
|
|
3146
|
+
Div_default.row,
|
|
3147
|
+
{
|
|
3148
|
+
position: "absolute",
|
|
3149
|
+
width: "100%",
|
|
3150
|
+
height: "100%",
|
|
3151
|
+
top: 0,
|
|
3152
|
+
left: 0,
|
|
3153
|
+
justifyContent: sideImageAlignment === "left" ? "flex-start" : sideImageAlignment === "right" ? "flex-end" : "center",
|
|
3154
|
+
overflow: "hidden",
|
|
3155
|
+
children: /* @__PURE__ */ jsx10(Image_default, { name: sideImageName, height: "100%", src: sideImageSrc })
|
|
3156
|
+
}
|
|
3157
|
+
),
|
|
3158
|
+
/* @__PURE__ */ jsx10(Div_default, { position: "absolute", width: "100%", bottom: theme2.styles.space, children: sideImageFooter })
|
|
3159
|
+
]
|
|
3152
3160
|
}
|
|
3153
3161
|
)
|
|
3154
3162
|
] });
|
|
@@ -6789,7 +6797,7 @@ import {
|
|
|
6789
6797
|
} from "react";
|
|
6790
6798
|
import styled10, { css as css2 } from "styled-components";
|
|
6791
6799
|
import { Fragment as Fragment5, jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
6792
|
-
var defaultImageWidth =
|
|
6800
|
+
var defaultImageWidth = 160;
|
|
6793
6801
|
var maximumVisiblePages = 11;
|
|
6794
6802
|
var TableStyledComponent = styled10.table.withConfig({
|
|
6795
6803
|
shouldForwardProp: (prop) => !["isStriped", "withHover", "withStickyHeader", "colorTheme", "theme"].includes(prop)
|
|
@@ -6928,22 +6936,14 @@ var TableComponent = forwardRef15(function Table({
|
|
|
6928
6936
|
switch (column.type) {
|
|
6929
6937
|
case "text": {
|
|
6930
6938
|
const value = column.keyName ? item[column.keyName] : void 0;
|
|
6931
|
-
return column.format
|
|
6939
|
+
return column.format?.(item, index) ?? String(value);
|
|
6932
6940
|
}
|
|
6933
6941
|
case "element": {
|
|
6934
6942
|
return column.render?.(item, index) ?? /* @__PURE__ */ jsx20(Fragment5, {});
|
|
6935
6943
|
}
|
|
6936
6944
|
case "image": {
|
|
6937
6945
|
const src = column.getImageSrc?.(item, index) ?? (column.keyName ? item[column.keyName] : void 0);
|
|
6938
|
-
return /* @__PURE__ */ jsx20(
|
|
6939
|
-
Image_default,
|
|
6940
|
-
{
|
|
6941
|
-
src,
|
|
6942
|
-
width: defaultImageWidth,
|
|
6943
|
-
borderRadius: theme2.styles.borderRadius / 2,
|
|
6944
|
-
...column.imageProps
|
|
6945
|
-
}
|
|
6946
|
-
);
|
|
6946
|
+
return /* @__PURE__ */ jsx20(Image_default, { src, width: "100%", borderRadius: theme2.styles.borderRadius / 2, ...column.imageProps });
|
|
6947
6947
|
}
|
|
6948
6948
|
case "checkbox": {
|
|
6949
6949
|
const { onChange, ...toggleInputProps } = column.toggleInputProps ?? {};
|
|
@@ -7223,7 +7223,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
7223
7223
|
/* @__PURE__ */ jsx20("thead", { children: /* @__PURE__ */ jsx20("tr", { className: "isHeader", children: columns.map((column, index) => /* @__PURE__ */ jsx20(
|
|
7224
7224
|
ThStyledComponent,
|
|
7225
7225
|
{
|
|
7226
|
-
width: column.type === "image" ? defaultImageWidth : column.type === "checkbox" ? 26 :
|
|
7226
|
+
width: column.width ?? (column.type === "image" ? defaultImageWidth : column.type === "checkbox" ? 26 : void 0),
|
|
7227
7227
|
minWidth: column.minWidth,
|
|
7228
7228
|
maxWidth: column.maxWidth,
|
|
7229
7229
|
textAlign: column.align,
|
|
@@ -7232,7 +7232,7 @@ var TableComponent = forwardRef15(function Table({
|
|
|
7232
7232
|
{
|
|
7233
7233
|
width: "100%",
|
|
7234
7234
|
alignItems: "center",
|
|
7235
|
-
justifyContent: "space-between",
|
|
7235
|
+
justifyContent: column.filter ? "space-between" : column.align === "center" ? "center" : column.align === "right" ? "flex-end" : "flex-start",
|
|
7236
7236
|
gap: theme2.styles.gap,
|
|
7237
7237
|
children: [
|
|
7238
7238
|
column.type === "checkbox" && onClickAllCheckboxes ? /* @__PURE__ */ jsx20(
|