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 CHANGED
@@ -318,10 +318,13 @@ type PageHolderProps = {
318
318
  type PageHolderComponentType = {
319
319
  (props: ComponentPropWithRef<HTMLDivElement, PageHolderProps>): React.ReactElement;
320
320
  center: (props: ComponentPropWithRef<HTMLDivElement, PageHolderProps & {
321
- decorationImageSrc?: string;
322
- decorationImageName?: AssetName | AnyOtherString;
321
+ sideImageSrc?: string;
322
+ sideImageName?: AssetName | AnyOtherString;
323
323
  /** @default "right" */
324
- decorationImagePosition?: "left" | "right";
324
+ sideImagePosition?: "left" | "right";
325
+ /** @default "center" */
326
+ sideImageAlignment?: "left" | "center" | "right";
327
+ sideImageFooter?: React.ReactNode;
325
328
  }>) => React.ReactElement;
326
329
  };
327
330
  declare const PageHolderComponent: PageHolderComponentType;
package/dist/index.d.ts CHANGED
@@ -318,10 +318,13 @@ type PageHolderProps = {
318
318
  type PageHolderComponentType = {
319
319
  (props: ComponentPropWithRef<HTMLDivElement, PageHolderProps>): React.ReactElement;
320
320
  center: (props: ComponentPropWithRef<HTMLDivElement, PageHolderProps & {
321
- decorationImageSrc?: string;
322
- decorationImageName?: AssetName | AnyOtherString;
321
+ sideImageSrc?: string;
322
+ sideImageName?: AssetName | AnyOtherString;
323
323
  /** @default "right" */
324
- decorationImagePosition?: "left" | "right";
324
+ sideImagePosition?: "left" | "right";
325
+ /** @default "center" */
326
+ sideImageAlignment?: "left" | "center" | "right";
327
+ sideImageFooter?: React.ReactNode;
325
328
  }>) => React.ReactElement;
326
329
  };
327
330
  declare const PageHolderComponent: PageHolderComponentType;
package/dist/index.js CHANGED
@@ -3184,9 +3184,11 @@ var PageHolderComponent = (0, import_react12.forwardRef)(function PageHolder({ n
3184
3184
  );
3185
3185
  });
3186
3186
  PageHolderComponent.center = (0, import_react12.forwardRef)(function Center({
3187
- decorationImageSrc,
3188
- decorationImageName,
3189
- decorationImagePosition = "right",
3187
+ sideImageSrc,
3188
+ sideImageName,
3189
+ sideImagePosition = "right",
3190
+ sideImageAlignment = "center",
3191
+ sideImageFooter,
3190
3192
  noMaxContentWidth,
3191
3193
  children,
3192
3194
  ...props
@@ -3196,39 +3198,45 @@ PageHolderComponent.center = (0, import_react12.forwardRef)(function Center({
3196
3198
  const { app } = useBetterHtmlContextInternal();
3197
3199
  const breakingPoint = mediaQuery.size1000;
3198
3200
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Div_default.row, { width: "100%", minHeight: "100svh", alignItems: "center", justifyContent: "center", children: [
3199
- decorationImagePosition === "left" && !breakingPoint && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Div_default, { width: "50%" }),
3200
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3201
- Div_default.column,
3201
+ sideImagePosition === "left" && !breakingPoint && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Div_default, { width: "50%" }),
3202
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Div_default.column, { width: `${!breakingPoint && (sideImageSrc || sideImageName) ? 50 : 100}%`, alignItems: "center", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3203
+ Div_default.box,
3202
3204
  {
3203
- width: `${!breakingPoint && (decorationImageSrc || decorationImageName) ? 50 : 100}%`,
3204
- alignItems: "center",
3205
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3206
- Div_default.box,
3207
- {
3208
- width: `calc(100% - ${theme2.styles.space}px * 2)`,
3209
- maxWidth: !noMaxContentWidth ? app.contentMaxWidth / 2 : void 0,
3210
- marginInline: theme2.styles.space,
3211
- marginBlock: theme2.styles.space,
3212
- ...props,
3213
- ref,
3214
- children
3215
- }
3216
- )
3205
+ width: `calc(100% - ${theme2.styles.space}px * 2)`,
3206
+ maxWidth: !noMaxContentWidth ? app.contentMaxWidth / 2 : void 0,
3207
+ marginInline: theme2.styles.space,
3208
+ marginBlock: theme2.styles.space,
3209
+ ...props,
3210
+ ref,
3211
+ children
3217
3212
  }
3218
- ),
3219
- decorationImagePosition === "right" && !breakingPoint && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Div_default, { width: "50%" }),
3220
- (decorationImageSrc || decorationImageName) && !breakingPoint && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3221
- Image_default,
3213
+ ) }),
3214
+ sideImagePosition === "right" && !breakingPoint && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Div_default, { width: "50%" }),
3215
+ (sideImageSrc || sideImageName) && !breakingPoint && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3216
+ Div_default,
3222
3217
  {
3223
3218
  position: "fixed",
3224
- name: decorationImageName,
3225
- src: decorationImageSrc,
3226
3219
  width: "50%",
3227
3220
  height: "100svh",
3228
3221
  top: 0,
3229
- left: decorationImagePosition === "left" ? 0 : "auto",
3230
- right: decorationImagePosition === "right" ? 0 : "auto",
3231
- objectFit: "cover"
3222
+ left: sideImagePosition === "left" ? 0 : "auto",
3223
+ right: sideImagePosition === "right" ? 0 : "auto",
3224
+ children: [
3225
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3226
+ Div_default.row,
3227
+ {
3228
+ position: "absolute",
3229
+ width: "100%",
3230
+ height: "100%",
3231
+ top: 0,
3232
+ left: 0,
3233
+ justifyContent: sideImageAlignment === "left" ? "flex-start" : sideImageAlignment === "right" ? "flex-end" : "center",
3234
+ overflow: "hidden",
3235
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Image_default, { name: sideImageName, height: "100%", src: sideImageSrc })
3236
+ }
3237
+ ),
3238
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Div_default, { position: "absolute", width: "100%", bottom: theme2.styles.space, children: sideImageFooter })
3239
+ ]
3232
3240
  }
3233
3241
  )
3234
3242
  ] });
@@ -6860,7 +6868,7 @@ var ColorThemeSwitch_default = ColorThemeSwitch2;
6860
6868
  var import_react23 = require("react");
6861
6869
  var import_styled_components11 = __toESM(require("styled-components"));
6862
6870
  var import_jsx_runtime21 = require("react/jsx-runtime");
6863
- var defaultImageWidth = 120;
6871
+ var defaultImageWidth = 160;
6864
6872
  var maximumVisiblePages = 11;
6865
6873
  var TableStyledComponent = import_styled_components11.default.table.withConfig({
6866
6874
  shouldForwardProp: (prop) => !["isStriped", "withHover", "withStickyHeader", "colorTheme", "theme"].includes(prop)
@@ -6999,22 +7007,14 @@ var TableComponent = (0, import_react23.forwardRef)(function Table({
6999
7007
  switch (column.type) {
7000
7008
  case "text": {
7001
7009
  const value = column.keyName ? item[column.keyName] : void 0;
7002
- return column.format ? column.format(item, index) : String(value ?? "");
7010
+ return column.format?.(item, index) ?? String(value);
7003
7011
  }
7004
7012
  case "element": {
7005
7013
  return column.render?.(item, index) ?? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, {});
7006
7014
  }
7007
7015
  case "image": {
7008
7016
  const src = column.getImageSrc?.(item, index) ?? (column.keyName ? item[column.keyName] : void 0);
7009
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7010
- Image_default,
7011
- {
7012
- src,
7013
- width: defaultImageWidth,
7014
- borderRadius: theme2.styles.borderRadius / 2,
7015
- ...column.imageProps
7016
- }
7017
- );
7017
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Image_default, { src, width: "100%", borderRadius: theme2.styles.borderRadius / 2, ...column.imageProps });
7018
7018
  }
7019
7019
  case "checkbox": {
7020
7020
  const { onChange, ...toggleInputProps } = column.toggleInputProps ?? {};
@@ -7294,7 +7294,7 @@ var TableComponent = (0, import_react23.forwardRef)(function Table({
7294
7294
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tr", { className: "isHeader", children: columns.map((column, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7295
7295
  ThStyledComponent,
7296
7296
  {
7297
- width: column.type === "image" ? defaultImageWidth : column.type === "checkbox" ? 26 : column.width,
7297
+ width: column.width ?? (column.type === "image" ? defaultImageWidth : column.type === "checkbox" ? 26 : void 0),
7298
7298
  minWidth: column.minWidth,
7299
7299
  maxWidth: column.maxWidth,
7300
7300
  textAlign: column.align,
@@ -7303,7 +7303,7 @@ var TableComponent = (0, import_react23.forwardRef)(function Table({
7303
7303
  {
7304
7304
  width: "100%",
7305
7305
  alignItems: "center",
7306
- justifyContent: "space-between",
7306
+ justifyContent: column.filter ? "space-between" : column.align === "center" ? "center" : column.align === "right" ? "flex-end" : "flex-start",
7307
7307
  gap: theme2.styles.gap,
7308
7308
  children: [
7309
7309
  column.type === "checkbox" && onClickAllCheckboxes ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(