blacklight 7.34.0 → 8.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (393) hide show
  1. checksums.yaml +4 -4
  2. data/.env +2 -3
  3. data/.github/workflows/ruby.yml +32 -127
  4. data/.rubocop.yml +241 -2
  5. data/.rubocop_todo.yml +214 -270
  6. data/Gemfile +7 -10
  7. data/README.md +11 -3
  8. data/VERSION +1 -1
  9. data/app/assets/javascripts/blacklight/blacklight.esm.js +384 -0
  10. data/app/assets/javascripts/blacklight/blacklight.esm.js.map +1 -0
  11. data/app/assets/javascripts/blacklight/blacklight.js +374 -489
  12. data/app/assets/javascripts/blacklight/blacklight.js.map +1 -0
  13. data/app/assets/stylesheets/blacklight/_autocomplete.scss +25 -0
  14. data/app/assets/stylesheets/blacklight/_blacklight_base.scss +1 -1
  15. data/app/assets/stylesheets/blacklight/_bookmark.scss +16 -0
  16. data/app/assets/stylesheets/blacklight/_bootstrap_overrides.scss +8 -0
  17. data/app/assets/stylesheets/blacklight/_facets.scss +72 -44
  18. data/app/assets/stylesheets/blacklight/_header.scss +0 -15
  19. data/app/assets/stylesheets/blacklight/_icons.scss +0 -14
  20. data/app/assets/stylesheets/blacklight/_mixins.scss +20 -0
  21. data/app/assets/stylesheets/blacklight/_modal.scss +8 -2
  22. data/app/assets/stylesheets/blacklight/_search_form.scss +30 -3
  23. data/app/assets/stylesheets/blacklight/_search_history.scss +10 -1
  24. data/app/assets/stylesheets/blacklight/_search_results.scss +6 -2
  25. data/app/assets/stylesheets/blacklight/blacklight_defaults.scss +4 -1
  26. data/app/builders/blacklight/action_builder.rb +18 -9
  27. data/app/components/blacklight/advanced_search_form_component.html.erb +2 -2
  28. data/app/components/blacklight/advanced_search_form_component.rb +8 -10
  29. data/app/components/blacklight/constraints_component.rb +27 -37
  30. data/app/components/blacklight/document/action_component.rb +9 -9
  31. data/app/components/blacklight/document/actions_component.rb +2 -2
  32. data/app/components/blacklight/document/bookmark_component.html.erb +9 -0
  33. data/app/components/blacklight/document/bookmark_component.rb +4 -2
  34. data/app/components/blacklight/document/citation_component.rb +5 -3
  35. data/app/components/blacklight/document/group_component.rb +7 -3
  36. data/app/components/blacklight/document/sidebar_component.html.erb +2 -0
  37. data/app/components/blacklight/document/sidebar_component.rb +16 -0
  38. data/app/components/blacklight/document/thumbnail_component.html.erb +2 -7
  39. data/app/components/blacklight/document/thumbnail_component.rb +1 -9
  40. data/app/components/blacklight/document_component.html.erb +4 -0
  41. data/app/components/blacklight/document_component.rb +14 -53
  42. data/app/components/blacklight/document_metadata_component.html.erb +2 -4
  43. data/app/components/blacklight/document_metadata_component.rb +5 -10
  44. data/app/components/blacklight/document_title_component.rb +4 -1
  45. data/app/components/blacklight/facet_component.rb +1 -1
  46. data/app/components/blacklight/facet_field_checkboxes_component.html.erb +3 -3
  47. data/app/components/blacklight/facet_field_checkboxes_component.rb +1 -1
  48. data/app/components/blacklight/facet_field_component.html.erb +5 -5
  49. data/app/components/blacklight/facet_field_component.rb +9 -2
  50. data/app/components/blacklight/facet_field_list_component.html.erb +3 -3
  51. data/app/components/blacklight/facet_field_list_component.rb +37 -5
  52. data/app/components/blacklight/facet_field_no_layout_component.rb +0 -2
  53. data/app/components/blacklight/facet_item_component.rb +1 -43
  54. data/app/components/blacklight/facet_item_pivot_component.rb +21 -23
  55. data/app/components/blacklight/header_component.rb +1 -1
  56. data/app/components/blacklight/hidden_search_state_component.rb +1 -2
  57. data/app/components/blacklight/icons/legacy_icon_component.rb +30 -0
  58. data/app/components/blacklight/icons/list_component.rb +16 -0
  59. data/app/components/blacklight/icons/search_component.rb +16 -0
  60. data/app/components/blacklight/metadata_field_component.html.erb +2 -2
  61. data/app/components/blacklight/metadata_field_component.rb +24 -8
  62. data/app/components/blacklight/metadata_field_layout_component.rb +4 -25
  63. data/app/components/blacklight/response/facet_group_component.html.erb +3 -5
  64. data/app/components/blacklight/response/facet_group_component.rb +29 -8
  65. data/app/components/blacklight/response/pagination_component.html.erb +1 -1
  66. data/app/components/blacklight/response/pagination_component.rb +1 -5
  67. data/app/components/blacklight/response/sort_component.rb +1 -1
  68. data/app/components/blacklight/response/spellcheck_component.rb +17 -6
  69. data/app/components/blacklight/response/view_type_button_component.rb +2 -6
  70. data/app/components/blacklight/response/view_type_component.rb +3 -5
  71. data/app/components/blacklight/search/sidebar_component.html.erb +8 -0
  72. data/app/components/blacklight/search/sidebar_component.rb +17 -0
  73. data/app/components/blacklight/search_bar_component.html.erb +20 -15
  74. data/app/components/blacklight/search_bar_component.rb +2 -16
  75. data/app/components/blacklight/search_button_component.rb +3 -3
  76. data/app/components/blacklight/search_context_component.rb +43 -9
  77. data/app/components/blacklight/search_header_component.html.erb +2 -0
  78. data/app/components/blacklight/search_header_component.rb +6 -0
  79. data/app/components/blacklight/start_over_button_component.rb +5 -3
  80. data/app/components/blacklight/system/dropdown_component.rb +2 -2
  81. data/app/components/blacklight/system/flash_message_component.html.erb +3 -1
  82. data/app/components/blacklight/system/flash_message_component.rb +11 -2
  83. data/app/components/blacklight/system/modal_component.html.erb +1 -1
  84. data/app/components/blacklight/system/modal_component.rb +0 -2
  85. data/app/components/blacklight/top_navbar_component.html.erb +1 -1
  86. data/app/components/blacklight/top_navbar_component.rb +0 -4
  87. data/app/controllers/bookmarks_controller.rb +1 -0
  88. data/app/controllers/catalog_controller.rb +1 -0
  89. data/app/controllers/concerns/blacklight/bookmarks.rb +10 -5
  90. data/app/controllers/concerns/blacklight/catalog.rb +21 -75
  91. data/app/controllers/concerns/blacklight/controller.rb +3 -41
  92. data/app/controllers/concerns/blacklight/search_context.rb +25 -7
  93. data/app/controllers/concerns/blacklight/search_history.rb +2 -0
  94. data/app/controllers/concerns/blacklight/searchable.rb +12 -1
  95. data/app/controllers/concerns/blacklight/token_based_user.rb +1 -0
  96. data/app/controllers/search_history_controller.rb +1 -0
  97. data/app/helpers/blacklight/blacklight_helper_behavior.rb +12 -310
  98. data/app/helpers/blacklight/catalog_helper_behavior.rb +22 -137
  99. data/app/helpers/blacklight/component_helper_behavior.rb +2 -53
  100. data/app/helpers/blacklight/configuration_helper_behavior.rb +2 -117
  101. data/app/helpers/blacklight/facets_helper_behavior.rb +4 -321
  102. data/app/helpers/blacklight/icon_helper_behavior.rb +5 -4
  103. data/app/helpers/blacklight/layout_helper_behavior.rb +1 -0
  104. data/app/helpers/blacklight/render_partials_helper_behavior.rb +11 -31
  105. data/app/helpers/blacklight/url_helper_behavior.rb +13 -97
  106. data/app/helpers/blacklight_helper.rb +1 -0
  107. data/app/helpers/catalog_helper.rb +1 -0
  108. data/app/javascript/blacklight/bookmark_toggle.js +13 -19
  109. data/app/javascript/blacklight/button_focus.js +12 -10
  110. data/app/javascript/blacklight/checkbox_submit.js +68 -122
  111. data/app/javascript/blacklight/core.js +6 -5
  112. data/app/javascript/blacklight/index.js +13 -0
  113. data/app/javascript/blacklight/modal.js +99 -164
  114. data/app/javascript/blacklight/modalForm.js +60 -0
  115. data/app/javascript/blacklight/search_context.js +45 -55
  116. data/app/models/blacklight/facet_paginator.rb +3 -2
  117. data/app/models/blacklight/icon.rb +4 -2
  118. data/app/models/bookmark.rb +0 -2
  119. data/app/models/concerns/blacklight/configurable.rb +5 -4
  120. data/app/models/concerns/blacklight/document/active_model_shim.rb +1 -0
  121. data/app/models/concerns/blacklight/document/cache_key.rb +1 -0
  122. data/app/models/concerns/blacklight/document/dublin_core.rb +2 -1
  123. data/app/models/concerns/blacklight/document/email.rb +1 -0
  124. data/app/models/concerns/blacklight/document/export.rb +2 -1
  125. data/app/models/concerns/blacklight/document/extensions.rb +1 -0
  126. data/app/models/concerns/blacklight/document/schema_org.rb +1 -0
  127. data/app/models/concerns/blacklight/document/semantic_fields.rb +1 -0
  128. data/app/models/concerns/blacklight/document/sms.rb +1 -0
  129. data/app/models/concerns/blacklight/suggest/response.rb +1 -0
  130. data/app/models/concerns/blacklight/user.rb +17 -8
  131. data/app/models/record_mailer.rb +13 -12
  132. data/app/models/search.rb +0 -1
  133. data/app/models/solr_document.rb +1 -0
  134. data/app/presenters/blacklight/clause_presenter.rb +1 -1
  135. data/app/presenters/blacklight/document_presenter.rb +13 -21
  136. data/app/presenters/blacklight/facet_field_presenter.rb +39 -14
  137. data/app/presenters/blacklight/facet_grouped_item_presenter.rb +1 -5
  138. data/app/presenters/blacklight/facet_item_pivot_presenter.rb +60 -0
  139. data/app/presenters/blacklight/facet_item_presenter.rb +3 -9
  140. data/app/presenters/blacklight/field_presenter.rb +1 -0
  141. data/app/presenters/blacklight/index_presenter.rb +2 -40
  142. data/app/presenters/blacklight/json_presenter.rb +7 -5
  143. data/app/presenters/blacklight/rendering/link_to_facet.rb +2 -5
  144. data/app/presenters/blacklight/show_presenter.rb +1 -9
  145. data/app/presenters/blacklight/thumbnail_presenter.rb +1 -1
  146. data/app/services/blacklight/bookmarks_search_builder.rb +22 -0
  147. data/app/services/blacklight/field_retriever.rb +1 -8
  148. data/app/services/blacklight/search_service.rb +8 -7
  149. data/app/values/blacklight/types.rb +0 -4
  150. data/app/views/bookmarks/_clear_bookmarks_widget.html.erb +8 -1
  151. data/app/views/bookmarks/_tools.html.erb +7 -12
  152. data/app/views/catalog/_advanced_search_form.html.erb +0 -1
  153. data/app/views/catalog/_bookmark_control.html.erb +1 -1
  154. data/app/views/catalog/_constraints.html.erb +1 -14
  155. data/app/views/catalog/_document.atom.builder +12 -14
  156. data/app/views/catalog/_document.html.erb +5 -3
  157. data/app/views/catalog/_document.rss.builder +2 -4
  158. data/app/views/catalog/_facet_layout.html.erb +2 -2
  159. data/app/views/catalog/_facets.html.erb +5 -4
  160. data/app/views/catalog/_home_text.html.erb +2 -14
  161. data/app/views/catalog/_search_form.html.erb +2 -2
  162. data/app/views/catalog/_search_header.html.erb +1 -2
  163. data/app/views/catalog/_search_results.html.erb +2 -2
  164. data/app/views/catalog/_search_sidebar.html.erb +5 -1
  165. data/app/views/catalog/_show_main_content.html.erb +11 -16
  166. data/app/views/catalog/_show_sidebar.html.erb +2 -2
  167. data/app/views/catalog/_show_tools.html.erb +8 -14
  168. data/app/views/catalog/_view_type_group.html.erb +1 -1
  169. data/app/views/catalog/email_success.html.erb +5 -6
  170. data/app/views/catalog/facet.html.erb +7 -5
  171. data/app/views/catalog/index.atom.builder +12 -14
  172. data/app/views/catalog/index.html.erb +4 -1
  173. data/app/views/catalog/index.json.jbuilder +19 -19
  174. data/app/views/catalog/index.rss.builder +1 -1
  175. data/app/views/catalog/opensearch.xml.builder +1 -1
  176. data/app/views/catalog/sms_success.html.erb +5 -6
  177. data/app/views/catalog/suggest.html.erb +3 -0
  178. data/app/views/layouts/blacklight/base.html.erb +13 -2
  179. data/app/views/search_history/index.html.erb +6 -2
  180. data/app/views/shared/_modal.html.erb +3 -3
  181. data/blacklight.gemspec +8 -9
  182. data/config/importmap.rb +3 -0
  183. data/config/locales/blacklight.ar.yml +0 -1
  184. data/config/locales/blacklight.ca.yml +0 -1
  185. data/config/locales/blacklight.de.yml +0 -1
  186. data/config/locales/blacklight.en.yml +0 -2
  187. data/config/locales/blacklight.es.yml +0 -1
  188. data/config/locales/blacklight.fr.yml +0 -1
  189. data/config/locales/blacklight.hu.yml +0 -1
  190. data/config/locales/blacklight.it.yml +0 -1
  191. data/config/locales/blacklight.nl.yml +0 -1
  192. data/config/locales/blacklight.pt-BR.yml +0 -1
  193. data/config/locales/blacklight.sq.yml +0 -1
  194. data/config/locales/blacklight.zh.yml +0 -1
  195. data/config/routes.rb +3 -2
  196. data/db/migrate/20140202020201_create_searches.rb +1 -0
  197. data/db/migrate/20140202020202_create_bookmarks.rb +1 -0
  198. data/db/migrate/20140320000000_add_polymorphic_type_to_bookmarks.rb +1 -0
  199. data/docker-compose.yml +0 -1
  200. data/lib/blacklight/abstract_repository.rb +1 -0
  201. data/lib/blacklight/configuration/context.rb +4 -4
  202. data/lib/blacklight/configuration/display_field.rb +7 -9
  203. data/lib/blacklight/configuration/facet_field.rb +17 -11
  204. data/lib/blacklight/configuration/field.rb +1 -0
  205. data/lib/blacklight/configuration/fields.rb +12 -15
  206. data/lib/blacklight/configuration/index_field.rb +1 -0
  207. data/lib/blacklight/configuration/null_display_field.rb +17 -0
  208. data/lib/blacklight/configuration/search_field.rb +1 -0
  209. data/lib/blacklight/configuration/show_field.rb +1 -0
  210. data/lib/blacklight/configuration/sort_field.rb +1 -0
  211. data/lib/blacklight/configuration/tool_config.rb +1 -0
  212. data/lib/blacklight/configuration/view_config.rb +16 -6
  213. data/lib/blacklight/configuration.rb +294 -358
  214. data/lib/blacklight/engine.rb +8 -13
  215. data/lib/blacklight/exceptions.rb +2 -2
  216. data/lib/blacklight/nested_open_struct_with_hash_access.rb +6 -12
  217. data/lib/blacklight/open_struct_with_hash_access.rb +19 -17
  218. data/lib/blacklight/parameters.rb +7 -21
  219. data/lib/blacklight/routes/exportable.rb +1 -0
  220. data/lib/blacklight/routes/searchable.rb +2 -1
  221. data/lib/blacklight/routes.rb +1 -0
  222. data/lib/blacklight/search_builder.rb +10 -10
  223. data/lib/blacklight/search_state/filter_field.rb +8 -25
  224. data/lib/blacklight/search_state/pivot_filter_field.rb +144 -0
  225. data/lib/blacklight/search_state.rb +23 -79
  226. data/lib/blacklight/solr/document.rb +1 -0
  227. data/lib/blacklight/solr/facet_paginator.rb +1 -0
  228. data/lib/blacklight/solr/repository.rb +3 -14
  229. data/lib/blacklight/solr/request.rb +1 -0
  230. data/lib/blacklight/solr/response/facets.rb +21 -5
  231. data/lib/blacklight/solr/response/group.rb +1 -0
  232. data/lib/blacklight/solr/response/group_response.rb +1 -0
  233. data/lib/blacklight/solr/response/more_like_this.rb +1 -0
  234. data/lib/blacklight/solr/response/pagination_methods.rb +4 -3
  235. data/lib/blacklight/solr/response/params.rb +5 -4
  236. data/lib/blacklight/solr/response/response.rb +1 -0
  237. data/lib/blacklight/solr/response/spelling.rb +1 -0
  238. data/lib/blacklight/solr/response.rb +4 -3
  239. data/lib/blacklight/solr/search_builder_behavior.rb +17 -34
  240. data/lib/blacklight/solr.rb +1 -0
  241. data/lib/blacklight/version.rb +1 -0
  242. data/lib/blacklight.rb +7 -10
  243. data/lib/generators/blacklight/assets/importmap_generator.rb +55 -0
  244. data/lib/generators/blacklight/assets/propshaft_generator.rb +25 -0
  245. data/lib/generators/blacklight/assets/sprockets_generator.rb +66 -0
  246. data/lib/generators/blacklight/assets_generator.rb +13 -89
  247. data/lib/generators/blacklight/controller_generator.rb +3 -2
  248. data/lib/generators/blacklight/document_generator.rb +1 -0
  249. data/lib/generators/blacklight/install_generator.rb +4 -3
  250. data/lib/generators/blacklight/models_generator.rb +1 -0
  251. data/lib/generators/blacklight/search_builder_generator.rb +1 -0
  252. data/lib/generators/blacklight/solr_generator.rb +1 -1
  253. data/lib/generators/blacklight/templates/catalog_controller.rb +34 -8
  254. data/lib/generators/blacklight/templates/solr/conf/solrconfig.xml +0 -69
  255. data/lib/generators/blacklight/test_support_generator.rb +4 -2
  256. data/lib/generators/blacklight/user_generator.rb +7 -9
  257. data/lib/railties/blacklight.rake +6 -7
  258. data/package.json +10 -13
  259. data/rollup.config.js +27 -0
  260. data/spec/components/blacklight/constraints_component_spec.rb +17 -13
  261. data/spec/components/blacklight/document_component_spec.rb +23 -82
  262. data/spec/components/blacklight/facet_component_spec.rb +2 -7
  263. data/spec/components/blacklight/facet_field_checkboxes_component_spec.rb +1 -2
  264. data/spec/components/blacklight/facet_field_list_component_spec.rb +7 -6
  265. data/spec/components/blacklight/facet_item_pivot_component_spec.rb +10 -9
  266. data/spec/components/blacklight/response/view_type_component_spec.rb +66 -0
  267. data/spec/components/blacklight/search_bar_component_spec.rb +1 -1
  268. data/spec/components/blacklight/search_context_component_spec.rb +40 -0
  269. data/spec/controllers/blacklight/catalog/component_configuration_spec.rb +1 -6
  270. data/spec/controllers/blacklight/{base_spec.rb → catalog_spec.rb} +2 -2
  271. data/spec/controllers/bookmarks_controller_spec.rb +2 -3
  272. data/spec/controllers/catalog_controller_spec.rb +13 -135
  273. data/spec/features/advanced_search_spec.rb +0 -56
  274. data/spec/features/autocomplete_spec.rb +1 -1
  275. data/spec/features/axe_spec.rb +1 -6
  276. data/spec/features/bookmarks_spec.rb +1 -1
  277. data/spec/features/facets_spec.rb +1 -1
  278. data/spec/features/search_context_spec.rb +4 -10
  279. data/spec/features/search_results_spec.rb +0 -33
  280. data/spec/features/sitelinks_search_box.rb +13 -0
  281. data/spec/helpers/blacklight/configuration_helper_behavior_spec.rb +2 -138
  282. data/spec/helpers/blacklight/facets_helper_behavior_spec.rb +0 -387
  283. data/spec/helpers/blacklight/icon_helper_behavior_spec.rb +8 -0
  284. data/spec/helpers/blacklight/render_partials_helper_behavior_spec.rb +5 -7
  285. data/spec/helpers/blacklight/url_helper_behavior_spec.rb +9 -131
  286. data/spec/helpers/blacklight_helper_spec.rb +3 -242
  287. data/spec/helpers/catalog_helper_spec.rb +7 -118
  288. data/spec/i18n_spec.rb +1 -0
  289. data/spec/integration/generators/blacklight/solr_generator_spec.rb +1 -1
  290. data/spec/lib/blacklight/configuration/facet_field_spec.rb +27 -16
  291. data/spec/lib/blacklight/configuration/field_spec.rb +1 -1
  292. data/spec/lib/blacklight/configuration/view_config_spec.rb +1 -1
  293. data/spec/lib/blacklight/open_struct_with_hash_access_spec.rb +2 -2
  294. data/spec/lib/blacklight/parameters_spec.rb +1 -4
  295. data/spec/lib/blacklight/search_state/filter_field_spec.rb +4 -4
  296. data/spec/lib/blacklight/search_state/pivot_filter_field_spec.rb +117 -0
  297. data/spec/lib/blacklight/search_state_spec.rb +80 -198
  298. data/spec/lib/tasks/blacklight_task_spec.rb +1 -0
  299. data/spec/models/blacklight/configuration_spec.rb +17 -51
  300. data/spec/models/blacklight/document/active_model_shim_spec.rb +2 -2
  301. data/spec/models/blacklight/icon_spec.rb +31 -15
  302. data/spec/models/blacklight/search_builder_spec.rb +9 -9
  303. data/spec/models/blacklight/solr/document_spec.rb +3 -3
  304. data/spec/models/blacklight/solr/repository_spec.rb +0 -27
  305. data/spec/models/blacklight/solr/response/facets_spec.rb +27 -27
  306. data/spec/models/blacklight/solr/response/group_response_spec.rb +1 -0
  307. data/spec/models/blacklight/solr/response/group_spec.rb +1 -0
  308. data/spec/models/blacklight/solr/response_spec.rb +9 -2
  309. data/spec/models/blacklight/solr/search_builder_spec.rb +24 -31
  310. data/spec/models/blacklight/user_spec.rb +22 -0
  311. data/spec/presenters/blacklight/clause_presenter_spec.rb +1 -0
  312. data/spec/presenters/blacklight/document_presenter_spec.rb +2 -2
  313. data/spec/presenters/blacklight/facet_field_presenter_spec.rb +85 -12
  314. data/spec/presenters/blacklight/facet_grouped_item_presenter_spec.rb +1 -0
  315. data/spec/presenters/blacklight/facet_item_presenter_spec.rb +14 -13
  316. data/spec/presenters/blacklight/field_presenter_spec.rb +0 -14
  317. data/spec/presenters/blacklight/index_presenter_spec.rb +2 -4
  318. data/spec/presenters/blacklight/json_presenter_spec.rb +1 -0
  319. data/spec/presenters/blacklight/link_alternate_presenter_spec.rb +3 -2
  320. data/spec/presenters/blacklight/show_presenter_spec.rb +20 -29
  321. data/spec/presenters/thumbnail_presenter_spec.rb +1 -1
  322. data/spec/requests/load_suggestions_spec.rb +16 -0
  323. data/spec/routing/catalog_routing_spec.rb +2 -1
  324. data/spec/services/blacklight/search_service_spec.rb +31 -68
  325. data/spec/spec_helper.rb +6 -4
  326. data/spec/support/controller_level_helpers.rb +1 -2
  327. data/spec/support/features/search_helpers.rb +39 -0
  328. data/spec/support/features/session_helpers.rb +1 -0
  329. data/spec/support/features.rb +3 -0
  330. data/spec/support/view_component_capybara_test_helpers.rb +8 -0
  331. data/spec/test_app_templates/lib/generators/test_app_generator.rb +9 -2
  332. data/spec/views/catalog/_document.html.erb_spec.rb +3 -34
  333. data/spec/views/catalog/_facet_index_navigation.html.erb_spec.rb +1 -1
  334. data/spec/views/catalog/_search_header.erb_spec.rb +1 -0
  335. data/spec/views/catalog/_show_sidebar.erb_spec.rb +1 -0
  336. data/spec/views/catalog/_show_tools.html.erb_spec.rb +5 -66
  337. data/spec/views/catalog/_view_type_group.html.erb_spec.rb +17 -9
  338. data/spec/views/catalog/email_success.html.erb_spec.rb +2 -2
  339. data/spec/views/catalog/facet.html.erb_spec.rb +6 -3
  340. data/spec/views/catalog/index.atom.builder_spec.rb +18 -11
  341. data/spec/views/catalog/index.html.erb_spec.rb +5 -6
  342. data/spec/views/catalog/index.json.jbuilder_spec.rb +2 -2
  343. data/spec/views/catalog/show.html.erb_spec.rb +3 -25
  344. data/spec/views/catalog/sms_success.html.erb_spec.rb +2 -2
  345. data/tasks/blacklight.rake +6 -4
  346. metadata +79 -126
  347. data/.babelrc +0 -11
  348. data/app/assets/images/blacklight/list.svg +0 -1
  349. data/app/assets/images/blacklight/search.svg +0 -1
  350. data/app/assets/stylesheets/blacklight/_twitter_typeahead.scss +0 -37
  351. data/app/components/blacklight/content_areas_shim.rb +0 -13
  352. data/app/controllers/concerns/blacklight/base.rb +0 -12
  353. data/app/controllers/concerns/blacklight/default_component_configuration.rb +0 -64
  354. data/app/controllers/concerns/blacklight/facet.rb +0 -69
  355. data/app/controllers/concerns/blacklight/search_fields.rb +0 -46
  356. data/app/helpers/blacklight/hash_as_hidden_fields_helper_behavior.rb +0 -27
  357. data/app/helpers/blacklight/render_constraints_helper_behavior.rb +0 -188
  358. data/app/helpers/blacklight/search_history_constraints_helper_behavior.rb +0 -97
  359. data/app/helpers/blacklight/suggest_helper_behavior.rb +0 -13
  360. data/app/javascript/blacklight/autocomplete.js +0 -36
  361. data/app/javascript/blacklight/facet_load.js +0 -22
  362. data/app/presenters/blacklight/search_bar_presenter.rb +0 -47
  363. data/app/views/catalog/_constraints_element.html.erb +0 -14
  364. data/app/views/catalog/_document_action.html.erb +0 -5
  365. data/app/views/catalog/_facet_group.html.erb +0 -5
  366. data/app/views/catalog/_facet_limit.html.erb +0 -3
  367. data/app/views/catalog/_index.html.erb +0 -1
  368. data/app/views/catalog/_index_header.html.erb +0 -22
  369. data/app/views/catalog/_previous_next_doc.html.erb +0 -2
  370. data/app/views/catalog/_show.html.erb +0 -6
  371. data/app/views/catalog/_show_header.html.erb +0 -2
  372. data/app/views/catalog/_thumbnail.html.erb +0 -1
  373. data/lib/blacklight/deprecations/engine_configuration.rb +0 -66
  374. data/lib/blacklight/deprecations/search_state_normalization.rb +0 -52
  375. data/spec/components/blacklight/header_component_spec.rb +0 -20
  376. data/spec/controllers/blacklight/facet_spec.rb +0 -33
  377. data/spec/controllers/blacklight/search_fields_spec.rb +0 -62
  378. data/spec/features/sitelinks_search_box_spec.rb +0 -13
  379. data/spec/helpers/blacklight/hash_as_hidden_fields_behavior_spec.rb +0 -26
  380. data/spec/helpers/blacklight/render_constraints_helper_behavior_spec.rb +0 -92
  381. data/spec/helpers/blacklight/search_history_constraints_helper_behavior_spec.rb +0 -101
  382. data/spec/helpers/blacklight/suggest_helper_behavior_spec.rb +0 -48
  383. data/spec/lib/blacklight/engine_spec.rb +0 -41
  384. data/spec/presenters/blacklight/search_bar_presenter_spec.rb +0 -94
  385. data/spec/support/view_component_test_helpers.rb +0 -35
  386. data/spec/views/catalog/_constraints.html.erb_spec.rb +0 -33
  387. data/spec/views/catalog/_facet_group.html.erb_spec.rb +0 -84
  388. data/spec/views/catalog/_facets.html.erb_spec.rb +0 -15
  389. data/spec/views/catalog/_index.html.erb_spec.rb +0 -62
  390. data/spec/views/catalog/_index_header.html.erb_spec.rb +0 -35
  391. data/spec/views/catalog/_previous_next_doc.html.erb_spec.rb +0 -22
  392. data/spec/views/catalog/_show.html.erb_spec.rb +0 -62
  393. data/spec/views/catalog/_thumbnail.html.erb_spec.rb +0 -38
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blacklight.js","sources":["../../../javascript/blacklight/core.js","../../../javascript/blacklight/checkbox_submit.js","../../../javascript/blacklight/bookmark_toggle.js","../../../javascript/blacklight/button_focus.js","../../../javascript/blacklight/modal.js","../../../javascript/blacklight/search_context.js","../../../javascript/blacklight/index.js"],"sourcesContent":["const Blacklight = function() {\n const buffer = new Array;\n return {\n onLoad: function(func) {\n buffer.push(func);\n },\n\n activate: function() {\n for(let i = 0; i < buffer.length; i++) {\n buffer[i].call();\n }\n },\n\n listeners: function () {\n const listeners = [];\n if (typeof Turbo !== 'undefined') {\n listeners.push('turbo:load', 'turbo:frame-load');\n } else if (typeof Turbolinks !== 'undefined' && Turbolinks.supported) {\n // Turbolinks 5\n if (Turbolinks.BrowserAdapter) {\n listeners.push('turbolinks:load');\n } else {\n // Turbolinks < 5\n listeners.push('page:load', 'DOMContentLoaded');\n }\n } else {\n listeners.push('DOMContentLoaded');\n }\n\n return listeners;\n }\n };\n}();\n\n// turbolinks triggers page:load events on page transition\n// If app isn't using turbolinks, this event will never be triggered, no prob.\nBlacklight.listeners().forEach(function(listener) {\n document.addEventListener(listener, function() {\n Blacklight.activate()\n })\n})\n\nBlacklight.onLoad(function () {\n const elem = document.querySelector('.no-js');\n\n // The \"no-js\" class may already have been removed because this function is\n // run on every turbo:load event, in that case, it won't find an element.\n if (!elem) return;\n\n elem.classList.remove('no-js')\n elem.classList.add('js')\n})\n\n\nexport default Blacklight\n","/* Converts a \"toggle\" form, with single submit button to add/remove\n something, like used for Bookmarks, into an AJAXy checkbox instead.\n Apply to a form. Does require certain assumption about the form:\n 1) The same form 'action' href must be used for both ADD and REMOVE\n actions, with the different being the hidden input name=\"_method\"\n being set to \"put\" or \"delete\" -- that's the Rails method to pretend\n to be doing a certain HTTP verb. So same URL, PUT to add, DELETE\n to remove. This plugin assumes that.\n Plus, the form this is applied to should provide a data-doc-id\n attribute (HTML5-style doc-*) that contains the id/primary key\n of the object in question -- used by plugin for a unique value for\n DOM id's.\n Uses HTML for a checkbox compatible with Bootstrap 4.\n new CheckboxSubmit(document.querySelector('form.something')).render()\n*/\nexport default class CheckboxSubmit {\n constructor(form) {\n this.form = form\n }\n\n async clicked(evt) {\n this.spanTarget.innerHTML = this.form.getAttribute('data-inprogress')\n this.labelTarget.setAttribute('disabled', 'disabled');\n this.checkboxTarget.setAttribute('disabled', 'disabled');\n const response = await fetch(this.formTarget.getAttribute('action'), {\n body: new FormData(this.formTarget),\n method: this.formTarget.getAttribute('method').toUpperCase(),\n headers: {\n 'Accept': 'application/json',\n 'X-Requested-With': 'XMLHttpRequest',\n 'X-CSRF-Token': document.querySelector('meta[name=csrf-token]')?.content\n }\n })\n this.labelTarget.removeAttribute('disabled')\n this.checkboxTarget.removeAttribute('disabled')\n if (response.ok) {\n const json = await response.json()\n this.updateStateFor(!this.checked)\n document.querySelector('[data-role=bookmark-counter]').innerHTML = json.bookmarks.count\n } else {\n alert('Error')\n }\n }\n\n get checked() {\n return (this.form.querySelectorAll('input[name=_method][value=delete]').length != 0)\n }\n\n get formTarget() {\n return this.form\n }\n\n get labelTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"label\"]')\n }\n\n get checkboxTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"checkbox\"]')\n }\n\n get spanTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"span\"]')\n }\n\n updateStateFor(state) {\n this.checkboxTarget.checked = state\n\n if (state) {\n this.labelTarget.classList.add('checked')\n //Set the Rails hidden field that fakes an HTTP verb\n //properly for current state action.\n this.formTarget.querySelector('input[name=_method]').value = 'delete'\n this.spanTarget.innerHTML = this.form.getAttribute('data-present')\n } else {\n this.labelTarget.classList.remove('checked')\n this.formTarget.querySelector('input[name=_method]').value = 'put'\n this.spanTarget.innerHTML = this.form.getAttribute('data-absent')\n }\n }\n}\n","import Blacklight from './core'\nimport CheckboxSubmit from './checkbox_submit'\n\nconst BookmarkToggle = (() => {\n // change form submit toggle to checkbox\n Blacklight.doBookmarkToggleBehavior = function() {\n document.addEventListener('click', (e) => {\n if (e.target.matches('[data-checkboxsubmit-target=\"checkbox\"]')) {\n const form = e.target.closest('form')\n if (form) new CheckboxSubmit(form).clicked(e);\n }\n });\n };\n Blacklight.doBookmarkToggleBehavior.selector = 'form.bookmark-toggle';\n\n Blacklight.doBookmarkToggleBehavior();\n})()\n\nexport default BookmarkToggle\n","const ButtonFocus = (() => {\n document.addEventListener('click', (e) => {\n // Button clicks should change focus. As of 10/3/19, Firefox for Mac and\n // Safari both do not set focus to a button on button click.\n // See https://zellwk.com/blog/inconsistent-button-behavior/ for background information\n if (e.target.matches('[data-toggle=\"collapse\"]') || e.target.matches('[data-bs-toggle=\"collapse\"]')) {\n e.target.focus()\n }\n })\n})()\n\nexport default ButtonFocus\n","/*\n The blacklight modal plugin can display some interactions inside a Bootstrap\n modal window, including some multi-page interactions.\n\n It supports unobtrusive Javascript, where a link or form that would have caused\n a new page load is changed to display it's results inside a modal dialog,\n by this plugin. The plugin assumes there is a Bootstrap modal div\n on the page with id #blacklight-modal to use as the modal -- the standard Blacklight\n layout provides this.\n\n To make a link or form have their results display inside a modal, add\n `data-blacklight-modal=\"trigger\"` to the link or form. (Note, form itself not submit input)\n With Rails link_to helper, you'd do that like:\n\n link_to something, link, data: { blacklight_modal: \"trigger\" }\n\n The results of the link href or form submit will be displayed inside\n a modal -- they should include the proper HTML markup for a bootstrap modal's\n contents. Also, you ordinarily won't want the Rails template with wrapping\n navigational elements to be used. The Rails controller could suppress\n the layout when a JS AJAX request is detected, OR the response\n can include a `<div data-blacklight-modal=\"container\">` -- only the contents\n of the container will be placed inside the modal, the rest of the\n page will be ignored.\n\n Link or forms inside the modal will ordinarily cause page loads\n when they are triggered. However, if you'd like their results\n to stay within the modal, just add `data-blacklight-modal=\"preserve\"`\n to the link or form.\n\n Here's an example of what might be returned, demonstrating most of the devices available:\n\n <div data-blacklight-modal=\"container\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">×</button>\n <h3 class=\"modal-title\">Request Placed</h3>\n </div>\n\n <div class=\"modal-body\">\n <p>Some message</p>\n <%= link_to \"This result will still be within modal\", some_link, data: { blacklight_modal: \"preserve\" } %>\n </div>\n\n\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Close</button>\n </div>\n </div>\n\n\n One additional feature. If the content returned from the AJAX form submission\n can be a turbo-stream that defines some HTML fragementsand where on the page to put them:\n https://turbo.hotwired.dev/handbook/streams\n*/\nimport Blacklight from './core'\nimport ModalForm from './modalForm'\n\nconst Modal = (() => {\n // We keep all our data in Blacklight.modal object.\n // Create lazily if someone else created first.\n if (Blacklight.modal === undefined) {\n Blacklight.modal = {};\n }\n\n const modal = Blacklight.modal\n\n // a Bootstrap modal div that should be already on the page hidden\n modal.modalSelector = '#blacklight-modal';\n\n // Trigger selectors identify forms or hyperlinks that should open\n // inside a modal dialog.\n modal.triggerLinkSelector = 'a[data-blacklight-modal~=trigger]';\n\n // preserve selectors identify forms or hyperlinks that, if activated already\n // inside a modal dialog, should have destinations remain inside the modal -- but\n // won't trigger a modal if not already in one.\n //\n // No need to repeat selectors from trigger selectors, those will already\n // be preserved. MUST be manually prefixed with the modal selector,\n // so they only apply to things inside a modal.\n modal.preserveLinkSelector = modal.modalSelector + ' a[data-blacklight-modal~=preserve]';\n\n modal.containerSelector = '[data-blacklight-modal~=container]';\n\n // Called on fatal failure of ajax load, function returns content\n // to show to user in modal. Right now called only for extreme\n // network errors.\n modal.onFailure = function (jqXHR, textStatus, errorThrown) {\n console.error('Server error:', this.url, jqXHR.status, errorThrown);\n\n const contents = `<div class=\"modal-header\">\n <div class=\"modal-title\">There was a problem with your request.</div>\n <button type=\"button\" class=\"blacklight-modal-close btn-close close\" data-dismiss=\"modal\" data-bs-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <p>Expected a successful response from the server, but got an error</p>\n <pre>${this.type} ${this.url}\\n${jqXHR.status}: ${errorThrown}</pre>\n </div>`\n\n document.querySelector(`${modal.modalSelector} .modal-content`).innerHTML = contents\n\n modal.show();\n }\n\n // Add the passed in contents to the modal and display it.\nmodal.receiveAjax = function (contents) {\n const domparser = new DOMParser();\n const dom = domparser.parseFromString(contents, \"text/html\")\n const elements = dom.querySelectorAll(`${modal.containerSelector} > *`)\n document.querySelector(`${modal.modalSelector} .modal-content`).replaceChildren(...elements)\n\n modal.show();\n };\n\n\n modal.modalAjaxLinkClick = function(e) {\n e.preventDefault();\n const href = e.target.getAttribute('href')\n fetch(href)\n .then(response => {\n if (!response.ok) {\n throw new TypeError(\"Request failed\");\n }\n return response.text();\n })\n .then(data => modal.receiveAjax(data))\n .catch(error => modal.onFailure(error))\n };\n\n modal.setupModal = function() {\n // Register both trigger and preserve selectors in ONE event handler, combining\n // into one selector with a comma, so if something matches BOTH selectors, it\n // still only gets the event handler called once.\n document.addEventListener('click', (e) => {\n if (e.target.matches(`${modal.triggerLinkSelector}, ${modal.preserveLinkSelector}`))\n modal.modalAjaxLinkClick(e)\n else if (e.target.matches('[data-bl-dismiss=\"modal\"]'))\n modal.hide()\n })\n };\n\n modal.hide = function (el) {\n const dom = document.querySelector(Blacklight.modal.modalSelector)\n\n if (!dom.open) return\n dom.close()\n }\n\n modal.show = function(el) {\n const dom = document.querySelector(Blacklight.modal.modalSelector)\n\n if (dom.open) return\n dom.showModal()\n }\n\n modal.setupModal()\n})()\n\nexport default Modal\n","import Blacklight from './core'\n\nconst SearchContext = (() => {\n Blacklight.doSearchContextBehavior = function() {\n document.addEventListener('click', (e) => {\n if (e.target.matches('[data-context-href]')) {\n Blacklight.handleSearchContextMethod.call(e.target, e)\n }\n })\n };\n\n Blacklight.csrfToken = () => document.querySelector('meta[name=csrf-token]')?.content\n Blacklight.csrfParam = () => document.querySelector('meta[name=csrf-param]')?.content\n\n // this is the Rails.handleMethod with a couple adjustments, described inline:\n // first, we're attaching this directly to the event handler, so we can check for meta-keys\n Blacklight.handleSearchContextMethod = function(event) {\n const link = this\n\n // instead of using the normal href, we need to use the context href instead\n let href = link.getAttribute('data-context-href')\n let target = link.getAttribute('target')\n let csrfToken = Blacklight.csrfToken()\n let csrfParam = Blacklight.csrfParam()\n let form = document.createElement('form')\n form.method = 'post'\n form.action = href\n\n\n let formContent = `<input name=\"_method\" value=\"post\" type=\"hidden\" />\n <input name=\"redirect\" value=\"${link.getAttribute('href')}\" type=\"hidden\" />`\n\n // check for meta keys.. if set, we should open in a new tab\n if(event.metaKey || event.ctrlKey) {\n target = '_blank';\n }\n\n if (csrfParam !== undefined && csrfToken !== undefined) {\n formContent += `<input name=\"${csrfParam}\" value=\"${csrfToken}\" type=\"hidden\" />`\n }\n\n // Must trigger submit by click on a button, else \"submit\" event handler won't work!\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit\n formContent += '<input type=\"submit\" />'\n\n if (target) { form.setAttribute('target', target); }\n\n form.style.display = 'none'\n form.innerHTML = formContent\n document.body.appendChild(form)\n form.querySelector('[type=\"submit\"]').click()\n\n event.preventDefault()\n };\n\n Blacklight.doSearchContextBehavior();\n})()\n\nexport default SearchContext\n","import BookmarkToggle from './bookmark_toggle'\nimport ButtonFocus from './button_focus'\nimport Modal from './modal'\nimport SearchContext from './search_context'\nimport Core from './core'\n\nexport default {\n BookmarkToggle,\n ButtonFocus,\n Modal,\n SearchContext,\n onLoad: Core.onLoad\n}\n"],"names":["Core"],"mappings":";;;;;;EAAA,MAAM,UAAU,GAAG,WAAW;EAC9B,EAAE,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC;EAC3B,EAAE,OAAO;EACT,IAAI,MAAM,EAAE,SAAS,IAAI,EAAE;EAC3B,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;EACxB,KAAK;AACL;EACA,IAAI,QAAQ,EAAE,WAAW;EACzB,MAAM,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;EAC7C,QAAQ,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;EACzB,OAAO;EACP,KAAK;AACL;EACA,IAAI,SAAS,EAAE,YAAY;EAC3B,MAAM,MAAM,SAAS,GAAG,EAAE,CAAC;EAC3B,MAAM,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;EACxC,QAAQ,SAAS,CAAC,IAAI,CAAC,YA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ACxD;EACA,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,OAAM;EAC/B,IAAI,IAAI,CAAC,SAAS,GAAG,YAAW;EAChC,IAAI,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAC;EACnC,IAAI,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,KAAK,GAAE;AACjD;EACA,IAAI,KAAK,CAAC,cAAc,GAAE;EAC1B,GAAG,CAAC;AACJ;EACA,EAAE,UAAU,CAAC,uBAAuB,EAAE,CAAC;EACvC,CAAC;;AClDD,gBAAe;EACf,EAAE,cAAc;EAChB,EAAE,WAAW;EACb,EAAE,KAAK;EACP,EAAE,aAAa;EACf,EAAE,MAAM,EAAEA,UAAI,CAAC,MAAM;EACrB;;;;;;;;"}
@@ -0,0 +1,25 @@
1
+ auto-complete [aria-selected="true"],
2
+ auto-complete [role="option"]:hover {
3
+ background-color: $dropdown-link-hover-bg;
4
+ }
5
+ auto-complete {
6
+ position: relative;
7
+ flex-grow: 3;
8
+
9
+ ul {
10
+ list-style-type: none;
11
+ position: absolute;
12
+ background-color: $dropdown-bg;
13
+ padding-left: 0;
14
+ border: 1px solid $dropdown-border-color;
15
+ border-radius: $dropdown-border-radius;
16
+ }
17
+
18
+ [role="option"]{
19
+ padding: 0.25rem 1.5rem;
20
+ }
21
+ }
22
+
23
+ .no-js #autocomplete-popup {
24
+ display: none;
25
+ }
@@ -22,5 +22,5 @@
22
22
  @import "facets";
23
23
  @import "search_history";
24
24
  @import "modal";
25
- @import "twitter_typeahead";
26
25
  @import "icons";
26
+ @import "autocomplete";
@@ -2,3 +2,19 @@ label.toggle-bookmark {
2
2
  font-weight: inherit;
3
3
  min-width: 8.5em;
4
4
  }
5
+
6
+ .bookmark-toggle {
7
+ .no-js & {
8
+ input[type="submit"] {
9
+ display: inline
10
+ }
11
+
12
+ div.toggle-bookmark {
13
+ display: none
14
+ }
15
+ }
16
+
17
+ input[type="submit"] {
18
+ display: none;
19
+ }
20
+ }
@@ -29,3 +29,11 @@
29
29
  .page-link {
30
30
  white-space: nowrap;
31
31
  }
32
+
33
+ .modal {
34
+ // override bootstrap .modal class default display: none
35
+ // since we aren't using bootstrap JS that sets and unsets the display
36
+ display: block;
37
+ background: none;
38
+ border: none;
39
+ }
@@ -82,32 +82,42 @@
82
82
  }
83
83
 
84
84
  .facet-limit-active {
85
- @extend .border-success;
85
+ border-color: $facet-active-border !important;
86
86
 
87
87
  .card-header {
88
- @extend .bg-success;
88
+ background-color: $facet-active-bg !important;
89
89
 
90
90
  .btn {
91
91
  @if function-exists(color-contrast) {
92
- color: color-contrast($success);
92
+ color: color-contrast($facet-active-bg);
93
+ }
94
+
95
+ @if function-exists(color-yiq) {
96
+ color: color-yiq($facet-active-bg);
93
97
  }
94
98
  }
95
99
  }
96
100
  }
97
101
 
98
102
  .facet-values {
99
- display: table;
100
- table-layout: fixed;
101
- width: 100%;
102
103
  margin-bottom: 0;
103
104
 
105
+ a {
106
+ text-decoration: none;
107
+ }
108
+
104
109
  li {
110
+ display: flex;
111
+ align-items: flex-start;
112
+ padding: 3px 0;
105
113
 
106
- display: table-row;
107
- .selected {
108
- @extend .text-success;
114
+ &[role="treeitem"] {
115
+ display: block;
109
116
  }
110
117
 
118
+ .selected {
119
+ color: $facet-active-item-color !important;
120
+ }
111
121
  }
112
122
 
113
123
  .remove {
@@ -130,44 +140,28 @@
130
140
  }
131
141
 
132
142
  .facet-label {
133
- display: table-cell;
134
143
  padding-right: 1em;
135
144
  text-indent: -15px;
136
145
  padding-left: 15px;
137
- padding-bottom: $spacer * .5;
138
146
  @include hyphens-auto;
139
147
  }
140
148
 
141
149
  .facet-count {
142
- display: table-cell;
143
- vertical-align: top;
144
- text-align: right;
145
- width: 5em;
150
+ margin-left: auto
146
151
  }
147
152
 
148
153
  .facet-checkbox {
149
- display: table-cell;
150
154
  width: 1.25rem;
151
- vertical-align: top;
152
- }
153
-
154
- .label-and-count {
155
- display: table;
156
- width: 100%;
157
- }
158
-
159
- .label-and-count label {
160
- display: table-row;
161
155
  }
162
156
  }
163
157
 
164
158
  .facet-extended-list {
165
159
  .sort-options {
166
- text-align:right;
160
+ text-align: right;
167
161
  }
168
162
 
169
163
  .prev-next-links {
170
- float:left;
164
+ float: left;
171
165
  }
172
166
  }
173
167
 
@@ -191,32 +185,66 @@
191
185
  }
192
186
  }
193
187
 
194
-
195
-
196
188
  /* style for pivot facet's nested list */
197
189
 
198
- .pivot-facet {
190
+ .facet-values {
199
191
  @extend .list-unstyled;
200
- @extend .py-1;
201
- @extend .px-4;
202
192
  }
203
193
 
204
- .facet-leaf-node {
205
- margin-left: 1rem;
206
- padding-right: 1rem;
207
- margin-top: -1.5rem;
194
+ .pivot-facet {
195
+ &.show {
196
+ @extend .d-flex;
197
+ }
208
198
  }
209
199
 
200
+ $facet-toggle-show-icon: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-plus-square" viewBox="0 0 16 16"><path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z" /><path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4z" /></svg>') !default;
201
+ $facet-toggle-hide-icon: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-dash-square" viewBox="0 0 16 16"><path d="M14 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z" /><path d="M4 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 4 8z" /></svg>') !default;
202
+ $facet-toggle-width: 1em !default;
203
+ $facet-toggle-height: $facet-toggle-width !default;
204
+
210
205
  .facet-toggle-handle {
211
- margin: 0;
212
- margin-left: -5px;
213
- padding: 0;
206
+ @extend .my-0;
207
+ @extend .py-0;
208
+ @extend .px-2;
209
+
210
+ // keep the icon span centered in the button, but shift to the left for equal spacing inside row
211
+ margin-left: -1 * $btn-padding-x;
212
+
213
+ .pivot-facet & {
214
+ // shift pivot values a little more aggressively for better compact display
215
+ margin-left: -2 * $btn-padding-x;
216
+ }
214
217
 
215
218
  &.collapsed {
216
- .show { display: block; }
217
- .hide { display: none; }
219
+ .show {
220
+ display: flex;
221
+ }
222
+
223
+ .hide {
224
+ display: none;
225
+ }
218
226
  }
219
227
 
220
- .show { display: none; }
221
- .hide { display: block; }
228
+ .show {
229
+ display: none;
230
+ }
231
+
232
+ .hide {
233
+ display: flex;
234
+ }
235
+
236
+ .show .icon,
237
+ .hide .icon {
238
+ width: $facet-toggle-width;
239
+ height: $facet-toggle-height;
240
+ padding: $btn-padding-y $btn-padding-x;
241
+ }
242
+
243
+ .show .icon {
244
+ background: transparent escape-svg($facet-toggle-show-icon) center / $facet-toggle-width auto no-repeat;
245
+ }
246
+
247
+ .hide .icon {
248
+ background: transparent escape-svg($facet-toggle-hide-icon) center / $facet-toggle-width auto no-repeat;
249
+ }
222
250
  }
@@ -14,10 +14,7 @@
14
14
  background: transparent $logo-image no-repeat top left;
15
15
  background-size: $logo-width $logo-height;
16
16
  }
17
- display: inline-block;
18
17
  height: $logo-height;
19
- margin-right: 20px;
20
- margin-top: -0.4rem;
21
18
  overflow: hidden;
22
19
  text-indent: 100%;
23
20
  white-space: nowrap;
@@ -37,18 +34,6 @@
37
34
  @extend .col-lg-8;
38
35
  padding-left: 0;
39
36
  }
40
-
41
- .submit-search-text {
42
- // hide 'search' label at very small screens
43
- @media screen and (max-width: breakpoint-max(xs)) {
44
- @if mixin-exists(sr-only) {
45
- @include sr-only();
46
- }
47
- @if mixin-exists(visually-hidden) {
48
- @include visually-hidden();
49
- }
50
- }
51
- }
52
37
  }
53
38
 
54
39
  #skip-link {
@@ -1,17 +1,3 @@
1
- @each $color, $value in $theme-colors {
2
- .btn-#{$color} {
3
- .blacklight-icons svg {
4
- fill: currentColor;
5
- }
6
- }
7
-
8
- .btn-outline-#{$color} {
9
- .blacklight-icons svg {
10
- fill: currentColor;
11
- }
12
- }
13
- }
14
-
15
1
  .btn.btn-icon {
16
2
  padding: $btn-padding-y;
17
3
 
@@ -13,3 +13,23 @@
13
13
  fill: #fff;
14
14
  }
15
15
  }
16
+
17
+ // define a visually-hidden class that applies to a given breakpoint and below
18
+ // https://getbootstrap.com/docs/5.2/helpers/visually-hidden/
19
+ @if mixin-exists(visually-hidden) {
20
+ @each $infix, $breakpoint in $grid-breakpoints {
21
+ .visually-hidden-#{$infix} {
22
+ @include media-breakpoint-down($breakpoint) {
23
+ @include visually-hidden;
24
+ }
25
+ }
26
+ }
27
+ } @else if mixin-exists(sr-only) { // Bootstrap 4 version
28
+ @each $infix, $breakpoint in $grid-breakpoints {
29
+ .visually-hidden-#{$infix} {
30
+ @include media-breakpoint-down($breakpoint) {
31
+ @include sr-only;
32
+ }
33
+ }
34
+ }
35
+ }
@@ -1,6 +1,8 @@
1
- .modal-content {
2
- @extend .clearfix;
1
+ .modal-dialog {
2
+ border-radius: 5px;
3
+ }
3
4
 
5
+ .modal-content {
4
6
  .facet-pagination.top {
5
7
  display: none;
6
8
  }
@@ -12,6 +14,10 @@
12
14
  .blacklight-modal-close {
13
15
  display: block;
14
16
  }
17
+
18
+ .prev_next_links.btn-group .btn {
19
+ border: 0;
20
+ }
15
21
  }
16
22
 
17
23
  // app/views/catalog/facet.html.erb may be rendered as a modal or a whole page.
@@ -1,7 +1,34 @@
1
1
  // bootstrap does flex-grow: 1 by default which makes the
2
2
  // text input roughly the same size as the select in many cases
3
- .input-group > .form-control {
4
- &.search-q {
5
- flex-grow: 3;
3
+ .input-group>.search-q {
4
+ flex-grow: 4;
5
+ }
6
+
7
+ .input-group > .search-autocomplete-wrapper {
8
+ @extend .form-control;
9
+ display: inline-block;
10
+ flex-grow: 4;
11
+ padding: 0;
12
+ position: relative;
13
+
14
+ .search-q {
15
+ border: 0;
16
+ height: 100%;
17
+ width: 100%;
18
+ }
19
+
20
+ ul {
21
+ @extend .dropdown-menu;
22
+ display: block;
23
+
24
+ li {
25
+ @extend .dropdown-item;
26
+ }
6
27
  }
7
28
  }
29
+
30
+ .search-btn {
31
+ border-top-left-radius: 0;
32
+ border-bottom-left-radius: 0;
33
+ display: flex;
34
+ }
@@ -1,7 +1,16 @@
1
1
  /* Search History */
2
2
  .search-history {
3
+
4
+ td {
5
+ padding: $spacer
6
+ }
7
+
8
+ .constraints-container {
9
+ @extend .mb-0;
10
+ }
11
+
3
12
  .constraint {
4
- @extend .px-3;
13
+ @extend .px-4;
5
14
  display: block;
6
15
  text-indent: -1 * map-get($spacers, 3);
7
16
  }
@@ -1,7 +1,7 @@
1
1
  // the search results on the index view of the catalog
2
2
  .documents-list {
3
3
  .document {
4
- @extend .clearfix;
4
+ display: flex;
5
5
  border-bottom: 1px dotted $table-border-color;
6
6
  margin-top: $spacer;
7
7
  padding-top: $spacer;
@@ -10,6 +10,10 @@
10
10
  @extend h5;
11
11
  }
12
12
 
13
+ .document-main-section {
14
+ flex-grow: 1;
15
+ }
16
+
13
17
  // bookmarks checkbox on index, give it some
14
18
  // lower margin when it collapses
15
19
  .index-document-functions {
@@ -21,7 +25,7 @@
21
25
  }
22
26
 
23
27
  .document-thumbnail {
24
- float: right;
28
+ flex-grow: 0;
25
29
  margin-bottom: ($spacer * 3);
26
30
  padding-left: ($spacer * 3);
27
31
  }
@@ -6,9 +6,12 @@ $logo-height: 50px !default;
6
6
 
7
7
  /* label (field names) */
8
8
  $field_name_color: $text-muted !default;
9
- $zindex-typeahead: $zindex-dropdown;
10
9
 
11
10
  // the default bootstrap font-family list includes "Segoe UI Emoji", which, on windows
12
11
  // renders our remove icon as an emoji-sized x instead of what we see on all other platforms...
13
12
  // so, for now (until we replace it with an SVG icon or something), we get to override bootstrap:
14
13
  $remove-icon-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif !default;
14
+
15
+ $facet-active-border: $success !default;
16
+ $facet-active-bg: $success !default;
17
+ $facet-active-item-color: $success !default;
@@ -27,19 +27,28 @@ module Blacklight
27
27
  validator = opts.fetch(:validator, nil).inspect
28
28
  klass.class_eval <<EORUBY, __FILE__, __LINE__ + 1
29
29
  def #{name}
30
- @response, @documents = action_documents
30
+ @documents = action_documents
31
31
 
32
- if request.post? && #{callback} &&
33
- (#{validator}.blank? || send(#{validator}))
32
+ if request.post? && #{callback}
33
+ if #{validator}.blank? || send(#{validator})
34
34
 
35
- send(#{callback}, @documents)
35
+ send(#{callback}, @documents)
36
36
 
37
- flash.now[:success] ||= I18n.t("blacklight.#{name}.success", default: nil)
37
+ flash[:success] ||= I18n.t("blacklight.#{name}.success", default: nil)
38
38
 
39
- respond_to do |format|
40
- format.html do
41
- return render "#{name}_success" if request.xhr?
42
- redirect_to action_success_redirect_path
39
+ respond_to do |format|
40
+ format.html do
41
+ return render "#{name}_success", layout: false if request.xhr?
42
+ redirect_to action_success_redirect_path
43
+ end
44
+ end
45
+ else
46
+ # Not valid
47
+ respond_to do |format|
48
+ format.html do
49
+ return render layout: false, status: :unprocessable_entity if request.xhr?
50
+ # Otherwise draw the full page
51
+ end
43
52
  end
44
53
  end
45
54
  else
@@ -8,7 +8,7 @@
8
8
  <% end %>
9
9
 
10
10
  <%= form_tag @url, method: @method, class: @classes.join(' '), role: 'search', 'aria-label' => t('blacklight.search.form.submit') do %>
11
- <%= render_hash_as_hidden_fields(@params) %>
11
+ <%= render Blacklight::HiddenSearchStateComponent.new(params: @params) %>
12
12
 
13
13
  <div class="input-criteria">
14
14
  <div class="query-criteria mb-4">
@@ -40,7 +40,7 @@
40
40
 
41
41
  <% if sort_fields_select %>
42
42
  <div class="form-group row mb-4">
43
- <%= content_tag :h2, t('blacklight.advanced_search.form.sort_label'), id: 'advanced-search-sort-label', class: 'col-md-3 col-form-label text-md-right' %>
43
+ <%= content_tag :h2, t('blacklight.advanced_search.form.sort_label'), class: 'col-md-3 col-form-label text-md-right' %>
44
44
  <div class="col">
45
45
  <%= sort_fields_select %>
46
46
  </div>
@@ -2,13 +2,11 @@
2
2
 
3
3
  module Blacklight
4
4
  class AdvancedSearchFormComponent < SearchBarComponent
5
- include Blacklight::ContentAreasShim
6
-
7
5
  renders_many :constraints
8
6
  renders_many :search_field_controls
9
7
  renders_many :search_filter_controls, (lambda do |config:, display_facet:, presenter: nil, component: nil, **kwargs|
10
- presenter ||= (config.presenter || Blacklight::FacetFieldPresenter).new(config, display_facet, helpers)
11
- component = component || config.advanced_search_component || Blacklight::FacetFieldCheckboxesComponent
8
+ presenter ||= config.presenter.new(config, display_facet, helpers)
9
+ component ||= config.advanced_search_component
12
10
 
13
11
  component.new(facet_field: presenter, **kwargs)
14
12
  end)
@@ -26,23 +24,23 @@ module Blacklight
26
24
 
27
25
  def default_operator_menu
28
26
  options_with_labels = [:must, :should].index_by { |op| t(op, scope: 'blacklight.advanced_search.op') }
29
- label_tag(:op, t('blacklight.advanced_search.op.label'), class: 'sr-only visually-hidden') + select_tag(:op, options_for_select(options_with_labels, params[:op]), class: 'input-small')
27
+ select_tag(:op, options_for_select(options_with_labels, params[:op]), class: 'input-small')
30
28
  end
31
29
 
32
30
  def sort_fields_select
33
31
  options = sort_fields.values.map { |field_config| [helpers.sort_field_label(field_config.key), field_config.key] }
34
32
  return unless options.any?
35
33
 
36
- select_tag(:sort, options_for_select(options, params[:sort]), class: "form-control sort-select w-auto", aria: { labelledby: 'advanced-search-sort-label' })
34
+ select_tag(:sort, options_for_select(options, params[:sort]), class: "form-select custom-select sort-select w-auto")
37
35
  end
38
36
 
39
37
  private
40
38
 
41
39
  def initialize_search_field_controls
42
40
  search_fields.values.each.with_index do |field, i|
43
- with_search_field_control do
41
+ search_field_control do
44
42
  fields_for('clause[]', i, include_id: false) do |f|
45
- content_tag(:div, class: 'form-group advanced-search-field row') do
43
+ content_tag(:div, class: 'form-group advanced-search-field row mb-3') do
46
44
  f.label(:query, field.display_label('search'), class: "col-sm-3 col-form-label text-md-right") +
47
45
  content_tag(:div, class: 'col-sm-9') do
48
46
  f.hidden_field(:field, value: field.key) +
@@ -59,7 +57,7 @@ module Blacklight
59
57
 
60
58
  fields.each do |_k, config|
61
59
  display_facet = @response.aggregations[config.field]
62
- with_search_filter_control(config: config, display_facet: display_facet)
60
+ search_filter_control(config: config, display_facet: display_facet)
63
61
  end
64
62
  end
65
63
 
@@ -72,7 +70,7 @@ module Blacklight
72
70
 
73
71
  return if constraints_text.blank?
74
72
 
75
- with_constraint do
73
+ constraint do
76
74
  constraints_text
77
75
  end
78
76
  end