react-better-html 1.1.150 → 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 +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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;
|
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;
|
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
|
|
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] ??
|
|
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)
|