@beweco/aurora-ui 0.6.76-qa.104 → 0.6.76-qa.105
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.cjs.js +43 -10
- package/dist/index.esm.js +43 -10
- package/dist/types/components/currency/Currency.d.ts.map +1 -1
- package/dist/types/components/phone/Phone.d.ts.map +1 -1
- package/dist/types/components/phone/flags/Canada.d.ts.map +1 -1
- package/dist/types/components/phone/phone.constants.d.ts.map +1 -1
- package/dist/types/utils/text-search.d.ts +18 -0
- package/dist/types/utils/text-search.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1982,6 +1982,34 @@ var useCloseOnAncestorScroll = function (_a) {
|
|
|
1982
1982
|
}, [isOpen, onClose, contentRef]);
|
|
1983
1983
|
};
|
|
1984
1984
|
|
|
1985
|
+
/**
|
|
1986
|
+
* Comparación de texto para los buscadores de los desplegables (país, moneda).
|
|
1987
|
+
*
|
|
1988
|
+
* El problema que resuelve: los nombres de la lista de países mezclan idiomas y
|
|
1989
|
+
* algunos llevan tilde ("Canadá", "República Dominicana"). Un `includes` crudo
|
|
1990
|
+
* exige que quien busca escriba la tilde, así que teclear "canada" no encontraba
|
|
1991
|
+
* Canadá y "republica" no encontraba República Dominicana — el desplegable
|
|
1992
|
+
* respondía "No se encontraron países" con el país delante.
|
|
1993
|
+
*/
|
|
1994
|
+
/** Minúsculas y sin diacríticos, para comparar lo que se escribe con lo que se muestra. */
|
|
1995
|
+
var normalizeForSearch = function (value) {
|
|
1996
|
+
return value
|
|
1997
|
+
.normalize("NFD")
|
|
1998
|
+
// Rango de marcas combinantes (tildes, diéresis, cedilla) que deja NFD.
|
|
1999
|
+
// Se usa en vez de \p{Diacritic} porque el flag `u` exige target es6+.
|
|
2000
|
+
.replace(/[̀-ͯ]/g, "")
|
|
2001
|
+
.toLowerCase();
|
|
2002
|
+
};
|
|
2003
|
+
/**
|
|
2004
|
+
* `true` si el término aparece en alguno de los campos, ignorando tildes y
|
|
2005
|
+
* mayúsculas. Los campos ausentes se descartan. Un término vacío casa siempre,
|
|
2006
|
+
* igual que el `includes` que sustituye.
|
|
2007
|
+
*/
|
|
2008
|
+
var matchesSearchTerm = function (fields, term) {
|
|
2009
|
+
var needle = normalizeForSearch(term);
|
|
2010
|
+
return fields.some(function (field) { return field != null && normalizeForSearch(field).includes(needle); });
|
|
2011
|
+
};
|
|
2012
|
+
|
|
1985
2013
|
// Lista de países con código telefónico y código ISO
|
|
1986
2014
|
var countries = [
|
|
1987
2015
|
{ code: "+57", name: "Colombia", country: "CO" },
|
|
@@ -2035,6 +2063,7 @@ var defaultTranslations$d = {
|
|
|
2035
2063
|
selectCountryAriaLabel: "Seleccionar país",
|
|
2036
2064
|
expandListAriaLabel: "Desplegar lista de países",
|
|
2037
2065
|
noCountriesFound: "No se encontraron países",
|
|
2066
|
+
countries: {},
|
|
2038
2067
|
};
|
|
2039
2068
|
|
|
2040
2069
|
/**
|
|
@@ -2174,7 +2203,7 @@ var Bulgaria = function () {
|
|
|
2174
2203
|
};
|
|
2175
2204
|
|
|
2176
2205
|
var Canada = function () {
|
|
2177
|
-
return (jsxRuntime.jsxs("svg", { width: "50", height: "40", viewBox: "0 0 21 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntime.jsx("rect", { width: "21", height: "14", fill: "white" }), jsxRuntime.jsx("rect", { width: "5.25", height: "14", fill: "#D80621" }), jsxRuntime.jsx("rect", { x: "15.75", width: "5.25", height: "14", fill: "#D80621" }), jsxRuntime.jsx("path", { d: "M10.
|
|
2206
|
+
return (jsxRuntime.jsxs("svg", { width: "50", height: "40", viewBox: "0 0 21 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxRuntime.jsx("rect", { width: "21", height: "14", fill: "white" }), jsxRuntime.jsx("rect", { width: "5.25", height: "14", fill: "#D80621" }), jsxRuntime.jsx("rect", { x: "15.75", width: "5.25", height: "14", fill: "#D80621" }), jsxRuntime.jsx("path", { d: "M10.50 2.90 L10.92 4.25 L11.75 3.95 L11.45 5.30 L13.30 4.95 L12.85 5.95 L13.20 6.60 L12.00 7.45 L12.30 8.10 L10.95 8.05 L10.50 9.90 L10.05 8.05 L8.70 8.10 L9.00 7.45 L7.80 6.60 L8.15 5.95 L7.70 4.95 L9.55 5.30 L9.25 3.95 L10.08 4.25 Z", fill: "#D80621" }), jsxRuntime.jsx("rect", { x: "10.34", y: "9.7", width: "0.32", height: "1.5", fill: "#D80621" })] }));
|
|
2178
2207
|
};
|
|
2179
2208
|
|
|
2180
2209
|
var Chile = function () {
|
|
@@ -2691,12 +2720,14 @@ var Currency = function (_a) {
|
|
|
2691
2720
|
!currencySelectorLocked &&
|
|
2692
2721
|
!disabled &&
|
|
2693
2722
|
reactDom.createPortal(jsxRuntime.jsxs("div", { ref: portalDropdownRef, style: dropdownPosition, className: "bg-content1 border border-default-200 rounded-lg shadow-lg z-50", role: "listbox", children: [jsxRuntime.jsx("div", { className: "p-2", children: jsxRuntime.jsx("input", { type: "text", className: "w-full px-3 py-2 text-sm bg-default-100 border-medium border-default-200 text-default-500 rounded-lg focus:outline-none focus:border-primary-500", placeholder: t.searchPlaceholder, onChange: function (e) {
|
|
2694
|
-
var searchTerm = e.target.value
|
|
2723
|
+
var searchTerm = e.target.value;
|
|
2695
2724
|
var filtered = options.filter(function (opt) {
|
|
2696
|
-
return
|
|
2697
|
-
opt
|
|
2698
|
-
opt.
|
|
2699
|
-
opt.
|
|
2725
|
+
return matchesSearchTerm([
|
|
2726
|
+
getCountryName(opt),
|
|
2727
|
+
opt.name,
|
|
2728
|
+
opt.currency,
|
|
2729
|
+
opt.country,
|
|
2730
|
+
], searchTerm);
|
|
2700
2731
|
});
|
|
2701
2732
|
setFilteredOptions(filtered);
|
|
2702
2733
|
} }) }), jsxRuntime.jsx("div", { className: "".concat(listMaxHeight, " overflow-y-auto"), children: filteredOptions.length > 0 ? (filteredOptions.map(function (opt) { return (jsxRuntime.jsxs("button", { type: "button", role: "option", "aria-selected": opt.country === selected.country &&
|
|
@@ -4601,11 +4632,13 @@ var Phone = function (_a) {
|
|
|
4601
4632
|
};
|
|
4602
4633
|
return (jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 w-full relative", id: id, children: [finalLabel && (jsxRuntime.jsxs("label", { htmlFor: "phone-input-".concat(name), className: "text-tiny text-default-500 mb-1 text-left", children: [finalLabel, " ", required && jsxRuntime.jsx("span", { className: "text-danger-500", children: "*" })] })), jsxRuntime.jsxs("div", { className: "flex items-center w-full min-h-[56px] transition-colors shadow-sm border-medium border-default-200 rounded-xl focus-within:border-primary-500 ".concat(error ? "!border-danger-500 " : "border-default-200").concat(disabled ? "opacity-60" : ""), children: [jsxRuntime.jsx("div", { className: "relative ml-2", ref: dropdownRef, children: jsxRuntime.jsxs("button", { type: "button", className: "flex items-center gap-1 px-4 h-10 rounded-xl bg-default-100 focus:outline-none transition-colors", onClick: function () { return setIsDropdownOpen(function (v) { return !v; }); }, disabled: disabled, tabIndex: 0, "aria-label": t.selectCountryAriaLabel, children: [jsxRuntime.jsx(FlagIcon, { countryCode: selectedCountry.country, size: "md" }), jsxRuntime.jsx("span", { className: "text-xs text-default-500", children: selectedCountry.code }), jsxRuntime.jsxs("svg", { className: "w-4 h-4 text-default-500 ml-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-label": t.expandListAriaLabel, children: [jsxRuntime.jsx("title", { children: t.expandListAriaLabel }), jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })] })] }) }), jsxRuntime.jsx(react.Input, { type: "tel", className: "flex-1 border-none bg-transparent text-default-500 placeholder-default-500 px-2", placeholder: t.placeholder, value: inputValue, onChange: handleInputChange, onBlur: onBlur, disabled: disabled, name: name, autoComplete: "tel", id: "phone-input-".concat(name) })] }), error && errorText && (jsxRuntime.jsx("span", { className: " text-left text-xs text-danger-500 mt-1", children: errorText })), isDropdownOpen &&
|
|
4603
4634
|
reactDom.createPortal(jsxRuntime.jsxs("div", { ref: portalDropdownRef, style: dropdownPosition, className: "bg-content1 border border-default-200 rounded-lg shadow-lg", "data-react-aria-top-layer": "true", children: [jsxRuntime.jsx("div", { className: "p-2", children: jsxRuntime.jsx("input", { type: "text", className: "w-full px-3 py-2 text-sm bg-default-100 border-medium border-default-200 text-default-500 rounded-lg focus:outline-none focus:border-primary-500", placeholder: t.searchPlaceholder, onChange: function (e) {
|
|
4604
|
-
var searchTerm = e.target.value
|
|
4635
|
+
var searchTerm = e.target.value;
|
|
4605
4636
|
var filtered = uniqueCountries.filter(function (country) {
|
|
4606
|
-
return
|
|
4607
|
-
country
|
|
4608
|
-
country.
|
|
4637
|
+
return matchesSearchTerm([
|
|
4638
|
+
getCountryName(country),
|
|
4639
|
+
country.name,
|
|
4640
|
+
country.code,
|
|
4641
|
+
], searchTerm);
|
|
4609
4642
|
});
|
|
4610
4643
|
setFilteredCountries(filtered);
|
|
4611
4644
|
} }) }), jsxRuntime.jsx("div", { className: "max-h-60 overflow-y-auto", children: filteredCountries.length > 0 ? (filteredCountries.map(function (country) { return (jsxRuntime.jsxs("button", { type: "button", className: "flex items-center w-full px-4 py-2.5 text-sm hover:bg-default-200 ".concat(country.country === selectedCountry.country
|
package/dist/index.esm.js
CHANGED
|
@@ -1983,6 +1983,34 @@ var useCloseOnAncestorScroll = function (_a) {
|
|
|
1983
1983
|
}, [isOpen, onClose, contentRef]);
|
|
1984
1984
|
};
|
|
1985
1985
|
|
|
1986
|
+
/**
|
|
1987
|
+
* Comparación de texto para los buscadores de los desplegables (país, moneda).
|
|
1988
|
+
*
|
|
1989
|
+
* El problema que resuelve: los nombres de la lista de países mezclan idiomas y
|
|
1990
|
+
* algunos llevan tilde ("Canadá", "República Dominicana"). Un `includes` crudo
|
|
1991
|
+
* exige que quien busca escriba la tilde, así que teclear "canada" no encontraba
|
|
1992
|
+
* Canadá y "republica" no encontraba República Dominicana — el desplegable
|
|
1993
|
+
* respondía "No se encontraron países" con el país delante.
|
|
1994
|
+
*/
|
|
1995
|
+
/** Minúsculas y sin diacríticos, para comparar lo que se escribe con lo que se muestra. */
|
|
1996
|
+
var normalizeForSearch = function (value) {
|
|
1997
|
+
return value
|
|
1998
|
+
.normalize("NFD")
|
|
1999
|
+
// Rango de marcas combinantes (tildes, diéresis, cedilla) que deja NFD.
|
|
2000
|
+
// Se usa en vez de \p{Diacritic} porque el flag `u` exige target es6+.
|
|
2001
|
+
.replace(/[̀-ͯ]/g, "")
|
|
2002
|
+
.toLowerCase();
|
|
2003
|
+
};
|
|
2004
|
+
/**
|
|
2005
|
+
* `true` si el término aparece en alguno de los campos, ignorando tildes y
|
|
2006
|
+
* mayúsculas. Los campos ausentes se descartan. Un término vacío casa siempre,
|
|
2007
|
+
* igual que el `includes` que sustituye.
|
|
2008
|
+
*/
|
|
2009
|
+
var matchesSearchTerm = function (fields, term) {
|
|
2010
|
+
var needle = normalizeForSearch(term);
|
|
2011
|
+
return fields.some(function (field) { return field != null && normalizeForSearch(field).includes(needle); });
|
|
2012
|
+
};
|
|
2013
|
+
|
|
1986
2014
|
// Lista de países con código telefónico y código ISO
|
|
1987
2015
|
var countries = [
|
|
1988
2016
|
{ code: "+57", name: "Colombia", country: "CO" },
|
|
@@ -2036,6 +2064,7 @@ var defaultTranslations$d = {
|
|
|
2036
2064
|
selectCountryAriaLabel: "Seleccionar país",
|
|
2037
2065
|
expandListAriaLabel: "Desplegar lista de países",
|
|
2038
2066
|
noCountriesFound: "No se encontraron países",
|
|
2067
|
+
countries: {},
|
|
2039
2068
|
};
|
|
2040
2069
|
|
|
2041
2070
|
/**
|
|
@@ -2175,7 +2204,7 @@ var Bulgaria = function () {
|
|
|
2175
2204
|
};
|
|
2176
2205
|
|
|
2177
2206
|
var Canada = function () {
|
|
2178
|
-
return (jsxs("svg", { width: "50", height: "40", viewBox: "0 0 21 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { width: "21", height: "14", fill: "white" }), jsx("rect", { width: "5.25", height: "14", fill: "#D80621" }), jsx("rect", { x: "15.75", width: "5.25", height: "14", fill: "#D80621" }), jsx("path", { d: "M10.
|
|
2207
|
+
return (jsxs("svg", { width: "50", height: "40", viewBox: "0 0 21 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { width: "21", height: "14", fill: "white" }), jsx("rect", { width: "5.25", height: "14", fill: "#D80621" }), jsx("rect", { x: "15.75", width: "5.25", height: "14", fill: "#D80621" }), jsx("path", { d: "M10.50 2.90 L10.92 4.25 L11.75 3.95 L11.45 5.30 L13.30 4.95 L12.85 5.95 L13.20 6.60 L12.00 7.45 L12.30 8.10 L10.95 8.05 L10.50 9.90 L10.05 8.05 L8.70 8.10 L9.00 7.45 L7.80 6.60 L8.15 5.95 L7.70 4.95 L9.55 5.30 L9.25 3.95 L10.08 4.25 Z", fill: "#D80621" }), jsx("rect", { x: "10.34", y: "9.7", width: "0.32", height: "1.5", fill: "#D80621" })] }));
|
|
2179
2208
|
};
|
|
2180
2209
|
|
|
2181
2210
|
var Chile = function () {
|
|
@@ -2692,12 +2721,14 @@ var Currency = function (_a) {
|
|
|
2692
2721
|
!currencySelectorLocked &&
|
|
2693
2722
|
!disabled &&
|
|
2694
2723
|
createPortal(jsxs("div", { ref: portalDropdownRef, style: dropdownPosition, className: "bg-content1 border border-default-200 rounded-lg shadow-lg z-50", role: "listbox", children: [jsx("div", { className: "p-2", children: jsx("input", { type: "text", className: "w-full px-3 py-2 text-sm bg-default-100 border-medium border-default-200 text-default-500 rounded-lg focus:outline-none focus:border-primary-500", placeholder: t.searchPlaceholder, onChange: function (e) {
|
|
2695
|
-
var searchTerm = e.target.value
|
|
2724
|
+
var searchTerm = e.target.value;
|
|
2696
2725
|
var filtered = options.filter(function (opt) {
|
|
2697
|
-
return
|
|
2698
|
-
opt
|
|
2699
|
-
opt.
|
|
2700
|
-
opt.
|
|
2726
|
+
return matchesSearchTerm([
|
|
2727
|
+
getCountryName(opt),
|
|
2728
|
+
opt.name,
|
|
2729
|
+
opt.currency,
|
|
2730
|
+
opt.country,
|
|
2731
|
+
], searchTerm);
|
|
2701
2732
|
});
|
|
2702
2733
|
setFilteredOptions(filtered);
|
|
2703
2734
|
} }) }), jsx("div", { className: "".concat(listMaxHeight, " overflow-y-auto"), children: filteredOptions.length > 0 ? (filteredOptions.map(function (opt) { return (jsxs("button", { type: "button", role: "option", "aria-selected": opt.country === selected.country &&
|
|
@@ -4602,11 +4633,13 @@ var Phone = function (_a) {
|
|
|
4602
4633
|
};
|
|
4603
4634
|
return (jsxs("div", { className: "flex flex-col gap-1 w-full relative", id: id, children: [finalLabel && (jsxs("label", { htmlFor: "phone-input-".concat(name), className: "text-tiny text-default-500 mb-1 text-left", children: [finalLabel, " ", required && jsx("span", { className: "text-danger-500", children: "*" })] })), jsxs("div", { className: "flex items-center w-full min-h-[56px] transition-colors shadow-sm border-medium border-default-200 rounded-xl focus-within:border-primary-500 ".concat(error ? "!border-danger-500 " : "border-default-200").concat(disabled ? "opacity-60" : ""), children: [jsx("div", { className: "relative ml-2", ref: dropdownRef, children: jsxs("button", { type: "button", className: "flex items-center gap-1 px-4 h-10 rounded-xl bg-default-100 focus:outline-none transition-colors", onClick: function () { return setIsDropdownOpen(function (v) { return !v; }); }, disabled: disabled, tabIndex: 0, "aria-label": t.selectCountryAriaLabel, children: [jsx(FlagIcon, { countryCode: selectedCountry.country, size: "md" }), jsx("span", { className: "text-xs text-default-500", children: selectedCountry.code }), jsxs("svg", { className: "w-4 h-4 text-default-500 ml-1", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-label": t.expandListAriaLabel, children: [jsx("title", { children: t.expandListAriaLabel }), jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })] })] }) }), jsx(Input$1, { type: "tel", className: "flex-1 border-none bg-transparent text-default-500 placeholder-default-500 px-2", placeholder: t.placeholder, value: inputValue, onChange: handleInputChange, onBlur: onBlur, disabled: disabled, name: name, autoComplete: "tel", id: "phone-input-".concat(name) })] }), error && errorText && (jsx("span", { className: " text-left text-xs text-danger-500 mt-1", children: errorText })), isDropdownOpen &&
|
|
4604
4635
|
createPortal(jsxs("div", { ref: portalDropdownRef, style: dropdownPosition, className: "bg-content1 border border-default-200 rounded-lg shadow-lg", "data-react-aria-top-layer": "true", children: [jsx("div", { className: "p-2", children: jsx("input", { type: "text", className: "w-full px-3 py-2 text-sm bg-default-100 border-medium border-default-200 text-default-500 rounded-lg focus:outline-none focus:border-primary-500", placeholder: t.searchPlaceholder, onChange: function (e) {
|
|
4605
|
-
var searchTerm = e.target.value
|
|
4636
|
+
var searchTerm = e.target.value;
|
|
4606
4637
|
var filtered = uniqueCountries.filter(function (country) {
|
|
4607
|
-
return
|
|
4608
|
-
country
|
|
4609
|
-
country.
|
|
4638
|
+
return matchesSearchTerm([
|
|
4639
|
+
getCountryName(country),
|
|
4640
|
+
country.name,
|
|
4641
|
+
country.code,
|
|
4642
|
+
], searchTerm);
|
|
4610
4643
|
});
|
|
4611
4644
|
setFilteredCountries(filtered);
|
|
4612
4645
|
} }) }), jsx("div", { className: "max-h-60 overflow-y-auto", children: filteredCountries.length > 0 ? (filteredCountries.map(function (country) { return (jsxs("button", { type: "button", className: "flex items-center w-full px-4 py-2.5 text-sm hover:bg-default-200 ".concat(country.country === selectedCountry.country
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Currency.d.ts","sourceRoot":"","sources":["../../../../src/components/currency/Currency.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Currency.d.ts","sourceRoot":"","sources":["../../../../src/components/currency/Currency.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,kBAAkB,EAAiC,MAAM,kBAAkB,CAAC;AAkD1F,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA+SjD,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Phone.d.ts","sourceRoot":"","sources":["../../../../src/components/phone/Phone.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Phone.d.ts","sourceRoot":"","sources":["../../../../src/components/phone/Phone.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAOrD,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAuP3C,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Canada.d.ts","sourceRoot":"","sources":["../../../../../src/components/phone/flags/Canada.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,+
|
|
1
|
+
{"version":3,"file":"Canada.d.ts","sourceRoot":"","sources":["../../../../../src/components/phone/flags/Canada.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,+CAoBlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone.constants.d.ts","sourceRoot":"","sources":["../../../../src/components/phone/phone.constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGvD,eAAO,MAAM,SAAS;;;;GA0CrB,CAAC;AAEF,eAAO,MAAM,eAAe;;;;GAE3B,CAAC;AAGF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"phone.constants.d.ts","sourceRoot":"","sources":["../../../../src/components/phone/phone.constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGvD,eAAO,MAAM,SAAS;;;;GA0CrB,CAAC;AAEF,eAAO,MAAM,eAAe;;;;GAE3B,CAAC;AAGF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,iBAAiB,CAQ3D,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comparación de texto para los buscadores de los desplegables (país, moneda).
|
|
3
|
+
*
|
|
4
|
+
* El problema que resuelve: los nombres de la lista de países mezclan idiomas y
|
|
5
|
+
* algunos llevan tilde ("Canadá", "República Dominicana"). Un `includes` crudo
|
|
6
|
+
* exige que quien busca escriba la tilde, así que teclear "canada" no encontraba
|
|
7
|
+
* Canadá y "republica" no encontraba República Dominicana — el desplegable
|
|
8
|
+
* respondía "No se encontraron países" con el país delante.
|
|
9
|
+
*/
|
|
10
|
+
/** Minúsculas y sin diacríticos, para comparar lo que se escribe con lo que se muestra. */
|
|
11
|
+
export declare const normalizeForSearch: (value: string) => string;
|
|
12
|
+
/**
|
|
13
|
+
* `true` si el término aparece en alguno de los campos, ignorando tildes y
|
|
14
|
+
* mayúsculas. Los campos ausentes se descartan. Un término vacío casa siempre,
|
|
15
|
+
* igual que el `includes` que sustituye.
|
|
16
|
+
*/
|
|
17
|
+
export declare const matchesSearchTerm: (fields: (string | undefined | null)[], term: string) => boolean;
|
|
18
|
+
//# sourceMappingURL=text-search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-search.d.ts","sourceRoot":"","sources":["../../../src/utils/text-search.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,2FAA2F;AAC3F,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,KAAG,MAMnC,CAAC;AAEjB;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAC7B,QAAQ,CAAC,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,EAAE,EACrC,MAAM,MAAM,KACV,OAKF,CAAC"}
|