@hoddy-ui/next 2.5.86 → 2.5.88
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 +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +278 -426
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +277 -426
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1498,325 +1498,54 @@ var SelectMenu = ({
|
|
|
1498
1498
|
var SelectMenu_default = SelectMenu;
|
|
1499
1499
|
|
|
1500
1500
|
// ../src/Components/TextField.tsx
|
|
1501
|
-
var
|
|
1502
|
-
|
|
1503
|
-
keyboardType,
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
const
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
if (focused || value) {
|
|
1540
|
-
Animated3.timing(labelAnim, {
|
|
1541
|
-
toValue: verticalScale(variant === "text" ? 2 : 4),
|
|
1542
|
-
duration: 300,
|
|
1543
|
-
useNativeDriver: false
|
|
1544
|
-
}).start();
|
|
1545
|
-
} else {
|
|
1546
|
-
Animated3.timing(labelAnim, {
|
|
1547
|
-
toValue: height2 / moderateScale2(variant === "text" ? 2.5 : 3.2),
|
|
1548
|
-
duration: 300,
|
|
1549
|
-
useNativeDriver: false
|
|
1550
|
-
}).start();
|
|
1551
|
-
}
|
|
1552
|
-
}, [focused, value]);
|
|
1553
|
-
const styles = ScaledSheet12.create({
|
|
1554
|
-
root: {
|
|
1555
|
-
marginBottom: ms7(gutterBottom),
|
|
1556
|
-
width: "100%",
|
|
1557
|
-
...style
|
|
1558
|
-
},
|
|
1559
|
-
container: {
|
|
1560
|
-
height: height2,
|
|
1561
|
-
overflow: "hidden",
|
|
1562
|
-
backgroundColor: variant === "outlined" || variant === "text" ? "#fff0" : focused ? colors2.white[3] : colors2.white[4],
|
|
1563
|
-
flexDirection: "row",
|
|
1564
|
-
borderColor: error ? colors2.error.main : focused ? colors2[color].main : colors2.textSecondary.main,
|
|
1565
|
-
borderWidth: error ? 1 : variant === "outlined" ? focused ? 2 : 0.5 : 0,
|
|
1566
|
-
borderBottomWidth: variant === "text" ? 0.5 : void 0,
|
|
1567
|
-
width: "100%",
|
|
1568
|
-
borderRadius: variant === "text" ? 0 : rounded ? 30 : 7,
|
|
1569
|
-
alignItems: "center",
|
|
1570
|
-
...inputStyles
|
|
1571
|
-
},
|
|
1572
|
-
input: {
|
|
1573
|
-
fontSize: "14@s",
|
|
1574
|
-
flex: 1,
|
|
1575
|
-
alignSelf: "stretch",
|
|
1576
|
-
paddingLeft: variant === "text" ? 0 : moderateScale2(15),
|
|
1577
|
-
paddingRight: moderateScale2(10),
|
|
1578
|
-
paddingTop: "11@vs",
|
|
1579
|
-
fontFamily: getFontFamily(400),
|
|
1580
|
-
color: disabled ? colors2.textSecondary.main : colors2.dark.main,
|
|
1581
|
-
zIndex: 10
|
|
1582
|
-
// backgroundColor: "#284",
|
|
1583
|
-
},
|
|
1584
|
-
inputText: {
|
|
1585
|
-
fontSize: "14@ms",
|
|
1586
|
-
flex: 1,
|
|
1587
|
-
paddingLeft: variant === "text" ? 0 : moderateScale2(15),
|
|
1588
|
-
paddingTop: "13@ms"
|
|
1589
|
-
},
|
|
1590
|
-
dateContent: {
|
|
1591
|
-
flexDirection: "row",
|
|
1592
|
-
alignItems: "center",
|
|
1593
|
-
flex: 1,
|
|
1594
|
-
paddingLeft: variant === "text" ? 0 : moderateScale2(15),
|
|
1595
|
-
paddingRight: moderateScale2(10),
|
|
1596
|
-
paddingTop: variant === "text" ? ms7(13) : ms7(12)
|
|
1597
|
-
},
|
|
1598
|
-
dateText: {
|
|
1599
|
-
fontSize: "14@ms",
|
|
1600
|
-
flex: 1
|
|
1601
|
-
},
|
|
1602
|
-
datePlaceholder: {
|
|
1603
|
-
color: colors2.textSecondary.main
|
|
1604
|
-
},
|
|
1605
|
-
label: {
|
|
1606
|
-
fontFamily: getFontFamily(400),
|
|
1607
|
-
position: "absolute",
|
|
1608
|
-
left: variant === "text" ? 0 : moderateScale2(15),
|
|
1609
|
-
fontSize: focused || value ? "10@s" : "13@s",
|
|
1610
|
-
color: focused ? colors2[color].main : colors2.textSecondary.main
|
|
1611
|
-
},
|
|
1612
|
-
helperText: {
|
|
1613
|
-
paddingHorizontal: "15@s",
|
|
1614
|
-
flex: 1,
|
|
1615
|
-
color: focused ? colors2[color].dark : colors2.textSecondary.main,
|
|
1616
|
-
paddingTop: "4@ms"
|
|
1617
|
-
},
|
|
1618
|
-
error: {
|
|
1619
|
-
paddingLeft: 10,
|
|
1620
|
-
paddingRight: 10,
|
|
1621
|
-
paddingTop: 5,
|
|
1622
|
-
flexDirection: "row",
|
|
1623
|
-
alignItems: "center"
|
|
1624
|
-
},
|
|
1625
|
-
errorText: {
|
|
1626
|
-
fontSize: 12,
|
|
1627
|
-
marginLeft: 10
|
|
1628
|
-
}
|
|
1629
|
-
});
|
|
1630
|
-
const formProps = type === "email" ? {
|
|
1631
|
-
textContentType: "emailAddress",
|
|
1632
|
-
keyboardType: "email-address",
|
|
1633
|
-
autoCapitalize: "none",
|
|
1634
|
-
autoCompleteType: "email"
|
|
1635
|
-
} : type === "number" ? {
|
|
1636
|
-
keyboardType: "numeric"
|
|
1637
|
-
} : type === "tel" ? {
|
|
1638
|
-
textContentType: "telephoneNumber",
|
|
1639
|
-
keyboardType: "phone-pad"
|
|
1640
|
-
} : type === "search" ? {
|
|
1641
|
-
keyboardType: "web-search",
|
|
1642
|
-
returnKeyType: "search",
|
|
1643
|
-
autoCapitalize: "none"
|
|
1644
|
-
} : type === "password" ? {
|
|
1645
|
-
secureTextEntry: true,
|
|
1646
|
-
autoCompleteType: "password",
|
|
1647
|
-
autoCapitalize: "none",
|
|
1648
|
-
textContentType: "password"
|
|
1649
|
-
} : {};
|
|
1650
|
-
const parseDateValue = () => {
|
|
1651
|
-
if (!value)
|
|
1652
|
-
return /* @__PURE__ */ new Date();
|
|
1653
|
-
if (value instanceof Date)
|
|
1654
|
-
return value;
|
|
1655
|
-
const isoParts = `${value}`.split("-");
|
|
1656
|
-
if (isoParts.length === 3) {
|
|
1657
|
-
const [year, month, day] = isoParts;
|
|
1658
|
-
const parsed = new Date(
|
|
1659
|
-
parseInt(year, 10),
|
|
1660
|
-
parseInt(month, 10) - 1,
|
|
1661
|
-
parseInt(day, 10)
|
|
1662
|
-
);
|
|
1663
|
-
if (!isNaN(parsed.getTime()))
|
|
1664
|
-
return parsed;
|
|
1665
|
-
}
|
|
1666
|
-
const fallback = new Date(value);
|
|
1667
|
-
return isNaN(fallback.getTime()) ? /* @__PURE__ */ new Date() : fallback;
|
|
1668
|
-
};
|
|
1669
|
-
const handleDateConfirm = (date) => {
|
|
1670
|
-
const year = date.getFullYear();
|
|
1671
|
-
const month = `${date.getMonth() + 1}`.padStart(2, "0");
|
|
1672
|
-
const day = `${date.getDate()}`.padStart(2, "0");
|
|
1673
|
-
const dateString = `${year}-${month}-${day}`;
|
|
1674
|
-
onChangeText?.(dateString);
|
|
1675
|
-
setDatePickerVisible(false);
|
|
1676
|
-
};
|
|
1677
|
-
const handleContainerPress = () => {
|
|
1678
|
-
if (disabled)
|
|
1679
|
-
return;
|
|
1680
|
-
setFocused(true);
|
|
1681
|
-
if (isDate) {
|
|
1682
|
-
onFocus();
|
|
1683
|
-
setDatePickerVisible(true);
|
|
1684
|
-
}
|
|
1685
|
-
};
|
|
1686
|
-
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(View10, { style: styles.root }, /* @__PURE__ */ React15.createElement(
|
|
1687
|
-
TouchableOpacity7,
|
|
1688
|
-
{
|
|
1689
|
-
onPress: handleContainerPress,
|
|
1690
|
-
style: styles.container
|
|
1691
|
-
},
|
|
1692
|
-
/* @__PURE__ */ React15.createElement(Animated3.Text, { style: { ...styles.label, top: labelAnim } }, label),
|
|
1693
|
-
start,
|
|
1694
|
-
options ? /* @__PURE__ */ React15.createElement(
|
|
1695
|
-
View10,
|
|
1696
|
-
{
|
|
1697
|
-
style: { flex: 1, alignItems: "center", flexDirection: "row" }
|
|
1698
|
-
},
|
|
1699
|
-
options.find((cur) => cur.value === value)?.start && /* @__PURE__ */ React15.createElement(
|
|
1700
|
-
View10,
|
|
1701
|
-
{
|
|
1702
|
-
style: {
|
|
1703
|
-
paddingTop: variant !== "outlined" ? ms7(13) : 0,
|
|
1704
|
-
paddingRight: 10
|
|
1705
|
-
}
|
|
1706
|
-
},
|
|
1707
|
-
options.find((cur) => cur.value === value)?.start
|
|
1708
|
-
),
|
|
1709
|
-
/* @__PURE__ */ React15.createElement(Typography_default, { style: styles.inputText }, options.find((cur) => cur.value === value)?.label)
|
|
1710
|
-
) : isDate ? /* @__PURE__ */ React15.createElement(View10, { style: styles.dateContent }, /* @__PURE__ */ React15.createElement(
|
|
1711
|
-
Typography_default,
|
|
1712
|
-
{
|
|
1713
|
-
style: [
|
|
1714
|
-
styles.dateText,
|
|
1715
|
-
!value ? styles.datePlaceholder : void 0
|
|
1716
|
-
],
|
|
1717
|
-
color: value ? "dark" : "textSecondary"
|
|
1718
|
-
},
|
|
1719
|
-
value || placeholder
|
|
1720
|
-
), /* @__PURE__ */ React15.createElement(View10, { style: { marginLeft: 8 } }, end ?? /* @__PURE__ */ React15.createElement(
|
|
1721
|
-
Ionicons4,
|
|
1722
|
-
{
|
|
1723
|
-
name: "calendar-outline",
|
|
1724
|
-
size: 22,
|
|
1725
|
-
color: colors2.textSecondary.main
|
|
1726
|
-
}
|
|
1727
|
-
))) : /* @__PURE__ */ React15.createElement(
|
|
1728
|
-
TextInput2,
|
|
1729
|
-
{
|
|
1730
|
-
onFocus: () => {
|
|
1731
|
-
onFocus();
|
|
1732
|
-
setFocused(true);
|
|
1733
|
-
},
|
|
1734
|
-
onBlur: () => {
|
|
1735
|
-
onBlur();
|
|
1736
|
-
setFocused(false);
|
|
1737
|
-
},
|
|
1738
|
-
value,
|
|
1739
|
-
onChangeText,
|
|
1740
|
-
keyboardType,
|
|
1741
|
-
editable: !disabled,
|
|
1742
|
-
selectTextOnFocus: !disabled,
|
|
1743
|
-
onSubmitEditing,
|
|
1744
|
-
placeholderTextColor: colors2.textSecondary.main,
|
|
1745
|
-
...formProps,
|
|
1746
|
-
...props,
|
|
1747
|
-
style: styles.input
|
|
1748
|
-
}
|
|
1749
|
-
),
|
|
1750
|
-
end && /* @__PURE__ */ React15.createElement(
|
|
1751
|
-
View10,
|
|
1752
|
-
{
|
|
1753
|
-
style: {
|
|
1754
|
-
marginRight: 20,
|
|
1755
|
-
paddingTop: variant === "text" ? ms7(13) : 0
|
|
1756
|
-
}
|
|
1757
|
-
},
|
|
1758
|
-
end
|
|
1759
|
-
),
|
|
1760
|
-
options && /* @__PURE__ */ React15.createElement(
|
|
1761
|
-
View10,
|
|
1762
|
-
{
|
|
1763
|
-
style: {
|
|
1764
|
-
marginRight: variant === "text" ? 0 : 20,
|
|
1765
|
-
paddingTop: variant === "text" ? ms7(13) : 0
|
|
1766
|
-
}
|
|
1767
|
-
},
|
|
1768
|
-
/* @__PURE__ */ React15.createElement(
|
|
1769
|
-
Ionicons4,
|
|
1770
|
-
{
|
|
1771
|
-
name: "chevron-down",
|
|
1772
|
-
color: colors2.textSecondary.main,
|
|
1773
|
-
size: 24
|
|
1774
|
-
}
|
|
1775
|
-
)
|
|
1776
|
-
)
|
|
1777
|
-
), helperText && /* @__PURE__ */ React15.createElement(
|
|
1778
|
-
Typography_default,
|
|
1779
|
-
{
|
|
1780
|
-
color: "textSecondary",
|
|
1781
|
-
style: styles.helperText,
|
|
1782
|
-
variant: "caption"
|
|
1783
|
-
},
|
|
1784
|
-
helperText
|
|
1785
|
-
), error && /* @__PURE__ */ React15.createElement(View10, { style: styles.error }, /* @__PURE__ */ React15.createElement(MaterialIcons5, { name: "error", color: colors2.error.main, size: 16 }), /* @__PURE__ */ React15.createElement(Typography_default, { style: styles.errorText, color: "error" }, error))), options && /* @__PURE__ */ React15.createElement(
|
|
1786
|
-
SelectMenu_default,
|
|
1787
|
-
{
|
|
1788
|
-
options,
|
|
1789
|
-
value,
|
|
1790
|
-
open: focused,
|
|
1791
|
-
onClose: () => setFocused(false),
|
|
1792
|
-
label,
|
|
1793
|
-
helperText,
|
|
1794
|
-
onChange: onChangeText,
|
|
1795
|
-
...selectMenuProps
|
|
1796
|
-
}
|
|
1797
|
-
), isDate && /* @__PURE__ */ React15.createElement(
|
|
1798
|
-
DateTimePickerModal,
|
|
1799
|
-
{
|
|
1800
|
-
isVisible: datePickerVisible,
|
|
1801
|
-
mode: "date",
|
|
1802
|
-
date: parseDateValue(),
|
|
1803
|
-
onConfirm: handleDateConfirm,
|
|
1804
|
-
onCancel: () => {
|
|
1805
|
-
setDatePickerVisible(false);
|
|
1806
|
-
setFocused(false);
|
|
1807
|
-
}
|
|
1808
|
-
}
|
|
1809
|
-
));
|
|
1810
|
-
};
|
|
1811
|
-
var TextField2 = React15.forwardRef(
|
|
1501
|
+
var formPropsFromType = (type, showPassword) => type === "email" ? {
|
|
1502
|
+
textContentType: "emailAddress",
|
|
1503
|
+
keyboardType: "email-address",
|
|
1504
|
+
autoCapitalize: "none",
|
|
1505
|
+
autoCompleteType: "email"
|
|
1506
|
+
} : type === "number" ? { keyboardType: "numeric" } : type === "tel" ? {
|
|
1507
|
+
textContentType: "telephoneNumber",
|
|
1508
|
+
keyboardType: "phone-pad"
|
|
1509
|
+
} : type === "search" ? {
|
|
1510
|
+
keyboardType: "web-search",
|
|
1511
|
+
returnKeyType: "search",
|
|
1512
|
+
autoCapitalize: "none"
|
|
1513
|
+
} : type === "password" ? {
|
|
1514
|
+
secureTextEntry: !showPassword,
|
|
1515
|
+
autoCompleteType: "password",
|
|
1516
|
+
autoCapitalize: "none",
|
|
1517
|
+
textContentType: "password"
|
|
1518
|
+
} : {};
|
|
1519
|
+
function parseDateValue(value) {
|
|
1520
|
+
if (!value)
|
|
1521
|
+
return /* @__PURE__ */ new Date();
|
|
1522
|
+
if (value instanceof Date)
|
|
1523
|
+
return value;
|
|
1524
|
+
const isoParts = `${value}`.split("-");
|
|
1525
|
+
if (isoParts.length === 3) {
|
|
1526
|
+
const [year, month, day] = isoParts;
|
|
1527
|
+
const parsed = new Date(
|
|
1528
|
+
parseInt(year, 10),
|
|
1529
|
+
parseInt(month, 10) - 1,
|
|
1530
|
+
parseInt(day, 10)
|
|
1531
|
+
);
|
|
1532
|
+
if (!isNaN(parsed.getTime()))
|
|
1533
|
+
return parsed;
|
|
1534
|
+
}
|
|
1535
|
+
const fallback = new Date(value);
|
|
1536
|
+
return isNaN(fallback.getTime()) ? /* @__PURE__ */ new Date() : fallback;
|
|
1537
|
+
}
|
|
1538
|
+
var TextFieldBase = React15.forwardRef(
|
|
1812
1539
|
({
|
|
1813
1540
|
label,
|
|
1814
1541
|
labelProps,
|
|
1542
|
+
labelVariant,
|
|
1815
1543
|
keyboardType,
|
|
1544
|
+
variant = "outlined",
|
|
1816
1545
|
color = "primary",
|
|
1817
1546
|
value,
|
|
1818
1547
|
type,
|
|
1819
|
-
placeholder,
|
|
1548
|
+
placeholder = "",
|
|
1820
1549
|
helperText,
|
|
1821
1550
|
onChangeText,
|
|
1822
1551
|
onSubmitEditing = () => {
|
|
@@ -1827,11 +1556,12 @@ var TextField2 = React15.forwardRef(
|
|
|
1827
1556
|
},
|
|
1828
1557
|
error,
|
|
1829
1558
|
start,
|
|
1559
|
+
size = "normal",
|
|
1830
1560
|
rounded,
|
|
1831
1561
|
disabled = false,
|
|
1832
1562
|
style = {},
|
|
1833
1563
|
inputStyles = {},
|
|
1834
|
-
gutterBottom
|
|
1564
|
+
gutterBottom,
|
|
1835
1565
|
end,
|
|
1836
1566
|
options,
|
|
1837
1567
|
multiline,
|
|
@@ -1843,32 +1573,81 @@ var TextField2 = React15.forwardRef(
|
|
|
1843
1573
|
const [showPassword, setShowPassword] = useState7(false);
|
|
1844
1574
|
const [datePickerVisible, setDatePickerVisible] = useState7(false);
|
|
1845
1575
|
const isDate = type === "date";
|
|
1846
|
-
const
|
|
1576
|
+
const setFocused = (next) => {
|
|
1577
|
+
if (options && next) {
|
|
1578
|
+
Keyboard3.dismiss();
|
|
1579
|
+
setTimeout(() => _setFocused(next), 100);
|
|
1580
|
+
} else {
|
|
1581
|
+
_setFocused(next);
|
|
1582
|
+
}
|
|
1583
|
+
};
|
|
1584
|
+
const isFloating = labelVariant === "floating";
|
|
1585
|
+
const hasPlaceholder = placeholder != null && String(placeholder).trim() !== "";
|
|
1586
|
+
const labelOpen = focused || value || isFloating && hasPlaceholder;
|
|
1587
|
+
const baseHeight = moderateScale2(
|
|
1847
1588
|
multiline ? 50 + (props.numberOfLines || 1) * 18 : 50
|
|
1848
1589
|
);
|
|
1849
|
-
const
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1590
|
+
const sizeMultiplier = isFloating ? size === "large" ? 1.2 : size === "small" ? 0.8 : 1 : 1;
|
|
1591
|
+
const height2 = baseHeight * sizeMultiplier;
|
|
1592
|
+
const labelAnim = useRef2(
|
|
1593
|
+
new Animated3.Value(
|
|
1594
|
+
height2 / moderateScale2(variant === "text" ? 2.5 : 3.2)
|
|
1595
|
+
)
|
|
1596
|
+
).current;
|
|
1597
|
+
React15.useEffect(() => {
|
|
1598
|
+
if (!isFloating)
|
|
1599
|
+
return;
|
|
1600
|
+
if (labelOpen) {
|
|
1601
|
+
Animated3.timing(labelAnim, {
|
|
1602
|
+
toValue: verticalScale(variant === "text" ? 2 : 4),
|
|
1603
|
+
duration: 300,
|
|
1604
|
+
useNativeDriver: false
|
|
1605
|
+
}).start();
|
|
1855
1606
|
} else {
|
|
1856
|
-
|
|
1607
|
+
Animated3.timing(labelAnim, {
|
|
1608
|
+
toValue: height2 / moderateScale2(variant === "text" ? 2.5 : 3.2),
|
|
1609
|
+
duration: 300,
|
|
1610
|
+
useNativeDriver: false
|
|
1611
|
+
}).start();
|
|
1612
|
+
}
|
|
1613
|
+
}, [isFloating, labelOpen, variant, height2]);
|
|
1614
|
+
const formProps = formPropsFromType(type, showPassword);
|
|
1615
|
+
const handleDateConfirm = (date) => {
|
|
1616
|
+
const year = date.getFullYear();
|
|
1617
|
+
const month = `${date.getMonth() + 1}`.padStart(2, "0");
|
|
1618
|
+
const day = `${date.getDate()}`.padStart(2, "0");
|
|
1619
|
+
onChangeText?.(`${year}-${month}-${day}`);
|
|
1620
|
+
setDatePickerVisible(false);
|
|
1621
|
+
setFocused(false);
|
|
1622
|
+
};
|
|
1623
|
+
const handleContainerPress = () => {
|
|
1624
|
+
if (disabled)
|
|
1625
|
+
return;
|
|
1626
|
+
setFocused(true);
|
|
1627
|
+
if (isDate) {
|
|
1628
|
+
onFocus();
|
|
1629
|
+
setDatePickerVisible(true);
|
|
1857
1630
|
}
|
|
1858
1631
|
};
|
|
1632
|
+
const inputPadding = variant === "text" ? 0 : moderateScale2(isFloating ? 15 : 10);
|
|
1633
|
+
const containerBorderRadius = variant === "text" ? 0 : rounded ? 30 : isFloating ? 7 : 10;
|
|
1634
|
+
const datePlaceholderColor = colors2.textSecondary.light;
|
|
1859
1635
|
const styles = ScaledSheet12.create({
|
|
1860
1636
|
root: {
|
|
1861
|
-
marginBottom: ms7(gutterBottom),
|
|
1637
|
+
marginBottom: ms7(gutterBottom ?? (isFloating ? 0 : 8)),
|
|
1638
|
+
width: "100%",
|
|
1862
1639
|
...style
|
|
1863
1640
|
},
|
|
1864
1641
|
container: {
|
|
1865
1642
|
height: height2,
|
|
1866
1643
|
overflow: "hidden",
|
|
1867
1644
|
flexDirection: "row",
|
|
1868
|
-
|
|
1869
|
-
|
|
1645
|
+
backgroundColor: variant === "outlined" || variant === "text" ? "#fff0" : focused ? colors2.white[3] : colors2.white[2],
|
|
1646
|
+
borderColor: error ? colors2.error.main : focused ? colors2[color].main : colors2.textSecondary.main,
|
|
1647
|
+
borderWidth: error ? 1 : variant === "outlined" ? focused ? 2 : 0.5 : 0,
|
|
1648
|
+
borderBottomWidth: variant === "text" ? 0.5 : void 0,
|
|
1870
1649
|
width: "100%",
|
|
1871
|
-
borderRadius:
|
|
1650
|
+
borderRadius: containerBorderRadius,
|
|
1872
1651
|
alignItems: multiline ? "flex-start" : "center",
|
|
1873
1652
|
paddingVertical: multiline ? 10 : 0,
|
|
1874
1653
|
...inputStyles
|
|
@@ -1877,40 +1656,42 @@ var TextField2 = React15.forwardRef(
|
|
|
1877
1656
|
fontSize: "14@s",
|
|
1878
1657
|
flex: 1,
|
|
1879
1658
|
alignSelf: "stretch",
|
|
1880
|
-
paddingLeft:
|
|
1659
|
+
paddingLeft: inputPadding,
|
|
1881
1660
|
paddingRight: moderateScale2(10),
|
|
1661
|
+
...isFloating ? { paddingTop: "11@vs", fontFamily: getFontFamily(400) } : {},
|
|
1882
1662
|
color: disabled ? colors2.textSecondary.main : colors2.dark.main,
|
|
1883
1663
|
zIndex: 10
|
|
1884
|
-
// backgroundColor: "#284",
|
|
1885
1664
|
},
|
|
1886
1665
|
inputText: {
|
|
1887
1666
|
fontSize: "14@ms",
|
|
1888
|
-
|
|
1889
|
-
paddingLeft:
|
|
1890
|
-
|
|
1891
|
-
placeholder: {
|
|
1892
|
-
fontSize: "14@ms",
|
|
1893
|
-
color: colors2.textSecondary.light,
|
|
1894
|
-
paddingLeft: moderateScale2(10)
|
|
1667
|
+
flex: 1,
|
|
1668
|
+
paddingLeft: inputPadding,
|
|
1669
|
+
...isFloating ? { paddingTop: "13@ms" } : {}
|
|
1895
1670
|
},
|
|
1896
1671
|
dateContent: {
|
|
1897
1672
|
flexDirection: "row",
|
|
1898
1673
|
alignItems: "center",
|
|
1899
1674
|
flex: 1,
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
dateText: {
|
|
1904
|
-
fontSize: "14@ms",
|
|
1905
|
-
flex: 1
|
|
1906
|
-
},
|
|
1907
|
-
datePlaceholder: {
|
|
1908
|
-
color: colors2.textSecondary.light
|
|
1675
|
+
paddingLeft: inputPadding,
|
|
1676
|
+
paddingRight: moderateScale2(10),
|
|
1677
|
+
paddingTop: isFloating ? variant === "text" ? ms7(13) : ms7(12) : multiline ? 4 : 0
|
|
1909
1678
|
},
|
|
1910
|
-
|
|
1679
|
+
dateText: { fontSize: "14@ms", flex: 1 },
|
|
1680
|
+
datePlaceholder: { color: datePlaceholderColor },
|
|
1681
|
+
...isFloating ? {
|
|
1682
|
+
contentWrapper: { flex: 1, position: "relative" },
|
|
1683
|
+
label: {
|
|
1684
|
+
fontFamily: getFontFamily(400),
|
|
1685
|
+
position: "absolute",
|
|
1686
|
+
left: inputPadding,
|
|
1687
|
+
fontSize: labelOpen ? "10@s" : "13@s",
|
|
1688
|
+
color: focused ? colors2[color].main : colors2.textSecondary.main
|
|
1689
|
+
}
|
|
1690
|
+
} : {},
|
|
1911
1691
|
helperText: {
|
|
1912
1692
|
paddingHorizontal: "15@s",
|
|
1913
|
-
|
|
1693
|
+
flex: 1,
|
|
1694
|
+
color: focused ? colors2[color].dark : colors2.textSecondary.main,
|
|
1914
1695
|
paddingTop: "4@ms"
|
|
1915
1696
|
},
|
|
1916
1697
|
error: {
|
|
@@ -1920,69 +1701,16 @@ var TextField2 = React15.forwardRef(
|
|
|
1920
1701
|
flexDirection: "row",
|
|
1921
1702
|
alignItems: "center"
|
|
1922
1703
|
},
|
|
1923
|
-
errorText: {
|
|
1924
|
-
|
|
1925
|
-
|
|
1704
|
+
errorText: { fontSize: 12, marginLeft: 10 },
|
|
1705
|
+
placeholder: {
|
|
1706
|
+
fontSize: "14@ms",
|
|
1707
|
+
color: colors2.textSecondary.light,
|
|
1708
|
+
paddingLeft: inputPadding
|
|
1926
1709
|
}
|
|
1927
1710
|
});
|
|
1928
|
-
const
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
autoCapitalize: "none",
|
|
1932
|
-
autoCompleteType: "email"
|
|
1933
|
-
} : type === "number" ? {
|
|
1934
|
-
keyboardType: "numeric"
|
|
1935
|
-
} : type === "tel" ? {
|
|
1936
|
-
textContentType: "telephoneNumber",
|
|
1937
|
-
keyboardType: "phone-pad"
|
|
1938
|
-
} : type === "search" ? {
|
|
1939
|
-
keyboardType: "web-search",
|
|
1940
|
-
returnKeyType: "search",
|
|
1941
|
-
autoCapitalize: "none"
|
|
1942
|
-
} : type === "password" ? {
|
|
1943
|
-
secureTextEntry: !showPassword,
|
|
1944
|
-
autoCompleteType: "password",
|
|
1945
|
-
autoCapitalize: "none",
|
|
1946
|
-
textContentType: "password"
|
|
1947
|
-
} : {};
|
|
1948
|
-
const parseDateValue = () => {
|
|
1949
|
-
if (!value)
|
|
1950
|
-
return /* @__PURE__ */ new Date();
|
|
1951
|
-
if (value instanceof Date)
|
|
1952
|
-
return value;
|
|
1953
|
-
const isoParts = `${value}`.split("-");
|
|
1954
|
-
if (isoParts.length === 3) {
|
|
1955
|
-
const [year, month, day] = isoParts;
|
|
1956
|
-
const parsed = new Date(
|
|
1957
|
-
parseInt(year, 10),
|
|
1958
|
-
parseInt(month, 10) - 1,
|
|
1959
|
-
parseInt(day, 10)
|
|
1960
|
-
);
|
|
1961
|
-
if (!isNaN(parsed.getTime()))
|
|
1962
|
-
return parsed;
|
|
1963
|
-
}
|
|
1964
|
-
const fallback = new Date(value);
|
|
1965
|
-
return isNaN(fallback.getTime()) ? /* @__PURE__ */ new Date() : fallback;
|
|
1966
|
-
};
|
|
1967
|
-
const handleDateConfirm = (date) => {
|
|
1968
|
-
const year = date.getFullYear();
|
|
1969
|
-
const month = `${date.getMonth() + 1}`.padStart(2, "0");
|
|
1970
|
-
const day = `${date.getDate()}`.padStart(2, "0");
|
|
1971
|
-
const dateString = `${year}-${month}-${day}`;
|
|
1972
|
-
onChangeText?.(dateString);
|
|
1973
|
-
setDatePickerVisible(false);
|
|
1974
|
-
setFocused(false);
|
|
1975
|
-
};
|
|
1976
|
-
const handleContainerPress = () => {
|
|
1977
|
-
if (disabled)
|
|
1978
|
-
return;
|
|
1979
|
-
setFocused(true);
|
|
1980
|
-
if (isDate) {
|
|
1981
|
-
onFocus();
|
|
1982
|
-
setDatePickerVisible(true);
|
|
1983
|
-
}
|
|
1984
|
-
};
|
|
1985
|
-
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(View10, { style: styles.root }, label && /* @__PURE__ */ React15.createElement(
|
|
1711
|
+
const selectedOption = options?.find((cur) => cur.value === value);
|
|
1712
|
+
const showPasswordToggle = type === "password" && !end && !options && !isDate;
|
|
1713
|
+
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(View10, { style: styles.root }, isFloating ? null : label != null && label !== "" ? /* @__PURE__ */ React15.createElement(
|
|
1986
1714
|
Typography_default,
|
|
1987
1715
|
{
|
|
1988
1716
|
variant: "body2",
|
|
@@ -1991,14 +1719,111 @@ var TextField2 = React15.forwardRef(
|
|
|
1991
1719
|
...labelProps
|
|
1992
1720
|
},
|
|
1993
1721
|
label
|
|
1994
|
-
), /* @__PURE__ */ React15.createElement(
|
|
1722
|
+
) : null, /* @__PURE__ */ React15.createElement(
|
|
1995
1723
|
TouchableOpacity7,
|
|
1996
1724
|
{
|
|
1997
1725
|
onPress: handleContainerPress,
|
|
1998
|
-
style: styles.container
|
|
1726
|
+
style: styles.container,
|
|
1727
|
+
activeOpacity: 1
|
|
1999
1728
|
},
|
|
2000
|
-
/* @__PURE__ */ React15.createElement(View10, { style: { marginTop: multiline ? 5 : 0 } }, start),
|
|
2001
|
-
|
|
1729
|
+
/* @__PURE__ */ React15.createElement(View10, { style: { marginTop: multiline && !isFloating ? 5 : 0 } }, start),
|
|
1730
|
+
isFloating ? /* @__PURE__ */ React15.createElement(View10, { style: styles.contentWrapper }, label != null && label !== "" ? /* @__PURE__ */ React15.createElement(
|
|
1731
|
+
Animated3.Text,
|
|
1732
|
+
{
|
|
1733
|
+
style: { ...styles.label, top: labelAnim },
|
|
1734
|
+
pointerEvents: "none"
|
|
1735
|
+
},
|
|
1736
|
+
label
|
|
1737
|
+
) : null, options ? /* @__PURE__ */ React15.createElement(
|
|
1738
|
+
View10,
|
|
1739
|
+
{
|
|
1740
|
+
style: {
|
|
1741
|
+
flex: 1,
|
|
1742
|
+
alignItems: "center",
|
|
1743
|
+
flexDirection: "row"
|
|
1744
|
+
}
|
|
1745
|
+
},
|
|
1746
|
+
isFloating && selectedOption?.start ? /* @__PURE__ */ React15.createElement(
|
|
1747
|
+
View10,
|
|
1748
|
+
{
|
|
1749
|
+
style: {
|
|
1750
|
+
paddingTop: variant !== "outlined" ? ms7(13) : 0,
|
|
1751
|
+
paddingRight: 10
|
|
1752
|
+
}
|
|
1753
|
+
},
|
|
1754
|
+
selectedOption.start
|
|
1755
|
+
) : null,
|
|
1756
|
+
selectedOption ? /* @__PURE__ */ React15.createElement(Typography_default, { style: styles.inputText }, selectedOption.label) : !isFloating && /* @__PURE__ */ React15.createElement(Typography_default, { style: styles.placeholder }, placeholder),
|
|
1757
|
+
isFloating ? /* @__PURE__ */ React15.createElement(
|
|
1758
|
+
View10,
|
|
1759
|
+
{
|
|
1760
|
+
style: {
|
|
1761
|
+
marginRight: variant === "text" ? 0 : 20,
|
|
1762
|
+
paddingTop: variant === "text" ? ms7(13) : 0
|
|
1763
|
+
}
|
|
1764
|
+
},
|
|
1765
|
+
/* @__PURE__ */ React15.createElement(
|
|
1766
|
+
Ionicons4,
|
|
1767
|
+
{
|
|
1768
|
+
name: "chevron-down",
|
|
1769
|
+
color: colors2.textSecondary.main,
|
|
1770
|
+
size: 24
|
|
1771
|
+
}
|
|
1772
|
+
)
|
|
1773
|
+
) : /* @__PURE__ */ React15.createElement(
|
|
1774
|
+
Ionicons4,
|
|
1775
|
+
{
|
|
1776
|
+
name: "chevron-down",
|
|
1777
|
+
size: 24,
|
|
1778
|
+
style: { marginLeft: "auto", marginRight: 15 },
|
|
1779
|
+
color: colors2.dark.light
|
|
1780
|
+
}
|
|
1781
|
+
)
|
|
1782
|
+
) : isDate ? /* @__PURE__ */ React15.createElement(View10, { style: styles.dateContent }, /* @__PURE__ */ React15.createElement(
|
|
1783
|
+
Typography_default,
|
|
1784
|
+
{
|
|
1785
|
+
style: [
|
|
1786
|
+
styles.dateText,
|
|
1787
|
+
!value ? styles.datePlaceholder : void 0
|
|
1788
|
+
],
|
|
1789
|
+
color: value ? "dark" : "textSecondary"
|
|
1790
|
+
},
|
|
1791
|
+
value || placeholder
|
|
1792
|
+
), /* @__PURE__ */ React15.createElement(View10, { style: { marginLeft: 8 } }, end ?? /* @__PURE__ */ React15.createElement(
|
|
1793
|
+
Ionicons4,
|
|
1794
|
+
{
|
|
1795
|
+
name: "calendar-outline",
|
|
1796
|
+
size: 22,
|
|
1797
|
+
color: colors2.textSecondary.main
|
|
1798
|
+
}
|
|
1799
|
+
))) : /* @__PURE__ */ React15.createElement(
|
|
1800
|
+
TextInput2,
|
|
1801
|
+
{
|
|
1802
|
+
ref,
|
|
1803
|
+
onFocus: () => {
|
|
1804
|
+
onFocus();
|
|
1805
|
+
setFocused(true);
|
|
1806
|
+
},
|
|
1807
|
+
onBlur: () => {
|
|
1808
|
+
onBlur();
|
|
1809
|
+
setFocused(false);
|
|
1810
|
+
},
|
|
1811
|
+
value,
|
|
1812
|
+
onChangeText,
|
|
1813
|
+
key: type === "password" ? showPassword ? "show" : "hide" : void 0,
|
|
1814
|
+
keyboardType,
|
|
1815
|
+
placeholderTextColor: colors2.textSecondary.light,
|
|
1816
|
+
editable: !disabled,
|
|
1817
|
+
placeholder,
|
|
1818
|
+
selectTextOnFocus: !disabled,
|
|
1819
|
+
onSubmitEditing,
|
|
1820
|
+
multiline,
|
|
1821
|
+
textAlignVertical: multiline ? "top" : "center",
|
|
1822
|
+
...formProps,
|
|
1823
|
+
...props,
|
|
1824
|
+
style: styles.input
|
|
1825
|
+
}
|
|
1826
|
+
)) : options ? /* @__PURE__ */ React15.createElement(React15.Fragment, null, selectedOption ? /* @__PURE__ */ React15.createElement(Typography_default, { style: styles.inputText }, selectedOption.label) : /* @__PURE__ */ React15.createElement(Typography_default, { style: styles.placeholder }, placeholder), /* @__PURE__ */ React15.createElement(
|
|
2002
1827
|
Ionicons4,
|
|
2003
1828
|
{
|
|
2004
1829
|
name: "chevron-down",
|
|
@@ -2037,7 +1862,7 @@ var TextField2 = React15.forwardRef(
|
|
|
2037
1862
|
},
|
|
2038
1863
|
value,
|
|
2039
1864
|
onChangeText,
|
|
2040
|
-
key: showPassword ? "show" : "hide",
|
|
1865
|
+
key: type === "password" ? showPassword ? "show" : "hide" : void 0,
|
|
2041
1866
|
keyboardType,
|
|
2042
1867
|
placeholderTextColor: colors2.textSecondary.light,
|
|
2043
1868
|
editable: !disabled,
|
|
@@ -2045,13 +1870,22 @@ var TextField2 = React15.forwardRef(
|
|
|
2045
1870
|
selectTextOnFocus: !disabled,
|
|
2046
1871
|
onSubmitEditing,
|
|
2047
1872
|
multiline,
|
|
2048
|
-
|
|
1873
|
+
textAlignVertical: multiline ? "top" : "center",
|
|
2049
1874
|
...formProps,
|
|
2050
1875
|
...props,
|
|
2051
1876
|
style: styles.input
|
|
2052
1877
|
}
|
|
2053
1878
|
),
|
|
2054
|
-
end
|
|
1879
|
+
end && !options ? /* @__PURE__ */ React15.createElement(
|
|
1880
|
+
View10,
|
|
1881
|
+
{
|
|
1882
|
+
style: {
|
|
1883
|
+
marginRight: 20,
|
|
1884
|
+
paddingTop: isFloating && variant === "text" ? ms7(13) : 0
|
|
1885
|
+
}
|
|
1886
|
+
},
|
|
1887
|
+
end
|
|
1888
|
+
) : showPasswordToggle ? /* @__PURE__ */ React15.createElement(
|
|
2055
1889
|
TouchableOpacity7,
|
|
2056
1890
|
{
|
|
2057
1891
|
style: { marginRight: 20 },
|
|
@@ -2065,16 +1899,8 @@ var TextField2 = React15.forwardRef(
|
|
|
2065
1899
|
color: colors2.textSecondary.main
|
|
2066
1900
|
}
|
|
2067
1901
|
)
|
|
2068
|
-
)
|
|
2069
|
-
), helperText
|
|
2070
|
-
Typography_default,
|
|
2071
|
-
{
|
|
2072
|
-
color: "textSecondary",
|
|
2073
|
-
style: styles.helperText,
|
|
2074
|
-
variant: "caption"
|
|
2075
|
-
},
|
|
2076
|
-
helperText
|
|
2077
|
-
), error && /* @__PURE__ */ React15.createElement(View10, { style: styles.error }, /* @__PURE__ */ React15.createElement(MaterialIcons5, { name: "error", color: colors2.error.main, size: 16 }), /* @__PURE__ */ React15.createElement(Typography_default, { style: styles.errorText, color: "error" }, error))), options && /* @__PURE__ */ React15.createElement(
|
|
1902
|
+
) : null
|
|
1903
|
+
), helperText ? /* @__PURE__ */ React15.createElement(Typography_default, { style: styles.helperText, variant: "caption" }, helperText) : null, error ? /* @__PURE__ */ React15.createElement(View10, { style: styles.error }, /* @__PURE__ */ React15.createElement(MaterialIcons5, { name: "error", color: colors2.error.main, size: 16 }), /* @__PURE__ */ React15.createElement(Typography_default, { style: styles.errorText, color: "error" }, error)) : null), options ? /* @__PURE__ */ React15.createElement(
|
|
2078
1904
|
SelectMenu_default,
|
|
2079
1905
|
{
|
|
2080
1906
|
options,
|
|
@@ -2086,21 +1912,45 @@ var TextField2 = React15.forwardRef(
|
|
|
2086
1912
|
onChange: onChangeText,
|
|
2087
1913
|
...selectMenuProps
|
|
2088
1914
|
}
|
|
2089
|
-
), isDate
|
|
1915
|
+
) : null, isDate ? /* @__PURE__ */ React15.createElement(
|
|
2090
1916
|
DateTimePickerModal,
|
|
2091
1917
|
{
|
|
2092
1918
|
isVisible: datePickerVisible,
|
|
2093
1919
|
mode: "date",
|
|
2094
|
-
date: parseDateValue(),
|
|
1920
|
+
date: parseDateValue(value),
|
|
2095
1921
|
onConfirm: handleDateConfirm,
|
|
2096
1922
|
onCancel: () => {
|
|
2097
1923
|
setDatePickerVisible(false);
|
|
2098
1924
|
setFocused(false);
|
|
2099
1925
|
}
|
|
2100
1926
|
}
|
|
2101
|
-
));
|
|
1927
|
+
) : null);
|
|
1928
|
+
}
|
|
1929
|
+
);
|
|
1930
|
+
TextFieldBase.displayName = "TextFieldBase";
|
|
1931
|
+
var TextField = React15.forwardRef((props, ref) => /* @__PURE__ */ React15.createElement(
|
|
1932
|
+
TextFieldBase,
|
|
1933
|
+
{
|
|
1934
|
+
...props,
|
|
1935
|
+
ref,
|
|
1936
|
+
labelVariant: "floating",
|
|
1937
|
+
gutterBottom: props.gutterBottom ?? 0,
|
|
1938
|
+
placeholder: props.placeholder ?? ""
|
|
2102
1939
|
}
|
|
1940
|
+
));
|
|
1941
|
+
TextField.displayName = "TextField";
|
|
1942
|
+
var TextField2 = React15.forwardRef(
|
|
1943
|
+
(props, ref) => /* @__PURE__ */ React15.createElement(
|
|
1944
|
+
TextFieldBase,
|
|
1945
|
+
{
|
|
1946
|
+
...props,
|
|
1947
|
+
ref,
|
|
1948
|
+
labelVariant: "external",
|
|
1949
|
+
gutterBottom: props.gutterBottom ?? 8
|
|
1950
|
+
}
|
|
1951
|
+
)
|
|
2103
1952
|
);
|
|
1953
|
+
TextField2.displayName = "TextField2";
|
|
2104
1954
|
var TextField_default = TextField;
|
|
2105
1955
|
|
|
2106
1956
|
// ../src/Components/Locator.tsx
|
|
@@ -3067,6 +2917,7 @@ export {
|
|
|
3067
2917
|
Spinner_default as Spinner,
|
|
3068
2918
|
TextField_default as TextField,
|
|
3069
2919
|
TextField2,
|
|
2920
|
+
TextFieldBase,
|
|
3070
2921
|
Typography_default as Typography,
|
|
3071
2922
|
UIThemeContext,
|
|
3072
2923
|
UIThemeProvider,
|