@internetarchive/collection-browser 4.7.1-alpha-webdev9189.0 → 4.8.1-webdev-9227.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (396) hide show
  1. package/README.md +33 -0
  2. package/dist/src/app-root.js +0 -2
  3. package/dist/src/app-root.js.map +1 -1
  4. package/dist/src/assets/img/icons/check.d.ts +2 -0
  5. package/dist/src/assets/img/icons/check.js +5 -0
  6. package/dist/src/assets/img/icons/check.js.map +1 -0
  7. package/dist/src/collection-browser.d.ts +2 -1
  8. package/dist/src/collection-browser.js +5 -27
  9. package/dist/src/collection-browser.js.map +1 -1
  10. package/dist/src/collection-facets/facet-row-template.d.ts +38 -0
  11. package/dist/src/collection-facets/facet-row-template.js +200 -0
  12. package/dist/src/collection-facets/facet-row-template.js.map +1 -0
  13. package/dist/src/collection-facets/facet-row.js +11 -186
  14. package/dist/src/collection-facets/facet-row.js.map +1 -1
  15. package/dist/src/collection-facets/models.d.ts +7 -2
  16. package/dist/src/collection-facets/models.js +7 -2
  17. package/dist/src/collection-facets/models.js.map +1 -1
  18. package/dist/src/collection-facets/more-facets-content.d.ts +87 -21
  19. package/dist/src/collection-facets/more-facets-content.js +479 -201
  20. package/dist/src/collection-facets/more-facets-content.js.map +1 -1
  21. package/dist/src/collection-facets/more-facets-scroller.d.ts +85 -0
  22. package/dist/src/collection-facets/more-facets-scroller.js +429 -0
  23. package/dist/src/collection-facets/more-facets-scroller.js.map +1 -0
  24. package/dist/src/collection-facets/page-window.d.ts +73 -0
  25. package/dist/src/collection-facets/page-window.js +202 -0
  26. package/dist/src/collection-facets/page-window.js.map +1 -0
  27. package/dist/src/collection-facets/toggle-switch.js +1 -0
  28. package/dist/src/collection-facets/toggle-switch.js.map +1 -1
  29. package/dist/src/collection-facets.js +3 -2
  30. package/dist/src/collection-facets.js.map +1 -1
  31. package/dist/src/empty-placeholder.d.ts +7 -7
  32. package/dist/src/empty-placeholder.js +29 -15
  33. package/dist/src/empty-placeholder.js.map +1 -1
  34. package/dist/src/expanded-date-picker.js +3 -2
  35. package/dist/src/expanded-date-picker.js.map +1 -1
  36. package/dist/src/locales/es.d.ts +94 -0
  37. package/dist/src/locales/es.js +109 -0
  38. package/dist/src/locales/es.js.map +1 -0
  39. package/dist/src/manage/manage-bar.d.ts +3 -2
  40. package/dist/src/manage/manage-bar.js +6 -7
  41. package/dist/src/manage/manage-bar.js.map +1 -1
  42. package/dist/src/manage/remove-items-modal-content.js +3 -2
  43. package/dist/src/manage/remove-items-modal-content.js.map +1 -1
  44. package/dist/src/models.d.ts +4 -0
  45. package/dist/src/models.js +22 -2
  46. package/dist/src/models.js.map +1 -1
  47. package/dist/src/sort-filter-bar/sort-filter-bar.js +3 -3
  48. package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
  49. package/dist/src/tiles/grid/account-tile.js +3 -2
  50. package/dist/src/tiles/grid/account-tile.js.map +1 -1
  51. package/dist/src/tiles/grid/collection-tile.js +3 -2
  52. package/dist/src/tiles/grid/collection-tile.js.map +1 -1
  53. package/dist/src/tiles/grid/item-tile.js +3 -2
  54. package/dist/src/tiles/grid/item-tile.js.map +1 -1
  55. package/dist/src/tiles/grid/tile-stats.js +3 -2
  56. package/dist/src/tiles/grid/tile-stats.js.map +1 -1
  57. package/dist/src/tiles/list/tile-list-compact-header.js +3 -2
  58. package/dist/src/tiles/list/tile-list-compact-header.js.map +1 -1
  59. package/dist/src/tiles/list/tile-list-compact.js +3 -1
  60. package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
  61. package/dist/src/tiles/list/tile-list.js +3 -2
  62. package/dist/src/tiles/list/tile-list.js.map +1 -1
  63. package/dist/src/tiles/overlay/text-overlay.js +3 -1
  64. package/dist/src/tiles/overlay/text-overlay.js.map +1 -1
  65. package/dist/src/tiles/review-block.js +3 -2
  66. package/dist/src/tiles/review-block.js.map +1 -1
  67. package/dist/src/tiles/tile-dispatcher.d.ts +2 -1
  68. package/dist/src/tiles/tile-dispatcher.js +5 -4
  69. package/dist/src/tiles/tile-dispatcher.js.map +1 -1
  70. package/dist/src/utils/log.d.ts +1 -4
  71. package/dist/src/utils/normalize-filter-text.d.ts +28 -0
  72. package/dist/src/utils/normalize-filter-text.js +35 -0
  73. package/dist/src/utils/normalize-filter-text.js.map +1 -0
  74. package/locales/es.d.ts +1 -0
  75. package/locales/es.js +1 -0
  76. package/package.json +15 -1
  77. package/.editorconfig +0 -29
  78. package/.github/workflows/ci.yml +0 -29
  79. package/.github/workflows/gh-pages-main.yml +0 -41
  80. package/.github/workflows/npm-publish.yml +0 -42
  81. package/.github/workflows/pr-preview.yml +0 -40
  82. package/.husky/pre-commit +0 -1
  83. package/.prettierignore +0 -1
  84. package/dist/src/collection-facets/more-facets-pagination.d.ts +0 -36
  85. package/dist/src/collection-facets/more-facets-pagination.js +0 -260
  86. package/dist/src/collection-facets/more-facets-pagination.js.map +0 -1
  87. package/dist/test/collection-browser.test.d.ts +0 -1
  88. package/dist/test/collection-browser.test.js +0 -1849
  89. package/dist/test/collection-browser.test.js.map +0 -1
  90. package/dist/test/collection-facets/facet-row.test.d.ts +0 -1
  91. package/dist/test/collection-facets/facet-row.test.js +0 -291
  92. package/dist/test/collection-facets/facet-row.test.js.map +0 -1
  93. package/dist/test/collection-facets/facets-template.test.d.ts +0 -1
  94. package/dist/test/collection-facets/facets-template.test.js +0 -95
  95. package/dist/test/collection-facets/facets-template.test.js.map +0 -1
  96. package/dist/test/collection-facets/more-facets-content.test.d.ts +0 -1
  97. package/dist/test/collection-facets/more-facets-content.test.js +0 -159
  98. package/dist/test/collection-facets/more-facets-content.test.js.map +0 -1
  99. package/dist/test/collection-facets/more-facets-pagination.test.d.ts +0 -1
  100. package/dist/test/collection-facets/more-facets-pagination.test.js +0 -126
  101. package/dist/test/collection-facets/more-facets-pagination.test.js.map +0 -1
  102. package/dist/test/collection-facets/toggle-switch.test.d.ts +0 -1
  103. package/dist/test/collection-facets/toggle-switch.test.js +0 -99
  104. package/dist/test/collection-facets/toggle-switch.test.js.map +0 -1
  105. package/dist/test/collection-facets.test.d.ts +0 -2
  106. package/dist/test/collection-facets.test.js +0 -728
  107. package/dist/test/collection-facets.test.js.map +0 -1
  108. package/dist/test/data-source/collection-browser-data-source.test.d.ts +0 -1
  109. package/dist/test/data-source/collection-browser-data-source.test.js +0 -154
  110. package/dist/test/data-source/collection-browser-data-source.test.js.map +0 -1
  111. package/dist/test/empty-placeholder.test.d.ts +0 -1
  112. package/dist/test/empty-placeholder.test.js +0 -57
  113. package/dist/test/empty-placeholder.test.js.map +0 -1
  114. package/dist/test/expanded-date-picker.test.d.ts +0 -1
  115. package/dist/test/expanded-date-picker.test.js +0 -124
  116. package/dist/test/expanded-date-picker.test.js.map +0 -1
  117. package/dist/test/icon-overlay.test.d.ts +0 -1
  118. package/dist/test/icon-overlay.test.js +0 -31
  119. package/dist/test/icon-overlay.test.js.map +0 -1
  120. package/dist/test/image-block.test.d.ts +0 -1
  121. package/dist/test/image-block.test.js +0 -208
  122. package/dist/test/image-block.test.js.map +0 -1
  123. package/dist/test/item-image.test.d.ts +0 -1
  124. package/dist/test/item-image.test.js +0 -187
  125. package/dist/test/item-image.test.js.map +0 -1
  126. package/dist/test/manage/manage-bar.test.d.ts +0 -3
  127. package/dist/test/manage/manage-bar.test.js +0 -216
  128. package/dist/test/manage/manage-bar.test.js.map +0 -1
  129. package/dist/test/manage/remove-items-modal-content.test.d.ts +0 -1
  130. package/dist/test/manage/remove-items-modal-content.test.js +0 -60
  131. package/dist/test/manage/remove-items-modal-content.test.js.map +0 -1
  132. package/dist/test/mediatype-config.test.d.ts +0 -1
  133. package/dist/test/mediatype-config.test.js +0 -11
  134. package/dist/test/mediatype-config.test.js.map +0 -1
  135. package/dist/test/mocks/mock-analytics-handler.d.ts +0 -10
  136. package/dist/test/mocks/mock-analytics-handler.js +0 -16
  137. package/dist/test/mocks/mock-analytics-handler.js.map +0 -1
  138. package/dist/test/mocks/mock-search-responses.d.ts +0 -31
  139. package/dist/test/mocks/mock-search-responses.js +0 -1241
  140. package/dist/test/mocks/mock-search-responses.js.map +0 -1
  141. package/dist/test/mocks/mock-search-service.d.ts +0 -16
  142. package/dist/test/mocks/mock-search-service.js +0 -64
  143. package/dist/test/mocks/mock-search-service.js.map +0 -1
  144. package/dist/test/restoration-state-handler.test.d.ts +0 -1
  145. package/dist/test/restoration-state-handler.test.js +0 -335
  146. package/dist/test/restoration-state-handler.test.js.map +0 -1
  147. package/dist/test/review-block.test.d.ts +0 -1
  148. package/dist/test/review-block.test.js +0 -46
  149. package/dist/test/review-block.test.js.map +0 -1
  150. package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.d.ts +0 -1
  151. package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js +0 -12
  152. package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js.map +0 -1
  153. package/dist/test/sort-filter-bar/alpha-bar.test.d.ts +0 -1
  154. package/dist/test/sort-filter-bar/alpha-bar.test.js +0 -68
  155. package/dist/test/sort-filter-bar/alpha-bar.test.js.map +0 -1
  156. package/dist/test/sort-filter-bar/sort-filter-bar.test.d.ts +0 -1
  157. package/dist/test/sort-filter-bar/sort-filter-bar.test.js +0 -326
  158. package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +0 -1
  159. package/dist/test/text-overlay.test.d.ts +0 -1
  160. package/dist/test/text-overlay.test.js +0 -43
  161. package/dist/test/text-overlay.test.js.map +0 -1
  162. package/dist/test/text-snippet-block.test.d.ts +0 -1
  163. package/dist/test/text-snippet-block.test.js +0 -58
  164. package/dist/test/text-snippet-block.test.js.map +0 -1
  165. package/dist/test/tile-stats.test.d.ts +0 -1
  166. package/dist/test/tile-stats.test.js +0 -167
  167. package/dist/test/tile-stats.test.js.map +0 -1
  168. package/dist/test/tiles/grid/account-tile.test.d.ts +0 -1
  169. package/dist/test/tiles/grid/account-tile.test.js +0 -96
  170. package/dist/test/tiles/grid/account-tile.test.js.map +0 -1
  171. package/dist/test/tiles/grid/collection-tile.test.d.ts +0 -1
  172. package/dist/test/tiles/grid/collection-tile.test.js +0 -90
  173. package/dist/test/tiles/grid/collection-tile.test.js.map +0 -1
  174. package/dist/test/tiles/grid/item-tile.test.d.ts +0 -1
  175. package/dist/test/tiles/grid/item-tile.test.js +0 -400
  176. package/dist/test/tiles/grid/item-tile.test.js.map +0 -1
  177. package/dist/test/tiles/grid/search-tile.test.d.ts +0 -1
  178. package/dist/test/tiles/grid/search-tile.test.js +0 -62
  179. package/dist/test/tiles/grid/search-tile.test.js.map +0 -1
  180. package/dist/test/tiles/hover/hover-pane-controller.test.d.ts +0 -1
  181. package/dist/test/tiles/hover/hover-pane-controller.test.js +0 -351
  182. package/dist/test/tiles/hover/hover-pane-controller.test.js.map +0 -1
  183. package/dist/test/tiles/hover/tile-hover-pane.test.d.ts +0 -1
  184. package/dist/test/tiles/hover/tile-hover-pane.test.js +0 -53
  185. package/dist/test/tiles/hover/tile-hover-pane.test.js.map +0 -1
  186. package/dist/test/tiles/list/tile-list-compact-header.test.d.ts +0 -1
  187. package/dist/test/tiles/list/tile-list-compact-header.test.js +0 -36
  188. package/dist/test/tiles/list/tile-list-compact-header.test.js.map +0 -1
  189. package/dist/test/tiles/list/tile-list-compact.test.d.ts +0 -1
  190. package/dist/test/tiles/list/tile-list-compact.test.js +0 -237
  191. package/dist/test/tiles/list/tile-list-compact.test.js.map +0 -1
  192. package/dist/test/tiles/list/tile-list.test.d.ts +0 -1
  193. package/dist/test/tiles/list/tile-list.test.js +0 -460
  194. package/dist/test/tiles/list/tile-list.test.js.map +0 -1
  195. package/dist/test/tiles/tile-dispatcher.test.d.ts +0 -1
  196. package/dist/test/tiles/tile-dispatcher.test.js +0 -246
  197. package/dist/test/tiles/tile-dispatcher.test.js.map +0 -1
  198. package/dist/test/tiles/tile-display-value-provider.test.d.ts +0 -1
  199. package/dist/test/tiles/tile-display-value-provider.test.js +0 -142
  200. package/dist/test/tiles/tile-display-value-provider.test.js.map +0 -1
  201. package/dist/test/tiles/tile-mediatype-icon.test.d.ts +0 -1
  202. package/dist/test/tiles/tile-mediatype-icon.test.js +0 -133
  203. package/dist/test/tiles/tile-mediatype-icon.test.js.map +0 -1
  204. package/dist/test/utils/array-equals.test.d.ts +0 -1
  205. package/dist/test/utils/array-equals.test.js +0 -27
  206. package/dist/test/utils/array-equals.test.js.map +0 -1
  207. package/dist/test/utils/format-count.test.d.ts +0 -1
  208. package/dist/test/utils/format-count.test.js +0 -24
  209. package/dist/test/utils/format-count.test.js.map +0 -1
  210. package/dist/test/utils/format-date.test.d.ts +0 -1
  211. package/dist/test/utils/format-date.test.js +0 -61
  212. package/dist/test/utils/format-date.test.js.map +0 -1
  213. package/dist/test/utils/format-unit-size.test.d.ts +0 -1
  214. package/dist/test/utils/format-unit-size.test.js +0 -18
  215. package/dist/test/utils/format-unit-size.test.js.map +0 -1
  216. package/dist/test/utils/local-date-from-utc.test.d.ts +0 -1
  217. package/dist/test/utils/local-date-from-utc.test.js +0 -27
  218. package/dist/test/utils/local-date-from-utc.test.js.map +0 -1
  219. package/eslint.config.mjs +0 -53
  220. package/index.html +0 -24
  221. package/index.ts +0 -29
  222. package/local.archive.org.cert +0 -86
  223. package/local.archive.org.key +0 -27
  224. package/pnpm-workspace.yaml +0 -30
  225. package/renovate.json +0 -6
  226. package/src/app-root.ts +0 -1284
  227. package/src/assets/img/icons/arrow-left.ts +0 -10
  228. package/src/assets/img/icons/arrow-right.ts +0 -10
  229. package/src/assets/img/icons/chevron.ts +0 -4
  230. package/src/assets/img/icons/close-circle-dark.ts +0 -5
  231. package/src/assets/img/icons/contract.ts +0 -9
  232. package/src/assets/img/icons/empty-query.ts +0 -5
  233. package/src/assets/img/icons/expand.ts +0 -9
  234. package/src/assets/img/icons/eye-closed.ts +0 -5
  235. package/src/assets/img/icons/eye.ts +0 -5
  236. package/src/assets/img/icons/favorite-filled.ts +0 -10
  237. package/src/assets/img/icons/favorite-unfilled.ts +0 -9
  238. package/src/assets/img/icons/filter.ts +0 -10
  239. package/src/assets/img/icons/login-required.ts +0 -18
  240. package/src/assets/img/icons/mediatype/account.ts +0 -14
  241. package/src/assets/img/icons/mediatype/audio.ts +0 -14
  242. package/src/assets/img/icons/mediatype/collection.ts +0 -12
  243. package/src/assets/img/icons/mediatype/data.ts +0 -15
  244. package/src/assets/img/icons/mediatype/etree.ts +0 -14
  245. package/src/assets/img/icons/mediatype/film.ts +0 -14
  246. package/src/assets/img/icons/mediatype/images.ts +0 -13
  247. package/src/assets/img/icons/mediatype/radio.ts +0 -15
  248. package/src/assets/img/icons/mediatype/search.ts +0 -14
  249. package/src/assets/img/icons/mediatype/software.ts +0 -13
  250. package/src/assets/img/icons/mediatype/texts.ts +0 -13
  251. package/src/assets/img/icons/mediatype/tv-commercial.ts +0 -12
  252. package/src/assets/img/icons/mediatype/tv-fact-check.ts +0 -12
  253. package/src/assets/img/icons/mediatype/tv-quote.ts +0 -12
  254. package/src/assets/img/icons/mediatype/tv.ts +0 -14
  255. package/src/assets/img/icons/mediatype/video.ts +0 -14
  256. package/src/assets/img/icons/mediatype/web.ts +0 -13
  257. package/src/assets/img/icons/null-result.ts +0 -5
  258. package/src/assets/img/icons/quote.ts +0 -7
  259. package/src/assets/img/icons/restricted.ts +0 -13
  260. package/src/assets/img/icons/reviews.ts +0 -11
  261. package/src/assets/img/icons/upload.ts +0 -12
  262. package/src/assets/img/icons/views.ts +0 -11
  263. package/src/circular-activity-indicator.ts +0 -64
  264. package/src/collection-browser.ts +0 -3187
  265. package/src/collection-facets/facet-row.ts +0 -309
  266. package/src/collection-facets/facet-tombstone-row.ts +0 -40
  267. package/src/collection-facets/facets-template.ts +0 -85
  268. package/src/collection-facets/models.ts +0 -10
  269. package/src/collection-facets/more-facets-content.ts +0 -644
  270. package/src/collection-facets/more-facets-pagination.ts +0 -294
  271. package/src/collection-facets/smart-facets/dedupe.ts +0 -44
  272. package/src/collection-facets/smart-facets/heuristics/browser-language/browser-language-heuristic.ts +0 -27
  273. package/src/collection-facets/smart-facets/heuristics/index.ts +0 -3
  274. package/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-heuristic.ts +0 -17
  275. package/src/collection-facets/smart-facets/heuristics/query-keywords/query-keywords-map.ts +0 -70
  276. package/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-entity-map.ts +0 -79
  277. package/src/collection-facets/smart-facets/heuristics/wikidata/wikidata-heuristic.ts +0 -93
  278. package/src/collection-facets/smart-facets/models.ts +0 -36
  279. package/src/collection-facets/smart-facets/smart-facet-bar.ts +0 -437
  280. package/src/collection-facets/smart-facets/smart-facet-button.ts +0 -145
  281. package/src/collection-facets/smart-facets/smart-facet-dropdown.ts +0 -185
  282. package/src/collection-facets/smart-facets/smart-facet-equals.ts +0 -16
  283. package/src/collection-facets/smart-facets/smart-facet-heuristics.ts +0 -26
  284. package/src/collection-facets/toggle-switch.ts +0 -174
  285. package/src/collection-facets.ts +0 -1013
  286. package/src/data-source/collection-browser-data-source-interface.ts +0 -351
  287. package/src/data-source/collection-browser-data-source.ts +0 -1474
  288. package/src/data-source/collection-browser-query-state.ts +0 -60
  289. package/src/data-source/models.ts +0 -56
  290. package/src/empty-placeholder.ts +0 -192
  291. package/src/expanded-date-picker.ts +0 -191
  292. package/src/language-code-handler/language-code-handler.ts +0 -64
  293. package/src/language-code-handler/language-code-mapping.ts +0 -564
  294. package/src/manage/manage-bar.ts +0 -276
  295. package/src/manage/remove-items-modal-content.ts +0 -102
  296. package/src/mediatype/mediatype-config.ts +0 -146
  297. package/src/models.ts +0 -895
  298. package/src/restoration-state-handler.ts +0 -550
  299. package/src/sort-filter-bar/alpha-bar-tooltip.ts +0 -53
  300. package/src/sort-filter-bar/alpha-bar.ts +0 -252
  301. package/src/sort-filter-bar/img/compact.ts +0 -5
  302. package/src/sort-filter-bar/img/list.ts +0 -5
  303. package/src/sort-filter-bar/img/sort-toggle-disabled.ts +0 -15
  304. package/src/sort-filter-bar/img/sort-toggle-down.ts +0 -17
  305. package/src/sort-filter-bar/img/sort-toggle-up.ts +0 -17
  306. package/src/sort-filter-bar/img/sort-triangle.ts +0 -5
  307. package/src/sort-filter-bar/img/tile.ts +0 -5
  308. package/src/sort-filter-bar/sort-filter-bar.ts +0 -734
  309. package/src/styles/ia-button.ts +0 -139
  310. package/src/styles/item-image-styles.ts +0 -124
  311. package/src/styles/sr-only.ts +0 -18
  312. package/src/styles/tile-action-styles.ts +0 -59
  313. package/src/tiles/base-tile-component.ts +0 -124
  314. package/src/tiles/collection-browser-loading-tile.ts +0 -26
  315. package/src/tiles/grid/account-tile.ts +0 -113
  316. package/src/tiles/grid/collection-tile.ts +0 -184
  317. package/src/tiles/grid/item-tile.ts +0 -347
  318. package/src/tiles/grid/search-tile.ts +0 -90
  319. package/src/tiles/grid/styles/tile-grid-shared-styles.ts +0 -130
  320. package/src/tiles/grid/tile-stats.ts +0 -211
  321. package/src/tiles/hover/hover-pane-controller.ts +0 -638
  322. package/src/tiles/hover/tile-hover-pane.ts +0 -184
  323. package/src/tiles/image-block.ts +0 -162
  324. package/src/tiles/item-image.ts +0 -214
  325. package/src/tiles/list/tile-list-compact-header.ts +0 -112
  326. package/src/tiles/list/tile-list-compact.ts +0 -278
  327. package/src/tiles/list/tile-list.ts +0 -718
  328. package/src/tiles/models.ts +0 -21
  329. package/src/tiles/overlay/icon-overlay.ts +0 -57
  330. package/src/tiles/overlay/text-overlay.ts +0 -79
  331. package/src/tiles/review-block.ts +0 -130
  332. package/src/tiles/text-snippet-block.ts +0 -132
  333. package/src/tiles/tile-dispatcher.ts +0 -637
  334. package/src/tiles/tile-display-value-provider.ts +0 -133
  335. package/src/tiles/tile-mediatype-icon.ts +0 -133
  336. package/src/utils/analytics-events.ts +0 -29
  337. package/src/utils/array-equals.ts +0 -8
  338. package/src/utils/collapse-repeated-quotes.ts +0 -13
  339. package/src/utils/date-filter-field.ts +0 -11
  340. package/src/utils/facet-utils.ts +0 -183
  341. package/src/utils/format-count.ts +0 -95
  342. package/src/utils/format-date.ts +0 -62
  343. package/src/utils/format-unit-size.ts +0 -43
  344. package/src/utils/local-date-from-utc.ts +0 -15
  345. package/src/utils/log.ts +0 -14
  346. package/src/utils/resolve-mediatype.ts +0 -26
  347. package/src/utils/sha1.ts +0 -9
  348. package/test/collection-browser.test.ts +0 -2694
  349. package/test/collection-facets/facet-row.test.ts +0 -421
  350. package/test/collection-facets/facets-template.test.ts +0 -139
  351. package/test/collection-facets/more-facets-content.test.ts +0 -231
  352. package/test/collection-facets/more-facets-pagination.test.ts +0 -201
  353. package/test/collection-facets/toggle-switch.test.ts +0 -164
  354. package/test/collection-facets.test.ts +0 -928
  355. package/test/data-source/collection-browser-data-source.test.ts +0 -193
  356. package/test/empty-placeholder.test.ts +0 -88
  357. package/test/expanded-date-picker.test.ts +0 -201
  358. package/test/icon-overlay.test.ts +0 -38
  359. package/test/image-block.test.ts +0 -247
  360. package/test/item-image.test.ts +0 -220
  361. package/test/manage/manage-bar.test.ts +0 -347
  362. package/test/manage/remove-items-modal-content.test.ts +0 -81
  363. package/test/mediatype-config.test.ts +0 -11
  364. package/test/mocks/mock-analytics-handler.ts +0 -30
  365. package/test/mocks/mock-search-responses.ts +0 -1364
  366. package/test/mocks/mock-search-service.ts +0 -134
  367. package/test/restoration-state-handler.test.ts +0 -480
  368. package/test/review-block.test.ts +0 -62
  369. package/test/sort-filter-bar/alpha-bar-tooltip.test.ts +0 -17
  370. package/test/sort-filter-bar/alpha-bar.test.ts +0 -101
  371. package/test/sort-filter-bar/sort-filter-bar.test.ts +0 -472
  372. package/test/text-overlay.test.ts +0 -55
  373. package/test/text-snippet-block.test.ts +0 -85
  374. package/test/tile-stats.test.ts +0 -191
  375. package/test/tiles/grid/account-tile.test.ts +0 -121
  376. package/test/tiles/grid/collection-tile.test.ts +0 -114
  377. package/test/tiles/grid/item-tile.test.ts +0 -520
  378. package/test/tiles/grid/search-tile.test.ts +0 -75
  379. package/test/tiles/hover/hover-pane-controller.test.ts +0 -482
  380. package/test/tiles/hover/tile-hover-pane.test.ts +0 -80
  381. package/test/tiles/list/tile-list-compact-header.test.ts +0 -43
  382. package/test/tiles/list/tile-list-compact.test.ts +0 -282
  383. package/test/tiles/list/tile-list.test.ts +0 -576
  384. package/test/tiles/tile-dispatcher.test.ts +0 -320
  385. package/test/tiles/tile-display-value-provider.test.ts +0 -172
  386. package/test/tiles/tile-mediatype-icon.test.ts +0 -160
  387. package/test/utils/array-equals.test.ts +0 -31
  388. package/test/utils/format-count.test.ts +0 -32
  389. package/test/utils/format-date.test.ts +0 -89
  390. package/test/utils/format-unit-size.test.ts +0 -21
  391. package/test/utils/local-date-from-utc.test.ts +0 -37
  392. package/tsconfig.json +0 -25
  393. package/types/dompurify.d.ts +0 -1
  394. package/vite.config.ts +0 -29
  395. package/web-dev-server.config.mjs +0 -30
  396. package/web-test-runner.config.mjs +0 -52
@@ -0,0 +1,38 @@
1
+ import { TemplateResult } from 'lit';
2
+ import type { FacetOption, FacetBucket, FacetState } from '../models';
3
+ import type { CollectionTitles } from '../data-source/models';
4
+ export type FacetRowTemplateOptions = {
5
+ /** The name of the facet group to which this facet belongs (e.g., "mediatype") */
6
+ facetType: FacetOption;
7
+ /** The facet bucket containing details about the state, count, and key for this row */
8
+ bucket: FacetBucket;
9
+ /** The collection name cache for converting collection identifiers to titles */
10
+ collectionTitles?: CollectionTitles;
11
+ /**
12
+ * Whether to omit the negative/hide button from this facet row if possible.
13
+ * Has no effect if the facet bucket is itself hidden, in which case the hide
14
+ * button *must* be shown to represent the state accurately.
15
+ */
16
+ omitHideButton?: boolean;
17
+ /**
18
+ * Called when either checkbox is clicked. Leave it out when an ancestor
19
+ * handles the rows' clicks by delegation instead.
20
+ */
21
+ onCheckboxClick?: (e: Event, negative: boolean) => void;
22
+ };
23
+ /**
24
+ * Returns the composed facet state corresponding to a positive or negative facet's checked state
25
+ */
26
+ export declare function getFacetState(checked: boolean, negative: boolean): FacetState;
27
+ /**
28
+ * Template for a full facet row, including the positive/negative checks,
29
+ * the display name, and the count. The row is plain DOM so that long lists
30
+ * (e.g. the More... dialog) can render many rows without creating an
31
+ * element per row. Render it inside a shadow root that includes
32
+ * `facetRowStyles`.
33
+ */
34
+ export declare function facetRowTemplate({ facetType, bucket, collectionTitles, omitHideButton, onCheckboxClick, }: FacetRowTemplateOptions): TemplateResult;
35
+ /**
36
+ * Styles for `facetRowTemplate`. Include `srOnlyStyle` alongside these.
37
+ */
38
+ export declare const facetRowStyles: import("lit").CSSResult;
@@ -0,0 +1,200 @@
1
+ import { css, html, nothing } from 'lit';
2
+ import eyeIcon from '../assets/img/icons/eye';
3
+ import eyeClosedIcon from '../assets/img/icons/eye-closed';
4
+ /**
5
+ * Returns the composed facet state corresponding to a positive or negative facet's checked state
6
+ */
7
+ export function getFacetState(checked, negative) {
8
+ if (!checked)
9
+ return 'none';
10
+ return negative ? 'hidden' : 'selected';
11
+ }
12
+ /**
13
+ * Template for a full facet row, including the positive/negative checks,
14
+ * the display name, and the count. The row is plain DOM so that long lists
15
+ * (e.g. the More... dialog) can render many rows without creating an
16
+ * element per row. Render it inside a shadow root that includes
17
+ * `facetRowStyles`.
18
+ */
19
+ export function facetRowTemplate({ facetType, bucket, collectionTitles, omitHideButton = false, onCheckboxClick, }) {
20
+ const showOnlyCheckboxId = `${facetType}:${bucket.key}-show-only`;
21
+ const negativeCheckboxId = `${facetType}:${bucket.key}-negative`;
22
+ const extraNoteSpan = bucket.extraNote
23
+ ? html `<span class="facet-note">${bucket.extraNote}</span>`
24
+ : nothing;
25
+ // For collections, we render the collection title as a link.
26
+ // For other facet types, we just have a static value to use.
27
+ const bucketTextDisplay = facetType !== 'collection'
28
+ ? html `${bucket.displayText ?? bucket.key} ${extraNoteSpan}`
29
+ : html `<a href="/details/${bucket.key}">
30
+ ${collectionTitles?.get(bucket.key) ?? bucket.key}
31
+ </a> `;
32
+ const bucketCountText = bucket.count > 0 ? bucket.count.toLocaleString() : '';
33
+ const facetHidden = bucket.state === 'hidden';
34
+ const facetSelected = bucket.state === 'selected';
35
+ const titleText = `${facetType}: ${bucket.displayText ?? bucket.key}`;
36
+ const onlyShowText = facetSelected
37
+ ? `Show all ${facetType}s`
38
+ : `Only show ${titleText}`;
39
+ const hideText = `Hide ${titleText}`;
40
+ const unhideText = `Unhide ${titleText}`;
41
+ const showHideText = facetHidden ? unhideText : hideText;
42
+ const ariaLabel = `${titleText}, ${bucket.count} results`;
43
+ const showOnlyClicked = onCheckboxClick
44
+ ? (e) => onCheckboxClick(e, false)
45
+ : undefined;
46
+ const hideClicked = onCheckboxClick
47
+ ? (e) => onCheckboxClick(e, true)
48
+ : undefined;
49
+ // Added data-testid for Playwright testing
50
+ return html `
51
+ <div class="facet-row-container">
52
+ <div class="facet-checkboxes">
53
+ <input
54
+ type="checkbox"
55
+ .name=${facetType}
56
+ .value=${bucket.key}
57
+ @click=${showOnlyClicked}
58
+ .checked=${facetSelected}
59
+ class="select-facet-checkbox"
60
+ title=${onlyShowText}
61
+ id=${showOnlyCheckboxId}
62
+ data-testid=${showOnlyCheckboxId}
63
+ />
64
+ <div
65
+ class="hide-facet-container"
66
+ ?hidden=${omitHideButton && !facetHidden}
67
+ >
68
+ <input
69
+ type="checkbox"
70
+ id=${negativeCheckboxId}
71
+ .name=${facetType}
72
+ .value=${bucket.key}
73
+ @click=${hideClicked}
74
+ .checked=${facetHidden}
75
+ class="hide-facet-checkbox"
76
+ />
77
+ <label
78
+ for=${negativeCheckboxId}
79
+ class="hide-facet-icon${facetHidden ? ' active' : ''}"
80
+ title=${showHideText}
81
+ data-testid=${negativeCheckboxId}
82
+ >
83
+ <span class="sr-only">${showHideText}</span>
84
+ <span class="eye eye-open">${eyeIcon}</span>
85
+ <span class="eye eye-closed">${eyeClosedIcon}</span>
86
+ </label>
87
+ </div>
88
+ </div>
89
+ <label
90
+ for=${showOnlyCheckboxId}
91
+ class="facet-info-display"
92
+ title=${onlyShowText}
93
+ aria-label=${ariaLabel}
94
+ >
95
+ <div class="facet-title">${bucketTextDisplay}</div>
96
+ <div class="facet-count">${bucketCountText}</div>
97
+ </label>
98
+ </div>
99
+ `;
100
+ }
101
+ const facetRowBorderTop = css `var(--facet-row-border-top, 1px solid transparent)`;
102
+ const facetRowBorderBottom = css `var(--facet-row-border-bottom, 1px solid transparent)`;
103
+ const checkboxHeight = css `15px`;
104
+ /**
105
+ * Styles for `facetRowTemplate`. Include `srOnlyStyle` alongside these.
106
+ */
107
+ export const facetRowStyles = css `
108
+ .facet-checkboxes {
109
+ margin: 0 5px 0 0;
110
+ display: flex;
111
+ height: ${checkboxHeight};
112
+ }
113
+ .facet-checkboxes input:first-child {
114
+ margin-right: 5px;
115
+ }
116
+ .facet-checkboxes input {
117
+ height: ${checkboxHeight};
118
+ width: ${checkboxHeight};
119
+ margin: 0;
120
+ }
121
+ .facet-row-container {
122
+ display: flex;
123
+ font-weight: 500;
124
+ font-size: 1.2rem;
125
+ margin: 0 auto;
126
+ padding: 0.25rem 0;
127
+ height: auto;
128
+ border-top: ${facetRowBorderTop};
129
+ border-bottom: ${facetRowBorderBottom};
130
+ }
131
+ .facet-info-display {
132
+ display: flex;
133
+ flex: 1 1 0%;
134
+ cursor: pointer;
135
+ flex-wrap: wrap;
136
+ }
137
+ .facet-title {
138
+ word-break: break-word;
139
+ display: inline-block;
140
+ flex: 1 1 0%;
141
+ }
142
+ .facet-note {
143
+ color: #bbb;
144
+ }
145
+ .facet-count {
146
+ text-align: right;
147
+ }
148
+ .select-facet-checkbox {
149
+ cursor: pointer;
150
+ display: inline-block;
151
+ }
152
+ .hide-facet-checkbox {
153
+ position: absolute;
154
+ clip: rect(0, 0, 0, 0);
155
+ pointer-events: none;
156
+ }
157
+ .hide-facet-checkbox:focus-visible + .hide-facet-icon {
158
+ outline-style: auto;
159
+ outline-offset: 2px;
160
+ }
161
+ .hide-facet-icon {
162
+ width: ${checkboxHeight};
163
+ height: ${checkboxHeight};
164
+ cursor: pointer;
165
+ display: flex;
166
+ }
167
+ .eye {
168
+ width: ${checkboxHeight};
169
+ height: ${checkboxHeight};
170
+ opacity: 0.3;
171
+ }
172
+ .hide-facet-icon:hover .eye,
173
+ .active .eye {
174
+ opacity: 1;
175
+ }
176
+ .hide-facet-icon:hover .eye-open,
177
+ .hide-facet-icon .eye-closed {
178
+ display: none;
179
+ }
180
+ .hide-facet-icon:hover .eye-closed,
181
+ .hide-facet-icon.active .eye-closed {
182
+ display: inline;
183
+ }
184
+ .hide-facet-icon.active .eye-open {
185
+ display: none;
186
+ }
187
+ .sorting-icon {
188
+ cursor: pointer;
189
+ }
190
+
191
+ a:link,
192
+ a:visited {
193
+ text-decoration: none;
194
+ color: var(--ia-theme-link-color, #4b64ff);
195
+ }
196
+ a:hover {
197
+ text-decoration: underline;
198
+ }
199
+ `;
200
+ //# sourceMappingURL=facet-row-template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"facet-row-template.js","sourceRoot":"","sources":["../../../src/collection-facets/facet-row-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAC;AACzD,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAC9C,OAAO,aAAa,MAAM,gCAAgC,CAAC;AA4B3D;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,OAAgB,EAAE,QAAiB;IAC/D,IAAI,CAAC,OAAO;QAAE,OAAO,MAAM,CAAC;IAC5B,OAAO,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC;AAC1C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAC/B,SAAS,EACT,MAAM,EACN,gBAAgB,EAChB,cAAc,GAAG,KAAK,EACtB,eAAe,GACS;IACxB,MAAM,kBAAkB,GAAG,GAAG,SAAS,IAAI,MAAM,CAAC,GAAG,YAAY,CAAC;IAClE,MAAM,kBAAkB,GAAG,GAAG,SAAS,IAAI,MAAM,CAAC,GAAG,WAAW,CAAC;IAEjE,MAAM,aAAa,GAAG,MAAM,CAA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/eye';\nimport eyeClosedIcon from '../assets/img/icons/eye-closed';\nimport type { FacetOption, FacetBucket, FacetState } from '../models';\nimport type { CollectionTitles } from '../data-source/models';\n\nexport type FacetRowTemplateOptions = {\n /** The name of the facet group to which this facet belongs (e.g., \"mediatype\") */\n facetType: FacetOption;\n\n /** The facet bucket containing details about the state, count, and key for this row */\n bucket: FacetBucket;\n\n /** The collection name cache for converting collection identifiers to titles */\n collectionTitles?: CollectionTitles;\n\n /**\n * Whether to omit the negative/hide button from this facet row if possible.\n * Has no effect if the facet bucket is itself hidden, in which case the hide\n * button *must* be shown to represent the state accurately.\n */\n omitHideButton?: boolean;\n\n /**\n * Called when either checkbox is clicked. Leave it out when an ancestor\n * handles the rows' clicks by delegation instead.\n */\n onCheckboxClick?: (e: Event, negative: boolean) => void;\n};\n\n/**\n * Returns the composed facet state corresponding to a positive or negative facet's checked state\n */\nexport function getFacetState(checked: boolean, negative: boolean): FacetState {\n if (!checked) return 'none';\n return negative ? 'hidden' : 'selected';\n}\n\n/**\n * Template for a full facet row, including the positive/negative checks,\n * the display name, and the count. The row is plain DOM so that long lists\n * (e.g. the More... dialog) can render many rows without creating an\n * element per row. Render it inside a shadow root that includes\n * `facetRowStyles`.\n */\nexport function facetRowTemplate({\n facetType,\n bucket,\n collectionTitles,\n omitHideButton = false,\n onCheckboxClick,\n}: FacetRowTemplateOptions): TemplateResult {\n const showOnlyCheckboxId = `${facetType}:${bucket.key}-show-only`;\n const negativeCheckboxId = `${facetType}:${bucket.key}-negative`;\n\n const extraNoteSpan = bucket.extraNote\n ? html`<span class=\"facet-note\">${bucket.extraNote}</span>`\n : nothing;\n\n // For collections, we render the collection title as a link.\n // For other facet types, we just have a static value to use.\n const bucketTextDisplay =\n facetType !== 'collection'\n ? html`${bucket.displayText ?? bucket.key} ${extraNoteSpan}`\n : html`<a href=\"/details/${bucket.key}\">\n ${collectionTitles?.get(bucket.key) ?? bucket.key}\n </a> `;\n\n const bucketCountText = bucket.count > 0 ? bucket.count.toLocaleString() : '';\n\n const facetHidden = bucket.state === 'hidden';\n const facetSelected = bucket.state === 'selected';\n\n const titleText = `${facetType}: ${bucket.displayText ?? bucket.key}`;\n const onlyShowText = facetSelected\n ? `Show all ${facetType}s`\n : `Only show ${titleText}`;\n const hideText = `Hide ${titleText}`;\n const unhideText = `Unhide ${titleText}`;\n const showHideText = facetHidden ? unhideText : hideText;\n const ariaLabel = `${titleText}, ${bucket.count} results`;\n\n const showOnlyClicked = onCheckboxClick\n ? (e: Event) => onCheckboxClick(e, false)\n : undefined;\n const hideClicked = onCheckboxClick\n ? (e: Event) => onCheckboxClick(e, true)\n : undefined;\n\n // Added data-testid for Playwright testing\n return html`\n <div class=\"facet-row-container\">\n <div class=\"facet-checkboxes\">\n <input\n type=\"checkbox\"\n .name=${facetType}\n .value=${bucket.key}\n @click=${showOnlyClicked}\n .checked=${facetSelected}\n class=\"select-facet-checkbox\"\n title=${onlyShowText}\n id=${showOnlyCheckboxId}\n data-testid=${showOnlyCheckboxId}\n />\n <div\n class=\"hide-facet-container\"\n ?hidden=${omitHideButton && !facetHidden}\n >\n <input\n type=\"checkbox\"\n id=${negativeCheckboxId}\n .name=${facetType}\n .value=${bucket.key}\n @click=${hideClicked}\n .checked=${facetHidden}\n class=\"hide-facet-checkbox\"\n />\n <label\n for=${negativeCheckboxId}\n class=\"hide-facet-icon${facetHidden ? ' active' : ''}\"\n title=${showHideText}\n data-testid=${negativeCheckboxId}\n >\n <span class=\"sr-only\">${showHideText}</span>\n <span class=\"eye eye-open\">${eyeIcon}</span>\n <span class=\"eye eye-closed\">${eyeClosedIcon}</span>\n </label>\n </div>\n </div>\n <label\n for=${showOnlyCheckboxId}\n class=\"facet-info-display\"\n title=${onlyShowText}\n aria-label=${ariaLabel}\n >\n <div class=\"facet-title\">${bucketTextDisplay}</div>\n <div class=\"facet-count\">${bucketCountText}</div>\n </label>\n </div>\n `;\n}\n\nconst facetRowBorderTop = css`var(--facet-row-border-top, 1px solid transparent)`;\nconst facetRowBorderBottom = css`var(--facet-row-border-bottom, 1px solid transparent)`;\nconst checkboxHeight = css`15px`;\n\n/**\n * Styles for `facetRowTemplate`. Include `srOnlyStyle` alongside these.\n */\nexport const facetRowStyles = css`\n .facet-checkboxes {\n margin: 0 5px 0 0;\n display: flex;\n height: ${checkboxHeight};\n }\n .facet-checkboxes input:first-child {\n margin-right: 5px;\n }\n .facet-checkboxes input {\n height: ${checkboxHeight};\n width: ${checkboxHeight};\n margin: 0;\n }\n .facet-row-container {\n display: flex;\n font-weight: 500;\n font-size: 1.2rem;\n margin: 0 auto;\n padding: 0.25rem 0;\n height: auto;\n border-top: ${facetRowBorderTop};\n border-bottom: ${facetRowBorderBottom};\n }\n .facet-info-display {\n display: flex;\n flex: 1 1 0%;\n cursor: pointer;\n flex-wrap: wrap;\n }\n .facet-title {\n word-break: break-word;\n display: inline-block;\n flex: 1 1 0%;\n }\n .facet-note {\n color: #bbb;\n }\n .facet-count {\n text-align: right;\n }\n .select-facet-checkbox {\n cursor: pointer;\n display: inline-block;\n }\n .hide-facet-checkbox {\n position: absolute;\n clip: rect(0, 0, 0, 0);\n pointer-events: none;\n }\n .hide-facet-checkbox:focus-visible + .hide-facet-icon {\n outline-style: auto;\n outline-offset: 2px;\n }\n .hide-facet-icon {\n width: ${checkboxHeight};\n height: ${checkboxHeight};\n cursor: pointer;\n display: flex;\n }\n .eye {\n width: ${checkboxHeight};\n height: ${checkboxHeight};\n opacity: 0.3;\n }\n .hide-facet-icon:hover .eye,\n .active .eye {\n opacity: 1;\n }\n .hide-facet-icon:hover .eye-open,\n .hide-facet-icon .eye-closed {\n display: none;\n }\n .hide-facet-icon:hover .eye-closed,\n .hide-facet-icon.active .eye-closed {\n display: inline;\n }\n .hide-facet-icon.active .eye-open {\n display: none;\n }\n .sorting-icon {\n cursor: pointer;\n }\n\n a:link,\n a:visited {\n text-decoration: none;\n color: var(--ia-theme-link-color, #4b64ff);\n }\n a:hover {\n text-decoration: underline;\n }\n`;\n"]}
@@ -1,10 +1,9 @@
1
1
  var FacetRow_1;
2
2
  import { __decorate } from "tslib";
3
- import { css, html, LitElement, nothing, } from 'lit';
3
+ import { html, LitElement, nothing } from 'lit';
4
4
  import { customElement, property } from 'lit/decorators.js';
5
- import eyeIcon from '../assets/img/icons/eye';
6
- import eyeClosedIcon from '../assets/img/icons/eye-closed';
7
5
  import { srOnlyStyle } from '../styles/sr-only';
6
+ import { facetRowStyles, facetRowTemplate, getFacetState, } from './facet-row-template';
8
7
  let FacetRow = FacetRow_1 = class FacetRow extends LitElement {
9
8
  constructor() {
10
9
  //
@@ -35,84 +34,13 @@ let FacetRow = FacetRow_1 = class FacetRow extends LitElement {
35
34
  const { bucket, facetType } = this;
36
35
  if (!bucket || !facetType)
37
36
  return nothing;
38
- const showOnlyCheckboxId = `${facetType}:${bucket.key}-show-only`;
39
- const negativeCheckboxId = `${facetType}:${bucket.key}-negative`;
40
- const extraNoteSpan = bucket.extraNote
41
- ? html `<span class="facet-note">${bucket.extraNote}</span>`
42
- : nothing;
43
- // For collections, we render the collection title as a link.
44
- // For other facet types, we just have a static value to use.
45
- const bucketTextDisplay = facetType !== 'collection'
46
- ? html `${bucket.displayText ?? bucket.key} ${extraNoteSpan}`
47
- : html `<a href="/details/${bucket.key}">
48
- ${this.collectionTitles?.get(bucket.key) ?? bucket.key}
49
- </a> `;
50
- const bucketCountText = bucket.count > 0 ? bucket.count.toLocaleString() : '';
51
- const facetHidden = bucket.state === 'hidden';
52
- const facetSelected = bucket.state === 'selected';
53
- const titleText = `${facetType}: ${bucket.displayText ?? bucket.key}`;
54
- const onlyShowText = facetSelected
55
- ? `Show all ${facetType}s`
56
- : `Only show ${titleText}`;
57
- const hideText = `Hide ${titleText}`;
58
- const unhideText = `Unhide ${titleText}`;
59
- const showHideText = facetHidden ? unhideText : hideText;
60
- const ariaLabel = `${titleText}, ${bucket.count} results`;
61
- // Added data-testid for Playwright testing
62
- return html `
63
- <div class="facet-row-container">
64
- <div class="facet-checkboxes">
65
- <input
66
- type="checkbox"
67
- .name=${facetType}
68
- .value=${bucket.key}
69
- @click=${(e) => {
70
- this.facetClicked(e, false);
71
- }}
72
- .checked=${facetSelected}
73
- class="select-facet-checkbox"
74
- title=${onlyShowText}
75
- id=${showOnlyCheckboxId}
76
- data-testid=${showOnlyCheckboxId}
77
- />
78
- <div
79
- class="hide-facet-container"
80
- ?hidden=${this.omitHideButton && !facetHidden}
81
- >
82
- <input
83
- type="checkbox"
84
- id=${negativeCheckboxId}
85
- .name=${facetType}
86
- .value=${bucket.key}
87
- @click=${(e) => {
88
- this.facetClicked(e, true);
89
- }}
90
- .checked=${facetHidden}
91
- class="hide-facet-checkbox"
92
- />
93
- <label
94
- for=${negativeCheckboxId}
95
- class="hide-facet-icon${facetHidden ? ' active' : ''}"
96
- title=${showHideText}
97
- data-testid=${negativeCheckboxId}
98
- >
99
- <span class="sr-only">${showHideText}</span>
100
- <span class="eye eye-open">${eyeIcon}</span>
101
- <span class="eye eye-closed">${eyeClosedIcon}</span>
102
- </label>
103
- </div>
104
- </div>
105
- <label
106
- for=${showOnlyCheckboxId}
107
- class="facet-info-display"
108
- title=${onlyShowText}
109
- aria-label=${ariaLabel}
110
- >
111
- <div class="facet-title">${bucketTextDisplay}</div>
112
- <div class="facet-count">${bucketCountText}</div>
113
- </label>
114
- </div>
115
- `;
37
+ return facetRowTemplate({
38
+ facetType,
39
+ bucket,
40
+ collectionTitles: this.collectionTitles,
41
+ omitHideButton: this.omitHideButton,
42
+ onCheckboxClick: (e, negative) => this.facetClicked(e, negative),
43
+ });
116
44
  }
117
45
  //
118
46
  // EVENT HANDLERS & DISPATCHERS
@@ -152,116 +80,13 @@ let FacetRow = FacetRow_1 = class FacetRow extends LitElement {
152
80
  * Returns the composed facet state corresponding to a positive or negative facet's checked state
153
81
  */
154
82
  static getFacetState(checked, negative) {
155
- let state;
156
- if (checked) {
157
- state = negative ? 'hidden' : 'selected';
158
- }
159
- else {
160
- state = 'none';
161
- }
162
- return state;
83
+ return getFacetState(checked, negative);
163
84
  }
164
85
  //
165
86
  // STYLES
166
87
  //
167
88
  static get styles() {
168
- const facetRowBorderTop = css `var(--facet-row-border-top, 1px solid transparent)`;
169
- const facetRowBorderBottom = css `var(--facet-row-border-bottom, 1px solid transparent)`;
170
- const checkboxHeight = css `15px`;
171
- const ownCss = css `
172
- .facet-checkboxes {
173
- margin: 0 5px 0 0;
174
- display: flex;
175
- height: ${checkboxHeight};
176
- }
177
- .facet-checkboxes input:first-child {
178
- margin-right: 5px;
179
- }
180
- .facet-checkboxes input {
181
- height: ${checkboxHeight};
182
- width: ${checkboxHeight};
183
- margin: 0;
184
- }
185
- .facet-row-container {
186
- display: flex;
187
- font-weight: 500;
188
- font-size: 1.2rem;
189
- margin: 0 auto;
190
- padding: 0.25rem 0;
191
- height: auto;
192
- border-top: ${facetRowBorderTop};
193
- border-bottom: ${facetRowBorderBottom};
194
- }
195
- .facet-info-display {
196
- display: flex;
197
- flex: 1 1 0%;
198
- cursor: pointer;
199
- flex-wrap: wrap;
200
- }
201
- .facet-title {
202
- word-break: break-word;
203
- display: inline-block;
204
- flex: 1 1 0%;
205
- }
206
- .facet-note {
207
- color: #bbb;
208
- }
209
- .facet-count {
210
- text-align: right;
211
- }
212
- .select-facet-checkbox {
213
- cursor: pointer;
214
- display: inline-block;
215
- }
216
- .hide-facet-checkbox {
217
- position: absolute;
218
- clip: rect(0, 0, 0, 0);
219
- pointer-events: none;
220
- }
221
- .hide-facet-checkbox:focus-visible + .hide-facet-icon {
222
- outline-style: auto;
223
- outline-offset: 2px;
224
- }
225
- .hide-facet-icon {
226
- width: ${checkboxHeight};
227
- height: ${checkboxHeight};
228
- cursor: pointer;
229
- display: flex;
230
- }
231
- .eye {
232
- width: ${checkboxHeight};
233
- height: ${checkboxHeight};
234
- opacity: 0.3;
235
- }
236
- .hide-facet-icon:hover .eye,
237
- .active .eye {
238
- opacity: 1;
239
- }
240
- .hide-facet-icon:hover .eye-open,
241
- .hide-facet-icon .eye-closed {
242
- display: none;
243
- }
244
- .hide-facet-icon:hover .eye-closed,
245
- .hide-facet-icon.active .eye-closed {
246
- display: inline;
247
- }
248
- .hide-facet-icon.active .eye-open {
249
- display: none;
250
- }
251
- .sorting-icon {
252
- cursor: pointer;
253
- }
254
-
255
- a:link,
256
- a:visited {
257
- text-decoration: none;
258
- color: var(--ia-theme-link-color, #4b64ff);
259
- }
260
- a:hover {
261
- text-decoration: underline;
262
- }
263
- `;
264
- return [srOnlyStyle, ownCss];
89
+ return [srOnlyStyle, facetRowStyles];
265
90
  }
266
91
  };
267
92
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"facet-row.js","sourceRoot":"","sources":["../../../src/collection-facets/facet-row.ts"],"names":[],"mappings":";;AAAA,OAAO,EACL,GAAG,EACH,IAAI,EACJ,UAAU,EAGV,OAAO,GACR,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,OAAO,MAAM,yBAAyB,CAAC;AAC9C,OAAO,aAAa,MAAM,gCAAgC,CAAC;AAQ3D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGzC,IAAM,QAAQ,gBAAd,MAAM,QAAS,SAAQ,UAAU;IAAjC;QACL,EAAE;QACF,WAAW;QACX,EAAE;;QAQF;;;;WAIG;QACyC,mBAAc,GAAG,KAAK,CAAC;IA+QrE,CAAC;IAzQC,EAAE;IACF,8BAA8B;IAC9B,EAAE;IAEF,MAAM;QACJ,OAAO,IAAI,CAAA,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACxC,CAAC;IAED,EAAE;IACF,mBAAmB;IACnB,EAAE;IAEF;;;OAGG;IACH,IAAY,gBAAgB;QAC1B,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;QACnC,IAAI,CAAC,MAAM,IAAI,CAAC,SAAS;YAAE,OAAO,OAAO,CAAC;QAE1C,MAAM,kBAAkB,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AC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAyB;AAGxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCAAsB;AAOL;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAwB;AAInE;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDACS;AApBzB,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CA+RpB","sourcesContent":["import {\n css,\n html,\n LitElement,\n TemplateResult,\n CSSResultGroup,\n nothing,\n} from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport eyeIcon from '../assets/img/icons/eye';\nimport eyeClosedIcon from '../assets/img/icons/eye-closed';\nimport type {\n FacetOption,\n FacetBucket,\n FacetEventDetails,\n FacetState,\n} from '../models';\nimport type { CollectionTitles } from '../data-source/models';\nimport { srOnlyStyle } from '../styles/sr-only';\n\n@customElement('facet-row')\nexport class FacetRow extends LitElement {\n //\n // UI STATE\n //\n\n /** The name of the facet group to which this facet belongs (e.g., \"mediatype\") */\n @property({ type: String }) facetType?: FacetOption;\n\n /** The facet bucket containing details about the state, count, and key for this row */\n @property({ type: Object }) bucket?: FacetBucket;\n\n /**\n * Whether to omit the negative/hide button from this facet row if possible.\n * Has no effect if the facet bucket is itself hidden, in which case the hide\n * button *must* be shown to represent the state accurately.\n */\n @property({ type: Boolean, reflect: true }) omitHideButton = false;\n\n /** The collection name cache for converting collection identifiers to titles */\n @property({ type: Object })\n collectionTitles?: CollectionTitles;\n\n //\n // COMPONENT LIFECYCLE METHODS\n //\n\n render() {\n return html`${this.facetRowTemplate}`;\n }\n\n //\n // TEMPLATE GETTERS\n //\n\n /**\n * Template for the full facet row, including the positive/negative checks,\n * the display name, and the count.\n */\n private get facetRowTemplate(): TemplateResult | typeof nothing {\n const { bucket, facetType } = this;\n if (!bucket || !facetType) return nothing;\n\n const showOnlyCheckboxId = `${facetType}:${bucket.key}-show-only`;\n const negativeCheckboxId = `${facetType}:${bucket.key}-negative`;\n\n const extraNoteSpan = bucket.extraNote\n ? html`<span class=\"facet-note\">${bucket.extraNote}</span>`\n : nothing;\n\n // For collections, we render the collection title as a link.\n // For other facet types, we just have a static value to use.\n const bucketTextDisplay =\n facetType !== 'collection'\n ? html`${bucket.displayText ?? bucket.key} ${extraNoteSpan}`\n : html`<a href=\"/details/${bucket.key}\">\n ${this.collectionTitles?.get(bucket.key) ?? bucket.key}\n </a> `;\n\n const bucketCountText =\n bucket.count > 0 ? bucket.count.toLocaleString() : '';\n\n const facetHidden = bucket.state === 'hidden';\n const facetSelected = bucket.state === 'selected';\n\n const titleText = `${facetType}: ${bucket.displayText ?? bucket.key}`;\n const onlyShowText = facetSelected\n ? `Show all ${facetType}s`\n : `Only show ${titleText}`;\n const hideText = `Hide ${titleText}`;\n const unhideText = `Unhide ${titleText}`;\n const showHideText = facetHidden ? unhideText : hideText;\n const ariaLabel = `${titleText}, ${bucket.count} results`;\n\n // Added data-testid for Playwright testing\n return html`\n <div class=\"facet-row-container\">\n <div class=\"facet-checkboxes\">\n <input\n type=\"checkbox\"\n .name=${facetType}\n .value=${bucket.key}\n @click=${(e: Event) => {\n this.facetClicked(e, false);\n }}\n .checked=${facetSelected}\n class=\"select-facet-checkbox\"\n title=${onlyShowText}\n id=${showOnlyCheckboxId}\n data-testid=${showOnlyCheckboxId}\n />\n <div\n class=\"hide-facet-container\"\n ?hidden=${this.omitHideButton && !facetHidden}\n >\n <input\n type=\"checkbox\"\n id=${negativeCheckboxId}\n .name=${facetType}\n .value=${bucket.key}\n @click=${(e: Event) => {\n this.facetClicked(e, true);\n }}\n .checked=${facetHidden}\n class=\"hide-facet-checkbox\"\n />\n <label\n for=${negativeCheckboxId}\n class=\"hide-facet-icon${facetHidden ? ' active' : ''}\"\n title=${showHideText}\n data-testid=${negativeCheckboxId}\n >\n <span class=\"sr-only\">${showHideText}</span>\n <span class=\"eye eye-open\">${eyeIcon}</span>\n <span class=\"eye eye-closed\">${eyeClosedIcon}</span>\n </label>\n </div>\n </div>\n <label\n for=${showOnlyCheckboxId}\n class=\"facet-info-display\"\n title=${onlyShowText}\n aria-label=${ariaLabel}\n >\n <div class=\"facet-title\">${bucketTextDisplay}</div>\n <div class=\"facet-count\">${bucketCountText}</div>\n </label>\n </div>\n `;\n }\n\n //\n // EVENT HANDLERS & DISPATCHERS\n //\n\n /**\n * Handler for whenever this facet is clicked & its state changes\n */\n private facetClicked(e: Event, negative: boolean) {\n const { bucket, facetType } = this;\n if (!bucket || !facetType) return;\n\n const target = e.target as HTMLInputElement;\n const { checked } = target;\n this.bucket = {\n ...bucket,\n state: FacetRow.getFacetState(checked, negative),\n };\n\n this.dispatchFacetClickEvent({\n facetType,\n bucket: this.bucket,\n negative,\n });\n }\n\n /**\n * Emits a `facetClick` event with details about this facet & its current state\n */\n private dispatchFacetClickEvent(detail: FacetEventDetails) {\n const event = new CustomEvent<FacetEventDetails>('facetClick', {\n detail,\n });\n this.dispatchEvent(event);\n }\n\n //\n // OTHER METHODS\n //\n\n /**\n * Returns the composed facet state corresponding to a positive or negative facet's checked state\n */\n static getFacetState(checked: boolean, negative: boolean): FacetState {\n let state: FacetState;\n if (checked) {\n state = negative ? 'hidden' : 'selected';\n } else {\n state = 'none';\n }\n return state;\n }\n\n //\n // STYLES\n //\n\n static get styles(): CSSResultGroup {\n const facetRowBorderTop = css`var(--facet-row-border-top, 1px solid transparent)`;\n const facetRowBorderBottom = css`var(--facet-row-border-bottom, 1px solid transparent)`;\n const checkboxHeight = css`15px`;\n\n const ownCss = css`\n .facet-checkboxes {\n margin: 0 5px 0 0;\n display: flex;\n height: ${checkboxHeight};\n }\n .facet-checkboxes input:first-child {\n margin-right: 5px;\n }\n .facet-checkboxes input {\n height: ${checkboxHeight};\n width: ${checkboxHeight};\n margin: 0;\n }\n .facet-row-container {\n display: flex;\n font-weight: 500;\n font-size: 1.2rem;\n margin: 0 auto;\n padding: 0.25rem 0;\n height: auto;\n border-top: ${facetRowBorderTop};\n border-bottom: ${facetRowBorderBottom};\n }\n .facet-info-display {\n display: flex;\n flex: 1 1 0%;\n cursor: pointer;\n flex-wrap: wrap;\n }\n .facet-title {\n word-break: break-word;\n display: inline-block;\n flex: 1 1 0%;\n }\n .facet-note {\n color: #bbb;\n }\n .facet-count {\n text-align: right;\n }\n .select-facet-checkbox {\n cursor: pointer;\n display: inline-block;\n }\n .hide-facet-checkbox {\n position: absolute;\n clip: rect(0, 0, 0, 0);\n pointer-events: none;\n }\n .hide-facet-checkbox:focus-visible + .hide-facet-icon {\n outline-style: auto;\n outline-offset: 2px;\n }\n .hide-facet-icon {\n width: ${checkboxHeight};\n height: ${checkboxHeight};\n cursor: pointer;\n display: flex;\n }\n .eye {\n width: ${checkboxHeight};\n height: ${checkboxHeight};\n opacity: 0.3;\n }\n .hide-facet-icon:hover .eye,\n .active .eye {\n opacity: 1;\n }\n .hide-facet-icon:hover .eye-open,\n .hide-facet-icon .eye-closed {\n display: none;\n }\n .hide-facet-icon:hover .eye-closed,\n .hide-facet-icon.active .eye-closed {\n display: inline;\n }\n .hide-facet-icon.active .eye-open {\n display: none;\n }\n .sorting-icon {\n cursor: pointer;\n }\n\n a:link,\n a:visited {\n text-decoration: none;\n color: var(--ia-theme-link-color, #4b64ff);\n }\n a:hover {\n text-decoration: underline;\n }\n `;\n\n return [srOnlyStyle, ownCss];\n }\n}\n"]}
1
+ {"version":3,"file":"facet-row.js","sourceRoot":"","sources":["../../../src/collection-facets/facet-row.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAkC,OAAO,EAAE,MAAM,KAAK,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAQ5D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,aAAa,G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YAC3B,SAAS;YACT,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,QAAQ;SACT,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACK,uBAAuB,CAAC,MAAyB;QACvD,MAAM,KAAK,GAAG,IAAI,WAAW,CAAoB,YAAY,EAAE;YAC7D,MAAM;SACP,CAAC,CAAC;QACH,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,EAAE;IACF,gBAAgB;IAChB,EAAE;IAEF;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,OAAgB,EAAE,QAAiB;QACtD,OAAO,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED,EAAE;IACF,SAAS;IACT,EAAE;IAEF,MAAM,KAAK,MAAM;QACf,OAAO,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IACvC,CAAC;CACF,CAAA;AAlG6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAyB;AAGxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCAAsB;AAOL;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAwB;AAInE;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDACS;AApBzB,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAwGpB","sourcesContent":["import { html, LitElement, TemplateResult, CSSResultGroup, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport type {\n FacetOption,\n FacetBucket,\n FacetEventDetails,\n FacetState,\n} from '../models';\nimport type { CollectionTitles } from '../data-source/models';\nimport { srOnlyStyle } from '../styles/sr-only';\nimport {\n facetRowStyles,\n facetRowTemplate,\n getFacetState,\n} from './facet-row-template';\n\n@customElement('facet-row')\nexport class FacetRow extends LitElement {\n //\n // UI STATE\n //\n\n /** The name of the facet group to which this facet belongs (e.g., \"mediatype\") */\n @property({ type: String }) facetType?: FacetOption;\n\n /** The facet bucket containing details about the state, count, and key for this row */\n @property({ type: Object }) bucket?: FacetBucket;\n\n /**\n * Whether to omit the negative/hide button from this facet row if possible.\n * Has no effect if the facet bucket is itself hidden, in which case the hide\n * button *must* be shown to represent the state accurately.\n */\n @property({ type: Boolean, reflect: true }) omitHideButton = false;\n\n /** The collection name cache for converting collection identifiers to titles */\n @property({ type: Object })\n collectionTitles?: CollectionTitles;\n\n //\n // COMPONENT LIFECYCLE METHODS\n //\n\n render() {\n return html`${this.facetRowTemplate}`;\n }\n\n //\n // TEMPLATE GETTERS\n //\n\n /**\n * Template for the full facet row, including the positive/negative checks,\n * the display name, and the count.\n */\n private get facetRowTemplate(): TemplateResult | typeof nothing {\n const { bucket, facetType } = this;\n if (!bucket || !facetType) return nothing;\n\n return facetRowTemplate({\n facetType,\n bucket,\n collectionTitles: this.collectionTitles,\n omitHideButton: this.omitHideButton,\n onCheckboxClick: (e, negative) => this.facetClicked(e, negative),\n });\n }\n\n //\n // EVENT HANDLERS & DISPATCHERS\n //\n\n /**\n * Handler for whenever this facet is clicked & its state changes\n */\n private facetClicked(e: Event, negative: boolean) {\n const { bucket, facetType } = this;\n if (!bucket || !facetType) return;\n\n const target = e.target as HTMLInputElement;\n const { checked } = target;\n this.bucket = {\n ...bucket,\n state: FacetRow.getFacetState(checked, negative),\n };\n\n this.dispatchFacetClickEvent({\n facetType,\n bucket: this.bucket,\n negative,\n });\n }\n\n /**\n * Emits a `facetClick` event with details about this facet & its current state\n */\n private dispatchFacetClickEvent(detail: FacetEventDetails) {\n const event = new CustomEvent<FacetEventDetails>('facetClick', {\n detail,\n });\n this.dispatchEvent(event);\n }\n\n //\n // OTHER METHODS\n //\n\n /**\n * Returns the composed facet state corresponding to a positive or negative facet's checked state\n */\n static getFacetState(checked: boolean, negative: boolean): FacetState {\n return getFacetState(checked, negative);\n }\n\n //\n // STYLES\n //\n\n static get styles(): CSSResultGroup {\n return [srOnlyStyle, facetRowStyles];\n }\n}\n"]}
@@ -3,7 +3,12 @@
3
3
  */
4
4
  export declare const MORE_FACETS__MAX_AGGREGATIONS = 10000;
5
5
  /**
6
- * Default number of facets to show per page of the More... facet dialogs.
6
+ * Width in px of each column of facets in the More... facet dialogs. Every
7
+ * column is this wide; the number of columns per page is however many fit.
8
+ */
9
+ export declare const MORE_FACETS__COLUMN_WIDTH = 250;
10
+ /**
11
+ * Default number of facets stacked in each column of the More... facet dialogs.
7
12
  * Can be overridden via component property.
8
13
  */
9
- export declare const MORE_FACETS__DEFAULT_PAGE_SIZE = 35;
14
+ export declare const MORE_FACETS__ROWS_PER_COLUMN = 12;
@@ -3,8 +3,13 @@
3
3
  */
4
4
  export const MORE_FACETS__MAX_AGGREGATIONS = 10000;
5
5
  /**
6
- * Default number of facets to show per page of the More... facet dialogs.
6
+ * Width in px of each column of facets in the More... facet dialogs. Every
7
+ * column is this wide; the number of columns per page is however many fit.
8
+ */
9
+ export const MORE_FACETS__COLUMN_WIDTH = 250;
10
+ /**
11
+ * Default number of facets stacked in each column of the More... facet dialogs.
7
12
  * Can be overridden via component property.
8
13
  */
9
- export const MORE_FACETS__DEFAULT_PAGE_SIZE = 35;
14
+ export const MORE_FACETS__ROWS_PER_COLUMN = 12;
10
15
  //# sourceMappingURL=models.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/collection-facets/models.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,KAAK,CAAC;AAEnD;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,CAAC","sourcesContent":["/**\n * Maximum number of aggregations to include in the More... facet dialogs.\n */\nexport const MORE_FACETS__MAX_AGGREGATIONS = 10000;\n\n/**\n * Default number of facets to show per page of the More... facet dialogs.\n * Can be overridden via component property.\n */\nexport const MORE_FACETS__DEFAULT_PAGE_SIZE = 35;\n"]}
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/collection-facets/models.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,KAAK,CAAC;AAEnD;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAE7C;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,CAAC","sourcesContent":["/**\n * Maximum number of aggregations to include in the More... facet dialogs.\n */\nexport const MORE_FACETS__MAX_AGGREGATIONS = 10000;\n\n/**\n * Width in px of each column of facets in the More... facet dialogs. Every\n * column is this wide; the number of columns per page is however many fit.\n */\nexport const MORE_FACETS__COLUMN_WIDTH = 250;\n\n/**\n * Default number of facets stacked in each column of the More... facet dialogs.\n * Can be overridden via component property.\n */\nexport const MORE_FACETS__ROWS_PER_COLUMN = 12;\n"]}