@searchcraft/javascript-sdk 0.9.7 → 0.10.1

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.
Files changed (128) hide show
  1. package/README.md +2 -2
  2. package/dist/components/defineCustomElements.js +8 -6
  3. package/dist/components/index.d.ts +2632 -68
  4. package/dist/components/index.js +51 -15
  5. package/dist/components/index.js.map +1 -1
  6. package/dist/components/{p-e41b0f43.js → p-0077f677.js} +14 -21
  7. package/dist/components/p-0077f677.js.map +1 -0
  8. package/dist/components/p-13e81b5d.js +147 -0
  9. package/dist/components/p-13e81b5d.js.map +1 -0
  10. package/dist/components/p-172a848d.js +93 -0
  11. package/dist/components/p-172a848d.js.map +1 -0
  12. package/dist/components/{p-580c09dc.js → p-17c646e2.js} +226 -190
  13. package/dist/components/p-17c646e2.js.map +1 -0
  14. package/dist/components/{p-e55a7970.js → p-1adf78b9.js} +2 -2
  15. package/dist/components/p-1adf78b9.js.map +1 -0
  16. package/dist/components/{p-e27a0dab.js → p-2be1a382.js} +5 -7
  17. package/dist/components/p-2be1a382.js.map +1 -0
  18. package/dist/components/{p-4df578e4.js → p-3e65aa91.js} +8 -8
  19. package/dist/components/p-3e65aa91.js.map +1 -0
  20. package/dist/components/{p-8f854dec.js → p-5d17ace0.js} +14 -13
  21. package/dist/components/p-5d17ace0.js.map +1 -0
  22. package/dist/components/{p-bf6a086a.js → p-73db9122.js} +3 -10
  23. package/dist/components/p-73db9122.js.map +1 -0
  24. package/dist/components/p-810a7850.js +17 -0
  25. package/dist/components/p-810a7850.js.map +1 -0
  26. package/dist/components/p-84e2cbd6.js +46 -0
  27. package/dist/components/p-84e2cbd6.js.map +1 -0
  28. package/dist/components/{p-bb12ab5a.js → p-868803f9.js} +4 -3
  29. package/dist/components/p-868803f9.js.map +1 -0
  30. package/dist/components/{p-60f05735.js → p-a62a2e74.js} +4 -4
  31. package/dist/components/p-a62a2e74.js.map +1 -0
  32. package/dist/components/{p-5fdaf1e6.js → p-a64b4cba.js} +2 -145
  33. package/dist/components/p-a64b4cba.js.map +1 -0
  34. package/dist/components/{p-71cc28c1.js → p-acf23bab.js} +2 -2
  35. package/dist/components/p-acf23bab.js.map +1 -0
  36. package/dist/components/{p-0e393fe1.js → p-f2585cdf.js} +3 -9
  37. package/dist/components/p-f2585cdf.js.map +1 -0
  38. package/dist/components/searchcraft-ad.js +1 -1
  39. package/dist/components/searchcraft-button.js +1 -1
  40. package/dist/components/searchcraft-error-message.js +1 -1
  41. package/dist/components/searchcraft-facet-list.js +1 -1
  42. package/dist/components/searchcraft-filter-panel.js +6 -5
  43. package/dist/components/searchcraft-filter-panel.js.map +1 -1
  44. package/dist/components/searchcraft-input-form.js +2 -2
  45. package/dist/components/searchcraft-input-label.js +1 -1
  46. package/dist/components/searchcraft-pagination.js +3 -9
  47. package/dist/components/searchcraft-pagination.js.map +1 -1
  48. package/dist/components/searchcraft-popover-button.js +95 -3
  49. package/dist/components/searchcraft-popover-button.js.map +1 -1
  50. package/dist/components/searchcraft-popover-footer.d.ts +11 -0
  51. package/dist/components/searchcraft-popover-footer.js +8 -0
  52. package/dist/components/searchcraft-popover-footer.js.map +1 -0
  53. package/dist/components/searchcraft-popover-form.js +36 -27
  54. package/dist/components/searchcraft-popover-form.js.map +1 -1
  55. package/dist/components/searchcraft-popover-list-item.js +1 -1
  56. package/dist/components/searchcraft-popover-list-view.js +1 -1
  57. package/dist/components/searchcraft-results-info.js +12 -23
  58. package/dist/components/searchcraft-results-info.js.map +1 -1
  59. package/dist/components/searchcraft-search-result.d.ts +11 -0
  60. package/dist/components/searchcraft-search-result.js +8 -0
  61. package/dist/components/searchcraft-search-result.js.map +1 -0
  62. package/dist/components/searchcraft-search-results-per-page.js +3 -10
  63. package/dist/components/searchcraft-search-results-per-page.js.map +1 -1
  64. package/dist/components/searchcraft-search-results.d.ts +11 -0
  65. package/dist/components/{searchcraft-base-search-results.js → searchcraft-search-results.js} +25 -71
  66. package/dist/components/searchcraft-search-results.js.map +1 -0
  67. package/dist/components/searchcraft-select.js +1 -1
  68. package/dist/components/searchcraft-slider.js +1 -1
  69. package/dist/components/searchcraft-theme.js +4 -42
  70. package/dist/components/searchcraft-theme.js.map +1 -1
  71. package/dist/components/searchcraft-toggle-button.js +1 -1
  72. package/dist/hydrate/index.d.ts +242 -0
  73. package/dist/hydrate/index.js +23479 -0
  74. package/dist/hydrate/index.mjs +23471 -0
  75. package/dist/hydrate/package.json +12 -0
  76. package/dist/themes/hologram.css +1 -0
  77. package/dist/themes/hologram.css.map +1 -0
  78. package/dist/types/components/searchcraft-ad/searchcraft-ad.d.ts +2 -0
  79. package/dist/types/components/searchcraft-button/searchcraft-button.d.ts +3 -2
  80. package/dist/types/components/searchcraft-error-message/searchcraft-error-message.d.ts +6 -7
  81. package/dist/types/components/searchcraft-facet-list/searchcraft-facet-list.d.ts +3 -1
  82. package/dist/types/components/searchcraft-filter-panel/searchcraft-filter-panel.d.ts +30 -1
  83. package/dist/types/components/searchcraft-input-form/searchcraft-input-form.d.ts +23 -14
  84. package/dist/types/components/searchcraft-input-label/searchcraft-input-label.d.ts +3 -2
  85. package/dist/types/components/searchcraft-pagination/searchcraft-pagination.d.ts +22 -8
  86. package/dist/types/components/searchcraft-popover-button/searchcraft-popover-button.d.ts +74 -0
  87. package/dist/types/components/searchcraft-popover-footer/searchcraft-popover-footer.d.ts +13 -0
  88. package/dist/types/components/searchcraft-popover-form/searchcraft-popover-form.d.ts +27 -15
  89. package/dist/types/components/searchcraft-popover-list-item/searchcraft-popover-list-item.d.ts +5 -3
  90. package/dist/types/components/searchcraft-popover-list-view/searchcraft-popover-list-view.d.ts +3 -2
  91. package/dist/types/components/searchcraft-results-info/searchcraft-results-info.d.ts +41 -19
  92. package/dist/types/components/searchcraft-search-result/searchcraft-search-result.d.ts +28 -0
  93. package/dist/types/components/searchcraft-search-results/searchcraft-search-results.d.ts +81 -0
  94. package/dist/types/components/searchcraft-search-results-per-page/searchcraft-search-results-per-page.d.ts +21 -5
  95. package/dist/types/components/searchcraft-select/searchcraft-select.d.ts +3 -5
  96. package/dist/types/components/searchcraft-slider/searchcraft-slider.d.ts +3 -3
  97. package/dist/types/components/searchcraft-theme/searchcraft-theme.d.ts +24 -16
  98. package/dist/types/components/searchcraft-toggle-button/searchcraft-toggle-button.d.ts +2 -1
  99. package/dist/types/components.d.ts +947 -612
  100. package/dist/types/index.d.ts +5 -4
  101. package/dist/types/store/SearchcraftStore.types.d.ts +3 -0
  102. package/dist/types/utils/html.d.ts +6 -0
  103. package/dist/types/utils/index.d.ts +1 -0
  104. package/package.json +13 -7
  105. package/dist/components/bundled.types.d.ts +0 -2275
  106. package/dist/components/p-0e393fe1.js.map +0 -1
  107. package/dist/components/p-19fe91f1.js +0 -136
  108. package/dist/components/p-19fe91f1.js.map +0 -1
  109. package/dist/components/p-4df578e4.js.map +0 -1
  110. package/dist/components/p-580c09dc.js.map +0 -1
  111. package/dist/components/p-5fdaf1e6.js.map +0 -1
  112. package/dist/components/p-60f05735.js.map +0 -1
  113. package/dist/components/p-71cc28c1.js.map +0 -1
  114. package/dist/components/p-8f854dec.js.map +0 -1
  115. package/dist/components/p-bb12ab5a.js.map +0 -1
  116. package/dist/components/p-bf6a086a.js.map +0 -1
  117. package/dist/components/p-d9551738.js +0 -25
  118. package/dist/components/p-d9551738.js.map +0 -1
  119. package/dist/components/p-e27a0dab.js.map +0 -1
  120. package/dist/components/p-e41b0f43.js.map +0 -1
  121. package/dist/components/p-e55a7970.js.map +0 -1
  122. package/dist/components/searchcraft-base-search-result.d.ts +0 -11
  123. package/dist/components/searchcraft-base-search-result.js +0 -8
  124. package/dist/components/searchcraft-base-search-result.js.map +0 -1
  125. package/dist/components/searchcraft-base-search-results.d.ts +0 -11
  126. package/dist/components/searchcraft-base-search-results.js.map +0 -1
  127. package/dist/types/components/searchcraft-base-search-result/searchcraft-base-search-result.d.ts +0 -55
  128. package/dist/types/components/searchcraft-base-search-results/searchcraft-base-search-results.d.ts +0 -89
@@ -1,6 +1,7 @@
1
1
  import { p as proxyCustomElement, H, h } from './p-5365011f.js';
2
- import { s as searchcraftStore } from './p-580c09dc.js';
2
+ import { s as searchcraftStore } from './p-17c646e2.js';
3
3
  import { a as getDocumentValueFromSearchResultMapping } from './p-6104fe5d.js';
4
+ import './p-a64b4cba.js';
4
5
 
5
6
  const SearchcraftPopoverListItem = /*@__PURE__*/ proxyCustomElement(class SearchcraftPopoverListItem extends H {
6
7
  constructor() {
@@ -11,16 +12,16 @@ const SearchcraftPopoverListItem = /*@__PURE__*/ proxyCustomElement(class Search
11
12
  popoverResultMappings;
12
13
  /** The document position relative to the search results (For Measure) */
13
14
  documentPosition = 0;
15
+ title;
16
+ subtitle;
14
17
  href;
15
- imageSrc;
18
+ imageSource;
16
19
  imageAlt;
17
- titleContent;
18
- subtitleContent;
19
20
  mapValuesFromDocument(document) {
20
- this.titleContent = getDocumentValueFromSearchResultMapping(document, this.popoverResultMappings?.title);
21
- this.subtitleContent = getDocumentValueFromSearchResultMapping(document, this.popoverResultMappings?.subtitle);
21
+ this.title = getDocumentValueFromSearchResultMapping(document, this.popoverResultMappings?.title);
22
+ this.subtitle = getDocumentValueFromSearchResultMapping(document, this.popoverResultMappings?.subtitle);
22
23
  this.href = getDocumentValueFromSearchResultMapping(document, this.popoverResultMappings?.href);
23
- this.imageSrc = getDocumentValueFromSearchResultMapping(document, this.popoverResultMappings?.imageSource);
24
+ this.imageSource = getDocumentValueFromSearchResultMapping(document, this.popoverResultMappings?.imageSource);
24
25
  this.imageAlt = getDocumentValueFromSearchResultMapping(document, this.popoverResultMappings?.imageAlt);
25
26
  }
26
27
  connectedCallback() {
@@ -44,17 +45,17 @@ const SearchcraftPopoverListItem = /*@__PURE__*/ proxyCustomElement(class Search
44
45
  }
45
46
  };
46
47
  render() {
47
- return (h("a", { key: '870fae8c0019ea24d9ecd173a781a38e3b17f8de', class: 'searchcraft-popover-list-item', href: this.href, onClick: this.handleLinkClick.bind(this) }, this.imageSrc && (h("div", { key: '9e200a2be177fed7f6303fdc1ba466fc47817b5d', class: 'searchcraft-popover-list-item-image-wrapper' }, h("img", { key: '22124b2856cd41220ac852a1fbc94cbf2a1cd9f9', alt: this.imageAlt, src: this.imageSrc, class: 'searchcraft-popover-list-item-image' }))), h("div", { key: 'b3f0bb6784a36befd044e71798915994093177ab', class: 'searchcraft-popover-list-item-info-wrapper' }, h("p", { key: 'caa22a8d68b56814ee29498db48fe1c65d8d7644', class: 'searchcraft-popover-list-item-title' }, this.titleContent), h("p", { key: '63e11be221d6f274855f7989b3a9dc4532c08e05', class: 'searchcraft-popover-list-item-subtitle' }, this.subtitleContent))));
48
+ return (h("div", { key: '2ad974b85e385f99724f9ac85d646cc82208e24a', class: 'searchcraft-popover-list-item' }, h("a", { key: '68da0953d5efa18fd003c22df5321be8096bace6', class: 'searchcraft-popover-list-item-link', href: this.href, onClick: this.handleLinkClick.bind(this) }, this.imageSource && (h("div", { key: '49c99c8b9b5c8ca74b7e656e9ff87169ed42d305', class: 'searchcraft-popover-list-item-image-wrapper' }, h("img", { key: '04022544e1d64e2d48b86a9d27e14e83e7ff43df', alt: this.imageAlt, src: this.imageSource, class: 'searchcraft-popover-list-item-image' }))), h("div", { key: 'eca661cccf12e41dea5b0a70637864763a579336', class: 'searchcraft-popover-list-item-content' }, this.title && (h("p", { key: 'c5cc621f946b521fb7c4b1fc7a8eb1d00b5c6d3f', class: 'searchcraft-popover-list-item-content-title' }, this.title)), this.subtitle && (h("p", { key: '595cb3dea62af52dd1df0e7515dd186688d695db', class: 'searchcraft-popover-list-item-content-subtitle' }, this.subtitle))))));
48
49
  }
49
50
  }, [0, "searchcraft-popover-list-item", {
50
51
  "item": [16],
51
52
  "popoverResultMappings": [16],
52
53
  "documentPosition": [2, "document-position"],
54
+ "title": [32],
55
+ "subtitle": [32],
53
56
  "href": [32],
54
- "imageSrc": [32],
55
- "imageAlt": [32],
56
- "titleContent": [32],
57
- "subtitleContent": [32]
57
+ "imageSource": [32],
58
+ "imageAlt": [32]
58
59
  }]);
59
60
  function defineCustomElement() {
60
61
  if (typeof customElements === "undefined") {
@@ -72,4 +73,4 @@ function defineCustomElement() {
72
73
 
73
74
  export { SearchcraftPopoverListItem as S, defineCustomElement as d };
74
75
 
75
- //# sourceMappingURL=p-8f854dec.js.map
76
+ //# sourceMappingURL=p-5d17ace0.js.map
@@ -0,0 +1 @@
1
+ {"file":"p-5d17ace0.js","mappings":";;;;;MAkBa,0BAA0B;;;;;IAC7B,IAAI,CAAuC;IAC3C,qBAAqB,CAAoC;;IAEzD,gBAAgB,GAAG,CAAC,CAAC;IAEpB,KAAK,CAAU;IACf,QAAQ,CAAU;IAClB,IAAI,CAAU;IACd,WAAW,CAAU;IACrB,QAAQ,CAAU;IAE3B,qBAAqB,CAAC,QAAwB;QAC5C,IAAI,CAAC,KAAK,GAAG,uCAAuC,CAClD,QAAQ,EACR,IAAI,CAAC,qBAAqB,EAAE,KAAK,CAClC,CAAC;QACF,IAAI,CAAC,QAAQ,GAAG,uCAAuC,CACrD,QAAQ,EACR,IAAI,CAAC,qBAAqB,EAAE,QAAQ,CACrC,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,uCAAuC,CACjD,QAAQ,EACR,IAAI,CAAC,qBAAqB,EAAE,IAAI,CACjC,CAAC;QACF,IAAI,CAAC,WAAW,GAAG,uCAAuC,CACxD,QAAQ,EACR,IAAI,CAAC,qBAAqB,EAAE,WAAW,CACxC,CAAC;QACF,IAAI,CAAC,QAAQ,GAAG,uCAAuC,CACrD,QAAQ,EACR,IAAI,CAAC,qBAAqB,EAAE,QAAQ,CACrC,CAAC;KACH;IAED,iBAAiB;QACf,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SAChD;KACF;IAED,oBAAoB,MAAK;IAEzB,eAAe,GAAG;QAChB,MAAM,KAAK,GAAG,gBAAgB,CAAC,QAAQ,EAAE,CAAC;QAC1C,MAAM,WAAW,GAAG,KAAK,CAAC,sBAAsB,EAAE,CAAC;QAEnD,IAAI,WAAW,EAAE;YACf,MAAM,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,CAAC;YAChD,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC;YACrC,MAAM,mBAAmB,GAAG,KAAK,CAAC,yBAAyB,CAAC,MAAM,IAAI,CAAC,CAAC;YAExE,WAAW,CAAC,aAAa,EAAE,gBAAgB,CAAC,kBAAkB,EAAE;gBAC9D,iBAAiB;gBACjB,mBAAmB;gBACnB,WAAW;aACZ,CAAC,CAAC;SACJ;KACF,CAAC;IAEF,MAAM;QACJ,QACE,4DAAK,KAAK,EAAC,+BAA+B,IACxC,0DACE,KAAK,EAAC,oCAAoC,EAC1C,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,IAEvC,IAAI,CAAC,WAAW,KACf,4DAAK,KAAK,EAAC,6CAA6C,IACtD,4DACE,GAAG,EAAE,IAAI,CAAC,QAAQ,EAClB,GAAG,EAAE,IAAI,CAAC,WAAW,EACrB,KAAK,EAAC,qCAAqC,GAC3C,CACE,CACP,EACD,4DAAK,KAAK,EAAC,uCAAuC,IAC/C,IAAI,CAAC,KAAK,KACT,0DAAG,KAAK,EAAC,6CAA6C,IACnD,IAAI,CAAC,KAAK,CACT,CACL,EACA,IAAI,CAAC,QAAQ,KACZ,0DAAG,KAAK,EAAC,gDAAgD,IACtD,IAAI,CAAC,QAAQ,CACZ,CACL,CACG,CACJ,CACA,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/searchcraft-popover-list-item/searchcraft-popover-list-item.tsx"],"sourcesContent":["import { searchcraftStore } from '@store';\nimport type {\n SearchDocument,\n SearchClientResponseItem,\n PopoverResultMappings,\n} from '@searchcraft/core';\nimport { Component, h, Prop, State } from '@stencil/core';\nimport { getDocumentValueFromSearchResultMapping } from '@utils';\n\n/**\n * A single list item rendered in a searchcraft-popover-list-view.\n *\n * @internal\n */\n@Component({\n tag: 'searchcraft-popover-list-item',\n shadow: false,\n})\nexport class SearchcraftPopoverListItem {\n @Prop() item: SearchClientResponseItem | undefined;\n @Prop() popoverResultMappings: PopoverResultMappings | undefined;\n /** The document position relative to the search results (For Measure) */\n @Prop() documentPosition = 0;\n\n @State() title?: string;\n @State() subtitle?: string;\n @State() href?: string;\n @State() imageSource?: string;\n @State() imageAlt?: string;\n\n mapValuesFromDocument(document: SearchDocument) {\n this.title = getDocumentValueFromSearchResultMapping(\n document,\n this.popoverResultMappings?.title,\n );\n this.subtitle = getDocumentValueFromSearchResultMapping(\n document,\n this.popoverResultMappings?.subtitle,\n );\n this.href = getDocumentValueFromSearchResultMapping(\n document,\n this.popoverResultMappings?.href,\n );\n this.imageSource = getDocumentValueFromSearchResultMapping(\n document,\n this.popoverResultMappings?.imageSource,\n );\n this.imageAlt = getDocumentValueFromSearchResultMapping(\n document,\n this.popoverResultMappings?.imageAlt,\n );\n }\n\n connectedCallback() {\n if (this.item) {\n this.mapValuesFromDocument(this.item.document);\n }\n }\n\n disconnectedCallback() {}\n\n handleLinkClick = () => {\n const state = searchcraftStore.getState();\n const searchcraft = state.getSearchcraftInstance();\n\n if (searchcraft) {\n const document_position = this.documentPosition;\n const search_term = state.searchTerm;\n const number_of_documents = state.searchClientResponseItems.length || 0;\n\n searchcraft.measureClient?.sendMeasureEvent('document_clicked', {\n document_position,\n number_of_documents,\n search_term,\n });\n }\n };\n\n render() {\n return (\n <div class='searchcraft-popover-list-item'>\n <a\n class='searchcraft-popover-list-item-link'\n href={this.href}\n onClick={this.handleLinkClick.bind(this)}\n >\n {this.imageSource && (\n <div class='searchcraft-popover-list-item-image-wrapper'>\n <img\n alt={this.imageAlt}\n src={this.imageSource}\n class='searchcraft-popover-list-item-image'\n />\n </div>\n )}\n <div class='searchcraft-popover-list-item-content'>\n {this.title && (\n <p class='searchcraft-popover-list-item-content-title'>\n {this.title}\n </p>\n )}\n {this.subtitle && (\n <p class='searchcraft-popover-list-item-content-subtitle'>\n {this.subtitle}\n </p>\n )}\n </div>\n </a>\n </div>\n );\n }\n}\n"],"version":3}
@@ -1,6 +1,4 @@
1
1
  import { p as proxyCustomElement, H, c as createEvent, h } from './p-5365011f.js';
2
- import { c as classNames } from './p-5cdc6210.js';
3
- import { p as parseCustomStyles } from './p-d9551738.js';
4
2
 
5
3
  const SearchcraftSelect = /*@__PURE__*/ proxyCustomElement(class SearchcraftSelect extends H {
6
4
  constructor() {
@@ -36,10 +34,6 @@ const SearchcraftSelect = /*@__PURE__*/ proxyCustomElement(class SearchcraftSele
36
34
  * The options for the select input.
37
35
  */
38
36
  options = [];
39
- /**
40
- * A custom styles object.
41
- */
42
- customStyles;
43
37
  /**
44
38
  * The event fired when the select is changed.
45
39
  */
@@ -54,11 +48,11 @@ const SearchcraftSelect = /*@__PURE__*/ proxyCustomElement(class SearchcraftSele
54
48
  this.setSearchResultsPage(page);
55
49
  }
56
50
  render() {
57
- return (h("div", { key: '5024d49d89a3649a5de591d37ded304a9dfb36d9', class: classNames('searchcraft-select', parseCustomStyles(this.customStyles || {})) }, this.label && (h("label", { key: '005aea9b190e5a6c041721e20395be23f76faab6', class: 'searchcraft-select-label', id: this.labelId || `${this.inputId}-label`, htmlFor: this.inputId }, this.label)), h("div", { key: '209d56844c0bcd241e73bafcad24fac927fe7ffa', class: 'searchcraft-select-input-wrapper' }, h("select", { key: '010c9e596ef45a303f84c0ac0fa54ab67556d7b6', "aria-labelledby": this.label ? this.labelId || `${this.inputId}-label` : undefined, class: 'searchcraft-select-input', disabled: this.disabled, id: this.inputId, name: this.name, onChange: this.handleSelectChange }, (typeof this.options === 'string'
51
+ return (h("div", { key: '15ecbf48c824a161cd83bdab99dace8e44f1ab39', class: 'searchcraft-select' }, this.label && (h("label", { key: 'aba433ae9c27c9405099cffcef923c3ad22d7fda', class: 'searchcraft-select-label', id: this.labelId || `${this.inputId}-label`, htmlFor: this.inputId }, this.label)), h("div", { key: '8df8a2ff05924c9c55cdd6e3827cd927cddab82a', class: 'searchcraft-select-input-wrapper' }, h("select", { key: '1d5f492c2255f8ca1b6ea5e04a2726dda2f2c52f', "aria-labelledby": this.label ? this.labelId || `${this.inputId}-label` : undefined, class: 'searchcraft-select-input', disabled: this.disabled, id: this.inputId, name: this.name, onChange: this.handleSelectChange }, (typeof this.options === 'string'
58
52
  ? JSON.parse(this.options)
59
53
  : this.options).map(({ label, value, selected }) => {
60
54
  return (h("option", { key: value, value: value, selected: selected }, label));
61
- })), h("svg", { key: '51d9fb79381468ee0992475ba376df5a5961116c', class: 'searchcraft-select-input-icon', width: '20', height: '20', viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' }, h("title", { key: '59186138953557764915d41708d4bcc23a9bb97f' }, "Select dropdown icon"), h("path", { key: 'ec2c962df16cb68bdaf3e2c32e57d875a63957a9', d: 'M5 7.5L10 12.5L15 7.5', stroke: 'currentColor', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' }))), this.caption && (h("p", { key: '742bc2dbd8371938894d49bb37d429d1b7a07d7a', class: 'searchcraft-select-caption' }, this.caption))));
55
+ })), h("svg", { key: '0ec6892b529f2e70027aadea47208582a65a97b7', class: 'searchcraft-select-input-icon', width: '20', height: '20', viewBox: '0 0 20 20', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' }, h("title", { key: 'bced6b62378491d1d1c629b602d7d033d912c761' }, "Select dropdown icon"), h("path", { key: '659f8ebf9129e2e7941da949d29688c41c1472bb', d: 'M5 7.5L10 12.5L15 7.5', stroke: 'currentColor', "stroke-width": '1.5', "stroke-linecap": 'round', "stroke-linejoin": 'round' }))), this.caption && (h("p", { key: '51217d926f68f79b6c3514f5fd769b56549fdce9', class: 'searchcraft-select-caption' }, this.caption))));
62
56
  }
63
57
  }, [0, "searchcraft-select", {
64
58
  "caption": [1],
@@ -68,7 +62,6 @@ const SearchcraftSelect = /*@__PURE__*/ proxyCustomElement(class SearchcraftSele
68
62
  "labelId": [1, "label-id"],
69
63
  "name": [1],
70
64
  "options": [1],
71
- "customStyles": [1, "custom-styles"],
72
65
  "searchResultsPerPage": [32],
73
66
  "setSearchResultsPage": [32],
74
67
  "setSearchResultsPerPage": [32]
@@ -89,4 +82,4 @@ function defineCustomElement() {
89
82
 
90
83
  export { SearchcraftSelect as S, defineCustomElement as d };
91
84
 
92
- //# sourceMappingURL=p-bf6a086a.js.map
85
+ //# sourceMappingURL=p-73db9122.js.map
@@ -0,0 +1 @@
1
+ {"file":"p-73db9122.js","mappings":";;MAkCa,iBAAiB;;;;;;;;;IAIpB,OAAO,CAAU;;;;IAIjB,QAAQ,GAAa,KAAK,CAAC;;;;IAI3B,OAAO,CAAU;;;;IAIjB,KAAK,CAAU;;;;IAIf,OAAO,CAAU;;;;IAIjB,IAAI,CAAU;;;;IAId,OAAO,GAAuC,EAAE,CAAC;;;;IAIhD,YAAY,CAAwB;IAEpC,oBAAoB,CAAC;IAErB,oBAAoB,GAA2B,SAAQ,CAAC;IACxD,uBAAuB,GAA8B,SAAQ,CAAC;IAE/D,kBAAkB,GAAG,CAAC,KAAK;QACjC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;KAC5C,CAAC;IAEF,cAAc,CAAC,IAAY;QACzB,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;KACjC;IAED,MAAM;QACJ,QACE,4DAAK,KAAK,EAAC,oBAAoB,IAC5B,IAAI,CAAC,KAAK,KACT,8DACE,KAAK,EAAC,0BAA0B,EAChC,EAAE,EAAE,IAAI,CAAC,OAAO,IAAI,GAAG,IAAI,CAAC,OAAO,QAAQ,EAC3C,OAAO,EAAE,IAAI,CAAC,OAAO,IAEpB,IAAI,CAAC,KAAK,CACL,CACT,EACD,4DAAK,KAAK,EAAC,kCAAkC,IAC3C,kFAEI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,IAAI,GAAG,IAAI,CAAC,OAAO,QAAQ,GAAG,SAAS,EAElE,KAAK,EAAC,0BAA0B,EAChC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,EAAE,EAAE,IAAI,CAAC,OAAO,EAChB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,QAAQ,EAAE,IAAI,CAAC,kBAAkB,IAEhC,CAAC,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ;cAC9B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;cACxB,IAAI,CAAC,OAAO,EACd,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE;YAC/B,QACE,cAAQ,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,IACjD,KAAK,CACC,EACT;SACH,CAAC,CACK,EACT,4DACE,KAAK,EAAC,+BAA+B,EACrC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,IAElC,uFAAmC,EACnC,6DACE,CAAC,EAAC,uBAAuB,EACzB,MAAM,EAAC,cAAc,kBACR,KAAK,oBACH,OAAO,qBACN,OAAO,GACvB,CACE,CACF,EACL,IAAI,CAAC,OAAO,KACX,0DAAG,KAAK,EAAC,4BAA4B,IAAE,IAAI,CAAC,OAAO,CAAK,CACzD,CACG,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/searchcraft-select/searchcraft-select.tsx"],"sourcesContent":["import {\n Component,\n h,\n State,\n Prop,\n type EventEmitter,\n Event,\n} from '@stencil/core';\n\nexport type SearchcraftSelectOption = {\n label: string;\n value: string | number;\n selected?: boolean;\n};\n\n/**\n * This web component is designed to allow users to select between a group of options.\n *\n * @js-example\n * ```html\n * <!-- index.html -->\n * <searchcraft-select\n * inputId=\"searchcraft-select\"\n * name=\"searchcraft-select\"\n * options=\"[{ label: 'label', value: 'value' }]\"\n * />\n * ```\n *\n * @internal\n */\n@Component({\n tag: 'searchcraft-select',\n shadow: false,\n})\nexport class SearchcraftSelect {\n /**\n * The caption displayed below the select input.\n */\n @Prop() caption?: string;\n /**\n * Whether the select input is disabled.\n */\n @Prop() disabled?: boolean = false;\n /**\n * The ID for the select input.\n */\n @Prop() inputId!: string;\n /**\n * The label of the select input.\n */\n @Prop() label?: string;\n /**\n * The ID for the label of the select input.\n */\n @Prop() labelId?: string;\n /**\n * The name of the select input.\n */\n @Prop() name!: string;\n /**\n * The options for the select input.\n */\n @Prop() options: SearchcraftSelectOption[] | string = [];\n /**\n * The event fired when the select is changed.\n */\n @Event() selectChange!: EventEmitter<string>;\n\n @State() searchResultsPerPage;\n\n @State() setSearchResultsPage: (page: number) => void = () => {};\n @State() setSearchResultsPerPage: (perPage: number) => void = () => {};\n\n private handleSelectChange = (event) => {\n this.selectChange.emit(event.target.value);\n };\n\n handleGoToPage(page: number) {\n this.setSearchResultsPage(page);\n }\n\n render() {\n return (\n <div class='searchcraft-select'>\n {this.label && (\n <label\n class='searchcraft-select-label'\n id={this.labelId || `${this.inputId}-label`}\n htmlFor={this.inputId}\n >\n {this.label}\n </label>\n )}\n <div class='searchcraft-select-input-wrapper'>\n <select\n aria-labelledby={\n this.label ? this.labelId || `${this.inputId}-label` : undefined\n }\n class='searchcraft-select-input'\n disabled={this.disabled}\n id={this.inputId}\n name={this.name}\n onChange={this.handleSelectChange}\n >\n {(typeof this.options === 'string'\n ? JSON.parse(this.options)\n : this.options\n ).map(({ label, value, selected }) => {\n return (\n <option key={value} value={value} selected={selected}>\n {label}\n </option>\n );\n })}\n </select>\n <svg\n class='searchcraft-select-input-icon'\n width='20'\n height='20'\n viewBox='0 0 20 20'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n >\n <title>Select dropdown icon</title>\n <path\n d='M5 7.5L10 12.5L15 7.5'\n stroke='currentColor'\n stroke-width='1.5'\n stroke-linecap='round'\n stroke-linejoin='round'\n />\n </svg>\n </div>\n {this.caption && (\n <p class='searchcraft-select-caption'>{this.caption}</p>\n )}\n </div>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,17 @@
1
+ import { D as DOMPurify } from './p-a64b4cba.js';
2
+
3
+ /**
4
+ * This allows you to parse a template string with a function.
5
+ */
6
+ const html = (strings, ...values) => {
7
+ let result = strings[0];
8
+ for (let i = 0; i < values.length; i++) {
9
+ result +=
10
+ DOMPurify.sanitize(values[i] ? String(values[i]) : '') + strings[i + 1];
11
+ }
12
+ return result || '';
13
+ };
14
+
15
+ export { html as h };
16
+
17
+ //# sourceMappingURL=p-810a7850.js.map
@@ -0,0 +1 @@
1
+ {"file":"p-810a7850.js","mappings":";;AAGA;;;MAGa,IAAI,GAAiB,CAAC,OAAO,EAAE,GAAG,MAAM;IACnD,IAAI,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAExB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,MAAM;YACJ,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;KAC3E;IAED,OAAO,MAAM,IAAI,EAAE,CAAC;AACtB;;;;","names":[],"sources":["src/utils/html.ts"],"sourcesContent":["import DOMPurify from 'dompurify';\n\nimport type { TemplateHtml } from '@searchcraft/core';\n/**\n * This allows you to parse a template string with a function.\n */\nexport const html: TemplateHtml = (strings, ...values) => {\n let result = strings[0];\n\n for (let i = 0; i < values.length; i++) {\n result +=\n DOMPurify.sanitize(values[i] ? String(values[i]) : '') + strings[i + 1];\n }\n\n return result || '';\n};\n"],"version":3}
@@ -0,0 +1,46 @@
1
+ import { p as proxyCustomElement, H, h } from './p-5365011f.js';
2
+ import { s as searchcraftStore } from './p-17c646e2.js';
3
+ import { f as formatNumberWithCommas } from './p-6104fe5d.js';
4
+ import './p-a64b4cba.js';
5
+
6
+ const SearchcraftPopoverFooter = /*@__PURE__*/ proxyCustomElement(class SearchcraftPopoverFooter extends H {
7
+ constructor() {
8
+ super();
9
+ this.__registerHost();
10
+ }
11
+ searchResultsCount;
12
+ unsubscribe = () => { };
13
+ componentDidLoad() {
14
+ this.searchResultsCount = searchcraftStore.getState().searchResultsCount;
15
+ this.unsubscribe = searchcraftStore.subscribe((state) => {
16
+ this.searchResultsCount = state.searchResultsCount;
17
+ });
18
+ }
19
+ disconnectedCallback() {
20
+ this.unsubscribe?.();
21
+ }
22
+ render() {
23
+ return (h("footer", { key: 'e1344ae185ef1b8a83bb69ba88e2952ab1c75e70', class: 'searchcraft-popover-footer' }, h("p", { key: '51874f4ce490e4f164b999e8c6f89710702e73bd', class: 'searchcraft-popover-footer-results-info' }, this.searchResultsCount
24
+ ? `${formatNumberWithCommas(this.searchResultsCount)} Results Found`
25
+ : ' '), h("a", { key: '5476e24cc3fa7fa265bd2b5cba43c8a70d8609ca', class: 'searchcraft-popover-footer-link', href: 'https://searchcraft.io/', target: '_blank', rel: 'noreferrer' }, h("svg", { key: '0a4edf94e9e40a96a93a4e7ba1ffbd081e51b585', class: 'searchcraft-popover-footer-link-image', width: '169', height: '16', viewBox: '0 0 169 16', fill: 'none', xmlns: 'http://www.w3.org/2000/svg' }, h("title", { key: '67813a626922d709a4409028cb0f3f1ce3e2cfe8' }, "Powered by Searchcraft"), h("path", { key: 'bf9e46a5f9783edd7167c1c5c1256d0200053969', d: 'M5.07288 0.608C7.60088 0.608 8.84888 2.064 8.84888 4.112C8.84888 6.16 7.60088 7.616 5.07288 7.616H1.68088V12H0.336875V0.608H5.07288ZM5.07288 6.4C6.67288 6.4 7.45688 5.552 7.45688 4.112C7.45688 2.672 6.67288 1.824 5.07288 1.824H1.68088V6.4H5.07288ZM13.31 12.192C10.99 12.192 9.31 10.512 9.31 7.872C9.31 5.232 10.99 3.552 13.31 3.552C15.63 3.552 17.31 5.232 17.31 7.872C17.31 10.512 15.63 12.192 13.31 12.192ZM13.31 11.04C14.91 11.04 15.966 9.872 15.966 7.872C15.966 5.872 14.91 4.704 13.31 4.704C11.71 4.704 10.654 5.872 10.654 7.872C10.654 9.872 11.71 11.04 13.31 11.04ZM28.3826 3.744H29.7586L27.0066 12H25.6626L24.4466 8.176C24.1586 7.264 23.8706 6.304 23.6146 5.376C23.3426 6.304 23.0546 7.264 22.7666 8.176L21.5666 12H20.2226L17.4706 3.744H18.8466L20.0146 7.472C20.3346 8.48 20.6226 9.472 20.9106 10.48C21.1826 9.472 21.4706 8.48 21.7906 7.472L22.9426 3.744H24.2866L25.4386 7.472C25.7426 8.464 26.0466 9.456 26.3346 10.448C26.6066 9.456 26.9106 8.464 27.2146 7.472L28.3826 3.744ZM37.5194 7.872V8.32H31.2474C31.3754 10.176 32.3514 11.024 33.7914 11.024C34.9594 11.024 35.6954 10.416 35.9834 9.488H37.3114C36.9114 11.04 35.7274 12.192 33.7594 12.192C31.5034 12.192 29.9194 10.544 29.9194 7.872C29.9194 5.28 31.4394 3.552 33.7274 3.552C36.1914 3.552 37.5194 5.504 37.5194 7.872ZM33.7274 4.72C32.4314 4.72 31.4874 5.536 31.2794 7.168H36.1434C36.0154 5.808 35.1994 4.72 33.7274 4.72ZM42.9101 3.616C43.0381 3.616 43.1661 3.616 43.3421 3.632V4.864H43.0221C41.3741 4.864 40.3181 5.696 40.3181 7.296V12H39.0381V3.744H40.2541V5.2C40.7181 4.336 41.5661 3.616 42.9101 3.616ZM51.2538 7.872V8.32H44.9818C45.1098 10.176 46.0858 11.024 47.5258 11.024C48.6938 11.024 49.4298 10.416 49.7178 9.488H51.0458C50.6458 11.04 49.4618 12.192 47.4938 12.192C45.2378 12.192 43.6538 10.544 43.6538 7.872C43.6538 5.28 45.1738 3.552 47.4618 3.552C49.9258 3.552 51.2538 5.504 51.2538 7.872ZM47.4618 4.72C46.1658 4.72 45.2218 5.536 45.0138 7.168H49.8778C49.7498 5.808 48.9338 4.72 47.4618 4.72ZM58.9805 0.608H60.2605V12H59.0445V10.72C58.4205 11.664 57.4445 12.192 56.2125 12.192C53.8925 12.192 52.3725 10.512 52.3725 7.872C52.3725 5.232 53.8925 3.552 56.2125 3.552C57.4125 3.552 58.3565 4.048 58.9805 4.928V0.608ZM56.3725 11.04C57.9725 11.04 59.0285 9.872 59.0285 7.872C59.0285 5.872 57.9725 4.704 56.3725 4.704C54.7725 4.704 53.7165 5.936 53.7165 7.936C53.7165 9.936 54.7725 11.04 56.3725 11.04ZM69.2736 3.552C71.5936 3.552 73.1136 5.232 73.1136 7.872C73.1136 10.512 71.5936 12.192 69.2736 12.192C68.0416 12.192 67.0656 11.664 66.4416 10.72V12H65.2256V0.608H66.5056V4.928C67.1296 4.048 68.0736 3.552 69.2736 3.552ZM69.1136 11.04C70.7136 11.04 71.7696 9.808 71.7696 7.808C71.7696 5.808 70.7136 4.704 69.1136 4.704C67.5136 4.704 66.4576 5.872 66.4576 7.872C66.4576 9.872 67.5136 11.04 69.1136 11.04ZM79.3795 3.744H80.7715L77.2835 13.296C76.7555 14.752 75.9075 15.184 74.5955 15.184C74.3395 15.184 74.0995 15.168 73.8275 15.136V14.064H74.5795C75.3955 14.064 75.8275 13.696 76.0835 13.04C76.1795 12.8 76.2755 12.528 76.3715 12.272L73.2675 3.744H74.6755L75.8435 7.184C76.2595 8.384 76.6435 9.568 77.0275 10.752C77.3955 9.568 77.7955 8.368 78.2115 7.168L79.3795 3.744ZM89.1546 12.256C86.1146 12.256 84.2906 10.864 84.2746 8.24H86.4026C86.4346 10.032 87.6346 10.512 89.2186 10.512C90.7066 10.512 91.5226 9.936 91.5226 8.864C91.5226 7.968 90.9306 7.568 89.1866 7.216L88.2266 7.024C86.0186 6.608 84.5626 5.632 84.5626 3.568C84.5626 1.68 86.0506 0.351999 88.7866 0.351999C91.9866 0.351999 93.3466 1.856 93.4266 4H91.3306C91.2506 2.784 90.6266 2.096 88.8186 2.096C87.4426 2.096 86.7706 2.64 86.7706 3.504C86.7706 4.416 87.2986 4.832 88.9946 5.184L89.9866 5.376C92.6746 5.904 93.7626 6.944 93.7626 8.752C93.7626 11.008 92.0026 12.256 89.1546 12.256ZM102.952 8.016V8.496H96.7758C96.9198 9.968 97.7518 10.624 98.9198 10.624C99.8798 10.624 100.504 10.176 100.808 9.44H102.744C102.328 11.12 100.888 12.192 98.9038 12.192C96.4718 12.192 94.7918 10.512 94.7918 7.872C94.7918 5.28 96.4238 3.552 98.8718 3.552C101.4 3.552 102.952 5.392 102.952 8.016ZM98.8558 5.12C97.7838 5.12 96.9838 5.728 96.7918 7.088H100.936C100.776 5.92 100.056 5.12 98.8558 5.12ZM111.599 12H109.583C109.455 11.776 109.391 11.392 109.359 10.992C108.815 11.76 107.919 12.192 106.703 12.192C104.943 12.192 103.727 11.312 103.727 9.712C103.727 8.336 104.559 7.36 106.895 7.136L108.143 7.024C108.911 6.928 109.311 6.688 109.311 6.08C109.311 5.44 108.975 5.056 107.807 5.056C106.655 5.056 106.175 5.36 106.095 6.368H104.111C104.223 4.624 105.247 3.552 107.823 3.552C110.287 3.552 111.263 4.544 111.263 6.032V10.432C111.263 11.024 111.375 11.68 111.599 12ZM107.183 10.752C108.255 10.752 109.311 10.176 109.311 8.736V7.984C109.103 8.176 108.799 8.272 108.367 8.32L107.279 8.448C106.159 8.576 105.791 8.976 105.791 9.632C105.791 10.32 106.255 10.752 107.183 10.752ZM117.216 3.616C117.392 3.616 117.536 3.616 117.712 3.648V5.504H117.2C115.712 5.504 114.816 6.24 114.816 7.808V12H112.8V3.744H114.752V5.216C115.152 4.288 115.936 3.616 117.216 3.616ZM122.137 12.192C119.689 12.192 118.057 10.512 118.057 7.872C118.057 5.232 119.673 3.552 122.137 3.552C124.297 3.552 125.737 4.784 125.977 6.72H123.961C123.769 5.696 123.033 5.232 122.137 5.232C120.937 5.232 120.121 6.064 120.121 7.872C120.121 9.68 120.969 10.512 122.137 10.512C123.049 10.512 123.833 10.016 123.993 8.928H126.009C125.785 10.944 124.249 12.192 122.137 12.192ZM131.641 3.552C133.369 3.552 134.537 4.56 134.537 6.528V12H132.521V6.864C132.521 5.808 131.993 5.296 130.969 5.296C130.089 5.296 129.129 5.904 129.129 7.376V12H127.113V0.608H129.129V4.848C129.673 4.096 130.521 3.552 131.641 3.552ZM139.887 12.192C137.439 12.192 135.807 10.512 135.807 7.872C135.807 5.232 137.423 3.552 139.887 3.552C142.047 3.552 143.487 4.784 143.727 6.72H141.711C141.519 5.696 140.783 5.232 139.887 5.232C138.687 5.232 137.871 6.064 137.871 7.872C137.871 9.68 138.719 10.512 139.887 10.512C140.799 10.512 141.583 10.016 141.743 8.928H143.759C143.535 10.944 141.999 12.192 139.887 12.192ZM149.279 3.616C149.455 3.616 149.599 3.616 149.775 3.648V5.504H149.263C147.775 5.504 146.879 6.24 146.879 7.808V12H144.863V3.744H146.815V5.216C147.215 4.288 147.999 3.616 149.279 3.616ZM157.803 12H155.787C155.659 11.776 155.595 11.392 155.563 10.992C155.019 11.76 154.123 12.192 152.907 12.192C151.147 12.192 149.931 11.312 149.931 9.712C149.931 8.336 150.763 7.36 153.099 7.136L154.347 7.024C155.115 6.928 155.515 6.688 155.515 6.08C155.515 5.44 155.179 5.056 154.011 5.056C152.859 5.056 152.379 5.36 152.299 6.368H150.315C150.427 4.624 151.451 3.552 154.027 3.552C156.491 3.552 157.467 4.544 157.467 6.032V10.432C157.467 11.024 157.579 11.68 157.803 12ZM153.387 10.752C154.459 10.752 155.515 10.176 155.515 8.736V7.984C155.307 8.176 155.003 8.272 154.571 8.32L153.483 8.448C152.363 8.576 151.995 8.976 151.995 9.632C151.995 10.32 152.459 10.752 153.387 10.752ZM162.466 2.16C161.746 2.16 161.426 2.512 161.426 3.152V3.744H163.122V5.28H161.426V12H159.426V5.28H158.146V3.744H159.426V3.12C159.426 1.664 160.146 0.559999 162.13 0.559999C162.45 0.559999 162.882 0.575999 163.17 0.608V2.16H162.466ZM168.636 5.28H167.004V9.744C167.004 10.288 167.276 10.464 167.948 10.464H168.636V12C168.268 12.032 167.9 12.064 167.58 12.064C165.836 12.064 165.004 11.472 165.004 9.952V5.28H163.724V3.744H165.004V1.344H167.004V3.744H168.636V5.28Z', fill: 'currentColor' })))));
26
+ }
27
+ }, [0, "searchcraft-popover-footer", {
28
+ "searchResultsCount": [32]
29
+ }]);
30
+ function defineCustomElement() {
31
+ if (typeof customElements === "undefined") {
32
+ return;
33
+ }
34
+ const components = ["searchcraft-popover-footer"];
35
+ components.forEach(tagName => { switch (tagName) {
36
+ case "searchcraft-popover-footer":
37
+ if (!customElements.get(tagName)) {
38
+ customElements.define(tagName, SearchcraftPopoverFooter);
39
+ }
40
+ break;
41
+ } });
42
+ }
43
+
44
+ export { SearchcraftPopoverFooter as S, defineCustomElement as d };
45
+
46
+ //# sourceMappingURL=p-84e2cbd6.js.map
@@ -0,0 +1 @@
1
+ {"file":"p-84e2cbd6.js","mappings":";;;;;MAca,wBAAwB;;;;;IAC1B,kBAAkB,CAAC;IAEpB,WAAW,GAAe,SAAQ,CAAC;IAE3C,gBAAgB;QACd,IAAI,CAAC,kBAAkB,GAAG,gBAAgB,CAAC,QAAQ,EAAE,CAAC,kBAAkB,CAAC;QAEzE,IAAI,CAAC,WAAW,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC,KAAK;YAClD,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC,kBAAkB,CAAC;SACpD,CAAC,CAAC;KACJ;IAED,oBAAoB;QAClB,IAAI,CAAC,WAAW,IAAI,CAAC;KACtB;IAED,MAAM;QACJ,QACE,+DAAQ,KAAK,EAAC,4BAA4B,IACxC,0DAAG,KAAK,EAAC,yCAAyC,IAC/C,IAAI,CAAC,kBAAkB;cACpB,GAAG,sBAAsB,CAAC,IAAI,CAAC,kBAAkB,CAAC,gBAAgB;cAClE,GAAG,CACL,EACJ,0DACE,KAAK,EAAC,iCAAiC,EACvC,IAAI,EAAC,yBAAyB,EAC9B,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,YAAY,IAEhB,4DACE,KAAK,EAAC,uCAAuC,EAC7C,KAAK,EAAC,KAAK,EACX,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,YAAY,EACpB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,IAElC,yFAAqC,EACrC,6DACE,CAAC,EAAC,kmOAAkmO,EACpmO,IAAI,EAAC,cAAc,GACnB,CACE,CACJ,CACG,EACT;KACH;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/searchcraft-popover-footer/searchcraft-popover-footer.tsx"],"sourcesContent":["import { searchcraftStore } from '@store';\nimport { Component, h, State } from '@stencil/core';\n\nimport { formatNumberWithCommas } from '@utils';\n\n/**\n * Renders the footer for the searchcraft-popover-form.\n *\n * @internal\n */\n@Component({\n tag: 'searchcraft-popover-footer',\n shadow: false,\n})\nexport class SearchcraftPopoverFooter {\n @State() searchResultsCount;\n\n private unsubscribe: () => void = () => {};\n\n componentDidLoad() {\n this.searchResultsCount = searchcraftStore.getState().searchResultsCount;\n\n this.unsubscribe = searchcraftStore.subscribe((state) => {\n this.searchResultsCount = state.searchResultsCount;\n });\n }\n\n disconnectedCallback() {\n this.unsubscribe?.();\n }\n\n render() {\n return (\n <footer class='searchcraft-popover-footer'>\n <p class='searchcraft-popover-footer-results-info'>\n {this.searchResultsCount\n ? `${formatNumberWithCommas(this.searchResultsCount)} Results Found`\n : ' '}\n </p>\n <a\n class='searchcraft-popover-footer-link'\n href='https://searchcraft.io/'\n target='_blank'\n rel='noreferrer'\n >\n <svg\n class='searchcraft-popover-footer-link-image'\n width='169'\n height='16'\n viewBox='0 0 169 16'\n fill='none'\n xmlns='http://www.w3.org/2000/svg'\n >\n <title>Powered by Searchcraft</title>\n <path\n d='M5.07288 0.608C7.60088 0.608 8.84888 2.064 8.84888 4.112C8.84888 6.16 7.60088 7.616 5.07288 7.616H1.68088V12H0.336875V0.608H5.07288ZM5.07288 6.4C6.67288 6.4 7.45688 5.552 7.45688 4.112C7.45688 2.672 6.67288 1.824 5.07288 1.824H1.68088V6.4H5.07288ZM13.31 12.192C10.99 12.192 9.31 10.512 9.31 7.872C9.31 5.232 10.99 3.552 13.31 3.552C15.63 3.552 17.31 5.232 17.31 7.872C17.31 10.512 15.63 12.192 13.31 12.192ZM13.31 11.04C14.91 11.04 15.966 9.872 15.966 7.872C15.966 5.872 14.91 4.704 13.31 4.704C11.71 4.704 10.654 5.872 10.654 7.872C10.654 9.872 11.71 11.04 13.31 11.04ZM28.3826 3.744H29.7586L27.0066 12H25.6626L24.4466 8.176C24.1586 7.264 23.8706 6.304 23.6146 5.376C23.3426 6.304 23.0546 7.264 22.7666 8.176L21.5666 12H20.2226L17.4706 3.744H18.8466L20.0146 7.472C20.3346 8.48 20.6226 9.472 20.9106 10.48C21.1826 9.472 21.4706 8.48 21.7906 7.472L22.9426 3.744H24.2866L25.4386 7.472C25.7426 8.464 26.0466 9.456 26.3346 10.448C26.6066 9.456 26.9106 8.464 27.2146 7.472L28.3826 3.744ZM37.5194 7.872V8.32H31.2474C31.3754 10.176 32.3514 11.024 33.7914 11.024C34.9594 11.024 35.6954 10.416 35.9834 9.488H37.3114C36.9114 11.04 35.7274 12.192 33.7594 12.192C31.5034 12.192 29.9194 10.544 29.9194 7.872C29.9194 5.28 31.4394 3.552 33.7274 3.552C36.1914 3.552 37.5194 5.504 37.5194 7.872ZM33.7274 4.72C32.4314 4.72 31.4874 5.536 31.2794 7.168H36.1434C36.0154 5.808 35.1994 4.72 33.7274 4.72ZM42.9101 3.616C43.0381 3.616 43.1661 3.616 43.3421 3.632V4.864H43.0221C41.3741 4.864 40.3181 5.696 40.3181 7.296V12H39.0381V3.744H40.2541V5.2C40.7181 4.336 41.5661 3.616 42.9101 3.616ZM51.2538 7.872V8.32H44.9818C45.1098 10.176 46.0858 11.024 47.5258 11.024C48.6938 11.024 49.4298 10.416 49.7178 9.488H51.0458C50.6458 11.04 49.4618 12.192 47.4938 12.192C45.2378 12.192 43.6538 10.544 43.6538 7.872C43.6538 5.28 45.1738 3.552 47.4618 3.552C49.9258 3.552 51.2538 5.504 51.2538 7.872ZM47.4618 4.72C46.1658 4.72 45.2218 5.536 45.0138 7.168H49.8778C49.7498 5.808 48.9338 4.72 47.4618 4.72ZM58.9805 0.608H60.2605V12H59.0445V10.72C58.4205 11.664 57.4445 12.192 56.2125 12.192C53.8925 12.192 52.3725 10.512 52.3725 7.872C52.3725 5.232 53.8925 3.552 56.2125 3.552C57.4125 3.552 58.3565 4.048 58.9805 4.928V0.608ZM56.3725 11.04C57.9725 11.04 59.0285 9.872 59.0285 7.872C59.0285 5.872 57.9725 4.704 56.3725 4.704C54.7725 4.704 53.7165 5.936 53.7165 7.936C53.7165 9.936 54.7725 11.04 56.3725 11.04ZM69.2736 3.552C71.5936 3.552 73.1136 5.232 73.1136 7.872C73.1136 10.512 71.5936 12.192 69.2736 12.192C68.0416 12.192 67.0656 11.664 66.4416 10.72V12H65.2256V0.608H66.5056V4.928C67.1296 4.048 68.0736 3.552 69.2736 3.552ZM69.1136 11.04C70.7136 11.04 71.7696 9.808 71.7696 7.808C71.7696 5.808 70.7136 4.704 69.1136 4.704C67.5136 4.704 66.4576 5.872 66.4576 7.872C66.4576 9.872 67.5136 11.04 69.1136 11.04ZM79.3795 3.744H80.7715L77.2835 13.296C76.7555 14.752 75.9075 15.184 74.5955 15.184C74.3395 15.184 74.0995 15.168 73.8275 15.136V14.064H74.5795C75.3955 14.064 75.8275 13.696 76.0835 13.04C76.1795 12.8 76.2755 12.528 76.3715 12.272L73.2675 3.744H74.6755L75.8435 7.184C76.2595 8.384 76.6435 9.568 77.0275 10.752C77.3955 9.568 77.7955 8.368 78.2115 7.168L79.3795 3.744ZM89.1546 12.256C86.1146 12.256 84.2906 10.864 84.2746 8.24H86.4026C86.4346 10.032 87.6346 10.512 89.2186 10.512C90.7066 10.512 91.5226 9.936 91.5226 8.864C91.5226 7.968 90.9306 7.568 89.1866 7.216L88.2266 7.024C86.0186 6.608 84.5626 5.632 84.5626 3.568C84.5626 1.68 86.0506 0.351999 88.7866 0.351999C91.9866 0.351999 93.3466 1.856 93.4266 4H91.3306C91.2506 2.784 90.6266 2.096 88.8186 2.096C87.4426 2.096 86.7706 2.64 86.7706 3.504C86.7706 4.416 87.2986 4.832 88.9946 5.184L89.9866 5.376C92.6746 5.904 93.7626 6.944 93.7626 8.752C93.7626 11.008 92.0026 12.256 89.1546 12.256ZM102.952 8.016V8.496H96.7758C96.9198 9.968 97.7518 10.624 98.9198 10.624C99.8798 10.624 100.504 10.176 100.808 9.44H102.744C102.328 11.12 100.888 12.192 98.9038 12.192C96.4718 12.192 94.7918 10.512 94.7918 7.872C94.7918 5.28 96.4238 3.552 98.8718 3.552C101.4 3.552 102.952 5.392 102.952 8.016ZM98.8558 5.12C97.7838 5.12 96.9838 5.728 96.7918 7.088H100.936C100.776 5.92 100.056 5.12 98.8558 5.12ZM111.599 12H109.583C109.455 11.776 109.391 11.392 109.359 10.992C108.815 11.76 107.919 12.192 106.703 12.192C104.943 12.192 103.727 11.312 103.727 9.712C103.727 8.336 104.559 7.36 106.895 7.136L108.143 7.024C108.911 6.928 109.311 6.688 109.311 6.08C109.311 5.44 108.975 5.056 107.807 5.056C106.655 5.056 106.175 5.36 106.095 6.368H104.111C104.223 4.624 105.247 3.552 107.823 3.552C110.287 3.552 111.263 4.544 111.263 6.032V10.432C111.263 11.024 111.375 11.68 111.599 12ZM107.183 10.752C108.255 10.752 109.311 10.176 109.311 8.736V7.984C109.103 8.176 108.799 8.272 108.367 8.32L107.279 8.448C106.159 8.576 105.791 8.976 105.791 9.632C105.791 10.32 106.255 10.752 107.183 10.752ZM117.216 3.616C117.392 3.616 117.536 3.616 117.712 3.648V5.504H117.2C115.712 5.504 114.816 6.24 114.816 7.808V12H112.8V3.744H114.752V5.216C115.152 4.288 115.936 3.616 117.216 3.616ZM122.137 12.192C119.689 12.192 118.057 10.512 118.057 7.872C118.057 5.232 119.673 3.552 122.137 3.552C124.297 3.552 125.737 4.784 125.977 6.72H123.961C123.769 5.696 123.033 5.232 122.137 5.232C120.937 5.232 120.121 6.064 120.121 7.872C120.121 9.68 120.969 10.512 122.137 10.512C123.049 10.512 123.833 10.016 123.993 8.928H126.009C125.785 10.944 124.249 12.192 122.137 12.192ZM131.641 3.552C133.369 3.552 134.537 4.56 134.537 6.528V12H132.521V6.864C132.521 5.808 131.993 5.296 130.969 5.296C130.089 5.296 129.129 5.904 129.129 7.376V12H127.113V0.608H129.129V4.848C129.673 4.096 130.521 3.552 131.641 3.552ZM139.887 12.192C137.439 12.192 135.807 10.512 135.807 7.872C135.807 5.232 137.423 3.552 139.887 3.552C142.047 3.552 143.487 4.784 143.727 6.72H141.711C141.519 5.696 140.783 5.232 139.887 5.232C138.687 5.232 137.871 6.064 137.871 7.872C137.871 9.68 138.719 10.512 139.887 10.512C140.799 10.512 141.583 10.016 141.743 8.928H143.759C143.535 10.944 141.999 12.192 139.887 12.192ZM149.279 3.616C149.455 3.616 149.599 3.616 149.775 3.648V5.504H149.263C147.775 5.504 146.879 6.24 146.879 7.808V12H144.863V3.744H146.815V5.216C147.215 4.288 147.999 3.616 149.279 3.616ZM157.803 12H155.787C155.659 11.776 155.595 11.392 155.563 10.992C155.019 11.76 154.123 12.192 152.907 12.192C151.147 12.192 149.931 11.312 149.931 9.712C149.931 8.336 150.763 7.36 153.099 7.136L154.347 7.024C155.115 6.928 155.515 6.688 155.515 6.08C155.515 5.44 155.179 5.056 154.011 5.056C152.859 5.056 152.379 5.36 152.299 6.368H150.315C150.427 4.624 151.451 3.552 154.027 3.552C156.491 3.552 157.467 4.544 157.467 6.032V10.432C157.467 11.024 157.579 11.68 157.803 12ZM153.387 10.752C154.459 10.752 155.515 10.176 155.515 8.736V7.984C155.307 8.176 155.003 8.272 154.571 8.32L153.483 8.448C152.363 8.576 151.995 8.976 151.995 9.632C151.995 10.32 152.459 10.752 153.387 10.752ZM162.466 2.16C161.746 2.16 161.426 2.512 161.426 3.152V3.744H163.122V5.28H161.426V12H159.426V5.28H158.146V3.744H159.426V3.12C159.426 1.664 160.146 0.559999 162.13 0.559999C162.45 0.559999 162.882 0.575999 163.17 0.608V2.16H162.466ZM168.636 5.28H167.004V9.744C167.004 10.288 167.276 10.464 167.948 10.464H168.636V12C168.268 12.032 167.9 12.064 167.58 12.064C165.836 12.064 165.004 11.472 165.004 9.952V5.28H163.724V3.744H165.004V1.344H167.004V3.744H168.636V5.28Z'\n fill='currentColor'\n />\n </svg>\n </a>\n </footer>\n );\n }\n}\n"],"version":3}
@@ -1,5 +1,6 @@
1
1
  import { p as proxyCustomElement, H, c as createEvent, h } from './p-5365011f.js';
2
2
  import { g as getMillis } from './p-6104fe5d.js';
3
+ import './p-a64b4cba.js';
3
4
  import { c as classNames } from './p-5cdc6210.js';
4
5
 
5
6
  const SearchcraftSlider = /*@__PURE__*/ proxyCustomElement(class SearchcraftSlider extends H {
@@ -76,10 +77,10 @@ const SearchcraftSlider = /*@__PURE__*/ proxyCustomElement(class SearchcraftSlid
76
77
  const endLabel = this.dataType === 'number'
77
78
  ? this.endValue
78
79
  : new Date(this.endValue).getFullYear();
79
- return (h("div", { key: 'ec4a36e1ce6534b7c077114086d759e0b1e7a24e', class: 'searchcraft-slider-container' }, h("div", { key: '35487cbeaeeb23052631804704645ca929340f70', class: 'searchcraft-slider-range-container' }, h("div", { key: '186e699def8e7a6e58e8ad5f04953ac1c6584344', class: 'searchcraft-slider-active-range', style: {
80
+ return (h("div", { key: '9225b18ce2f40246837d183fcefdd0be7cc22383', class: 'searchcraft-slider' }, h("div", { key: '8078c1eda2ceb781282f59216915896fdbe2a8d3', class: 'searchcraft-slider-range' }, h("div", { key: '6a6bafa9f7abf41ab24f020cd291a4a08c618afb', class: 'searchcraft-slider-active-range', style: {
80
81
  left: `${startPercent}%`,
81
82
  width: `${endPercent - startPercent}%`,
82
- } }), h("input", { key: '97638e2a1471888c2be47f7526e9dd98fea58683', class: classNames('searchcraft-slider-input', 'searchcraft-slider-input-min-handle'), max: this.max, min: this.min, onInput: this.handleStartValueChange.bind(this), step: this.granularity, style: { zIndex: this.lastFocusedHandle === 'min' ? '2' : '1' }, type: 'range', value: this.startValue }), h("input", { key: 'db2abded80b606d17bde1677e4acc09a85e6e20e', class: classNames('searchcraft-slider-input', 'searchcraft-slider-input-max-handle'), max: this.max, min: this.min, onInput: this.handleEndValueChange.bind(this), step: this.granularity, style: { zIndex: this.lastFocusedHandle === 'max' ? '2' : '1' }, type: 'range', value: this.endValue })), h("div", { key: '83954b6955a872a17377d506d2d8458059acac03', class: 'searchcraft-slider-label-container' }, h("span", { key: 'b5315b4438385ecf5df3f76579fdf102b6a8c39c', class: 'searchcraft-slider-label' }, startLabel), h("span", { key: '875094ac7ee69e04c3a16407388dd27f167b3c8f', class: 'searchcraft-slider-label' }, endLabel))));
83
+ } }), h("input", { key: 'f07a91d441d277b8e9eba34e39093393a44bbf53', class: classNames('searchcraft-slider-input', 'searchcraft-slider-input-min-handle'), max: this.max, min: this.min, onInput: this.handleStartValueChange.bind(this), step: this.granularity, style: { zIndex: this.lastFocusedHandle === 'min' ? '2' : '1' }, type: 'range', value: this.startValue }), h("input", { key: '0637ea5fe123abe1d77c540b347c78fc8ad3d281', class: classNames('searchcraft-slider-input', 'searchcraft-slider-input-max-handle'), max: this.max, min: this.min, onInput: this.handleEndValueChange.bind(this), step: this.granularity, style: { zIndex: this.lastFocusedHandle === 'max' ? '2' : '1' }, type: 'range', value: this.endValue })), h("div", { key: 'b62f8d8485915dddefb7ca29f62b4a96d70470c5', class: 'searchcraft-slider-label' }, h("span", { key: 'fd5d32172ce53d93b858ca54c17b12b80fcdde1d', class: 'searchcraft-slider-start-label' }, startLabel), h("span", { key: '8f4d230b78fb8d896a469f17ade3a3fd3162b427', class: 'searchcraft-slider-end-label' }, endLabel))));
83
84
  }
84
85
  }, [0, "searchcraft-slider", {
85
86
  "max": [2],
@@ -106,4 +107,4 @@ function defineCustomElement() {
106
107
 
107
108
  export { SearchcraftSlider as S, defineCustomElement as d };
108
109
 
109
- //# sourceMappingURL=p-bb12ab5a.js.map
110
+ //# sourceMappingURL=p-868803f9.js.map
@@ -0,0 +1 @@
1
+ {"file":"p-868803f9.js","mappings":";;;;;MAoBa,iBAAiB;;;;;;;;;IAIpB,GAAG,GAAG,GAAG,CAAC;;;;IAIV,GAAG,GAAG,CAAC,CAAC;;;;IAIR,WAAW,GAAW,SAAS,CAAC,OAAO,CAAC,CAAC;;IAEzC,QAAQ,GAAsB,QAAQ,CAAC;IAEtC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC;IACpB,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC;IACtB,iBAAiB,GAAkB,KAAK,CAAC;;;;IAKzC,YAAY,CAEP;IAEd,gBAAgB;QACd,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC;KAC1B;IAEO,UAAU,GAAG;QACnB,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC;YACtB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC,CAAC;KACJ,CAAC;IAEM,sBAAsB,GAAG,CAAC,KAAiB;QACjD,MAAM,YAAY,GAAG,KAAK,CAAC,MAA0B,CAAC;QACtD,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACtD,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC;QAC/B,IAAI,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE;YAC1B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;YACxB,IAAI,CAAC,UAAU,EAAE,CAAC;SACnB;aAAM;YACL,IAAI,CAAC,UAAU,GAAG,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;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/searchcraft-slider/searchcraft-slider.tsx"],"sourcesContent":["import {\n Component,\n Event,\n type EventEmitter,\n h,\n State,\n Prop,\n} from '@stencil/core';\nimport { getMillis } from '@utils';\nimport classNames from 'classnames';\n\n/**\n * This web component is designed to allow users to select a value from a range defined by a minimum and maximum value. The component renders a slider interface, which can be used to visually choose a value between two boundaries.\n *\n * @internal\n */\n@Component({\n tag: 'searchcraft-slider',\n shadow: false,\n})\nexport class SearchcraftSlider {\n /**\n * The maximum value allowed.\n */\n @Prop() max = 100;\n /**\n * The minimum value allowed.\n */\n @Prop() min = 0;\n /**\n * The granularity that the value must adhere to.\n */\n @Prop() granularity: number = getMillis('month');\n /** The type of data allowed. */\n @Prop() dataType: 'number' | 'date' = 'number';\n\n @State() endValue = this.max;\n @State() startValue = this.min;\n @State() lastFocusedHandle: 'min' | 'max' = 'max';\n\n /**\n * When the range has changed.\n * */\n @Event() rangeChanged:\n | EventEmitter<{ startValue: number; endValue: number }>\n | undefined;\n\n componentDidLoad() {\n this.startValue = this.min;\n this.endValue = this.max;\n }\n\n private emitUpdate = async () => {\n this.rangeChanged?.emit({\n startValue: this.startValue,\n endValue: this.endValue,\n });\n };\n\n private handleStartValueChange = (event: InputEvent) => {\n const inputElement = event.target as HTMLInputElement;\n const value = Number.parseInt(inputElement.value, 10);\n this.lastFocusedHandle = 'min';\n if (value <= this.endValue) {\n this.startValue = value;\n this.emitUpdate();\n } else {\n this.startValue = this.endValue;\n inputElement.value = `${this.endValue}`;\n }\n };\n\n private handleEndValueChange = (event: InputEvent) => {\n const inputElement = event.target as HTMLInputElement;\n const value = Number.parseInt(inputElement.value, 10);\n this.lastFocusedHandle = 'max';\n if (value >= this.startValue) {\n this.endValue = value;\n this.emitUpdate();\n } else {\n this.endValue = this.startValue;\n inputElement.value = `${this.startValue}`;\n }\n };\n\n render() {\n const rangeMin = this.min;\n const rangeMax = this.max;\n const startPercent =\n ((this.startValue - rangeMin) / (rangeMax - rangeMin)) * 100;\n const endPercent =\n ((this.endValue - rangeMin) / (rangeMax - rangeMin)) * 100;\n\n const startLabel =\n this.dataType === 'number'\n ? this.startValue\n : new Date(this.startValue).getFullYear();\n\n const endLabel =\n this.dataType === 'number'\n ? this.endValue\n : new Date(this.endValue).getFullYear();\n\n return (\n <div class='searchcraft-slider'>\n <div class='searchcraft-slider-range'>\n <div\n class='searchcraft-slider-active-range'\n style={{\n left: `${startPercent}%`,\n width: `${endPercent - startPercent}%`,\n }}\n />\n <input\n class={classNames(\n 'searchcraft-slider-input',\n 'searchcraft-slider-input-min-handle',\n )}\n max={this.max}\n min={this.min}\n onInput={this.handleStartValueChange.bind(this)}\n step={this.granularity}\n style={{ zIndex: this.lastFocusedHandle === 'min' ? '2' : '1' }}\n type='range'\n value={this.startValue}\n />\n <input\n class={classNames(\n 'searchcraft-slider-input',\n 'searchcraft-slider-input-max-handle',\n )}\n max={this.max}\n min={this.min}\n onInput={this.handleEndValueChange.bind(this)}\n step={this.granularity}\n style={{ zIndex: this.lastFocusedHandle === 'max' ? '2' : '1' }}\n type='range'\n value={this.endValue}\n />\n </div>\n <div class='searchcraft-slider-label'>\n <span class='searchcraft-slider-start-label'>{startLabel}</span>\n <span class='searchcraft-slider-end-label'>{endLabel}</span>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
@@ -1,7 +1,7 @@
1
1
  import { p as proxyCustomElement, H, h } from './p-5365011f.js';
2
- import { n as nanoid, d as defineCustomElement$2 } from './p-5fdaf1e6.js';
3
- import { s as searchcraftStore } from './p-580c09dc.js';
4
- import { d as defineCustomElement$1 } from './p-8f854dec.js';
2
+ import { n as nanoid, d as defineCustomElement$2 } from './p-13e81b5d.js';
3
+ import { s as searchcraftStore } from './p-17c646e2.js';
4
+ import { d as defineCustomElement$1 } from './p-5d17ace0.js';
5
5
 
6
6
  const SearchcraftPopoverListView = /*@__PURE__*/ proxyCustomElement(class SearchcraftPopoverListView extends H {
7
7
  constructor() {
@@ -131,4 +131,4 @@ function defineCustomElement() {
131
131
 
132
132
  export { SearchcraftPopoverListView as S, defineCustomElement as d };
133
133
 
134
- //# sourceMappingURL=p-60f05735.js.map
134
+ //# sourceMappingURL=p-a62a2e74.js.map
@@ -0,0 +1 @@
1
+ {"file":"p-a62a2e74.js","mappings":";;;;;MAyBa,0BAA0B;;;;;;;;;IAK7B,qBAAqB,CAAoC;;;;IAIzD,yBAAyB,CAAyC;IAClE,qBAAqB,CAAqC;IAC1D,iBAAiB,CAAU;IAC3B,oBAAoB,CAAU;IAE9B,MAAM,GAAG,gBAAgB,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC;IAE1D,gBAAgB;QACd,QACE,WAAK,KAAK,EAAC,+BAA+B,IACvC,IAAI,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAC,IAAI,MACpC,sBACE,oBAAoB,EAAE,IAAI,EAC1B,aAAa,EAAE,MAAM,EAAE,EACvB,QAAQ,EAAC,eAAe,EACxB,GAAG,EAAE,IAAI,CAAC,EAAE,GACZ,CACH,CAAC,EACD,IAAI,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,MAC/C,qCACE,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,IAAI,CAAC,EAAE,EACZ,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,EACjD,gBAAgB,EACd,IAAI,CAAC,oBAAoB,IAAI,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC,GAAG,KAAK,GAElE,CACH,CAAC,CACE,EACN;KACH;IAED,mBAAmB;QACjB,MAAM,aAAa,GAAkB,EAAE,CAAC;QACxC,MAAM,oBAAoB,GAAG,IAAI,CAAC,MAAM,EAAE,4BAA4B,IAAI,CAAC,CAAC;QAC5E,MAAM,oBAAoB,GAAG,IAAI,CAAC,MAAM,EAAE,4BAA4B,IAAI,CAAC,CAAC;QAC5E,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,EAAE,qBAA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I,CAAC,mBAAmB,EAAE,CAAC;YACpC,KAAK,QAAQ;gBACX,OAAO,IAAI,CAAC,mBAAmB,EAAE,CAAC;YACpC;gBACE,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC;SACjC;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/searchcraft-popover-list-view/searchcraft-popover-list-view.tsx"],"sourcesContent":["import type {\n AdClientResponseItem,\n SearchClientResponseItem,\n} from '@searchcraft/core';\nimport { Component, h, Prop, type JSX } from '@stencil/core';\nimport { nanoid } from 'nanoid';\n\nimport type { PopoverResultMappings } from '@searchcraft/core';\nimport { searchcraftStore } from '@store';\n\n/**\n * This web component is designed to display a list of results within a popover interface.\n * It is consumed within the `searchcraft-popover-form` component.\n *\n * @js-example\n * ```html\n * <searchcraft-popover-list-view />\n * ```\n *\n * @internal\n */\n@Component({\n tag: 'searchcraft-popover-list-view',\n shadow: false,\n})\nexport class SearchcraftPopoverListView {\n /**\n * The mappings that define how the data in the documents are mapped to the\n * list-view-item elements.\n */\n @Prop() popoverResultMappings: PopoverResultMappings | undefined;\n /**\n * The items to render in the list view.\n */\n @Prop() searchClientResponseItems: SearchClientResponseItem[] | undefined;\n @Prop() adClientResponseItems: AdClientResponseItem[] | undefined;\n @Prop() searchResultsPage!: number;\n @Prop() searchResultsPerPage!: number;\n\n private config = searchcraftStore.getState().core?.config;\n\n renderWithADMAds() {\n return (\n <div class='searchcraft-popover-list-view'>\n {this.adClientResponseItems?.map((item) => (\n <searchcraft-ad\n adClientResponseItem={item}\n adContainerId={nanoid()}\n adSource='adMarketplace'\n key={item.id}\n />\n ))}\n {this.searchClientResponseItems?.map((item, index) => (\n <searchcraft-popover-list-item\n item={item}\n key={item.id}\n popoverResultMappings={this.popoverResultMappings}\n documentPosition={\n this.searchResultsPerPage * (this.searchResultsPage - 1) + index\n }\n />\n ))}\n </div>\n );\n }\n\n renderWithCustomAds() {\n const itemsToRender: JSX.Element[] = [];\n const interstitialInterval = this.config?.customAdInterstitialInterval || 0;\n const interstitialQuantity = this.config?.customAdInterstitialQuantity || 1;\n const adStartQuantity = this.config?.customAdStartQuantity || 0;\n const adEndQuantity = this.config?.customAdEndQuantity || 0;\n const searchItems = this.searchClientResponseItems || [];\n\n // Renders ads at beginning\n for (let n = 0; n < adStartQuantity; n++) {\n itemsToRender.push(\n <searchcraft-ad\n adSource='Custom'\n adContainerId={nanoid()}\n key={`${n}-ad`}\n />,\n );\n }\n\n // Renders search results + interstitial ads\n searchItems.forEach((item, index) => {\n if (\n interstitialInterval &&\n index % interstitialInterval === 0 &&\n index + interstitialInterval < searchItems.length &&\n index >= interstitialInterval\n ) {\n for (let n = 0; n < interstitialQuantity; n++) {\n itemsToRender.push(\n <searchcraft-ad\n adSource='Custom'\n adContainerId={nanoid()}\n key={`${item.id}-ad-${n}`}\n />,\n );\n }\n }\n\n itemsToRender.push(\n <searchcraft-popover-list-item\n item={item}\n key={item.id}\n popoverResultMappings={this.popoverResultMappings}\n documentPosition={\n this.searchResultsPerPage * (this.searchResultsPage - 1) + index\n }\n />,\n );\n });\n\n // Renders ads at end\n for (let n = 0; n < adEndQuantity; n++) {\n itemsToRender.push(\n <searchcraft-ad\n adSource='Custom'\n adContainerId={nanoid()}\n key={`${n}-ad`}\n />,\n );\n }\n\n return <div class='searchcraft-popover-list-view'>{itemsToRender}</div>;\n }\n\n renderWithNativoAds() {\n const itemsToRender: JSX.Element[] = [];\n const interstitialStartIndex =\n this.config?.nativoAdInterstialStartIndex || 0;\n const interstitialInterval = this.config?.nativoAdInterstitialInterval || 0;\n const interstitialQuantity = this.config?.nativoAdInterstitialQuantity || 1;\n const adStartQuantity = this.config?.nativoAdStartQuantity || 0;\n const adEndQuantity = this.config?.nativoAdEndQuantity || 0;\n const searchItems = this.searchClientResponseItems || [];\n\n // Renders ads at beginning\n for (let n = 0; n < adStartQuantity; n++) {\n itemsToRender.push(\n <searchcraft-ad\n adSource='Nativo'\n adContainerId={nanoid()}\n key={`${n}-ad`}\n />,\n );\n }\n\n // Renders search results + interstitial ads\n searchItems.forEach((item, index) => {\n if (\n interstitialInterval &&\n (index + interstitialStartIndex) % interstitialInterval === 0 &&\n index + interstitialInterval < searchItems.length &&\n index >= interstitialInterval\n ) {\n for (let n = 0; n < interstitialQuantity; n++) {\n itemsToRender.push(\n <searchcraft-ad\n adSource='Nativo'\n adContainerId={nanoid()}\n key={`${item.id}-ad-${n}`}\n />,\n );\n }\n }\n\n itemsToRender.push(\n <searchcraft-popover-list-item\n item={item}\n key={item.id}\n popoverResultMappings={this.popoverResultMappings}\n documentPosition={\n this.searchResultsPerPage * (this.searchResultsPage - 1) + index\n }\n />,\n );\n });\n\n // Renders ads at end\n for (let n = 0; n < adEndQuantity; n++) {\n itemsToRender.push(\n <searchcraft-ad\n adSource='Nativo'\n adContainerId={nanoid()}\n key={`${n}-ad`}\n />,\n );\n }\n\n return <div class='searchcraft-popover-list-view'>{itemsToRender}</div>;\n }\n\n renderWithNoAds() {\n return (\n <div class='searchcraft-popover-list-view'>\n {this.searchClientResponseItems?.map((item, index) => (\n <searchcraft-popover-list-item\n item={item}\n key={item.id}\n popoverResultMappings={this.popoverResultMappings}\n documentPosition={\n this.searchResultsPerPage * (this.searchResultsPage - 1) + index\n }\n />\n ))}\n </div>\n );\n }\n\n render() {\n switch (this.config?.adSource || 'None') {\n case 'adMarketplace':\n return this.renderWithADMAds();\n case 'Custom':\n return this.renderWithCustomAds();\n case 'Nativo':\n return this.renderWithNativoAds();\n default:\n return this.renderWithNoAds();\n }\n }\n}\n"],"version":3}
@@ -1,6 +1,3 @@
1
- import { p as proxyCustomElement, H, h } from './p-5365011f.js';
2
- import { s as searchcraftStore } from './p-580c09dc.js';
3
-
4
1
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
5
2
 
6
3
  var purify = {exports: {}};
@@ -1353,146 +1350,6 @@ var purify = {exports: {}};
1353
1350
 
1354
1351
  const DOMPurify = purify.exports;
1355
1352
 
1356
- const urlAlphabet =
1357
- 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
1358
-
1359
- let nanoid = (size = 21) => {
1360
- let id = '';
1361
- let bytes = crypto.getRandomValues(new Uint8Array((size |= 0)));
1362
- while (size--) {
1363
- id += urlAlphabet[bytes[size] & 63];
1364
- }
1365
- return id
1366
- };
1367
-
1368
- const SearchcraftPopoverListItemAd = /*@__PURE__*/ proxyCustomElement(class SearchcraftPopoverListItemAd extends H {
1369
- constructor() {
1370
- super();
1371
- this.__registerHost();
1372
- }
1373
- adSource = 'Custom';
1374
- adClientResponseItem;
1375
- adContainerId = nanoid();
1376
- searchTerm;
1377
- isSearchInProgress = false;
1378
- get hostElement() { return this; }
1379
- core;
1380
- intersectionObserver;
1381
- storeUnsubscribe;
1382
- adContainerRenderedTimeout;
1383
- isComponentConnected = true;
1384
- connectedCallback() {
1385
- const currentState = searchcraftStore.getState();
1386
- this.core = currentState.core;
1387
- this.searchTerm = currentState.searchTerm;
1388
- this.isSearchInProgress = currentState.isSearchInProgress;
1389
- // Subscribes to store changes (for search term).
1390
- this.storeUnsubscribe = searchcraftStore.subscribe((state) => {
1391
- this.searchTerm = state.searchTerm;
1392
- this.isSearchInProgress = state.isSearchInProgress;
1393
- });
1394
- }
1395
- componentDidLoad() {
1396
- /**
1397
- * Handles when an ad container is viewable within the document,
1398
- * Core emits an ad_container_viewed event and performs ad client side effects
1399
- */
1400
- if (this.hostElement) {
1401
- this.intersectionObserver = new IntersectionObserver(([entry]) => {
1402
- if (entry?.isIntersecting && !this.isSearchInProgress) {
1403
- this.core?.handleAdContainerViewed({
1404
- adClientResponseItem: this.adClientResponseItem,
1405
- adContainerId: this.adContainerId,
1406
- adSource: this.adSource,
1407
- searchTerm: this.searchTerm || '',
1408
- });
1409
- }
1410
- }, { threshold: 0 });
1411
- this.intersectionObserver.observe(this.hostElement);
1412
- }
1413
- }
1414
- disconnectedCallback() {
1415
- this.storeUnsubscribe?.();
1416
- this.intersectionObserver?.disconnect();
1417
- this.isComponentConnected = false;
1418
- clearTimeout(this.adContainerRenderedTimeout);
1419
- }
1420
- renderADMAd() {
1421
- const item = this.adClientResponseItem;
1422
- if (!item.admAd) {
1423
- return;
1424
- }
1425
- return (h("a", { class: 'searchcraft-adm-ad', href: item.admAd.click_url }, item.admAd.image_url && (h("div", { class: 'searchcraft-adm-ad-image-wrapper' }, h("img", { alt: item.admAd.term || 'image', src: item.admAd.image_url, class: 'searchcraft-adm-ad-image' }))), h("div", { class: 'searchcraft-adm-ad-info-wrapper' }, h("p", { class: 'searchcraft-adm-ad-title' }, item.admAd.term), item.admAd.price && (h("p", { class: 'searchcraft-adm-ad-subtitle' }, item.admAd.price)))));
1426
- }
1427
- renderCustomAd() {
1428
- const templateRenderFunction = this.core?.config?.customAdTemplate;
1429
- const containerId = `searchcraft-custom-ad-${this.adContainerId}`;
1430
- let containerInnerHTML = '<p>Custom Ad Placeholder</p>';
1431
- if (templateRenderFunction) {
1432
- containerInnerHTML = templateRenderFunction({
1433
- searchTerm: this.searchTerm || '',
1434
- adContainerId: this.adContainerId,
1435
- });
1436
- }
1437
- return (h("div", { class: 'searchcraft-custom-ad', id: containerId, "data-searchcraft-ad-container-id": this.adContainerId, innerHTML: DOMPurify.sanitize(containerInnerHTML) }));
1438
- }
1439
- renderNativoAd() {
1440
- const nativoClassName = this.core?.config.nativoAdClassName || 'ntv-item';
1441
- return h("div", { class: nativoClassName });
1442
- }
1443
- render() {
1444
- // Don't render ads while search is in progress
1445
- if (this.isSearchInProgress) {
1446
- return;
1447
- }
1448
- /**
1449
- * Handles when an ad container is first rendered.
1450
- * Core emits an ad_container_rendered event and performs ad client side effects
1451
- *
1452
- */
1453
- if (this.isComponentConnected) {
1454
- clearTimeout(this.adContainerRenderedTimeout);
1455
- this.adContainerRenderedTimeout = setTimeout(() => {
1456
- this.core?.handleAdContainerRendered({
1457
- adClientResponseItem: this.adClientResponseItem,
1458
- adContainerId: this.adContainerId,
1459
- adSource: this.adSource,
1460
- searchTerm: this.searchTerm || '',
1461
- });
1462
- }, this.core?.config?.adContainerRenderedDebounceDelay || 500);
1463
- }
1464
- switch (this.adSource) {
1465
- case 'adMarketplace':
1466
- return this.renderADMAd();
1467
- case 'Custom':
1468
- return this.renderCustomAd();
1469
- case 'Nativo':
1470
- return this.renderNativoAd();
1471
- default:
1472
- return;
1473
- }
1474
- }
1475
- }, [0, "searchcraft-ad", {
1476
- "adSource": [1, "ad-source"],
1477
- "adClientResponseItem": [16],
1478
- "adContainerId": [1, "ad-container-id"],
1479
- "searchTerm": [32],
1480
- "isSearchInProgress": [32]
1481
- }]);
1482
- function defineCustomElement() {
1483
- if (typeof customElements === "undefined") {
1484
- return;
1485
- }
1486
- const components = ["searchcraft-ad"];
1487
- components.forEach(tagName => { switch (tagName) {
1488
- case "searchcraft-ad":
1489
- if (!customElements.get(tagName)) {
1490
- customElements.define(tagName, SearchcraftPopoverListItemAd);
1491
- }
1492
- break;
1493
- } });
1494
- }
1495
-
1496
- export { SearchcraftPopoverListItemAd as S, defineCustomElement as d, nanoid as n };
1353
+ export { DOMPurify as D };
1497
1354
 
1498
- //# sourceMappingURL=p-5fdaf1e6.js.map
1355
+ //# sourceMappingURL=p-a64b4cba.js.map