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,39 @@
1
+ .table-card
2
+ form
3
+ margin: 0
4
+ table
5
+ th
6
+ border-top: none
7
+
8
+ .progress
9
+ margin: 5px 0px 0px 0px
10
+ border: 1px solid $gray-200
11
+ border-radius: $border-radius
12
+
13
+ .card-header
14
+ //background-color: $table-bg-active
15
+ .title
16
+ float: left
17
+ font-size: 20px
18
+ .glyph
19
+ margin-right: 10px
20
+ .has-value
21
+ width: 400px !important
22
+ .input-group
23
+ width: 300px
24
+ transition: width .5s ease-in-out
25
+ float: right
26
+ .card-table, .card-body
27
+ overflow-x: auto
28
+ min-height: 200px
29
+
30
+ .card-footer
31
+ display: flex
32
+ justify-content: space-between
33
+ //background-color: $table-bg-active
34
+ padding: 10px 10px
35
+ .pagination
36
+ margin: 0
37
+ li
38
+ display: inline
39
+ float: left
@@ -0,0 +1,26 @@
1
+ // libraries
2
+ @import bootstrap
3
+ $fa-font-path: 'fontawesome'
4
+ @import fontawesome/fontawesome
5
+ @import fontawesome/solid
6
+ @import fontawesome/brands
7
+ @import multi-select
8
+ @import bootstrap-multiselect
9
+ @import bootstrap-markdown.min
10
+ @import bootstrap-switch.min
11
+ @import bootstrap-datepicker3.min
12
+
13
+ $states_colors: $theme-colors
14
+
15
+ // Components
16
+ @import sass/_boxes
17
+ @import sass/_containers
18
+ @import sass/_fixes
19
+ @import sass/_forms
20
+ @import sass/_navigations
21
+ @import sass/_notifications
22
+ @import sass/_tables
23
+
24
+ // Other section
25
+ .ui-bibz-clear
26
+ clear: both
data/bin/test CHANGED
@@ -1,7 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # frozen_string_literal: true
2
+ $: << File.expand_path("../test", __dir__)
3
3
 
4
- $LOAD_PATH << File.expand_path('../test', __dir__)
5
-
6
- require 'bundler/setup'
7
- require 'rails/plugin/test'
4
+ require "bundler/setup"
5
+ require "rails/plugin/test"
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ pin '@popperjs/core', to: 'https://unpkg.com/@popperjs/core@2.11.2/dist/esm/index.js', preload: true # use unpkg.com as ga.jspm.io contains a broken popper package
4
+ pin 'bootstrap', to: 'https://ga.jspm.io/npm:bootstrap@5.3.2/dist/js/bootstrap.esm.js', preload: true
5
+ pin 'jquery', to: 'jquery-3.7.0.min.js', preload: true
6
+ pin 'bootstrap-multiselect', to: 'bootstrap-multiselect.min.js', preload: true
7
+ pin 'bootstrap-switch', to: 'bootstrap-switch.min.js', preload: true
8
+ pin 'fuzzysort', to: 'fuzzysort.js', preload: true
9
+ pin 'jquery.multi-select', to: 'jquery.multi-select.min.js', preload: true
10
+ pin 'bootstrap-markdown', to: 'bootstrap-markdown.js', preload: true
11
+ pin 'bootstrap-datepicker.min.js', to: 'bootstrap-datepicker.min.js', preload: true
12
+ pin 'bootstrap-switch', to: 'bootstrap-switch.min.js', preload: true
13
+ pin 'jquery.quicksearch', to: 'jquery.quicksearch.min.js', preload: true
14
+ pin 'forms', to: 'forms.js', preload: true
15
+ pin 'interfaces', to: 'interfaces.js', preload: true
16
+ pin 'tables', to: 'tables.js', preload: true
17
+ pin 'formula', to: 'forms/formula.js', preload: true
18
+ pin 'input-connected', to: 'forms/input-connected.js', preload: true
19
+ pin 'jquery.multi-select-extend', to: 'forms/jquery.multi-select-extend.js', preload: true
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ Rails.application.config.assets.precompile += %w[bootstrap.min.js popper.js
4
+ jquery-3.7.0.min.js bootstrap-multiselect.min.js jquery.multi-select.min.js
5
+ forms.js interfaces.js tables.js forms/formula.js forms/input-connected.js forms/jquery.multi-select-extend.js"]
@@ -21,8 +21,6 @@ module WillPaginate
21
21
  end
22
22
 
23
23
  class BootstrapLinkRenderer < LinkRenderer
24
- ELLIPSIS = '&hellip;'
25
-
26
24
  def to_html
27
25
  list_items = pagination.map do |item|
28
26
  case item
@@ -68,7 +66,7 @@ module WillPaginate
68
66
  end
69
67
 
70
68
  def gap
71
- tag :li, tag(:i, ELLIPSIS, class: 'page-link'), class: 'page-item disabled'
69
+ tag :li, tag(:i, '&hellip;', class: 'page-link'), class: 'page-item disabled'
72
70
  end
73
71
 
74
72
  def previous_page
@@ -0,0 +1,118 @@
1
+ # frozen_string_literal: true
2
+
3
+ module UiBibz::Builders
4
+ # Class to build html classes
5
+ class DataHtmlOptionsBuilder
6
+ attr_accessor :html_options
7
+ attr_reader :options
8
+
9
+ def initialize(html_options, options)
10
+ @html_options = html_options
11
+ @options = options
12
+
13
+ stimulus_data_html
14
+ hotwire_data_html
15
+ tooltip_data_html
16
+ popover_data_html
17
+ end
18
+
19
+ # Add html data arguments
20
+ def add(name, value: true)
21
+ return if value.blank? && value != false
22
+
23
+ html_options[:data] = {} if html_options[:data].nil?
24
+ value = value.strip if value.is_a?(String)
25
+ html_options[:data].update({ name => value })
26
+ end
27
+
28
+ alias output html_options
29
+
30
+ private
31
+
32
+ def stimulus_data_html
33
+ data_target = html_options.try(:[], :data).try(:[], :target) || options.try(:delete, :target)
34
+ add(:target, value: data_target) unless data_target.nil?
35
+
36
+ data_controller = html_options.try(:[], :data).try(:[], :controller) || options.try(:delete, :controller)
37
+ add(:controller, value: data_controller) unless data_controller.nil?
38
+
39
+ data_action = html_options.try(:[], :data).try(:[], :action) || options.try(:delete, :action)
40
+ add(:action, value: data_action) unless data_action.nil?
41
+ end
42
+
43
+ def hotwire_data_html
44
+ # To turbolinks
45
+ data_turbolinks = html_options.try(:[], :data).try(:[], :turbolinks) || options.try(:delete, :turbolinks)
46
+ add(:turbolinks, value: data_turbolinks) unless data_turbolinks.nil?
47
+
48
+ # To Turbo
49
+ data_turbo = html_options.try(:[], :data).try(:[], :turbo) || options.try(:delete, :turbo)
50
+ add(:turbo, value: data_turbo) unless data_turbo.nil?
51
+ end
52
+
53
+ # Add popover to a component
54
+ #
55
+ # By tooltip object
56
+ #
57
+ # popover = UiBibz::Ui::Core::Notifications::Popover.new("My Popover")
58
+ # UiBibz::Ui::Core::Component.new("My content", popover: popover)
59
+ #
60
+ # By Hash
61
+ #
62
+ # UiBibz::Ui::Core::Component.new("My content", popover: { content: "My Popover" })
63
+ #
64
+ # By String
65
+ #
66
+ # UiBibz::Ui::Core::Component.new("My content", popover: "My Popover")
67
+ #
68
+ def popover_data_html
69
+ return if options[:popover].nil?
70
+
71
+ html_options.update(generate_popover.render)
72
+ end
73
+
74
+ # Add tooltip to a component
75
+ #
76
+ # By tooltip object
77
+ #
78
+ # tooltip = UiBibz::Ui::Core::Notifications::Tooltip.new("My tooltip")
79
+ # UiBibz::Ui::Core::Component.new("My content", tooltip: tooltip)
80
+ #
81
+ # By Boolean
82
+ #
83
+ # UiBibz::Ui::Core::Component.new("My content", tooltip: true)
84
+ # # or
85
+ # UiBibz::Ui::Core::Component.new("My content", {tooltip: true}, { title: 'My tooltip' })
86
+ #
87
+ # By Hash
88
+ #
89
+ # UiBibz::Ui::Core::Component.new("My content", tooltip: { title: 'My tooltip' })
90
+ #
91
+ def tooltip_data_html
92
+ return if options[:tooltip].nil?
93
+
94
+ html_options.update(generate_tooltip.render)
95
+ end
96
+
97
+ def generate_tooltip
98
+ case options[:tooltip].class.name
99
+ when 'UiBibz::Ui::Core::Notifications::Tooltip'
100
+ options[:tooltip]
101
+ when 'TrueClass'
102
+ tooltip_content = html_options.delete(:title) || (sanitize_text(content) if options[:text] == false)
103
+ UiBibz::Ui::Core::Notifications::Tooltip.new(tooltip_content)
104
+ else
105
+ UiBibz::Ui::Core::Notifications::Tooltip.new(options[:tooltip])
106
+ end
107
+ end
108
+
109
+ def generate_popover
110
+ case options[:popover].class.name
111
+ when 'UiBibz::Ui::Core::Notifications::Popover'
112
+ options[:popover]
113
+ else
114
+ UiBibz::Ui::Core::Notifications::Popover.new(options[:popover])
115
+ end
116
+ end
117
+ end
118
+ end
@@ -0,0 +1,89 @@
1
+ # frozen_string_literal: true
2
+
3
+ module UiBibz::Builders
4
+ # Class to build html classes
5
+ class HtmlClassesBuilder
6
+ class << self
7
+ # Add class and return output
8
+ # @param [Array|String] classes
9
+ # @return [Array|nil] classes
10
+ def join_classes(*)
11
+ html_classes_builder = new
12
+ html_classes_builder.add(*)
13
+ html_classes_builder.output
14
+ end
15
+
16
+ # Remove classes and return output
17
+ # @param [Array|String] arr
18
+ # @param [Array|String] classes
19
+ # @return [Array|nil] classes
20
+ def exclude_classes(arr, *classes)
21
+ html_classes_builder = new
22
+ html_classes_builder.add(arr)
23
+ html_classes_builder.remove(classes)
24
+ html_classes_builder.output
25
+ end
26
+ end
27
+
28
+ def initialize
29
+ @html_classes = []
30
+ end
31
+
32
+ # Add classes
33
+ # @param [Array|String] classes
34
+ # @return [Void]
35
+ def add(*classes)
36
+ @html_classes << classes
37
+ end
38
+
39
+ # Remove classes
40
+ # @param [Array|String] classes
41
+ # @return [Void]
42
+ def remove(*classes)
43
+ @html_classes = to_a.reject { |klass_name| self.class.join_classes(classes).include?(klass_name.to_s) }
44
+ end
45
+
46
+ # To be sure to have uniq classes
47
+ # @return [String] String of uniq classes
48
+ def to_s
49
+ to_a.join(' ')
50
+ end
51
+
52
+ # To be sure to have uniq classes
53
+ # @return [Array] Array of uniq classes
54
+ def to_a
55
+ @html_classes.flatten.join(' ').split.uniq
56
+ end
57
+
58
+ # Te be sure to have uniq classes
59
+ # @return [Array|Nil] Array or nil
60
+ def output
61
+ to_a.empty? ? nil : to_a
62
+ end
63
+
64
+ # Create a composed class
65
+ # @param [String] class_name
66
+ # @param [Symbol|String] value
67
+ # @return [Void]
68
+ def add_composed(class_name, value)
69
+ add class_name % value if value
70
+ end
71
+
72
+ # Add class if value is not nil
73
+ # @param [String] class_name
74
+ # @param [Symbol|String] value
75
+ # @return [Void]
76
+ def add_not_nil(class_name, value)
77
+ add class_name unless value.nil?
78
+ end
79
+
80
+ # Add class if value is equal to expected
81
+ # @param [String] class_name
82
+ # @param [Symbol|String] value
83
+ # @param [Symbol|String] expected
84
+ # @return [Void]
85
+ def add_if_equal_value(class_name, value, expected)
86
+ add class_name if value == expected
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module UiBibz::Builders
4
+ # Class to build html classes
5
+ class HtmlOptionsBuilder
6
+ attr_accessor :html_options
7
+ attr_reader :options
8
+
9
+ def initialize(html_options, options)
10
+ @html_options = html_options
11
+ @options = options
12
+ end
13
+
14
+ def initialize_component_html_options(component_html_options)
15
+ html_options.merge!(component_html_options)
16
+ end
17
+
18
+ def initialize_component_html_classes(component_html_classes)
19
+ html_options[:class] = component_html_classes
20
+ end
21
+ end
22
+ end
@@ -112,7 +112,7 @@ module UiBibz::Concerns::Models::Searchable
112
112
  end
113
113
 
114
114
  def self.default_order
115
- @arguments.dig(:default, :order) || ''
115
+ @arguments[:order] || { created_at: :desc }
116
116
  end
117
117
 
118
118
  def self.search_by_query(sql)
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module UiBibz
4
+ module FactoryMethods
5
+ # Class to initialize component
6
+ class ComponentInitializeFactoryMethod
7
+ def initialize(component, component_binding)
8
+ @component = component
9
+ @binding = component_binding
10
+ @content = component_binding.local_variable_get(:content)
11
+ @options = component_binding.local_variable_get(:options)
12
+ @html_options = component_binding.local_variable_get(:html_options)
13
+ @block = component_binding.local_variable_get(:block)
14
+ end
15
+
16
+ def make
17
+ strategy.new(@component, @binding)
18
+ end
19
+
20
+ private
21
+
22
+ def strategy
23
+ if !@block.nil?
24
+ UiBibz::Strategies::ComponentInitializeBlockStrategy
25
+ elsif @content.is_a?(Hash)
26
+ UiBibz::Strategies::ComponentInitializeHashStrategy
27
+ else
28
+ UiBibz::Strategies::ComponentInitializeStandardStrategy
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -21,47 +21,47 @@ module UiBibz::Helpers::Ui::Core::BoxesHelper
21
21
  # +options+ (Hash)
22
22
  # +html_options+ (Hash)
23
23
  #
24
- def ui_card_accordion(content = nil, options = nil, html_options = nil, &block)
25
- UiBibz::Ui::Core::Boxes::CardAccordion.new(content, options, html_options).tap(&block).render
24
+ def ui_card_accordion(content = nil, options = nil, html_options = nil, &)
25
+ UiBibz::Ui::Core::Boxes::CardAccordion.new(content, options, html_options).tap(&).render
26
26
  end
27
27
 
28
28
  # Card Group Component
29
29
  #
30
30
  # +options+ (Hash)
31
31
  # +html_options+ (Hash)
32
- def ui_card_group(content = nil, options = nil, html_options = nil, &block)
33
- UiBibz::Ui::Core::Boxes::CardGroup.new(content, options, html_options).tap(&block).render
32
+ def ui_card_group(content = nil, options = nil, html_options = nil, &)
33
+ UiBibz::Ui::Core::Boxes::CardGroup.new(content, options, html_options).tap(&).render
34
34
  end
35
35
 
36
36
  # Card Deck Component
37
37
  #
38
38
  # +options+ (Hash)
39
39
  # +html_options+ (Hash)
40
- def ui_card_deck(content = nil, options = nil, html_options = nil, &block)
41
- UiBibz::Ui::Core::Boxes::CardDeck.new(content, options, html_options).tap(&block).render
40
+ def ui_card_deck(content = nil, options = nil, html_options = nil, &)
41
+ UiBibz::Ui::Core::Boxes::CardDeck.new(content, options, html_options).tap(&).render
42
42
  end
43
43
 
44
44
  # Card Grid Component
45
45
  #
46
46
  # +options+ (Hash)
47
47
  # +html_options+ (Hash)
48
- def ui_card_grid(content = nil, options = nil, html_options = nil, &block)
49
- UiBibz::Ui::Core::Boxes::CardGrid.new(content, options, html_options).tap(&block).render
48
+ def ui_card_grid(content = nil, options = nil, html_options = nil, &)
49
+ UiBibz::Ui::Core::Boxes::CardGrid.new(content, options, html_options).tap(&).render
50
50
  end
51
51
 
52
52
  # Card Column Component
53
53
  #
54
54
  # +options+ (Hash)
55
55
  # +html_options+ (Hash)
56
- def ui_card_column(content = nil, options = nil, html_options = nil, &block)
57
- UiBibz::Ui::Core::Boxes::CardColumn.new(content, options, html_options).tap(&block).render
56
+ def ui_card_column(content = nil, options = nil, html_options = nil, &)
57
+ UiBibz::Ui::Core::Boxes::CardColumn.new(content, options, html_options).tap(&).render
58
58
  end
59
59
 
60
60
  # Jumbotron Component
61
61
  #
62
62
  # +options+ (Hash)
63
63
  # +html_options+ (Hash)
64
- def ui_jumbotron(content = nil, options = nil, html_options = nil, &block)
65
- UiBibz::Ui::Core::Boxes::Jumbotron.new(content, options, html_options, &block).render
64
+ def ui_jumbotron(content = nil, options = nil, html_options = nil, &)
65
+ UiBibz::Ui::Core::Boxes::Jumbotron.new(content, options, html_options, &).render
66
66
  end
67
67
  end