@jsenv/navi 0.29.385 → 0.29.387
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/dev/jsenv_navi.js +38 -10
- package/dist/dev/jsenv_navi.js.map +4 -4
- package/dist/jsenv_navi.js +35 -10
- package/dist/jsenv_navi.js.map +4 -4
- package/package.json +3 -3
package/dist/dev/jsenv_navi.js
CHANGED
|
@@ -67856,6 +67856,19 @@ const createListRows = () => {
|
|
|
67856
67856
|
`List: every row stands in the same slot, so they keep the order they first rendered in — reordering them (a search, a sort) will not move them. The list's rows must be its own children: give it the rows (or a <List.Items>), not a component rendering them.`,
|
|
67857
67857
|
);
|
|
67858
67858
|
};
|
|
67859
|
+
// A run holds the room of every item it was given, drawn or not: its
|
|
67860
|
+
// fillers count them, its window frames them. A row of it that renders
|
|
67861
|
+
// nothing leaves its room blank, where a declared row gives its place back.
|
|
67862
|
+
let runRowRemovedWarned = false;
|
|
67863
|
+
const warnRunRowRemoved = () => {
|
|
67864
|
+
if (runRowRemovedWarned) {
|
|
67865
|
+
return;
|
|
67866
|
+
}
|
|
67867
|
+
runRowRemovedWarned = true;
|
|
67868
|
+
console.warn(
|
|
67869
|
+
`List: a row drawn by <List.Items> matches nothing and searchNoMatchMode is "remove", but a run's rows cannot be removed: the run keeps the room of every item it was given, so the row leaves a blank. Give <List.Items> the matching items only (useSearchText orders them first; keep the ones whose getItemMatchInfo(item).match is not false), or use searchNoMatchMode="muted" / "invisible_and_inert", which keep the row.`,
|
|
67870
|
+
);
|
|
67871
|
+
};
|
|
67859
67872
|
const removeFromSlot = (slotId, ownerId) => {
|
|
67860
67873
|
const ownerIds = ownerIdsBySlot.get(slotId);
|
|
67861
67874
|
if (!ownerIds) {
|
|
@@ -68127,6 +68140,7 @@ const createListRows = () => {
|
|
|
68127
68140
|
// inside is then its to place (a run draws its groups with their rows
|
|
68128
68141
|
// already placed), and no walk inside it has anything to declare.
|
|
68129
68142
|
slotHasOwner: (slotId) => ownerIdsBySlot.has(slotId),
|
|
68143
|
+
warnRunRowRemoved,
|
|
68130
68144
|
// Whether any run of rows lives in this list: what makes a render window
|
|
68131
68145
|
// mean anything (see List's renderBudget).
|
|
68132
68146
|
hasRuns: () => locatorByOwner.size > 0,
|
|
@@ -72219,6 +72233,9 @@ const ListItemUI = props => {
|
|
|
72219
72233
|
if (matchInfo?.match === false) {
|
|
72220
72234
|
if (searchNoMatchMode === "remove") {
|
|
72221
72235
|
props.filtered = true;
|
|
72236
|
+
if (row) {
|
|
72237
|
+
listRows.warnRunRowRemoved();
|
|
72238
|
+
}
|
|
72222
72239
|
} else if (searchNoMatchMode === "invisible_and_inert") {
|
|
72223
72240
|
props.hidden = true;
|
|
72224
72241
|
} else if (searchNoMatchMode === "muted") {
|
|
@@ -72713,7 +72730,10 @@ const VISIBILITY_HIDDEN_STYLE = {
|
|
|
72713
72730
|
* @param {any[]} [props.items]
|
|
72714
72731
|
* The collection, when it is held in memory: all of it, in order. Nothing is
|
|
72715
72732
|
* ever asked for — `itemsAction`, `count`, `pageSize` and `memoryBudget` have
|
|
72716
|
-
* no part to play, and no row is ever a skeleton.
|
|
72733
|
+
* no part to play, and no row is ever a skeleton. Every item is a row with
|
|
72734
|
+
* its room, whether the run draws it or holds it in a filler: a search that
|
|
72735
|
+
* is to remove rows (`searchNoMatchMode="remove"`) is applied to the array
|
|
72736
|
+
* itself — see `useSearchText` — not to the rows it draws.
|
|
72717
72737
|
* @param {(range: object) => any} [props.itemsAction]
|
|
72718
72738
|
* Where the rows come from when the collection is read a slice at a time:
|
|
72719
72739
|
* a resource's range reader (`RESOURCE.GET_RANGE.bindParams(...)`).
|
|
@@ -80110,18 +80130,26 @@ const createSearch = (fields) => {
|
|
|
80110
80130
|
};
|
|
80111
80131
|
|
|
80112
80132
|
/**
|
|
80113
|
-
*
|
|
80114
|
-
* followed by non-matched items in their natural order. No item is
|
|
80133
|
+
* useSearchText — reorders items so matched ones come first (sorted by score
|
|
80134
|
+
* desc), followed by non-matched items in their natural order. No item is
|
|
80135
|
+
* dropped: what a non-matching row becomes is the list's `searchNoMatchMode`.
|
|
80115
80136
|
* Returns [orderedItems, getItemMatchInfo].
|
|
80116
80137
|
* - orderedItems: all items, reordered
|
|
80117
80138
|
* - getItemMatchInfo(item): { match, matchScore, matchRanges } — pass the
|
|
80118
|
-
* whole thing straight to <
|
|
80119
|
-
* there is no need to destructure the three fields by hand.
|
|
80120
|
-
*
|
|
80121
|
-
*
|
|
80122
|
-
*
|
|
80123
|
-
*
|
|
80124
|
-
*
|
|
80139
|
+
* whole thing straight to <List.Item matchInfo={getItemMatchInfo(item)} />,
|
|
80140
|
+
* there is no need to destructure the three fields by hand. The row derives
|
|
80141
|
+
* filtered / hidden / muted from it, and the list counts the rows matching
|
|
80142
|
+
* nothing (its searchFallback shows when none matches).
|
|
80143
|
+
*
|
|
80144
|
+
* When searchText is empty, natural order is preserved and all items match with
|
|
80145
|
+
* score 0.
|
|
80146
|
+
*
|
|
80147
|
+
* Rows declared one by one (<List.Item> children) give their place back when
|
|
80148
|
+
* removed. A run (<List.Items items={...}>) does not: it keeps the room of
|
|
80149
|
+
* every item it was given, drawn or held in a filler. In "remove" mode, hand
|
|
80150
|
+
* the run the matching items only — the ones whose getItemMatchInfo(item).match
|
|
80151
|
+
* is not false; a typed search that leaves the list without a row still shows
|
|
80152
|
+
* its searchFallback.
|
|
80125
80153
|
*/
|
|
80126
80154
|
const useSearchText = (searchText, items, matchFn = applySearch) => {
|
|
80127
80155
|
if (typeof searchText !== "string" && searchText !== undefined) {
|