@rufous/ui 0.2.78 → 0.2.79
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/main.cjs +0 -34
- package/dist/main.css +2 -7
- package/dist/main.js +0 -34
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -1927,12 +1927,6 @@ var AddressLookup = ({
|
|
|
1927
1927
|
const [suggestions, setSuggestions] = (0, import_react18.useState)([]);
|
|
1928
1928
|
const [loading, setLoading] = (0, import_react18.useState)(false);
|
|
1929
1929
|
const [showSuggestions, setShowSuggestions] = (0, import_react18.useState)(false);
|
|
1930
|
-
const [googleFields, setGoogleFields] = (0, import_react18.useState)({
|
|
1931
|
-
country: false,
|
|
1932
|
-
state: false,
|
|
1933
|
-
city: false,
|
|
1934
|
-
pincode: false
|
|
1935
|
-
});
|
|
1936
1930
|
const debounceTimeout = (0, import_react18.useRef)(null);
|
|
1937
1931
|
const containerRef = (0, import_react18.useRef)(null);
|
|
1938
1932
|
const apiKey = token || "";
|
|
@@ -1948,16 +1942,6 @@ var AddressLookup = ({
|
|
|
1948
1942
|
document.addEventListener("mousedown", handleClickOutside);
|
|
1949
1943
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1950
1944
|
}, []);
|
|
1951
|
-
(0, import_react18.useEffect)(() => {
|
|
1952
|
-
if (value.country || value.state || value.city || value.pincode) {
|
|
1953
|
-
setGoogleFields({
|
|
1954
|
-
country: !!value.country,
|
|
1955
|
-
state: !!value.state,
|
|
1956
|
-
city: !!value.city,
|
|
1957
|
-
pincode: !!value.pincode
|
|
1958
|
-
});
|
|
1959
|
-
}
|
|
1960
|
-
}, []);
|
|
1961
1945
|
(0, import_react18.useEffect)(() => {
|
|
1962
1946
|
if (value.country) {
|
|
1963
1947
|
const country = countries.find((c) => c.name === value.country);
|
|
@@ -2018,12 +2002,6 @@ var AddressLookup = ({
|
|
|
2018
2002
|
const state = findComp("administrative_area_level_1");
|
|
2019
2003
|
const country = findComp("country");
|
|
2020
2004
|
const pincode = findComp("postal_code");
|
|
2021
|
-
setGoogleFields({
|
|
2022
|
-
country: !!country,
|
|
2023
|
-
state: !!state,
|
|
2024
|
-
city: !!city,
|
|
2025
|
-
pincode: !!pincode
|
|
2026
|
-
});
|
|
2027
2005
|
const updatedData = {
|
|
2028
2006
|
...value,
|
|
2029
2007
|
addressLine1: mainText || value.addressLine1,
|
|
@@ -2074,7 +2052,6 @@ var AddressLookup = ({
|
|
|
2074
2052
|
state: "",
|
|
2075
2053
|
city: ""
|
|
2076
2054
|
});
|
|
2077
|
-
setGoogleFields({ ...googleFields, country: false, state: false, city: false });
|
|
2078
2055
|
};
|
|
2079
2056
|
const handleStateChange = (newState) => {
|
|
2080
2057
|
onChange({
|
|
@@ -2106,7 +2083,6 @@ var AddressLookup = ({
|
|
|
2106
2083
|
});
|
|
2107
2084
|
setSuggestions([]);
|
|
2108
2085
|
setShowSuggestions(false);
|
|
2109
|
-
setGoogleFields({ country: false, state: false, city: false, pincode: false });
|
|
2110
2086
|
} else {
|
|
2111
2087
|
if (debounceTimeout.current) clearTimeout(debounceTimeout.current);
|
|
2112
2088
|
debounceTimeout.current = setTimeout(() => {
|
|
@@ -2155,8 +2131,6 @@ var AddressLookup = ({
|
|
|
2155
2131
|
fullWidth: true,
|
|
2156
2132
|
value: value.country || "",
|
|
2157
2133
|
required,
|
|
2158
|
-
className: googleFields.country && value.country ? "field-disabled" : "",
|
|
2159
|
-
readOnly: googleFields.country && !!value.country,
|
|
2160
2134
|
onChange: (e) => handleCountryChange(e.target.value),
|
|
2161
2135
|
list: "countries-list"
|
|
2162
2136
|
}
|
|
@@ -2168,9 +2142,6 @@ var AddressLookup = ({
|
|
|
2168
2142
|
fullWidth: true,
|
|
2169
2143
|
value: value.state || "",
|
|
2170
2144
|
required,
|
|
2171
|
-
disabled: !value.country,
|
|
2172
|
-
className: googleFields.state && value.state ? "field-disabled" : "",
|
|
2173
|
-
readOnly: googleFields.state && !!value.state,
|
|
2174
2145
|
onChange: (e) => handleStateChange(e.target.value),
|
|
2175
2146
|
list: "states-list"
|
|
2176
2147
|
}
|
|
@@ -2182,9 +2153,6 @@ var AddressLookup = ({
|
|
|
2182
2153
|
fullWidth: true,
|
|
2183
2154
|
value: value.city || "",
|
|
2184
2155
|
required,
|
|
2185
|
-
disabled: !value.state,
|
|
2186
|
-
className: googleFields.city && value.city ? "field-disabled" : "",
|
|
2187
|
-
readOnly: googleFields.city && !!value.city,
|
|
2188
2156
|
onChange: (e) => handleChange("city", e.target.value),
|
|
2189
2157
|
list: "cities-list"
|
|
2190
2158
|
}
|
|
@@ -2196,8 +2164,6 @@ var AddressLookup = ({
|
|
|
2196
2164
|
fullWidth: true,
|
|
2197
2165
|
value: value.pincode || "",
|
|
2198
2166
|
required,
|
|
2199
|
-
className: googleFields.pincode && value.pincode ? "field-disabled" : "",
|
|
2200
|
-
readOnly: googleFields.pincode && !!value.pincode,
|
|
2201
2167
|
onChange: (e) => handleChange("pincode", e.target.value)
|
|
2202
2168
|
}
|
|
2203
2169
|
), error.pincode && /* @__PURE__ */ import_react18.default.createElement("div", { className: "field-error-text" }, error.pincode))));
|
package/dist/main.css
CHANGED
|
@@ -1069,7 +1069,6 @@ pre {
|
|
|
1069
1069
|
.autocomplete-option {
|
|
1070
1070
|
padding: 10px 14px;
|
|
1071
1071
|
cursor: pointer;
|
|
1072
|
-
border-bottom: 1px solid var(--border-color, #f0f0f0);
|
|
1073
1072
|
}
|
|
1074
1073
|
.autocomplete-option:last-child {
|
|
1075
1074
|
border-bottom: none;
|
|
@@ -1079,11 +1078,11 @@ pre {
|
|
|
1079
1078
|
}
|
|
1080
1079
|
.autocomplete-main-text {
|
|
1081
1080
|
font-weight: 600;
|
|
1082
|
-
font-size: 0.
|
|
1081
|
+
font-size: 0.8em;
|
|
1083
1082
|
color: var(--text-color, #333);
|
|
1084
1083
|
}
|
|
1085
1084
|
.autocomplete-secondary-text {
|
|
1086
|
-
font-size: 0.
|
|
1085
|
+
font-size: 0.75em;
|
|
1087
1086
|
color: var(--text-secondary, #666);
|
|
1088
1087
|
}
|
|
1089
1088
|
.loading-indicator {
|
|
@@ -1094,10 +1093,6 @@ pre {
|
|
|
1094
1093
|
display: flex;
|
|
1095
1094
|
align-items: center;
|
|
1096
1095
|
}
|
|
1097
|
-
.field-disabled {
|
|
1098
|
-
background-color: var(--hover-color, #f0f0f0);
|
|
1099
|
-
cursor: not-allowed;
|
|
1100
|
-
}
|
|
1101
1096
|
.field-error-text {
|
|
1102
1097
|
color: #dc2626;
|
|
1103
1098
|
font-size: 0.75rem;
|
package/dist/main.js
CHANGED
|
@@ -1761,12 +1761,6 @@ var AddressLookup = ({
|
|
|
1761
1761
|
const [suggestions, setSuggestions] = useState4([]);
|
|
1762
1762
|
const [loading, setLoading] = useState4(false);
|
|
1763
1763
|
const [showSuggestions, setShowSuggestions] = useState4(false);
|
|
1764
|
-
const [googleFields, setGoogleFields] = useState4({
|
|
1765
|
-
country: false,
|
|
1766
|
-
state: false,
|
|
1767
|
-
city: false,
|
|
1768
|
-
pincode: false
|
|
1769
|
-
});
|
|
1770
1764
|
const debounceTimeout = useRef3(null);
|
|
1771
1765
|
const containerRef = useRef3(null);
|
|
1772
1766
|
const apiKey = token || "";
|
|
@@ -1782,16 +1776,6 @@ var AddressLookup = ({
|
|
|
1782
1776
|
document.addEventListener("mousedown", handleClickOutside);
|
|
1783
1777
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1784
1778
|
}, []);
|
|
1785
|
-
useEffect4(() => {
|
|
1786
|
-
if (value.country || value.state || value.city || value.pincode) {
|
|
1787
|
-
setGoogleFields({
|
|
1788
|
-
country: !!value.country,
|
|
1789
|
-
state: !!value.state,
|
|
1790
|
-
city: !!value.city,
|
|
1791
|
-
pincode: !!value.pincode
|
|
1792
|
-
});
|
|
1793
|
-
}
|
|
1794
|
-
}, []);
|
|
1795
1779
|
useEffect4(() => {
|
|
1796
1780
|
if (value.country) {
|
|
1797
1781
|
const country = countries.find((c) => c.name === value.country);
|
|
@@ -1852,12 +1836,6 @@ var AddressLookup = ({
|
|
|
1852
1836
|
const state = findComp("administrative_area_level_1");
|
|
1853
1837
|
const country = findComp("country");
|
|
1854
1838
|
const pincode = findComp("postal_code");
|
|
1855
|
-
setGoogleFields({
|
|
1856
|
-
country: !!country,
|
|
1857
|
-
state: !!state,
|
|
1858
|
-
city: !!city,
|
|
1859
|
-
pincode: !!pincode
|
|
1860
|
-
});
|
|
1861
1839
|
const updatedData = {
|
|
1862
1840
|
...value,
|
|
1863
1841
|
addressLine1: mainText || value.addressLine1,
|
|
@@ -1908,7 +1886,6 @@ var AddressLookup = ({
|
|
|
1908
1886
|
state: "",
|
|
1909
1887
|
city: ""
|
|
1910
1888
|
});
|
|
1911
|
-
setGoogleFields({ ...googleFields, country: false, state: false, city: false });
|
|
1912
1889
|
};
|
|
1913
1890
|
const handleStateChange = (newState) => {
|
|
1914
1891
|
onChange({
|
|
@@ -1940,7 +1917,6 @@ var AddressLookup = ({
|
|
|
1940
1917
|
});
|
|
1941
1918
|
setSuggestions([]);
|
|
1942
1919
|
setShowSuggestions(false);
|
|
1943
|
-
setGoogleFields({ country: false, state: false, city: false, pincode: false });
|
|
1944
1920
|
} else {
|
|
1945
1921
|
if (debounceTimeout.current) clearTimeout(debounceTimeout.current);
|
|
1946
1922
|
debounceTimeout.current = setTimeout(() => {
|
|
@@ -1989,8 +1965,6 @@ var AddressLookup = ({
|
|
|
1989
1965
|
fullWidth: true,
|
|
1990
1966
|
value: value.country || "",
|
|
1991
1967
|
required,
|
|
1992
|
-
className: googleFields.country && value.country ? "field-disabled" : "",
|
|
1993
|
-
readOnly: googleFields.country && !!value.country,
|
|
1994
1968
|
onChange: (e) => handleCountryChange(e.target.value),
|
|
1995
1969
|
list: "countries-list"
|
|
1996
1970
|
}
|
|
@@ -2002,9 +1976,6 @@ var AddressLookup = ({
|
|
|
2002
1976
|
fullWidth: true,
|
|
2003
1977
|
value: value.state || "",
|
|
2004
1978
|
required,
|
|
2005
|
-
disabled: !value.country,
|
|
2006
|
-
className: googleFields.state && value.state ? "field-disabled" : "",
|
|
2007
|
-
readOnly: googleFields.state && !!value.state,
|
|
2008
1979
|
onChange: (e) => handleStateChange(e.target.value),
|
|
2009
1980
|
list: "states-list"
|
|
2010
1981
|
}
|
|
@@ -2016,9 +1987,6 @@ var AddressLookup = ({
|
|
|
2016
1987
|
fullWidth: true,
|
|
2017
1988
|
value: value.city || "",
|
|
2018
1989
|
required,
|
|
2019
|
-
disabled: !value.state,
|
|
2020
|
-
className: googleFields.city && value.city ? "field-disabled" : "",
|
|
2021
|
-
readOnly: googleFields.city && !!value.city,
|
|
2022
1990
|
onChange: (e) => handleChange("city", e.target.value),
|
|
2023
1991
|
list: "cities-list"
|
|
2024
1992
|
}
|
|
@@ -2030,8 +1998,6 @@ var AddressLookup = ({
|
|
|
2030
1998
|
fullWidth: true,
|
|
2031
1999
|
value: value.pincode || "",
|
|
2032
2000
|
required,
|
|
2033
|
-
className: googleFields.pincode && value.pincode ? "field-disabled" : "",
|
|
2034
|
-
readOnly: googleFields.pincode && !!value.pincode,
|
|
2035
2001
|
onChange: (e) => handleChange("pincode", e.target.value)
|
|
2036
2002
|
}
|
|
2037
2003
|
), error.pincode && /* @__PURE__ */ React69.createElement("div", { className: "field-error-text" }, error.pincode))));
|