react-better-html 1.1.149 → 1.1.151

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
@@ -410,6 +410,10 @@ type InputFieldComponentType = {
410
410
  dateTime: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps & {
411
411
  minDate?: Date;
412
412
  maxDate?: Date;
413
+ /** @default today */
414
+ defaultDateAfterTimePick?: `${number}-${number}-${number}`;
415
+ /** @default "00:00" */
416
+ defaultTimeAfterDatePick?: `${number}:${number}`;
413
417
  }>) => React.ReactElement;
414
418
  time: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) => React.ReactElement;
415
419
  color: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) => React.ReactElement;
@@ -738,6 +742,7 @@ type TableProps<DataItem> = {
738
742
  pageCount?: number;
739
743
  isInsideTableExpandRow?: boolean;
740
744
  containsOverflowComponents?: boolean;
745
+ wrapperComponentRef?: React.Ref<HTMLDivElement>;
741
746
  getRowStyle?: (item: DataItem, index: number) => ComponentStyle;
742
747
  onClickRow?: (item: DataItem, index: number) => void;
743
748
  onClickAllCheckboxes?: (checked: boolean) => void;
package/dist/index.d.ts CHANGED
@@ -410,6 +410,10 @@ type InputFieldComponentType = {
410
410
  dateTime: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps & {
411
411
  minDate?: Date;
412
412
  maxDate?: Date;
413
+ /** @default today */
414
+ defaultDateAfterTimePick?: `${number}-${number}-${number}`;
415
+ /** @default "00:00" */
416
+ defaultTimeAfterDatePick?: `${number}:${number}`;
413
417
  }>) => React.ReactElement;
414
418
  time: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) => React.ReactElement;
415
419
  color: (props: ComponentPropWithRef<HTMLInputElement, InputFieldProps>) => React.ReactElement;
@@ -738,6 +742,7 @@ type TableProps<DataItem> = {
738
742
  pageCount?: number;
739
743
  isInsideTableExpandRow?: boolean;
740
744
  containsOverflowComponents?: boolean;
745
+ wrapperComponentRef?: React.Ref<HTMLDivElement>;
741
746
  getRowStyle?: (item: DataItem, index: number) => ComponentStyle;
742
747
  onClickRow?: (item: DataItem, index: number) => void;
743
748
  onClickAllCheckboxes?: (checked: boolean) => void;
package/dist/index.js CHANGED
@@ -3697,7 +3697,7 @@ var PageHeaderComponent = (0, import_react15.forwardRef)(function PageHeader({
3697
3697
  {
3698
3698
  alignItems: "center",
3699
3699
  gap: theme2.styles.space,
3700
- marginBottom: marginBottom ?? theme2.styles.space * 2,
3700
+ marginBottom: marginBottom || theme2.styles.space * 2,
3701
3701
  ref,
3702
3702
  children: [
3703
3703
  imageUrl && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Image_default.profileImage, { src: imageUrl, size: imageSize ?? (mediaQuery.size600 ? 46 : 60) }),
@@ -6581,7 +6581,7 @@ InputFieldComponent.date = (0, import_react20.forwardRef)(function Date2({ minDa
6581
6581
  }
6582
6582
  );
6583
6583
  });
6584
- InputFieldComponent.dateTime = (0, import_react20.forwardRef)(function DateTime({ minDate, maxDate, ...props }, ref) {
6584
+ InputFieldComponent.dateTime = (0, import_react20.forwardRef)(function DateTime({ minDate, maxDate, defaultDateAfterTimePick, defaultTimeAfterDatePick = "00:00", ...props }, ref) {
6585
6585
  const theme2 = useTheme();
6586
6586
  const holderRef = (0, import_react20.useRef)(null);
6587
6587
  const selectedHourRef = (0, import_react20.useRef)(null);
@@ -6590,31 +6590,31 @@ InputFieldComponent.dateTime = (0, import_react20.forwardRef)(function DateTime(
6590
6590
  const { internalValue, setInternalValue, inputFieldProps, insideInputFieldComponentProps, isOpen } = useComponentInputFieldDateProps(props, holderRef, isMobileIOS);
6591
6591
  const onChange = (0, import_react20.useCallback)(
6592
6592
  (date) => {
6593
- const newValue = date ? `${date}T${internalValue?.toString().split("T")[1] ?? "00:00"}` : "";
6593
+ const newValue = date ? `${date}T${internalValue?.toString().split("T")[1] ?? defaultTimeAfterDatePick}` : "";
6594
6594
  inputFieldProps.onChangeValue?.(newValue);
6595
6595
  setInternalValue(newValue);
6596
6596
  },
6597
- [internalValue, inputFieldProps.onChangeValue]
6597
+ [internalValue, defaultTimeAfterDatePick, inputFieldProps.onChangeValue]
6598
6598
  );
6599
6599
  const onClickHour = (0, import_react20.useCallback)(
6600
6600
  (hour) => {
6601
6601
  const newTime = `${hour.toString().padStart(2, "0")}:${internalValue?.toString().split(":")[1] || "00"}`;
6602
- const today = `${(/* @__PURE__ */ new Date()).getFullYear()}-${((/* @__PURE__ */ new Date()).getMonth() + 1).toString().padStart(2, "0")}-${(/* @__PURE__ */ new Date()).getDate().toString().padStart(2, "0")}`;
6602
+ const today = defaultDateAfterTimePick ?? `${(/* @__PURE__ */ new Date()).getFullYear()}-${((/* @__PURE__ */ new Date()).getMonth() + 1).toString().padStart(2, "0")}-${(/* @__PURE__ */ new Date()).getDate().toString().padStart(2, "0")}`;
6603
6603
  const newValue = `${(internalValue.trim() || today)?.toString().split("T")[0]}T${newTime}`;
6604
6604
  inputFieldProps.onChangeValue?.(newValue);
6605
6605
  setInternalValue(newValue);
6606
6606
  },
6607
- [internalValue, inputFieldProps.onChangeValue]
6607
+ [defaultDateAfterTimePick, internalValue, inputFieldProps.onChangeValue]
6608
6608
  );
6609
6609
  const onClickMinute = (0, import_react20.useCallback)(
6610
6610
  (minute) => {
6611
6611
  const newTime = `${internalValue?.toString().split("T")?.[1]?.split(":")[0] || "00"}:${minute.toString().padStart(2, "0")}`;
6612
- const today = `${(/* @__PURE__ */ new Date()).getFullYear()}-${((/* @__PURE__ */ new Date()).getMonth() + 1).toString().padStart(2, "0")}-${(/* @__PURE__ */ new Date()).getDate().toString().padStart(2, "0")}`;
6612
+ const today = defaultDateAfterTimePick ?? `${(/* @__PURE__ */ new Date()).getFullYear()}-${((/* @__PURE__ */ new Date()).getMonth() + 1).toString().padStart(2, "0")}-${(/* @__PURE__ */ new Date()).getDate().toString().padStart(2, "0")}`;
6613
6613
  const newValue = `${(internalValue.trim() || today)?.toString().split("T")[0]}T${newTime}`;
6614
6614
  inputFieldProps.onChangeValue?.(newValue);
6615
6615
  setInternalValue(newValue);
6616
6616
  },
6617
- [internalValue, inputFieldProps.onChangeValue]
6617
+ [defaultDateAfterTimePick, internalValue, inputFieldProps.onChangeValue]
6618
6618
  );
6619
6619
  (0, import_react20.useEffect)(() => {
6620
6620
  if (isOpen && selectedHourRef.current)
@@ -7583,6 +7583,7 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
7583
7583
  pageCount,
7584
7584
  isInsideTableExpandRow,
7585
7585
  containsOverflowComponents,
7586
+ wrapperComponentRef,
7586
7587
  getRowStyle,
7587
7588
  onClickRow,
7588
7589
  onClickAllCheckboxes,
@@ -7963,6 +7964,7 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
7963
7964
  borderRadius: theme2.styles.borderRadius * 2,
7964
7965
  overflow: !containsOverflowComponents ? "auto" : void 0,
7965
7966
  ...props,
7967
+ ref: wrapperComponentRef,
7966
7968
  children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
7967
7969
  TableStyledComponent,
7968
7970
  {
@@ -8033,7 +8035,7 @@ var TableComponent = (0, import_react25.forwardRef)(function Table({
8033
8035
  }
8034
8036
  ),
8035
8037
  expandedRows[rowIndex] && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tr", { className: "withoutHover isExpandRow", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("td", { colSpan: columns.length, children: renderExpandedRow(item, rowIndex) }) })
8036
- ] }, JSON.stringify(item) + rowIndex + getRowStyle)) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tr", { className: "withoutHover", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("td", { className: "noData", colSpan: columns.length, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text_default.unknown, { children: noDataItemsMessage }) }) }) }),
8038
+ ] }, JSON.stringify(item) + rowIndex)) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tr", { className: "withoutHover", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("td", { className: "noData", colSpan: columns.length, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text_default.unknown, { children: noDataItemsMessage }) }) }) }),
8037
8039
  withFooter && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tfoot", { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("tr", { className: "isFooter", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("td", { colSpan: columns.length, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
8038
8040
  Div_default.column,
8039
8041
  {