@usereactify/search 5.0.0-beta.14 → 5.0.0-beta.15
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 +2 -0
- package/dist/package.json +1 -1
- package/dist/src/components/ClearAll/ClearAll.d.ts +1 -1
- package/dist/src/components/ClearAll/ClearAll.js +2 -2
- package/dist/src/components/ClearAll/ClearAll.js.map +1 -1
- package/dist/src/components/Example/ExampleClearAll.d.ts +1 -1
- package/dist/src/components/Example/ExampleClearAll.js.map +1 -1
- package/dist/src/components/Example/ExampleCustomComponent.d.ts +2 -0
- package/dist/src/components/Example/ExampleCustomComponent.js +36 -0
- package/dist/src/components/Example/ExampleCustomComponent.js.map +1 -0
- package/dist/src/components/Example/ExampleFilterList.js +3 -3
- package/dist/src/components/Example/ExampleFilterList.js.map +1 -1
- package/dist/src/components/Example/ExampleFilterRange.js +1 -1
- package/dist/src/components/Example/ExampleFilterRange.js.map +1 -1
- package/dist/src/components/Example/ExampleFilters.d.ts +1 -1
- package/dist/src/components/Example/ExampleFilters.js +1 -1
- package/dist/src/components/Example/ExampleFilters.js.map +1 -1
- package/dist/src/components/Example/ExampleFiltersActive.d.ts +1 -1
- package/dist/src/components/Example/ExampleFiltersActive.js.map +1 -1
- package/dist/src/components/Example/ExampleHookUseFilters.d.ts +2 -0
- package/dist/src/components/Example/ExampleHookUseFilters.js +20 -0
- package/dist/src/components/Example/ExampleHookUseFilters.js.map +1 -0
- package/dist/src/components/Example/ExampleHookUseSearch.d.ts +2 -0
- package/dist/src/components/Example/ExampleHookUseSearch.js +22 -0
- package/dist/src/components/Example/ExampleHookUseSearch.js.map +1 -0
- package/dist/src/components/Example/ExampleHookUseSortBy.d.ts +2 -0
- package/dist/src/components/Example/ExampleHookUseSortBy.js +18 -0
- package/dist/src/components/Example/ExampleHookUseSortBy.js.map +1 -0
- package/dist/src/components/Example/ExampleReactiveSearchProviderCollection.d.ts +2 -0
- package/dist/src/components/Example/ExampleReactiveSearchProviderCollection.js +27 -0
- package/dist/src/components/Example/ExampleReactiveSearchProviderCollection.js.map +1 -0
- package/dist/src/components/Example/ExampleReactiveSearchProviderInstantSearch.d.ts +2 -0
- package/dist/src/components/Example/ExampleReactiveSearchProviderInstantSearch.js +27 -0
- package/dist/src/components/Example/ExampleReactiveSearchProviderInstantSearch.js.map +1 -0
- package/dist/src/components/Example/ExampleReactiveSearchProviderSearch.d.ts +2 -0
- package/dist/src/components/Example/ExampleReactiveSearchProviderSearch.js +27 -0
- package/dist/src/components/Example/ExampleReactiveSearchProviderSearch.js.map +1 -0
- package/dist/src/components/Example/ExampleResults.d.ts +2 -0
- package/dist/src/components/Example/ExampleResults.js +38 -0
- package/dist/src/components/Example/ExampleResults.js.map +1 -0
- package/dist/src/components/Example/ExampleSearch.d.ts +4 -0
- package/dist/src/components/Example/ExampleSearch.js +20 -0
- package/dist/src/components/Example/ExampleSearch.js.map +1 -0
- package/dist/src/components/Example/ExampleSortBy.d.ts +1 -1
- package/dist/src/components/Example/ExampleSortBy.js.map +1 -1
- package/dist/src/components/Example/ExampleStats.d.ts +1 -1
- package/dist/src/components/Example/ExampleStats.js.map +1 -1
- package/dist/src/components/Example/index.d.ts +7 -0
- package/dist/src/components/Example/index.js +7 -0
- package/dist/src/components/Example/index.js.map +1 -1
- package/dist/src/components/Filter/Filter.d.ts +6 -3
- package/dist/src/components/Filter/Filter.js.map +1 -1
- package/dist/src/components/Filter/Filters.d.ts +1 -1
- package/dist/src/components/Filter/Filters.js +2 -2
- package/dist/src/components/Filter/Filters.js.map +1 -1
- package/dist/src/components/Filter/FiltersActive.d.ts +1 -1
- package/dist/src/components/Filter/FiltersActive.js +2 -2
- package/dist/src/components/Filter/FiltersActive.js.map +1 -1
- package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.d.ts +2 -2
- package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.js +11 -13
- package/dist/src/components/ReactifySearchProvider/ReactifySearchProvider.js.map +1 -1
- package/dist/src/components/Result/ResultCardCallout.d.ts +2 -4
- package/dist/src/components/Result/ResultCardCallout.js.map +1 -1
- package/dist/src/components/Result/ResultCardProduct.d.ts +2 -5
- package/dist/src/components/Result/ResultCardProduct.js.map +1 -1
- package/dist/src/components/Result/ResultPaginationLoadMore.d.ts +2 -2
- package/dist/src/components/Result/ResultPaginationLoadMore.js +1 -1
- package/dist/src/components/Result/ResultPaginationLoadMore.js.map +1 -1
- package/dist/src/components/Result/ResultPaginationNextPrev.d.ts +2 -2
- package/dist/src/components/Result/ResultPaginationNextPrev.js +1 -1
- package/dist/src/components/Result/ResultPaginationNextPrev.js.map +1 -1
- package/dist/src/components/Result/ResultPaginationNumbered.d.ts +2 -2
- package/dist/src/components/Result/ResultPaginationNumbered.js +1 -1
- package/dist/src/components/Result/ResultPaginationNumbered.js.map +1 -1
- package/dist/src/components/Result/Results.d.ts +19 -11
- package/dist/src/components/Result/Results.js +4 -4
- package/dist/src/components/Result/Results.js.map +1 -1
- package/dist/src/components/Search/Search.d.ts +7 -0
- package/dist/src/components/Search/Search.js +17 -0
- package/dist/src/components/Search/Search.js.map +1 -0
- package/dist/src/components/Search/index.d.ts +1 -1
- package/dist/src/components/Search/index.js +1 -1
- package/dist/src/components/Search/index.js.map +1 -1
- package/dist/src/components/Sensor/SensorSearch.js +7 -3
- package/dist/src/components/Sensor/SensorSearch.js.map +1 -1
- package/dist/src/components/SortBy/SortBy.d.ts +1 -1
- package/dist/src/components/SortBy/SortBy.js +2 -2
- package/dist/src/components/SortBy/SortBy.js.map +1 -1
- package/dist/src/components/Stats/Stats.d.ts +17 -2
- package/dist/src/components/Stats/Stats.js +2 -2
- package/dist/src/components/Stats/Stats.js.map +1 -1
- package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.js +10 -10
- package/dist/src/hooks/reactivesearch/useReactiveDataSearchProps.js.map +1 -1
- package/dist/src/hooks/useCuration.js +3 -3
- package/dist/src/hooks/useCuration.js.map +1 -1
- package/dist/src/hooks/useFilterListProps.d.ts +1 -0
- package/dist/src/hooks/useFilterListProps.js +6 -6
- package/dist/src/hooks/useFilterListProps.js.map +1 -1
- package/dist/src/hooks/useFilterRangeProps.d.ts +1 -0
- package/dist/src/hooks/useFilterRangeProps.js +6 -5
- package/dist/src/hooks/useFilterRangeProps.js.map +1 -1
- package/dist/src/hooks/useFilters.d.ts +2 -0
- package/dist/src/hooks/useFilters.js.map +1 -1
- package/dist/src/hooks/usePagination.d.ts +10 -0
- package/dist/src/hooks/usePagination.js.map +1 -1
- package/dist/src/hooks/useReactifySearchContext.d.ts +8 -8
- package/dist/src/hooks/useReactifySearchContext.js.map +1 -1
- package/dist/src/hooks/useSearch.d.ts +8 -3
- package/dist/src/hooks/useSearch.js +24 -22
- package/dist/src/hooks/useSearch.js.map +1 -1
- package/dist/src/hooks/useSortBy.d.ts +4 -1
- package/dist/src/hooks/useSortBy.js +2 -0
- package/dist/src/hooks/useSortBy.js.map +1 -1
- package/dist/src/types/reactivesearch.d.ts +1 -1
- package/dist/src/types/reactivesearch.js.map +1 -1
- package/package.json +1 -1
- package/dist/src/components/Search/SearchInput.d.ts +0 -8
- package/dist/src/components/Search/SearchInput.js +0 -18
- package/dist/src/components/Search/SearchInput.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [5.0.0-beta.15](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.14...v5.0.0-beta.15) (2022-08-05)
|
|
6
|
+
|
|
5
7
|
## [5.0.0-beta.14](https://bitbucket.org/usereactify/reactify-search-ui/compare/v5.0.0-beta.13...v5.0.0-beta.14) (2022-08-04)
|
|
6
8
|
|
|
7
9
|
|
package/dist/package.json
CHANGED
|
@@ -9,7 +9,7 @@ const reactivesearch_1 = require("@appbaseio/reactivesearch");
|
|
|
9
9
|
const components_1 = require("../../components");
|
|
10
10
|
const ClearAll = (props) => {
|
|
11
11
|
var _a;
|
|
12
|
-
const
|
|
12
|
+
const RenderComponent = (_a = props.render) !== null && _a !== void 0 ? _a : components_1.ExampleClearAll;
|
|
13
13
|
return (react_1.default.createElement(reactivesearch_1.SelectedFilters, { render: ({ selectedValues, clearValues }) => {
|
|
14
14
|
const selectedFilters = Object.values(selectedValues)
|
|
15
15
|
.map((value) => value)
|
|
@@ -22,7 +22,7 @@ const ClearAll = (props) => {
|
|
|
22
22
|
if (!selectedFilters.length) {
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
|
-
return react_1.default.createElement(
|
|
25
|
+
return react_1.default.createElement(RenderComponent, { clearAll: clearValues });
|
|
26
26
|
} }));
|
|
27
27
|
};
|
|
28
28
|
exports.ClearAll = ClearAll;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClearAll.js","sourceRoot":"","sources":["../../../../src/components/ClearAll/ClearAll.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,8DAA4D;AAE5D,iDAAmD;AAS5C,MAAM,QAAQ,GAA4B,CAAC,KAAK,EAAE,EAAE;;IACzD,MAAM,
|
|
1
|
+
{"version":3,"file":"ClearAll.js","sourceRoot":"","sources":["../../../../src/components/ClearAll/ClearAll.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,8DAA4D;AAE5D,iDAAmD;AAS5C,MAAM,QAAQ,GAA4B,CAAC,KAAK,EAAE,EAAE;;IACzD,MAAM,eAAe,GAAG,MAAA,KAAK,CAAC,MAAM,mCAAI,4BAAe,CAAC;IAExD,OAAO,CACL,8BAAC,gCAAe,IACd,MAAM,EAAE,CAAC,EAAE,cAAc,EAAE,WAAW,EAAE,EAAE,EAAE;YAC1C,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC;iBAClD,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC;iBACrB,MAAM,CACL,CAAC,IAAS,EAAE,EAAE;;gBACZ,OAAA,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,SAAS;qBACf,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,CAAA;oBAChB,CAAC,CAAC,CAAC,CAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,0CAAE,MAAM,CAAA,IAAI,CAAC,CAAC,CAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,0CAAE,KAAK,CAAA,CAAC,CAAA;aAAA,CAClD,CAAC;YAEJ,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;gBAC3B,OAAO,IAAI,CAAC;aACb;YAED,OAAO,8BAAC,eAAe,IAAC,QAAQ,EAAE,WAAW,GAAI,CAAC;QACpD,CAAC,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAvBW,QAAA,QAAQ,YAuBnB","sourcesContent":["import React from \"react\";\nimport { SelectedFilters } from \"@appbaseio/reactivesearch\";\n\nimport { ExampleClearAll } from \"../../components\";\n\nexport type ClearAllProps = {\n /** Render method */\n render?: React.FC<{\n clearAll: () => void;\n }>;\n};\n\nexport const ClearAll: React.FC<ClearAllProps> = (props) => {\n const RenderComponent = props.render ?? ExampleClearAll;\n\n return (\n <SelectedFilters\n render={({ selectedValues, clearValues }) => {\n const selectedFilters = Object.values(selectedValues)\n .map((value) => value)\n .filter(\n (item: any) =>\n item?.URLParams &&\n item?.showFilter &&\n (!!item?.value?.length || !!item?.value?.label)\n );\n\n if (!selectedFilters.length) {\n return null;\n }\n\n return <RenderComponent clearAll={clearValues} />;\n }}\n />\n );\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ClearAllProps } from "../../components";
|
|
3
|
-
export declare type ExampleClearAllProps = React.ComponentProps<NonNullable<ClearAllProps["
|
|
3
|
+
export declare type ExampleClearAllProps = React.ComponentProps<NonNullable<ClearAllProps["render"]>>;
|
|
4
4
|
export declare const ExampleClearAll: React.FC<ExampleClearAllProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleClearAll.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleClearAll.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,eAAe,GAAmC,CAAC,KAAK,EAAE,EAAE;IACvE,OAAO,qCAAG,OAAO,EAAE,KAAK,CAAC,QAAQ,IAAG,WAAW,CAAK,CAAC;AACvD,CAAC,CAAC;AAFW,QAAA,eAAe,mBAE1B","sourcesContent":["import React from \"react\";\n\nimport { Filter, ClearAllProps } from \"../../components\";\n\nexport type ExampleClearAllProps = React.ComponentProps<\n NonNullable<ClearAllProps[\"
|
|
1
|
+
{"version":3,"file":"ExampleClearAll.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleClearAll.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,eAAe,GAAmC,CAAC,KAAK,EAAE,EAAE;IACvE,OAAO,qCAAG,OAAO,EAAE,KAAK,CAAC,QAAQ,IAAG,WAAW,CAAK,CAAC;AACvD,CAAC,CAAC;AAFW,QAAA,eAAe,mBAE1B","sourcesContent":["import React from \"react\";\n\nimport { Filter, ClearAllProps } from \"../../components\";\n\nexport type ExampleClearAllProps = React.ComponentProps<\n NonNullable<ClearAllProps[\"render\"]>\n>;\n\nexport const ExampleClearAll: React.FC<ExampleClearAllProps> = (props) => {\n return <a onClick={props.clearAll}>{\"Clear All\"}</a>;\n};\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.ExampleCustomComponent = void 0;
|
|
23
|
+
const React = __importStar(require("react"));
|
|
24
|
+
const components_1 = require("../../components");
|
|
25
|
+
const ExampleCustomComponent = () => {
|
|
26
|
+
return (React.createElement(components_1.ReactifySearchProvider, { mode: "search", shopifyPermanentDomain: "reactify-apps.myshopify.com", additionalComponentHandles: ["SensorSpecialProduct"] },
|
|
27
|
+
React.createElement(components_1.CustomComponent, { componentId: "SensorSpecialProduct", customQuery: () => ({
|
|
28
|
+
query: {
|
|
29
|
+
match: {
|
|
30
|
+
product_type: "Special Product",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
}) })));
|
|
34
|
+
};
|
|
35
|
+
exports.ExampleCustomComponent = ExampleCustomComponent;
|
|
36
|
+
//# sourceMappingURL=ExampleCustomComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleCustomComponent.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleCustomComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAE/B,iDAA2E;AAEpE,MAAM,sBAAsB,GAAa,GAAG,EAAE;IACnD,OAAO,CACL,oBAAC,mCAAsB,IACrB,IAAI,EAAC,QAAQ,EACb,sBAAsB,EAAC,6BAA6B,EACpD,0BAA0B,EAAE,CAAC,sBAAsB,CAAC;QAEpD,oBAAC,4BAAe,IACd,WAAW,EAAC,sBAAsB,EAClC,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC;gBAClB,KAAK,EAAE;oBACL,KAAK,EAAE;wBACL,YAAY,EAAE,iBAAiB;qBAChC;iBACF;aACF,CAAC,GACF,CACqB,CAC1B,CAAC;AACJ,CAAC,CAAC;AAnBW,QAAA,sBAAsB,0BAmBjC","sourcesContent":["import * as React from \"react\";\n\nimport { ReactifySearchProvider, CustomComponent } from \"../../components\";\n\nexport const ExampleCustomComponent: React.FC = () => {\n return (\n <ReactifySearchProvider\n mode=\"search\"\n shopifyPermanentDomain=\"reactify-apps.myshopify.com\"\n additionalComponentHandles={[\"SensorSpecialProduct\"]}\n >\n <CustomComponent\n componentId=\"SensorSpecialProduct\"\n customQuery={() => ({\n query: {\n match: {\n product_type: \"Special Product\",\n },\n },\n })}\n />\n </ReactifySearchProvider>\n );\n};\n"]}
|
|
@@ -20,7 +20,7 @@ exports.ExampleFilterList = ExampleFilterList;
|
|
|
20
20
|
const ExampleFilterListList = (props) => {
|
|
21
21
|
return (react_1.default.createElement("ul", { className: "rs__filter__list" }, props.filterListProps.options.map((option) => (react_1.default.createElement("li", { key: option.key, className: `rs__filter__list-item ${option.checked ? "rs__filter__list-item-active" : ""}` },
|
|
22
22
|
react_1.default.createElement("label", { className: "rs__filter__list-item-label", onClick: () => props.filterListProps.handleChange(option.key) },
|
|
23
|
-
react_1.default.createElement("span", { className: "rs__filter__list-item-key" }, option.
|
|
23
|
+
react_1.default.createElement("span", { className: "rs__filter__list-item-key" }, option.label),
|
|
24
24
|
react_1.default.createElement("span", { className: "rs__filter__list-item-count" },
|
|
25
25
|
"(",
|
|
26
26
|
option.doc_count,
|
|
@@ -31,7 +31,7 @@ const ExampleFilterListRadio = (props) => {
|
|
|
31
31
|
return (react_1.default.createElement("ul", { className: "rs__filter__list" }, props.filterListProps.options.map((option) => (react_1.default.createElement("li", { key: option.key, className: `rs__filter__list-item ${option.checked ? "rs__filter__list-item-active" : ""}` },
|
|
32
32
|
react_1.default.createElement("label", { className: "rs__filter__list-item-label" },
|
|
33
33
|
react_1.default.createElement("input", { className: "rs__filter__list-item-input", value: option.key, type: "radio", checked: option.checked, onChange: (event) => props.filterListProps.handleChange(event.target.value) }),
|
|
34
|
-
react_1.default.createElement("span", { className: "rs__filter__list-item-key" }, option.
|
|
34
|
+
react_1.default.createElement("span", { className: "rs__filter__list-item-key" }, option.label),
|
|
35
35
|
react_1.default.createElement("span", { className: "rs__filter__list-item-count" },
|
|
36
36
|
"(",
|
|
37
37
|
option.doc_count,
|
|
@@ -42,7 +42,7 @@ const ExampleFilterListCheckbox = (props) => {
|
|
|
42
42
|
return (react_1.default.createElement("ul", { className: "rs__filter__list" }, props.filterListProps.options.map((option) => (react_1.default.createElement("li", { key: option.key, className: `rs__filter__list-item ${option.checked ? "rs__filter__list-item-active" : ""}` },
|
|
43
43
|
react_1.default.createElement("label", { className: "rs__filter__list-item-label" },
|
|
44
44
|
react_1.default.createElement("input", { className: "rs__filter__list-item-input", value: option.key, type: "checkbox", checked: option.checked, onChange: (event) => props.filterListProps.handleChange(event.target.value) }),
|
|
45
|
-
react_1.default.createElement("span", { className: "rs__filter__list-item-key" }, option.
|
|
45
|
+
react_1.default.createElement("span", { className: "rs__filter__list-item-key" }, option.label),
|
|
46
46
|
react_1.default.createElement("span", { className: "rs__filter__list-item-count" },
|
|
47
47
|
"(",
|
|
48
48
|
option.doc_count,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleFilterList.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterList.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,iBAAiB,GAAqC,CAAC,KAAK,EAAE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,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO;gBACzC,eAAe,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO;aACpD,EACD,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,IAE5D,MAAM,CAAC,GAAG,CACP,CACF,CACP,CAAC,CACE,CACP,CAAC;AACJ,CAAC,CAAC;AA1CW,QAAA,oBAAoB,wBA0C/B","sourcesContent":["import React from \"react\";\n\nimport { FilterProps } from \"../../components\";\n\nexport type ExampleFilterListProps = React.ComponentProps<\n NonNullable<FilterProps[\"renderFilterList\"]>\n>;\n\nexport const ExampleFilterList: React.FC<ExampleFilterListProps> = (props) => {\n return (\n <div className=\"rs__filter\">\n <h3 className=\"rs__filter__name\">{props.filter.name}</h3>\n {props.filter.displayView === \"list\" ? (\n <ExampleFilterListList {...props} />\n ) : null}\n {props.filter.displayType === \"single\" &&\n props.filter.displayView === \"check\" ? (\n <ExampleFilterListRadio {...props} />\n ) : null}\n {props.filter.displayType === \"multi\" &&\n props.filter.displayView === \"check\" ? (\n <ExampleFilterListCheckbox {...props} />\n ) : null}\n {props.filter.displayView === \"swatch\" ? (\n <ExampleFilterListSwatch {...props} />\n ) : null}\n {props.filter.displayView === \"box\" ? (\n <ExampleFilterListBox {...props} />\n ) : null}\n </div>\n );\n};\n\nexport const ExampleFilterListList: React.FC<ExampleFilterListProps> = (\n props\n) => {\n return (\n <ul className=\"rs__filter__list\">\n {props.filterListProps.options.map((option) => (\n <li\n key={option.key}\n className={`rs__filter__list-item ${\n option.checked ? \"rs__filter__list-item-active\" : \"\"\n }`}\n >\n <label\n className=\"rs__filter__list-item-label\"\n onClick={() => props.filterListProps.handleChange(option.key)}\n >\n <span className=\"rs__filter__list-item-key\">{option.key}</span>\n <span className=\"rs__filter__list-item-count\">\n ({option.doc_count})\n </span>\n </label>\n </li>\n ))}\n </ul>\n );\n};\n\nexport const ExampleFilterListRadio: React.FC<ExampleFilterListProps> = (\n props\n) => {\n return (\n <ul className=\"rs__filter__list\">\n {props.filterListProps.options.map((option) => (\n <li\n key={option.key}\n className={`rs__filter__list-item ${\n option.checked ? \"rs__filter__list-item-active\" : \"\"\n }`}\n >\n <label className=\"rs__filter__list-item-label\">\n <input\n className=\"rs__filter__list-item-input\"\n value={option.key}\n type=\"radio\"\n checked={option.checked}\n onChange={(event) =>\n props.filterListProps.handleChange(event.target.value)\n }\n />\n <span className=\"rs__filter__list-item-key\">{option.key}</span>\n <span className=\"rs__filter__list-item-count\">\n ({option.doc_count})\n </span>\n </label>\n </li>\n ))}\n </ul>\n );\n};\n\nexport const ExampleFilterListCheckbox: React.FC<ExampleFilterListProps> = (\n props\n) => {\n return (\n <ul className=\"rs__filter__list\">\n {props.filterListProps.options.map((option) => (\n <li\n key={option.key}\n className={`rs__filter__list-item ${\n option.checked ? \"rs__filter__list-item-active\" : \"\"\n }`}\n >\n <label className=\"rs__filter__list-item-label\">\n <input\n className=\"rs__filter__list-item-input\"\n value={option.key}\n type=\"checkbox\"\n checked={option.checked}\n onChange={(event) =>\n props.filterListProps.handleChange(event.target.value)\n }\n />\n <span className=\"rs__filter__list-item-key\">{option.key}</span>\n <span className=\"rs__filter__list-item-count\">\n ({option.doc_count})\n </span>\n </label>\n </li>\n ))}\n </ul>\n );\n};\n\nexport const ExampleFilterListSwatch: React.FC<ExampleFilterListProps> = (\n props\n) => {\n return (\n <div\n className=\"rs__filter__list\"\n style={{\n display: \"flex\",\n flexWrap: \"wrap\",\n }}\n >\n {props.filterListProps.options.map((option) => (\n <div\n key={option.key}\n className={`rs__filter__list-item ${\n option.checked ? \"rs__filter__list-item-active\" : \"\"\n }`}\n >\n <div\n className=\"rs__filter__list-item-label\"\n style={{\n display: \"inline-block\",\n width: \"20px\",\n height: \"20px\",\n marginRight: \"2px\",\n marginBottom: \"2px\",\n borderRadius: \"50%\",\n backgroundColor: option.key,\n border: option.checked\n ? \"1px solid black\"\n : \"1px solid transparent\",\n }}\n onClick={() => props.filterListProps.handleChange(option.key)}\n />\n </div>\n ))}\n </div>\n );\n};\n\nexport const ExampleFilterListBox: React.FC<ExampleFilterListProps> = (\n props\n) => {\n return (\n <div\n className=\"rs__filter__list\"\n style={{\n display: \"flex\",\n flexWrap: \"wrap\",\n }}\n >\n {props.filterListProps.options.map((option) => (\n <div\n key={option.key}\n className={`rs__filter__list-item ${\n option.checked ? \"rs__filter__list-item-active\" : \"\"\n }`}\n >\n <div\n className=\"rs__filter__list-item-label\"\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n width: \"40px\",\n height: \"40px\",\n marginRight: \"2px\",\n marginBottom: \"2px\",\n border: \"1px solid black\",\n overflow: \"hidden\",\n cursor: \"pointer\",\n color: option.checked ? \"white\" : \"black\",\n backgroundColor: option.checked ? \"black\" : \"white\",\n }}\n onClick={() => props.filterListProps.handleChange(option.key)}\n >\n {option.key}\n </div>\n </div>\n ))}\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"ExampleFilterList.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterList.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,iBAAiB,GAAqC,CAAC,KAAK,EAAE,EAAE;IAC3E,OAAO,CACL,uCAAK,SAAS,EAAC,YAAY;QACzB,sCAAI,SAAS,EAAC,kBAAkB,IAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAM;QACxD,KAAK,CAAC,MAAM,CAAC,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,CACrC,8BAAC,6BAAqB,oBAAK,KAAK,EAAI,CACrC,CAAC,CAAC,CAAC,IAAI;QACP,KAAK,CAAC,MAAM,CAAC,WAAW,KAAK,QAAQ;YACtC,KAAK,CAAC,MAAM,CAAC,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,CACrC,8BAAC,8BAAsB,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port type ExampleFilterListProps = React.ComponentProps<\n NonNullable<FilterProps[\"renderFilterList\"]>\n>;\n\nexport const ExampleFilterList: React.FC<ExampleFilterListProps> = (props) => {\n return (\n <div className=\"rs__filter\">\n <h3 className=\"rs__filter__name\">{props.filter.name}</h3>\n {props.filter.displayView === \"list\" ? (\n <ExampleFilterListList {...props} />\n ) : null}\n {props.filter.displayType === \"single\" &&\n props.filter.displayView === \"check\" ? (\n <ExampleFilterListRadio {...props} />\n ) : null}\n {props.filter.displayType === \"multi\" &&\n props.filter.displayView === \"check\" ? (\n <ExampleFilterListCheckbox {...props} />\n ) : null}\n {props.filter.displayView === \"swatch\" ? (\n <ExampleFilterListSwatch {...props} />\n ) : null}\n {props.filter.displayView === \"box\" ? (\n <ExampleFilterListBox {...props} />\n ) : null}\n </div>\n );\n};\n\nexport const ExampleFilterListList: React.FC<ExampleFilterListProps> = (\n props\n) => {\n return (\n <ul className=\"rs__filter__list\">\n {props.filterListProps.options.map((option) => (\n <li\n key={option.key}\n className={`rs__filter__list-item ${\n option.checked ? \"rs__filter__list-item-active\" : \"\"\n }`}\n >\n <label\n className=\"rs__filter__list-item-label\"\n onClick={() => props.filterListProps.handleChange(option.key)}\n >\n <span className=\"rs__filter__list-item-key\">{option.label}</span>\n <span className=\"rs__filter__list-item-count\">\n ({option.doc_count})\n </span>\n </label>\n </li>\n ))}\n </ul>\n );\n};\n\nexport const ExampleFilterListRadio: React.FC<ExampleFilterListProps> = (\n props\n) => {\n return (\n <ul className=\"rs__filter__list\">\n {props.filterListProps.options.map((option) => (\n <li\n key={option.key}\n className={`rs__filter__list-item ${\n option.checked ? \"rs__filter__list-item-active\" : \"\"\n }`}\n >\n <label className=\"rs__filter__list-item-label\">\n <input\n className=\"rs__filter__list-item-input\"\n value={option.key}\n type=\"radio\"\n checked={option.checked}\n onChange={(event) =>\n props.filterListProps.handleChange(event.target.value)\n }\n />\n <span className=\"rs__filter__list-item-key\">{option.label}</span>\n <span className=\"rs__filter__list-item-count\">\n ({option.doc_count})\n </span>\n </label>\n </li>\n ))}\n </ul>\n );\n};\n\nexport const ExampleFilterListCheckbox: React.FC<ExampleFilterListProps> = (\n props\n) => {\n return (\n <ul className=\"rs__filter__list\">\n {props.filterListProps.options.map((option) => (\n <li\n key={option.key}\n className={`rs__filter__list-item ${\n option.checked ? \"rs__filter__list-item-active\" : \"\"\n }`}\n >\n <label className=\"rs__filter__list-item-label\">\n <input\n className=\"rs__filter__list-item-input\"\n value={option.key}\n type=\"checkbox\"\n checked={option.checked}\n onChange={(event) =>\n props.filterListProps.handleChange(event.target.value)\n }\n />\n <span className=\"rs__filter__list-item-key\">{option.label}</span>\n <span className=\"rs__filter__list-item-count\">\n ({option.doc_count})\n </span>\n </label>\n </li>\n ))}\n </ul>\n );\n};\n\nexport const ExampleFilterListSwatch: React.FC<ExampleFilterListProps> = (\n props\n) => {\n return (\n <div\n className=\"rs__filter__list\"\n style={{\n display: \"flex\",\n flexWrap: \"wrap\",\n }}\n >\n {props.filterListProps.options.map((option) => (\n <div\n key={option.key}\n className={`rs__filter__list-item ${\n option.checked ? \"rs__filter__list-item-active\" : \"\"\n }`}\n >\n <div\n className=\"rs__filter__list-item-label\"\n style={{\n display: \"inline-block\",\n width: \"20px\",\n height: \"20px\",\n marginRight: \"2px\",\n marginBottom: \"2px\",\n borderRadius: \"50%\",\n backgroundColor: option.key,\n border: option.checked\n ? \"1px solid black\"\n : \"1px solid transparent\",\n }}\n onClick={() => props.filterListProps.handleChange(option.key)}\n />\n </div>\n ))}\n </div>\n );\n};\n\nexport const ExampleFilterListBox: React.FC<ExampleFilterListProps> = (\n props\n) => {\n return (\n <div\n className=\"rs__filter__list\"\n style={{\n display: \"flex\",\n flexWrap: \"wrap\",\n }}\n >\n {props.filterListProps.options.map((option) => (\n <div\n key={option.key}\n className={`rs__filter__list-item ${\n option.checked ? \"rs__filter__list-item-active\" : \"\"\n }`}\n >\n <div\n className=\"rs__filter__list-item-label\"\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n width: \"40px\",\n height: \"40px\",\n marginRight: \"2px\",\n marginBottom: \"2px\",\n border: \"1px solid black\",\n overflow: \"hidden\",\n cursor: \"pointer\",\n color: option.checked ? \"white\" : \"black\",\n backgroundColor: option.checked ? \"black\" : \"white\",\n }}\n onClick={() => props.filterListProps.handleChange(option.key)}\n >\n {option.key}\n </div>\n </div>\n ))}\n </div>\n );\n};\n"]}
|
|
@@ -11,7 +11,7 @@ const ExampleFilterRange = (props) => {
|
|
|
11
11
|
react_1.default.createElement("ul", { className: "rs__filter__list" }, props.filterRangeProps.options.map((option) => (react_1.default.createElement("li", { key: option.key, className: "rs__filter__list-item" },
|
|
12
12
|
react_1.default.createElement("label", { className: "rs__filter__list-item-label" },
|
|
13
13
|
react_1.default.createElement("input", { className: "rs__filter__list-item-input", value: option.key, type: "radio", checked: option.checked, onChange: (event) => props.filterRangeProps.handleChange(event.target.value) }),
|
|
14
|
-
react_1.default.createElement("span", { className: "rs__filter__list-item-key" }, option.
|
|
14
|
+
react_1.default.createElement("span", { className: "rs__filter__list-item-key" }, option.label))))))));
|
|
15
15
|
};
|
|
16
16
|
exports.ExampleFilterRange = ExampleFilterRange;
|
|
17
17
|
//# sourceMappingURL=ExampleFilterRange.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleFilterRange.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterRange.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;
|
|
1
|
+
{"version":3,"file":"ExampleFilterRange.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilterRange.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,kBAAkB,GAAsC,CACnE,KAAK,EACL,EAAE;IACF,OAAO,CACL,uCAAK,SAAS,EAAC,YAAY;QACzB,sCAAI,SAAS,EAAC,kBAAkB,IAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAM;QACzD,sCAAI,SAAS,EAAC,kBAAkB,IAC7B,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC9C,sCAAI,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,SAAS,EAAC,uBAAuB;YACpD,yCAAO,SAAS,EAAC,6BAA6B;gBAC5C,yCACE,SAAS,EAAC,6BAA6B,EACvC,KAAK,EAAE,MAAM,CAAC,GAAG,EACjB,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,MAAM,CAAC,OAAO,EACvB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAClB,KAAK,CAAC,gBAAgB,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,GAEzD;gBACF,wCAAM,SAAS,EAAC,2BAA2B,IAAE,MAAM,CAAC,KAAK,CAAQ,CAC3D,CACL,CACN,CAAC,CACC,CACD,CACP,CAAC;AACJ,CAAC,CAAC;AA1BW,QAAA,kBAAkB,sBA0B7B","sourcesContent":["import React from \"react\";\n\nimport { FilterProps } from \"../../components\";\n\nexport type ExampleFilterRangeProps = React.ComponentProps<\n NonNullable<FilterProps[\"renderFilterRange\"]>\n>;\n\nexport const ExampleFilterRange: React.FC<ExampleFilterRangeProps> = (\n props\n) => {\n return (\n <div className=\"rs__filter\">\n <h3 className=\"rs__filter__name\">{props.filter.name}</h3>\n <ul className=\"rs__filter__list\">\n {props.filterRangeProps.options.map((option) => (\n <li key={option.key} className=\"rs__filter__list-item\">\n <label className=\"rs__filter__list-item-label\">\n <input\n className=\"rs__filter__list-item-input\"\n value={option.key}\n type=\"radio\"\n checked={option.checked}\n onChange={(event) =>\n props.filterRangeProps.handleChange(event.target.value)\n }\n />\n <span className=\"rs__filter__list-item-key\">{option.label}</span>\n </label>\n </li>\n ))}\n </ul>\n </div>\n );\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FiltersProps } from "../../components";
|
|
3
|
-
export declare type ExampleFiltersProps = React.ComponentProps<NonNullable<FiltersProps["
|
|
3
|
+
export declare type ExampleFiltersProps = React.ComponentProps<NonNullable<FiltersProps["render"]>>;
|
|
4
4
|
export declare const ExampleFilters: React.FC<ExampleFiltersProps>;
|
|
@@ -8,7 +8,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const components_1 = require("../../components");
|
|
9
9
|
const ExampleFilters = (props) => {
|
|
10
10
|
var _a;
|
|
11
|
-
return (react_1.default.createElement(react_1.default.Fragment, null, (_a = props.
|
|
11
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, (_a = props.filters) === null || _a === void 0 ? void 0 : _a.map((filter) => (react_1.default.createElement(components_1.Filter, { key: filter.id, filter: filter })))));
|
|
12
12
|
};
|
|
13
13
|
exports.ExampleFilters = ExampleFilters;
|
|
14
14
|
//# sourceMappingURL=ExampleFilters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleFilters.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilters.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAAwD;AAMjD,MAAM,cAAc,GAAkC,CAAC,KAAK,EAAE,EAAE;;IACrE,OAAO,CACL,8DACG,MAAA,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"ExampleFilters.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFilters.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAAwD;AAMjD,MAAM,cAAc,GAAkC,CAAC,KAAK,EAAE,EAAE;;IACrE,OAAO,CACL,8DACG,MAAA,KAAK,CAAC,OAAO,0CAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC9B,8BAAC,mBAAM,IAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,GAAI,CAC3C,CAAC,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AARW,QAAA,cAAc,kBAQzB","sourcesContent":["import React from \"react\";\n\nimport { Filter, FiltersProps } from \"../../components\";\n\nexport type ExampleFiltersProps = React.ComponentProps<\n NonNullable<FiltersProps[\"render\"]>\n>;\n\nexport const ExampleFilters: React.FC<ExampleFiltersProps> = (props) => {\n return (\n <>\n {props.filters?.map((filter) => (\n <Filter key={filter.id} filter={filter} />\n ))}\n </>\n );\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FiltersActiveProps } from "../../components";
|
|
3
|
-
export declare type ExampleFiltersActiveProps = React.ComponentProps<NonNullable<FiltersActiveProps["
|
|
3
|
+
export declare type ExampleFiltersActiveProps = React.ComponentProps<NonNullable<FiltersActiveProps["render"]>>;
|
|
4
4
|
export declare const ExampleFiltersActive: React.FC<ExampleFiltersActiveProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleFiltersActive.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFiltersActive.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,oBAAoB,GAAwC,CACvE,KAAK,EACL,EAAE;IACF,OAAO,CACL,uCAAK,SAAS,EAAC,mBAAmB;QAChC,sCAAI,SAAS,EAAC,yBAAyB,IAAE,gBAAgB,CAAM;QAC/D,sCAAI,SAAS,EAAC,yBAAyB,IACpC,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC,CAC7C,sCAAI,GAAG,EAAE,cAAc,CAAC,GAAG,EAAE,SAAS,EAAC,8BAA8B;YACnE,yCACE,SAAS,EAAC,oCAAoC,EAC9C,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,GAAG,CAAC;gBAErD,wCAAM,SAAS,EAAC,oCAAoC;oBACjD,cAAc,CAAC,KAAK;oBACpB,IAAI,CACA;gBACP,wCAAM,SAAS,EAAC,oCAAoC,IACjD,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC;oBAClC,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;oBACjC,CAAC,CAAC,OAAO,cAAc,CAAC,KAAK,KAAK,QAAQ;wBAC1C,CAAC,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,KAAK,IAAI,cAAc,CAAC,KAAK,CAAC,GAAG,EAAE;wBAC7D,CAAC,CAAC,cAAc,CAAC,KAAK,CACnB,CACD,CACL,CACN,CAAC,CACC,CACD,CACP,CAAC;AACJ,CAAC,CAAC;AA9BW,QAAA,oBAAoB,wBA8B/B","sourcesContent":["import React from \"react\";\n\nimport { FiltersActiveProps } from \"../../components\";\n\nexport type ExampleFiltersActiveProps = React.ComponentProps<\n NonNullable<FiltersActiveProps[\"
|
|
1
|
+
{"version":3,"file":"ExampleFiltersActive.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleFiltersActive.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,oBAAoB,GAAwC,CACvE,KAAK,EACL,EAAE;IACF,OAAO,CACL,uCAAK,SAAS,EAAC,mBAAmB;QAChC,sCAAI,SAAS,EAAC,yBAAyB,IAAE,gBAAgB,CAAM;QAC/D,sCAAI,SAAS,EAAC,yBAAyB,IACpC,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC,CAC7C,sCAAI,GAAG,EAAE,cAAc,CAAC,GAAG,EAAE,SAAS,EAAC,8BAA8B;YACnE,yCACE,SAAS,EAAC,oCAAoC,EAC9C,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,GAAG,CAAC;gBAErD,wCAAM,SAAS,EAAC,oCAAoC;oBACjD,cAAc,CAAC,KAAK;oBACpB,IAAI,CACA;gBACP,wCAAM,SAAS,EAAC,oCAAoC,IACjD,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC;oBAClC,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;oBACjC,CAAC,CAAC,OAAO,cAAc,CAAC,KAAK,KAAK,QAAQ;wBAC1C,CAAC,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,KAAK,IAAI,cAAc,CAAC,KAAK,CAAC,GAAG,EAAE;wBAC7D,CAAC,CAAC,cAAc,CAAC,KAAK,CACnB,CACD,CACL,CACN,CAAC,CACC,CACD,CACP,CAAC;AACJ,CAAC,CAAC;AA9BW,QAAA,oBAAoB,wBA8B/B","sourcesContent":["import React from \"react\";\n\nimport { FiltersActiveProps } from \"../../components\";\n\nexport type ExampleFiltersActiveProps = React.ComponentProps<\n NonNullable<FiltersActiveProps[\"render\"]>\n>;\n\nexport const ExampleFiltersActive: React.FC<ExampleFiltersActiveProps> = (\n props\n) => {\n return (\n <div className=\"rs__filter-active\">\n <h3 className=\"rs__filter-active__name\">{\"Filters Active\"}</h3>\n <ul className=\"rs__filter-active__list\">\n {props.selectedFilters.map((selectedFilter) => (\n <li key={selectedFilter.key} className=\"rs__filter-active__list-item\">\n <label\n className=\"rs__filter-active__list-item-label\"\n onClick={() => props.handleRemove(selectedFilter.key)}\n >\n <span className=\"rs__filter-active__list-item-label\">\n {selectedFilter.label}\n {\": \"}\n </span>\n <span className=\"rs__filter-active__list-item-value\">\n {Array.isArray(selectedFilter.value)\n ? selectedFilter.value.join(\", \")\n : typeof selectedFilter.value !== \"string\"\n ? `${selectedFilter.value.start}-${selectedFilter.value.end}`\n : selectedFilter.value}\n </span>\n </label>\n </li>\n ))}\n </ul>\n </div>\n );\n};\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ExampleHookUseFilters = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const hooks_1 = require("../../hooks");
|
|
9
|
+
const components_1 = require("../../components");
|
|
10
|
+
const ExampleHookUseFilters = () => {
|
|
11
|
+
var _a;
|
|
12
|
+
const filtersHook = (0, hooks_1.useFilters)();
|
|
13
|
+
return (react_1.default.createElement("div", null,
|
|
14
|
+
react_1.default.createElement("h1", null, "Filters"), (_a = filtersHook.filters) === null || _a === void 0 ? void 0 :
|
|
15
|
+
_a.map((filter) => (react_1.default.createElement("div", null,
|
|
16
|
+
react_1.default.createElement("h3", null, filter.name),
|
|
17
|
+
react_1.default.createElement(components_1.Filter, { key: filter.id, filter: filter }))))));
|
|
18
|
+
};
|
|
19
|
+
exports.ExampleHookUseFilters = ExampleHookUseFilters;
|
|
20
|
+
//# sourceMappingURL=ExampleHookUseFilters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleHookUseFilters.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleHookUseFilters.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,uCAAyC;AACzC,iDAA0C;AAEnC,MAAM,qBAAqB,GAAa,GAAG,EAAE;;IAClD,MAAM,WAAW,GAAG,IAAA,kBAAU,GAAE,CAAC;IAEjC,OAAO,CACL;QACE,0CAAK,SAAS,CAAM,EACnB,MAAA,WAAW,CAAC,OAAO;WAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACpC;YACE,0CAAK,MAAM,CAAC,IAAI,CAAM;YACtB,8BAAC,mBAAM,IAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,GAAI,CACtC,CACP,CAAC,CACE,CACP,CAAC;AACJ,CAAC,CAAC;AAdW,QAAA,qBAAqB,yBAchC","sourcesContent":["import React from \"react\";\n\nimport { useFilters } from \"../../hooks\";\nimport { Filter } from \"../../components\";\n\nexport const ExampleHookUseFilters: React.FC = () => {\n const filtersHook = useFilters();\n\n return (\n <div>\n <h1>{\"Filters\"}</h1>\n {filtersHook.filters?.map((filter) => (\n <div>\n <h3>{filter.name}</h3>\n <Filter key={filter.id} filter={filter} />\n </div>\n ))}\n </div>\n );\n};\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ExampleHookUseSearch = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const hooks_1 = require("../../hooks");
|
|
9
|
+
const ExampleHookUseSearch = () => {
|
|
10
|
+
const searchHook = (0, hooks_1.useSearch)();
|
|
11
|
+
const handleFormSubmit = react_1.default.useCallback((event) => {
|
|
12
|
+
event.preventDefault();
|
|
13
|
+
searchHook.submitSearchTerm();
|
|
14
|
+
}, [searchHook.submitSearchTerm]);
|
|
15
|
+
const handleInputChange = react_1.default.useCallback((event) => {
|
|
16
|
+
searchHook.setSearchTerm(event.target.value);
|
|
17
|
+
}, [searchHook.setSearchTerm]);
|
|
18
|
+
return (react_1.default.createElement("form", { onSubmit: handleFormSubmit },
|
|
19
|
+
react_1.default.createElement("input", { type: "text", value: searchHook.searchTerm, onChange: handleInputChange })));
|
|
20
|
+
};
|
|
21
|
+
exports.ExampleHookUseSearch = ExampleHookUseSearch;
|
|
22
|
+
//# sourceMappingURL=ExampleHookUseSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleHookUseSearch.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleHookUseSearch.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,uCAAwC;AAEjC,MAAM,oBAAoB,GAAa,GAAG,EAAE;IACjD,MAAM,UAAU,GAAG,IAAA,iBAAS,GAAE,CAAC;IAE/B,MAAM,gBAAgB,GAAG,eAAK,CAAC,WAAW,CACxC,CAAC,KAAuC,EAAE,EAAE;QAC1C,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,UAAU,CAAC,gBAAgB,EAAE,CAAC;IAChC,CAAC,EACD,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAC9B,CAAC;IAEF,MAAM,iBAAiB,GAAG,eAAK,CAAC,WAAW,CACzC,CAAC,KAA0C,EAAE,EAAE;QAC7C,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC,EACD,CAAC,UAAU,CAAC,aAAa,CAAC,CAC3B,CAAC;IAEF,OAAO,CACL,wCAAM,QAAQ,EAAE,gBAAgB;QAC9B,yCACE,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,UAAU,CAAC,UAAU,EAC5B,QAAQ,EAAE,iBAAiB,GAC3B,CACG,CACR,CAAC;AACJ,CAAC,CAAC;AA3BW,QAAA,oBAAoB,wBA2B/B","sourcesContent":["import React from \"react\";\n\nimport { useSearch } from \"../../hooks\";\n\nexport const ExampleHookUseSearch: React.FC = () => {\n const searchHook = useSearch();\n\n const handleFormSubmit = React.useCallback(\n (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n searchHook.submitSearchTerm();\n },\n [searchHook.submitSearchTerm]\n );\n\n const handleInputChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n searchHook.setSearchTerm(event.target.value);\n },\n [searchHook.setSearchTerm]\n );\n\n return (\n <form onSubmit={handleFormSubmit}>\n <input\n type=\"text\"\n value={searchHook.searchTerm}\n onChange={handleInputChange}\n />\n </form>\n );\n};\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ExampleHookUseSortBy = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const hooks_1 = require("../../hooks");
|
|
9
|
+
const ExampleHookUseSortBy = () => {
|
|
10
|
+
var _a;
|
|
11
|
+
const sortByHook = (0, hooks_1.useSortBy)();
|
|
12
|
+
const handleSelectChange = react_1.default.useCallback((event) => {
|
|
13
|
+
sortByHook.setSortOption(event.target.value);
|
|
14
|
+
}, [sortByHook.setSortOption]);
|
|
15
|
+
return (react_1.default.createElement("select", { value: (_a = sortByHook.sortOption) === null || _a === void 0 ? void 0 : _a.handle, onChange: handleSelectChange }, sortByHook.sortOptions.map((sortOption) => (react_1.default.createElement("option", { key: sortOption.handle, value: sortOption.handle }, sortOption.name)))));
|
|
16
|
+
};
|
|
17
|
+
exports.ExampleHookUseSortBy = ExampleHookUseSortBy;
|
|
18
|
+
//# sourceMappingURL=ExampleHookUseSortBy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleHookUseSortBy.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleHookUseSortBy.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,uCAAwC;AAEjC,MAAM,oBAAoB,GAAa,GAAG,EAAE;;IACjD,MAAM,UAAU,GAAG,IAAA,iBAAS,GAAE,CAAC;IAE/B,MAAM,kBAAkB,GAAG,eAAK,CAAC,WAAW,CAC1C,CAAC,KAA2C,EAAE,EAAE;QAC9C,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC,EACD,CAAC,UAAU,CAAC,aAAa,CAAC,CAC3B,CAAC;IAEF,OAAO,CACL,0CAAQ,KAAK,EAAE,MAAA,UAAU,CAAC,UAAU,0CAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,IACvE,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAC1C,0CAAQ,GAAG,EAAE,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,MAAM,IACrD,UAAU,CAAC,IAAI,CACT,CACV,CAAC,CACK,CACV,CAAC;AACJ,CAAC,CAAC;AAnBW,QAAA,oBAAoB,wBAmB/B","sourcesContent":["import React from \"react\";\n\nimport { useSortBy } from \"../../hooks\";\n\nexport const ExampleHookUseSortBy: React.FC = () => {\n const sortByHook = useSortBy();\n\n const handleSelectChange = React.useCallback(\n (event: React.ChangeEvent<HTMLSelectElement>) => {\n sortByHook.setSortOption(event.target.value);\n },\n [sortByHook.setSortOption]\n );\n\n return (\n <select value={sortByHook.sortOption?.handle} onChange={handleSelectChange}>\n {sortByHook.sortOptions.map((sortOption) => (\n <option key={sortOption.handle} value={sortOption.handle}>\n {sortOption.name}\n </option>\n ))}\n </select>\n );\n};\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.ExampleReactiveSearchProviderCollection = void 0;
|
|
23
|
+
const React = __importStar(require("react"));
|
|
24
|
+
const components_1 = require("../../components");
|
|
25
|
+
const ExampleReactiveSearchProviderCollection = () => (React.createElement(components_1.ReactifySearchProvider, { mode: "collection", shopifyPermanentDomain: "reactify-apps.myshopify.com", collectionHandle: "example-collection" }, "..."));
|
|
26
|
+
exports.ExampleReactiveSearchProviderCollection = ExampleReactiveSearchProviderCollection;
|
|
27
|
+
//# sourceMappingURL=ExampleReactiveSearchProviderCollection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleReactiveSearchProviderCollection.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleReactiveSearchProviderCollection.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAE/B,iDAA0D;AAEnD,MAAM,uCAAuC,GAAa,GAAG,EAAE,CAAC,CACrE,oBAAC,mCAAsB,IACrB,IAAI,EAAC,YAAY,EACjB,sBAAsB,EAAC,6BAA6B,EACpD,gBAAgB,EAAC,oBAAoB,UAGd,CAC1B,CAAC;AARW,QAAA,uCAAuC,2CAQlD","sourcesContent":["import * as React from \"react\";\n\nimport { ReactifySearchProvider } from \"../../components\";\n\nexport const ExampleReactiveSearchProviderCollection: React.FC = () => (\n <ReactifySearchProvider\n mode=\"collection\"\n shopifyPermanentDomain=\"reactify-apps.myshopify.com\"\n collectionHandle=\"example-collection\"\n >\n ...\n </ReactifySearchProvider>\n);\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.ExampleReactiveSearchProviderInstantSearch = void 0;
|
|
23
|
+
const React = __importStar(require("react"));
|
|
24
|
+
const components_1 = require("../../components");
|
|
25
|
+
const ExampleReactiveSearchProviderInstantSearch = () => (React.createElement(components_1.ReactifySearchProvider, { mode: "instant-search", shopifyPermanentDomain: "reactify-apps.myshopify.com" }, "..."));
|
|
26
|
+
exports.ExampleReactiveSearchProviderInstantSearch = ExampleReactiveSearchProviderInstantSearch;
|
|
27
|
+
//# sourceMappingURL=ExampleReactiveSearchProviderInstantSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleReactiveSearchProviderInstantSearch.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleReactiveSearchProviderInstantSearch.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAE/B,iDAA0D;AAEnD,MAAM,0CAA0C,GAAa,GAAG,EAAE,CAAC,CACxE,oBAAC,mCAAsB,IACrB,IAAI,EAAC,gBAAgB,EACrB,sBAAsB,EAAC,6BAA6B,UAG7B,CAC1B,CAAC;AAPW,QAAA,0CAA0C,8CAOrD","sourcesContent":["import * as React from \"react\";\n\nimport { ReactifySearchProvider } from \"../../components\";\n\nexport const ExampleReactiveSearchProviderInstantSearch: React.FC = () => (\n <ReactifySearchProvider\n mode=\"instant-search\"\n shopifyPermanentDomain=\"reactify-apps.myshopify.com\"\n >\n ...\n </ReactifySearchProvider>\n);\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.ExampleReactiveSearchProviderSearch = void 0;
|
|
23
|
+
const React = __importStar(require("react"));
|
|
24
|
+
const components_1 = require("../../components");
|
|
25
|
+
const ExampleReactiveSearchProviderSearch = () => (React.createElement(components_1.ReactifySearchProvider, { mode: "search", shopifyPermanentDomain: "reactify-apps.myshopify.com" }, "..."));
|
|
26
|
+
exports.ExampleReactiveSearchProviderSearch = ExampleReactiveSearchProviderSearch;
|
|
27
|
+
//# sourceMappingURL=ExampleReactiveSearchProviderSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleReactiveSearchProviderSearch.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleReactiveSearchProviderSearch.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAE/B,iDAA0D;AAEnD,MAAM,mCAAmC,GAAa,GAAG,EAAE,CAAC,CACjE,oBAAC,mCAAsB,IACrB,IAAI,EAAC,QAAQ,EACb,sBAAsB,EAAC,6BAA6B,UAG7B,CAC1B,CAAC;AAPW,QAAA,mCAAmC,uCAO9C","sourcesContent":["import * as React from \"react\";\n\nimport { ReactifySearchProvider } from \"../../components\";\n\nexport const ExampleReactiveSearchProviderSearch: React.FC = () => (\n <ReactifySearchProvider\n mode=\"search\"\n shopifyPermanentDomain=\"reactify-apps.myshopify.com\"\n >\n ...\n </ReactifySearchProvider>\n);\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.Component = void 0;
|
|
23
|
+
const React = __importStar(require("react"));
|
|
24
|
+
const components_1 = require("../../components");
|
|
25
|
+
const ExampleResultCardProduct_1 = require("./ExampleResultCardProduct");
|
|
26
|
+
const ExampleResultCardCallout_1 = require("./ExampleResultCardCallout");
|
|
27
|
+
const ExampleResultPaginationNumbered_1 = require("./ExampleResultPaginationNumbered");
|
|
28
|
+
const ExampleResultPaginationLoadMore_1 = require("./ExampleResultPaginationLoadMore");
|
|
29
|
+
const ExampleResultPaginationNextPrev_1 = require("./ExampleResultPaginationNextPrev");
|
|
30
|
+
const Component = () => {
|
|
31
|
+
return (React.createElement(components_1.Results, { listStyle: {
|
|
32
|
+
display: "grid",
|
|
33
|
+
gap: "10px",
|
|
34
|
+
gridTemplateColumns: "repeat(4, minmax(0, 1fr))",
|
|
35
|
+
}, renderResultCardProduct: ExampleResultCardProduct_1.ExampleResultCardProduct, renderResultCardCallout: ExampleResultCardCallout_1.ExampleResultCardCallout, renderPaginationNumbered: ExampleResultPaginationNumbered_1.ExampleResultPaginationNumbered, renderPaginationLoadMore: ExampleResultPaginationLoadMore_1.ExampleResultPaginationLoadMore, renderPaginationNextPrev: ExampleResultPaginationNextPrev_1.ExampleResultPaginationNextPrev }));
|
|
36
|
+
};
|
|
37
|
+
exports.Component = Component;
|
|
38
|
+
//# sourceMappingURL=ExampleResults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleResults.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleResults.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAE/B,iDAA2C;AAE3C,yEAAsE;AACtE,yEAAsE;AACtE,uFAAoF;AACpF,uFAAoF;AACpF,uFAAoF;AAE7E,MAAM,SAAS,GAAa,GAAG,EAAE;IACtC,OAAO,CACL,oBAAC,oBAAO,IACN,SAAS,EAAE;YACT,OAAO,EAAE,MAAM;YACf,GAAG,EAAE,MAAM;YACX,mBAAmB,EAAE,2BAA2B;SACjD,EACD,uBAAuB,EAAE,mDAAwB,EACjD,uBAAuB,EAAE,mDAAwB,EACjD,wBAAwB,EAAE,iEAA+B,EACzD,wBAAwB,EAAE,iEAA+B,EACzD,wBAAwB,EAAE,iEAA+B,GACzD,CACH,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,SAAS,aAepB","sourcesContent":["import * as React from \"react\";\n\nimport { Results } from \"../../components\";\n\nimport { ExampleResultCardProduct } from \"./ExampleResultCardProduct\";\nimport { ExampleResultCardCallout } from \"./ExampleResultCardCallout\";\nimport { ExampleResultPaginationNumbered } from \"./ExampleResultPaginationNumbered\";\nimport { ExampleResultPaginationLoadMore } from \"./ExampleResultPaginationLoadMore\";\nimport { ExampleResultPaginationNextPrev } from \"./ExampleResultPaginationNextPrev\";\n\nexport const Component: React.FC = () => {\n return (\n <Results\n listStyle={{\n display: \"grid\",\n gap: \"10px\",\n gridTemplateColumns: \"repeat(4, minmax(0, 1fr))\",\n }}\n renderResultCardProduct={ExampleResultCardProduct}\n renderResultCardCallout={ExampleResultCardCallout}\n renderPaginationNumbered={ExampleResultPaginationNumbered}\n renderPaginationLoadMore={ExampleResultPaginationLoadMore}\n renderPaginationNextPrev={ExampleResultPaginationNextPrev}\n />\n );\n};\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ExampleSearch = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const ExampleSearch = (props) => {
|
|
9
|
+
const handleFormSubmit = react_1.default.useCallback((event) => {
|
|
10
|
+
event.preventDefault();
|
|
11
|
+
props.submitSearchTerm();
|
|
12
|
+
}, [props.submitSearchTerm]);
|
|
13
|
+
const handleInputChange = react_1.default.useCallback((event) => {
|
|
14
|
+
props.setSearchTerm(event.target.value);
|
|
15
|
+
}, [props.setSearchTerm]);
|
|
16
|
+
return (react_1.default.createElement("form", { onSubmit: handleFormSubmit },
|
|
17
|
+
react_1.default.createElement("input", { type: "text", placeholder: "Search terms...", value: props.searchTerm, onChange: handleInputChange })));
|
|
18
|
+
};
|
|
19
|
+
exports.ExampleSearch = ExampleSearch;
|
|
20
|
+
//# sourceMappingURL=ExampleSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExampleSearch.js","sourceRoot":"","sources":["../../../../src/components/Example/ExampleSearch.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAQnB,MAAM,aAAa,GAAiC,CAAC,KAAK,EAAE,EAAE;IACnE,MAAM,gBAAgB,GAAG,eAAK,CAAC,WAAW,CACxC,CAAC,KAAuC,EAAE,EAAE;QAC1C,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,gBAAgB,EAAE,CAAC;IAC3B,CAAC,EACD,CAAC,KAAK,CAAC,gBAAgB,CAAC,CACzB,CAAC;IAEF,MAAM,iBAAiB,GAAG,eAAK,CAAC,WAAW,CACzC,CAAC,KAA0C,EAAE,EAAE;QAC7C,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC,EACD,CAAC,KAAK,CAAC,aAAa,CAAC,CACtB,CAAC;IAEF,OAAO,CACL,wCAAM,QAAQ,EAAE,gBAAgB;QAC9B,yCACE,IAAI,EAAC,MAAM,EACX,WAAW,EAAC,iBAAiB,EAC7B,KAAK,EAAE,KAAK,CAAC,UAAU,EACvB,QAAQ,EAAE,iBAAiB,GAC3B,CACG,CACR,CAAC;AACJ,CAAC,CAAC;AA1BW,QAAA,aAAa,iBA0BxB","sourcesContent":["import React from \"react\";\n\nimport { SearchProps } from \"../../components\";\n\nexport type ExampleSearchProps = React.ComponentProps<\n NonNullable<SearchProps[\"render\"]>\n>;\n\nexport const ExampleSearch: React.FC<ExampleSearchProps> = (props) => {\n const handleFormSubmit = React.useCallback(\n (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n props.submitSearchTerm();\n },\n [props.submitSearchTerm]\n );\n\n const handleInputChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n props.setSearchTerm(event.target.value);\n },\n [props.setSearchTerm]\n );\n\n return (\n <form onSubmit={handleFormSubmit}>\n <input\n type=\"text\"\n placeholder=\"Search terms...\"\n value={props.searchTerm}\n onChange={handleInputChange}\n />\n </form>\n );\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SortByProps } from "../../components";
|
|
3
|
-
export declare type ExampleSortByProps = React.ComponentProps<NonNullable<SortByProps["
|
|
3
|
+
export declare type ExampleSortByProps = React.ComponentProps<NonNullable<SortByProps["render"]>>;
|
|
4
4
|
export declare const ExampleSortBy: React.FC<ExampleSortByProps>;
|