@roadtrip/components 2.24.1 → 2.27.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 (481) hide show
  1. package/dist/cjs/{app-04553107.js → app-79994847.js} +1 -1
  2. package/dist/cjs/{css-shim-cf2d8057.js → css-shim-9a05bb86.js} +1 -1
  3. package/dist/cjs/{dom-ba87b185.js → dom-417ccd20.js} +1 -1
  4. package/dist/cjs/{index-d47fa3c0.js → index-9b63596c.js} +1 -1
  5. package/dist/cjs/index.cjs.js +2 -2
  6. package/dist/cjs/loader.cjs.js +5 -5
  7. package/dist/cjs/road-accordion.cjs.entry.js +3 -3
  8. package/dist/cjs/road-alert.cjs.entry.js +1 -1
  9. package/dist/cjs/road-autocomplete.cjs.entry.js +7 -2
  10. package/dist/cjs/road-avatar.cjs.entry.js +2 -2
  11. package/dist/cjs/road-badge_11.cjs.entry.js +19 -7
  12. package/dist/cjs/road-card.cjs.entry.js +9 -4
  13. package/dist/cjs/road-carousel-item.cjs.entry.js +1 -1
  14. package/dist/cjs/road-carousel.cjs.entry.js +33 -33
  15. package/dist/cjs/road-checkbox.cjs.entry.js +11 -2
  16. package/dist/cjs/road-chip.cjs.entry.js +4 -4
  17. package/dist/cjs/road-collapse.cjs.entry.js +4 -4
  18. package/dist/cjs/road-counter.cjs.entry.js +8 -4
  19. package/dist/cjs/road-dialog.cjs.entry.js +1 -1
  20. package/dist/cjs/road-dropdown.cjs.entry.js +2 -2
  21. package/dist/cjs/road-duration.cjs.entry.js +60 -0
  22. package/dist/cjs/road-flap.cjs.entry.js +1 -1
  23. package/dist/cjs/road-img.cjs.entry.js +7 -1
  24. package/dist/cjs/road-input-group.cjs.entry.js +1 -1
  25. package/dist/cjs/road-input.cjs.entry.js +12 -3
  26. package/dist/cjs/road-modal.cjs.entry.js +1 -1
  27. package/dist/cjs/road-navbar-item.cjs.entry.js +7 -1
  28. package/dist/cjs/road-navbar.cjs.entry.js +5 -1
  29. package/dist/cjs/road-plate-number.cjs.entry.js +11 -3
  30. package/dist/cjs/road-progress.cjs.entry.js +1 -1
  31. package/dist/cjs/road-radio-group.cjs.entry.js +3 -1
  32. package/dist/cjs/road-radio.cjs.entry.js +5 -1
  33. package/dist/cjs/road-range.cjs.entry.js +4 -2
  34. package/dist/cjs/road-rating.cjs.entry.js +1 -1
  35. package/dist/cjs/road-select-filter.cjs.entry.js +1798 -3
  36. package/dist/cjs/road-select.cjs.entry.js +9 -1
  37. package/dist/cjs/road-skeleton.cjs.entry.js +2 -2
  38. package/dist/cjs/road-spinner.cjs.entry.js +2 -2
  39. package/dist/cjs/road-switch.cjs.entry.js +13 -4
  40. package/dist/cjs/road-tab-bar.cjs.entry.js +5 -1
  41. package/dist/cjs/road-tab-button.cjs.entry.js +7 -1
  42. package/dist/cjs/road-tab.cjs.entry.js +1 -1
  43. package/dist/cjs/road-table.cjs.entry.js +2 -2
  44. package/dist/cjs/road-tabs.cjs.entry.js +3 -1
  45. package/dist/cjs/road-text.cjs.entry.js +1 -1
  46. package/dist/cjs/road-textarea.cjs.entry.js +14 -6
  47. package/dist/cjs/road-toast.cjs.entry.js +3 -3
  48. package/dist/cjs/road-toolbar-title.cjs.entry.js +2 -2
  49. package/dist/cjs/road-tooltip.cjs.entry.js +3 -3
  50. package/dist/cjs/roadtrip.cjs.js +5 -5
  51. package/dist/cjs/{shadow-css-7fb0b43f.js → shadow-css-432b27e3.js} +1 -1
  52. package/dist/cjs/{utils-ade59127.js → utils-90171b88.js} +1 -1
  53. package/dist/collection/collection-manifest.json +2 -1
  54. package/dist/collection/components/accordion/accordion.css +6 -6
  55. package/dist/collection/components/accordion/accordion.js +2 -2
  56. package/dist/collection/components/accordion/accordion.stories.js +81 -37
  57. package/dist/collection/components/alert/alert.stories.js +51 -45
  58. package/dist/collection/components/autocomplete/autocomplete.js +31 -3
  59. package/dist/collection/components/autocomplete/autocomplete.stories.js +51 -21
  60. package/dist/collection/components/avatar/avatar.js +2 -3
  61. package/dist/collection/components/avatar/avatar.stories.js +39 -14
  62. package/dist/collection/components/badge/badge.stories.js +33 -35
  63. package/dist/collection/components/button/button.css +4 -4
  64. package/dist/collection/components/button/button.js +57 -9
  65. package/dist/collection/components/button/button.stories.js +162 -71
  66. package/dist/collection/components/card/card.js +28 -6
  67. package/dist/collection/components/card/card.stories.js +3 -3
  68. package/dist/collection/components/carousel/carousel.css +2 -2
  69. package/dist/collection/components/carousel/carousel.js +48 -48
  70. package/dist/collection/components/carousel/carousel.stories.js +332 -88
  71. package/dist/collection/components/checkbox/checkbox.js +67 -7
  72. package/dist/collection/components/checkbox/checkbox.stories.js +89 -64
  73. package/dist/collection/components/chip/chip.js +6 -6
  74. package/dist/collection/components/chip/chip.stories.js +58 -82
  75. package/dist/collection/components/col/col.js +2 -3
  76. package/dist/collection/components/collapse/collapse.js +7 -7
  77. package/dist/collection/components/collapse/collapse.stories.js +141 -126
  78. package/dist/collection/components/counter/counter.js +50 -13
  79. package/dist/collection/components/counter/counter.stories.js +65 -31
  80. package/dist/collection/components/dialog/dialog.stories.js +81 -37
  81. package/dist/collection/components/drawer/drawer.stories.js +187 -79
  82. package/dist/collection/components/dropdown/dropdown.js +2 -2
  83. package/dist/collection/components/dropdown/dropdown.stories.js +41 -20
  84. package/dist/collection/components/duration/duration.css +31 -0
  85. package/dist/collection/components/duration/duration.js +212 -0
  86. package/dist/collection/components/duration/duration.stories.js +108 -0
  87. package/dist/collection/components/flap/flap.stories.js +35 -31
  88. package/dist/collection/components/grid/grid.js +2 -3
  89. package/dist/collection/components/grid/grid.stories.js +5 -5
  90. package/dist/collection/components/icon/icon.stories.js +88 -62
  91. package/dist/collection/components/icon/svg/attachment.svg +1 -0
  92. package/dist/collection/components/icon/svg/check-list-color.svg +1 -0
  93. package/dist/collection/components/icon/svg/check-list.svg +1 -0
  94. package/dist/collection/components/icon/svg/device-smartphone-music-color.svg +1 -0
  95. package/dist/collection/components/icon/svg/device-smartphone-music.svg +1 -0
  96. package/dist/collection/components/icon/svg/mic-off-outline-color.svg +1 -0
  97. package/dist/collection/components/icon/svg/mic-off-outline.svg +1 -0
  98. package/dist/collection/components/icon/svg/mic-off.svg +1 -0
  99. package/dist/collection/components/icon/svg/people-community-outline-color.svg +1 -0
  100. package/dist/collection/components/icon/svg/people-community-outline.svg +1 -0
  101. package/dist/collection/components/icon/svg/people-community.svg +1 -0
  102. package/dist/collection/components/icon/svg/people-coworker-color.svg +1 -1
  103. package/dist/collection/components/icon/svg/people-coworker.svg +1 -1
  104. package/dist/collection/components/icon/svg/player-radio-music-outline-color.svg +1 -0
  105. package/dist/collection/components/icon/svg/player-radio-music-outline.svg +1 -0
  106. package/dist/collection/components/icon/svg/station-electric-outline-color.svg +1 -0
  107. package/dist/collection/components/icon/svg/station-electric-outline.svg +1 -0
  108. package/dist/collection/components/icon/svg/vehicle-car-all-authorize-outline-color.svg +1 -0
  109. package/dist/collection/components/icon/svg/vehicle-car-all-authorize-outline.svg +1 -0
  110. package/dist/collection/components/icon/svg/vehicle-car-all-unauthorize-outline-color.svg +1 -0
  111. package/dist/collection/components/icon/svg/vehicle-car-all-unauthorize-outline.svg +1 -0
  112. package/dist/collection/components/icon/svg/{vehicle-car-bodyworkoutline-color.svg → vehicle-car-bodywork-outline-color.svg} +0 -0
  113. package/dist/collection/components/img/img.js +61 -4
  114. package/dist/collection/components/img/img.stories.js +1 -1
  115. package/dist/collection/components/input/input.css +4 -4
  116. package/dist/collection/components/input/input.js +89 -8
  117. package/dist/collection/components/input/input.stories.js +195 -129
  118. package/dist/collection/components/input-group/input-group.stories.js +44 -35
  119. package/dist/collection/components/item/item.css +2 -2
  120. package/dist/collection/components/item/item.stories.js +118 -24
  121. package/dist/collection/components/label/label.js +2 -3
  122. package/dist/collection/components/list/list.stories.js +48 -46
  123. package/dist/collection/components/modal/modal.stories.js +46 -30
  124. package/dist/collection/components/navbar/navbar.js +27 -0
  125. package/dist/collection/components/navbar/navbar.stories.js +41 -24
  126. package/dist/collection/components/navbar-item/navbar-item.js +30 -1
  127. package/dist/collection/components/plate-number/plate-number.js +99 -20
  128. package/dist/collection/components/plate-number/plate-number.stories.js +36 -17
  129. package/dist/collection/components/progress/progress.stories.js +3 -3
  130. package/dist/collection/components/radio/radio.js +47 -3
  131. package/dist/collection/components/radio/radio.stories.js +50 -33
  132. package/dist/collection/components/radio-group/radio-group.js +21 -2
  133. package/dist/collection/components/range/range.js +26 -8
  134. package/dist/collection/components/range/range.stories.js +40 -33
  135. package/dist/collection/components/rating/rating.stories.js +40 -31
  136. package/dist/collection/components/select/select.js +64 -5
  137. package/dist/collection/components/select/select.stories.js +82 -90
  138. package/dist/collection/components/select-filter/select-filter.js +69 -4
  139. package/dist/collection/components/select-filter/select-filter.stories.js +82 -106
  140. package/dist/collection/components/skeleton/skeleton.js +2 -3
  141. package/dist/collection/components/spinner/spinner.js +3 -4
  142. package/dist/collection/components/switch/switch.js +71 -11
  143. package/dist/collection/components/switch/switch.stories.js +96 -84
  144. package/dist/collection/components/tab-bar/tab-bar.js +21 -0
  145. package/dist/collection/components/tab-button/tab-button.js +30 -1
  146. package/dist/collection/components/table/table.js +2 -3
  147. package/dist/collection/components/table/table.stories.js +15 -6
  148. package/dist/collection/components/tabs/tabs.js +39 -3
  149. package/dist/collection/components/tabs/tabs.stories.js +107 -58
  150. package/dist/collection/components/text/text.stories.js +8 -4
  151. package/dist/collection/components/textarea/textarea.js +97 -17
  152. package/dist/collection/components/textarea/textarea.stories.js +135 -113
  153. package/dist/collection/components/toast/toast.js +4 -4
  154. package/dist/collection/components/toast/toast.stories.js +60 -46
  155. package/dist/collection/components/toolbar/toolbar.stories.js +50 -13
  156. package/dist/collection/components/toolbar-title/toolbar-title.js +3 -4
  157. package/dist/collection/components/tooltip/tooltip.js +4 -4
  158. package/dist/collection/components/tooltip/tooltip.stories.js +78 -11
  159. package/dist/esm/{app-6a43d362.js → app-a32f9d74.js} +1 -1
  160. package/dist/esm/{css-shim-aea0f6cc.js → css-shim-17041dc7.js} +1 -1
  161. package/dist/esm/{dom-c7604576.js → dom-ba83fb9d.js} +1 -1
  162. package/dist/esm/{index-4e5ea092.js → index-0c8a0e04.js} +1 -1
  163. package/dist/esm/index.js +2 -2
  164. package/dist/esm/loader.js +5 -5
  165. package/dist/esm/road-accordion.entry.js +3 -3
  166. package/dist/esm/road-alert.entry.js +1 -1
  167. package/dist/esm/road-autocomplete.entry.js +7 -2
  168. package/dist/esm/road-avatar.entry.js +2 -2
  169. package/dist/esm/road-badge_11.entry.js +19 -7
  170. package/dist/esm/road-card.entry.js +9 -4
  171. package/dist/esm/road-carousel-item.entry.js +1 -1
  172. package/dist/esm/road-carousel.entry.js +33 -33
  173. package/dist/esm/road-checkbox.entry.js +11 -2
  174. package/dist/esm/road-chip.entry.js +4 -4
  175. package/dist/esm/road-collapse.entry.js +4 -4
  176. package/dist/esm/road-counter.entry.js +8 -4
  177. package/dist/esm/road-dialog.entry.js +1 -1
  178. package/dist/esm/road-dropdown.entry.js +2 -2
  179. package/dist/esm/road-duration.entry.js +56 -0
  180. package/dist/esm/road-flap.entry.js +1 -1
  181. package/dist/esm/road-img.entry.js +7 -1
  182. package/dist/esm/road-input-group.entry.js +1 -1
  183. package/dist/esm/road-input.entry.js +12 -3
  184. package/dist/esm/road-modal.entry.js +1 -1
  185. package/dist/esm/road-navbar-item.entry.js +7 -1
  186. package/dist/esm/road-navbar.entry.js +5 -1
  187. package/dist/esm/road-plate-number.entry.js +11 -3
  188. package/dist/esm/road-progress.entry.js +1 -1
  189. package/dist/esm/road-radio-group.entry.js +3 -1
  190. package/dist/esm/road-radio.entry.js +5 -1
  191. package/dist/esm/road-range.entry.js +4 -2
  192. package/dist/esm/road-rating.entry.js +1 -1
  193. package/dist/esm/road-select-filter.entry.js +1798 -3
  194. package/dist/esm/road-select.entry.js +9 -1
  195. package/dist/esm/road-skeleton.entry.js +2 -2
  196. package/dist/esm/road-spinner.entry.js +2 -2
  197. package/dist/esm/road-switch.entry.js +13 -4
  198. package/dist/esm/road-tab-bar.entry.js +5 -1
  199. package/dist/esm/road-tab-button.entry.js +7 -1
  200. package/dist/esm/road-tab.entry.js +1 -1
  201. package/dist/esm/road-table.entry.js +2 -2
  202. package/dist/esm/road-tabs.entry.js +3 -1
  203. package/dist/esm/road-text.entry.js +1 -1
  204. package/dist/esm/road-textarea.entry.js +14 -6
  205. package/dist/esm/road-toast.entry.js +3 -3
  206. package/dist/esm/road-toolbar-title.entry.js +2 -2
  207. package/dist/esm/road-tooltip.entry.js +3 -3
  208. package/dist/esm/roadtrip.js +5 -5
  209. package/dist/esm/{shadow-css-83bb1d14.js → shadow-css-bfd5796e.js} +1 -1
  210. package/dist/esm/{utils-23aa19c1.js → utils-39de47f7.js} +1 -1
  211. package/dist/esm-es5/app-a32f9d74.js +1 -0
  212. package/dist/esm-es5/{css-shim-aea0f6cc.js → css-shim-17041dc7.js} +0 -0
  213. package/dist/esm-es5/{dom-c7604576.js → dom-ba83fb9d.js} +0 -0
  214. package/dist/esm-es5/{index-4e5ea092.js → index-0c8a0e04.js} +1 -1
  215. package/dist/esm-es5/index.js +1 -1
  216. package/dist/esm-es5/loader.js +1 -1
  217. package/dist/esm-es5/road-accordion.entry.js +1 -1
  218. package/dist/esm-es5/road-alert.entry.js +1 -1
  219. package/dist/esm-es5/road-autocomplete.entry.js +1 -1
  220. package/dist/esm-es5/road-avatar.entry.js +1 -1
  221. package/dist/esm-es5/road-badge_11.entry.js +1 -1
  222. package/dist/esm-es5/road-card.entry.js +1 -1
  223. package/dist/esm-es5/road-carousel-item.entry.js +1 -1
  224. package/dist/esm-es5/road-carousel.entry.js +1 -1
  225. package/dist/esm-es5/road-checkbox.entry.js +1 -1
  226. package/dist/esm-es5/road-chip.entry.js +1 -1
  227. package/dist/esm-es5/road-collapse.entry.js +1 -1
  228. package/dist/esm-es5/road-counter.entry.js +1 -1
  229. package/dist/esm-es5/road-dialog.entry.js +1 -1
  230. package/dist/esm-es5/road-dropdown.entry.js +1 -1
  231. package/dist/esm-es5/road-duration.entry.js +1 -0
  232. package/dist/esm-es5/road-flap.entry.js +1 -1
  233. package/dist/esm-es5/road-img.entry.js +1 -1
  234. package/dist/esm-es5/road-input-group.entry.js +1 -1
  235. package/dist/esm-es5/road-input.entry.js +1 -1
  236. package/dist/esm-es5/road-modal.entry.js +1 -1
  237. package/dist/esm-es5/road-navbar-item.entry.js +1 -1
  238. package/dist/esm-es5/road-navbar.entry.js +1 -1
  239. package/dist/esm-es5/road-plate-number.entry.js +1 -1
  240. package/dist/esm-es5/road-progress.entry.js +1 -1
  241. package/dist/esm-es5/road-radio-group.entry.js +1 -1
  242. package/dist/esm-es5/road-radio.entry.js +1 -1
  243. package/dist/esm-es5/road-range.entry.js +1 -1
  244. package/dist/esm-es5/road-rating.entry.js +1 -1
  245. package/dist/esm-es5/road-select-filter.entry.js +1 -1
  246. package/dist/esm-es5/road-select.entry.js +1 -1
  247. package/dist/esm-es5/road-skeleton.entry.js +1 -1
  248. package/dist/esm-es5/road-spinner.entry.js +1 -1
  249. package/dist/esm-es5/road-switch.entry.js +1 -1
  250. package/dist/esm-es5/road-tab-bar.entry.js +1 -1
  251. package/dist/esm-es5/road-tab-button.entry.js +1 -1
  252. package/dist/esm-es5/road-tab.entry.js +1 -1
  253. package/dist/esm-es5/road-table.entry.js +1 -1
  254. package/dist/esm-es5/road-tabs.entry.js +1 -1
  255. package/dist/esm-es5/road-text.entry.js +1 -1
  256. package/dist/esm-es5/road-textarea.entry.js +1 -1
  257. package/dist/esm-es5/road-toast.entry.js +1 -1
  258. package/dist/esm-es5/road-toolbar-title.entry.js +1 -1
  259. package/dist/esm-es5/road-tooltip.entry.js +1 -1
  260. package/dist/esm-es5/roadtrip.js +1 -1
  261. package/dist/esm-es5/{shadow-css-83bb1d14.js → shadow-css-bfd5796e.js} +0 -0
  262. package/dist/esm-es5/{utils-23aa19c1.js → utils-39de47f7.js} +1 -1
  263. package/dist/html.html-data.json +63 -21
  264. package/dist/icons/icons.svg +1 -1
  265. package/dist/icons/index.d.ts +20 -1
  266. package/dist/icons/index.js +22 -3
  267. package/dist/roadtrip/index.esm.js +1 -1
  268. package/dist/roadtrip/p-01cebe6a.entry.js +1 -0
  269. package/dist/roadtrip/p-04deac86.system.entry.js +1 -0
  270. package/dist/roadtrip/{p-05373846.system.js → p-05961c88.system.js} +1 -1
  271. package/dist/roadtrip/{p-2cf6206e.system.entry.js → p-06921946.system.entry.js} +1 -1
  272. package/dist/roadtrip/p-0ada8d41.entry.js +1 -0
  273. package/dist/roadtrip/{p-13b46f63.system.entry.js → p-0be273e0.system.entry.js} +1 -1
  274. package/dist/roadtrip/{p-cedaf396.system.entry.js → p-0cfc0efd.system.entry.js} +1 -1
  275. package/dist/roadtrip/{p-9bbeb646.entry.js → p-0e5cecff.entry.js} +1 -1
  276. package/dist/roadtrip/p-0e645dfb.system.entry.js +1 -0
  277. package/dist/roadtrip/p-0f532f30.system.entry.js +1 -0
  278. package/dist/roadtrip/p-102d3882.system.js +1 -0
  279. package/dist/roadtrip/{p-79a745a7.entry.js → p-1347a27e.entry.js} +1 -1
  280. package/dist/roadtrip/{p-f62ebe3f.system.entry.js → p-13c18cec.system.entry.js} +1 -1
  281. package/dist/roadtrip/p-1481edc3.entry.js +1 -0
  282. package/dist/roadtrip/p-1c0851b0.entry.js +1 -0
  283. package/dist/roadtrip/p-20a7a848.system.entry.js +1 -0
  284. package/dist/roadtrip/{p-1d83535a.entry.js → p-24234448.entry.js} +1 -1
  285. package/dist/roadtrip/{p-45b87537.system.entry.js → p-26b3aa33.system.entry.js} +1 -1
  286. package/dist/roadtrip/{p-e5eda362.system.entry.js → p-2740d308.system.entry.js} +1 -1
  287. package/dist/roadtrip/p-287f1612.system.entry.js +1 -0
  288. package/dist/roadtrip/p-299ecdd3.entry.js +1 -0
  289. package/dist/roadtrip/{p-b1a05290.system.entry.js → p-2f2dc4a0.system.entry.js} +1 -1
  290. package/dist/roadtrip/{p-8cb74e64.js → p-33e38a04.js} +1 -1
  291. package/dist/roadtrip/p-354107fa.entry.js +1 -0
  292. package/dist/roadtrip/{p-c7895d95.system.js → p-3683fe49.system.js} +0 -0
  293. package/dist/roadtrip/p-3ee7ff2a.system.entry.js +1 -0
  294. package/dist/roadtrip/{p-388a7f61.system.entry.js → p-42ccd4a2.system.entry.js} +1 -1
  295. package/dist/roadtrip/{p-8374797d.entry.js → p-44576eac.entry.js} +1 -1
  296. package/dist/roadtrip/p-46c22946.js +1 -0
  297. package/dist/roadtrip/{p-41bcd21c.system.entry.js → p-4742a822.system.entry.js} +1 -1
  298. package/dist/roadtrip/p-5bcd3e1f.entry.js +1 -0
  299. package/dist/roadtrip/p-6195c41f.system.entry.js +1 -0
  300. package/dist/roadtrip/{p-9b04e0cb.system.entry.js → p-646e75cf.system.entry.js} +1 -1
  301. package/dist/roadtrip/p-6a123e72.system.entry.js +1 -0
  302. package/dist/roadtrip/p-6bc4c517.system.entry.js +1 -0
  303. package/dist/roadtrip/p-6deb1943.system.entry.js +1 -0
  304. package/dist/roadtrip/p-6def92c3.entry.js +1 -0
  305. package/dist/roadtrip/p-6f248970.entry.js +1 -0
  306. package/dist/roadtrip/p-7070c8b5.system.entry.js +1 -0
  307. package/dist/roadtrip/p-7130ff47.entry.js +1 -0
  308. package/dist/roadtrip/{p-8649dccc.system.js → p-7154119b.system.js} +0 -0
  309. package/dist/roadtrip/p-7304b650.system.entry.js +1 -0
  310. package/dist/roadtrip/{p-a1f59f11.system.entry.js → p-74218654.system.entry.js} +1 -1
  311. package/dist/roadtrip/{p-085aad0a.system.entry.js → p-766f8a2a.system.entry.js} +1 -1
  312. package/dist/roadtrip/{p-628f5836.system.entry.js → p-76885294.system.entry.js} +1 -1
  313. package/dist/roadtrip/p-7765931a.system.entry.js +1 -0
  314. package/dist/roadtrip/{p-923c9893.entry.js → p-78315356.entry.js} +1 -1
  315. package/dist/roadtrip/p-7a07a70f.entry.js +1 -0
  316. package/dist/roadtrip/p-7b733694.js +1 -0
  317. package/dist/roadtrip/{p-ad3b839e.entry.js → p-7fe4f8f3.entry.js} +1 -1
  318. package/dist/roadtrip/{p-6688d8f8.system.entry.js → p-835d550a.system.entry.js} +1 -1
  319. package/dist/roadtrip/p-83f8960f.entry.js +1 -0
  320. package/dist/roadtrip/p-87eb24ee.entry.js +1 -0
  321. package/dist/roadtrip/p-8e21df57.system.entry.js +1 -0
  322. package/dist/roadtrip/{p-356163fb.js → p-93dab753.js} +0 -0
  323. package/dist/roadtrip/{p-39dd9c7f.entry.js → p-9567d161.entry.js} +1 -1
  324. package/dist/roadtrip/{p-a671df87.entry.js → p-9a1a293c.entry.js} +1 -1
  325. package/dist/roadtrip/{p-ffd2a5c1.system.entry.js → p-9afcfc7c.system.entry.js} +1 -1
  326. package/dist/roadtrip/{p-be0b7289.entry.js → p-9dd72bfa.entry.js} +1 -1
  327. package/dist/roadtrip/p-a1168bd5.system.entry.js +1 -0
  328. package/dist/roadtrip/p-a61e04a1.entry.js +1 -0
  329. package/dist/roadtrip/p-a7ddae1b.system.entry.js +1 -0
  330. package/dist/roadtrip/{p-8fc0f477.system.entry.js → p-a87e8b19.system.entry.js} +1 -1
  331. package/dist/roadtrip/{p-0626f8a2.system.entry.js → p-a8db6630.system.entry.js} +1 -1
  332. package/dist/roadtrip/{p-ad4a83f1.js → p-ac0761c3.js} +0 -0
  333. package/dist/roadtrip/{p-b862fe1a.system.js → p-ad92df4f.system.js} +1 -1
  334. package/dist/roadtrip/p-b0e17e68.entry.js +1 -0
  335. package/dist/roadtrip/{p-84578822.system.entry.js → p-b0ec7122.system.entry.js} +1 -1
  336. package/dist/roadtrip/{p-17ed8237.entry.js → p-b0ed748a.entry.js} +1 -1
  337. package/dist/roadtrip/p-b205281e.system.js +1 -0
  338. package/dist/roadtrip/{p-b6ea7ba9.system.entry.js → p-b591a3f7.system.entry.js} +1 -1
  339. package/dist/roadtrip/p-b6e60fca.system.entry.js +1 -0
  340. package/dist/roadtrip/p-bcf74e54.system.entry.js +1 -0
  341. package/dist/roadtrip/{p-d3e3af9e.system.entry.js → p-bd2a89d4.system.entry.js} +1 -1
  342. package/dist/roadtrip/p-bd4a114b.entry.js +1 -0
  343. package/dist/roadtrip/p-bebdee1e.entry.js +1 -0
  344. package/dist/roadtrip/{p-f907849c.system.entry.js → p-c0429d42.system.entry.js} +1 -1
  345. package/dist/roadtrip/p-c637a847.entry.js +1 -0
  346. package/dist/roadtrip/{p-f10872aa.entry.js → p-ced4c451.entry.js} +1 -1
  347. package/dist/roadtrip/{p-cb2bebde.entry.js → p-d06202e7.entry.js} +1 -1
  348. package/dist/roadtrip/p-d5607a82.system.entry.js +1 -0
  349. package/dist/roadtrip/{p-790067ad.system.entry.js → p-d861032d.system.entry.js} +1 -1
  350. package/dist/roadtrip/{p-f6d6d227.entry.js → p-dcfc236e.entry.js} +1 -1
  351. package/dist/roadtrip/p-e4f0f0d7.entry.js +1 -0
  352. package/dist/roadtrip/p-e5756d79.entry.js +1 -0
  353. package/dist/roadtrip/p-e6664bbe.entry.js +1 -0
  354. package/dist/roadtrip/{p-82d3347b.entry.js → p-e70b2a21.entry.js} +1 -1
  355. package/dist/roadtrip/{p-2d8ba6be.entry.js → p-e9a6f1fb.entry.js} +1 -1
  356. package/dist/roadtrip/p-ea45d823.entry.js +1 -0
  357. package/dist/roadtrip/p-ed2dbf57.entry.js +1 -0
  358. package/dist/roadtrip/{p-72b3db6d.system.js → p-efa19d38.system.js} +0 -0
  359. package/dist/roadtrip/{p-9233dfbe.entry.js → p-f0ec3a64.entry.js} +1 -1
  360. package/dist/roadtrip/p-f20a3658.entry.js +1 -0
  361. package/dist/roadtrip/p-f22c63b7.entry.js +1 -0
  362. package/dist/roadtrip/p-f233746c.system.entry.js +1 -0
  363. package/dist/roadtrip/{p-2b0d3888.system.js → p-f33e4ac5.system.js} +1 -1
  364. package/dist/roadtrip/{p-41aa7a41.system.entry.js → p-f4f42d5c.system.entry.js} +1 -1
  365. package/dist/roadtrip/{p-112e8d3f.js → p-f6631560.js} +0 -0
  366. package/dist/roadtrip/p-fa68c113.entry.js +1 -0
  367. package/dist/roadtrip/p-fce355f6.entry.js +1 -0
  368. package/dist/roadtrip/roadtrip.esm.js +1 -1
  369. package/dist/roadtrip/roadtrip.js +1 -1
  370. package/dist/roadtrip/svg/attachment.svg +1 -0
  371. package/dist/roadtrip/svg/check-list-color.svg +1 -0
  372. package/dist/roadtrip/svg/check-list.svg +1 -0
  373. package/dist/roadtrip/svg/device-smartphone-music-color.svg +1 -0
  374. package/dist/roadtrip/svg/device-smartphone-music.svg +1 -0
  375. package/dist/roadtrip/svg/mic-off-outline-color.svg +1 -0
  376. package/dist/roadtrip/svg/mic-off-outline.svg +1 -0
  377. package/dist/roadtrip/svg/mic-off.svg +1 -0
  378. package/dist/roadtrip/svg/people-community-outline-color.svg +1 -0
  379. package/dist/roadtrip/svg/people-community-outline.svg +1 -0
  380. package/dist/roadtrip/svg/people-community.svg +1 -0
  381. package/dist/roadtrip/svg/people-coworker-color.svg +1 -1
  382. package/dist/roadtrip/svg/people-coworker.svg +1 -1
  383. package/dist/roadtrip/svg/player-radio-music-outline-color.svg +1 -0
  384. package/dist/roadtrip/svg/player-radio-music-outline.svg +1 -0
  385. package/dist/roadtrip/svg/station-electric-outline-color.svg +1 -0
  386. package/dist/roadtrip/svg/station-electric-outline.svg +1 -0
  387. package/dist/roadtrip/svg/vehicle-car-all-authorize-outline-color.svg +1 -0
  388. package/dist/roadtrip/svg/vehicle-car-all-authorize-outline.svg +1 -0
  389. package/dist/roadtrip/svg/vehicle-car-all-unauthorize-outline-color.svg +1 -0
  390. package/dist/roadtrip/svg/vehicle-car-all-unauthorize-outline.svg +1 -0
  391. package/dist/roadtrip/svg/{vehicle-car-bodyworkoutline-color.svg → vehicle-car-bodywork-outline-color.svg} +0 -0
  392. package/dist/types/components/accordion/accordion.d.ts +1 -1
  393. package/dist/types/components/autocomplete/autocomplete.d.ts +5 -0
  394. package/dist/types/components/button/button.d.ts +6 -2
  395. package/dist/types/components/card/card.d.ts +5 -0
  396. package/dist/types/components/carousel/carousel.d.ts +16 -16
  397. package/dist/types/components/checkbox/checkbox.d.ts +12 -3
  398. package/dist/types/components/chip/chip.d.ts +3 -3
  399. package/dist/types/components/collapse/collapse.d.ts +4 -4
  400. package/dist/types/components/counter/counter.d.ts +8 -4
  401. package/dist/types/components/dropdown/dropdown.d.ts +1 -1
  402. package/dist/types/components/duration/duration.d.ts +44 -0
  403. package/dist/types/components/img/img.d.ts +15 -3
  404. package/dist/types/components/input/input.d.ts +10 -0
  405. package/dist/types/components/navbar/navbar.d.ts +2 -0
  406. package/dist/types/components/navbar-item/navbar-item.d.ts +2 -0
  407. package/dist/types/components/plate-number/plate-number.d.ts +10 -0
  408. package/dist/types/components/radio/radio.d.ts +4 -0
  409. package/dist/types/components/radio-group/radio-group.d.ts +4 -0
  410. package/dist/types/components/range/range.d.ts +4 -0
  411. package/dist/types/components/select/select.d.ts +8 -0
  412. package/dist/types/components/select-filter/select-filter.d.ts +10 -0
  413. package/dist/types/components/switch/switch.d.ts +14 -5
  414. package/dist/types/components/tab-bar/tab-bar.d.ts +2 -0
  415. package/dist/types/components/tab-button/tab-button.d.ts +2 -0
  416. package/dist/types/components/tabs/tabs.d.ts +8 -0
  417. package/dist/types/components/textarea/textarea.d.ts +18 -8
  418. package/dist/types/components/toast/toast.d.ts +2 -2
  419. package/dist/types/components/tooltip/tooltip.d.ts +2 -2
  420. package/dist/types/components.d.ts +185 -109
  421. package/dist/types/stencil-public-runtime.d.ts +6 -4
  422. package/icons/icons.svg +1 -1
  423. package/icons/index.d.ts +20 -1
  424. package/icons/index.js +22 -3
  425. package/loader/cdn.js +3 -0
  426. package/loader/index.cjs.js +3 -0
  427. package/loader/index.d.ts +12 -0
  428. package/loader/index.es2017.js +3 -0
  429. package/loader/index.js +4 -0
  430. package/loader/package.json +10 -0
  431. package/package.json +10 -7
  432. package/dist/esm-es5/app-6a43d362.js +0 -1
  433. package/dist/roadtrip/p-0205d149.entry.js +0 -1
  434. package/dist/roadtrip/p-0245b436.system.entry.js +0 -1
  435. package/dist/roadtrip/p-06049c44.entry.js +0 -1
  436. package/dist/roadtrip/p-0de3a4c8.system.entry.js +0 -1
  437. package/dist/roadtrip/p-10cc8504.system.entry.js +0 -1
  438. package/dist/roadtrip/p-16bce6f9.system.entry.js +0 -1
  439. package/dist/roadtrip/p-2965ce57.entry.js +0 -1
  440. package/dist/roadtrip/p-36a7c233.system.js +0 -1
  441. package/dist/roadtrip/p-3c7147c6.system.entry.js +0 -1
  442. package/dist/roadtrip/p-3d2cf159.entry.js +0 -1
  443. package/dist/roadtrip/p-3e56faf1.entry.js +0 -1
  444. package/dist/roadtrip/p-404509c1.entry.js +0 -1
  445. package/dist/roadtrip/p-464814f7.system.entry.js +0 -1
  446. package/dist/roadtrip/p-48a0df03.system.entry.js +0 -1
  447. package/dist/roadtrip/p-55c19c46.system.entry.js +0 -1
  448. package/dist/roadtrip/p-57e9b50d.entry.js +0 -1
  449. package/dist/roadtrip/p-5cfcbccd.system.entry.js +0 -1
  450. package/dist/roadtrip/p-674922e2.system.entry.js +0 -1
  451. package/dist/roadtrip/p-694eee8e.system.entry.js +0 -1
  452. package/dist/roadtrip/p-70b2bc5a.entry.js +0 -1
  453. package/dist/roadtrip/p-70d0fb28.entry.js +0 -1
  454. package/dist/roadtrip/p-726b0209.system.entry.js +0 -1
  455. package/dist/roadtrip/p-78143a79.system.entry.js +0 -1
  456. package/dist/roadtrip/p-89fb8799.entry.js +0 -1
  457. package/dist/roadtrip/p-96f5d0f6.entry.js +0 -1
  458. package/dist/roadtrip/p-9846103f.entry.js +0 -1
  459. package/dist/roadtrip/p-9d3921a8.system.js +0 -1
  460. package/dist/roadtrip/p-9faa50e1.system.entry.js +0 -1
  461. package/dist/roadtrip/p-a082797b.entry.js +0 -1
  462. package/dist/roadtrip/p-a0cbd965.system.entry.js +0 -1
  463. package/dist/roadtrip/p-a6827ec2.entry.js +0 -1
  464. package/dist/roadtrip/p-aa63d5e9.system.entry.js +0 -1
  465. package/dist/roadtrip/p-acc76968.entry.js +0 -1
  466. package/dist/roadtrip/p-af6faf9b.system.entry.js +0 -1
  467. package/dist/roadtrip/p-b0c6bcbf.entry.js +0 -1
  468. package/dist/roadtrip/p-bf18c600.system.entry.js +0 -1
  469. package/dist/roadtrip/p-c6b70e6f.js +0 -1
  470. package/dist/roadtrip/p-c9b37cd7.entry.js +0 -1
  471. package/dist/roadtrip/p-cd0efcac.system.entry.js +0 -1
  472. package/dist/roadtrip/p-d11931f0.js +0 -1
  473. package/dist/roadtrip/p-d39f805b.entry.js +0 -1
  474. package/dist/roadtrip/p-dad9d770.entry.js +0 -1
  475. package/dist/roadtrip/p-dd6c27c5.entry.js +0 -1
  476. package/dist/roadtrip/p-ded9cf97.entry.js +0 -1
  477. package/dist/roadtrip/p-eadfbbbb.entry.js +0 -1
  478. package/dist/roadtrip/p-f7547337.entry.js +0 -1
  479. package/dist/roadtrip/p-f80248b1.entry.js +0 -1
  480. package/dist/roadtrip/p-fe45a922.entry.js +0 -1
  481. package/dist/roadtrip/p-ffacdd19.entry.js +0 -1
@@ -1,10 +1,1789 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, e as getElement } from './index-4e5ea092.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, e as getElement } from './index-0c8a0e04.js';
2
+
3
+ /**
4
+ * Fuse.js v6.5.3 - Lightweight fuzzy-search (http://fusejs.io)
5
+ *
6
+ * Copyright (c) 2021 Kiro Risk (http://kiro.me)
7
+ * All Rights Reserved. Apache Software License 2.0
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ */
11
+
12
+ function isArray(value) {
13
+ return !Array.isArray
14
+ ? getTag(value) === '[object Array]'
15
+ : Array.isArray(value)
16
+ }
17
+
18
+ // Adapted from: https://github.com/lodash/lodash/blob/master/.internal/baseToString.js
19
+ const INFINITY = 1 / 0;
20
+ function baseToString(value) {
21
+ // Exit early for strings to avoid a performance hit in some environments.
22
+ if (typeof value == 'string') {
23
+ return value
24
+ }
25
+ let result = value + '';
26
+ return result == '0' && 1 / value == -INFINITY ? '-0' : result
27
+ }
28
+
29
+ function toString(value) {
30
+ return value == null ? '' : baseToString(value)
31
+ }
32
+
33
+ function isString(value) {
34
+ return typeof value === 'string'
35
+ }
36
+
37
+ function isNumber(value) {
38
+ return typeof value === 'number'
39
+ }
40
+
41
+ // Adapted from: https://github.com/lodash/lodash/blob/master/isBoolean.js
42
+ function isBoolean(value) {
43
+ return (
44
+ value === true ||
45
+ value === false ||
46
+ (isObjectLike(value) && getTag(value) == '[object Boolean]')
47
+ )
48
+ }
49
+
50
+ function isObject(value) {
51
+ return typeof value === 'object'
52
+ }
53
+
54
+ // Checks if `value` is object-like.
55
+ function isObjectLike(value) {
56
+ return isObject(value) && value !== null
57
+ }
58
+
59
+ function isDefined(value) {
60
+ return value !== undefined && value !== null
61
+ }
62
+
63
+ function isBlank(value) {
64
+ return !value.trim().length
65
+ }
66
+
67
+ // Gets the `toStringTag` of `value`.
68
+ // Adapted from: https://github.com/lodash/lodash/blob/master/.internal/getTag.js
69
+ function getTag(value) {
70
+ return value == null
71
+ ? value === undefined
72
+ ? '[object Undefined]'
73
+ : '[object Null]'
74
+ : Object.prototype.toString.call(value)
75
+ }
76
+
77
+ const EXTENDED_SEARCH_UNAVAILABLE = 'Extended search is not available';
78
+
79
+ const INCORRECT_INDEX_TYPE = "Incorrect 'index' type";
80
+
81
+ const LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = (key) =>
82
+ `Invalid value for key ${key}`;
83
+
84
+ const PATTERN_LENGTH_TOO_LARGE = (max) =>
85
+ `Pattern length exceeds max of ${max}.`;
86
+
87
+ const MISSING_KEY_PROPERTY = (name) => `Missing ${name} property in key`;
88
+
89
+ const INVALID_KEY_WEIGHT_VALUE = (key) =>
90
+ `Property 'weight' in key '${key}' must be a positive integer`;
91
+
92
+ const hasOwn = Object.prototype.hasOwnProperty;
93
+
94
+ class KeyStore {
95
+ constructor(keys) {
96
+ this._keys = [];
97
+ this._keyMap = {};
98
+
99
+ let totalWeight = 0;
100
+
101
+ keys.forEach((key) => {
102
+ let obj = createKey(key);
103
+
104
+ totalWeight += obj.weight;
105
+
106
+ this._keys.push(obj);
107
+ this._keyMap[obj.id] = obj;
108
+
109
+ totalWeight += obj.weight;
110
+ });
111
+
112
+ // Normalize weights so that their sum is equal to 1
113
+ this._keys.forEach((key) => {
114
+ key.weight /= totalWeight;
115
+ });
116
+ }
117
+ get(keyId) {
118
+ return this._keyMap[keyId]
119
+ }
120
+ keys() {
121
+ return this._keys
122
+ }
123
+ toJSON() {
124
+ return JSON.stringify(this._keys)
125
+ }
126
+ }
127
+
128
+ function createKey(key) {
129
+ let path = null;
130
+ let id = null;
131
+ let src = null;
132
+ let weight = 1;
133
+
134
+ if (isString(key) || isArray(key)) {
135
+ src = key;
136
+ path = createKeyPath(key);
137
+ id = createKeyId(key);
138
+ } else {
139
+ if (!hasOwn.call(key, 'name')) {
140
+ throw new Error(MISSING_KEY_PROPERTY('name'))
141
+ }
142
+
143
+ const name = key.name;
144
+ src = name;
145
+
146
+ if (hasOwn.call(key, 'weight')) {
147
+ weight = key.weight;
148
+
149
+ if (weight <= 0) {
150
+ throw new Error(INVALID_KEY_WEIGHT_VALUE(name))
151
+ }
152
+ }
153
+
154
+ path = createKeyPath(name);
155
+ id = createKeyId(name);
156
+ }
157
+
158
+ return { path, id, weight, src }
159
+ }
160
+
161
+ function createKeyPath(key) {
162
+ return isArray(key) ? key : key.split('.')
163
+ }
164
+
165
+ function createKeyId(key) {
166
+ return isArray(key) ? key.join('.') : key
167
+ }
168
+
169
+ function get(obj, path) {
170
+ let list = [];
171
+ let arr = false;
172
+
173
+ const deepGet = (obj, path, index) => {
174
+ if (!isDefined(obj)) {
175
+ return
176
+ }
177
+ if (!path[index]) {
178
+ // If there's no path left, we've arrived at the object we care about.
179
+ list.push(obj);
180
+ } else {
181
+ let key = path[index];
182
+
183
+ const value = obj[key];
184
+
185
+ if (!isDefined(value)) {
186
+ return
187
+ }
188
+
189
+ // If we're at the last value in the path, and if it's a string/number/bool,
190
+ // add it to the list
191
+ if (
192
+ index === path.length - 1 &&
193
+ (isString(value) || isNumber(value) || isBoolean(value))
194
+ ) {
195
+ list.push(toString(value));
196
+ } else if (isArray(value)) {
197
+ arr = true;
198
+ // Search each item in the array.
199
+ for (let i = 0, len = value.length; i < len; i += 1) {
200
+ deepGet(value[i], path, index + 1);
201
+ }
202
+ } else if (path.length) {
203
+ // An object. Recurse further.
204
+ deepGet(value, path, index + 1);
205
+ }
206
+ }
207
+ };
208
+
209
+ // Backwards compatibility (since path used to be a string)
210
+ deepGet(obj, isString(path) ? path.split('.') : path, 0);
211
+
212
+ return arr ? list : list[0]
213
+ }
214
+
215
+ const MatchOptions = {
216
+ // Whether the matches should be included in the result set. When `true`, each record in the result
217
+ // set will include the indices of the matched characters.
218
+ // These can consequently be used for highlighting purposes.
219
+ includeMatches: false,
220
+ // When `true`, the matching function will continue to the end of a search pattern even if
221
+ // a perfect match has already been located in the string.
222
+ findAllMatches: false,
223
+ // Minimum number of characters that must be matched before a result is considered a match
224
+ minMatchCharLength: 1
225
+ };
226
+
227
+ const BasicOptions = {
228
+ // When `true`, the algorithm continues searching to the end of the input even if a perfect
229
+ // match is found before the end of the same input.
230
+ isCaseSensitive: false,
231
+ // When true, the matching function will continue to the end of a search pattern even if
232
+ includeScore: false,
233
+ // List of properties that will be searched. This also supports nested properties.
234
+ keys: [],
235
+ // Whether to sort the result list, by score
236
+ shouldSort: true,
237
+ // Default sort function: sort by ascending score, ascending index
238
+ sortFn: (a, b) =>
239
+ a.score === b.score ? (a.idx < b.idx ? -1 : 1) : a.score < b.score ? -1 : 1
240
+ };
241
+
242
+ const FuzzyOptions = {
243
+ // Approximately where in the text is the pattern expected to be found?
244
+ location: 0,
245
+ // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
246
+ // (of both letters and location), a threshold of '1.0' would match anything.
247
+ threshold: 0.6,
248
+ // Determines how close the match must be to the fuzzy location (specified above).
249
+ // An exact letter match which is 'distance' characters away from the fuzzy location
250
+ // would score as a complete mismatch. A distance of '0' requires the match be at
251
+ // the exact location specified, a threshold of '1000' would require a perfect match
252
+ // to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
253
+ distance: 100
254
+ };
255
+
256
+ const AdvancedOptions = {
257
+ // When `true`, it enables the use of unix-like search commands
258
+ useExtendedSearch: false,
259
+ // The get function to use when fetching an object's properties.
260
+ // The default will search nested paths *ie foo.bar.baz*
261
+ getFn: get,
262
+ // When `true`, search will ignore `location` and `distance`, so it won't matter
263
+ // where in the string the pattern appears.
264
+ // More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score
265
+ ignoreLocation: false,
266
+ // When `true`, the calculation for the relevance score (used for sorting) will
267
+ // ignore the field-length norm.
268
+ // More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm
269
+ ignoreFieldNorm: false,
270
+ // The weight to determine how much field length norm effects scoring.
271
+ fieldNormWeight: 1
272
+ };
273
+
274
+ var Config = {
275
+ ...BasicOptions,
276
+ ...MatchOptions,
277
+ ...FuzzyOptions,
278
+ ...AdvancedOptions
279
+ };
280
+
281
+ const SPACE = /[^ ]+/g;
282
+
283
+ // Field-length norm: the shorter the field, the higher the weight.
284
+ // Set to 3 decimals to reduce index size.
285
+ function norm(weight = 1, mantissa = 3) {
286
+ const cache = new Map();
287
+ const m = Math.pow(10, mantissa);
288
+
289
+ return {
290
+ get(value) {
291
+ const numTokens = value.match(SPACE).length;
292
+
293
+ if (cache.has(numTokens)) {
294
+ return cache.get(numTokens)
295
+ }
296
+
297
+ // Default function is 1/sqrt(x), weight makes that variable
298
+ const norm = 1 / Math.pow(numTokens, 0.5 * weight);
299
+
300
+ // In place of `toFixed(mantissa)`, for faster computation
301
+ const n = parseFloat(Math.round(norm * m) / m);
302
+
303
+ cache.set(numTokens, n);
304
+
305
+ return n
306
+ },
307
+ clear() {
308
+ cache.clear();
309
+ }
310
+ }
311
+ }
312
+
313
+ class FuseIndex {
314
+ constructor({
315
+ getFn = Config.getFn,
316
+ fieldNormWeight = Config.fieldNormWeight
317
+ } = {}) {
318
+ this.norm = norm(fieldNormWeight, 3);
319
+ this.getFn = getFn;
320
+ this.isCreated = false;
321
+
322
+ this.setIndexRecords();
323
+ }
324
+ setSources(docs = []) {
325
+ this.docs = docs;
326
+ }
327
+ setIndexRecords(records = []) {
328
+ this.records = records;
329
+ }
330
+ setKeys(keys = []) {
331
+ this.keys = keys;
332
+ this._keysMap = {};
333
+ keys.forEach((key, idx) => {
334
+ this._keysMap[key.id] = idx;
335
+ });
336
+ }
337
+ create() {
338
+ if (this.isCreated || !this.docs.length) {
339
+ return
340
+ }
341
+
342
+ this.isCreated = true;
343
+
344
+ // List is Array<String>
345
+ if (isString(this.docs[0])) {
346
+ this.docs.forEach((doc, docIndex) => {
347
+ this._addString(doc, docIndex);
348
+ });
349
+ } else {
350
+ // List is Array<Object>
351
+ this.docs.forEach((doc, docIndex) => {
352
+ this._addObject(doc, docIndex);
353
+ });
354
+ }
355
+
356
+ this.norm.clear();
357
+ }
358
+ // Adds a doc to the end of the index
359
+ add(doc) {
360
+ const idx = this.size();
361
+
362
+ if (isString(doc)) {
363
+ this._addString(doc, idx);
364
+ } else {
365
+ this._addObject(doc, idx);
366
+ }
367
+ }
368
+ // Removes the doc at the specified index of the index
369
+ removeAt(idx) {
370
+ this.records.splice(idx, 1);
371
+
372
+ // Change ref index of every subsquent doc
373
+ for (let i = idx, len = this.size(); i < len; i += 1) {
374
+ this.records[i].i -= 1;
375
+ }
376
+ }
377
+ getValueForItemAtKeyId(item, keyId) {
378
+ return item[this._keysMap[keyId]]
379
+ }
380
+ size() {
381
+ return this.records.length
382
+ }
383
+ _addString(doc, docIndex) {
384
+ if (!isDefined(doc) || isBlank(doc)) {
385
+ return
386
+ }
387
+
388
+ let record = {
389
+ v: doc,
390
+ i: docIndex,
391
+ n: this.norm.get(doc)
392
+ };
393
+
394
+ this.records.push(record);
395
+ }
396
+ _addObject(doc, docIndex) {
397
+ let record = { i: docIndex, $: {} };
398
+
399
+ // Iterate over every key (i.e, path), and fetch the value at that key
400
+ this.keys.forEach((key, keyIndex) => {
401
+ // console.log(key)
402
+ let value = this.getFn(doc, key.path);
403
+
404
+ if (!isDefined(value)) {
405
+ return
406
+ }
407
+
408
+ if (isArray(value)) {
409
+ let subRecords = [];
410
+ const stack = [{ nestedArrIndex: -1, value }];
411
+
412
+ while (stack.length) {
413
+ const { nestedArrIndex, value } = stack.pop();
414
+
415
+ if (!isDefined(value)) {
416
+ continue
417
+ }
418
+
419
+ if (isString(value) && !isBlank(value)) {
420
+ let subRecord = {
421
+ v: value,
422
+ i: nestedArrIndex,
423
+ n: this.norm.get(value)
424
+ };
425
+
426
+ subRecords.push(subRecord);
427
+ } else if (isArray(value)) {
428
+ value.forEach((item, k) => {
429
+ stack.push({
430
+ nestedArrIndex: k,
431
+ value: item
432
+ });
433
+ });
434
+ } else ;
435
+ }
436
+ record.$[keyIndex] = subRecords;
437
+ } else if (!isBlank(value)) {
438
+ let subRecord = {
439
+ v: value,
440
+ n: this.norm.get(value)
441
+ };
442
+
443
+ record.$[keyIndex] = subRecord;
444
+ }
445
+ });
446
+
447
+ this.records.push(record);
448
+ }
449
+ toJSON() {
450
+ return {
451
+ keys: this.keys,
452
+ records: this.records
453
+ }
454
+ }
455
+ }
456
+
457
+ function createIndex(
458
+ keys,
459
+ docs,
460
+ { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}
461
+ ) {
462
+ const myIndex = new FuseIndex({ getFn, fieldNormWeight });
463
+ myIndex.setKeys(keys.map(createKey));
464
+ myIndex.setSources(docs);
465
+ myIndex.create();
466
+ return myIndex
467
+ }
468
+
469
+ function parseIndex(
470
+ data,
471
+ { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}
472
+ ) {
473
+ const { keys, records } = data;
474
+ const myIndex = new FuseIndex({ getFn, fieldNormWeight });
475
+ myIndex.setKeys(keys);
476
+ myIndex.setIndexRecords(records);
477
+ return myIndex
478
+ }
479
+
480
+ function computeScore$1(
481
+ pattern,
482
+ {
483
+ errors = 0,
484
+ currentLocation = 0,
485
+ expectedLocation = 0,
486
+ distance = Config.distance,
487
+ ignoreLocation = Config.ignoreLocation
488
+ } = {}
489
+ ) {
490
+ const accuracy = errors / pattern.length;
491
+
492
+ if (ignoreLocation) {
493
+ return accuracy
494
+ }
495
+
496
+ const proximity = Math.abs(expectedLocation - currentLocation);
497
+
498
+ if (!distance) {
499
+ // Dodge divide by zero error.
500
+ return proximity ? 1.0 : accuracy
501
+ }
502
+
503
+ return accuracy + proximity / distance
504
+ }
505
+
506
+ function convertMaskToIndices(
507
+ matchmask = [],
508
+ minMatchCharLength = Config.minMatchCharLength
509
+ ) {
510
+ let indices = [];
511
+ let start = -1;
512
+ let end = -1;
513
+ let i = 0;
514
+
515
+ for (let len = matchmask.length; i < len; i += 1) {
516
+ let match = matchmask[i];
517
+ if (match && start === -1) {
518
+ start = i;
519
+ } else if (!match && start !== -1) {
520
+ end = i - 1;
521
+ if (end - start + 1 >= minMatchCharLength) {
522
+ indices.push([start, end]);
523
+ }
524
+ start = -1;
525
+ }
526
+ }
527
+
528
+ // (i-1 - start) + 1 => i - start
529
+ if (matchmask[i - 1] && i - start >= minMatchCharLength) {
530
+ indices.push([start, i - 1]);
531
+ }
532
+
533
+ return indices
534
+ }
535
+
536
+ // Machine word size
537
+ const MAX_BITS = 32;
538
+
539
+ function search(
540
+ text,
541
+ pattern,
542
+ patternAlphabet,
543
+ {
544
+ location = Config.location,
545
+ distance = Config.distance,
546
+ threshold = Config.threshold,
547
+ findAllMatches = Config.findAllMatches,
548
+ minMatchCharLength = Config.minMatchCharLength,
549
+ includeMatches = Config.includeMatches,
550
+ ignoreLocation = Config.ignoreLocation
551
+ } = {}
552
+ ) {
553
+ if (pattern.length > MAX_BITS) {
554
+ throw new Error(PATTERN_LENGTH_TOO_LARGE(MAX_BITS))
555
+ }
556
+
557
+ const patternLen = pattern.length;
558
+ // Set starting location at beginning text and initialize the alphabet.
559
+ const textLen = text.length;
560
+ // Handle the case when location > text.length
561
+ const expectedLocation = Math.max(0, Math.min(location, textLen));
562
+ // Highest score beyond which we give up.
563
+ let currentThreshold = threshold;
564
+ // Is there a nearby exact match? (speedup)
565
+ let bestLocation = expectedLocation;
566
+
567
+ // Performance: only computer matches when the minMatchCharLength > 1
568
+ // OR if `includeMatches` is true.
569
+ const computeMatches = minMatchCharLength > 1 || includeMatches;
570
+ // A mask of the matches, used for building the indices
571
+ const matchMask = computeMatches ? Array(textLen) : [];
572
+
573
+ let index;
574
+
575
+ // Get all exact matches, here for speed up
576
+ while ((index = text.indexOf(pattern, bestLocation)) > -1) {
577
+ let score = computeScore$1(pattern, {
578
+ currentLocation: index,
579
+ expectedLocation,
580
+ distance,
581
+ ignoreLocation
582
+ });
583
+
584
+ currentThreshold = Math.min(score, currentThreshold);
585
+ bestLocation = index + patternLen;
586
+
587
+ if (computeMatches) {
588
+ let i = 0;
589
+ while (i < patternLen) {
590
+ matchMask[index + i] = 1;
591
+ i += 1;
592
+ }
593
+ }
594
+ }
595
+
596
+ // Reset the best location
597
+ bestLocation = -1;
598
+
599
+ let lastBitArr = [];
600
+ let finalScore = 1;
601
+ let binMax = patternLen + textLen;
602
+
603
+ const mask = 1 << (patternLen - 1);
604
+
605
+ for (let i = 0; i < patternLen; i += 1) {
606
+ // Scan for the best match; each iteration allows for one more error.
607
+ // Run a binary search to determine how far from the match location we can stray
608
+ // at this error level.
609
+ let binMin = 0;
610
+ let binMid = binMax;
611
+
612
+ while (binMin < binMid) {
613
+ const score = computeScore$1(pattern, {
614
+ errors: i,
615
+ currentLocation: expectedLocation + binMid,
616
+ expectedLocation,
617
+ distance,
618
+ ignoreLocation
619
+ });
620
+
621
+ if (score <= currentThreshold) {
622
+ binMin = binMid;
623
+ } else {
624
+ binMax = binMid;
625
+ }
626
+
627
+ binMid = Math.floor((binMax - binMin) / 2 + binMin);
628
+ }
629
+
630
+ // Use the result from this iteration as the maximum for the next.
631
+ binMax = binMid;
632
+
633
+ let start = Math.max(1, expectedLocation - binMid + 1);
634
+ let finish = findAllMatches
635
+ ? textLen
636
+ : Math.min(expectedLocation + binMid, textLen) + patternLen;
637
+
638
+ // Initialize the bit array
639
+ let bitArr = Array(finish + 2);
640
+
641
+ bitArr[finish + 1] = (1 << i) - 1;
642
+
643
+ for (let j = finish; j >= start; j -= 1) {
644
+ let currentLocation = j - 1;
645
+ let charMatch = patternAlphabet[text.charAt(currentLocation)];
646
+
647
+ if (computeMatches) {
648
+ // Speed up: quick bool to int conversion (i.e, `charMatch ? 1 : 0`)
649
+ matchMask[currentLocation] = +!!charMatch;
650
+ }
651
+
652
+ // First pass: exact match
653
+ bitArr[j] = ((bitArr[j + 1] << 1) | 1) & charMatch;
654
+
655
+ // Subsequent passes: fuzzy match
656
+ if (i) {
657
+ bitArr[j] |=
658
+ ((lastBitArr[j + 1] | lastBitArr[j]) << 1) | 1 | lastBitArr[j + 1];
659
+ }
660
+
661
+ if (bitArr[j] & mask) {
662
+ finalScore = computeScore$1(pattern, {
663
+ errors: i,
664
+ currentLocation,
665
+ expectedLocation,
666
+ distance,
667
+ ignoreLocation
668
+ });
669
+
670
+ // This match will almost certainly be better than any existing match.
671
+ // But check anyway.
672
+ if (finalScore <= currentThreshold) {
673
+ // Indeed it is
674
+ currentThreshold = finalScore;
675
+ bestLocation = currentLocation;
676
+
677
+ // Already passed `loc`, downhill from here on in.
678
+ if (bestLocation <= expectedLocation) {
679
+ break
680
+ }
681
+
682
+ // When passing `bestLocation`, don't exceed our current distance from `expectedLocation`.
683
+ start = Math.max(1, 2 * expectedLocation - bestLocation);
684
+ }
685
+ }
686
+ }
687
+
688
+ // No hope for a (better) match at greater error levels.
689
+ const score = computeScore$1(pattern, {
690
+ errors: i + 1,
691
+ currentLocation: expectedLocation,
692
+ expectedLocation,
693
+ distance,
694
+ ignoreLocation
695
+ });
696
+
697
+ if (score > currentThreshold) {
698
+ break
699
+ }
700
+
701
+ lastBitArr = bitArr;
702
+ }
703
+
704
+ const result = {
705
+ isMatch: bestLocation >= 0,
706
+ // Count exact matches (those with a score of 0) to be "almost" exact
707
+ score: Math.max(0.001, finalScore)
708
+ };
709
+
710
+ if (computeMatches) {
711
+ const indices = convertMaskToIndices(matchMask, minMatchCharLength);
712
+ if (!indices.length) {
713
+ result.isMatch = false;
714
+ } else if (includeMatches) {
715
+ result.indices = indices;
716
+ }
717
+ }
718
+
719
+ return result
720
+ }
721
+
722
+ function createPatternAlphabet(pattern) {
723
+ let mask = {};
724
+
725
+ for (let i = 0, len = pattern.length; i < len; i += 1) {
726
+ const char = pattern.charAt(i);
727
+ mask[char] = (mask[char] || 0) | (1 << (len - i - 1));
728
+ }
729
+
730
+ return mask
731
+ }
732
+
733
+ class BitapSearch {
734
+ constructor(
735
+ pattern,
736
+ {
737
+ location = Config.location,
738
+ threshold = Config.threshold,
739
+ distance = Config.distance,
740
+ includeMatches = Config.includeMatches,
741
+ findAllMatches = Config.findAllMatches,
742
+ minMatchCharLength = Config.minMatchCharLength,
743
+ isCaseSensitive = Config.isCaseSensitive,
744
+ ignoreLocation = Config.ignoreLocation
745
+ } = {}
746
+ ) {
747
+ this.options = {
748
+ location,
749
+ threshold,
750
+ distance,
751
+ includeMatches,
752
+ findAllMatches,
753
+ minMatchCharLength,
754
+ isCaseSensitive,
755
+ ignoreLocation
756
+ };
757
+
758
+ this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();
759
+
760
+ this.chunks = [];
761
+
762
+ if (!this.pattern.length) {
763
+ return
764
+ }
765
+
766
+ const addChunk = (pattern, startIndex) => {
767
+ this.chunks.push({
768
+ pattern,
769
+ alphabet: createPatternAlphabet(pattern),
770
+ startIndex
771
+ });
772
+ };
773
+
774
+ const len = this.pattern.length;
775
+
776
+ if (len > MAX_BITS) {
777
+ let i = 0;
778
+ const remainder = len % MAX_BITS;
779
+ const end = len - remainder;
780
+
781
+ while (i < end) {
782
+ addChunk(this.pattern.substr(i, MAX_BITS), i);
783
+ i += MAX_BITS;
784
+ }
785
+
786
+ if (remainder) {
787
+ const startIndex = len - MAX_BITS;
788
+ addChunk(this.pattern.substr(startIndex), startIndex);
789
+ }
790
+ } else {
791
+ addChunk(this.pattern, 0);
792
+ }
793
+ }
794
+
795
+ searchIn(text) {
796
+ const { isCaseSensitive, includeMatches } = this.options;
797
+
798
+ if (!isCaseSensitive) {
799
+ text = text.toLowerCase();
800
+ }
801
+
802
+ // Exact match
803
+ if (this.pattern === text) {
804
+ let result = {
805
+ isMatch: true,
806
+ score: 0
807
+ };
808
+
809
+ if (includeMatches) {
810
+ result.indices = [[0, text.length - 1]];
811
+ }
812
+
813
+ return result
814
+ }
815
+
816
+ // Otherwise, use Bitap algorithm
817
+ const {
818
+ location,
819
+ distance,
820
+ threshold,
821
+ findAllMatches,
822
+ minMatchCharLength,
823
+ ignoreLocation
824
+ } = this.options;
825
+
826
+ let allIndices = [];
827
+ let totalScore = 0;
828
+ let hasMatches = false;
829
+
830
+ this.chunks.forEach(({ pattern, alphabet, startIndex }) => {
831
+ const { isMatch, score, indices } = search(text, pattern, alphabet, {
832
+ location: location + startIndex,
833
+ distance,
834
+ threshold,
835
+ findAllMatches,
836
+ minMatchCharLength,
837
+ includeMatches,
838
+ ignoreLocation
839
+ });
840
+
841
+ if (isMatch) {
842
+ hasMatches = true;
843
+ }
844
+
845
+ totalScore += score;
846
+
847
+ if (isMatch && indices) {
848
+ allIndices = [...allIndices, ...indices];
849
+ }
850
+ });
851
+
852
+ let result = {
853
+ isMatch: hasMatches,
854
+ score: hasMatches ? totalScore / this.chunks.length : 1
855
+ };
856
+
857
+ if (hasMatches && includeMatches) {
858
+ result.indices = allIndices;
859
+ }
860
+
861
+ return result
862
+ }
863
+ }
864
+
865
+ class BaseMatch {
866
+ constructor(pattern) {
867
+ this.pattern = pattern;
868
+ }
869
+ static isMultiMatch(pattern) {
870
+ return getMatch(pattern, this.multiRegex)
871
+ }
872
+ static isSingleMatch(pattern) {
873
+ return getMatch(pattern, this.singleRegex)
874
+ }
875
+ search(/*text*/) {}
876
+ }
877
+
878
+ function getMatch(pattern, exp) {
879
+ const matches = pattern.match(exp);
880
+ return matches ? matches[1] : null
881
+ }
882
+
883
+ // Token: 'file
884
+
885
+ class ExactMatch extends BaseMatch {
886
+ constructor(pattern) {
887
+ super(pattern);
888
+ }
889
+ static get type() {
890
+ return 'exact'
891
+ }
892
+ static get multiRegex() {
893
+ return /^="(.*)"$/
894
+ }
895
+ static get singleRegex() {
896
+ return /^=(.*)$/
897
+ }
898
+ search(text) {
899
+ const isMatch = text === this.pattern;
900
+
901
+ return {
902
+ isMatch,
903
+ score: isMatch ? 0 : 1,
904
+ indices: [0, this.pattern.length - 1]
905
+ }
906
+ }
907
+ }
908
+
909
+ // Token: !fire
910
+
911
+ class InverseExactMatch extends BaseMatch {
912
+ constructor(pattern) {
913
+ super(pattern);
914
+ }
915
+ static get type() {
916
+ return 'inverse-exact'
917
+ }
918
+ static get multiRegex() {
919
+ return /^!"(.*)"$/
920
+ }
921
+ static get singleRegex() {
922
+ return /^!(.*)$/
923
+ }
924
+ search(text) {
925
+ const index = text.indexOf(this.pattern);
926
+ const isMatch = index === -1;
927
+
928
+ return {
929
+ isMatch,
930
+ score: isMatch ? 0 : 1,
931
+ indices: [0, text.length - 1]
932
+ }
933
+ }
934
+ }
935
+
936
+ // Token: ^file
937
+
938
+ class PrefixExactMatch extends BaseMatch {
939
+ constructor(pattern) {
940
+ super(pattern);
941
+ }
942
+ static get type() {
943
+ return 'prefix-exact'
944
+ }
945
+ static get multiRegex() {
946
+ return /^\^"(.*)"$/
947
+ }
948
+ static get singleRegex() {
949
+ return /^\^(.*)$/
950
+ }
951
+ search(text) {
952
+ const isMatch = text.startsWith(this.pattern);
953
+
954
+ return {
955
+ isMatch,
956
+ score: isMatch ? 0 : 1,
957
+ indices: [0, this.pattern.length - 1]
958
+ }
959
+ }
960
+ }
961
+
962
+ // Token: !^fire
963
+
964
+ class InversePrefixExactMatch extends BaseMatch {
965
+ constructor(pattern) {
966
+ super(pattern);
967
+ }
968
+ static get type() {
969
+ return 'inverse-prefix-exact'
970
+ }
971
+ static get multiRegex() {
972
+ return /^!\^"(.*)"$/
973
+ }
974
+ static get singleRegex() {
975
+ return /^!\^(.*)$/
976
+ }
977
+ search(text) {
978
+ const isMatch = !text.startsWith(this.pattern);
979
+
980
+ return {
981
+ isMatch,
982
+ score: isMatch ? 0 : 1,
983
+ indices: [0, text.length - 1]
984
+ }
985
+ }
986
+ }
987
+
988
+ // Token: .file$
989
+
990
+ class SuffixExactMatch extends BaseMatch {
991
+ constructor(pattern) {
992
+ super(pattern);
993
+ }
994
+ static get type() {
995
+ return 'suffix-exact'
996
+ }
997
+ static get multiRegex() {
998
+ return /^"(.*)"\$$/
999
+ }
1000
+ static get singleRegex() {
1001
+ return /^(.*)\$$/
1002
+ }
1003
+ search(text) {
1004
+ const isMatch = text.endsWith(this.pattern);
1005
+
1006
+ return {
1007
+ isMatch,
1008
+ score: isMatch ? 0 : 1,
1009
+ indices: [text.length - this.pattern.length, text.length - 1]
1010
+ }
1011
+ }
1012
+ }
1013
+
1014
+ // Token: !.file$
1015
+
1016
+ class InverseSuffixExactMatch extends BaseMatch {
1017
+ constructor(pattern) {
1018
+ super(pattern);
1019
+ }
1020
+ static get type() {
1021
+ return 'inverse-suffix-exact'
1022
+ }
1023
+ static get multiRegex() {
1024
+ return /^!"(.*)"\$$/
1025
+ }
1026
+ static get singleRegex() {
1027
+ return /^!(.*)\$$/
1028
+ }
1029
+ search(text) {
1030
+ const isMatch = !text.endsWith(this.pattern);
1031
+ return {
1032
+ isMatch,
1033
+ score: isMatch ? 0 : 1,
1034
+ indices: [0, text.length - 1]
1035
+ }
1036
+ }
1037
+ }
1038
+
1039
+ class FuzzyMatch extends BaseMatch {
1040
+ constructor(
1041
+ pattern,
1042
+ {
1043
+ location = Config.location,
1044
+ threshold = Config.threshold,
1045
+ distance = Config.distance,
1046
+ includeMatches = Config.includeMatches,
1047
+ findAllMatches = Config.findAllMatches,
1048
+ minMatchCharLength = Config.minMatchCharLength,
1049
+ isCaseSensitive = Config.isCaseSensitive,
1050
+ ignoreLocation = Config.ignoreLocation
1051
+ } = {}
1052
+ ) {
1053
+ super(pattern);
1054
+ this._bitapSearch = new BitapSearch(pattern, {
1055
+ location,
1056
+ threshold,
1057
+ distance,
1058
+ includeMatches,
1059
+ findAllMatches,
1060
+ minMatchCharLength,
1061
+ isCaseSensitive,
1062
+ ignoreLocation
1063
+ });
1064
+ }
1065
+ static get type() {
1066
+ return 'fuzzy'
1067
+ }
1068
+ static get multiRegex() {
1069
+ return /^"(.*)"$/
1070
+ }
1071
+ static get singleRegex() {
1072
+ return /^(.*)$/
1073
+ }
1074
+ search(text) {
1075
+ return this._bitapSearch.searchIn(text)
1076
+ }
1077
+ }
1078
+
1079
+ // Token: 'file
1080
+
1081
+ class IncludeMatch extends BaseMatch {
1082
+ constructor(pattern) {
1083
+ super(pattern);
1084
+ }
1085
+ static get type() {
1086
+ return 'include'
1087
+ }
1088
+ static get multiRegex() {
1089
+ return /^'"(.*)"$/
1090
+ }
1091
+ static get singleRegex() {
1092
+ return /^'(.*)$/
1093
+ }
1094
+ search(text) {
1095
+ let location = 0;
1096
+ let index;
1097
+
1098
+ const indices = [];
1099
+ const patternLen = this.pattern.length;
1100
+
1101
+ // Get all exact matches
1102
+ while ((index = text.indexOf(this.pattern, location)) > -1) {
1103
+ location = index + patternLen;
1104
+ indices.push([index, location - 1]);
1105
+ }
1106
+
1107
+ const isMatch = !!indices.length;
1108
+
1109
+ return {
1110
+ isMatch,
1111
+ score: isMatch ? 0 : 1,
1112
+ indices
1113
+ }
1114
+ }
1115
+ }
1116
+
1117
+ // ❗Order is important. DO NOT CHANGE.
1118
+ const searchers = [
1119
+ ExactMatch,
1120
+ IncludeMatch,
1121
+ PrefixExactMatch,
1122
+ InversePrefixExactMatch,
1123
+ InverseSuffixExactMatch,
1124
+ SuffixExactMatch,
1125
+ InverseExactMatch,
1126
+ FuzzyMatch
1127
+ ];
1128
+
1129
+ const searchersLen = searchers.length;
1130
+
1131
+ // Regex to split by spaces, but keep anything in quotes together
1132
+ const SPACE_RE = / +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/;
1133
+ const OR_TOKEN = '|';
1134
+
1135
+ // Return a 2D array representation of the query, for simpler parsing.
1136
+ // Example:
1137
+ // "^core go$ | rb$ | py$ xy$" => [["^core", "go$"], ["rb$"], ["py$", "xy$"]]
1138
+ function parseQuery(pattern, options = {}) {
1139
+ return pattern.split(OR_TOKEN).map((item) => {
1140
+ let query = item
1141
+ .trim()
1142
+ .split(SPACE_RE)
1143
+ .filter((item) => item && !!item.trim());
1144
+
1145
+ let results = [];
1146
+ for (let i = 0, len = query.length; i < len; i += 1) {
1147
+ const queryItem = query[i];
1148
+
1149
+ // 1. Handle multiple query match (i.e, once that are quoted, like `"hello world"`)
1150
+ let found = false;
1151
+ let idx = -1;
1152
+ while (!found && ++idx < searchersLen) {
1153
+ const searcher = searchers[idx];
1154
+ let token = searcher.isMultiMatch(queryItem);
1155
+ if (token) {
1156
+ results.push(new searcher(token, options));
1157
+ found = true;
1158
+ }
1159
+ }
1160
+
1161
+ if (found) {
1162
+ continue
1163
+ }
1164
+
1165
+ // 2. Handle single query matches (i.e, once that are *not* quoted)
1166
+ idx = -1;
1167
+ while (++idx < searchersLen) {
1168
+ const searcher = searchers[idx];
1169
+ let token = searcher.isSingleMatch(queryItem);
1170
+ if (token) {
1171
+ results.push(new searcher(token, options));
1172
+ break
1173
+ }
1174
+ }
1175
+ }
1176
+
1177
+ return results
1178
+ })
1179
+ }
1180
+
1181
+ // These extended matchers can return an array of matches, as opposed
1182
+ // to a singl match
1183
+ const MultiMatchSet = new Set([FuzzyMatch.type, IncludeMatch.type]);
1184
+
1185
+ /**
1186
+ * Command-like searching
1187
+ * ======================
1188
+ *
1189
+ * Given multiple search terms delimited by spaces.e.g. `^jscript .python$ ruby !java`,
1190
+ * search in a given text.
1191
+ *
1192
+ * Search syntax:
1193
+ *
1194
+ * | Token | Match type | Description |
1195
+ * | ----------- | -------------------------- | -------------------------------------- |
1196
+ * | `jscript` | fuzzy-match | Items that fuzzy match `jscript` |
1197
+ * | `=scheme` | exact-match | Items that are `scheme` |
1198
+ * | `'python` | include-match | Items that include `python` |
1199
+ * | `!ruby` | inverse-exact-match | Items that do not include `ruby` |
1200
+ * | `^java` | prefix-exact-match | Items that start with `java` |
1201
+ * | `!^earlang` | inverse-prefix-exact-match | Items that do not start with `earlang` |
1202
+ * | `.js$` | suffix-exact-match | Items that end with `.js` |
1203
+ * | `!.go$` | inverse-suffix-exact-match | Items that do not end with `.go` |
1204
+ *
1205
+ * A single pipe character acts as an OR operator. For example, the following
1206
+ * query matches entries that start with `core` and end with either`go`, `rb`,
1207
+ * or`py`.
1208
+ *
1209
+ * ```
1210
+ * ^core go$ | rb$ | py$
1211
+ * ```
1212
+ */
1213
+ class ExtendedSearch {
1214
+ constructor(
1215
+ pattern,
1216
+ {
1217
+ isCaseSensitive = Config.isCaseSensitive,
1218
+ includeMatches = Config.includeMatches,
1219
+ minMatchCharLength = Config.minMatchCharLength,
1220
+ ignoreLocation = Config.ignoreLocation,
1221
+ findAllMatches = Config.findAllMatches,
1222
+ location = Config.location,
1223
+ threshold = Config.threshold,
1224
+ distance = Config.distance
1225
+ } = {}
1226
+ ) {
1227
+ this.query = null;
1228
+ this.options = {
1229
+ isCaseSensitive,
1230
+ includeMatches,
1231
+ minMatchCharLength,
1232
+ findAllMatches,
1233
+ ignoreLocation,
1234
+ location,
1235
+ threshold,
1236
+ distance
1237
+ };
1238
+
1239
+ this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();
1240
+ this.query = parseQuery(this.pattern, this.options);
1241
+ }
1242
+
1243
+ static condition(_, options) {
1244
+ return options.useExtendedSearch
1245
+ }
1246
+
1247
+ searchIn(text) {
1248
+ const query = this.query;
1249
+
1250
+ if (!query) {
1251
+ return {
1252
+ isMatch: false,
1253
+ score: 1
1254
+ }
1255
+ }
1256
+
1257
+ const { includeMatches, isCaseSensitive } = this.options;
1258
+
1259
+ text = isCaseSensitive ? text : text.toLowerCase();
1260
+
1261
+ let numMatches = 0;
1262
+ let allIndices = [];
1263
+ let totalScore = 0;
1264
+
1265
+ // ORs
1266
+ for (let i = 0, qLen = query.length; i < qLen; i += 1) {
1267
+ const searchers = query[i];
1268
+
1269
+ // Reset indices
1270
+ allIndices.length = 0;
1271
+ numMatches = 0;
1272
+
1273
+ // ANDs
1274
+ for (let j = 0, pLen = searchers.length; j < pLen; j += 1) {
1275
+ const searcher = searchers[j];
1276
+ const { isMatch, indices, score } = searcher.search(text);
1277
+
1278
+ if (isMatch) {
1279
+ numMatches += 1;
1280
+ totalScore += score;
1281
+ if (includeMatches) {
1282
+ const type = searcher.constructor.type;
1283
+ if (MultiMatchSet.has(type)) {
1284
+ allIndices = [...allIndices, ...indices];
1285
+ } else {
1286
+ allIndices.push(indices);
1287
+ }
1288
+ }
1289
+ } else {
1290
+ totalScore = 0;
1291
+ numMatches = 0;
1292
+ allIndices.length = 0;
1293
+ break
1294
+ }
1295
+ }
1296
+
1297
+ // OR condition, so if TRUE, return
1298
+ if (numMatches) {
1299
+ let result = {
1300
+ isMatch: true,
1301
+ score: totalScore / numMatches
1302
+ };
1303
+
1304
+ if (includeMatches) {
1305
+ result.indices = allIndices;
1306
+ }
1307
+
1308
+ return result
1309
+ }
1310
+ }
1311
+
1312
+ // Nothing was matched
1313
+ return {
1314
+ isMatch: false,
1315
+ score: 1
1316
+ }
1317
+ }
1318
+ }
1319
+
1320
+ const registeredSearchers = [];
1321
+
1322
+ function register(...args) {
1323
+ registeredSearchers.push(...args);
1324
+ }
1325
+
1326
+ function createSearcher(pattern, options) {
1327
+ for (let i = 0, len = registeredSearchers.length; i < len; i += 1) {
1328
+ let searcherClass = registeredSearchers[i];
1329
+ if (searcherClass.condition(pattern, options)) {
1330
+ return new searcherClass(pattern, options)
1331
+ }
1332
+ }
1333
+
1334
+ return new BitapSearch(pattern, options)
1335
+ }
1336
+
1337
+ const LogicalOperator = {
1338
+ AND: '$and',
1339
+ OR: '$or'
1340
+ };
1341
+
1342
+ const KeyType = {
1343
+ PATH: '$path',
1344
+ PATTERN: '$val'
1345
+ };
1346
+
1347
+ const isExpression = (query) =>
1348
+ !!(query[LogicalOperator.AND] || query[LogicalOperator.OR]);
1349
+
1350
+ const isPath = (query) => !!query[KeyType.PATH];
1351
+
1352
+ const isLeaf = (query) =>
1353
+ !isArray(query) && isObject(query) && !isExpression(query);
1354
+
1355
+ const convertToExplicit = (query) => ({
1356
+ [LogicalOperator.AND]: Object.keys(query).map((key) => ({
1357
+ [key]: query[key]
1358
+ }))
1359
+ });
1360
+
1361
+ // When `auto` is `true`, the parse function will infer and initialize and add
1362
+ // the appropriate `Searcher` instance
1363
+ function parse(query, options, { auto = true } = {}) {
1364
+ const next = (query) => {
1365
+ let keys = Object.keys(query);
1366
+
1367
+ const isQueryPath = isPath(query);
1368
+
1369
+ if (!isQueryPath && keys.length > 1 && !isExpression(query)) {
1370
+ return next(convertToExplicit(query))
1371
+ }
1372
+
1373
+ if (isLeaf(query)) {
1374
+ const key = isQueryPath ? query[KeyType.PATH] : keys[0];
1375
+
1376
+ const pattern = isQueryPath ? query[KeyType.PATTERN] : query[key];
1377
+
1378
+ if (!isString(pattern)) {
1379
+ throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key))
1380
+ }
1381
+
1382
+ const obj = {
1383
+ keyId: createKeyId(key),
1384
+ pattern
1385
+ };
1386
+
1387
+ if (auto) {
1388
+ obj.searcher = createSearcher(pattern, options);
1389
+ }
1390
+
1391
+ return obj
1392
+ }
1393
+
1394
+ let node = {
1395
+ children: [],
1396
+ operator: keys[0]
1397
+ };
1398
+
1399
+ keys.forEach((key) => {
1400
+ const value = query[key];
1401
+
1402
+ if (isArray(value)) {
1403
+ value.forEach((item) => {
1404
+ node.children.push(next(item));
1405
+ });
1406
+ }
1407
+ });
1408
+
1409
+ return node
1410
+ };
1411
+
1412
+ if (!isExpression(query)) {
1413
+ query = convertToExplicit(query);
1414
+ }
1415
+
1416
+ return next(query)
1417
+ }
1418
+
1419
+ // Practical scoring function
1420
+ function computeScore(
1421
+ results,
1422
+ { ignoreFieldNorm = Config.ignoreFieldNorm }
1423
+ ) {
1424
+ results.forEach((result) => {
1425
+ let totalScore = 1;
1426
+
1427
+ result.matches.forEach(({ key, norm, score }) => {
1428
+ const weight = key ? key.weight : null;
1429
+
1430
+ totalScore *= Math.pow(
1431
+ score === 0 && weight ? Number.EPSILON : score,
1432
+ (weight || 1) * (ignoreFieldNorm ? 1 : norm)
1433
+ );
1434
+ });
1435
+
1436
+ result.score = totalScore;
1437
+ });
1438
+ }
1439
+
1440
+ function transformMatches(result, data) {
1441
+ const matches = result.matches;
1442
+ data.matches = [];
1443
+
1444
+ if (!isDefined(matches)) {
1445
+ return
1446
+ }
1447
+
1448
+ matches.forEach((match) => {
1449
+ if (!isDefined(match.indices) || !match.indices.length) {
1450
+ return
1451
+ }
1452
+
1453
+ const { indices, value } = match;
1454
+
1455
+ let obj = {
1456
+ indices,
1457
+ value
1458
+ };
1459
+
1460
+ if (match.key) {
1461
+ obj.key = match.key.src;
1462
+ }
1463
+
1464
+ if (match.idx > -1) {
1465
+ obj.refIndex = match.idx;
1466
+ }
1467
+
1468
+ data.matches.push(obj);
1469
+ });
1470
+ }
1471
+
1472
+ function transformScore(result, data) {
1473
+ data.score = result.score;
1474
+ }
1475
+
1476
+ function format(
1477
+ results,
1478
+ docs,
1479
+ {
1480
+ includeMatches = Config.includeMatches,
1481
+ includeScore = Config.includeScore
1482
+ } = {}
1483
+ ) {
1484
+ const transformers = [];
1485
+
1486
+ if (includeMatches) transformers.push(transformMatches);
1487
+ if (includeScore) transformers.push(transformScore);
1488
+
1489
+ return results.map((result) => {
1490
+ const { idx } = result;
1491
+
1492
+ const data = {
1493
+ item: docs[idx],
1494
+ refIndex: idx
1495
+ };
1496
+
1497
+ if (transformers.length) {
1498
+ transformers.forEach((transformer) => {
1499
+ transformer(result, data);
1500
+ });
1501
+ }
1502
+
1503
+ return data
1504
+ })
1505
+ }
1506
+
1507
+ class Fuse {
1508
+ constructor(docs, options = {}, index) {
1509
+ this.options = { ...Config, ...options };
1510
+
1511
+ if (
1512
+ this.options.useExtendedSearch &&
1513
+ !true
1514
+ ) {
1515
+ throw new Error(EXTENDED_SEARCH_UNAVAILABLE)
1516
+ }
1517
+
1518
+ this._keyStore = new KeyStore(this.options.keys);
1519
+
1520
+ this.setCollection(docs, index);
1521
+ }
1522
+
1523
+ setCollection(docs, index) {
1524
+ this._docs = docs;
1525
+
1526
+ if (index && !(index instanceof FuseIndex)) {
1527
+ throw new Error(INCORRECT_INDEX_TYPE)
1528
+ }
1529
+
1530
+ this._myIndex =
1531
+ index ||
1532
+ createIndex(this.options.keys, this._docs, {
1533
+ getFn: this.options.getFn,
1534
+ fieldNormWeight: this.options.fieldNormWeight
1535
+ });
1536
+ }
1537
+
1538
+ add(doc) {
1539
+ if (!isDefined(doc)) {
1540
+ return
1541
+ }
1542
+
1543
+ this._docs.push(doc);
1544
+ this._myIndex.add(doc);
1545
+ }
1546
+
1547
+ remove(predicate = (/* doc, idx */) => false) {
1548
+ const results = [];
1549
+
1550
+ for (let i = 0, len = this._docs.length; i < len; i += 1) {
1551
+ const doc = this._docs[i];
1552
+ if (predicate(doc, i)) {
1553
+ this.removeAt(i);
1554
+ i -= 1;
1555
+ len -= 1;
1556
+
1557
+ results.push(doc);
1558
+ }
1559
+ }
1560
+
1561
+ return results
1562
+ }
1563
+
1564
+ removeAt(idx) {
1565
+ this._docs.splice(idx, 1);
1566
+ this._myIndex.removeAt(idx);
1567
+ }
1568
+
1569
+ getIndex() {
1570
+ return this._myIndex
1571
+ }
1572
+
1573
+ search(query, { limit = -1 } = {}) {
1574
+ const {
1575
+ includeMatches,
1576
+ includeScore,
1577
+ shouldSort,
1578
+ sortFn,
1579
+ ignoreFieldNorm
1580
+ } = this.options;
1581
+
1582
+ let results = isString(query)
1583
+ ? isString(this._docs[0])
1584
+ ? this._searchStringList(query)
1585
+ : this._searchObjectList(query)
1586
+ : this._searchLogical(query);
1587
+
1588
+ computeScore(results, { ignoreFieldNorm });
1589
+
1590
+ if (shouldSort) {
1591
+ results.sort(sortFn);
1592
+ }
1593
+
1594
+ if (isNumber(limit) && limit > -1) {
1595
+ results = results.slice(0, limit);
1596
+ }
1597
+
1598
+ return format(results, this._docs, {
1599
+ includeMatches,
1600
+ includeScore
1601
+ })
1602
+ }
1603
+
1604
+ _searchStringList(query) {
1605
+ const searcher = createSearcher(query, this.options);
1606
+ const { records } = this._myIndex;
1607
+ const results = [];
1608
+
1609
+ // Iterate over every string in the index
1610
+ records.forEach(({ v: text, i: idx, n: norm }) => {
1611
+ if (!isDefined(text)) {
1612
+ return
1613
+ }
1614
+
1615
+ const { isMatch, score, indices } = searcher.searchIn(text);
1616
+
1617
+ if (isMatch) {
1618
+ results.push({
1619
+ item: text,
1620
+ idx,
1621
+ matches: [{ score, value: text, norm, indices }]
1622
+ });
1623
+ }
1624
+ });
1625
+
1626
+ return results
1627
+ }
1628
+
1629
+ _searchLogical(query) {
1630
+
1631
+ const expression = parse(query, this.options);
1632
+
1633
+ const evaluate = (node, item, idx) => {
1634
+ if (!node.children) {
1635
+ const { keyId, searcher } = node;
1636
+
1637
+ const matches = this._findMatches({
1638
+ key: this._keyStore.get(keyId),
1639
+ value: this._myIndex.getValueForItemAtKeyId(item, keyId),
1640
+ searcher
1641
+ });
1642
+
1643
+ if (matches && matches.length) {
1644
+ return [
1645
+ {
1646
+ idx,
1647
+ item,
1648
+ matches
1649
+ }
1650
+ ]
1651
+ }
1652
+
1653
+ return []
1654
+ }
1655
+
1656
+ const res = [];
1657
+ for (let i = 0, len = node.children.length; i < len; i += 1) {
1658
+ const child = node.children[i];
1659
+ const result = evaluate(child, item, idx);
1660
+ if (result.length) {
1661
+ res.push(...result);
1662
+ } else if (node.operator === LogicalOperator.AND) {
1663
+ return []
1664
+ }
1665
+ }
1666
+ return res
1667
+ };
1668
+
1669
+ const records = this._myIndex.records;
1670
+ const resultMap = {};
1671
+ const results = [];
1672
+
1673
+ records.forEach(({ $: item, i: idx }) => {
1674
+ if (isDefined(item)) {
1675
+ let expResults = evaluate(expression, item, idx);
1676
+
1677
+ if (expResults.length) {
1678
+ // Dedupe when adding
1679
+ if (!resultMap[idx]) {
1680
+ resultMap[idx] = { idx, item, matches: [] };
1681
+ results.push(resultMap[idx]);
1682
+ }
1683
+ expResults.forEach(({ matches }) => {
1684
+ resultMap[idx].matches.push(...matches);
1685
+ });
1686
+ }
1687
+ }
1688
+ });
1689
+
1690
+ return results
1691
+ }
1692
+
1693
+ _searchObjectList(query) {
1694
+ const searcher = createSearcher(query, this.options);
1695
+ const { keys, records } = this._myIndex;
1696
+ const results = [];
1697
+
1698
+ // List is Array<Object>
1699
+ records.forEach(({ $: item, i: idx }) => {
1700
+ if (!isDefined(item)) {
1701
+ return
1702
+ }
1703
+
1704
+ let matches = [];
1705
+
1706
+ // Iterate over every key (i.e, path), and fetch the value at that key
1707
+ keys.forEach((key, keyIndex) => {
1708
+ matches.push(
1709
+ ...this._findMatches({
1710
+ key,
1711
+ value: item[keyIndex],
1712
+ searcher
1713
+ })
1714
+ );
1715
+ });
1716
+
1717
+ if (matches.length) {
1718
+ results.push({
1719
+ idx,
1720
+ item,
1721
+ matches
1722
+ });
1723
+ }
1724
+ });
1725
+
1726
+ return results
1727
+ }
1728
+ _findMatches({ key, value, searcher }) {
1729
+ if (!isDefined(value)) {
1730
+ return []
1731
+ }
1732
+
1733
+ let matches = [];
1734
+
1735
+ if (isArray(value)) {
1736
+ value.forEach(({ v: text, i: idx, n: norm }) => {
1737
+ if (!isDefined(text)) {
1738
+ return
1739
+ }
1740
+
1741
+ const { isMatch, score, indices } = searcher.searchIn(text);
1742
+
1743
+ if (isMatch) {
1744
+ matches.push({
1745
+ score,
1746
+ key,
1747
+ value: text,
1748
+ idx,
1749
+ norm,
1750
+ indices
1751
+ });
1752
+ }
1753
+ });
1754
+ } else {
1755
+ const { v: text, n: norm } = value;
1756
+
1757
+ const { isMatch, score, indices } = searcher.searchIn(text);
1758
+
1759
+ if (isMatch) {
1760
+ matches.push({ score, key, value: text, norm, indices });
1761
+ }
1762
+ }
1763
+
1764
+ return matches
1765
+ }
1766
+ }
1767
+
1768
+ Fuse.version = '6.5.3';
1769
+ Fuse.createIndex = createIndex;
1770
+ Fuse.parseIndex = parseIndex;
1771
+ Fuse.config = Config;
1772
+
1773
+ {
1774
+ Fuse.parseQuery = parse;
1775
+ }
1776
+
1777
+ {
1778
+ register(ExtendedSearch);
1779
+ }
2
1780
 
3
1781
  const selectFilterCss = ".sc-road-select-filter-h{position:relative;display:block}.select-filter-list.sc-road-select-filter{position:absolute;top:3rem;z-index:1;width:100%;max-height:16rem;padding:0.5rem 0;margin:0;overflow-y:scroll;font-family:var(--font, sans-serif);font-size:0.875rem;color:var(--text);list-style-type:none;background:var(--white);border-radius:0 0 0.25rem 0.25rem;-webkit-box-shadow:0 3px 6px rgba(0, 0, 0, 0.16);box-shadow:0 3px 6px rgba(0, 0, 0, 0.16)}.select-filter-item.sc-road-select-filter{padding:0.75rem 1rem;cursor:pointer}.select-filter-item.sc-road-select-filter:hover,.select-filter-item.highlight.sc-road-select-filter{color:var(--secondary-contrast);background:var(--secondary)}";
4
1782
 
5
1783
  let SelectFilter = class {
6
1784
  constructor(hostRef) {
7
1785
  registerInstance(this, hostRef);
1786
+ this.roadselected = createEvent(this, "roadselected", 7);
8
1787
  this.roadSelected = createEvent(this, "roadSelected", 7);
9
1788
  this.isOpen = false;
10
1789
  this.currentValue = '';
@@ -12,6 +1791,15 @@ let SelectFilter = class {
12
1791
  * List of options of the select
13
1792
  */
14
1793
  this.options = [];
1794
+ /**
1795
+ * Options to pass to the fuse.js instance.
1796
+ * See https://fusejs.io/api/options.html for valid options
1797
+ */
1798
+ this.parameters = {
1799
+ keys: ["value", "label"],
1800
+ threshold: 0.3,
1801
+ ignoreLocation: true,
1802
+ };
15
1803
  /**
16
1804
  * If `false`, the user can submit custom value
17
1805
  */
@@ -19,6 +1807,10 @@ let SelectFilter = class {
19
1807
  this.onClick = (value, label) => {
20
1808
  this.el.querySelector('road-input').value = label;
21
1809
  this.isOpen = false;
1810
+ this.roadselected.emit({
1811
+ value: value.toString(),
1812
+ label: label,
1813
+ });
22
1814
  this.roadSelected.emit({
23
1815
  value: value.toString(),
24
1816
  label: label,
@@ -34,14 +1826,17 @@ let SelectFilter = class {
34
1826
  onClickOutside(event) {
35
1827
  if (this.isOpen && !this.el.contains(event.target)) {
36
1828
  this.isOpen = false;
37
- if (this.onlySelect) {
1829
+ const value = this.el.querySelector('road-input').value;
1830
+ if (this.onlySelect && !this.options.some(option => option['label'] === value)) {
38
1831
  this.el.querySelector('road-input').value = '';
39
1832
  }
40
1833
  }
41
1834
  }
42
1835
  render() {
1836
+ const fuseSearch = new Fuse(this.options, this.parameters);
1837
+ const options = this.currentValue === '' ? this.options.map((doc, idx) => ({ item: doc, score: 1, refIndex: idx })) : fuseSearch.search(this.currentValue);
43
1838
  return (h(Host, null, h("slot", null), this.isOpen &&
44
- h("ul", { class: "select-filter-list", role: "listbox" }, this.options && this.options.filter(element => element.label.replace(/(<([^>]+)>)/gi, "").toLowerCase().indexOf(this.currentValue) > -1).map(option => (h("li", { class: "select-filter-item", role: "option", onClick: () => this.onClick(option.value, option.label.replace(/(<([^>]+)>)/gi, "")), innerHTML: option.label }))))));
1839
+ h("ul", { class: "select-filter-list", role: "listbox" }, options.map(option => (h("li", { class: "select-filter-item", role: "option", onClick: () => this.onClick(option.item.value, option.item.label.replace(/(<([^>]+)>)/gi, "")), innerHTML: option.item.label }))))));
45
1840
  }
46
1841
  get el() { return getElement(this); }
47
1842
  };