@ppg_pl/tinting 0.0.0

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 (197) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +81 -0
  3. package/dist/cjs/index-0a139db0.js +1667 -0
  4. package/dist/cjs/index-0a139db0.js.map +1 -0
  5. package/dist/cjs/index.cjs.js +4 -0
  6. package/dist/cjs/index.cjs.js.map +1 -0
  7. package/dist/cjs/loader.cjs.js +24 -0
  8. package/dist/cjs/loader.cjs.js.map +1 -0
  9. package/dist/cjs/modal-header_10.cjs.entry.js +12313 -0
  10. package/dist/cjs/modal-header_10.cjs.entry.js.map +1 -0
  11. package/dist/cjs/tinting.cjs.js +28 -0
  12. package/dist/cjs/tinting.cjs.js.map +1 -0
  13. package/dist/collection/collection-manifest.json +21 -0
  14. package/dist/collection/components/api/index.js +23 -0
  15. package/dist/collection/components/api/index.js.map +1 -0
  16. package/dist/collection/components/api/services.js +96 -0
  17. package/dist/collection/components/api/services.js.map +1 -0
  18. package/dist/collection/components/backdrop/index.css +14 -0
  19. package/dist/collection/components/backdrop/index.js +17 -0
  20. package/dist/collection/components/backdrop/index.js.map +1 -0
  21. package/dist/collection/components/colorbox/index.css +53 -0
  22. package/dist/collection/components/colorbox/index.js +182 -0
  23. package/dist/collection/components/colorbox/index.js.map +1 -0
  24. package/dist/collection/components/colorinfo/index.js +239 -0
  25. package/dist/collection/components/colorinfo/index.js.map +1 -0
  26. package/dist/collection/components/component/index.css +6 -0
  27. package/dist/collection/components/component/index.js +220 -0
  28. package/dist/collection/components/component/index.js.map +1 -0
  29. package/dist/collection/components/header/assets/close.png +0 -0
  30. package/dist/collection/components/header/index.css +180 -0
  31. package/dist/collection/components/header/index.js +334 -0
  32. package/dist/collection/components/header/index.js.map +1 -0
  33. package/dist/collection/components/loader/index.css +85 -0
  34. package/dist/collection/components/loader/index.js +19 -0
  35. package/dist/collection/components/loader/index.js.map +1 -0
  36. package/dist/collection/components/modal/__mocks__/index.js +759 -0
  37. package/dist/collection/components/modal/__mocks__/index.js.map +1 -0
  38. package/dist/collection/components/modal/assets/arrow_down.png +0 -0
  39. package/dist/collection/components/modal/index.css +386 -0
  40. package/dist/collection/components/modal/index.js +646 -0
  41. package/dist/collection/components/modal/index.js.map +1 -0
  42. package/dist/collection/components/search/assets/search.svg +15 -0
  43. package/dist/collection/components/search/index.css +38 -0
  44. package/dist/collection/components/search/index.js +178 -0
  45. package/dist/collection/components/search/index.js.map +1 -0
  46. package/dist/collection/components/select/assets/chevron-down.webp +0 -0
  47. package/dist/collection/components/select/assets/chevron.png +0 -0
  48. package/dist/collection/components/select/index.css +77 -0
  49. package/dist/collection/components/select/index.js +231 -0
  50. package/dist/collection/components/select/index.js.map +1 -0
  51. package/dist/collection/components/slider/index.css +89 -0
  52. package/dist/collection/components/slider/index.js +145 -0
  53. package/dist/collection/components/slider/index.js.map +1 -0
  54. package/dist/collection/gtmUtils.js +4 -0
  55. package/dist/collection/gtmUtils.js.map +1 -0
  56. package/dist/collection/index.js +2 -0
  57. package/dist/collection/index.js.map +1 -0
  58. package/dist/collection/types.js +2 -0
  59. package/dist/collection/types.js.map +1 -0
  60. package/dist/collection/utils/index.js +12 -0
  61. package/dist/collection/utils/index.js.map +1 -0
  62. package/dist/components/gtmUtils.js +7 -0
  63. package/dist/components/gtmUtils.js.map +1 -0
  64. package/dist/components/index.d.ts +27 -0
  65. package/dist/components/index.js +3 -0
  66. package/dist/components/index.js.map +1 -0
  67. package/dist/components/index10.js +31 -0
  68. package/dist/components/index10.js.map +1 -0
  69. package/dist/components/index11.js +3949 -0
  70. package/dist/components/index11.js.map +1 -0
  71. package/dist/components/index2.js +2726 -0
  72. package/dist/components/index2.js.map +1 -0
  73. package/dist/components/index3.js +87 -0
  74. package/dist/components/index3.js.map +1 -0
  75. package/dist/components/index4.js +121 -0
  76. package/dist/components/index4.js.map +1 -0
  77. package/dist/components/index5.js +26 -0
  78. package/dist/components/index5.js.map +1 -0
  79. package/dist/components/index6.js +31 -0
  80. package/dist/components/index6.js.map +1 -0
  81. package/dist/components/index7.js +75 -0
  82. package/dist/components/index7.js.map +1 -0
  83. package/dist/components/index8.js +87 -0
  84. package/dist/components/index8.js.map +1 -0
  85. package/dist/components/index9.js +5306 -0
  86. package/dist/components/index9.js.map +1 -0
  87. package/dist/components/modal-header.d.ts +11 -0
  88. package/dist/components/modal-header.js +8 -0
  89. package/dist/components/modal-header.js.map +1 -0
  90. package/dist/components/my-backdrop.d.ts +11 -0
  91. package/dist/components/my-backdrop.js +8 -0
  92. package/dist/components/my-backdrop.js.map +1 -0
  93. package/dist/components/my-colorbox.d.ts +11 -0
  94. package/dist/components/my-colorbox.js +8 -0
  95. package/dist/components/my-colorbox.js.map +1 -0
  96. package/dist/components/my-colorinfo.d.ts +11 -0
  97. package/dist/components/my-colorinfo.js +8 -0
  98. package/dist/components/my-colorinfo.js.map +1 -0
  99. package/dist/components/my-component.d.ts +11 -0
  100. package/dist/components/my-component.js +254 -0
  101. package/dist/components/my-component.js.map +1 -0
  102. package/dist/components/my-loader.d.ts +11 -0
  103. package/dist/components/my-loader.js +8 -0
  104. package/dist/components/my-loader.js.map +1 -0
  105. package/dist/components/my-modal.d.ts +11 -0
  106. package/dist/components/my-modal.js +8 -0
  107. package/dist/components/my-modal.js.map +1 -0
  108. package/dist/components/my-search.d.ts +11 -0
  109. package/dist/components/my-search.js +8 -0
  110. package/dist/components/my-search.js.map +1 -0
  111. package/dist/components/my-select.d.ts +11 -0
  112. package/dist/components/my-select.js +8 -0
  113. package/dist/components/my-select.js.map +1 -0
  114. package/dist/components/my-slider.d.ts +11 -0
  115. package/dist/components/my-slider.js +8 -0
  116. package/dist/components/my-slider.js.map +1 -0
  117. package/dist/esm/index-f3be6531.js +1638 -0
  118. package/dist/esm/index-f3be6531.js.map +1 -0
  119. package/dist/esm/index.js +3 -0
  120. package/dist/esm/index.js.map +1 -0
  121. package/dist/esm/loader.js +20 -0
  122. package/dist/esm/loader.js.map +1 -0
  123. package/dist/esm/modal-header_10.entry.js +12300 -0
  124. package/dist/esm/modal-header_10.entry.js.map +1 -0
  125. package/dist/esm/polyfills/core-js.js +11 -0
  126. package/dist/esm/polyfills/css-shim.js +1 -0
  127. package/dist/esm/polyfills/dom.js +79 -0
  128. package/dist/esm/polyfills/es5-html-element.js +1 -0
  129. package/dist/esm/polyfills/index.js +34 -0
  130. package/dist/esm/polyfills/system.js +6 -0
  131. package/dist/esm/tinting.js +23 -0
  132. package/dist/esm/tinting.js.map +1 -0
  133. package/dist/index.cjs.js +1 -0
  134. package/dist/index.js +1 -0
  135. package/dist/tinting/assets/arrow_down.png +0 -0
  136. package/dist/tinting/assets/chevron-down.webp +0 -0
  137. package/dist/tinting/assets/chevron.png +0 -0
  138. package/dist/tinting/assets/close.png +0 -0
  139. package/dist/tinting/assets/search.svg +15 -0
  140. package/dist/tinting/index.esm.js +2 -0
  141. package/dist/tinting/index.esm.js.map +1 -0
  142. package/dist/tinting/p-06cd865b.entry.js +15 -0
  143. package/dist/tinting/p-06cd865b.entry.js.map +1 -0
  144. package/dist/tinting/p-b135c76f.js +3 -0
  145. package/dist/tinting/p-b135c76f.js.map +1 -0
  146. package/dist/tinting/tinting.css +1 -0
  147. package/dist/tinting/tinting.esm.js +2 -0
  148. package/dist/tinting/tinting.esm.js.map +1 -0
  149. package/dist/types/components/api/index.d.ts +7 -0
  150. package/dist/types/components/api/services.d.ts +9 -0
  151. package/dist/types/components/backdrop/index.d.ts +3 -0
  152. package/dist/types/components/colorbox/index.d.ts +15 -0
  153. package/dist/types/components/colorinfo/index.d.ts +19 -0
  154. package/dist/types/components/component/index.d.ts +18 -0
  155. package/dist/types/components/header/index.d.ts +35 -0
  156. package/dist/types/components/loader/index.d.ts +3 -0
  157. package/dist/types/components/modal/__mocks__/index.d.ts +415 -0
  158. package/dist/types/components/modal/index.d.ts +77 -0
  159. package/dist/types/components/search/index.d.ts +15 -0
  160. package/dist/types/components/select/index.d.ts +31 -0
  161. package/dist/types/components/slider/index.d.ts +15 -0
  162. package/dist/types/components.d.ts +289 -0
  163. package/dist/types/gtmUtils.d.ts +1 -0
  164. package/dist/types/index.d.ts +1 -0
  165. package/dist/types/stencil-public-runtime.d.ts +1637 -0
  166. package/dist/types/types.d.ts +68 -0
  167. package/dist/types/utils/index.d.ts +1 -0
  168. package/loader/cdn.js +3 -0
  169. package/loader/index.cjs.js +3 -0
  170. package/loader/index.d.ts +21 -0
  171. package/loader/index.es2017.js +3 -0
  172. package/loader/index.js +4 -0
  173. package/loader/package.json +11 -0
  174. package/package.json +69 -0
  175. package/www/build/assets/arrow_down.png +0 -0
  176. package/www/build/assets/chevron-down.webp +0 -0
  177. package/www/build/assets/chevron.png +0 -0
  178. package/www/build/assets/close.png +0 -0
  179. package/www/build/assets/fonts/Galatea-Regular.eot +0 -0
  180. package/www/build/assets/fonts/Galatea-Regular.ttf +0 -0
  181. package/www/build/assets/fonts/Galatea-Regular.woff +0 -0
  182. package/www/build/assets/fonts/Galatea-Regular.woff2 +0 -0
  183. package/www/build/assets/search.svg +15 -0
  184. package/www/build/index.esm.js +2 -0
  185. package/www/build/index.esm.js.map +1 -0
  186. package/www/build/p-06cd865b.entry.js +15 -0
  187. package/www/build/p-06cd865b.entry.js.map +1 -0
  188. package/www/build/p-a4907f5e.css +4 -0
  189. package/www/build/p-b135c76f.js +3 -0
  190. package/www/build/p-b135c76f.js.map +1 -0
  191. package/www/build/p-e2322b6c.js +163 -0
  192. package/www/build/tinting.css +1 -0
  193. package/www/build/tinting.esm.js +2 -0
  194. package/www/build/tinting.esm.js.map +1 -0
  195. package/www/build/tinting.js +33 -0
  196. package/www/host.config.json +15 -0
  197. package/www/index.html +31 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/modal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAgB,CAAC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Prop, Event, EventEmitter, h, State, Listen, Watch } from '@stencil/core';\nimport { APIURL, accessToken } from '../api';\nimport { setDataLayer } from '../../gtmUtils';\nimport { Color, Product } from '../../types';\nimport { fetchColors, fetchProductData, limit, updateFilters } from '../api/services';\nimport { debounce } from '../../utils';\nimport chroma from 'chroma-js';\n\ndeclare global {\n interface Window {\n dataLayer: Record<string, any>[];\n }\n}\n\n@Component({\n tag: 'my-modal',\n styleUrl: 'index.scss',\n assetsDirs: ['assets'],\n})\nexport class Modal {\n private boxDesktopWidth = 130;\n private boxMobileWidth = 70;\n private desktopPadding = 75;\n private mobilePadding = 35;\n private mediumBreakpoint = 1024;\n private colorTimerInterval: ReturnType<typeof setInterval> | undefined;\n\n @Event({ bubbles: true, composed: true }) onSelectedColorEmit: EventEmitter<Color>;\n\n @Event({ bubbles: true, composed: true }) clearSearchText: EventEmitter;\n @Element() modalEl: HTMLElement;\n\n @Prop() shop: string;\n @Prop() product: string;\n @Prop() baselink: string;\n @Prop() selectedcolor: string | null;\n @Prop() arrowDown = 'arrow_down.png';\n\n @State() chunksNum = 12;\n @State() data: Product | null = null;\n @State() preloader = false;\n @State() loading = false;\n @State() currentColor: Color | null = null;\n @State() currentIndex: number | null = null;\n @State() infoBoxWidth: number | null = null;\n @State() boxWidth: number = this.boxDesktopWidth; // box width with gap\n @State() padding: number = this.desktopPadding;\n @State() isMobile: boolean = false;\n @State() showRange: boolean = false;\n @State() colorCategories: string[] | null = null;\n @State() selectedCategory: any = null;\n @State() page = 1;\n @State() colorIsSelected = false;\n @State() colorsList: Color[] = [];\n @State() hasMore = true;\n @State() filters: any = {\n type: 'product' as 'product' | 'sample' | 'number' | 'name' | 'sampleInProduct',\n id: '',\n productId: '',\n page: 1,\n colorNumber: '',\n colorName: '',\n };\n\n debouncedSearchColorsHandler: (event: CustomEvent) => void;\n\n constructor() {\n this.debouncedSearchColorsHandler = debounce(this.searchColor.bind(this), 300);\n }\n\n @Watch('chunksNum')\n setInfoBoxWidth(newValue: number) {\n this.infoBoxWidth = newValue * this.boxWidth;\n }\n\n @Watch('data')\n watchPropHandler(newValue: Product) {\n if (newValue) {\n this.filters = updateFilters(this.filters, { id: newValue.id, type: 'product' });\n this.fetchColorsData();\n }\n }\n\n private clearInterval = () => {\n this.colorTimerInterval && clearInterval(this.colorTimerInterval);\n this.colorTimerInterval = undefined;\n };\n\n private colorTimer = () => {\n if (this.currentColor && this.currentColor.id) {\n this.colorTimerInterval = setInterval(() => {\n this.currentColor?.name &&\n setDataLayer({\n event: 'ColorTimer',\n shop: this.shop,\n product: this.product,\n color: this.currentColor?.name,\n timer: '10',\n });\n }, 10000);\n } else {\n this.clearInterval();\n }\n };\n\n @Method()\n async open() {\n this.modalEl.style.display = 'block';\n }\n @Event() close: EventEmitter;\n closeModalHandler() {\n this.close.emit();\n }\n\n @Event() readyToCLose: EventEmitter;\n handleReadyToClose(value: boolean) {\n this.readyToCLose.emit({ observable: value });\n }\n\n @Listen('closeInfoBox')\n closeInfoBoxHandler() {\n this.currentColor = null;\n this.currentIndex = null;\n }\n\n @Listen('onCurrentColor')\n handleEmitColor(event: CustomEvent<Color>) {\n this.onSelectedColorEmit.emit(event.detail);\n }\n\n private chunks = (xs: Color[], y: Color[][] = []): Color[][] => {\n return xs.length === 0 ? y : this.chunks(xs.slice(this.chunksNum), y.concat([xs.slice(0, this.chunksNum)]));\n };\n\n private calculateBoxCount = () => {\n const modalWidth = this.modalEl.children && this.modalEl.children[0] && this.modalEl.children[0]?.clientWidth - this.padding;\n const boxWidth = this.boxWidth;\n\n const calc = Math.floor(modalWidth / boxWidth);\n\n const boxesCount = calc;\n\n if (!this.preloader) this.chunksNum = boxesCount;\n };\n\n private displayForMobile = () => {\n if (window.innerWidth < this.mediumBreakpoint) {\n this.boxWidth = this.boxMobileWidth;\n this.padding = this.mobilePadding;\n this.isMobile = true;\n } else {\n this.isMobile = false;\n this.boxWidth = this.boxDesktopWidth;\n this.padding = this.desktopPadding;\n }\n };\n\n @Listen('resize', { target: 'window' })\n handleResize() {\n this.calculateBoxCount();\n this.displayForMobile();\n }\n\n private sortColorsBySimilarity(colors: Color[]): Color[] {\n if (colors.length <= 1) return colors;\n\n const sortedColors: Color[] = [];\n const remainingColors = [...colors];\n\n // Start with the first color\n sortedColors.push(remainingColors.shift()!);\n\n while (remainingColors.length > 0) {\n // Find the most similar color to the last color in sortedColors\n const lastColor = sortedColors[sortedColors.length - 1];\n let mostSimilarIndex = 0;\n let minDistance = Infinity;\n\n remainingColors.forEach((color, index) => {\n const distance = chroma.distance(lastColor.hex, color.hex, 'lab');\n if (distance < minDistance) {\n minDistance = distance;\n mostSimilarIndex = index;\n }\n });\n\n // Move the most similar color to sortedColors\n sortedColors.push(remainingColors.splice(mostSimilarIndex, 1)[0]);\n }\n\n return sortedColors;\n }\n\n private getColorHueGroup(hex: string): string {\n const color = chroma(hex);\n const hue = color.get('hsl.h');\n const saturation = color.get('hsl.s');\n const lightness = color.get('hsl.l');\n\n // Handle grayscale colors\n if (saturation < 0.1) {\n if (lightness < 0.2) return 'black';\n if (lightness > 0.8) return 'white';\n return 'gray';\n }\n\n // Group colors by hue ranges\n if (hue >= 330 || hue < 30) return 'red';\n if (hue >= 30 && hue < 90) return 'yellow';\n if (hue >= 90 && hue < 150) return 'green';\n if (hue >= 150 && hue < 210) return 'cyan';\n if (hue >= 210 && hue < 270) return 'blue';\n if (hue >= 270 && hue < 330) return 'magenta';\n\n return 'other';\n }\n\n private sortColorsByHueAndSimilarity(colors: Color[]): Color[] {\n if (colors.length <= 1) return colors;\n\n // Group colors by their hue family\n const colorGroups: Record<string, Color[]> = {\n red: [],\n yellow: [],\n green: [],\n cyan: [],\n blue: [],\n magenta: [],\n gray: [],\n black: [],\n white: [],\n other: [],\n };\n\n // Sort colors into groups\n colors.forEach(color => {\n const group = this.getColorHueGroup(color.hex);\n colorGroups[group].push(color);\n });\n\n // Sort each group by similarity\n const sortedGroups: Color[][] = [];\n const groupOrder = ['red', 'magenta', 'blue', 'cyan', 'green', 'yellow', 'gray', 'black', 'white', 'other'];\n\n groupOrder.forEach(groupName => {\n if (colorGroups[groupName].length > 0) {\n sortedGroups.push(this.sortColorsBySimilarity(colorGroups[groupName]));\n }\n });\n\n // Combine all sorted groups\n return sortedGroups.flat();\n }\n\n private async fetchColorsData({ reset = false } = {}) {\n if (this.loading && !reset) return;\n this.loading = true;\n\n try {\n const colors = await fetchColors(this.filters);\n\n if (reset) {\n // For new searches, sort all colors by hue and similarity\n this.colorsList = this.sortColorsByHueAndSimilarity(colors);\n } else {\n // For pagination, combine and sort all colors\n this.colorsList = this.sortColorsByHueAndSimilarity([...this.colorsList, ...colors]);\n }\n\n this.hasMore = colors.length >= limit;\n } catch (error) {\n console.error('Error fetching colors:', error);\n } finally {\n this.loading = false;\n }\n }\n\n private async loadProductData() {\n this.preloader = true;\n\n const product = await fetchProductData({ shopName: this.shop, productName: this.product });\n\n if (product) {\n this.data = product;\n this.filters = updateFilters(this.filters, { type: 'product', id: product.id });\n\n // Fetch initial colors\n await this.fetchColorsData();\n }\n\n this.preloader = false;\n }\n\n private async loadMoreColors() {\n if (this.loading || !this.hasMore) return; // Prevent spam loading\n\n this.filters = { ...this.filters, page: this.filters.page + 1 }; // Increase page for lazy loading\n\n await this.fetchColorsData({ reset: false }); // Append results\n }\n\n private updateFilterAndFetch(newFilters: Partial<typeof this.filters>) {\n if (!this.data?.id) return;\n\n this.loading = true;\n\n this.filters = updateFilters(this.filters, {\n id: this.data.id,\n sampleId: this.filters.sampleId,\n colorName: this.filters.colorName,\n ...newFilters,\n page: 1,\n });\n\n this.fetchColorsData({ reset: true }).finally(() => {\n this.loading = false;\n });\n }\n\n async searchColor(event: CustomEvent) {\n const query = event.detail?.trim();\n\n this.updateFilterAndFetch({ colorName: query });\n }\n\n @Listen('colorFamilySelected')\n handleColorFamilySelected(event: CustomEvent) {\n this.currentColor = null;\n if (event.detail === this.filters.colorFamily) {\n this.filters = updateFilters(this.filters, { colorFamily: '' });\n this.updateFilterAndFetch({ colorFamily: '' });\n } else {\n this.filters = updateFilters(this.filters, { colorFamily: event.detail });\n this.updateFilterAndFetch({ colorFamily: event.detail });\n }\n }\n\n @Listen('searchColors')\n searchColorsHandler(event: CustomEvent) {\n this.loading = true;\n this.currentColor = null;\n this.debouncedSearchColorsHandler(event);\n }\n\n private handleSampleSelect = (selectedSample?: any) => {\n this.currentColor = null;\n this.selectedCategory = selectedSample.value;\n\n this.updateFilterAndFetch({ sampleId: selectedSample.value, colorFamily: '' });\n };\n\n handleScroll(_event: Event, modalContent: HTMLElement) {\n if (this.loading || !this.hasMore) return;\n\n const scrollTop = modalContent.scrollTop;\n const scrollHeight = modalContent.scrollHeight;\n const clientHeight = modalContent.clientHeight;\n\n // Check if user scrolled to the bottom of the modal\n if (scrollTop + clientHeight >= scrollHeight - 50) {\n this.loadMoreColors();\n }\n }\n\n private openSeletedColor() {\n if (!this.colorsList || !this.selectedcolor) return;\n\n if (!this.colorIsSelected) {\n const result = this.chunks(this.colorsList)\n .map((innerArray, arrayIndex) => {\n const foundColor = innerArray.find(color => color.name.trim()?.toUpperCase() === this.selectedcolor?.trim()?.toUpperCase());\n\n return foundColor ? { color: foundColor, index: arrayIndex } : null;\n })\n .filter(item => item !== null);\n\n this.currentColor = result[0]?.color as any;\n this.currentIndex = result[0]?.index as any;\n this.colorIsSelected = true;\n }\n }\n\n componentWillLoad() {\n this.preloader = true;\n setDataLayer({\n shop: this.shop,\n product: this.product,\n });\n\n this.loadProductData();\n }\n\n componentWillRender() {\n this.displayForMobile();\n this.calculateBoxCount();\n this.colorTimer();\n this.openSeletedColor();\n\n const modalContent = this.modalEl.querySelector('.my-modal') as HTMLElement;\n if (modalContent) {\n modalContent.addEventListener('scroll', event => this.handleScroll(event, modalContent));\n }\n }\n\n private resetColors() {\n this.currentColor = null;\n this.currentIndex = null;\n this.colorIsSelected = false;\n }\n\n private resetAllFilters() {\n // Reset current color selection\n this.resetColors();\n\n // Reset filters to initial state\n this.filters = {\n type: 'product',\n id: this.data?.id || '',\n productId: '',\n page: 1,\n colorNumber: '',\n colorName: '',\n colorFamily: '',\n sampleId: '',\n };\n\n // Reset selected category\n this.selectedCategory = null;\n\n // Clear search text\n this.clearSearchText.emit();\n\n // Fetch colors with reset filters\n this.fetchColorsData({ reset: true });\n }\n\n private resetSelectedCategory() {\n this.resetColors();\n this.colorIsSelected = false;\n this.selectedCategory = null;\n this.filters = updateFilters(this.filters, { sampleId: '' });\n this.fetchColorsData({ reset: true });\n }\n\n render() {\n return (\n <div class={`my-modal`} onMouseEnter={() => this.handleReadyToClose(false)} onMouseLeave={() => this.handleReadyToClose(true)}>\n {this.preloader && (\n <div class={'loader'}>\n <my-loader></my-loader>\n </div>\n )}\n {!this.preloader && this.data && (\n <modal-header\n modalName={this.data.modalName}\n modalLogo={this.data.modalLogo ? `${APIURL}/assets/${this.data.modalLogo}?access_token=${accessToken}` : null}\n modalDescription={this.data.modalDescription}\n shop={this.shop}\n productName={this.data.name}\n productSamples={this.data.productSamples}\n selectedColorFamily={this.filters.colorFamily}\n isMobile={this.isMobile}\n onCloseModal={() => this.closeModalHandler()}\n onSampleSelected={event => this.handleSampleSelect(event.detail)}\n onOnLogoClick={() => this.resetAllFilters()}\n onOnResetCategory={() => this.resetSelectedCategory()}\n ></modal-header>\n )}\n\n <div class={'my-modal__wrapper'}>\n {!this.preloader && (\n <div class={'container_boxes'}>\n {!this.loading && this.colorsList.length === 0 && (\n <div class=\"not-found\">\n <p>Nie zaleziono wyników wyszukiwania pod danym hasłem.</p>\n <p> Wpisz inną nazwę bądź numer koloru lub skorzystaj z kolekcji kolorystycznych.</p>\n </div>\n )}\n {this.colorsList?.length > 0 &&\n this.chunks(this.colorsList).map((color: Color[], index: number) => {\n return (\n <div key={index} class=\"boxes\">\n <div class=\"boxes__list\">\n {color.map((c: Color) => (\n <my-colorbox\n key={c.id}\n onClick={() => {\n if (this.currentColor?.id === c.id) {\n this.currentColor = null;\n } else {\n this.currentColor = c;\n }\n this.currentIndex = index;\n setDataLayer({\n event: 'ColorClick',\n shop: this.shop,\n product: this.product,\n color: c.name,\n });\n this.clearInterval();\n }}\n color={c.hex}\n name={c.name}\n isActive={this.currentColor?.id === c.id}\n shop={this.shop}\n product={this.product}\n isImageInsteadHex={{\n isImageInsteadHex: c.imageInsteadHex,\n bigImage: c.bigImage,\n }}\n ></my-colorbox>\n ))}\n </div>\n\n {this.currentColor?.id && index === this.currentIndex && (\n <my-colorinfo\n currentColor={this.currentColor}\n shop={this.shop}\n product={this.product}\n data={this.data}\n isMobile={this.isMobile}\n infoBoxWidth={this.infoBoxWidth}\n baselink={this.baselink}\n ></my-colorinfo>\n )}\n </div>\n );\n })}\n </div>\n )}\n {this.loading && <my-loader></my-loader>}\n </div>\n {!this.preloader && this.isMobile && (\n <button class=\"button\" onClick={() => this.closeModalHandler()}>\n Zamknij\n </button>\n )}\n </div>\n );\n }\n}\n"]}
@@ -0,0 +1,15 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="21px" height="21px" viewBox="0 0 21 21" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>search (1)</title>
4
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <g id="E_TT-Copy" transform="translate(-670.000000, -275.000000)" fill="#000000" fill-rule="nonzero">
6
+ <g id="Group-11" transform="translate(240.477268, 115.000000)">
7
+ <g id="Group-18" transform="translate(38.010142, 143.000000)">
8
+ <g id="search-(1)" transform="translate(392.266523, 17.349138)">
9
+ <path d="M8.04938507,16.0918365 C9.8370154,16.0918798 11.5735099,15.4954541 12.9838185,14.3969873 L18.3044575,19.7176263 C18.7019302,20.1014916 19.3352777,20.0904844 19.719143,19.6930117 C20.0936046,19.3052895 20.0936046,18.6906196 19.719143,18.3029407 L14.3985041,12.9823018 C17.12426,9.47351771 16.4895258,4.41943508 12.9807417,1.69367909 C9.47195764,-1.03207689 4.41791834,-0.397342671 1.69216235,3.11144142 C-1.03359363,6.62022552 -0.398859411,11.6743081 3.10992468,14.4000641 C4.5225301,15.4974475 6.26058468,16.0927465 8.04938507,16.0918365 Z M3.77430035,3.77274027 C6.13538859,1.4116087 9.96346822,1.41156536 12.3245998,3.7726536 C14.6857314,6.13374184 14.6857747,9.96182148 12.3246865,12.3229531 C9.96359823,14.6840846 6.1355186,14.684128 3.77438702,12.3230397 C3.77434368,12.3229964 3.77434368,12.3229964 3.77430035,12.3229531 C1.41321211,9.97906898 1.39930143,6.16494336 3.7431855,3.80385512 C3.75354267,3.79345461 3.76389984,3.78309744 3.77430035,3.77274027 Z" id="Shape"></path>
10
+ </g>
11
+ </g>
12
+ </g>
13
+ </g>
14
+ </g>
15
+ </svg>
@@ -0,0 +1,38 @@
1
+ @import url("https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
2
+ .tinting-wrapper * {
3
+ font-family: "Poppins", sans-serif;
4
+ }
5
+
6
+ .search {
7
+ position: relative;
8
+ width: 300px;
9
+ }
10
+ @media (max-width: 768px) {
11
+ .search {
12
+ width: 100%;
13
+ }
14
+ }
15
+ .search input {
16
+ font-size: 16px;
17
+ padding: 17px;
18
+ border-radius: 27.35px;
19
+ border: 1px solid #dfdfdf;
20
+ width: 100%;
21
+ color: #4c4c4c;
22
+ box-sizing: border-box;
23
+ padding-right: 55px;
24
+ }
25
+ .search button {
26
+ position: absolute;
27
+ border: none;
28
+ background-color: transparent;
29
+ right: 10px;
30
+ top: 0;
31
+ width: 50px;
32
+ height: 100%;
33
+ display: flex;
34
+ flex-direction: column;
35
+ align-items: center;
36
+ justify-content: center;
37
+ cursor: pointer;
38
+ }
@@ -0,0 +1,178 @@
1
+ import { h, getAssetPath } from '@stencil/core';
2
+ import { setDataLayer } from '../../gtmUtils';
3
+ function debounce(func, wait) {
4
+ let timeout;
5
+ return function executedFunction(...args) {
6
+ const later = () => {
7
+ clearTimeout(timeout);
8
+ func(...args);
9
+ };
10
+ clearTimeout(timeout);
11
+ timeout = setTimeout(later, wait);
12
+ };
13
+ }
14
+ export class MySearch {
15
+ constructor() {
16
+ this.fetchColorsByName = (text) => {
17
+ this.searchColors.emit(text);
18
+ };
19
+ this.debouncedInputChangeValue = debounce((value) => {
20
+ this.fetchColorsByName(value);
21
+ this.searchText = value;
22
+ }, 500);
23
+ this.productname = undefined;
24
+ this.shopname = undefined;
25
+ this.isMobile = undefined;
26
+ this.searchIcon = 'search.svg';
27
+ this.searchText = null;
28
+ }
29
+ onInputChangeValue(event) {
30
+ const value = event.target.value;
31
+ this.debouncedInputChangeValue(value);
32
+ }
33
+ fetchColorsByNameHandle(newValue) {
34
+ if (newValue.length >= 3) {
35
+ setDataLayer({
36
+ event: 'ColorSearch',
37
+ shop: this.shopname,
38
+ product: this.productname,
39
+ search_term: newValue,
40
+ });
41
+ }
42
+ this.fetchColorsByName(newValue);
43
+ }
44
+ clearSearchTextHandler() {
45
+ this.searchText = null;
46
+ }
47
+ render() {
48
+ return (h("div", { class: 'search' }, h("input", { placeholder: this.isMobile ? 'Wyszukaj kolor' : 'Wyszukaj kolor po nazwie', value: this.searchText || '', type: "text", onInput: this.onInputChangeValue.bind(this) }), h("button", { onClick: () => {
49
+ this.searchText && this.fetchColorsByName(this.searchText);
50
+ this.searchText = '';
51
+ } }, h("img", { src: getAssetPath(`./assets/${this.searchIcon}`), alt: "arrow_down" }))));
52
+ }
53
+ static get is() { return "my-search"; }
54
+ static get encapsulation() { return "scoped"; }
55
+ static get originalStyleUrls() {
56
+ return {
57
+ "$": ["index.scss"]
58
+ };
59
+ }
60
+ static get styleUrls() {
61
+ return {
62
+ "$": ["index.css"]
63
+ };
64
+ }
65
+ static get assetsDirs() { return ["assets"]; }
66
+ static get properties() {
67
+ return {
68
+ "productname": {
69
+ "type": "string",
70
+ "mutable": false,
71
+ "complexType": {
72
+ "original": "string",
73
+ "resolved": "string",
74
+ "references": {}
75
+ },
76
+ "required": false,
77
+ "optional": false,
78
+ "docs": {
79
+ "tags": [],
80
+ "text": ""
81
+ },
82
+ "attribute": "productname",
83
+ "reflect": false
84
+ },
85
+ "shopname": {
86
+ "type": "string",
87
+ "mutable": false,
88
+ "complexType": {
89
+ "original": "string",
90
+ "resolved": "string",
91
+ "references": {}
92
+ },
93
+ "required": false,
94
+ "optional": false,
95
+ "docs": {
96
+ "tags": [],
97
+ "text": ""
98
+ },
99
+ "attribute": "shopname",
100
+ "reflect": false
101
+ },
102
+ "isMobile": {
103
+ "type": "boolean",
104
+ "mutable": false,
105
+ "complexType": {
106
+ "original": "boolean",
107
+ "resolved": "boolean",
108
+ "references": {}
109
+ },
110
+ "required": false,
111
+ "optional": false,
112
+ "docs": {
113
+ "tags": [],
114
+ "text": ""
115
+ },
116
+ "attribute": "is-mobile",
117
+ "reflect": false
118
+ },
119
+ "searchIcon": {
120
+ "type": "string",
121
+ "mutable": false,
122
+ "complexType": {
123
+ "original": "string",
124
+ "resolved": "string",
125
+ "references": {}
126
+ },
127
+ "required": false,
128
+ "optional": false,
129
+ "docs": {
130
+ "tags": [],
131
+ "text": ""
132
+ },
133
+ "attribute": "search-icon",
134
+ "reflect": false,
135
+ "defaultValue": "'search.svg'"
136
+ }
137
+ };
138
+ }
139
+ static get states() {
140
+ return {
141
+ "searchText": {}
142
+ };
143
+ }
144
+ static get events() {
145
+ return [{
146
+ "method": "searchColors",
147
+ "name": "searchColors",
148
+ "bubbles": true,
149
+ "cancelable": true,
150
+ "composed": true,
151
+ "docs": {
152
+ "tags": [],
153
+ "text": ""
154
+ },
155
+ "complexType": {
156
+ "original": "any",
157
+ "resolved": "any",
158
+ "references": {}
159
+ }
160
+ }];
161
+ }
162
+ static get watchers() {
163
+ return [{
164
+ "propName": "searchText",
165
+ "methodName": "fetchColorsByNameHandle"
166
+ }];
167
+ }
168
+ static get listeners() {
169
+ return [{
170
+ "name": "clearSearchText",
171
+ "method": "clearSearchTextHandler",
172
+ "target": "document",
173
+ "capture": false,
174
+ "passive": false
175
+ }];
176
+ }
177
+ }
178
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/search/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAgB,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC5G,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,SAAS,QAAQ,CAAC,IAAc,EAAE,IAAY;EAC5C,IAAI,OAAsC,CAAC;EAC3C,OAAO,SAAS,gBAAgB,CAAC,GAAG,IAAW;IAC7C,MAAM,KAAK,GAAG,GAAG,EAAE;MACjB,YAAY,CAAC,OAAO,CAAC,CAAC;MACtB,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IAChB,CAAC,CAAC;IACF,YAAY,CAAC,OAAO,CAAC,CAAC;IACtB,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;EACpC,CAAC,CAAC;AACJ,CAAC;AAQD,MAAM,OAAO,QAAQ;;IAQnB,sBAAiB,GAAG,CAAC,IAAY,EAAE,EAAE;MACnC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC,CAAC;IAEM,8BAAyB,GAAG,QAAQ,CAAC,CAAC,KAAa,EAAE,EAAE;MAC7D,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;MAC9B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC1B,CAAC,EAAE,GAAG,CAAC,CAAC;;;;sBAXa,YAAY;sBACI,IAAI;;EAYjC,kBAAkB,CAAC,KAAY;IACrC,MAAM,KAAK,GAAI,KAAK,CAAC,MAA2B,CAAC,KAAK,CAAC;IAC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} from '@stencil/core';\nimport { setDataLayer } from '../../gtmUtils';\n\nfunction debounce(func: Function, wait: number) {\n let timeout: ReturnType<typeof setTimeout>;\n return function executedFunction(...args: any[]) {\n const later = () => {\n clearTimeout(timeout);\n func(...args);\n };\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n };\n}\n\n@Component({\n tag: 'my-search',\n styleUrl: 'index.scss',\n assetsDirs: ['assets'],\n scoped: true,\n})\nexport class MySearch {\n @Prop() productname: string;\n @Prop() shopname: string;\n @Prop() isMobile: boolean;\n @Prop() searchIcon = 'search.svg';\n @State() searchText: string | null = null;\n @Event() searchColors: EventEmitter;\n\n fetchColorsByName = (text: string) => {\n this.searchColors.emit(text);\n };\n\n private debouncedInputChangeValue = debounce((value: string) => {\n this.fetchColorsByName(value);\n this.searchText = value;\n }, 500);\n\n private onInputChangeValue(event: Event) {\n const value = (event.target as HTMLInputElement).value;\n this.debouncedInputChangeValue(value);\n }\n\n @Watch('searchText')\n fetchColorsByNameHandle(newValue: string) {\n if (newValue.length >= 3) {\n setDataLayer({\n event: 'ColorSearch',\n shop: this.shopname,\n product: this.productname,\n search_term: newValue,\n });\n }\n\n this.fetchColorsByName(newValue);\n }\n\n @Listen('clearSearchText', { target: 'document' })\n clearSearchTextHandler() {\n this.searchText = null;\n }\n\n render() {\n return (\n <div class={'search'}>\n <input placeholder={this.isMobile ? 'Wyszukaj kolor' : 'Wyszukaj kolor po nazwie'} value={this.searchText || ''} type=\"text\" onInput={this.onInputChangeValue.bind(this)} />\n\n <button\n onClick={() => {\n this.searchText && this.fetchColorsByName(this.searchText);\n\n this.searchText = '';\n }}\n >\n <img src={getAssetPath(`./assets/${this.searchIcon}`)} alt=\"arrow_down\" />\n </button>\n </div>\n );\n }\n}\n"]}
@@ -0,0 +1,77 @@
1
+ @import url("https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
2
+ .tinting-wrapper * {
3
+ font-family: "Poppins", sans-serif;
4
+ }
5
+
6
+ .select {
7
+ position: relative;
8
+ width: 300px;
9
+ }
10
+ @media (max-width: 768px) {
11
+ .select {
12
+ width: 100%;
13
+ }
14
+ }
15
+ .select .input-wrapper {
16
+ position: relative;
17
+ display: flex;
18
+ align-items: flex-start;
19
+ }
20
+ .select input {
21
+ font-size: 16px;
22
+ padding: 16px;
23
+ border-radius: 27.35px;
24
+ border: 1px solid #dfdfdf;
25
+ width: 100%;
26
+ color: #4c4c4c;
27
+ box-sizing: border-box;
28
+ padding-right: 50px;
29
+ }
30
+ .select button {
31
+ position: absolute;
32
+ right: 10px;
33
+ background: transparent;
34
+ border: none;
35
+ cursor: pointer;
36
+ width: 40px;
37
+ height: 100%;
38
+ display: flex;
39
+ align-items: center;
40
+ justify-content: center;
41
+ }
42
+ .select button img {
43
+ transition: transform 0.3s ease;
44
+ }
45
+ .select button img.rotated {
46
+ transform: rotate(180deg);
47
+ }
48
+ .select .dropdown {
49
+ position: absolute;
50
+ top: 100%;
51
+ left: 0;
52
+ width: 100%;
53
+ background: white;
54
+ border: 1px solid #dfdfdf;
55
+ border-radius: 5px;
56
+ max-height: 200px;
57
+ overflow-y: auto;
58
+ z-index: 1000;
59
+ padding: 0;
60
+ margin: 0;
61
+ }
62
+ .select .dropdown li {
63
+ padding: 0;
64
+ margin: 0;
65
+ padding: 10px;
66
+ cursor: pointer;
67
+ list-style: none;
68
+ text-align: left;
69
+ }
70
+ .select .dropdown li:hover {
71
+ background: #f5f5f5;
72
+ }
73
+ .select .dropdown .no-results {
74
+ padding: 10px;
75
+ text-align: center;
76
+ color: #999;
77
+ }
@@ -0,0 +1,231 @@
1
+ import { h } from '@stencil/core';
2
+ import { getAssetPath } from '@stencil/core';
3
+ import { debounce } from '../../utils';
4
+ export class MySelect {
5
+ constructor() {
6
+ this.defaultOption = { name: this.placeholder, id: null };
7
+ this.debouncedSearch = debounce((value) => {
8
+ const optionsWithDefault = [this.defaultOption, ...this.options];
9
+ this.filteredOptions = optionsWithDefault.filter(option => option.name.toLowerCase().includes(value.toLowerCase()));
10
+ this.inputValueChange.emit(value);
11
+ }, 300);
12
+ this.handleClickOutside = (event) => {
13
+ if (!this.el.contains(event.target)) {
14
+ this.showDropdown = false;
15
+ }
16
+ };
17
+ this.options = [];
18
+ this.placeholder = 'Select an option';
19
+ this.isMobile = false;
20
+ this.searchIcon = 'chevron.png';
21
+ this.searchText = '';
22
+ this.filteredOptions = [];
23
+ this.showDropdown = false;
24
+ this.selectedValue = null;
25
+ }
26
+ reset() {
27
+ this.onReset.emit();
28
+ }
29
+ componentWillLoad() {
30
+ this.filteredOptions = [this.defaultOption, ...this.options];
31
+ }
32
+ componentDidLoad() {
33
+ document.addEventListener('click', this.handleClickOutside);
34
+ }
35
+ disconnectedCallback() {
36
+ document.removeEventListener('click', this.handleClickOutside);
37
+ }
38
+ handleInput(event) {
39
+ const value = event.target.value;
40
+ this.searchText = value;
41
+ this.showDropdown = true;
42
+ this.debouncedSearch(value);
43
+ }
44
+ selectOption(option) {
45
+ if (option.value === null) {
46
+ this.selectedValue = null;
47
+ this.searchText = '';
48
+ this.reset();
49
+ }
50
+ else {
51
+ this.selectedValue = option.key;
52
+ this.searchText = option.key;
53
+ this.selectValue.emit(option);
54
+ }
55
+ this.showDropdown = false;
56
+ }
57
+ toggleDropdown() {
58
+ this.showDropdown = !this.showDropdown;
59
+ }
60
+ updateOptions(newOptions) {
61
+ this.filteredOptions = [this.defaultOption, ...newOptions];
62
+ }
63
+ clearSearchTextHandler() {
64
+ this.searchText = '';
65
+ this.selectedValue = null;
66
+ this.reset();
67
+ }
68
+ render() {
69
+ return (h("div", { class: "select" }, h("div", { class: "input-wrapper" }, h("input", { type: "text", placeholder: this.placeholder, value: this.searchText, onInput: this.handleInput.bind(this), onFocus: () => (this.showDropdown = true) }), h("button", { onClick: () => this.toggleDropdown() }, h("img", { src: getAssetPath(`./assets/${this.searchIcon}`), alt: "dropdown icon", class: this.showDropdown ? 'rotated' : '' }))), this.showDropdown && (h("ul", { class: "dropdown" }, this.filteredOptions.length > 0 ? (this.filteredOptions.map(option => (h("li", { class: option.id === null ? 'default-option' : '', onClick: () => this.selectOption({ key: option.name, value: option.id }) }, option.name)))) : (h("li", { class: "no-results" }, "No results found"))))));
70
+ }
71
+ static get is() { return "my-select"; }
72
+ static get encapsulation() { return "scoped"; }
73
+ static get originalStyleUrls() {
74
+ return {
75
+ "$": ["index.scss"]
76
+ };
77
+ }
78
+ static get styleUrls() {
79
+ return {
80
+ "$": ["index.css"]
81
+ };
82
+ }
83
+ static get assetsDirs() { return ["assets"]; }
84
+ static get properties() {
85
+ return {
86
+ "options": {
87
+ "type": "unknown",
88
+ "mutable": false,
89
+ "complexType": {
90
+ "original": "any[]",
91
+ "resolved": "any[]",
92
+ "references": {}
93
+ },
94
+ "required": false,
95
+ "optional": false,
96
+ "docs": {
97
+ "tags": [],
98
+ "text": ""
99
+ },
100
+ "defaultValue": "[]"
101
+ },
102
+ "placeholder": {
103
+ "type": "string",
104
+ "mutable": false,
105
+ "complexType": {
106
+ "original": "string",
107
+ "resolved": "string",
108
+ "references": {}
109
+ },
110
+ "required": false,
111
+ "optional": false,
112
+ "docs": {
113
+ "tags": [],
114
+ "text": ""
115
+ },
116
+ "attribute": "placeholder",
117
+ "reflect": false,
118
+ "defaultValue": "'Select an option'"
119
+ },
120
+ "isMobile": {
121
+ "type": "boolean",
122
+ "mutable": false,
123
+ "complexType": {
124
+ "original": "boolean",
125
+ "resolved": "boolean",
126
+ "references": {}
127
+ },
128
+ "required": false,
129
+ "optional": false,
130
+ "docs": {
131
+ "tags": [],
132
+ "text": ""
133
+ },
134
+ "attribute": "is-mobile",
135
+ "reflect": false,
136
+ "defaultValue": "false"
137
+ },
138
+ "searchIcon": {
139
+ "type": "string",
140
+ "mutable": false,
141
+ "complexType": {
142
+ "original": "string",
143
+ "resolved": "string",
144
+ "references": {}
145
+ },
146
+ "required": false,
147
+ "optional": false,
148
+ "docs": {
149
+ "tags": [],
150
+ "text": ""
151
+ },
152
+ "attribute": "search-icon",
153
+ "reflect": false,
154
+ "defaultValue": "'chevron.png'"
155
+ }
156
+ };
157
+ }
158
+ static get states() {
159
+ return {
160
+ "searchText": {},
161
+ "filteredOptions": {},
162
+ "showDropdown": {},
163
+ "selectedValue": {}
164
+ };
165
+ }
166
+ static get events() {
167
+ return [{
168
+ "method": "onReset",
169
+ "name": "onReset",
170
+ "bubbles": true,
171
+ "cancelable": true,
172
+ "composed": true,
173
+ "docs": {
174
+ "tags": [],
175
+ "text": ""
176
+ },
177
+ "complexType": {
178
+ "original": "void",
179
+ "resolved": "void",
180
+ "references": {}
181
+ }
182
+ }, {
183
+ "method": "selectValue",
184
+ "name": "selectValue",
185
+ "bubbles": true,
186
+ "cancelable": true,
187
+ "composed": true,
188
+ "docs": {
189
+ "tags": [],
190
+ "text": ""
191
+ },
192
+ "complexType": {
193
+ "original": "{ key: string; value: number | null }",
194
+ "resolved": "{ key: string; value: number | null; }",
195
+ "references": {}
196
+ }
197
+ }, {
198
+ "method": "inputValueChange",
199
+ "name": "inputValueChange",
200
+ "bubbles": true,
201
+ "cancelable": true,
202
+ "composed": true,
203
+ "docs": {
204
+ "tags": [],
205
+ "text": ""
206
+ },
207
+ "complexType": {
208
+ "original": "string",
209
+ "resolved": "string",
210
+ "references": {}
211
+ }
212
+ }];
213
+ }
214
+ static get elementRef() { return "el"; }
215
+ static get watchers() {
216
+ return [{
217
+ "propName": "options",
218
+ "methodName": "updateOptions"
219
+ }];
220
+ }
221
+ static get listeners() {
222
+ return [{
223
+ "name": "clearSearchText",
224
+ "method": "clearSearchTextHandler",
225
+ "target": "document",
226
+ "capture": false,
227
+ "passive": false
228
+ }];
229
+ }
230
+ }
231
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/select/index.ts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,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h, State, Event, EventEmitter, Listen, Watch, Element } from '@stencil/core';\nimport { getAssetPath } from '@stencil/core';\nimport { debounce } from '../../utils';\n\n@Component({\n tag: 'my-select',\n styleUrl: 'index.scss',\n assetsDirs: ['assets'],\n scoped: true,\n})\nexport class MySelect {\n @Element() el: HTMLElement;\n\n @Prop() options: any[] = []; // List of selectable options\n @Prop() placeholder: string = 'Select an option'; // Placeholder text\n @Prop() isMobile: boolean = false;\n @Prop() searchIcon: string = 'chevron.png'; // Search icon asset\n\n @State() searchText: string = '';\n @State() filteredOptions: any[] = [];\n @State() showDropdown: boolean = false;\n @State() selectedValue: string | null = null;\n @Event() onReset: EventEmitter<void>;\n @Event() selectValue: EventEmitter<{ key: string; value: number | null }>; // Emits selected value\n @Event() inputValueChange: EventEmitter<string>; // Emits input changes for filtering\n\n private defaultOption = { name: this.placeholder, id: null };\n\n private debouncedSearch = debounce((value: string) => {\n const optionsWithDefault = [this.defaultOption, ...this.options];\n this.filteredOptions = optionsWithDefault.filter(option => option.name.toLowerCase().includes(value.toLowerCase()));\n this.inputValueChange.emit(value);\n }, 300);\n\n private reset() {\n this.onReset.emit();\n }\n\n componentWillLoad() {\n this.filteredOptions = [this.defaultOption, ...this.options];\n }\n\n componentDidLoad() {\n document.addEventListener('click', this.handleClickOutside);\n }\n\n disconnectedCallback() {\n document.removeEventListener('click', this.handleClickOutside);\n }\n\n private handleClickOutside = (event: MouseEvent) => {\n if (!this.el.contains(event.target as Node)) {\n this.showDropdown = false;\n }\n };\n\n private handleInput(event: Event) {\n const value = (event.target as HTMLInputElement).value;\n this.searchText = value;\n this.showDropdown = true;\n this.debouncedSearch(value);\n }\n\n private selectOption(option: { key: string; value: number | null }) {\n if (option.value === null) {\n this.selectedValue = null;\n this.searchText = '';\n this.reset();\n } else {\n this.selectedValue = option.key;\n this.searchText = option.key;\n this.selectValue.emit(option);\n }\n this.showDropdown = false;\n }\n\n private toggleDropdown() {\n this.showDropdown = !this.showDropdown;\n }\n\n @Watch('options')\n updateOptions(newOptions: any[]) {\n this.filteredOptions = [this.defaultOption, ...newOptions];\n }\n\n @Listen('clearSearchText', { target: 'document' })\n clearSearchTextHandler() {\n this.searchText = '';\n this.selectedValue = null;\n this.reset();\n }\n\n render() {\n return (\n <div class=\"select\">\n <div class=\"input-wrapper\">\n <input type=\"text\" placeholder={this.placeholder} value={this.searchText} onInput={this.handleInput.bind(this)} onFocus={() => (this.showDropdown = true)} />\n <button onClick={() => this.toggleDropdown()}>\n <img src={getAssetPath(`./assets/${this.searchIcon}`)} alt=\"dropdown icon\" class={this.showDropdown ? 'rotated' : ''} />\n </button>\n </div>\n\n {this.showDropdown && (\n <ul class=\"dropdown\">\n {this.filteredOptions.length > 0 ? (\n this.filteredOptions.map(option => (\n <li class={option.id === null ? 'default-option' : ''} onClick={() => this.selectOption({ key: option.name, value: option.id })}>\n {option.name}\n </li>\n ))\n ) : (\n <li class=\"no-results\">No results found</li>\n )}\n </ul>\n )}\n </div>\n );\n }\n}\n"]}