@stapel/search-react 0.32.3 → 0.32.5
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 +26 -0
- package/dist/default/FilterChips.d.ts +17 -0
- package/dist/default/FilterChips.d.ts.map +1 -1
- package/dist/default/FilterChips.js +42 -3
- package/dist/default/FilterChips.js.map +1 -1
- package/dist/default/OtherCategoriesLine.d.ts +35 -6
- package/dist/default/OtherCategoriesLine.d.ts.map +1 -1
- package/dist/default/OtherCategoriesLine.js +54 -11
- package/dist/default/OtherCategoriesLine.js.map +1 -1
- package/dist/default/SearchPage.d.ts +12 -1
- package/dist/default/SearchPage.d.ts.map +1 -1
- package/dist/default/SearchPage.js +5 -3
- package/dist/default/SearchPage.js.map +1 -1
- package/dist/default/SearchResultsPane.d.ts +47 -0
- package/dist/default/SearchResultsPane.d.ts.map +1 -1
- package/dist/default/SearchResultsPane.js +57 -2
- package/dist/default/SearchResultsPane.js.map +1 -1
- package/dist/default/index.d.ts +4 -4
- package/dist/default/index.d.ts.map +1 -1
- package/dist/default/index.js +3 -3
- package/dist/default/index.js.map +1 -1
- package/llms.txt +1 -1
- package/manifest.json +1 -1
- package/nav-manifest.json +1 -1
- package/package.json +5 -5
- package/src/analytics/generated/events.json +1 -1
- package/src/default/FilterChips.tsx +50 -2
- package/src/default/OtherCategoriesLine.tsx +65 -12
- package/src/default/SearchPage.tsx +21 -1
- package/src/default/SearchResultsPane.tsx +107 -1
- package/src/default/index.ts +10 -1
|
@@ -77,6 +77,33 @@ export type SearchResultsWrapper = (items: readonly SearchItem[], results: React
|
|
|
77
77
|
* and the 2560px pane the constant was written against is still capped.
|
|
78
78
|
*/
|
|
79
79
|
export declare const RESULTS_MAX_WIDTH = 1400;
|
|
80
|
+
/**
|
|
81
|
+
* HOW MANY CARD COLUMNS, when the host has an opinion.
|
|
82
|
+
*
|
|
83
|
+
* A number is that many columns at every width. A map is one number per token
|
|
84
|
+
* breakpoint, and the two named rungs are the only ones there are: `phone` is
|
|
85
|
+
* the base, `tablet` and `desktop` take over as the block gets wider. A key
|
|
86
|
+
* left out inherits the rung below it.
|
|
87
|
+
*/
|
|
88
|
+
export type ResultsColumns = number | Readonly<Partial<Record<"phone" | "tablet" | "desktop", number>>>;
|
|
89
|
+
/** The class the responsive arm's rules are hung on. */
|
|
90
|
+
export declare const RESULTS_COLUMNS_CLASS = "stapel-search-results-columns";
|
|
91
|
+
/** The `href` the hoisted column sheet is deduplicated by. */
|
|
92
|
+
export declare const RESULTS_COLUMNS_STYLE_HREF = "stapel-search-results-columns";
|
|
93
|
+
/**
|
|
94
|
+
* The map, as CSS — and the query measures the BLOCK, not the window.
|
|
95
|
+
*
|
|
96
|
+
* It has to: this grid sits in the results column, which on a 1440px desktop
|
|
97
|
+
* is the window minus a 280px filter rail minus the gap. A media query would
|
|
98
|
+
* hand it a desktop column count at a width it never has, and the same three
|
|
99
|
+
* rungs are what `<PopularValues columns="responsive">` already climbs one
|
|
100
|
+
* pane over. The keys NAME the token breakpoints because those are the
|
|
101
|
+
* numbers a host thinks in; what they are compared against is this block's
|
|
102
|
+
* own inline size.
|
|
103
|
+
*
|
|
104
|
+
* Ascending, so the widest matching rung wins by ordinary cascade order.
|
|
105
|
+
*/
|
|
106
|
+
export declare function resultsColumnsCss(columns: ResultsColumns): string;
|
|
80
107
|
export interface SearchResultsPaneProps extends ThemeModeProp {
|
|
81
108
|
/**
|
|
82
109
|
* The card slot (spec §6.2 item 1). A storefront passes
|
|
@@ -164,6 +191,26 @@ export interface SearchResultsPaneProps extends ThemeModeProp {
|
|
|
164
191
|
* Ignored when `renderResults` replaces the arrangement entirely.
|
|
165
192
|
*/
|
|
166
193
|
readonly layout?: SearchResultsLayout;
|
|
194
|
+
/**
|
|
195
|
+
* HOW MANY COLUMNS the `"grid"` arrangement draws.
|
|
196
|
+
*
|
|
197
|
+
* Default: none of them — `repeat(auto-fill, minmax(260px, 1fr))` decides,
|
|
198
|
+
* which is the right answer for a storefront that wants as many readable
|
|
199
|
+
* cards as fit and no breakpoint table to maintain. It is the wrong answer
|
|
200
|
+
* for a deployment whose cards are taller or wider than the default's, and
|
|
201
|
+
* such a host had exactly one way to say so: an `!important` rule on this
|
|
202
|
+
* pane's grid from outside, against a declaration it could not read back.
|
|
203
|
+
*
|
|
204
|
+
* A number is that many columns at every width. A map ({@link
|
|
205
|
+
* ResultsColumns}) is one number per token breakpoint — `{ phone: 1, tablet:
|
|
206
|
+
* 2 }` is the two-cards-per-row tablet SERP this exists for — compared
|
|
207
|
+
* against the width of this BLOCK rather than of the window, because the
|
|
208
|
+
* filter rail takes 280px of that window and the cards never see it.
|
|
209
|
+
*
|
|
210
|
+
* Ignored by `layout="list"` (one row per result IS one column) and by
|
|
211
|
+
* `renderResults`, which replaces the arrangement entirely.
|
|
212
|
+
*/
|
|
213
|
+
readonly columns?: ResultsColumns;
|
|
167
214
|
/**
|
|
168
215
|
* Heading level for the results caption. Default `4`, which is what every
|
|
169
216
|
* surface that EMBEDS this pane under its own title needs.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchResultsPane.d.ts","sourceRoot":"","sources":["../../src/default/SearchResultsPane.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,EAAiB,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAYpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAQlD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAEvE,OAAO,KAAK,EACV,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,C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ode, useT, useTPlural } from "@stapel/core";
|
|
4
4
|
import { EmptyState, ErrorAlert, GatedButton, LoadList, SkinTheme, visuallyHidden, } from "@stapel/tokens-antd/skin";
|
|
5
|
-
import { spacing } from "@stapel/tokens";
|
|
5
|
+
import { breakpoints, spacing } from "@stapel/tokens";
|
|
6
6
|
import { SearchResults } from "../headless/SearchResults.js";
|
|
7
7
|
import { useScorerNames } from "../headless/useScorerNames.js";
|
|
8
8
|
import { SEARCH_WINDOW_EXCEEDED } from "../i18n/errorsMap.js";
|
|
@@ -61,6 +61,48 @@ const RESULTS_LIST = {
|
|
|
61
61
|
...RESULTS_GRID,
|
|
62
62
|
gridTemplateColumns: "1fr",
|
|
63
63
|
};
|
|
64
|
+
/** The class the responsive arm's rules are hung on. */
|
|
65
|
+
export const RESULTS_COLUMNS_CLASS = "stapel-search-results-columns";
|
|
66
|
+
/** The `href` the hoisted column sheet is deduplicated by. */
|
|
67
|
+
export const RESULTS_COLUMNS_STYLE_HREF = "stapel-search-results-columns";
|
|
68
|
+
/** N equal tracks, each allowed to shrink below its content — `minmax(0,
|
|
69
|
+
* 1fr)` rather than `1fr`, or one long unbroken title widens the whole row. */
|
|
70
|
+
function fixedColumns(count) {
|
|
71
|
+
return `repeat(${String(Math.max(1, Math.floor(count)))}, minmax(0, 1fr))`;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The map, as CSS — and the query measures the BLOCK, not the window.
|
|
75
|
+
*
|
|
76
|
+
* It has to: this grid sits in the results column, which on a 1440px desktop
|
|
77
|
+
* is the window minus a 280px filter rail minus the gap. A media query would
|
|
78
|
+
* hand it a desktop column count at a width it never has, and the same three
|
|
79
|
+
* rungs are what `<PopularValues columns="responsive">` already climbs one
|
|
80
|
+
* pane over. The keys NAME the token breakpoints because those are the
|
|
81
|
+
* numbers a host thinks in; what they are compared against is this block's
|
|
82
|
+
* own inline size.
|
|
83
|
+
*
|
|
84
|
+
* Ascending, so the widest matching rung wins by ordinary cascade order.
|
|
85
|
+
*/
|
|
86
|
+
export function resultsColumnsCss(columns) {
|
|
87
|
+
const block = `.${RESULTS_COLUMNS_CLASS}`;
|
|
88
|
+
if (typeof columns === "number") {
|
|
89
|
+
return `${block}{grid-template-columns:${fixedColumns(columns)}}`;
|
|
90
|
+
}
|
|
91
|
+
const rules = [`${block}{container-type:inline-size}`];
|
|
92
|
+
if (columns.phone !== undefined) {
|
|
93
|
+
rules.push(`${block}{grid-template-columns:${fixedColumns(columns.phone)}}`);
|
|
94
|
+
}
|
|
95
|
+
for (const rung of [
|
|
96
|
+
{ at: breakpoints.tablet, count: columns.tablet },
|
|
97
|
+
{ at: breakpoints.desktop, count: columns.desktop },
|
|
98
|
+
]) {
|
|
99
|
+
if (rung.count === undefined)
|
|
100
|
+
continue;
|
|
101
|
+
rules.push(`@container (min-width: ${String(rung.at)}px)` +
|
|
102
|
+
`{${block}{grid-template-columns:${fixedColumns(rung.count)}}}`);
|
|
103
|
+
}
|
|
104
|
+
return rules.join("\n");
|
|
105
|
+
}
|
|
64
106
|
function Count(props) {
|
|
65
107
|
// A COUNTED sentence: `tPlural` asks Intl.PluralRules for the locale's
|
|
66
108
|
// category, so Russian gets three different endings for 1, 3 and 17 instead
|
|
@@ -98,6 +140,11 @@ export function SearchResultsPane(props) {
|
|
|
98
140
|
const { renderCard, renderResults, wrapResults } = props;
|
|
99
141
|
const scorerName = useScorerNames();
|
|
100
142
|
const maxWidth = props.maxWidth === undefined ? RESULTS_MAX_WIDTH : props.maxWidth;
|
|
143
|
+
// A column count is the host's opinion about the GRID; the list arrangement
|
|
144
|
+
// is one column by definition and has nothing to say to it.
|
|
145
|
+
const columnRules = props.columns === undefined || props.layout === "list"
|
|
146
|
+
? null
|
|
147
|
+
: resultsColumnsCss(props.columns);
|
|
101
148
|
return (_jsx(SkinTheme, { surface: "base", ...(props.mode !== undefined ? { mode: props.mode } : {}), style: {
|
|
102
149
|
width: "100%",
|
|
103
150
|
...(maxWidth !== null ? { maxWidth } : {}),
|
|
@@ -119,7 +166,15 @@ export function SearchResultsPane(props) {
|
|
|
119
166
|
? SEARCH_I18N_KEYS.resultsWindowExceeded
|
|
120
167
|
: SEARCH_I18N_KEYS.resultsLoadFailed), retryLabel: t(SEARCH_I18N_KEYS.resultsRetry), onRetry: bag.refetch }));
|
|
121
168
|
}, children: (items) => {
|
|
122
|
-
const arrangement = renderResults !== undefined ? (renderResults(items)) : (
|
|
169
|
+
const arrangement = renderResults !== undefined ? (renderResults(items)) : (_jsxs("div", { style: props.layout === "list" ? RESULTS_LIST : RESULTS_GRID, ...(columnRules !== null
|
|
170
|
+
? { className: RESULTS_COLUMNS_CLASS }
|
|
171
|
+
: {}), "data-testid": "search-results-grid", "data-layout": props.layout ?? "grid", ...(columnRules !== null
|
|
172
|
+
? {
|
|
173
|
+
"data-columns": typeof props.columns === "number"
|
|
174
|
+
? String(props.columns)
|
|
175
|
+
: "responsive",
|
|
176
|
+
}
|
|
177
|
+
: {}), children: [columnRules !== null ? (_jsx("style", { href: RESULTS_COLUMNS_STYLE_HREF, precedence: "default", children: columnRules })) : null, items.map((item) => (_jsx("div", { children: renderCard !== undefined ? (renderCard(item)) : (_jsx(SearchResultCard, { item: item })) }, item.key)))] }));
|
|
123
178
|
return (_jsx("div", { "data-testid": "search-results", children: wrapResults !== undefined
|
|
124
179
|
? wrapResults(items, arrangement)
|
|
125
180
|
: arrangement }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchResultsPane.js","sourceRoot":"","sources":["../../src/default/SearchResultsPane.tsx"],"names":[],"mappings":";AA2BA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EACL,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,SAAS,EACT,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,OAAO,EA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QAAQ;4CAC/B,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC;4CACvB,CAAC,CAAC,YAAY;qCACnB;oCACH,CAAC,CAAC,EAAE,CAAC,aAEN,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,CACtB,gBACE,IAAI,EAAE,0BAA0B,EAChC,UAAU,EAAC,SAAS,YAEnB,WAAW,GACN,CACT,CAAC,CAAC,CAAC,IAAI,EACP,KAAK,CAAC,GAAG,CAAC,CAAC,IAAgB,EAAE,EAAE,CAAC,CAC/B,wBACG,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,CAC1B,UAAU,CAAC,IAAI,CAAC,CACjB,CAAC,CAAC,CAAC,CACF,KAAC,gBAAgB,IAAC,IAAI,EAAE,IAAI,GAAI,CACjC,IALO,IAAI,CAAC,GAAG,CAMZ,CACP,CAAC,IACE,CACP,CAAC;4BACJ,OAAO,CACL,6BAAiB,gBAAgB,YAC9B,WAAW,KAAK,SAAS;oCACxB,CAAC,CAAC,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC;oCACjC,CAAC,CAAC,WAAW,GACX,CACP,CAAC;wBACJ,CAAC,GACQ,EAEX,KAAC,KAAK,IAAC,GAAG,EAAE,GAAG,GAAI,EAClB,KAAK,CAAC,MAAM,IACR,CACR,GACa,GACN,CACb,CAAC;AACJ,CAAC"}
|
package/dist/default/index.d.ts
CHANGED
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
*/
|
|
41
41
|
export { SearchPage, RAIL_CLASS, RAIL_STYLE_HREF, railScrollbarCss, } from "./SearchPage.js";
|
|
42
42
|
export type { SearchPageProps, SearchFiltersLayout } from "./SearchPage.js";
|
|
43
|
-
export { OtherCategoriesLine, OTHER_CATEGORIES_CLASS, OTHER_CATEGORIES_PHONE_ROWS, OTHER_CATEGORIES_SLOT_MIN_HEIGHT, OTHER_CATEGORIES_STYLE_HREF, otherCategoriesCss, } from "./OtherCategoriesLine.js";
|
|
43
|
+
export { OtherCategoriesLine, OTHER_CATEGORIES_CLASS, OTHER_CATEGORIES_PHONE_ROWS, OTHER_CATEGORIES_SLOT_MIN_HEIGHT, OTHER_CATEGORIES_STYLE_HREF, otherCategoriesCss, otherCategoriesSlotHeight, } from "./OtherCategoriesLine.js";
|
|
44
44
|
export type { OtherCategoriesLineProps, OtherCategoryHrefResolver, OtherCategoryNamer, } from "./OtherCategoriesLine.js";
|
|
45
|
-
export { SearchResultsPane, RESULTS_MAX_WIDTH } from "./SearchResultsPane.js";
|
|
46
|
-
export type { SearchResultsPaneProps, SearchResultsRenderer, SearchResultsWrapper, } from "./SearchResultsPane.js";
|
|
47
|
-
export { FilterChips, CHIP_BAND_ORDER, CHIP_ROW_CAP, CHIP_ROW_CLASS, CHIP_ROW_MIN_HEIGHT, CHIP_ROW_STYLE_HREF, appliedChipTestId, buildAppliedChips, capChipRow, categoryLeaf, chipRowCss, orderChipFilters, rangeChipText, rangeLabelSource, } from "./FilterChips.js";
|
|
45
|
+
export { SearchResultsPane, RESULTS_MAX_WIDTH, RESULTS_COLUMNS_CLASS, RESULTS_COLUMNS_STYLE_HREF, resultsColumnsCss, } from "./SearchResultsPane.js";
|
|
46
|
+
export type { ResultsColumns, SearchResultsPaneProps, SearchResultsRenderer, SearchResultsWrapper, } from "./SearchResultsPane.js";
|
|
47
|
+
export { FilterChips, CHIP_BAND_ORDER, CHIP_ROW_CAP, CHIP_ROW_CLASS, CHIP_ROW_MIN_HEIGHT, CHIP_ROW_STYLE_HREF, appliedChipTestId, appliedRowMinHeight, buildAppliedChips, capChipRow, categoryLeaf, chipRowCss, orderChipFilters, rangeChipText, rangeLabelSource, } from "./FilterChips.js";
|
|
48
48
|
export type { AppliedChip, AppliedChipTarget, ChipBand, ChipSpec, FilterChipsAppliedProps, FilterChipsCommonProps, FilterChipsMode, FilterChipsOpenerProps, FilterChipsProps, } from "./FilterChips.js";
|
|
49
49
|
export { EmptyExits, RADIUS_WIDEN_FACTOR, parentCategory } from "./EmptyExits.js";
|
|
50
50
|
export type { EmptyExitsProps } from "./EmptyExits.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/default/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAGH,OAAO,EACL,UAAU,EACV,UAAU,EACV,eAAe,EACf,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE5E,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,2BAA2B,EAC3B,gCAAgC,EAChC,2BAA2B,EAC3B,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/default/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAGH,OAAO,EACL,UAAU,EACV,UAAU,EACV,eAAe,EACf,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE5E,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,2BAA2B,EAC3B,gCAAgC,EAChC,2BAA2B,EAC3B,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,wBAAwB,EACxB,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,WAAW,EACX,eAAe,EACf,YAAY,EACZ,cAAc,EACd,mBAAmB,EACn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AAC"}
|
package/dist/default/index.js
CHANGED
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
*/
|
|
41
41
|
// ── surfaces ────────────────────────────────────────────────────────────────
|
|
42
42
|
export { SearchPage, RAIL_CLASS, RAIL_STYLE_HREF, railScrollbarCss, } from "./SearchPage.js";
|
|
43
|
-
export { OtherCategoriesLine, OTHER_CATEGORIES_CLASS, OTHER_CATEGORIES_PHONE_ROWS, OTHER_CATEGORIES_SLOT_MIN_HEIGHT, OTHER_CATEGORIES_STYLE_HREF, otherCategoriesCss, } from "./OtherCategoriesLine.js";
|
|
44
|
-
export { SearchResultsPane, RESULTS_MAX_WIDTH } from "./SearchResultsPane.js";
|
|
45
|
-
export { FilterChips, CHIP_BAND_ORDER, CHIP_ROW_CAP, CHIP_ROW_CLASS, CHIP_ROW_MIN_HEIGHT, CHIP_ROW_STYLE_HREF, appliedChipTestId, buildAppliedChips, capChipRow, categoryLeaf, chipRowCss, orderChipFilters, rangeChipText, rangeLabelSource, } from "./FilterChips.js";
|
|
43
|
+
export { OtherCategoriesLine, OTHER_CATEGORIES_CLASS, OTHER_CATEGORIES_PHONE_ROWS, OTHER_CATEGORIES_SLOT_MIN_HEIGHT, OTHER_CATEGORIES_STYLE_HREF, otherCategoriesCss, otherCategoriesSlotHeight, } from "./OtherCategoriesLine.js";
|
|
44
|
+
export { SearchResultsPane, RESULTS_MAX_WIDTH, RESULTS_COLUMNS_CLASS, RESULTS_COLUMNS_STYLE_HREF, resultsColumnsCss, } from "./SearchResultsPane.js";
|
|
45
|
+
export { FilterChips, CHIP_BAND_ORDER, CHIP_ROW_CAP, CHIP_ROW_CLASS, CHIP_ROW_MIN_HEIGHT, CHIP_ROW_STYLE_HREF, appliedChipTestId, appliedRowMinHeight, buildAppliedChips, capChipRow, categoryLeaf, chipRowCss, orderChipFilters, rangeChipText, rangeLabelSource, } from "./FilterChips.js";
|
|
46
46
|
export { EmptyExits, RADIUS_WIDEN_FACTOR, parentCategory } from "./EmptyExits.js";
|
|
47
47
|
export { LocationSummaryLine } from "./LocationSummaryLine.js";
|
|
48
48
|
export { FacetGroupControl, facetGroupIsEmptyHeading, facetGroupShape, facetOptionNodes, isDictionaryFacet, FACET_DICTIONARY_THRESHOLD, FACET_SHEET_PAGE, FACET_VISIBLE_OPTIONS, } from "./FacetGroupControl.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/default/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,+EAA+E;AAC/E,OAAO,EACL,UAAU,EACV,UAAU,EACV,eAAe,EACf,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,2BAA2B,EAC3B,gCAAgC,EAChC,2BAA2B,EAC3B,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/default/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,+EAA+E;AAC/E,OAAO,EACL,UAAU,EACV,UAAU,EACV,eAAe,EACf,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,2BAA2B,EAC3B,gCAAgC,EAChC,2BAA2B,EAC3B,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAQhC,OAAO,EACL,WAAW,EACX,eAAe,EACf,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,aAA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,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
package/llms.txt
CHANGED
package/manifest.json
CHANGED
package/nav-manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stapel/search-react",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.5",
|
|
4
4
|
"description": "Headless React pair for stapel-search: a typed query client, TanStack Query hooks, and a URL-first state codec that makes a search shareable by construction (filters, ranges, geo, sort and the keyset cursor all live in the query string). Drill-down facets rendered with their remaining counts and with the server's own honesty flags — approximate, skipped, degraded — never swallowed; keyset pagination with the window refusal named; DSA Art. 26 `promoted` marking carried into every card slot and the P2B Art. 5 ranking disclosure exposed as data. Zero visual opinion in the main entry; an opt-in /default subpath ships the antd skin, and /router binds the codec to react-router's useSearchParams.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"limit": "14.5 KB"
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
|
-
"name": "default — the antd skin (query box + a typeahead that offers CATEGORY destinations with their live counts, filters incl. ranges/geo/category slots + the phone chip row with its leading category chip and the location summary row + the rail's evidence-ranked disclosure groups, panel search and sticky count/clear footer, results incl. the view switch, the card photo GALLERY as a SkinCarousel strip, the empty state's derived exits, ranking, the dictionary control for a vocabulary facet, the popular-values block, the partition row in both its chip and segmented variants, the select-style dictionary FIELD the desktop rail opens, the from/to pickers a bounded integer axis draws and the rail's own scrollbar sheet) must stay out of the main bundle. Raised 24.5 → 25.5 KB for those four controls, then 25.5 → 26.25 KB for the chip row's APPLIED mode — one chip per applied value and per numeric bound, each removing that one constraint beside a rail that is already on screen (a storefront was carrying its own copy of it), then 26.25 → 27 KB for the \"search in other categories\" LINE — which is a net deletion on the page that mounts it, replacing a full-width block of one row per section that arrived after the results and pushed them, then 27 → 27.75 KB for the two frames the page now tells apart: the dictionary FIELD reaching `<SearchPage>` at all (per-layout default, field in the rail and inline in the sheet) and the footer bar being static in a column and sticky in a sheet, where it used to be pinned over the last two groups everywhere, then 27.75 → 28.5 KB for `categoryHref` on the other-categories line — a real `<a href>` per row with a modifier-click left to the browser, instead of a `<button>` with no address a person could open in a new tab, then 28.5 → 29.25 KB for the phone's dictionary SHEET — a trigger row over the shared `SkinPickerSheet` with a recommended band, an alphabetical rest paged fifty at a time and a draft committed in one write, which is the control the composer's vocabulary picker already was while the buyer got a wall of checkboxes, then 29.25 → 30.5 KB for the panel that draws all of it: groups and ranges as one ordered sequence with one «Apply» for the panel rather than one per row, the empty-group heading rule, `categoryFilter={false}` and the `resultsLead` slot for a page reached by walking the catalogue, `PopularValues columns=\\\"responsive\\\"` on a container query, `SortSelect` annotating a blocked option at every width, a loading arm that covers the whole pane (0.34 CLS on a live host), and the chip row reserving its own box (a further 0.045). Measured with dependencies held constant, this package's src at the commit before that work and then at it: 29.05 -> 30.16 KB — 1.11 KB, and every part of it is a shift or a mislabelled control a host was living with",
|
|
60
|
+
"name": "default — the antd skin (query box + a typeahead that offers CATEGORY destinations with their live counts, filters incl. ranges/geo/category slots + the phone chip row with its leading category chip and the location summary row + the rail's evidence-ranked disclosure groups, panel search and sticky count/clear footer, results incl. the view switch, the card photo GALLERY as a SkinCarousel strip, the empty state's derived exits, ranking, the dictionary control for a vocabulary facet, the popular-values block, the partition row in both its chip and segmented variants, the select-style dictionary FIELD the desktop rail opens, the from/to pickers a bounded integer axis draws and the rail's own scrollbar sheet) must stay out of the main bundle. Raised 24.5 → 25.5 KB for those four controls, then 25.5 → 26.25 KB for the chip row's APPLIED mode — one chip per applied value and per numeric bound, each removing that one constraint beside a rail that is already on screen (a storefront was carrying its own copy of it), then 26.25 → 27 KB for the \"search in other categories\" LINE — which is a net deletion on the page that mounts it, replacing a full-width block of one row per section that arrived after the results and pushed them, then 27 → 27.75 KB for the two frames the page now tells apart: the dictionary FIELD reaching `<SearchPage>` at all (per-layout default, field in the rail and inline in the sheet) and the footer bar being static in a column and sticky in a sheet, where it used to be pinned over the last two groups everywhere, then 27.75 → 28.5 KB for `categoryHref` on the other-categories line — a real `<a href>` per row with a modifier-click left to the browser, instead of a `<button>` with no address a person could open in a new tab, then 28.5 → 29.25 KB for the phone's dictionary SHEET — a trigger row over the shared `SkinPickerSheet` with a recommended band, an alphabetical rest paged fifty at a time and a draft committed in one write, which is the control the composer's vocabulary picker already was while the buyer got a wall of checkboxes, then 29.25 → 30.5 KB for the panel that draws all of it: groups and ranges as one ordered sequence with one «Apply» for the panel rather than one per row, the empty-group heading rule, `categoryFilter={false}` and the `resultsLead` slot for a page reached by walking the catalogue, `PopularValues columns=\\\"responsive\\\"` on a container query, `SortSelect` annotating a blocked option at every width, a loading arm that covers the whole pane (0.34 CLS on a live host), and the chip row reserving its own box (a further 0.045). Measured with dependencies held constant, this package's src at the commit before that work and then at it: 29.05 -> 30.16 KB — 1.11 KB, and every part of it is a shift or a mislabelled control a host was living with, then 30.5 -> 31 KB for `<SearchResultsPane columns>` and its pass-through on `<SearchPage resultsColumns>`: a fixed track count or a per-breakpoint map, emitted as a hoisted container-query sheet (the results block is the window minus a 280px rail, so a media query would answer about a width the cards never have). Measured with dependencies held constant, this package's src before and after: 30.40 -> 30.65 KB — 250 B, and what it replaces is a host's `!important` rule against a grid declaration it could not read back",
|
|
61
61
|
"path": "dist/default/index.js",
|
|
62
|
-
"limit": "
|
|
62
|
+
"limit": "31 KB"
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
"name": "router — the react-router binding is opt-in; the main entry must never pull a router",
|
|
@@ -115,12 +115,12 @@
|
|
|
115
115
|
"size-limit": "^11.2.0",
|
|
116
116
|
"typescript": "^5.8.3",
|
|
117
117
|
"vitest": "^3.2.4",
|
|
118
|
-
"@stapel/attributes-react": "^0.16.
|
|
118
|
+
"@stapel/attributes-react": "^0.16.2",
|
|
119
119
|
"@stapel/core": "^0.25.4",
|
|
120
120
|
"@stapel/image": "^0.4.2",
|
|
121
121
|
"@stapel/showcase": "^0.3.0",
|
|
122
122
|
"@stapel/tokens": "^0.8.0",
|
|
123
|
-
"@stapel/tokens-antd": "^0.17.
|
|
123
|
+
"@stapel/tokens-antd": "^0.17.3"
|
|
124
124
|
},
|
|
125
125
|
"engines": {
|
|
126
126
|
"node": ">=22"
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
*/
|
|
160
160
|
import { useState } from "react";
|
|
161
161
|
import type { CSSProperties, ReactElement, ReactNode } from "react";
|
|
162
|
-
import { Button } from "antd";
|
|
162
|
+
import { Button, theme as antdTheme } from "antd";
|
|
163
163
|
import { SkinDialog, useDialogSurface } from "@stapel/tokens-antd/skin";
|
|
164
164
|
import { useT } from "@stapel/core";
|
|
165
165
|
import { radii, spacing } from "@stapel/tokens";
|
|
@@ -888,6 +888,26 @@ export function buildAppliedChips(input: {
|
|
|
888
888
|
return chips;
|
|
889
889
|
}
|
|
890
890
|
|
|
891
|
+
/**
|
|
892
|
+
* THE APPLIED ROW'S OWN BLOCK-SIZE — one chip, plus the row's two bands of
|
|
893
|
+
* focus-ring room ({@link APPLIED_ROW}'s `paddingBlock`).
|
|
894
|
+
*
|
|
895
|
+
* A NUMBER OUT OF THE THEME, not a constant: the chips are `size="small"`
|
|
896
|
+
* buttons, so their height IS antd's `controlHeightSM` — 24px on a desktop
|
|
897
|
+
* and, under the fleet's phone touch floor, the same 44px as every other
|
|
898
|
+
* control. A reservation written as a literal would be right on one surface
|
|
899
|
+
* and a shift on the other, in whichever direction it guessed wrong.
|
|
900
|
+
*
|
|
901
|
+
* The row it stands in for wraps, so this holds ONE line: the height a search
|
|
902
|
+
* with a single constraint arrives at, and the floor for a search with more.
|
|
903
|
+
* Under-reserving by a line moves the page less than not reserving at all;
|
|
904
|
+
* over-reserving would move it in the other direction on every ordinary
|
|
905
|
+
* search, which is the trade a floor gets right and a guess does not.
|
|
906
|
+
*/
|
|
907
|
+
export function appliedRowMinHeight(chipHeight: number): number {
|
|
908
|
+
return chipHeight + spacing[1] * 2;
|
|
909
|
+
}
|
|
910
|
+
|
|
891
911
|
/** The applied row wraps: it stands beside a rail, not on a 390px scroller,
|
|
892
912
|
* and a constraint pushed off the line is a constraint with no control. */
|
|
893
913
|
const APPLIED_ROW: CSSProperties = {
|
|
@@ -901,6 +921,7 @@ const APPLIED_ROW: CSSProperties = {
|
|
|
901
921
|
|
|
902
922
|
function AppliedChipRow(props: FilterChipsAppliedProps): ReactElement | null {
|
|
903
923
|
const t = useT();
|
|
924
|
+
const { token } = antdTheme.useToken();
|
|
904
925
|
const { state } = useSearchState();
|
|
905
926
|
const bag = useFacetPanel({
|
|
906
927
|
...(props.categoryFeatures !== undefined
|
|
@@ -938,7 +959,34 @@ function AppliedChipRow(props: FilterChipsAppliedProps): ReactElement | null {
|
|
|
938
959
|
ranges: answered ? ranges : [],
|
|
939
960
|
t,
|
|
940
961
|
});
|
|
941
|
-
if (chips.length === 0)
|
|
962
|
+
if (chips.length === 0) {
|
|
963
|
+
/* THE BOX THE ROW WILL ARRIVE INTO.
|
|
964
|
+
*
|
|
965
|
+
* The paragraph above is why this row draws nothing until the answer
|
|
966
|
+
* lands, and the consequence was a hole: an address carrying `f.*`/`r.*`
|
|
967
|
+
* is an address whose row is CERTAIN — the constraints are in the URL,
|
|
968
|
+
* the only thing missing is what to call them — and the row appeared a
|
|
969
|
+
* beat later and pushed the first card down under the reader's eye. The
|
|
970
|
+
* measured host held 48px of its own in a stylesheet to stop it, a height
|
|
971
|
+
* it could not read back from this pair and which was wrong on whichever
|
|
972
|
+
* surface it was not measured on.
|
|
973
|
+
*
|
|
974
|
+
* Reserved only while the answer is IN FLIGHT and only for an address
|
|
975
|
+
* that names constraints: a settled answer with no chips renders nothing
|
|
976
|
+
* (what this row has always done), and a search with no filters in its
|
|
977
|
+
* address reserves nothing, because for that search "no row" is the
|
|
978
|
+
* honest answer and holding a band would be the same shift the other way.
|
|
979
|
+
*/
|
|
980
|
+
const expected =
|
|
981
|
+
bag.state.status === "loading" && bag.activeFilters > 0;
|
|
982
|
+
return expected ? (
|
|
983
|
+
<div
|
|
984
|
+
aria-hidden="true"
|
|
985
|
+
data-testid="search-applied-chips-reserve"
|
|
986
|
+
style={{ minBlockSize: appliedRowMinHeight(token.controlHeightSM) }}
|
|
987
|
+
/>
|
|
988
|
+
) : null;
|
|
989
|
+
}
|
|
942
990
|
|
|
943
991
|
const remove = (target: AppliedChipTarget): void => {
|
|
944
992
|
if (target.kind === "facet") bag.toggle(target.slug, target.value);
|
|
@@ -77,14 +77,51 @@ import type { OtherCategoryRow } from "../headless/useOtherCategories.js";
|
|
|
77
77
|
import { SEARCH_I18N_KEYS } from "../i18n/keys.js";
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
|
-
*
|
|
80
|
+
* ONE text row of this line — the unit the slot is measured in.
|
|
81
81
|
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
82
|
+
* Kept under its original name because it is exported and a host may hold it;
|
|
83
|
+
* what changed is that the slot is no longer ASSUMED to be one of these. See
|
|
84
|
+
* {@link otherCategoriesSlotHeight}.
|
|
85
85
|
*/
|
|
86
86
|
export const OTHER_CATEGORIES_SLOT_MIN_HEIGHT = 24;
|
|
87
87
|
|
|
88
|
+
/** How many rows the collapsed phone line may occupy — the clamp in
|
|
89
|
+
* {@link otherCategoriesCss}, and half of what {@link otherCategoriesSlotHeight}
|
|
90
|
+
* measures with. */
|
|
91
|
+
export const OTHER_CATEGORIES_PHONE_ROWS = 2;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* HOW TALL THE LINE WILL BE, computed from what the line already knows about
|
|
95
|
+
* itself rather than assumed.
|
|
96
|
+
*
|
|
97
|
+
* The slot used to hold exactly one row, on every surface. On a phone it is
|
|
98
|
+
* two: the label ("Search in other categories:") is most of a 390px row on its
|
|
99
|
+
* own, so the first entry lands on the second row, and the collapsed line is
|
|
100
|
+
* clamped at {@link OTHER_CATEGORIES_PHONE_ROWS} — which is why the measured
|
|
101
|
+
* storefront held a second row of its own under the pair's slot, a height it
|
|
102
|
+
* had to guess and could not read back. One row reserved for a two-row line is
|
|
103
|
+
* a shift of exactly the row that was not reserved.
|
|
104
|
+
*
|
|
105
|
+
* Three inputs, all of them already in hand when the slot is drawn: whether
|
|
106
|
+
* this is the phone surface, how many entries the line will print, and the
|
|
107
|
+
* clamp this file owns. A line with no entries stays one row — that is the
|
|
108
|
+
* label alone, which is what an empty-result read is still waiting to fill.
|
|
109
|
+
*
|
|
110
|
+
* The DRAWN line is measured with the same function, so the band and the line
|
|
111
|
+
* it stands in for cannot drift apart: a reserved slot one row taller than
|
|
112
|
+
* what fills it is still a shift, just in the other direction.
|
|
113
|
+
*/
|
|
114
|
+
export function otherCategoriesSlotHeight(input: {
|
|
115
|
+
/** How many entries the line will print — `0` while nothing is nameable. */
|
|
116
|
+
readonly entries: number;
|
|
117
|
+
/** The sheet surface, where the clamp applies. */
|
|
118
|
+
readonly phone: boolean;
|
|
119
|
+
}): number {
|
|
120
|
+
const rows =
|
|
121
|
+
input.phone && input.entries > 0 ? OTHER_CATEGORIES_PHONE_ROWS : 1;
|
|
122
|
+
return rows * OTHER_CATEGORIES_SLOT_MIN_HEIGHT;
|
|
123
|
+
}
|
|
124
|
+
|
|
88
125
|
/** Names an id path the pair cannot name on its own. Returning `undefined`
|
|
89
126
|
* drops the row rather than printing a number at a person. */
|
|
90
127
|
export type OtherCategoryNamer = (category: string) => string | undefined;
|
|
@@ -159,9 +196,6 @@ const ENTRY: CSSProperties = {
|
|
|
159
196
|
|
|
160
197
|
const COUNT: CSSProperties = { color: cssVar("text-subtle") };
|
|
161
198
|
|
|
162
|
-
/** How many rows the collapsed phone line may occupy. */
|
|
163
|
-
export const OTHER_CATEGORIES_PHONE_ROWS = 2;
|
|
164
|
-
|
|
165
199
|
/** The class the clamp is hung on. */
|
|
166
200
|
export const OTHER_CATEGORIES_CLASS = "stapel-search-other-categories";
|
|
167
201
|
|
|
@@ -239,13 +273,26 @@ export function OtherCategoriesLine(
|
|
|
239
273
|
if (holding || entries.length === 0) {
|
|
240
274
|
// Nothing to say, and nothing coming: say nothing.
|
|
241
275
|
if (!expected) return null;
|
|
276
|
+
// THE HEIGHT OF THE LINE THIS STANDS IN FOR, not one text row. While the
|
|
277
|
+
// host is still naming, the SECTIONS are already known (they came with
|
|
278
|
+
// the answer that drew the cards), so how many entries the line will
|
|
279
|
+
// print is known too — capped by the same limit the line itself uses. An
|
|
280
|
+
// empty-result read that has not landed yet knows no sections, and one
|
|
281
|
+
// row is then the honest floor.
|
|
282
|
+
const willShow = Math.min(bag.rows.length, limit);
|
|
242
283
|
return (
|
|
243
284
|
<div
|
|
244
285
|
data-testid="search-other-categories"
|
|
245
286
|
data-reserved="on"
|
|
246
287
|
data-source={bag.source}
|
|
288
|
+
data-reserved-rows={
|
|
289
|
+
otherCategoriesSlotHeight({ entries: willShow, phone }) /
|
|
290
|
+
OTHER_CATEGORIES_SLOT_MIN_HEIGHT
|
|
291
|
+
}
|
|
247
292
|
{...(holding ? { "data-naming": "pending" } : {})}
|
|
248
|
-
style={{
|
|
293
|
+
style={{
|
|
294
|
+
minBlockSize: otherCategoriesSlotHeight({ entries: willShow, phone }),
|
|
295
|
+
}}
|
|
249
296
|
/>
|
|
250
297
|
);
|
|
251
298
|
}
|
|
@@ -262,10 +309,16 @@ export function OtherCategoriesLine(
|
|
|
262
309
|
? `${OTHER_CATEGORIES_CLASS} ${OTHER_CATEGORIES_CLASS}--clamped`
|
|
263
310
|
: OTHER_CATEGORIES_CLASS
|
|
264
311
|
}
|
|
265
|
-
// The band and the line are the SAME height by construction
|
|
266
|
-
//
|
|
267
|
-
//
|
|
268
|
-
|
|
312
|
+
// The band and the line are the SAME height by construction — one
|
|
313
|
+
// function, called with what each of them knows. A reserved slot one row
|
|
314
|
+
// taller (or shorter) than what fills it is still a shift, and this is
|
|
315
|
+
// the only way to be sure they match.
|
|
316
|
+
style={{
|
|
317
|
+
minBlockSize: otherCategoriesSlotHeight({
|
|
318
|
+
entries: shown.length,
|
|
319
|
+
phone,
|
|
320
|
+
}),
|
|
321
|
+
}}
|
|
269
322
|
>
|
|
270
323
|
<style href={OTHER_CATEGORIES_STYLE_HREF} precedence="default">
|
|
271
324
|
{otherCategoriesCss()}
|
|
@@ -91,7 +91,10 @@ import type {
|
|
|
91
91
|
OtherCategoryNamer,
|
|
92
92
|
} from "./OtherCategoriesLine.js";
|
|
93
93
|
import { SearchResultsPane } from "./SearchResultsPane.js";
|
|
94
|
-
import type {
|
|
94
|
+
import type {
|
|
95
|
+
ResultsColumns,
|
|
96
|
+
SearchResultsWrapper,
|
|
97
|
+
} from "./SearchResultsPane.js";
|
|
95
98
|
import { SortSelect } from "./SortSelect.js";
|
|
96
99
|
import { SEARCH_BUILTIN_VIEWS, ViewSwitch, resolveView } from "./ViewSwitch.js";
|
|
97
100
|
import type { SearchView } from "./ViewSwitch.js";
|
|
@@ -487,10 +490,22 @@ export interface SearchPageProps extends ThemeModeProp, ParseSearchStateOptions
|
|
|
487
490
|
* own `<h1>` above this page passes a lower level.
|
|
488
491
|
*/
|
|
489
492
|
readonly resultsHeadingLevel?: 1 | 2 | 3 | 4 | 5;
|
|
493
|
+
/**
|
|
494
|
+
* How many card columns the results grid draws — `<SearchResultsPane
|
|
495
|
+
* columns>`, forwarded verbatim.
|
|
496
|
+
*
|
|
497
|
+
* It is on the PAGE as well as on the pane because the page is what a
|
|
498
|
+
* storefront mounts on `/s` and `/c/:slug`: a prop that exists only on the
|
|
499
|
+
* component nobody mounts is a prop nobody has, and a host that wanted two
|
|
500
|
+
* cards per row on a tablet was left with an `!important` rule against a
|
|
501
|
+
* grid it could not read back.
|
|
502
|
+
*/
|
|
503
|
+
readonly resultsColumns?: ResultsColumns;
|
|
490
504
|
}
|
|
491
505
|
|
|
492
506
|
interface SearchPageBodyProps {
|
|
493
507
|
readonly renderCard?: SearchCardRenderer;
|
|
508
|
+
readonly resultsColumns?: ResultsColumns;
|
|
494
509
|
readonly categoryFilter?: boolean;
|
|
495
510
|
readonly resultsLead?: ReactNode;
|
|
496
511
|
readonly dictionaryMode?: "field" | "inline" | "sheet";
|
|
@@ -714,6 +729,9 @@ function SearchPageBody(props: SearchPageBodyProps): ReactElement {
|
|
|
714
729
|
{...(props.wrapResults !== undefined ? { wrapResults: props.wrapResults } : {})}
|
|
715
730
|
{...(view.layout !== undefined ? { layout: view.layout } : {})}
|
|
716
731
|
{...(props.renderCard !== undefined ? { renderCard: props.renderCard } : {})}
|
|
732
|
+
{...(props.resultsColumns !== undefined
|
|
733
|
+
? { columns: props.resultsColumns }
|
|
734
|
+
: {})}
|
|
717
735
|
{...(props.footer !== undefined ? { footer: props.footer } : {})}
|
|
718
736
|
{...(props.otherCategories !== undefined
|
|
719
737
|
? { otherCategories: props.otherCategories }
|
|
@@ -923,6 +941,7 @@ export function SearchPage(props: SearchPageProps): ReactElement {
|
|
|
923
941
|
onViewChange,
|
|
924
942
|
resultsAction,
|
|
925
943
|
resultsHeadingLevel,
|
|
944
|
+
resultsColumns,
|
|
926
945
|
dictionaryMode,
|
|
927
946
|
visibleGroups,
|
|
928
947
|
pinnedFacets,
|
|
@@ -935,6 +954,7 @@ export function SearchPage(props: SearchPageProps): ReactElement {
|
|
|
935
954
|
<SearchStateProvider adapter={adapter} geoOffer={geoOffer} {...parseOptions}>
|
|
936
955
|
<SearchPageBody
|
|
937
956
|
{...(renderCard !== undefined ? { renderCard } : {})}
|
|
957
|
+
{...(resultsColumns !== undefined ? { resultsColumns } : {})}
|
|
938
958
|
{...(dictionaryMode !== undefined ? { dictionaryMode } : {})}
|
|
939
959
|
{...(visibleGroups !== undefined ? { visibleGroups } : {})}
|
|
940
960
|
{...(pinnedFacets !== undefined ? { pinnedFacets } : {})}
|