@sensiblestats/widget-react 0.81.1 → 0.81.2
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/CHANGELOG.md +6 -0
- package/dist/index.cjs +13 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @sensiblestats/widget-react
|
|
2
2
|
|
|
3
|
+
## 0.81.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Today tab search: narrow a matched group's rendered rows to only the fixture(s) whose team name matched the query, instead of every fixture in that group.
|
|
8
|
+
|
|
3
9
|
## 0.81.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -6004,15 +6004,25 @@ function starClickable(group, pinnedCompetitionId) {
|
|
|
6004
6004
|
function foldSearchText(s) {
|
|
6005
6005
|
return s.replace(/İ/g, "I").replace(/ı/g, "i").normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase();
|
|
6006
6006
|
}
|
|
6007
|
+
function competitionMatchesQuery(group, q) {
|
|
6008
|
+
if (foldSearchText(group.competitionName).includes(q)) return true;
|
|
6009
|
+
return !!group.competitionCountry && foldSearchText(group.competitionCountry).includes(q);
|
|
6010
|
+
}
|
|
6007
6011
|
function matchesQuery(group, query) {
|
|
6008
6012
|
const q = foldSearchText(query.trim());
|
|
6009
6013
|
if (!q) return true;
|
|
6010
|
-
if (
|
|
6011
|
-
if (group.competitionCountry && foldSearchText(group.competitionCountry).includes(q)) return true;
|
|
6014
|
+
if (competitionMatchesQuery(group, q)) return true;
|
|
6012
6015
|
return group.matches.some(
|
|
6013
6016
|
(m) => foldSearchText(m.homeTeamName).includes(q) || foldSearchText(m.awayTeamName).includes(q)
|
|
6014
6017
|
);
|
|
6015
6018
|
}
|
|
6019
|
+
function matchingFixtures(group, query) {
|
|
6020
|
+
const q = foldSearchText(query.trim());
|
|
6021
|
+
if (!q || competitionMatchesQuery(group, q)) return group.matches;
|
|
6022
|
+
return group.matches.filter(
|
|
6023
|
+
(m) => foldSearchText(m.homeTeamName).includes(q) || foldSearchText(m.awayTeamName).includes(q)
|
|
6024
|
+
);
|
|
6025
|
+
}
|
|
6016
6026
|
|
|
6017
6027
|
// src/useStarTap.ts
|
|
6018
6028
|
var import_react38 = require("react");
|
|
@@ -6379,7 +6389,7 @@ function TodayPanel({ discovery, ui, monitor }) {
|
|
|
6379
6389
|
] }) : null
|
|
6380
6390
|
] })
|
|
6381
6391
|
] }),
|
|
6382
|
-
group.
|
|
6392
|
+
matchingFixtures(group, query).map((match) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
6383
6393
|
"div",
|
|
6384
6394
|
{
|
|
6385
6395
|
role: "button",
|