Permalink
Please sign in to comment.
Showing
with
83 additions
and 18 deletions.
- +1 −0 lib/src/components/index.d.ts
- +1 −0 lib/src/components/index.js
- +1 −1 lib/src/components/index.js.map
- +0 −1 lib/src/components/search/hits/src/Hits.d.ts
- +0 −6 lib/src/components/search/hits/src/Hits.js
- +1 −1 lib/src/components/search/hits/src/Hits.js.map
- +9 −0 lib/src/components/search/hits/src/NoHits.d.ts
- +28 −0 lib/src/components/search/hits/src/NoHits.js
- +1 −0 lib/src/components/search/hits/src/NoHits.js.map
- +4 −0 lib/src/components/search/hits/styles/no-hits.scss
- +1 −0 src/components/index.ts
- +0 −8 src/components/search/hits/src/Hits.tsx
- +31 −0 src/components/search/hits/src/NoHits.tsx
- +4 −0 src/components/search/hits/styles/no-hits.scss
- +1 −0 tsconfig.json
- +0 −1 webpack.test.config.js
1
lib/src/components/index.d.ts
1
lib/src/components/index.js
2
lib/src/components/index.js.map
@@ -1 +1 @@ | ||
-{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":";;;AAAA,iBAAc,6CAA6C,CAAC,EAAA;AAC5D,iBAAc,kEAAkE,CAAC,EAAA;AACjF,iBAAc,iDAAiD,CAAC,EAAA;AAChE,iBAAc,uDAAuD,CAAC,EAAA;AACtE,iBAAc,sEAAsE,CAAC,EAAA;AACrF,iBAAc,iFAAiF,CAAC,EAAA;AAChG,iBAAc,wBAAwB,CAAC,EAAA;AACvC,iBAAc,mCAAmC,CAAC,EAAA;AAClD,iBAAc,oCAAoC,CAAC,EAAA;AACnD,iBAAc,mCAAmC,CAAC,EAAA;AAClD,iBAAc,+CAA+C,CAAC,EAAA;AAC9D,iBAAc,kFAAkF,CAAC,EAAA"} | ||
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":";;;AAAA,iBAAc,6CAA6C,CAAC,EAAA;AAC5D,iBAAc,kEAAkE,CAAC,EAAA;AACjF,iBAAc,iDAAiD,CAAC,EAAA;AAChE,iBAAc,uDAAuD,CAAC,EAAA;AACtE,iBAAc,sEAAsE,CAAC,EAAA;AACrF,iBAAc,iFAAiF,CAAC,EAAA;AAChG,iBAAc,wBAAwB,CAAC,EAAA;AACvC,iBAAc,0BAA0B,CAAC,EAAA;AACzC,iBAAc,mCAAmC,CAAC,EAAA;AAClD,iBAAc,oCAAoC,CAAC,EAAA;AACnD,iBAAc,mCAAmC,CAAC,EAAA;AAClD,iBAAc,+CAA+C,CAAC,EAAA;AAC9D,iBAAc,kFAAkF,CAAC,EAAA"} |
1
lib/src/components/search/hits/src/Hits.d.ts
6
lib/src/components/search/hits/src/Hits.js
2
lib/src/components/search/hits/src/Hits.js.map
@@ -1 +1 @@ | ||
-{"version":3,"file":"Hits.js","sourceRoot":"","sources":["../../../../../../src/components/search/hits/src/Hits.tsx"],"names":["Hits","Hits.constructor","Hits.componentWillMount","Hits.defineAccessor","Hits.defineBEMBlocks","Hits.renderResult","Hits.renderInitialView","Hits.renderNoResults","Hits.render"],"mappings":";;;;;AAAA,IAAY,CAAC,WAAM,QAAQ,CAAC,CAAA;AAC5B,IAAY,KAAK,WAAM,OAAO,CAAC,CAAA;AAC/B,QAAO,sBAAsB,CAAC,CAAA;AAE9B,qBAMO,kBAEP,CAAC,CAFwB;AAOzB;IAA0BA,wBAAkCA;IAA5DA;QAA0BC,8BAAkCA;IAoE5DA,CAACA;IA1DAD,iCAAkBA,GAAlBA;QACCE,gBAAKA,CAACA,kBAAkBA,WAAEA,CAAAA;QAC1BA,EAAEA,CAAAA,CAACA,IAAIA,CAACA,KAAKA,CAACA,eAAeA,CAACA,CAACA,CAACA;YAC/BA,IAAIA,CAACA,SAASA,CAACA,WAAWA,CACzBA,IAAIA,wBAAiBA,CAACA,IAAIA,CAACA,KAAKA,CAACA,eAAeA,CAACA,CAACA,CAAAA;QACpDA,CAACA;IACFA,CAACA;IAEDF,6BAAcA,GAAdA;QACCG,MAAMA,CAACA,IAAIA,uBAAgBA,CAACA,IAAIA,CAAC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AA;QAElBA,EAAEA,CAACA,CAACA,IAAIA,CAACA,gBAAgBA,EAAEA,CAACA,CAACA,CAACA;YAC7BA,OAAOA,GAAGA,IAAIA,CAACA,iBAAiBA,EAAEA,CAAAA;QACnCA,CAACA;QAACA,IAAIA,CAACA,EAAEA,CAACA,CAACA,CAACA,OAAOA,CAACA,CAACA,CAACA;YACrBA,OAAOA,GAAGA,IAAIA,CAACA,eAAeA,EAAEA,CAAAA;QACjCA,CAACA;QAACA,IAAIA,CAACA,CAACA;YACPA,OAAOA,GAAGA,CAACA,CAACA,GAAGA,CAACA,IAAIA,EAAEA,IAAIA,CAACA,YAAYA,CAACA,IAAIA,CAACA,IAAIA,CAACA,CAACA,CAAAA;QACpDA,CAACA;QAEDA,MAAMA,CAACA,CACNA,qBAACA,GAAGA,KAACA,OAAOA,GAACA,MAAMA,GAACA,SAASA,GAAEA,IAAIA,CAACA,SAASA,CAACA,SAASA,EAAGA,GACxDA,OAAQA,CACDA,CACTA,CAACA;IACHA,CAACA;IAjEMR,cAASA,GAAGA,CAACA,CAACA,QAAQA,CAACA;QAC7BA,WAAWA,EAACA,KAAKA,CAACA,SAASA,CAACA,MAAMA,CAACA,UAAUA;QAC7CA,eAAeA,EAACA,KAAKA,CAACA,SAASA,CAACA,OAAOA,CACtCA,KAAKA,CAACA,SAASA,CAACA,MAAMA,CACtBA;KACDA,EAAEA,yBAAkBA,CAACA,SAASA,CAACA,CAAAA;IA6DjCA,WAACA;AAADA,CAACA,AApED,EAA0B,yBAAkB,EAoE3C;AApEY,YAAI,OAoEhB,CAAA"} | ||
+{"version":3,"file":"Hits.js","sourceRoot":"","sources":["../../../../../../src/components/search/hits/src/Hits.tsx"],"names":["Hits","Hits.constructor","Hits.componentWillMount","Hits.defineAccessor","Hits.defineBEMBlocks","Hits.renderResult","Hits.renderInitialView","Hits.render"],"mappings":";;;;;AAAA,IAAY,CAAC,WAAM,QAAQ,CAAC,CAAA;AAC5B,IAAY,KAAK,WAAM,OAAO,CAAC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CAACA,SAASA,CAACA,SAASA,CAACA,iBAAiBA,CAAEA,EAAOA,CAC7FA,CAAAA;IACFA,CAACA;IAEDN,qBAAMA,GAANA;QACCO,IAAIA,IAAIA,GAAiBA,IAAIA,CAACA,OAAOA,EAAEA,CAAAA;QACvCA,IAAIA,OAAOA,GAAGA,IAAIA,CAACA,MAAMA,GAAGA,CAACA,CAAAA;QAC7BA,IAAIA,OAAOA,GAAGA,IAAIA,CAAAA;QAElBA,EAAEA,CAACA,CAACA,IAAIA,CAACA,gBAAgBA,EAAEA,CAACA,CAACA,CAACA;YAC7BA,OAAOA,GAAGA,IAAIA,CAACA,iBAAiBA,EAAEA,CAAAA;QACnCA,CAACA;QAACA,IAAIA,CAACA,CAACA;YACPA,OAAOA,GAAGA,CAACA,CAACA,GAAGA,CAACA,IAAIA,EAAEA,IAAIA,CAACA,YAAYA,CAACA,IAAIA,CAACA,IAAIA,CAACA,CAACA,CAAAA;QACpDA,CAACA;QAEDA,MAAMA,CAACA,CACNA,qBAACA,GAAGA,KAACA,OAAOA,GAACA,MAAMA,GAACA,SAASA,GAAEA,IAAIA,CAACA,SAASA,CAACA,SAASA,EAAGA,GACxDA,OAAQA,CACDA,CACTA,CAACA;IACHA,CAACA;IAzDMP,cAASA,GAAGA,CAACA,CAACA,QAAQA,CAACA;QAC7BA,WAAWA,EAACA,KAAKA,CAACA,SAASA,CAACA,MAAMA,CAACA,UAAUA;QAC7CA,eAAeA,EAACA,KAAKA,CAACA,SAASA,CAACA,OAAOA,CACtCA,KAAKA,CAACA,SAASA,CAACA,MAAMA,CACtBA;KACDA,EAAEA,yBAAkBA,CAACA,SAASA,CAACA,CAAAA;IAqDjCA,WAACA;AAADA,CAACA,AA5DD,EAA0B,yBAAkB,EA4D3C;AA5DY,YAAI,OA4DhB,CAAA"} |
9
lib/src/components/search/hits/src/NoHits.d.ts
@@ -0,0 +1,9 @@ | ||
+import { SearchkitComponent, SearchkitComponentProps } from "../../../../core"; | ||
+export interface NoHitsProps extends SearchkitComponentProps { | ||
+} | ||
+export declare class NoHits extends SearchkitComponent<NoHitsProps, any> { | ||
+ defineBEMBlocks(): { | ||
+ container: string; | ||
+ }; | ||
+ render(): JSX.Element; | ||
+} |
28
lib/src/components/search/hits/src/NoHits.js
@@ -0,0 +1,28 @@ | ||
+var __extends = (this && this.__extends) || function (d, b) { | ||
+ for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
+ function __() { this.constructor = d; } | ||
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
+}; | ||
+var React = require("react"); | ||
+require("../styles/no-hits.scss"); | ||
+var core_1 = require("../../../../core"); | ||
+var NoHits = (function (_super) { | ||
+ __extends(NoHits, _super); | ||
+ function NoHits() { | ||
+ _super.apply(this, arguments); | ||
+ } | ||
+ NoHits.prototype.defineBEMBlocks = function () { | ||
+ var block = (this.props.mod || "no-hits"); | ||
+ return { | ||
+ container: block | ||
+ }; | ||
+ }; | ||
+ NoHits.prototype.render = function () { | ||
+ if (this.hasHits()) | ||
+ return null; | ||
+ return (React.createElement("div", {"data-qa": "no-hits", "className": this.bemBlocks.container()}, "no results found")); | ||
+ }; | ||
+ return NoHits; | ||
+})(core_1.SearchkitComponent); | ||
+exports.NoHits = NoHits; | ||
+//# sourceMappingURL=NoHits.js.map |
1
lib/src/components/search/hits/src/NoHits.js.map
@@ -0,0 +1 @@ | ||
+{"version":3,"file":"NoHits.js","sourceRoot":"","sources":["../../../../../../src/components/search/hits/src/NoHits.tsx"],"names":["NoHits","NoHits.constructor","NoHits.defineBEMBlocks","NoHits.render"],"mappings":";;;;;AACA,IAAY,KAAK,WAAM,OAAO,CAAC,CAAA;AAC/B,QAAO,wBAAwB,CAAC,CAAA;AAEhC,qBAGO,kBAEP,CAAC,CAFwB;AAKzB;IAA4BA,0BAAoCA;IAAhEA;QAA4BC,8BAAoCA;IAkBhEA,CAACA;IAhBAD,gCAAeA,GAAfA;QACCE,IAAIA,KAAKA,GAAGA,CAACA,IAAIA,CAACA,KAAKA,CAACA,GAAGA,IAAIA,SAASA,CAACA,CAAAA;QACzCA,MAAMA,CAACA;YACNA,SAASA,EAAEA,KAAKA;SAChBA,CAAAA;IACFA,CAACA;IAEDF,uBAAMA,GAANA;QACGG,EAAEA,CAACA,CAACA,IAAIA,CAACA,OAAOA,EAAEA,CAACA;YAACA,MAAMA,CAACA,IAAIA,CAAAA;QAEjCA,MAAMA,CAACA,CACNA,qBAACA,GAAGA,KAACA,OAAOA,GAACA,SAASA,GAACA,SAASA,GAAEA,IAAIA,CAACA,SAASA,CAACA,SAASA,EAAGA,sBAEpDA,CACTA,CAACA;IACHA,CAACA;IACFH,aAACA;AAADA,CAACA,AAlBD,EAA4B,yBAAkB,EAkB7C;AAlBY,cAAM,SAkBlB,CAAA"} |
4
lib/src/components/search/hits/styles/no-hits.scss
@@ -0,0 +1,4 @@ | ||
+.no-hits { | ||
+ text-align:center; | ||
+ margin-top:60px; | ||
+} |
1
src/components/index.ts
8
src/components/search/hits/src/Hits.tsx
31
src/components/search/hits/src/NoHits.tsx
@@ -0,0 +1,31 @@ | ||
+import * as _ from "lodash"; | ||
+import * as React from "react"; | ||
+import "../styles/no-hits.scss"; | ||
+ | ||
+import { | ||
+ SearchkitComponent, | ||
+ SearchkitComponentProps | ||
+} from "../../../../core" | ||
+ | ||
+export interface NoHitsProps extends SearchkitComponentProps { | ||
+} | ||
+ | ||
+export class NoHits extends SearchkitComponent<NoHitsProps, any> { | ||
+ | ||
+ defineBEMBlocks() { | ||
+ let block = (this.props.mod || "no-hits") | ||
+ return { | ||
+ container: block | ||
+ } | ||
+ } | ||
+ | ||
+ render() { | ||
+ if (this.hasHits()) return null | ||
+ | ||
+ return ( | ||
+ <div data-qa="no-hits" className={this.bemBlocks.container()}> | ||
+ no results found | ||
+ </div> | ||
+ ); | ||
+ } | ||
+} |
4
src/components/search/hits/styles/no-hits.scss
@@ -0,0 +1,4 @@ | ||
+.no-hits { | ||
+ text-align:center; | ||
+ margin-top:60px; | ||
+} |
1
tsconfig.json
1
webpack.test.config.js
0 comments on commit
6ec6ad9