@hoddy-ui/next 2.5.83 → 2.5.84
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.js +25 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -24
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1685,9 +1685,9 @@ var TextField = ({
|
|
|
1685
1685
|
return /* @__PURE__ */ new Date();
|
|
1686
1686
|
if (value instanceof Date)
|
|
1687
1687
|
return value;
|
|
1688
|
-
const
|
|
1689
|
-
if (
|
|
1690
|
-
const [
|
|
1688
|
+
const isoParts = `${value}`.split("-");
|
|
1689
|
+
if (isoParts.length === 3) {
|
|
1690
|
+
const [year, month, day] = isoParts;
|
|
1691
1691
|
const parsed = new Date(
|
|
1692
1692
|
parseInt(year, 10),
|
|
1693
1693
|
parseInt(month, 10) - 1,
|
|
@@ -1700,10 +1700,10 @@ var TextField = ({
|
|
|
1700
1700
|
return isNaN(fallback.getTime()) ? /* @__PURE__ */ new Date() : fallback;
|
|
1701
1701
|
};
|
|
1702
1702
|
const handleDateConfirm = (date) => {
|
|
1703
|
-
const day = date.getDate();
|
|
1704
|
-
const month = date.getMonth() + 1;
|
|
1705
1703
|
const year = date.getFullYear();
|
|
1706
|
-
const
|
|
1704
|
+
const month = `${date.getMonth() + 1}`.padStart(2, "0");
|
|
1705
|
+
const day = `${date.getDate()}`.padStart(2, "0");
|
|
1706
|
+
const dateString = `${year}-${month}-${day}`;
|
|
1707
1707
|
onChangeText?.(dateString);
|
|
1708
1708
|
setDatePickerVisible(false);
|
|
1709
1709
|
};
|
|
@@ -1983,9 +1983,9 @@ var TextField2 = import_react16.default.forwardRef(
|
|
|
1983
1983
|
return /* @__PURE__ */ new Date();
|
|
1984
1984
|
if (value instanceof Date)
|
|
1985
1985
|
return value;
|
|
1986
|
-
const
|
|
1987
|
-
if (
|
|
1988
|
-
const [
|
|
1986
|
+
const isoParts = `${value}`.split("-");
|
|
1987
|
+
if (isoParts.length === 3) {
|
|
1988
|
+
const [year, month, day] = isoParts;
|
|
1989
1989
|
const parsed = new Date(
|
|
1990
1990
|
parseInt(year, 10),
|
|
1991
1991
|
parseInt(month, 10) - 1,
|
|
@@ -1998,12 +1998,13 @@ var TextField2 = import_react16.default.forwardRef(
|
|
|
1998
1998
|
return isNaN(fallback.getTime()) ? /* @__PURE__ */ new Date() : fallback;
|
|
1999
1999
|
};
|
|
2000
2000
|
const handleDateConfirm = (date) => {
|
|
2001
|
-
const day = date.getDate();
|
|
2002
|
-
const month = date.getMonth() + 1;
|
|
2003
2001
|
const year = date.getFullYear();
|
|
2002
|
+
const month = `${date.getMonth() + 1}`.padStart(2, "0");
|
|
2003
|
+
const day = `${date.getDate()}`.padStart(2, "0");
|
|
2004
2004
|
const dateString = `${year}-${month}-${day}`;
|
|
2005
2005
|
onChangeText?.(dateString);
|
|
2006
2006
|
setDatePickerVisible(false);
|
|
2007
|
+
setFocused(false);
|
|
2007
2008
|
};
|
|
2008
2009
|
const handleContainerPress = () => {
|
|
2009
2010
|
if (disabled)
|
|
@@ -2106,19 +2107,7 @@ var TextField2 = import_react16.default.forwardRef(
|
|
|
2106
2107
|
variant: "caption"
|
|
2107
2108
|
},
|
|
2108
2109
|
helperText
|
|
2109
|
-
), error && /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles.error }, /* @__PURE__ */ import_react16.default.createElement(import_vector_icons8.MaterialIcons, { name: "error", color: colors2.error.main, size: 16 }), /* @__PURE__ */ import_react16.default.createElement(Typography_default, { style: styles.errorText, color: "error" }, error))),
|
|
2110
|
-
import_react_native_modal_datetime_picker.default,
|
|
2111
|
-
{
|
|
2112
|
-
isVisible: datePickerVisible,
|
|
2113
|
-
mode: "date",
|
|
2114
|
-
date: parseDateValue(),
|
|
2115
|
-
onConfirm: handleDateConfirm,
|
|
2116
|
-
onCancel: () => {
|
|
2117
|
-
setDatePickerVisible(false);
|
|
2118
|
-
setFocused(false);
|
|
2119
|
-
}
|
|
2120
|
-
}
|
|
2121
|
-
), options && /* @__PURE__ */ import_react16.default.createElement(
|
|
2110
|
+
), error && /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles.error }, /* @__PURE__ */ import_react16.default.createElement(import_vector_icons8.MaterialIcons, { name: "error", color: colors2.error.main, size: 16 }), /* @__PURE__ */ import_react16.default.createElement(Typography_default, { style: styles.errorText, color: "error" }, error))), options && /* @__PURE__ */ import_react16.default.createElement(
|
|
2122
2111
|
SelectMenu_default,
|
|
2123
2112
|
{
|
|
2124
2113
|
options,
|
|
@@ -2130,6 +2119,18 @@ var TextField2 = import_react16.default.forwardRef(
|
|
|
2130
2119
|
onChange: onChangeText,
|
|
2131
2120
|
...selectMenuProps
|
|
2132
2121
|
}
|
|
2122
|
+
), isDate && /* @__PURE__ */ import_react16.default.createElement(
|
|
2123
|
+
import_react_native_modal_datetime_picker.default,
|
|
2124
|
+
{
|
|
2125
|
+
isVisible: datePickerVisible,
|
|
2126
|
+
mode: "date",
|
|
2127
|
+
date: parseDateValue(),
|
|
2128
|
+
onConfirm: handleDateConfirm,
|
|
2129
|
+
onCancel: () => {
|
|
2130
|
+
setDatePickerVisible(false);
|
|
2131
|
+
setFocused(false);
|
|
2132
|
+
}
|
|
2133
|
+
}
|
|
2133
2134
|
));
|
|
2134
2135
|
}
|
|
2135
2136
|
);
|