ui_bibz 3.0.12 → 4.0.0.beta3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (295) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +3 -3
  3. data/.github/workflows/linter.yml +13 -12
  4. data/.overcommit.yml +6 -0
  5. data/.rubocop.yml +6 -0
  6. data/.ruby-version +1 -1
  7. data/Gemfile +19 -12
  8. data/Gemfile.lock +178 -138
  9. data/app/assets/config/ui_bibz.js +12 -0
  10. data/app/assets/javascripts/forms/formula.js +82 -0
  11. data/app/assets/javascripts/forms/input-connected.js +132 -0
  12. data/app/assets/javascripts/forms/jquery.multi-select-extend.js +52 -0
  13. data/app/assets/javascripts/forms.js +160 -0
  14. data/app/assets/javascripts/interfaces.js +56 -0
  15. data/app/assets/javascripts/tables.js +49 -0
  16. data/app/assets/javascripts/ui_bibz_js.js +37 -0
  17. data/app/assets/stylesheets/navigations/_nav.sass +2 -0
  18. data/app/assets/stylesheets/navigations/_navbar.sass +12 -0
  19. data/app/assets/stylesheets/navigations/_progress_bar.sass +2 -0
  20. data/app/assets/stylesheets/navigations/_toolbar.sass +3 -0
  21. data/app/assets/stylesheets/sass/_boxes.sass +1 -0
  22. data/app/assets/stylesheets/sass/_containers.sass +2 -0
  23. data/app/assets/stylesheets/sass/_fixes.sass +2 -0
  24. data/app/assets/stylesheets/sass/_forms.sass +8 -0
  25. data/app/assets/stylesheets/sass/_navigations.sass +4 -0
  26. data/app/assets/stylesheets/sass/_notifications.sass +4 -0
  27. data/app/assets/stylesheets/sass/_tables.sass +2 -0
  28. data/app/assets/stylesheets/sass/_variables_mixins_functions.sass +3 -0
  29. data/app/assets/stylesheets/sass/boxes/_card.sass +4 -0
  30. data/app/assets/stylesheets/sass/containers/_panel.scss +330 -0
  31. data/app/assets/stylesheets/sass/forms/_bootstrap_select.sass +5 -0
  32. data/app/assets/stylesheets/sass/forms/_button.sass +3 -0
  33. data/app/assets/stylesheets/sass/forms/_date_picker.sass +3 -0
  34. data/app/assets/stylesheets/sass/forms/_form_check.sass +10 -0
  35. data/app/assets/stylesheets/sass/forms/_formula_field.sass +17 -0
  36. data/app/assets/stylesheets/sass/forms/_multiselect.sass +44 -0
  37. data/app/assets/stylesheets/sass/forms/_range.sass +44 -0
  38. data/app/assets/stylesheets/sass/forms/_slider.sass +136 -0
  39. data/app/assets/stylesheets/sass/forms/_surround_field.sass +25 -0
  40. data/app/assets/stylesheets/sass/notifications/_badge.sass +5 -0
  41. data/app/assets/stylesheets/sass/notifications/_glyph.sass +3 -0
  42. data/app/assets/stylesheets/sass/notifications/_star.sass +2 -0
  43. data/app/assets/stylesheets/sass/notifications/_toast.sass +3 -0
  44. data/app/assets/stylesheets/sass/tables/_table.sass +39 -0
  45. data/app/assets/stylesheets/sass/tables/_table_card.sass +39 -0
  46. data/app/assets/stylesheets/ui_bibz.sass +26 -0
  47. data/bin/test +3 -5
  48. data/config/importmap.rb +19 -0
  49. data/config/initializers/assets.rb +5 -0
  50. data/config/initializers/will_paginate.rb +1 -3
  51. data/lib/ui_bibz/builders/data_html_options_builder.rb +118 -0
  52. data/lib/ui_bibz/builders/html_classes_builder.rb +89 -0
  53. data/lib/ui_bibz/builders/html_options_builder.rb +22 -0
  54. data/lib/ui_bibz/concerns/models/searchable.rb +1 -1
  55. data/lib/ui_bibz/factory_methods/component_initialize_factory_method.rb +33 -0
  56. data/lib/ui_bibz/helpers/ui/core/boxes_helper.rb +12 -12
  57. data/lib/ui_bibz/helpers/ui/core/forms_helper.rb +50 -50
  58. data/lib/ui_bibz/helpers/ui/core/icons_helper.rb +6 -6
  59. data/lib/ui_bibz/helpers/ui/core/layouts_helper.rb +2 -2
  60. data/lib/ui_bibz/helpers/ui/core/lists_helper.rb +2 -2
  61. data/lib/ui_bibz/helpers/ui/core/navigations_helper.rb +12 -12
  62. data/lib/ui_bibz/helpers/ui/core/notifications_helper.rb +4 -4
  63. data/lib/ui_bibz/helpers/ui/core/windows_helper.rb +10 -2
  64. data/lib/ui_bibz/helpers/ui/ux_helper.rb +2 -2
  65. data/lib/ui_bibz/helpers/utils_helper.rb +2 -2
  66. data/lib/ui_bibz/infos.rb +3 -3
  67. data/lib/ui_bibz/inputs/ui_bibz_form/ui_bibz_form_builder.rb +12 -12
  68. data/lib/ui_bibz/inputs/ui_bibz_inputs/collection_input.rb +1 -1
  69. data/lib/ui_bibz/rails/engine.rb +21 -4
  70. data/lib/ui_bibz/strategies/component_initialize_abstract_strategy.rb +27 -0
  71. data/lib/ui_bibz/strategies/component_initialize_block_strategy.rb +31 -0
  72. data/lib/ui_bibz/strategies/component_initialize_hash_strategy.rb +18 -0
  73. data/lib/ui_bibz/strategies/component_initialize_standard_strategy.rb +18 -0
  74. data/lib/ui_bibz/ui/concerns/card_itemable_concern.rb +4 -4
  75. data/lib/ui_bibz/ui/concerns/notification_concern.rb +1 -1
  76. data/lib/ui_bibz/ui/core/boxes/card.rb +1 -1
  77. data/lib/ui_bibz/ui/core/boxes/card_accordion.rb +4 -4
  78. data/lib/ui_bibz/ui/core/boxes/card_column.rb +1 -1
  79. data/lib/ui_bibz/ui/core/boxes/card_deck.rb +1 -1
  80. data/lib/ui_bibz/ui/core/boxes/card_grid.rb +0 -3
  81. data/lib/ui_bibz/ui/core/boxes/card_group.rb +1 -1
  82. data/lib/ui_bibz/ui/core/boxes/components/card_body.rb +9 -9
  83. data/lib/ui_bibz/ui/core/boxes/components/card_col.rb +2 -2
  84. data/lib/ui_bibz/ui/core/boxes/components/card_list_group.rb +1 -1
  85. data/lib/ui_bibz/ui/core/boxes/components/card_row.rb +1 -1
  86. data/lib/ui_bibz/ui/core/component.rb +13 -62
  87. data/lib/ui_bibz/ui/core/forms/buttons/button.rb +3 -1
  88. data/lib/ui_bibz/ui/core/forms/buttons/button_group.rb +11 -11
  89. data/lib/ui_bibz/ui/core/forms/choices/box_switch_field.rb +7 -7
  90. data/lib/ui_bibz/ui/core/forms/choices/checkbox_field.rb +2 -2
  91. data/lib/ui_bibz/ui/core/forms/choices/choice_group.rb +5 -6
  92. data/lib/ui_bibz/ui/core/forms/choices/components/choice.rb +1 -1
  93. data/lib/ui_bibz/ui/core/forms/dates/date_picker_field.rb +15 -15
  94. data/lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_link.rb +1 -1
  95. data/lib/ui_bibz/ui/core/forms/dropdowns/dropdown.rb +5 -5
  96. data/lib/ui_bibz/ui/core/forms/numbers/slider_field.rb +1 -1
  97. data/lib/ui_bibz/ui/core/forms/selects/dropdown_select_field.rb +10 -10
  98. data/lib/ui_bibz/ui/core/forms/selects/multi_column_field.rb +2 -2
  99. data/lib/ui_bibz/ui/core/forms/surrounds/surround_field.rb +32 -32
  100. data/lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb +7 -8
  101. data/lib/ui_bibz/ui/core/icons/components/glyph_text.rb +1 -1
  102. data/lib/ui_bibz/ui/core/icons/glyph.rb +4 -3
  103. data/lib/ui_bibz/ui/core/layouts/row.rb +2 -2
  104. data/lib/ui_bibz/ui/core/lists/components/list.rb +4 -4
  105. data/lib/ui_bibz/ui/core/lists/list_group.rb +1 -1
  106. data/lib/ui_bibz/ui/core/navigations/breadcrumb.rb +6 -4
  107. data/lib/ui_bibz/ui/core/navigations/components/nav_link_span.rb +1 -2
  108. data/lib/ui_bibz/ui/core/navigations/components/navbar_form.rb +6 -5
  109. data/lib/ui_bibz/ui/core/navigations/components/toolbar_form.rb +2 -2
  110. data/lib/ui_bibz/ui/core/navigations/nav.rb +10 -6
  111. data/lib/ui_bibz/ui/core/navigations/navbar.rb +21 -19
  112. data/lib/ui_bibz/ui/core/navigations/pagination.rb +3 -3
  113. data/lib/ui_bibz/ui/core/navigations/toolbar.rb +5 -5
  114. data/lib/ui_bibz/ui/core/notifications/alert.rb +4 -5
  115. data/lib/ui_bibz/ui/core/notifications/badge.rb +6 -2
  116. data/lib/ui_bibz/ui/core/notifications/components/toast_header.rb +1 -1
  117. data/lib/ui_bibz/ui/core/notifications/progress_bar.rb +3 -3
  118. data/lib/ui_bibz/ui/core/notifications/toast.rb +8 -9
  119. data/lib/ui_bibz/ui/core/windows/components/offcanvas_body.rb +47 -0
  120. data/lib/ui_bibz/ui/core/windows/components/offcanvas_header.rb +54 -0
  121. data/lib/ui_bibz/ui/core/windows/modal.rb +9 -9
  122. data/lib/ui_bibz/ui/core/windows/offcanvas.rb +84 -0
  123. data/lib/ui_bibz/ui/extensions/core/component/glyph_extension.rb +4 -20
  124. data/lib/ui_bibz/ui/extensions/core/component/klass_extension.rb +11 -19
  125. data/lib/ui_bibz/ui/extensions/core/forms/connect_extension.rb +1 -1
  126. data/lib/ui_bibz/ui/ux/containers/components/panel_column.rb +3 -3
  127. data/lib/ui_bibz/ui/ux/containers/components/panel_deck.rb +3 -3
  128. data/lib/ui_bibz/ui/ux/containers/components/panel_group.rb +3 -3
  129. data/lib/ui_bibz/ui/ux/containers/components/panel_header.rb +4 -4
  130. data/lib/ui_bibz/ui/ux/containers/panel.rb +13 -13
  131. data/lib/ui_bibz/ui/ux/tables/components/actions.rb +4 -4
  132. data/lib/ui_bibz/ui/ux/tables/components/column.rb +1 -1
  133. data/lib/ui_bibz/ui/ux/tables/components/columns.rb +2 -2
  134. data/lib/ui_bibz/ui/ux/tables/extensions/sortable.rb +1 -1
  135. data/lib/ui_bibz/ui/ux/tables/table.rb +5 -5
  136. data/lib/ui_bibz/ui/ux/tables/table_card.rb +6 -6
  137. data/lib/ui_bibz/ui/ux/tables/table_search_field.rb +1 -1
  138. data/lib/ui_bibz/utils/breakdown_class_name_generator.rb +3 -3
  139. data/lib/ui_bibz/utils/screwdriver.rb +1 -1
  140. data/lib/ui_bibz/view_objects/glyph_component_view_object.rb +38 -0
  141. data/lib/ui_bibz.rb +25 -0
  142. data/test/builders/data_html_classes_builder_test.rb +37 -0
  143. data/test/builders/html_classes_builder_test.rb +76 -0
  144. data/test/dummy/Rakefile +1 -1
  145. data/test/dummy/app/assets/stylesheets/application.css +1 -15
  146. data/test/dummy/app/channels/application_cable/channel.rb +6 -0
  147. data/test/dummy/app/channels/application_cable/connection.rb +6 -0
  148. data/test/dummy/app/jobs/application_job.rb +9 -0
  149. data/test/dummy/app/mailers/application_mailer.rb +6 -0
  150. data/test/dummy/app/views/layouts/application.html.erb +10 -12
  151. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  152. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  153. data/test/dummy/bin/rails +3 -3
  154. data/test/dummy/bin/rake +2 -2
  155. data/test/dummy/bin/setup +12 -12
  156. data/test/dummy/config/application.rb +13 -17
  157. data/test/dummy/config/boot.rb +3 -3
  158. data/test/dummy/config/database.yml +2 -2
  159. data/test/dummy/config/environment.rb +1 -1
  160. data/test/dummy/config/environments/development.rb +21 -16
  161. data/test/dummy/config/environments/production.rb +16 -41
  162. data/test/dummy/config/environments/test.rb +19 -8
  163. data/test/dummy/config/importmap.rb +11 -0
  164. data/test/dummy/config/initializers/content_security_policy.rb +21 -24
  165. data/test/dummy/config/initializers/filter_parameter_logging.rb +6 -2
  166. data/test/dummy/config/initializers/inflections.rb +4 -4
  167. data/test/dummy/config/initializers/permissions_policy.rb +12 -0
  168. data/test/dummy/config/locales/en.yml +13 -3
  169. data/test/dummy/config/puma.rb +7 -2
  170. data/test/dummy/config/storage.yml +5 -5
  171. data/test/dummy/config.ru +2 -1
  172. data/test/simple_form_test.rb +24 -24
  173. data/test/ui/core/boxes/card_test.rb +2 -1
  174. data/test/ui/core/component_test.rb +2 -2
  175. data/test/ui/core/forms/buttons/button_group_test.rb +1 -1
  176. data/test/ui/core/forms/buttons/button_link_test.rb +1 -1
  177. data/test/ui/core/forms/buttons/button_refresh_test.rb +1 -1
  178. data/test/ui/core/forms/buttons/button_test.rb +2 -2
  179. data/test/ui/core/forms/choices/box_switch_field_test.rb +10 -10
  180. data/test/ui/core/forms/choices/checkbox_field_test.rb +1 -1
  181. data/test/ui/core/forms/choices/choice_group_test.rb +1 -1
  182. data/test/ui/core/forms/dropdowns/dropdown_test.rb +1 -1
  183. data/test/ui/core/forms/numbers/formula_field_test.rb +1 -1
  184. data/test/ui/core/forms/selects/dropdown_select_field_test.rb +2 -2
  185. data/test/ui/core/forms/selects/select_field_test.rb +1 -1
  186. data/test/ui/core/forms/surrounds/surround_field_test.rb +4 -4
  187. data/test/ui/core/forms/texts/auto_complete_field_test.rb +2 -2
  188. data/test/ui/core/icons/glyph_test.rb +8 -4
  189. data/test/ui/core/icons/star_test.rb +12 -6
  190. data/test/ui/core/navigations/breadcrumb_test.rb +1 -1
  191. data/test/ui/core/navigations/link_test.rb +1 -1
  192. data/test/ui/core/navigations/nav_test.rb +11 -0
  193. data/test/ui/core/notifications/alert_test.rb +1 -1
  194. data/test/ui/core/notifications/badge_test.rb +3 -3
  195. data/test/ui/core/notifications/popover_test.rb +4 -4
  196. data/test/ui/core/notifications/spinner_test.rb +1 -1
  197. data/test/ui/core/notifications/toast_test.rb +1 -1
  198. data/test/ui/core/notifications/tooltip_test.rb +4 -4
  199. data/test/ui/core/windows/offcanvas_test.rb +27 -0
  200. data/test/ui/ux/containers/panel_test.rb +1 -1
  201. data/test/ui/ux/tables/table_test.rb +3 -3
  202. data/test/view_objects/glyph_component_view_object_test.rb +17 -0
  203. data/ui_bibz.gemspec +6 -20
  204. data/vendor/assets/fonts/fontawesome/fa-brands-400.ttf +0 -0
  205. data/vendor/assets/fonts/fontawesome/fa-brands-400.woff2 +0 -0
  206. data/vendor/assets/fonts/fontawesome/fa-regular-400.ttf +0 -0
  207. data/vendor/assets/fonts/fontawesome/fa-regular-400.woff2 +0 -0
  208. data/vendor/assets/fonts/fontawesome/fa-solid-900.ttf +0 -0
  209. data/vendor/assets/fonts/fontawesome/fa-solid-900.woff2 +0 -0
  210. data/vendor/assets/fonts/fontawesome/fa-v4compatibility.ttf +0 -0
  211. data/vendor/assets/fonts/fontawesome/fa-v4compatibility.woff2 +0 -0
  212. data/vendor/assets/javascripts/bootstrap-markdown.js +1 -1555
  213. data/vendor/assets/javascripts/bootstrap-multiselect.min.js +40 -1176
  214. data/vendor/assets/javascripts/bootstrap-switch.min.js +9 -21
  215. data/vendor/assets/javascripts/bs-custom-file-input.min.js +0 -1
  216. data/vendor/assets/javascripts/fontawesome/all.js +5977 -0
  217. data/vendor/assets/javascripts/fontawesome/all.min.js +6 -0
  218. data/vendor/assets/javascripts/fontawesome/brands.js +749 -0
  219. data/vendor/assets/javascripts/fontawesome/brands.min.js +6 -0
  220. data/vendor/assets/javascripts/fontawesome/conflict-detection.js +1138 -0
  221. data/vendor/assets/javascripts/fontawesome/conflict-detection.min.js +6 -0
  222. data/vendor/assets/javascripts/fontawesome/fontawesome.js +3126 -0
  223. data/vendor/assets/javascripts/fontawesome/fontawesome.min.js +6 -0
  224. data/vendor/assets/javascripts/fontawesome/regular.js +445 -0
  225. data/vendor/assets/javascripts/fontawesome/regular.min.js +6 -0
  226. data/vendor/assets/javascripts/fontawesome/solid.js +1672 -0
  227. data/vendor/assets/javascripts/fontawesome/solid.min.js +6 -0
  228. data/vendor/assets/javascripts/fontawesome/v4-shims.js +225 -0
  229. data/vendor/assets/javascripts/fontawesome/v4-shims.min.js +6 -0
  230. data/vendor/assets/javascripts/fuzzysort.js +562 -0
  231. data/vendor/assets/javascripts/jquery-3.7.0.min.js +2 -0
  232. data/vendor/assets/javascripts/jquery.multi-select.min.js +725 -1
  233. data/vendor/assets/stylesheets/bootstrap-multiselect.sass +115 -0
  234. data/vendor/assets/stylesheets/bootstrap-switch.scss +211 -0
  235. data/vendor/assets/stylesheets/fontawesome/_animated.scss +142 -9
  236. data/vendor/assets/stylesheets/fontawesome/_bordered-pulled.scss +13 -13
  237. data/vendor/assets/stylesheets/fontawesome/_core.scss +28 -6
  238. data/vendor/assets/stylesheets/fontawesome/_fixed-width.scss +2 -1
  239. data/vendor/assets/stylesheets/fontawesome/_functions.scss +57 -0
  240. data/vendor/assets/stylesheets/fontawesome/_icons.scss +7 -1438
  241. data/vendor/assets/stylesheets/fontawesome/_list.scss +4 -4
  242. data/vendor/assets/stylesheets/fontawesome/_mixins.scss +53 -34
  243. data/vendor/assets/stylesheets/fontawesome/_rotated-flipped.scss +25 -18
  244. data/vendor/assets/stylesheets/fontawesome/_screen-reader.scss +12 -3
  245. data/vendor/assets/stylesheets/fontawesome/_shims.scss +640 -664
  246. data/vendor/assets/stylesheets/fontawesome/_sizing.scss +16 -0
  247. data/vendor/assets/stylesheets/fontawesome/_stacked.scss +5 -4
  248. data/vendor/assets/stylesheets/fontawesome/_variables.scss +4896 -1393
  249. data/vendor/assets/stylesheets/fontawesome/brands.scss +17 -10
  250. data/vendor/assets/stylesheets/fontawesome/fontawesome.scss +7 -2
  251. data/vendor/assets/stylesheets/fontawesome/regular.scss +13 -10
  252. data/vendor/assets/stylesheets/fontawesome/solid.scss +13 -11
  253. data/vendor/assets/stylesheets/fontawesome/v4-shims.scss +6 -1
  254. data/vendor/assets/stylesheets/multi-select.css +92 -0
  255. metadata +120 -348
  256. data/.gitlab-ci.yml +0 -17
  257. data/.travis.yml +0 -24
  258. data/lib/ui_bibz/ui/extensions/core/component/popover_extension.rb +0 -70
  259. data/structure.md +0 -68
  260. data/test/dummy/README.rdoc +0 -28
  261. data/test/dummy/app/assets/javascripts/application.js +0 -13
  262. data/test/dummy/app/javascripts/packs/index.js +0 -3
  263. data/test/dummy/config/initializers/application_controller_renderer.rb +0 -9
  264. data/test/dummy/config/initializers/assets.rb +0 -14
  265. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -8
  266. data/test/dummy/config/initializers/cookies_serializer.rb +0 -7
  267. data/test/dummy/config/initializers/mime_types.rb +0 -5
  268. data/test/dummy/config/initializers/session_store.rb +0 -5
  269. data/test/dummy/config/initializers/ui_bibz.rb +0 -5
  270. data/test/dummy/config/initializers/wrap_parameters.rb +0 -16
  271. data/test/dummy/config/secrets.yml +0 -22
  272. data/test/dummy/config/spring.rb +0 -8
  273. data/test/dummy/test/models/user_test.rb +0 -9
  274. data/vendor/assets/fonts/fa-brands-400.eot +0 -0
  275. data/vendor/assets/fonts/fa-brands-400.svg +0 -3570
  276. data/vendor/assets/fonts/fa-brands-400.ttf +0 -0
  277. data/vendor/assets/fonts/fa-brands-400.woff +0 -0
  278. data/vendor/assets/fonts/fa-brands-400.woff2 +0 -0
  279. data/vendor/assets/fonts/fa-regular-400.eot +0 -0
  280. data/vendor/assets/fonts/fa-regular-400.svg +0 -803
  281. data/vendor/assets/fonts/fa-regular-400.ttf +0 -0
  282. data/vendor/assets/fonts/fa-regular-400.woff +0 -0
  283. data/vendor/assets/fonts/fa-regular-400.woff2 +0 -0
  284. data/vendor/assets/fonts/fa-solid-900.eot +0 -0
  285. data/vendor/assets/fonts/fa-solid-900.svg +0 -4938
  286. data/vendor/assets/fonts/fa-solid-900.ttf +0 -0
  287. data/vendor/assets/fonts/fa-solid-900.woff +0 -0
  288. data/vendor/assets/fonts/fa-solid-900.woff2 +0 -0
  289. data/vendor/assets/javascripts/all.js +0 -4441
  290. data/vendor/assets/javascripts/all.min.js +0 -5
  291. data/vendor/assets/stylesheets/all.min.css +0 -5
  292. data/vendor/assets/stylesheets/fontawesome/_larger.scss +0 -23
  293. data/vendor/assets/stylesheets/svg-with-js.css +0 -5
  294. /data/{test/dummy/app/mailers/.keep → app/assets/stylesheets/sass/forms/_dropdown.sass} +0 -0
  295. /data/{test/dummy/app/views/users/index.html.erb → app/assets/stylesheets/sass/forms/_input_refresh_button.sass} +0 -0
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'test_helper'
4
+
5
+ class UiHelperTest < ActionView::TestCase
6
+ include UiBibz::Helpers::Ui::CoreHelper
7
+
8
+ test 'offcanvas' do
9
+ actual = ui_offcanvas position: :top do |m|
10
+ m.header 'My title'
11
+ m.body 'My body'
12
+ end
13
+ expected = "<div class=\"offcanvas offcanvas-top\" tabindex=\"-1\"><div class=\"offcanvas-header\"><h5 class=\"offcanvas-title\">My title</h5><button class=\"btn-close\" data-bs-dismiss=\"offcanvas\" aria-label=\"Close\"></button></div><div class=\"offcanvas-body\">My body</div></div>"
14
+
15
+ assert_equal expected, actual
16
+ end
17
+
18
+ test 'offcanvas options' do
19
+ actual = ui_offcanvas scrollable: true, backdrop: :static do |m|
20
+ m.header 'My title'
21
+ m.body 'My body'
22
+ end
23
+ expected = "<div data-bs-backdrop=\"static\" data-bs-scroll=\"true\" class=\"offcanvas offcanvas-start\" tabindex=\"-1\"><div class=\"offcanvas-header\"><h5 class=\"offcanvas-title\">My title</h5><button class=\"btn-close\" data-bs-dismiss=\"offcanvas\" aria-label=\"Close\"></button></div><div class=\"offcanvas-body\">My body</div></div>"
24
+
25
+ assert_equal expected, actual
26
+ end
27
+ end
@@ -35,7 +35,7 @@ class CardTest < ActionView::TestCase
35
35
  end
36
36
  p.footer 'Footer'
37
37
  end
38
- expected = "<div class=\"panel\"><div class=\"panel-header justify-content-between\"><div class=\"panel-title\">My header</div><div class=\"btn-group btn-group-sm\" role=\"group\"><button class=\"btn-outline-secondary btn btn-sm\"><i class=\"glyph fas fa-caret-up\"></i> <span class=\"visually-hidden\">Minimize</span></button><button class=\"btn-outline-secondary btn btn-sm\"><i class=\"glyph fas fa-cog\"></i> <span class=\"visually-hidden\">Options</span></button><button class=\"btn-outline-secondary btn btn-sm\"><i class=\"glyph fas fa-Close\"></i> <span class=\"visually-hidden\">Close</span></button></div></div><div class=\"btn-toolbar justify-content-between panel-toolbar\" role=\"toolbar\"><div role=\"group\" class=\"btn-group btn-group-sm me-2\"><button class=\"btn-secondary btn btn-sm\">Copy</button><button class=\"btn-secondary btn btn-sm\">Cut</button><button class=\"btn-secondary btn btn-sm\">Paste</button></div><div class=\"btn-group btn-group-sm\" role=\"group\"><button class=\"btn-secondary btn btn-sm\">Delete</button></div></div><div class=\"panel-body\">Body</div><div class=\"btn-toolbar panel-toolbar\" role=\"toolbar\"><div class=\"btn-group btn-group-sm\" role=\"group\"><button class=\"btn-success btn btn-sm\"><i class=\"glyph fas fa-plus-circle\"></i> <span class=\"visually-hidden\">Add</span></button><button class=\"btn-danger btn btn-sm\"><i class=\"glyph fas fa-minus-circle\"></i> <span class=\"visually-hidden\">Remove</span></button></div></div><div class=\"panel-footer\">Footer</div></div>"
38
+ expected = "<div class=\"panel\"><div class=\"panel-header justify-content-between\"><div class=\"panel-title\">My header</div><div class=\"btn-group btn-group-sm\" role=\"group\"><button class=\"btn-outline-secondary btn btn-sm\"><i class=\"glyph fa-solid fa-caret-up\"></i> <span class=\"visually-hidden\">Minimize</span></button><button class=\"btn-outline-secondary btn btn-sm\"><i class=\"glyph fa-solid fa-cog\"></i> <span class=\"visually-hidden\">Options</span></button><button class=\"btn-outline-secondary btn btn-sm\"><i class=\"glyph fa-solid fa-Close\"></i> <span class=\"visually-hidden\">Close</span></button></div></div><div class=\"btn-toolbar justify-content-between panel-toolbar\" role=\"toolbar\"><div role=\"group\" class=\"btn-group btn-group-sm me-2\"><button class=\"btn-secondary btn btn-sm\">Copy</button><button class=\"btn-secondary btn btn-sm\">Cut</button><button class=\"btn-secondary btn btn-sm\">Paste</button></div><div class=\"btn-group btn-group-sm\" role=\"group\"><button class=\"btn-secondary btn btn-sm\">Delete</button></div></div><div class=\"panel-body\">Body</div><div class=\"btn-toolbar panel-toolbar\" role=\"toolbar\"><div class=\"btn-group btn-group-sm\" role=\"group\"><button class=\"btn-success btn btn-sm\"><i class=\"glyph fa-solid fa-plus-circle\"></i> <span class=\"visually-hidden\">Add</span></button><button class=\"btn-danger btn btn-sm\"><i class=\"glyph fa-solid fa-minus-circle\"></i> <span class=\"visually-hidden\">Remove</span></button></div></div><div class=\"panel-footer\">Footer</div></div>"
39
39
 
40
40
  assert_equal expected, actual
41
41
  end
@@ -26,7 +26,7 @@ class TableTest < ActionView::TestCase
26
26
 
27
27
  test 'table search field' do
28
28
  actual = UiBibz::Ui::Ux::Tables::TableSearchField.new({ store: @users }).render
29
- expected = "<form class=\"form-table-search-field\" action=\"/users?direction=asc&amp;page=1&amp;per_page=2&amp;search=Name+fr&amp;sort=users.name_fr\" accept-charset=\"UTF-8\" method=\"get\"><div class=\"input-group input-group-sm table-search-field\"><span class=\"input-group-text\"><i class=\"glyph fas fa-search\"></i></span><input type=\"hidden\" name=\"sort\" value=\"users.name_fr\" /><input type=\"hidden\" name=\"direction\" value=\"asc\" /><input type=\"hidden\" name=\"per_page\" value=\"2\" /><input type=\"hidden\" name=\"page\" value=\"1\" /><input type=\"hidden\" name=\"only_path\" value=\"true\" /><input type=\"hidden\" name=\"store_id\" value=\"users\" /><input type=\"hidden\" name=\"link_type\" value=\"search\" /><input type=\"search\" value=\"Name fr\" name=\"search\" class=\"form-control\" placeholder=\"Search by Name fr and Name en...\" /><button type=\"button\" class=\"btn btn-secondary input-group-btn clear-search-btn\"><i class=\"glyph fas fa-times-circle\"></i> <span class=\"visually-hidden\">Clear Search</span></button></div></form>"
29
+ expected = "<form class=\"form-table-search-field\" action=\"/users?direction=asc&amp;page=1&amp;per_page=2&amp;search=Name+fr&amp;sort=users.name_fr\" accept-charset=\"UTF-8\" method=\"get\"><div class=\"input-group input-group-sm table-search-field\"><span class=\"input-group-text\"><i class=\"glyph fa-solid fa-search\"></i></span><input type=\"hidden\" name=\"sort\" value=\"users.name_fr\" /><input type=\"hidden\" name=\"direction\" value=\"asc\" /><input type=\"hidden\" name=\"per_page\" value=\"2\" /><input type=\"hidden\" name=\"page\" value=\"1\" /><input type=\"hidden\" name=\"only_path\" value=\"true\" /><input type=\"hidden\" name=\"store_id\" value=\"users\" /><input type=\"hidden\" name=\"link_type\" value=\"search\" /><input type=\"search\" value=\"Name fr\" name=\"search\" class=\"form-control\" placeholder=\"Search by Name fr and Name en...\" /><button type=\"button\" class=\"btn btn-secondary input-group-btn clear-search-btn\"><i class=\"glyph fa-solid fa-times-circle\"></i> <span class=\"visually-hidden\">Clear Search</span></button></div></form>"
30
30
 
31
31
  assert_equal expected, actual
32
32
  end
@@ -89,7 +89,7 @@ class TableTest < ActionView::TestCase
89
89
  test 'table non searchable with a title and glyph' do
90
90
  options = { searchable: false, glyph: 'state', title: 'Title list' }
91
91
  actual = UiBibz::Ui::Ux::Tables::Searchable.new(@store, options).render
92
- expected = '<div><div class="title"><i class="glyph fas fa-state"></i>Title list</div><br class="ui-bibz-clear" /></div>'
92
+ expected = '<div><div class="title"><i class="glyph fa-solid fa-state"></i>Title list</div><br class="ui-bibz-clear" /></div>'
93
93
 
94
94
  assert_equal expected, actual
95
95
  end
@@ -97,7 +97,7 @@ class TableTest < ActionView::TestCase
97
97
  test 'table searchable' do
98
98
  options = { searchable: true }
99
99
  actual = UiBibz::Ui::Ux::Tables::Searchable.new(@store, options).render
100
- expected = "<div><div class=\"title\">Users list</div><form class=\"form-table-search-field\" action=\"/users?direction=asc&amp;page=1&amp;per_page=2&amp;search=Name+fr&amp;sort=users.name_fr\" accept-charset=\"UTF-8\" method=\"get\"><div class=\"input-group input-group-sm table-search-field\"><span class=\"input-group-text\"><i class=\"glyph fas fa-search\"></i></span><input type=\"hidden\" name=\"sort\" value=\"users.name_fr\" /><input type=\"hidden\" name=\"direction\" value=\"asc\" /><input type=\"hidden\" name=\"per_page\" value=\"2\" /><input type=\"hidden\" name=\"page\" value=\"1\" /><input type=\"hidden\" name=\"only_path\" value=\"true\" /><input type=\"hidden\" name=\"store_id\" value=\"users\" /><input type=\"hidden\" name=\"link_type\" value=\"search\" /><input type=\"search\" value=\"Name fr\" name=\"search\" class=\"form-control\" placeholder=\"Search by Name fr and Name en...\" /><button type=\"button\" class=\"btn btn-secondary input-group-btn clear-search-btn\"><i class=\"glyph fas fa-times-circle\"></i> <span class=\"visually-hidden\">Clear Search</span></button></div></form><br class=\"ui-bibz-clear\" /></div>"
100
+ expected = "<div><div class=\"title\">Users list</div><form class=\"form-table-search-field\" action=\"/users?direction=asc&amp;page=1&amp;per_page=2&amp;search=Name+fr&amp;sort=users.name_fr\" accept-charset=\"UTF-8\" method=\"get\"><div class=\"input-group input-group-sm table-search-field\"><span class=\"input-group-text\"><i class=\"glyph fa-solid fa-search\"></i></span><input type=\"hidden\" name=\"sort\" value=\"users.name_fr\" /><input type=\"hidden\" name=\"direction\" value=\"asc\" /><input type=\"hidden\" name=\"per_page\" value=\"2\" /><input type=\"hidden\" name=\"page\" value=\"1\" /><input type=\"hidden\" name=\"only_path\" value=\"true\" /><input type=\"hidden\" name=\"store_id\" value=\"users\" /><input type=\"hidden\" name=\"link_type\" value=\"search\" /><input type=\"search\" value=\"Name fr\" name=\"search\" class=\"form-control\" placeholder=\"Search by Name fr and Name en...\" /><button type=\"button\" class=\"btn btn-secondary input-group-btn clear-search-btn\"><i class=\"glyph fa-solid fa-times-circle\"></i> <span class=\"visually-hidden\">Clear Search</span></button></div></form><br class=\"ui-bibz-clear\" /></div>"
101
101
 
102
102
  assert_equal expected, actual
103
103
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'test_helper'
4
+
5
+ class GlyphComponentViewObjectTest < ActiveSupport::TestCase
6
+ test 'render nil without option name' do
7
+ glyph_component_view_object = UiBibz::ViewObjects::GlyphComponentViewObject.new({}, {})
8
+
9
+ assert_nil glyph_component_view_object.render
10
+ end
11
+
12
+ test 'render glyph with name' do
13
+ glyph_component_view_object = UiBibz::ViewObjects::GlyphComponentViewObject.new({ glyph: 'test' })
14
+
15
+ assert_equal '<i class="glyph fa-solid fa-test"></i>', glyph_component_view_object.render
16
+ end
17
+ end
data/ui_bibz.gemspec CHANGED
@@ -19,36 +19,22 @@ Gem::Specification.new do |s|
19
19
  s.description = UiBibz::DESCRIPTION
20
20
  s.license = UiBibz::LICENSE
21
21
 
22
- s.required_ruby_version = '>= 3.0.0'
22
+ s.required_ruby_version = '>= 3.2.0'
23
23
 
24
24
  s.files = `git ls-files`.split
25
- s.test_files = `git ls-files -- {test,spec,features}/*`.split
26
25
  s.executables = `git ls-files -- bin/*`.split.map { |f| File.basename(f) }
27
26
  s.require_paths = %w[lib vendor]
28
27
 
29
28
  # Rails gems
30
- s.add_development_dependency 'rails', '~> 6.1.3', '>= 6.1.3.2'
29
+ s.add_dependency 'rails', '>= 7.0.6'
31
30
 
32
31
  # Remove these dependencies after
32
+ s.add_dependency 'bootstrap', '~> 5.3.0'
33
33
  s.add_dependency 'will_paginate', '~> 3.3.0'
34
34
  s.add_dependency 'will_paginate-bootstrap4'
35
35
  s.add_dependency 'will-paginate-i18n'
36
+ # Don't move factory_bot_rails to Gemfile because of bug
37
+ s.add_development_dependency 'factory_bot_rails', '~> 4.0' # rubocop:disable Gemspec/DevelopmentDependencies
36
38
 
37
- # Development gems
38
- s.add_development_dependency 'factory_bot_rails', '~> 4.0'
39
- s.add_development_dependency 'haml-rails'
40
- s.add_development_dependency 'minitest'
41
- s.add_development_dependency 'overcommit'
42
- s.add_development_dependency 'rubocop'
43
- s.add_development_dependency 'rubocop-ast'
44
- s.add_development_dependency 'rubocop-minitest'
45
- s.add_development_dependency 'rubocop-performance'
46
- s.add_development_dependency 'rubocop-rails'
47
- s.add_development_dependency 'simplecov'
48
- s.add_development_dependency 'simple_form'
49
- s.add_development_dependency 'sqlite3'
50
- s.add_development_dependency 'yard'
51
- s.metadata = {
52
- 'rubygems_mfa_required' => 'true'
53
- }
39
+ s.metadata['rubygems_mfa_required'] = 'true'
54
40
  end