@pipe0/react 1.0.32 → 1.0.33
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 +10 -0
- package/dist/components/defaults/catalog/card-derived.d.mts +1 -1
- package/dist/components/defaults/catalog/card-derived.mjs +0 -1
- package/dist/components/defaults/catalog/card-derived.mjs.map +1 -1
- package/dist/components/defaults/catalog/card-primitives.d.mts +2 -2
- package/dist/components/defaults/catalog/card-primitives.mjs +2 -2
- package/dist/components/defaults/catalog/card-primitives.mjs.map +1 -1
- package/dist/components/internal/LiquidEditor/ChipEditPopover.mjs +60 -14
- package/dist/components/internal/LiquidEditor/ChipEditPopover.mjs.map +1 -1
- package/dist/context/catalog-card-context.mjs +3 -7
- package/dist/context/catalog-card-context.mjs.map +1 -1
- package/dist/context/catalog-config-context.d.mts +1 -1
- package/dist/context/catalog-config-context.mjs +1 -1
- package/dist/context/catalog-config-context.mjs.map +1 -1
- package/dist/hooks/use-pipe-catalog-table.d.mts +8 -8
- package/dist/index.d.mts +2 -17
- package/dist/index.mjs +1 -16
- package/dist/types/catalog-adapters.d.mts +2 -19
- package/dist/types/catalog-adapters.d.mts.map +1 -1
- package/package.json +2 -2
- package/dist/components/compound/searches-catalog/active-filters.d.mts +0 -23
- package/dist/components/compound/searches-catalog/active-filters.d.mts.map +0 -1
- package/dist/components/compound/searches-catalog/active-filters.mjs +0 -50
- package/dist/components/compound/searches-catalog/active-filters.mjs.map +0 -1
- package/dist/components/compound/searches-catalog/card.d.mts +0 -22
- package/dist/components/compound/searches-catalog/card.d.mts.map +0 -1
- package/dist/components/compound/searches-catalog/card.mjs +0 -82
- package/dist/components/compound/searches-catalog/card.mjs.map +0 -1
- package/dist/components/compound/searches-catalog/category-filter.d.mts +0 -27
- package/dist/components/compound/searches-catalog/category-filter.d.mts.map +0 -1
- package/dist/components/compound/searches-catalog/category-filter.mjs +0 -61
- package/dist/components/compound/searches-catalog/category-filter.mjs.map +0 -1
- package/dist/components/compound/searches-catalog/column-filter.d.mts +0 -29
- package/dist/components/compound/searches-catalog/column-filter.d.mts.map +0 -1
- package/dist/components/compound/searches-catalog/column-filter.mjs +0 -64
- package/dist/components/compound/searches-catalog/column-filter.mjs.map +0 -1
- package/dist/components/compound/searches-catalog/column-filters.d.mts +0 -15
- package/dist/components/compound/searches-catalog/column-filters.d.mts.map +0 -1
- package/dist/components/compound/searches-catalog/column-filters.mjs +0 -16
- package/dist/components/compound/searches-catalog/column-filters.mjs.map +0 -1
- package/dist/components/compound/searches-catalog/empty.d.mts +0 -17
- package/dist/components/compound/searches-catalog/empty.d.mts.map +0 -1
- package/dist/components/compound/searches-catalog/empty.mjs +0 -29
- package/dist/components/compound/searches-catalog/empty.mjs.map +0 -1
- package/dist/components/compound/searches-catalog/index.d.mts +0 -12
- package/dist/components/compound/searches-catalog/list.d.mts +0 -19
- package/dist/components/compound/searches-catalog/list.d.mts.map +0 -1
- package/dist/components/compound/searches-catalog/list.mjs +0 -33
- package/dist/components/compound/searches-catalog/list.mjs.map +0 -1
- package/dist/components/compound/searches-catalog/output-field-filter.d.mts +0 -22
- package/dist/components/compound/searches-catalog/output-field-filter.d.mts.map +0 -1
- package/dist/components/compound/searches-catalog/output-field-filter.mjs +0 -22
- package/dist/components/compound/searches-catalog/output-field-filter.mjs.map +0 -1
- package/dist/components/compound/searches-catalog/provider-filter.d.mts +0 -22
- package/dist/components/compound/searches-catalog/provider-filter.d.mts.map +0 -1
- package/dist/components/compound/searches-catalog/provider-filter.mjs +0 -29
- package/dist/components/compound/searches-catalog/provider-filter.mjs.map +0 -1
- package/dist/components/compound/searches-catalog/root.d.mts +0 -33
- package/dist/components/compound/searches-catalog/root.d.mts.map +0 -1
- package/dist/components/compound/searches-catalog/root.mjs +0 -74
- package/dist/components/compound/searches-catalog/root.mjs.map +0 -1
- package/dist/components/compound/searches-catalog/search-filter.d.mts +0 -21
- package/dist/components/compound/searches-catalog/search-filter.d.mts.map +0 -1
- package/dist/components/compound/searches-catalog/search-filter.mjs +0 -47
- package/dist/components/compound/searches-catalog/search-filter.mjs.map +0 -1
- package/dist/components/compound/searches-catalog/tag-filter.d.mts +0 -22
- package/dist/components/compound/searches-catalog/tag-filter.d.mts.map +0 -1
- package/dist/components/compound/searches-catalog/tag-filter.mjs +0 -22
- package/dist/components/compound/searches-catalog/tag-filter.mjs.map +0 -1
- package/dist/context/searches-catalog-card-context.d.mts +0 -24
- package/dist/context/searches-catalog-card-context.d.mts.map +0 -1
- package/dist/context/searches-catalog-card-context.mjs +0 -13
- package/dist/context/searches-catalog-card-context.mjs.map +0 -1
- package/dist/context/searches-catalog-context.d.mts +0 -20
- package/dist/context/searches-catalog-context.d.mts.map +0 -1
- package/dist/context/searches-catalog-context.mjs +0 -13
- package/dist/context/searches-catalog-context.mjs.map +0 -1
- package/dist/hooks/use-searches-catalog-table.d.mts +0 -56
- package/dist/hooks/use-searches-catalog-table.d.mts.map +0 -1
- package/dist/hooks/use-searches-catalog-table.mjs +0 -159
- package/dist/hooks/use-searches-catalog-table.mjs.map +0 -1
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { CategoryOption } from "../../defaults/catalog/category-filter.mjs";
|
|
2
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
-
import { SearchCategory } from "@pipe0/base";
|
|
5
|
-
|
|
6
|
-
//#region src/components/compound/searches-catalog/category-filter.d.ts
|
|
7
|
-
interface SearchesCatalogCategoryFilterState {
|
|
8
|
-
value: SearchCategory | null;
|
|
9
|
-
setValue: (value: SearchCategory | null) => void;
|
|
10
|
-
options: ReadonlyArray<CategoryOption<SearchCategory>>;
|
|
11
|
-
counts: Partial<Record<SearchCategory, number>>;
|
|
12
|
-
totalCount: number;
|
|
13
|
-
isActive: boolean;
|
|
14
|
-
}
|
|
15
|
-
interface SearchesCatalogCategoryFilterProps extends useRender.ComponentProps<"div", SearchesCatalogCategoryFilterState> {
|
|
16
|
-
/** Override the default category options. */
|
|
17
|
-
options?: ReadonlyArray<CategoryOption<SearchCategory>>;
|
|
18
|
-
}
|
|
19
|
-
declare function SearchesCatalogCategoryFilter({
|
|
20
|
-
options,
|
|
21
|
-
className,
|
|
22
|
-
render,
|
|
23
|
-
...props
|
|
24
|
-
}: SearchesCatalogCategoryFilterProps): _$react_jsx_runtime0.JSX.Element;
|
|
25
|
-
//#endregion
|
|
26
|
-
export { SearchesCatalogCategoryFilter, SearchesCatalogCategoryFilterProps, SearchesCatalogCategoryFilterState };
|
|
27
|
-
//# sourceMappingURL=category-filter.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"category-filter.d.mts","names":[],"sources":["../../../../src/components/compound/searches-catalog/category-filter.tsx"],"mappings":";;;;;;UA8BiB,kCAAA;EACf,KAAA,EAAO,cAAA;EACP,QAAA,GAAW,KAAA,EAAO,cAAA;EAClB,OAAA,EAAS,aAAA,CAAc,cAAA,CAAe,cAAA;EACtC,MAAA,EAAQ,OAAA,CAAQ,MAAA,CAAO,cAAA;EACvB,UAAA;EACA,QAAA;AAAA;AAAA,UAGe,kCAAA,SACP,SAAA,CAAU,cAAA,QAAsB,kCAAA;EAPjB;EASvB,OAAA,GAAU,aAAA,CAAc,cAAA,CAAe,cAAA;AAAA;AAAA,iBAGzB,6BAAA,CAAA;EACd,OAAA;EACA,SAAA;EACA,MAAA;EAAA,GACG;AAAA,GACF,kCAAA,GAAkC,oBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { useSearchesCatalogContext } from "../../../context/searches-catalog-context.mjs";
|
|
2
|
-
import { DefaultCategoryFilter } from "../../defaults/catalog/category-filter.mjs";
|
|
3
|
-
import { mergeProps } from "@base-ui/react/merge-props";
|
|
4
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import { getSearchCategoryEntries } from "@pipe0/base";
|
|
7
|
-
import { Building2, Database, Table, User, X } from "lucide-react";
|
|
8
|
-
|
|
9
|
-
//#region src/components/compound/searches-catalog/category-filter.tsx
|
|
10
|
-
const SEARCH_CATEGORY_ICONS = {
|
|
11
|
-
people: User,
|
|
12
|
-
companies: Building2,
|
|
13
|
-
data: Table,
|
|
14
|
-
deprecated: X
|
|
15
|
-
};
|
|
16
|
-
const DEFAULT_OPTIONS = [{
|
|
17
|
-
id: null,
|
|
18
|
-
label: "All",
|
|
19
|
-
icon: Database
|
|
20
|
-
}, ...[...getSearchCategoryEntries()].sort((a, b) => a.order - b.order).map((entry) => ({
|
|
21
|
-
id: entry.id,
|
|
22
|
-
label: entry.label,
|
|
23
|
-
icon: SEARCH_CATEGORY_ICONS[entry.id]
|
|
24
|
-
}))];
|
|
25
|
-
function SearchesCatalogCategoryFilter({ options = DEFAULT_OPTIONS, className, render, ...props }) {
|
|
26
|
-
const ctx = useSearchesCatalogContext();
|
|
27
|
-
const value = ctx.category;
|
|
28
|
-
const isActive = value !== null;
|
|
29
|
-
const element = useRender({
|
|
30
|
-
defaultTagName: "div",
|
|
31
|
-
render,
|
|
32
|
-
state: {
|
|
33
|
-
value,
|
|
34
|
-
setValue: ctx.setCategory,
|
|
35
|
-
options,
|
|
36
|
-
counts: ctx.baselineCategoryCounts,
|
|
37
|
-
totalCount: ctx.baselineCardCount,
|
|
38
|
-
isActive
|
|
39
|
-
},
|
|
40
|
-
stateAttributesMapping: {
|
|
41
|
-
setValue: () => null,
|
|
42
|
-
options: () => null,
|
|
43
|
-
counts: () => null
|
|
44
|
-
},
|
|
45
|
-
props: mergeProps({
|
|
46
|
-
className,
|
|
47
|
-
"data-p0": "catalog-category-filter"
|
|
48
|
-
}, props)
|
|
49
|
-
});
|
|
50
|
-
if (render) return element;
|
|
51
|
-
return /* @__PURE__ */ jsx(DefaultCategoryFilter, {
|
|
52
|
-
options,
|
|
53
|
-
value: ctx.category,
|
|
54
|
-
onChange: ctx.setCategory,
|
|
55
|
-
className
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
//#endregion
|
|
60
|
-
export { SearchesCatalogCategoryFilter };
|
|
61
|
-
//# sourceMappingURL=category-filter.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"category-filter.mjs","names":[],"sources":["../../../../src/components/compound/searches-catalog/category-filter.tsx"],"sourcesContent":["import { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { getSearchCategoryEntries, type SearchCategory } from \"@pipe0/base\";\nimport { Building2, Database, Table, User, X } from \"lucide-react\";\nimport { useSearchesCatalogContext } from \"../../../context/searches-catalog-context.js\";\nimport {\n type CategoryOption,\n DefaultCategoryFilter,\n} from \"../../defaults/catalog/category-filter.js\";\n\nconst SEARCH_CATEGORY_ICONS: Record<SearchCategory, CategoryOption<SearchCategory>[\"icon\"]> = {\n people: User,\n companies: Building2,\n data: Table,\n deprecated: X,\n};\n\nconst DEFAULT_OPTIONS: ReadonlyArray<CategoryOption<SearchCategory>> = [\n { id: null, label: \"All\", icon: Database },\n ...[...getSearchCategoryEntries()]\n .sort((a, b) => a.order - b.order)\n .map(\n (entry): CategoryOption<SearchCategory> => ({\n id: entry.id,\n label: entry.label,\n icon: SEARCH_CATEGORY_ICONS[entry.id],\n }),\n ),\n];\n\nexport interface SearchesCatalogCategoryFilterState {\n value: SearchCategory | null;\n setValue: (value: SearchCategory | null) => void;\n options: ReadonlyArray<CategoryOption<SearchCategory>>;\n counts: Partial<Record<SearchCategory, number>>;\n totalCount: number;\n isActive: boolean;\n}\n\nexport interface SearchesCatalogCategoryFilterProps\n extends useRender.ComponentProps<\"div\", SearchesCatalogCategoryFilterState> {\n /** Override the default category options. */\n options?: ReadonlyArray<CategoryOption<SearchCategory>>;\n}\n\nexport function SearchesCatalogCategoryFilter({\n options = DEFAULT_OPTIONS,\n className,\n render,\n ...props\n}: SearchesCatalogCategoryFilterProps) {\n const ctx = useSearchesCatalogContext();\n const value = ctx.category;\n const isActive = value !== null;\n\n const element = useRender({\n defaultTagName: \"div\",\n render,\n state: {\n value,\n setValue: ctx.setCategory,\n options,\n counts: ctx.baselineCategoryCounts,\n totalCount: ctx.baselineCardCount,\n isActive,\n },\n stateAttributesMapping: {\n setValue: () => null,\n options: () => null,\n counts: () => null,\n },\n props: mergeProps<\"div\">(\n {\n className,\n ...({ \"data-p0\": \"catalog-category-filter\" } as Record<string, string>),\n },\n props,\n ),\n });\n\n if (render) return element;\n\n return (\n <DefaultCategoryFilter\n options={options}\n value={ctx.category}\n onChange={ctx.setCategory}\n className={className}\n />\n );\n}\n"],"mappings":";;;;;;;;;AAUA,MAAM,wBAAwF;CAC5F,QAAQ;CACR,WAAW;CACX,MAAM;CACN,YAAY;CACb;AAED,MAAM,kBAAiE,CACrE;CAAE,IAAI;CAAM,OAAO;CAAO,MAAM;CAAU,EAC1C,GAAG,CAAC,GAAG,0BAA0B,CAAC,CAC/B,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM,CACjC,KACE,WAA2C;CAC1C,IAAI,MAAM;CACV,OAAO,MAAM;CACb,MAAM,sBAAsB,MAAM;CACnC,EACF,CACJ;AAiBD,SAAgB,8BAA8B,EAC5C,UAAU,iBACV,WACA,QACA,GAAG,SACkC;CACrC,MAAM,MAAM,2BAA2B;CACvC,MAAM,QAAQ,IAAI;CAClB,MAAM,WAAW,UAAU;CAE3B,MAAM,UAAU,UAAU;EACxB,gBAAgB;EAChB;EACA,OAAO;GACL;GACA,UAAU,IAAI;GACd;GACA,QAAQ,IAAI;GACZ,YAAY,IAAI;GAChB;GACD;EACD,wBAAwB;GACtB,gBAAgB;GAChB,eAAe;GACf,cAAc;GACf;EACD,OAAO,WACL;GACE;GACM,WAAW;GAClB,EACD,MACD;EACF,CAAC;AAEF,KAAI,OAAQ,QAAO;AAEnB,QACE,oBAAC,uBAAD;EACW;EACT,OAAO,IAAI;EACX,UAAU,IAAI;EACH;EACX"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { FilterSelectOption } from "../../defaults/catalog/filter-select.mjs";
|
|
2
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
-
import { ReactNode } from "react";
|
|
4
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
-
|
|
6
|
-
//#region src/components/compound/searches-catalog/column-filter.d.ts
|
|
7
|
-
type SearchesColumnFilterId = "outputFields" | "providers" | "tags";
|
|
8
|
-
interface ColumnFilterState {
|
|
9
|
-
value: string;
|
|
10
|
-
setValue: (value: string | null) => void;
|
|
11
|
-
options: ReadonlyArray<FilterSelectOption>;
|
|
12
|
-
isActive: boolean;
|
|
13
|
-
}
|
|
14
|
-
interface SearchesCatalogColumnFilterProps extends useRender.ComponentProps<"div", ColumnFilterState> {
|
|
15
|
-
id: SearchesColumnFilterId;
|
|
16
|
-
placeholder?: ReactNode;
|
|
17
|
-
options?: ReadonlyArray<FilterSelectOption>;
|
|
18
|
-
}
|
|
19
|
-
declare function SearchesCatalogColumnFilter({
|
|
20
|
-
id,
|
|
21
|
-
placeholder,
|
|
22
|
-
options,
|
|
23
|
-
className,
|
|
24
|
-
render,
|
|
25
|
-
...props
|
|
26
|
-
}: SearchesCatalogColumnFilterProps): _$react_jsx_runtime0.JSX.Element;
|
|
27
|
-
//#endregion
|
|
28
|
-
export { ColumnFilterState, SearchesCatalogColumnFilter, SearchesCatalogColumnFilterProps, SearchesColumnFilterId };
|
|
29
|
-
//# sourceMappingURL=column-filter.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"column-filter.d.mts","names":[],"sources":["../../../../src/components/compound/searches-catalog/column-filter.tsx"],"mappings":";;;;;;KASY,sBAAA;AAAA,UAEK,iBAAA;EACf,KAAA;EACA,QAAA,GAAW,KAAA;EACX,OAAA,EAAS,aAAA,CAAc,kBAAA;EACvB,QAAA;AAAA;AAAA,UAGe,gCAAA,SACP,SAAA,CAAU,cAAA,QAAsB,iBAAA;EACxC,EAAA,EAAI,sBAAA;EACJ,WAAA,GAAc,SAAA;EACd,OAAA,GAAU,aAAA,CAAc,kBAAA;AAAA;AAAA,iBAsBV,2BAAA,CAAA;EACd,EAAA;EACA,WAAA;EACA,OAAA;EACA,SAAA;EACA,MAAA;EAAA,GACG;AAAA,GACF,gCAAA,GAAgC,oBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { useSearchesCatalogContext } from "../../../context/searches-catalog-context.mjs";
|
|
2
|
-
import { DefaultFilterSelect } from "../../defaults/catalog/filter-select.mjs";
|
|
3
|
-
import { mergeProps } from "@base-ui/react/merge-props";
|
|
4
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
|
|
7
|
-
//#region src/components/compound/searches-catalog/column-filter.tsx
|
|
8
|
-
function getDefaultOptions(id, ctx) {
|
|
9
|
-
let entries = [];
|
|
10
|
-
switch (id) {
|
|
11
|
-
case "outputFields":
|
|
12
|
-
entries = ctx.sortedOutputFieldEntries;
|
|
13
|
-
break;
|
|
14
|
-
case "providers":
|
|
15
|
-
entries = ctx.sortedProviderEntries;
|
|
16
|
-
break;
|
|
17
|
-
case "tags":
|
|
18
|
-
entries = ctx.sortedTagEntries;
|
|
19
|
-
break;
|
|
20
|
-
}
|
|
21
|
-
return entries.map(([name]) => ({
|
|
22
|
-
label: name,
|
|
23
|
-
value: name
|
|
24
|
-
}));
|
|
25
|
-
}
|
|
26
|
-
function SearchesCatalogColumnFilter({ id, placeholder, options, className, render, ...props }) {
|
|
27
|
-
const ctx = useSearchesCatalogContext();
|
|
28
|
-
const value = ctx.getColumnFilterValue(id) || "";
|
|
29
|
-
const resolvedOptions = options ?? getDefaultOptions(id, ctx);
|
|
30
|
-
const setValue = (v) => {
|
|
31
|
-
if (v == null) ctx.removeColumnFilter(id);
|
|
32
|
-
else ctx.addColumnFilter(id, v);
|
|
33
|
-
};
|
|
34
|
-
const element = useRender({
|
|
35
|
-
defaultTagName: "div",
|
|
36
|
-
render,
|
|
37
|
-
state: {
|
|
38
|
-
value,
|
|
39
|
-
setValue,
|
|
40
|
-
options: resolvedOptions,
|
|
41
|
-
isActive: !!value
|
|
42
|
-
},
|
|
43
|
-
stateAttributesMapping: {
|
|
44
|
-
setValue: () => null,
|
|
45
|
-
options: () => null
|
|
46
|
-
},
|
|
47
|
-
props: mergeProps({
|
|
48
|
-
className,
|
|
49
|
-
"data-p0": `catalog-column-filter-${id}`
|
|
50
|
-
}, props)
|
|
51
|
-
});
|
|
52
|
-
if (render) return element;
|
|
53
|
-
return /* @__PURE__ */ jsx(DefaultFilterSelect, {
|
|
54
|
-
placeholder,
|
|
55
|
-
value,
|
|
56
|
-
onChange: setValue,
|
|
57
|
-
options: resolvedOptions,
|
|
58
|
-
className
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
//#endregion
|
|
63
|
-
export { SearchesCatalogColumnFilter };
|
|
64
|
-
//# sourceMappingURL=column-filter.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"column-filter.mjs","names":[],"sources":["../../../../src/components/compound/searches-catalog/column-filter.tsx"],"sourcesContent":["import { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport type { ReactNode } from \"react\";\nimport { useSearchesCatalogContext } from \"../../../context/searches-catalog-context.js\";\nimport {\n DefaultFilterSelect,\n type FilterSelectOption,\n} from \"../../defaults/catalog/filter-select.js\";\n\nexport type SearchesColumnFilterId = \"outputFields\" | \"providers\" | \"tags\";\n\nexport interface ColumnFilterState {\n value: string;\n setValue: (value: string | null) => void;\n options: ReadonlyArray<FilterSelectOption>;\n isActive: boolean;\n}\n\nexport interface SearchesCatalogColumnFilterProps\n extends useRender.ComponentProps<\"div\", ColumnFilterState> {\n id: SearchesColumnFilterId;\n placeholder?: ReactNode;\n options?: ReadonlyArray<FilterSelectOption>;\n}\n\nfunction getDefaultOptions(\n id: SearchesColumnFilterId,\n ctx: ReturnType<typeof useSearchesCatalogContext>,\n): FilterSelectOption[] {\n let entries: ReadonlyArray<readonly [string, unknown]> = [];\n switch (id) {\n case \"outputFields\":\n entries = ctx.sortedOutputFieldEntries;\n break;\n case \"providers\":\n entries = ctx.sortedProviderEntries;\n break;\n case \"tags\":\n entries = ctx.sortedTagEntries;\n break;\n }\n return entries.map(([name]) => ({ label: name, value: name }));\n}\n\nexport function SearchesCatalogColumnFilter({\n id,\n placeholder,\n options,\n className,\n render,\n ...props\n}: SearchesCatalogColumnFilterProps) {\n const ctx = useSearchesCatalogContext();\n const value = ctx.getColumnFilterValue(id) || \"\";\n const resolvedOptions = options ?? getDefaultOptions(id, ctx);\n const setValue = (v: string | null) => {\n if (v == null) ctx.removeColumnFilter(id);\n else ctx.addColumnFilter(id, v);\n };\n\n const element = useRender({\n defaultTagName: \"div\",\n render,\n state: { value, setValue, options: resolvedOptions, isActive: !!value },\n stateAttributesMapping: {\n setValue: () => null,\n options: () => null,\n },\n props: mergeProps<\"div\">(\n {\n className,\n ...({ \"data-p0\": `catalog-column-filter-${id}` } as Record<string, string>),\n },\n props,\n ),\n });\n\n if (render) return element;\n\n return (\n <DefaultFilterSelect\n placeholder={placeholder}\n value={value}\n onChange={setValue}\n options={resolvedOptions}\n className={className}\n />\n );\n}\n"],"mappings":";;;;;;;AAyBA,SAAS,kBACP,IACA,KACsB;CACtB,IAAI,UAAqD,EAAE;AAC3D,SAAQ,IAAR;EACE,KAAK;AACH,aAAU,IAAI;AACd;EACF,KAAK;AACH,aAAU,IAAI;AACd;EACF,KAAK;AACH,aAAU,IAAI;AACd;;AAEJ,QAAO,QAAQ,KAAK,CAAC,WAAW;EAAE,OAAO;EAAM,OAAO;EAAM,EAAE;;AAGhE,SAAgB,4BAA4B,EAC1C,IACA,aACA,SACA,WACA,QACA,GAAG,SACgC;CACnC,MAAM,MAAM,2BAA2B;CACvC,MAAM,QAAQ,IAAI,qBAAqB,GAAG,IAAI;CAC9C,MAAM,kBAAkB,WAAW,kBAAkB,IAAI,IAAI;CAC7D,MAAM,YAAY,MAAqB;AACrC,MAAI,KAAK,KAAM,KAAI,mBAAmB,GAAG;MACpC,KAAI,gBAAgB,IAAI,EAAE;;CAGjC,MAAM,UAAU,UAAU;EACxB,gBAAgB;EAChB;EACA,OAAO;GAAE;GAAO;GAAU,SAAS;GAAiB,UAAU,CAAC,CAAC;GAAO;EACvE,wBAAwB;GACtB,gBAAgB;GAChB,eAAe;GAChB;EACD,OAAO,WACL;GACE;GACM,WAAW,yBAAyB;GAC3C,EACD,MACD;EACF,CAAC;AAEF,KAAI,OAAQ,QAAO;AAEnB,QACE,oBAAC,qBAAD;EACe;EACN;EACP,UAAU;EACV,SAAS;EACE;EACX"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
//#region src/components/compound/searches-catalog/column-filters.d.ts
|
|
5
|
-
interface SearchesCatalogColumnFiltersProps {
|
|
6
|
-
children?: ReactNode;
|
|
7
|
-
className?: string;
|
|
8
|
-
}
|
|
9
|
-
declare function SearchesCatalogColumnFilters({
|
|
10
|
-
children,
|
|
11
|
-
className
|
|
12
|
-
}: SearchesCatalogColumnFiltersProps): _$react_jsx_runtime0.JSX.Element;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { SearchesCatalogColumnFilters, SearchesCatalogColumnFiltersProps };
|
|
15
|
-
//# sourceMappingURL=column-filters.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"column-filters.d.mts","names":[],"sources":["../../../../src/components/compound/searches-catalog/column-filters.tsx"],"mappings":";;;;UAKiB,iCAAA;EACf,QAAA,GAAW,SAAA;EACX,SAAA;AAAA;AAAA,iBAGc,4BAAA,CAAA;EACd,QAAA;EACA;AAAA,GACC,iCAAA,GAAiC,oBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { DefaultCatalogFilters } from "../../defaults/catalog/layout.mjs";
|
|
2
|
-
import { SearchesCatalogOutputFieldFilter } from "./output-field-filter.mjs";
|
|
3
|
-
import { SearchesCatalogProviderFilter } from "./provider-filter.mjs";
|
|
4
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
|
|
6
|
-
//#region src/components/compound/searches-catalog/column-filters.tsx
|
|
7
|
-
function SearchesCatalogColumnFilters({ children, className }) {
|
|
8
|
-
return /* @__PURE__ */ jsx(DefaultCatalogFilters, {
|
|
9
|
-
className,
|
|
10
|
-
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SearchesCatalogOutputFieldFilter, {}), /* @__PURE__ */ jsx(SearchesCatalogProviderFilter, {})] })
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
//#endregion
|
|
15
|
-
export { SearchesCatalogColumnFilters };
|
|
16
|
-
//# sourceMappingURL=column-filters.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"column-filters.mjs","names":[],"sources":["../../../../src/components/compound/searches-catalog/column-filters.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { DefaultCatalogFilters } from \"../../defaults/catalog/layout.js\";\nimport { SearchesCatalogOutputFieldFilter } from \"./output-field-filter.js\";\nimport { SearchesCatalogProviderFilter } from \"./provider-filter.js\";\n\nexport interface SearchesCatalogColumnFiltersProps {\n children?: ReactNode;\n className?: string;\n}\n\nexport function SearchesCatalogColumnFilters({\n children,\n className,\n}: SearchesCatalogColumnFiltersProps) {\n return (\n <DefaultCatalogFilters className={className}>\n {children ?? (\n <>\n <SearchesCatalogOutputFieldFilter />\n <SearchesCatalogProviderFilter />\n </>\n )}\n </DefaultCatalogFilters>\n );\n}\n"],"mappings":";;;;;;AAUA,SAAgB,6BAA6B,EAC3C,UACA,aACoC;AACpC,QACE,oBAAC,uBAAD;EAAkC;YAC/B,YACC,4CACE,oBAAC,kCAAD,EAAoC,GACpC,oBAAC,+BAAD,EAAiC,EAChC;EAEiB"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
2
|
-
import * as _$react from "react";
|
|
3
|
-
|
|
4
|
-
//#region src/components/compound/searches-catalog/empty.d.ts
|
|
5
|
-
interface SearchesCatalogEmptyState {
|
|
6
|
-
visible: boolean;
|
|
7
|
-
}
|
|
8
|
-
interface SearchesCatalogEmptyProps extends useRender.ComponentProps<"div", SearchesCatalogEmptyState> {}
|
|
9
|
-
declare function SearchesCatalogEmpty({
|
|
10
|
-
children,
|
|
11
|
-
className,
|
|
12
|
-
render,
|
|
13
|
-
...props
|
|
14
|
-
}: SearchesCatalogEmptyProps): _$react.ReactElement<unknown, string | _$react.JSXElementConstructor<any>> | null;
|
|
15
|
-
//#endregion
|
|
16
|
-
export { SearchesCatalogEmpty, SearchesCatalogEmptyProps, SearchesCatalogEmptyState };
|
|
17
|
-
//# sourceMappingURL=empty.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"empty.d.mts","names":[],"sources":["../../../../src/components/compound/searches-catalog/empty.tsx"],"mappings":";;;;UAMiB,yBAAA;EACf,OAAA;AAAA;AAAA,UAGe,yBAAA,SACP,SAAA,CAAU,cAAA,QAAsB,yBAAA;AAAA,iBAE1B,oBAAA,CAAA;EACd,QAAA;EACA,SAAA;EACA,MAAA;EAAA,GACG;AAAA,GACF,yBAAA,GAAyB,OAAA,CAAA,YAAA,mBAAA,OAAA,CAAA,qBAAA"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useCatalogConfig } from "../../../context/catalog-config-context.mjs";
|
|
2
|
-
import { useSearchesCatalogContext } from "../../../context/searches-catalog-context.mjs";
|
|
3
|
-
import { DefaultEmptyState } from "../../defaults/catalog/empty-state.mjs";
|
|
4
|
-
import { mergeProps } from "@base-ui/react/merge-props";
|
|
5
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
6
|
-
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
|
|
8
|
-
//#region src/components/compound/searches-catalog/empty.tsx
|
|
9
|
-
function SearchesCatalogEmpty({ children, className, render, ...props }) {
|
|
10
|
-
const { components } = useCatalogConfig();
|
|
11
|
-
const visible = useSearchesCatalogContext().table.getRowModel().rows.length === 0;
|
|
12
|
-
const EmptyState = components?.EmptyState;
|
|
13
|
-
const element = useRender({
|
|
14
|
-
defaultTagName: "div",
|
|
15
|
-
render,
|
|
16
|
-
state: { visible },
|
|
17
|
-
props: mergeProps({
|
|
18
|
-
className,
|
|
19
|
-
children: EmptyState ? /* @__PURE__ */ jsx(EmptyState, { children }) : /* @__PURE__ */ jsx(DefaultEmptyState, { children: children ?? "No searches found. Try adjusting your filters." }),
|
|
20
|
-
"data-p0": "catalog-empty"
|
|
21
|
-
}, props)
|
|
22
|
-
});
|
|
23
|
-
if (!visible) return null;
|
|
24
|
-
return element;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
export { SearchesCatalogEmpty };
|
|
29
|
-
//# sourceMappingURL=empty.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"empty.mjs","names":[],"sources":["../../../../src/components/compound/searches-catalog/empty.tsx"],"sourcesContent":["import { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { useCatalogConfig } from \"../../../context/catalog-config-context.js\";\nimport { useSearchesCatalogContext } from \"../../../context/searches-catalog-context.js\";\nimport { DefaultEmptyState } from \"../../defaults/catalog/empty-state.js\";\n\nexport interface SearchesCatalogEmptyState {\n visible: boolean;\n}\n\nexport interface SearchesCatalogEmptyProps\n extends useRender.ComponentProps<\"div\", SearchesCatalogEmptyState> {}\n\nexport function SearchesCatalogEmpty({\n children,\n className,\n render,\n ...props\n}: SearchesCatalogEmptyProps) {\n const { components } = useCatalogConfig();\n const ctx = useSearchesCatalogContext();\n const visible = ctx.table.getRowModel().rows.length === 0;\n\n const EmptyState = components?.EmptyState;\n const defaultBody = EmptyState ? (\n <EmptyState>{children}</EmptyState>\n ) : (\n <DefaultEmptyState>\n {children ?? \"No searches found. Try adjusting your filters.\"}\n </DefaultEmptyState>\n );\n\n const element = useRender({\n defaultTagName: \"div\",\n render,\n state: { visible },\n props: mergeProps<\"div\">(\n {\n className,\n children: defaultBody,\n ...({ \"data-p0\": \"catalog-empty\" } as Record<string, string>),\n },\n props,\n ),\n });\n\n if (!visible) return null;\n return element;\n}\n"],"mappings":";;;;;;;;AAaA,SAAgB,qBAAqB,EACnC,UACA,WACA,QACA,GAAG,SACyB;CAC5B,MAAM,EAAE,eAAe,kBAAkB;CAEzC,MAAM,UADM,2BAA2B,CACnB,MAAM,aAAa,CAAC,KAAK,WAAW;CAExD,MAAM,aAAa,YAAY;CAS/B,MAAM,UAAU,UAAU;EACxB,gBAAgB;EAChB;EACA,OAAO,EAAE,SAAS;EAClB,OAAO,WACL;GACE;GACA,UAfc,aAClB,oBAAC,YAAD,EAAa,UAAsB,IAEnC,oBAAC,mBAAD,YACG,YAAY,kDACK;GAWV,WAAW;GAClB,EACD,MACD;EACF,CAAC;AAEF,KAAI,CAAC,QAAS,QAAO;AACrB,QAAO"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ActiveFilter, SearchesCatalogActiveFilters, SearchesCatalogActiveFiltersProps, SearchesCatalogActiveFiltersState } from "./active-filters.mjs";
|
|
2
|
-
import { SearchesCatalogCard, SearchesCatalogCardProps } from "./card.mjs";
|
|
3
|
-
import { SearchesCatalogCategoryFilter, SearchesCatalogCategoryFilterProps, SearchesCatalogCategoryFilterState } from "./category-filter.mjs";
|
|
4
|
-
import { ColumnFilterState, SearchesCatalogColumnFilter, SearchesCatalogColumnFilterProps, SearchesColumnFilterId } from "./column-filter.mjs";
|
|
5
|
-
import { SearchesCatalogColumnFilters, SearchesCatalogColumnFiltersProps } from "./column-filters.mjs";
|
|
6
|
-
import { SearchesCatalogEmpty, SearchesCatalogEmptyProps, SearchesCatalogEmptyState } from "./empty.mjs";
|
|
7
|
-
import { SearchesCatalogList, SearchesCatalogListProps, SearchesCatalogListState } from "./list.mjs";
|
|
8
|
-
import { SearchesCatalogOutputFieldFilter, SearchesCatalogOutputFieldFilterProps } from "./output-field-filter.mjs";
|
|
9
|
-
import { SearchesCatalogProviderFilter, SearchesCatalogProviderFilterProps } from "./provider-filter.mjs";
|
|
10
|
-
import { SearchesCatalog, SearchesCatalogInstanceProps, SearchesCatalogProps, SearchesCatalogZeroConfigProps } from "./root.mjs";
|
|
11
|
-
import { SearchesCatalogSearchFilter, SearchesCatalogSearchFilterProps, SearchesCatalogSearchFilterState } from "./search-filter.mjs";
|
|
12
|
-
import { SearchesCatalogTagFilter, SearchesCatalogTagFilterProps } from "./tag-filter.mjs";
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SearchesCardData } from "../../../types/catalog-adapters.mjs";
|
|
2
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
-
import * as _$react from "react";
|
|
4
|
-
|
|
5
|
-
//#region src/components/compound/searches-catalog/list.d.ts
|
|
6
|
-
interface SearchesCatalogListState {
|
|
7
|
-
cards: ReadonlyArray<SearchesCardData>;
|
|
8
|
-
isEmpty: boolean;
|
|
9
|
-
}
|
|
10
|
-
interface SearchesCatalogListProps extends useRender.ComponentProps<"div", SearchesCatalogListState> {}
|
|
11
|
-
declare function SearchesCatalogList({
|
|
12
|
-
render,
|
|
13
|
-
className,
|
|
14
|
-
children,
|
|
15
|
-
...props
|
|
16
|
-
}: SearchesCatalogListProps): _$react.ReactElement<unknown, string | _$react.JSXElementConstructor<any>> | null;
|
|
17
|
-
//#endregion
|
|
18
|
-
export { SearchesCatalogList, SearchesCatalogListProps, SearchesCatalogListState };
|
|
19
|
-
//# sourceMappingURL=list.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.mts","names":[],"sources":["../../../../src/components/compound/searches-catalog/list.tsx"],"mappings":";;;;;UAOiB,wBAAA;EACf,KAAA,EAAO,aAAA,CAAc,gBAAA;EACrB,OAAA;AAAA;AAAA,UAGe,wBAAA,SACP,SAAA,CAAU,cAAA,QAAsB,wBAAA;AAAA,iBAE1B,mBAAA,CAAA;EACd,MAAA;EACA,SAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,wBAAA,GAAwB,OAAA,CAAA,YAAA,mBAAA,OAAA,CAAA,qBAAA"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { cn } from "../../../lib/utils.mjs";
|
|
2
|
-
import { useSearchesCatalogContext } from "../../../context/searches-catalog-context.mjs";
|
|
3
|
-
import { SearchesCatalogCard } from "./card.mjs";
|
|
4
|
-
import { mergeProps } from "@base-ui/react/merge-props";
|
|
5
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
6
|
-
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
|
|
8
|
-
//#region src/components/compound/searches-catalog/list.tsx
|
|
9
|
-
function SearchesCatalogList({ render, className, children, ...props }) {
|
|
10
|
-
const { cards } = useSearchesCatalogContext();
|
|
11
|
-
const isEmpty = cards.length === 0;
|
|
12
|
-
const defaultBody = cards.map((card, idx) => /* @__PURE__ */ jsx(SearchesCatalogCard, { card }, `${card.searchesId}-${idx}`));
|
|
13
|
-
const element = useRender({
|
|
14
|
-
defaultTagName: "div",
|
|
15
|
-
render,
|
|
16
|
-
state: {
|
|
17
|
-
cards,
|
|
18
|
-
isEmpty
|
|
19
|
-
},
|
|
20
|
-
stateAttributesMapping: { cards: () => null },
|
|
21
|
-
props: mergeProps({
|
|
22
|
-
className: cn("pz:flex pz:flex-col pz:gap-2", className),
|
|
23
|
-
children: children ?? defaultBody,
|
|
24
|
-
"data-p0": "catalog-list"
|
|
25
|
-
}, props)
|
|
26
|
-
});
|
|
27
|
-
if (isEmpty) return null;
|
|
28
|
-
return element;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
//#endregion
|
|
32
|
-
export { SearchesCatalogList };
|
|
33
|
-
//# sourceMappingURL=list.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list.mjs","names":[],"sources":["../../../../src/components/compound/searches-catalog/list.tsx"],"sourcesContent":["import { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { useSearchesCatalogContext } from \"../../../context/searches-catalog-context.js\";\nimport { cn } from \"../../../lib/utils.js\";\nimport type { SearchesCardData } from \"../../../types/catalog-adapters.js\";\nimport { SearchesCatalogCard } from \"./card.js\";\n\nexport interface SearchesCatalogListState {\n cards: ReadonlyArray<SearchesCardData>;\n isEmpty: boolean;\n}\n\nexport interface SearchesCatalogListProps\n extends useRender.ComponentProps<\"div\", SearchesCatalogListState> {}\n\nexport function SearchesCatalogList({\n render,\n className,\n children,\n ...props\n}: SearchesCatalogListProps) {\n const { cards } = useSearchesCatalogContext();\n const isEmpty = cards.length === 0;\n\n const defaultBody = cards.map((card, idx) => (\n <SearchesCatalogCard key={`${card.searchesId}-${idx}`} card={card} />\n ));\n\n const element = useRender({\n defaultTagName: \"div\",\n render,\n state: { cards, isEmpty },\n stateAttributesMapping: {\n cards: () => null,\n },\n props: mergeProps<\"div\">(\n {\n className: cn(\"pz:flex pz:flex-col pz:gap-2\", className),\n children: children ?? defaultBody,\n ...({ \"data-p0\": \"catalog-list\" } as Record<string, string>),\n },\n props,\n ),\n });\n\n if (isEmpty) return null;\n return element;\n}\n"],"mappings":";;;;;;;;AAeA,SAAgB,oBAAoB,EAClC,QACA,WACA,UACA,GAAG,SACwB;CAC3B,MAAM,EAAE,UAAU,2BAA2B;CAC7C,MAAM,UAAU,MAAM,WAAW;CAEjC,MAAM,cAAc,MAAM,KAAK,MAAM,QACnC,oBAAC,qBAAD,EAA6D,MAAQ,EAA3C,GAAG,KAAK,WAAW,GAAG,MAAqB,CACrE;CAEF,MAAM,UAAU,UAAU;EACxB,gBAAgB;EAChB;EACA,OAAO;GAAE;GAAO;GAAS;EACzB,wBAAwB,EACtB,aAAa,MACd;EACD,OAAO,WACL;GACE,WAAW,GAAG,gCAAgC,UAAU;GACxD,UAAU,YAAY;GAChB,WAAW;GAClB,EACD,MACD;EACF,CAAC;AAEF,KAAI,QAAS,QAAO;AACpB,QAAO"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { FilterSelectOption } from "../../defaults/catalog/filter-select.mjs";
|
|
2
|
-
import { ColumnFilterState } from "./column-filter.mjs";
|
|
3
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
-
import { ReactNode } from "react";
|
|
5
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
|
-
|
|
7
|
-
//#region src/components/compound/searches-catalog/output-field-filter.d.ts
|
|
8
|
-
interface SearchesCatalogOutputFieldFilterProps {
|
|
9
|
-
options?: ReadonlyArray<FilterSelectOption>;
|
|
10
|
-
placeholder?: ReactNode;
|
|
11
|
-
className?: string;
|
|
12
|
-
render?: useRender.ComponentProps<"div", ColumnFilterState>["render"];
|
|
13
|
-
}
|
|
14
|
-
declare function SearchesCatalogOutputFieldFilter({
|
|
15
|
-
options,
|
|
16
|
-
placeholder,
|
|
17
|
-
className,
|
|
18
|
-
render
|
|
19
|
-
}: SearchesCatalogOutputFieldFilterProps): _$react_jsx_runtime0.JSX.Element;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { SearchesCatalogOutputFieldFilter, SearchesCatalogOutputFieldFilterProps };
|
|
22
|
-
//# sourceMappingURL=output-field-filter.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"output-field-filter.d.mts","names":[],"sources":["../../../../src/components/compound/searches-catalog/output-field-filter.tsx"],"mappings":";;;;;;;UAMiB,qCAAA;EACf,OAAA,GAAU,aAAA,CAAc,kBAAA;EACxB,WAAA,GAAc,SAAA;EACd,SAAA;EACA,MAAA,GAAS,SAAA,CAAU,cAAA,QAAsB,iBAAA;AAAA;AAAA,iBAS3B,gCAAA,CAAA;EACd,OAAA;EACA,WAAA;EACA,SAAA;EACA;AAAA,GACC,qCAAA,GAAqC,oBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { SearchesCatalogColumnFilter } from "./column-filter.mjs";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { ArrowDown } from "lucide-react";
|
|
4
|
-
|
|
5
|
-
//#region src/components/compound/searches-catalog/output-field-filter.tsx
|
|
6
|
-
const DEFAULT_PLACEHOLDER = /* @__PURE__ */ jsxs("span", {
|
|
7
|
-
className: "pz:inline-flex pz:items-center pz:gap-1.5",
|
|
8
|
-
children: [/* @__PURE__ */ jsx(ArrowDown, { className: "pz:size-4" }), " Output fields"]
|
|
9
|
-
});
|
|
10
|
-
function SearchesCatalogOutputFieldFilter({ options, placeholder = DEFAULT_PLACEHOLDER, className, render }) {
|
|
11
|
-
return /* @__PURE__ */ jsx(SearchesCatalogColumnFilter, {
|
|
12
|
-
id: "outputFields",
|
|
13
|
-
placeholder,
|
|
14
|
-
options,
|
|
15
|
-
className,
|
|
16
|
-
render
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
//#endregion
|
|
21
|
-
export { SearchesCatalogOutputFieldFilter };
|
|
22
|
-
//# sourceMappingURL=output-field-filter.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"output-field-filter.mjs","names":[],"sources":["../../../../src/components/compound/searches-catalog/output-field-filter.tsx"],"sourcesContent":["import type { useRender } from \"@base-ui/react/use-render\";\nimport { ArrowDown } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\nimport type { FilterSelectOption } from \"../../defaults/catalog/filter-select.js\";\nimport { type ColumnFilterState, SearchesCatalogColumnFilter } from \"./column-filter.js\";\n\nexport interface SearchesCatalogOutputFieldFilterProps {\n options?: ReadonlyArray<FilterSelectOption>;\n placeholder?: ReactNode;\n className?: string;\n render?: useRender.ComponentProps<\"div\", ColumnFilterState>[\"render\"];\n}\n\nconst DEFAULT_PLACEHOLDER = (\n <span className=\"pz:inline-flex pz:items-center pz:gap-1.5\">\n <ArrowDown className=\"pz:size-4\" /> Output fields\n </span>\n);\n\nexport function SearchesCatalogOutputFieldFilter({\n options,\n placeholder = DEFAULT_PLACEHOLDER,\n className,\n render,\n}: SearchesCatalogOutputFieldFilterProps) {\n return (\n <SearchesCatalogColumnFilter\n id=\"outputFields\"\n placeholder={placeholder}\n options={options}\n className={className}\n render={render}\n />\n );\n}\n"],"mappings":";;;;;AAaA,MAAM,sBACJ,qBAAC,QAAD;CAAM,WAAU;WAAhB,CACE,oBAAC,WAAD,EAAW,WAAU,aAAc,oBAC9B;;AAGT,SAAgB,iCAAiC,EAC/C,SACA,cAAc,qBACd,WACA,UACwC;AACxC,QACE,oBAAC,6BAAD;EACE,IAAG;EACU;EACJ;EACE;EACH;EACR"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { FilterSelectOption } from "../../defaults/catalog/filter-select.mjs";
|
|
2
|
-
import { ColumnFilterState } from "./column-filter.mjs";
|
|
3
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
-
import { ReactNode } from "react";
|
|
5
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
|
-
|
|
7
|
-
//#region src/components/compound/searches-catalog/provider-filter.d.ts
|
|
8
|
-
interface SearchesCatalogProviderFilterProps {
|
|
9
|
-
options?: ReadonlyArray<FilterSelectOption>;
|
|
10
|
-
placeholder?: ReactNode;
|
|
11
|
-
className?: string;
|
|
12
|
-
render?: useRender.ComponentProps<"div", ColumnFilterState>["render"];
|
|
13
|
-
}
|
|
14
|
-
declare function SearchesCatalogProviderFilter({
|
|
15
|
-
options,
|
|
16
|
-
placeholder,
|
|
17
|
-
className,
|
|
18
|
-
render
|
|
19
|
-
}: SearchesCatalogProviderFilterProps): _$react_jsx_runtime0.JSX.Element;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { SearchesCatalogProviderFilter, SearchesCatalogProviderFilterProps };
|
|
22
|
-
//# sourceMappingURL=provider-filter.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provider-filter.d.mts","names":[],"sources":["../../../../src/components/compound/searches-catalog/provider-filter.tsx"],"mappings":";;;;;;;UAQiB,kCAAA;EACf,OAAA,GAAU,aAAA,CAAc,kBAAA;EACxB,WAAA,GAAc,SAAA;EACd,SAAA;EACA,MAAA,GAAS,SAAA,CAAU,cAAA,QAAsB,iBAAA;AAAA;AAAA,iBAS3B,6BAAA,CAAA;EACd,OAAA;EACA,WAAA;EACA,SAAA;EACA;AAAA,GACC,kCAAA,GAAkC,oBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useSearchesCatalogContext } from "../../../context/searches-catalog-context.mjs";
|
|
2
|
-
import { SearchesCatalogColumnFilter } from "./column-filter.mjs";
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import { getProviderEntry } from "@pipe0/base";
|
|
5
|
-
import { Building2 } from "lucide-react";
|
|
6
|
-
|
|
7
|
-
//#region src/components/compound/searches-catalog/provider-filter.tsx
|
|
8
|
-
const DEFAULT_PLACEHOLDER = /* @__PURE__ */ jsxs("span", {
|
|
9
|
-
className: "pz:inline-flex pz:items-center pz:gap-1.5",
|
|
10
|
-
children: [/* @__PURE__ */ jsx(Building2, { className: "pz:size-4" }), " Provider"]
|
|
11
|
-
});
|
|
12
|
-
function SearchesCatalogProviderFilter({ options, placeholder = DEFAULT_PLACEHOLDER, className, render }) {
|
|
13
|
-
const ctx = useSearchesCatalogContext();
|
|
14
|
-
return /* @__PURE__ */ jsx(SearchesCatalogColumnFilter, {
|
|
15
|
-
id: "providers",
|
|
16
|
-
placeholder,
|
|
17
|
-
options: options ?? ctx.sortedProviderEntries.map(([name]) => ({
|
|
18
|
-
label: name,
|
|
19
|
-
value: name,
|
|
20
|
-
imageSrc: getProviderEntry(name)?.logoUrl
|
|
21
|
-
})),
|
|
22
|
-
className,
|
|
23
|
-
render
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
export { SearchesCatalogProviderFilter };
|
|
29
|
-
//# sourceMappingURL=provider-filter.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provider-filter.mjs","names":[],"sources":["../../../../src/components/compound/searches-catalog/provider-filter.tsx"],"sourcesContent":["import type { useRender } from \"@base-ui/react/use-render\";\nimport { getProviderEntry, type ProviderName } from \"@pipe0/base\";\nimport { Building2 } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\nimport { useSearchesCatalogContext } from \"../../../context/searches-catalog-context.js\";\nimport type { FilterSelectOption } from \"../../defaults/catalog/filter-select.js\";\nimport { type ColumnFilterState, SearchesCatalogColumnFilter } from \"./column-filter.js\";\n\nexport interface SearchesCatalogProviderFilterProps {\n options?: ReadonlyArray<FilterSelectOption>;\n placeholder?: ReactNode;\n className?: string;\n render?: useRender.ComponentProps<\"div\", ColumnFilterState>[\"render\"];\n}\n\nconst DEFAULT_PLACEHOLDER = (\n <span className=\"pz:inline-flex pz:items-center pz:gap-1.5\">\n <Building2 className=\"pz:size-4\" /> Provider\n </span>\n);\n\nexport function SearchesCatalogProviderFilter({\n options,\n placeholder = DEFAULT_PLACEHOLDER,\n className,\n render,\n}: SearchesCatalogProviderFilterProps) {\n const ctx = useSearchesCatalogContext();\n const resolvedOptions =\n options ??\n ctx.sortedProviderEntries.map(([name]) => ({\n label: name,\n value: name,\n imageSrc: getProviderEntry(name as ProviderName)?.logoUrl,\n }));\n\n return (\n <SearchesCatalogColumnFilter\n id=\"providers\"\n placeholder={placeholder}\n options={resolvedOptions}\n className={className}\n render={render}\n />\n );\n}\n"],"mappings":";;;;;;;AAeA,MAAM,sBACJ,qBAAC,QAAD;CAAM,WAAU;WAAhB,CACE,oBAAC,WAAD,EAAW,WAAU,aAAc,eAC9B;;AAGT,SAAgB,8BAA8B,EAC5C,SACA,cAAc,qBACd,WACA,UACqC;CACrC,MAAM,MAAM,2BAA2B;AASvC,QACE,oBAAC,6BAAD;EACE,IAAG;EACU;EACb,SAXF,WACA,IAAI,sBAAsB,KAAK,CAAC,WAAW;GACzC,OAAO;GACP,OAAO;GACP,UAAU,iBAAiB,KAAqB,EAAE;GACnD,EAAE;EAOU;EACH;EACR"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { CatalogClassNames, CatalogComponentOverrides, SearchesCardData } from "../../../types/catalog-adapters.mjs";
|
|
2
|
-
import { UseSearchesCatalogTableReturn } from "../../../hooks/use-searches-catalog-table.mjs";
|
|
3
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
-
import { ReactNode, SyntheticEvent } from "react";
|
|
5
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
|
-
import { CatalogFilter } from "@pipe0/base";
|
|
7
|
-
import { ColumnFilter } from "@tanstack/react-table";
|
|
8
|
-
|
|
9
|
-
//#region src/components/compound/searches-catalog/root.d.ts
|
|
10
|
-
interface CustomizationProps {
|
|
11
|
-
classNames?: CatalogClassNames;
|
|
12
|
-
components?: CatalogComponentOverrides;
|
|
13
|
-
className?: string;
|
|
14
|
-
render?: useRender.ComponentProps<"div">["render"];
|
|
15
|
-
}
|
|
16
|
-
interface SelectionProps {
|
|
17
|
-
/** Fires on click / keyboard activation of any `<SearchesCatalogCard>`. */
|
|
18
|
-
onSelectSearches?: (searches: SearchesCardData, e: SyntheticEvent) => void;
|
|
19
|
-
}
|
|
20
|
-
interface SearchesCatalogInstanceProps extends CustomizationProps, SelectionProps {
|
|
21
|
-
context: UseSearchesCatalogTableReturn;
|
|
22
|
-
children?: ReactNode;
|
|
23
|
-
}
|
|
24
|
-
interface SearchesCatalogZeroConfigProps extends CustomizationProps, SelectionProps {
|
|
25
|
-
filter?: CatalogFilter;
|
|
26
|
-
initialColumnFilters?: ColumnFilter[];
|
|
27
|
-
children?: ReactNode;
|
|
28
|
-
}
|
|
29
|
-
type SearchesCatalogProps = SearchesCatalogInstanceProps | SearchesCatalogZeroConfigProps;
|
|
30
|
-
declare function SearchesCatalog(props: SearchesCatalogProps): _$react_jsx_runtime0.JSX.Element;
|
|
31
|
-
//#endregion
|
|
32
|
-
export { SearchesCatalog, SearchesCatalogInstanceProps, SearchesCatalogProps, SearchesCatalogZeroConfigProps };
|
|
33
|
-
//# sourceMappingURL=root.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"root.d.mts","names":[],"sources":["../../../../src/components/compound/searches-catalog/root.tsx"],"mappings":";;;;;;;;;UA+BU,kBAAA;EACR,UAAA,GAAa,iBAAA;EACb,UAAA,GAAa,yBAAA;EACb,SAAA;EACA,MAAA,GAAS,SAAA,CAAU,cAAA;AAAA;AAAA,UAGX,cAAA;EALK;EAOb,gBAAA,IAAoB,QAAA,EAAU,gBAAA,EAAkB,CAAA,EAAG,cAAA;AAAA;AAAA,UAGpC,4BAAA,SAAqC,kBAAA,EAAoB,cAAA;EACxE,OAAA,EAAS,6BAAA;EACT,QAAA,GAAW,SAAA;AAAA;AAAA,UAGI,8BAAA,SAAuC,kBAAA,EAAoB,cAAA;EAC1E,MAAA,GAAS,aAAA;EACT,oBAAA,GAAuB,YAAA;EACvB,QAAA,GAAW,SAAA;AAAA;AAAA,KAGD,oBAAA,GAAuB,4BAAA,GAA+B,8BAAA;AAAA,iBAElD,eAAA,CAAgB,KAAA,EAAO,oBAAA,GAAoB,oBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { CatalogProvider, CatalogRoot, useCatalogConfig } from "../../../context/catalog-config-context.mjs";
|
|
2
|
-
import { SearchesCatalogContext } from "../../../context/searches-catalog-context.mjs";
|
|
3
|
-
import { DefaultCatalogRoot } from "../../defaults/catalog/layout.mjs";
|
|
4
|
-
import { SearchesCatalogActiveFilters } from "./active-filters.mjs";
|
|
5
|
-
import { SearchesCatalogCategoryFilter } from "./category-filter.mjs";
|
|
6
|
-
import { SearchesCatalogColumnFilters } from "./column-filters.mjs";
|
|
7
|
-
import { SearchesCatalogEmpty } from "./empty.mjs";
|
|
8
|
-
import { SearchesCatalogList } from "./list.mjs";
|
|
9
|
-
import { useSearchesCatalogTable } from "../../../hooks/use-searches-catalog-table.mjs";
|
|
10
|
-
import { SearchesCatalogSearchFilter } from "./search-filter.mjs";
|
|
11
|
-
import { useMemo, useState } from "react";
|
|
12
|
-
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
-
|
|
14
|
-
//#region src/components/compound/searches-catalog/root.tsx
|
|
15
|
-
function SearchesCatalog(props) {
|
|
16
|
-
if ("context" in props) return /* @__PURE__ */ jsx(SearchesCatalogWithContext, { ...props });
|
|
17
|
-
return /* @__PURE__ */ jsx(SearchesCatalogZeroConfig, { ...props });
|
|
18
|
-
}
|
|
19
|
-
function SearchesCatalogZeroConfig({ filter, initialColumnFilters, ...rest }) {
|
|
20
|
-
return /* @__PURE__ */ jsx(SearchesCatalogWithContext, {
|
|
21
|
-
context: useSearchesCatalogTable({
|
|
22
|
-
filter,
|
|
23
|
-
initialColumnFilters
|
|
24
|
-
}),
|
|
25
|
-
...rest
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
function SearchesCatalogWithContext({ context, children, className, classNames, components, onSelectSearches, render }) {
|
|
29
|
-
const hasLocalOverrides = classNames || components;
|
|
30
|
-
const [expandedCardId, setExpandedCardId] = useState(null);
|
|
31
|
-
const value = useMemo(() => ({
|
|
32
|
-
...context,
|
|
33
|
-
onSelectCard: onSelectSearches,
|
|
34
|
-
expandedCardId,
|
|
35
|
-
setExpandedCardId
|
|
36
|
-
}), [
|
|
37
|
-
context,
|
|
38
|
-
onSelectSearches,
|
|
39
|
-
expandedCardId
|
|
40
|
-
]);
|
|
41
|
-
const inner = /* @__PURE__ */ jsx(SearchesCatalogContext.Provider, {
|
|
42
|
-
value,
|
|
43
|
-
children: /* @__PURE__ */ jsx(SearchesCatalogShell, {
|
|
44
|
-
className,
|
|
45
|
-
render,
|
|
46
|
-
children
|
|
47
|
-
})
|
|
48
|
-
});
|
|
49
|
-
if (hasLocalOverrides) return /* @__PURE__ */ jsx(CatalogRoot, { children: /* @__PURE__ */ jsx(CatalogProvider, {
|
|
50
|
-
classNames,
|
|
51
|
-
components,
|
|
52
|
-
children: inner
|
|
53
|
-
}) });
|
|
54
|
-
return /* @__PURE__ */ jsx(CatalogRoot, { children: inner });
|
|
55
|
-
}
|
|
56
|
-
function SearchesCatalogShell({ children, className, render }) {
|
|
57
|
-
useCatalogConfig();
|
|
58
|
-
return /* @__PURE__ */ jsx(DefaultCatalogRoot, {
|
|
59
|
-
className,
|
|
60
|
-
render,
|
|
61
|
-
children: children !== void 0 ? children : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
62
|
-
/* @__PURE__ */ jsx(SearchesCatalogSearchFilter, {}),
|
|
63
|
-
/* @__PURE__ */ jsx(SearchesCatalogCategoryFilter, {}),
|
|
64
|
-
/* @__PURE__ */ jsx(SearchesCatalogColumnFilters, {}),
|
|
65
|
-
/* @__PURE__ */ jsx(SearchesCatalogActiveFilters, {}),
|
|
66
|
-
/* @__PURE__ */ jsx(SearchesCatalogList, {}),
|
|
67
|
-
/* @__PURE__ */ jsx(SearchesCatalogEmpty, {})
|
|
68
|
-
] })
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
//#endregion
|
|
73
|
-
export { SearchesCatalog };
|
|
74
|
-
//# sourceMappingURL=root.mjs.map
|