ui_bibz 3.0.13 → 4.0.0.beta4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +3 -3
- data/.github/workflows/linter.yml +13 -12
- data/.overcommit.yml +6 -0
- data/.rubocop.yml +6 -0
- data/.ruby-version +1 -1
- data/Gemfile +19 -12
- data/Gemfile.lock +219 -148
- data/app/assets/config/ui_bibz.js +14 -0
- data/app/assets/javascripts/controllers/combobox_controller.js +37 -0
- data/app/assets/javascripts/forms/formula.js +82 -0
- data/app/assets/javascripts/forms/input-connected.js +132 -0
- data/app/assets/javascripts/forms/jquery.multi-select-extend.js +52 -0
- data/app/assets/javascripts/forms.js +160 -0
- data/app/assets/javascripts/interfaces.js +56 -0
- data/app/assets/javascripts/tables.js +49 -0
- data/app/assets/javascripts/ui_bibz_js.js +37 -0
- data/app/assets/stylesheets/navigations/_nav.sass +2 -0
- data/app/assets/stylesheets/navigations/_navbar.sass +12 -0
- data/app/assets/stylesheets/navigations/_progress_bar.sass +2 -0
- data/app/assets/stylesheets/navigations/_toolbar.sass +3 -0
- data/app/assets/stylesheets/sass/_boxes.sass +1 -0
- data/app/assets/stylesheets/sass/_containers.sass +2 -0
- data/app/assets/stylesheets/sass/_fixes.sass +2 -0
- data/app/assets/stylesheets/sass/_forms.sass +9 -0
- data/app/assets/stylesheets/sass/_navigations.sass +4 -0
- data/app/assets/stylesheets/sass/_notifications.sass +4 -0
- data/app/assets/stylesheets/sass/_tables.sass +2 -0
- data/app/assets/stylesheets/sass/_variables_mixins_functions.sass +3 -0
- data/app/assets/stylesheets/sass/boxes/_card.sass +4 -0
- data/app/assets/stylesheets/sass/containers/_panel.scss +330 -0
- data/app/assets/stylesheets/sass/forms/_bootstrap_select.sass +5 -0
- data/app/assets/stylesheets/sass/forms/_button.sass +3 -0
- data/app/assets/stylesheets/sass/forms/_combobox.sass +32 -0
- data/app/assets/stylesheets/sass/forms/_date_picker.sass +3 -0
- data/app/assets/stylesheets/sass/forms/_form_check.sass +10 -0
- data/app/assets/stylesheets/sass/forms/_formula_field.sass +17 -0
- data/app/assets/stylesheets/sass/forms/_multiselect.sass +44 -0
- data/app/assets/stylesheets/sass/forms/_range.sass +44 -0
- data/app/assets/stylesheets/sass/forms/_slider.sass +136 -0
- data/app/assets/stylesheets/sass/forms/_surround_field.sass +25 -0
- data/app/assets/stylesheets/sass/notifications/_badge.sass +5 -0
- data/app/assets/stylesheets/sass/notifications/_glyph.sass +3 -0
- data/app/assets/stylesheets/sass/notifications/_star.sass +2 -0
- data/app/assets/stylesheets/sass/notifications/_toast.sass +3 -0
- data/app/assets/stylesheets/sass/tables/_table.sass +39 -0
- data/app/assets/stylesheets/sass/tables/_table_card.sass +39 -0
- data/app/assets/stylesheets/ui_bibz.sass +26 -0
- data/bin/test +3 -5
- data/config/importmap.rb +21 -0
- data/config/initializers/assets.rb +5 -0
- data/config/initializers/will_paginate.rb +1 -3
- data/lib/ui_bibz/builders/data_html_options_builder.rb +118 -0
- data/lib/ui_bibz/builders/html_classes_builder.rb +89 -0
- data/lib/ui_bibz/builders/html_options_builder.rb +22 -0
- data/lib/ui_bibz/factory_methods/component_initialize_factory_method.rb +33 -0
- data/lib/ui_bibz/helpers/ui/core/boxes_helper.rb +12 -12
- data/lib/ui_bibz/helpers/ui/core/forms_helper.rb +58 -50
- data/lib/ui_bibz/helpers/ui/core/icons_helper.rb +6 -6
- data/lib/ui_bibz/helpers/ui/core/layouts_helper.rb +2 -2
- data/lib/ui_bibz/helpers/ui/core/lists_helper.rb +2 -2
- data/lib/ui_bibz/helpers/ui/core/navigations_helper.rb +12 -12
- data/lib/ui_bibz/helpers/ui/core/notifications_helper.rb +4 -4
- data/lib/ui_bibz/helpers/ui/core/windows_helper.rb +10 -2
- data/lib/ui_bibz/helpers/ui/ux_helper.rb +2 -2
- data/lib/ui_bibz/helpers/utils_helper.rb +2 -2
- data/lib/ui_bibz/infos.rb +3 -3
- data/lib/ui_bibz/inputs/ui_bibz_form/ui_bibz_form_builder.rb +12 -12
- data/lib/ui_bibz/inputs/ui_bibz_inputs/collection_input.rb +1 -1
- data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_combobox_field_input.rb +15 -0
- data/lib/ui_bibz/rails/engine.rb +21 -4
- data/lib/ui_bibz/strategies/component_initialize_abstract_strategy.rb +27 -0
- data/lib/ui_bibz/strategies/component_initialize_block_strategy.rb +31 -0
- data/lib/ui_bibz/strategies/component_initialize_hash_strategy.rb +18 -0
- data/lib/ui_bibz/strategies/component_initialize_standard_strategy.rb +18 -0
- data/lib/ui_bibz/ui/concerns/card_itemable_concern.rb +4 -4
- data/lib/ui_bibz/ui/concerns/notification_concern.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/card.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/card_accordion.rb +4 -4
- data/lib/ui_bibz/ui/core/boxes/card_column.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/card_deck.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/card_grid.rb +0 -3
- data/lib/ui_bibz/ui/core/boxes/card_group.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/components/card_body.rb +9 -9
- data/lib/ui_bibz/ui/core/boxes/components/card_col.rb +2 -2
- data/lib/ui_bibz/ui/core/boxes/components/card_list_group.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/components/card_row.rb +1 -1
- data/lib/ui_bibz/ui/core/component.rb +13 -62
- data/lib/ui_bibz/ui/core/forms/buttons/button.rb +3 -1
- data/lib/ui_bibz/ui/core/forms/buttons/button_group.rb +11 -11
- data/lib/ui_bibz/ui/core/forms/choices/box_switch_field.rb +7 -7
- data/lib/ui_bibz/ui/core/forms/choices/checkbox_field.rb +2 -2
- data/lib/ui_bibz/ui/core/forms/choices/choice_group.rb +5 -6
- data/lib/ui_bibz/ui/core/forms/choices/components/choice.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/dates/date_picker_field.rb +15 -15
- data/lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_link.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/dropdowns/dropdown.rb +5 -5
- data/lib/ui_bibz/ui/core/forms/numbers/slider_field.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/selects/dropdown_select_field.rb +10 -10
- data/lib/ui_bibz/ui/core/forms/selects/multi_column_field.rb +2 -2
- data/lib/ui_bibz/ui/core/forms/surrounds/surround_field.rb +32 -32
- data/lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb +7 -8
- data/lib/ui_bibz/ui/core/forms/texts/combobox_field.rb +96 -0
- data/lib/ui_bibz/ui/core/icons/components/glyph_text.rb +1 -1
- data/lib/ui_bibz/ui/core/icons/glyph.rb +4 -3
- data/lib/ui_bibz/ui/core/layouts/row.rb +2 -2
- data/lib/ui_bibz/ui/core/lists/components/list.rb +4 -4
- data/lib/ui_bibz/ui/core/lists/list_group.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/breadcrumb.rb +6 -4
- data/lib/ui_bibz/ui/core/navigations/components/nav_link_span.rb +1 -2
- data/lib/ui_bibz/ui/core/navigations/components/navbar_form.rb +6 -5
- data/lib/ui_bibz/ui/core/navigations/components/toolbar_form.rb +2 -2
- data/lib/ui_bibz/ui/core/navigations/nav.rb +10 -6
- data/lib/ui_bibz/ui/core/navigations/navbar.rb +21 -19
- data/lib/ui_bibz/ui/core/navigations/pagination.rb +3 -3
- data/lib/ui_bibz/ui/core/navigations/toolbar.rb +5 -5
- data/lib/ui_bibz/ui/core/notifications/alert.rb +4 -5
- data/lib/ui_bibz/ui/core/notifications/badge.rb +6 -2
- data/lib/ui_bibz/ui/core/notifications/components/toast_header.rb +1 -1
- data/lib/ui_bibz/ui/core/notifications/progress_bar.rb +3 -3
- data/lib/ui_bibz/ui/core/notifications/toast.rb +8 -9
- data/lib/ui_bibz/ui/core/windows/components/offcanvas_body.rb +47 -0
- data/lib/ui_bibz/ui/core/windows/components/offcanvas_header.rb +54 -0
- data/lib/ui_bibz/ui/core/windows/modal.rb +9 -9
- data/lib/ui_bibz/ui/core/windows/offcanvas.rb +84 -0
- data/lib/ui_bibz/ui/extensions/core/component/glyph_extension.rb +4 -20
- data/lib/ui_bibz/ui/extensions/core/component/klass_extension.rb +11 -19
- data/lib/ui_bibz/ui/extensions/core/forms/connect_extension.rb +1 -1
- data/lib/ui_bibz/ui/ux/containers/components/panel_column.rb +3 -3
- data/lib/ui_bibz/ui/ux/containers/components/panel_deck.rb +3 -3
- data/lib/ui_bibz/ui/ux/containers/components/panel_group.rb +3 -3
- data/lib/ui_bibz/ui/ux/containers/components/panel_header.rb +4 -4
- data/lib/ui_bibz/ui/ux/containers/panel.rb +13 -13
- data/lib/ui_bibz/ui/ux/tables/components/actions.rb +4 -4
- data/lib/ui_bibz/ui/ux/tables/components/column.rb +1 -1
- data/lib/ui_bibz/ui/ux/tables/components/columns.rb +2 -2
- data/lib/ui_bibz/ui/ux/tables/extensions/sortable.rb +1 -1
- data/lib/ui_bibz/ui/ux/tables/table.rb +5 -5
- data/lib/ui_bibz/ui/ux/tables/table_card.rb +6 -6
- data/lib/ui_bibz/ui/ux/tables/table_search_field.rb +1 -1
- data/lib/ui_bibz/utils/breakdown_class_name_generator.rb +3 -3
- data/lib/ui_bibz/utils/screwdriver.rb +1 -1
- data/lib/ui_bibz/view_objects/glyph_component_view_object.rb +38 -0
- data/lib/ui_bibz.rb +26 -0
- data/test/builders/data_html_classes_builder_test.rb +37 -0
- data/test/builders/html_classes_builder_test.rb +76 -0
- data/test/dummy/Rakefile +1 -1
- data/test/dummy/app/assets/stylesheets/application.css +1 -15
- data/test/dummy/app/channels/application_cable/channel.rb +6 -0
- data/test/dummy/app/channels/application_cable/connection.rb +6 -0
- data/test/dummy/app/jobs/application_job.rb +9 -0
- data/test/dummy/app/mailers/application_mailer.rb +6 -0
- data/test/dummy/app/views/layouts/application.html.erb +10 -12
- data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/test/dummy/bin/rails +3 -3
- data/test/dummy/bin/rake +2 -2
- data/test/dummy/bin/setup +12 -12
- data/test/dummy/config/application.rb +13 -17
- data/test/dummy/config/boot.rb +3 -3
- data/test/dummy/config/database.yml +2 -2
- data/test/dummy/config/environment.rb +1 -1
- data/test/dummy/config/environments/development.rb +21 -16
- data/test/dummy/config/environments/production.rb +16 -41
- data/test/dummy/config/environments/test.rb +19 -8
- data/test/dummy/config/importmap.rb +11 -0
- data/test/dummy/config/initializers/content_security_policy.rb +21 -24
- data/test/dummy/config/initializers/filter_parameter_logging.rb +6 -2
- data/test/dummy/config/initializers/inflections.rb +4 -4
- data/test/dummy/config/initializers/permissions_policy.rb +12 -0
- data/test/dummy/config/locales/en.yml +13 -3
- data/test/dummy/config/puma.rb +7 -2
- data/test/dummy/config/storage.yml +5 -5
- data/test/dummy/config.ru +2 -1
- data/test/simple_form_test.rb +24 -24
- data/test/ui/core/boxes/card_test.rb +2 -1
- data/test/ui/core/component_test.rb +2 -2
- data/test/ui/core/forms/buttons/button_group_test.rb +1 -1
- data/test/ui/core/forms/buttons/button_link_test.rb +1 -1
- data/test/ui/core/forms/buttons/button_refresh_test.rb +1 -1
- data/test/ui/core/forms/buttons/button_test.rb +2 -2
- data/test/ui/core/forms/choices/box_switch_field_test.rb +10 -10
- data/test/ui/core/forms/choices/checkbox_field_test.rb +1 -1
- data/test/ui/core/forms/choices/choice_group_test.rb +1 -1
- data/test/ui/core/forms/dropdowns/dropdown_test.rb +1 -1
- data/test/ui/core/forms/numbers/formula_field_test.rb +1 -1
- data/test/ui/core/forms/selects/dropdown_select_field_test.rb +2 -2
- data/test/ui/core/forms/selects/select_field_test.rb +1 -1
- data/test/ui/core/forms/surrounds/surround_field_test.rb +4 -4
- data/test/ui/core/forms/texts/auto_complete_field_test.rb +2 -2
- data/test/ui/core/forms/texts/combobox_field_test.rb +19 -0
- data/test/ui/core/icons/glyph_test.rb +8 -4
- data/test/ui/core/icons/star_test.rb +12 -6
- data/test/ui/core/navigations/breadcrumb_test.rb +1 -1
- data/test/ui/core/navigations/link_test.rb +1 -1
- data/test/ui/core/navigations/nav_test.rb +11 -0
- data/test/ui/core/notifications/alert_test.rb +1 -1
- data/test/ui/core/notifications/badge_test.rb +3 -3
- data/test/ui/core/notifications/popover_test.rb +4 -4
- data/test/ui/core/notifications/spinner_test.rb +1 -1
- data/test/ui/core/notifications/toast_test.rb +1 -1
- data/test/ui/core/notifications/tooltip_test.rb +4 -4
- data/test/ui/core/windows/offcanvas_test.rb +27 -0
- data/test/ui/ux/containers/panel_test.rb +1 -1
- data/test/ui/ux/tables/table_test.rb +3 -3
- data/test/view_objects/glyph_component_view_object_test.rb +17 -0
- data/ui_bibz.gemspec +6 -20
- data/vendor/assets/fonts/fontawesome/fa-brands-400.ttf +0 -0
- data/vendor/assets/fonts/fontawesome/fa-brands-400.woff2 +0 -0
- data/vendor/assets/fonts/fontawesome/fa-regular-400.ttf +0 -0
- data/vendor/assets/fonts/fontawesome/fa-regular-400.woff2 +0 -0
- data/vendor/assets/fonts/fontawesome/fa-solid-900.ttf +0 -0
- data/vendor/assets/fonts/fontawesome/fa-solid-900.woff2 +0 -0
- data/vendor/assets/fonts/fontawesome/fa-v4compatibility.ttf +0 -0
- data/vendor/assets/fonts/fontawesome/fa-v4compatibility.woff2 +0 -0
- data/vendor/assets/javascripts/bootstrap-markdown.js +1 -1555
- data/vendor/assets/javascripts/bootstrap-multiselect.min.js +40 -1176
- data/vendor/assets/javascripts/bootstrap-switch.min.js +9 -21
- data/vendor/assets/javascripts/bs-custom-file-input.min.js +0 -1
- data/vendor/assets/javascripts/debounce.js +51 -0
- data/vendor/assets/javascripts/fontawesome/all.js +5977 -0
- data/vendor/assets/javascripts/fontawesome/all.min.js +6 -0
- data/vendor/assets/javascripts/fontawesome/brands.js +749 -0
- data/vendor/assets/javascripts/fontawesome/brands.min.js +6 -0
- data/vendor/assets/javascripts/fontawesome/conflict-detection.js +1138 -0
- data/vendor/assets/javascripts/fontawesome/conflict-detection.min.js +6 -0
- data/vendor/assets/javascripts/fontawesome/fontawesome.js +3126 -0
- data/vendor/assets/javascripts/fontawesome/fontawesome.min.js +6 -0
- data/vendor/assets/javascripts/fontawesome/regular.js +445 -0
- data/vendor/assets/javascripts/fontawesome/regular.min.js +6 -0
- data/vendor/assets/javascripts/fontawesome/solid.js +1672 -0
- data/vendor/assets/javascripts/fontawesome/solid.min.js +6 -0
- data/vendor/assets/javascripts/fontawesome/v4-shims.js +225 -0
- data/vendor/assets/javascripts/fontawesome/v4-shims.min.js +6 -0
- data/vendor/assets/javascripts/fuzzysort.js +562 -0
- data/vendor/assets/javascripts/jquery-3.7.0.min.js +2 -0
- data/vendor/assets/javascripts/jquery.multi-select.min.js +725 -1
- data/vendor/assets/stylesheets/bootstrap-multiselect.sass +115 -0
- data/vendor/assets/stylesheets/bootstrap-switch.scss +211 -0
- data/vendor/assets/stylesheets/fontawesome/_animated.scss +142 -9
- data/vendor/assets/stylesheets/fontawesome/_bordered-pulled.scss +13 -13
- data/vendor/assets/stylesheets/fontawesome/_core.scss +28 -6
- data/vendor/assets/stylesheets/fontawesome/_fixed-width.scss +2 -1
- data/vendor/assets/stylesheets/fontawesome/_functions.scss +57 -0
- data/vendor/assets/stylesheets/fontawesome/_icons.scss +7 -1438
- data/vendor/assets/stylesheets/fontawesome/_list.scss +4 -4
- data/vendor/assets/stylesheets/fontawesome/_mixins.scss +53 -34
- data/vendor/assets/stylesheets/fontawesome/_rotated-flipped.scss +25 -18
- data/vendor/assets/stylesheets/fontawesome/_screen-reader.scss +12 -3
- data/vendor/assets/stylesheets/fontawesome/_shims.scss +640 -664
- data/vendor/assets/stylesheets/fontawesome/_sizing.scss +16 -0
- data/vendor/assets/stylesheets/fontawesome/_stacked.scss +5 -4
- data/vendor/assets/stylesheets/fontawesome/_variables.scss +4896 -1393
- data/vendor/assets/stylesheets/fontawesome/brands.scss +17 -10
- data/vendor/assets/stylesheets/fontawesome/fontawesome.scss +7 -2
- data/vendor/assets/stylesheets/fontawesome/regular.scss +13 -10
- data/vendor/assets/stylesheets/fontawesome/solid.scss +13 -11
- data/vendor/assets/stylesheets/fontawesome/v4-shims.scss +6 -1
- data/vendor/assets/stylesheets/multi-select.css +92 -0
- metadata +126 -348
- data/.gitlab-ci.yml +0 -17
- data/.travis.yml +0 -24
- data/lib/ui_bibz/ui/extensions/core/component/popover_extension.rb +0 -70
- data/structure.md +0 -68
- data/test/dummy/README.rdoc +0 -28
- data/test/dummy/app/assets/javascripts/application.js +0 -13
- data/test/dummy/app/javascripts/packs/index.js +0 -3
- data/test/dummy/config/initializers/application_controller_renderer.rb +0 -9
- data/test/dummy/config/initializers/assets.rb +0 -14
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -8
- data/test/dummy/config/initializers/cookies_serializer.rb +0 -7
- data/test/dummy/config/initializers/mime_types.rb +0 -5
- data/test/dummy/config/initializers/session_store.rb +0 -5
- data/test/dummy/config/initializers/ui_bibz.rb +0 -5
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -16
- data/test/dummy/config/secrets.yml +0 -22
- data/test/dummy/config/spring.rb +0 -8
- data/test/dummy/test/models/user_test.rb +0 -9
- data/vendor/assets/fonts/fa-brands-400.eot +0 -0
- data/vendor/assets/fonts/fa-brands-400.svg +0 -3570
- data/vendor/assets/fonts/fa-brands-400.ttf +0 -0
- data/vendor/assets/fonts/fa-brands-400.woff +0 -0
- data/vendor/assets/fonts/fa-brands-400.woff2 +0 -0
- data/vendor/assets/fonts/fa-regular-400.eot +0 -0
- data/vendor/assets/fonts/fa-regular-400.svg +0 -803
- data/vendor/assets/fonts/fa-regular-400.ttf +0 -0
- data/vendor/assets/fonts/fa-regular-400.woff +0 -0
- data/vendor/assets/fonts/fa-regular-400.woff2 +0 -0
- data/vendor/assets/fonts/fa-solid-900.eot +0 -0
- data/vendor/assets/fonts/fa-solid-900.svg +0 -4938
- data/vendor/assets/fonts/fa-solid-900.ttf +0 -0
- data/vendor/assets/fonts/fa-solid-900.woff +0 -0
- data/vendor/assets/fonts/fa-solid-900.woff2 +0 -0
- data/vendor/assets/javascripts/all.js +0 -4441
- data/vendor/assets/javascripts/all.min.js +0 -5
- data/vendor/assets/stylesheets/all.min.css +0 -5
- data/vendor/assets/stylesheets/fontawesome/_larger.scss +0 -23
- data/vendor/assets/stylesheets/svg-with-js.css +0 -5
- /data/{test/dummy/app/mailers/.keep → app/assets/stylesheets/sass/forms/_dropdown.sass} +0 -0
- /data/{test/dummy/app/views/users/index.html.erb → app/assets/stylesheets/sass/forms/_input_refresh_button.sass} +0 -0
@@ -59,7 +59,7 @@ class CardTest < ActionView::TestCase
|
|
59
59
|
p.body 'state'
|
60
60
|
p.footer 'state'
|
61
61
|
end
|
62
|
-
expected = "<div class=\"state card\"><div class=\"card-header\"><i class=\"glyph
|
62
|
+
expected = "<div class=\"state card\"><div class=\"card-header\"><i class=\"glyph fa-solid fa-eye\"></i> state</div><div class=\"card-body\">state</div><div class=\"card-footer\">state</div></div>"
|
63
63
|
|
64
64
|
assert_equal expected, actual
|
65
65
|
end
|
@@ -96,6 +96,7 @@ class CardTest < ActionView::TestCase
|
|
96
96
|
cg.card 'test 3', body: true
|
97
97
|
end
|
98
98
|
expected = '<div class="card-deck-wrapper"><div class="card-deck"><div class="card"><div class="card-body">test 1</div></div><div class="card"><div class="card-body">test 2</div></div><div class="card"><div class="card-body">test 3</div></div></div></div>'
|
99
|
+
|
99
100
|
assert_equal expected, actual
|
100
101
|
end
|
101
102
|
|
@@ -5,7 +5,7 @@ require 'test_helper'
|
|
5
5
|
class ComponentTest < ActionView::TestCase
|
6
6
|
test 'create complex component' do
|
7
7
|
actual = UiBibz::Ui::Core::Component.new('New component', { state: :active, glyph: 'add' }, { class: 'new-class' }).render
|
8
|
-
expected = "<i class=\"glyph
|
8
|
+
expected = "<i class=\"glyph fa-solid fa-add\"></i> New component"
|
9
9
|
|
10
10
|
assert_equal expected, actual
|
11
11
|
end
|
@@ -21,7 +21,7 @@ class ComponentTest < ActionView::TestCase
|
|
21
21
|
|
22
22
|
test 'create component without text and glyph' do
|
23
23
|
actual = UiBibz::Ui::Core::Component.new('My text', { glyph: 'diamond', text: false }).render
|
24
|
-
expected = "<i class=\"glyph
|
24
|
+
expected = "<i class=\"glyph fa-solid fa-diamond\"></i> <span class=\"visually-hidden\">My text</span>"
|
25
25
|
|
26
26
|
assert_equal expected, actual
|
27
27
|
end
|
@@ -47,7 +47,7 @@ class ButtonGroupTest < ActionView::TestCase
|
|
47
47
|
d.link 'Link 1', url: '#link1', glyph: 'eye'
|
48
48
|
end
|
49
49
|
end
|
50
|
-
expected = "<div class=\"btn-group\" role=\"group\"><div id=\"dropdown-test\" class=\"dropup btn-group\"><button class=\"btn btn-success dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\" id=\"dropdown-test\">Dropdown</button><div class=\"dropdown-menu\" arial-labelledby=\"dropdown-test\"><a class=\"dropdown-item\" href=\"#link1\"><i class=\"glyph
|
50
|
+
expected = "<div class=\"btn-group\" role=\"group\"><div id=\"dropdown-test\" class=\"dropup btn-group\"><button class=\"btn btn-success dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\" id=\"dropdown-test\">Dropdown</button><div class=\"dropdown-menu\" arial-labelledby=\"dropdown-test\"><a class=\"dropdown-item\" href=\"#link1\"><i class=\"glyph fa-solid fa-eye\"></i> Link 1</a></div></div></div>"
|
51
51
|
|
52
52
|
assert_equal expected, actual
|
53
53
|
end
|
@@ -70,7 +70,7 @@ class ButtonLinkTest < ActionView::TestCase
|
|
70
70
|
|
71
71
|
test 'button_link glyph' do
|
72
72
|
actual = ui_button_link('state', glyph: 'diamond')
|
73
|
-
expected = '<a class="btn-secondary btn" role="button" href="#"><i class="glyph
|
73
|
+
expected = '<a class="btn-secondary btn" role="button" href="#"><i class="glyph fa-solid fa-diamond"></i> state</a>'
|
74
74
|
|
75
75
|
assert_equal expected, actual
|
76
76
|
end
|
@@ -5,7 +5,7 @@ require 'test_helper'
|
|
5
5
|
class ButtonRefreshTest < ActionView::TestCase
|
6
6
|
test 'button' do
|
7
7
|
actual = UiBibz::Ui::Core::Forms::Buttons::ButtonRefresh.new('state', status: :success, connect: { target: { url: '/' } }).render
|
8
|
-
expected = "<span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"","url":"/","data":[]}}\" class=\"btn-success ui-bibz-connect btn input-refresh-button\"><i class=\"glyph
|
8
|
+
expected = "<span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"","url":"/","data":[]}}\" class=\"btn-success ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fa-solid fa-sync-alt\"></i> state</span>"
|
9
9
|
|
10
10
|
assert_equal expected, actual
|
11
11
|
end
|
@@ -63,14 +63,14 @@ class ButtonTest < ActionView::TestCase
|
|
63
63
|
|
64
64
|
test 'button glyph' do
|
65
65
|
actual = ui_button('state', glyph: 'diamond')
|
66
|
-
expected = "<button class=\"btn-secondary btn\"><i class=\"glyph
|
66
|
+
expected = "<button class=\"btn-secondary btn\"><i class=\"glyph fa-solid fa-diamond\"></i> state</button>"
|
67
67
|
|
68
68
|
assert_equal expected, actual
|
69
69
|
end
|
70
70
|
|
71
71
|
test 'button glyph without text' do
|
72
72
|
actual = ui_button('state', glyph: 'diamond', text: false)
|
73
|
-
expected = "<button class=\"btn-secondary btn\"><i class=\"glyph
|
73
|
+
expected = "<button class=\"btn-secondary btn\"><i class=\"glyph fa-solid fa-diamond\"></i> <span class=\"visually-hidden\">state</span></button>"
|
74
74
|
|
75
75
|
assert_equal expected, actual
|
76
76
|
end
|
@@ -6,7 +6,7 @@ class BoxBoxSwitchFieldTest < ActionView::TestCase
|
|
6
6
|
# OK
|
7
7
|
test 'box_switch_field size' do
|
8
8
|
actual = UiBibz::Ui::Core::Forms::Choices::BoxSwitchField.new('test', size: :lg).render
|
9
|
-
expected = '<div class="switch-field-container"><input type="hidden" name="test" id="test" value="0" /><input type="checkbox" name="test" id="test" value="1" data-size="large" class="switch-field" /></div>'
|
9
|
+
expected = '<div class="switch-field-container"><input type="hidden" name="test" id="test" value="0" autocomplete="off" /><input type="checkbox" name="test" id="test" value="1" data-size="large" class="switch-field" /></div>'
|
10
10
|
|
11
11
|
assert_equal expected, actual
|
12
12
|
end
|
@@ -14,7 +14,7 @@ class BoxBoxSwitchFieldTest < ActionView::TestCase
|
|
14
14
|
# OK
|
15
15
|
test 'box_switch_field animate' do
|
16
16
|
actual = UiBibz::Ui::Core::Forms::Choices::BoxSwitchField.new('test', animate: false).render
|
17
|
-
expected = '<div class="switch-field-container"><input type="hidden" name="test" id="test" value="0" /><input type="checkbox" name="test" id="test" value="1" data-animate="false" class="switch-field" /></div>'
|
17
|
+
expected = '<div class="switch-field-container"><input type="hidden" name="test" id="test" value="0" autocomplete="off" /><input type="checkbox" name="test" id="test" value="1" data-animate="false" class="switch-field" /></div>'
|
18
18
|
|
19
19
|
assert_equal expected, actual
|
20
20
|
end
|
@@ -22,7 +22,7 @@ class BoxBoxSwitchFieldTest < ActionView::TestCase
|
|
22
22
|
# OK
|
23
23
|
test 'box_switch_field checked' do
|
24
24
|
actual = UiBibz::Ui::Core::Forms::Choices::BoxSwitchField.new('test', {}, checked: true).render
|
25
|
-
expected = '<div class="switch-field-container"><input type="hidden" name="test" id="test" value="0" /><input type="checkbox" name="test" id="test" value="1" checked="checked" class="switch-field" /></div>'
|
25
|
+
expected = '<div class="switch-field-container"><input type="hidden" name="test" id="test" value="0" autocomplete="off" /><input type="checkbox" name="test" id="test" value="1" checked="checked" class="switch-field" /></div>'
|
26
26
|
|
27
27
|
assert_equal expected, actual
|
28
28
|
end
|
@@ -30,7 +30,7 @@ class BoxBoxSwitchFieldTest < ActionView::TestCase
|
|
30
30
|
# OK
|
31
31
|
test 'box_switch_field state' do
|
32
32
|
actual = UiBibz::Ui::Core::Forms::Choices::BoxSwitchField.new('test', {}, state: 'disabled').render
|
33
|
-
expected = '<div class="switch-field-container"><input type="hidden" name="test" id="test" value="0" /><input type="checkbox" name="test" id="test" value="1" state="disabled" class="switch-field" /></div>'
|
33
|
+
expected = '<div class="switch-field-container"><input type="hidden" name="test" id="test" value="0" autocomplete="off" /><input type="checkbox" name="test" id="test" value="1" state="disabled" class="switch-field" /></div>'
|
34
34
|
|
35
35
|
assert_equal expected, actual
|
36
36
|
end
|
@@ -38,7 +38,7 @@ class BoxBoxSwitchFieldTest < ActionView::TestCase
|
|
38
38
|
# NON FONCTIONNEL
|
39
39
|
test 'box_switch_field readonly' do
|
40
40
|
actual = UiBibz::Ui::Core::Forms::Choices::BoxSwitchField.new('test', {}, readonly: true).render
|
41
|
-
expected = '<div class="switch-field-container"><input type="hidden" name="test" id="test" value="0" /><input type="checkbox" name="test" id="test" value="1" readonly="readonly" class="switch-field" /></div>'
|
41
|
+
expected = '<div class="switch-field-container"><input type="hidden" name="test" id="test" value="0" autocomplete="off" /><input type="checkbox" name="test" id="test" value="1" readonly="readonly" class="switch-field" /></div>'
|
42
42
|
|
43
43
|
assert_equal expected, actual
|
44
44
|
end
|
@@ -46,7 +46,7 @@ class BoxBoxSwitchFieldTest < ActionView::TestCase
|
|
46
46
|
# OK
|
47
47
|
test 'box_switch_field left_color' do
|
48
48
|
actual = UiBibz::Ui::Core::Forms::Choices::BoxSwitchField.new('test', left_color: 'success').render
|
49
|
-
expected = '<div class="switch-field-container"><input type="hidden" name="test" id="test" value="0" /><input type="checkbox" name="test" id="test" value="1" data-on-color="success" class="switch-field" /></div>'
|
49
|
+
expected = '<div class="switch-field-container"><input type="hidden" name="test" id="test" value="0" autocomplete="off" /><input type="checkbox" name="test" id="test" value="1" data-on-color="success" class="switch-field" /></div>'
|
50
50
|
|
51
51
|
assert_equal expected, actual
|
52
52
|
end
|
@@ -54,7 +54,7 @@ class BoxBoxSwitchFieldTest < ActionView::TestCase
|
|
54
54
|
# OK
|
55
55
|
test 'box_switch_field right_color' do
|
56
56
|
actual = UiBibz::Ui::Core::Forms::Choices::BoxSwitchField.new('test', right_color: 'info').render
|
57
|
-
expected = '<div class="switch-field-container"><input type="hidden" name="test" id="test" value="0" /><input type="checkbox" name="test" id="test" value="1" data-off-color="info" class="switch-field" /></div>'
|
57
|
+
expected = '<div class="switch-field-container"><input type="hidden" name="test" id="test" value="0" autocomplete="off" /><input type="checkbox" name="test" id="test" value="1" data-off-color="info" class="switch-field" /></div>'
|
58
58
|
|
59
59
|
assert_equal expected, actual
|
60
60
|
end
|
@@ -62,7 +62,7 @@ class BoxBoxSwitchFieldTest < ActionView::TestCase
|
|
62
62
|
# OK
|
63
63
|
test 'box_switch_field middle_text' do
|
64
64
|
actual = UiBibz::Ui::Core::Forms::Choices::BoxSwitchField.new('test', middle_text: 'testlabeltext').render
|
65
|
-
expected = '<div class="switch-field-container"><input type="hidden" name="test" id="test" value="0" /><input type="checkbox" name="test" id="test" value="1" data-label-text="testlabeltext" class="switch-field" /></div>'
|
65
|
+
expected = '<div class="switch-field-container"><input type="hidden" name="test" id="test" value="0" autocomplete="off" /><input type="checkbox" name="test" id="test" value="1" data-label-text="testlabeltext" class="switch-field" /></div>'
|
66
66
|
|
67
67
|
assert_equal expected, actual
|
68
68
|
end
|
@@ -70,7 +70,7 @@ class BoxBoxSwitchFieldTest < ActionView::TestCase
|
|
70
70
|
# OK
|
71
71
|
test 'box_switch_field left_text' do
|
72
72
|
actual = UiBibz::Ui::Core::Forms::Choices::BoxSwitchField.new('test', left_text: 'testonlabel').render
|
73
|
-
expected = '<div class="switch-field-container"><input type="hidden" name="test" id="test" value="0" /><input type="checkbox" name="test" id="test" value="1" data-on-text="testonlabel" class="switch-field" /></div>'
|
73
|
+
expected = '<div class="switch-field-container"><input type="hidden" name="test" id="test" value="0" autocomplete="off" /><input type="checkbox" name="test" id="test" value="1" data-on-text="testonlabel" class="switch-field" /></div>'
|
74
74
|
|
75
75
|
assert_equal expected, actual
|
76
76
|
end
|
@@ -78,7 +78,7 @@ class BoxBoxSwitchFieldTest < ActionView::TestCase
|
|
78
78
|
# OK
|
79
79
|
test 'box_switch_field right_text' do
|
80
80
|
actual = UiBibz::Ui::Core::Forms::Choices::BoxSwitchField.new('test', right_text: 'testofflabel').render
|
81
|
-
expected = '<div class="switch-field-container"><input type="hidden" name="test" id="test" value="0" /><input type="checkbox" name="test" id="test" value="1" data-off-text="testofflabel" class="switch-field" /></div>'
|
81
|
+
expected = '<div class="switch-field-container"><input type="hidden" name="test" id="test" value="0" autocomplete="off" /><input type="checkbox" name="test" id="test" value="1" data-off-text="testofflabel" class="switch-field" /></div>'
|
82
82
|
|
83
83
|
assert_equal expected, actual
|
84
84
|
end
|
@@ -12,7 +12,7 @@ class CheckboxFieldTest < ActionView::TestCase
|
|
12
12
|
|
13
13
|
test 'checkbox_field which is a boolean' do
|
14
14
|
actual = UiBibz::Ui::Core::Forms::Choices::CheckboxField.new('John', { boolean: true, value: 1 }).render
|
15
|
-
expected = "<div class=\"form-check\"><input type=\"hidden\" name=\"John\" id=\"John-hidden\" value=\"0\" /><input type=\"checkbox\" name=\"John\" id=\"John\" value=\"1\" class=\"form-check-input\" /><label class=\"form-check-label\" for=\"John\">John</label></div>"
|
15
|
+
expected = "<div class=\"form-check\"><input type=\"hidden\" name=\"John\" id=\"John-hidden\" value=\"0\" autocomplete=\"off\" /><input type=\"checkbox\" name=\"John\" id=\"John\" value=\"1\" class=\"form-check-input\" /><label class=\"form-check-label\" for=\"John\">John</label></div>"
|
16
16
|
|
17
17
|
assert_equal expected, actual
|
18
18
|
end
|
@@ -32,7 +32,7 @@ class ChoiceGroupTest < ActionView::TestCase
|
|
32
32
|
bc.choice 'Radio 1', glyph: 'diamond', status: :primary
|
33
33
|
bc.choice 'Radio 2', state: :active
|
34
34
|
end
|
35
|
-
expected = "<div data-toggle=\"buttons\" class=\"btn-group btn-group-lg button-choice btn-group-toggle\"><input type=\"radio\" autocomplete=\"off\" class=\"btn-check\" name=\"#{actual.items.first.input_options[:name]}\" id=\"#{actual.items.first.input_options[:id]}\" /><label class=\"btn-outline-primary btn btn-lg\" for=\"#{actual.items.first.input_options[:id]}\"><i class=\"glyph
|
35
|
+
expected = "<div data-toggle=\"buttons\" class=\"btn-group btn-group-lg button-choice btn-group-toggle\"><input type=\"radio\" autocomplete=\"off\" class=\"btn-check\" name=\"#{actual.items.first.input_options[:name]}\" id=\"#{actual.items.first.input_options[:id]}\" /><label class=\"btn-outline-primary btn btn-lg\" for=\"#{actual.items.first.input_options[:id]}\"><i class=\"glyph fa-solid fa-diamond\"></i> Radio 1</label><input type=\"radio\" autocomplete=\"off\" class=\"btn-check\" checked=\"checked\" name=\"#{actual.items.last.input_options[:name]}\" id=\"#{actual.items.last.input_options[:id]}\" /><label class=\"btn-outline-secondary btn btn-lg\" aria-pressed=\"true\" for=\"#{actual.items.last.input_options[:id]}\">Radio 2</label></div>"
|
36
36
|
|
37
37
|
assert_equal expected, actual.render
|
38
38
|
end
|
@@ -39,7 +39,7 @@ class DropdownTest < ActionView::TestCase
|
|
39
39
|
d.divider
|
40
40
|
d.link 'Link3', url: '#link3'
|
41
41
|
end
|
42
|
-
expected = "<div class=\"dropup btn-group\"><button class=\"btn btn-success dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\" id=\"#{actual.id}\"><i class=\"glyph
|
42
|
+
expected = "<div class=\"dropup btn-group\"><button class=\"btn btn-success dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\" id=\"#{actual.id}\"><i class=\"glyph fa-solid fa-diamond\"></i> Dropdown</button><div class=\"dropdown-menu dropdown-menu-end\" arial-labelledby=\"#{actual.id}\"><a class=\"dropdown-item\" href=\"#link1\"><i class=\"glyph fa-solid fa-eye\"></i> Link 1</a><h6 class=\"dropdown-header\" role=\"presentation\">header</h6><a class=\"dropdown-item\" href=\"#link2\">Link 2</a><div class=\"dropdown-divider\"></div><a class=\"dropdown-item\" href=\"#link3\">Link3</a></div></div>"
|
43
43
|
|
44
44
|
assert_equal expected, actual.render
|
45
45
|
end
|
@@ -5,7 +5,7 @@ require 'test_helper'
|
|
5
5
|
class FormulaFieldTest < ActionView::TestCase
|
6
6
|
test 'formula_field' do
|
7
7
|
actual = UiBibz::Ui::Core::Forms::Numbers::FormulaField.new('value').render
|
8
|
-
expected = '<div class="formula_field input-group ui_surround_field"><input type="text" name="value_formula" id="value_formula" class="formula-field form-control" /><span class="formula-field-sign input-group-text">=</span><input type="text" name="value" id="value" class="formula-field-result form-control" readonly="readonly" /><span data-bs-toggle="tooltip" class="formula-field-alert input-group-text"><i class="glyph-danger glyph
|
8
|
+
expected = '<div class="formula_field input-group ui_surround_field"><input type="text" name="value_formula" id="value_formula" class="formula-field form-control" /><span class="formula-field-sign input-group-text">=</span><input type="text" name="value" id="value" class="formula-field-result form-control" readonly="readonly" /><span data-bs-toggle="tooltip" class="formula-field-alert input-group-text"><i class="glyph-danger glyph fa-solid fa-exclamation-triangle"></i></span></div>'
|
9
9
|
|
10
10
|
assert_equal expected, actual
|
11
11
|
end
|
@@ -24,7 +24,7 @@ class DropdownSelectFieldTest < ActionView::TestCase
|
|
24
24
|
test 'Dropdown Select Field data html options' do
|
25
25
|
grouped_options = { 'North America' => [['United statuss', 'US'], 'Canada'], 'Europe' => %w[Denmark Germany France] }
|
26
26
|
actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('example', { multiple: true, option_tags: grouped_options_for_select(grouped_options), clickable_opt_group: true, collapsible_opt_group: true, searchable: true, non_selected_text: 'test', select_all_options: true, number_displayed: 2, status: :danger, n_selected_text: "items selected" }).render
|
27
|
-
expected = "<select name=\"example[]\" id=\"example\" data-enable-clickable-opt-groups=\"true\" data-enable-collapsible-opt-groups=\"true\" data-enable-filtering=\"true\" data-non-selected-text=\"test\" data-include-select-all-option=\"true\" data-number-displayed=\"
|
27
|
+
expected = "<select name=\"example[]\" id=\"example\" data-enable-clickable-opt-groups=\"true\" data-enable-collapsible-opt-groups=\"true\" data-enable-filtering=\"true\" data-non-selected-text=\"test\" data-include-select-all-option=\"true\" data-number-displayed=\"2\" data-dropdown-classes=\"dropdown\" data-n-selected-text=\"items selected\" class=\"btn-danger multi-select-field\" multiple=\"multiple\"><optgroup label=\"North America\"><option value=\"US\">United statuss</option>
|
28
28
|
<option value=\"Canada\">Canada</option></optgroup><optgroup label=\"Europe\"><option value=\"Denmark\">Denmark</option>
|
29
29
|
<option value=\"Germany\">Germany</option>
|
30
30
|
<option value=\"France\">France</option></optgroup></select>"
|
@@ -34,7 +34,7 @@ class DropdownSelectFieldTest < ActionView::TestCase
|
|
34
34
|
|
35
35
|
test 'Dropdown Select Field refresh option' do
|
36
36
|
actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { multiple: true, refresh: { target: { url: '/' } } }).render
|
37
|
-
expected = "<div class=\"field-refresh input-group ui_surround_field\"><select name=\"test[]\" id=\"test\" data-dropdown-classes=\"dropdown\" class=\"btn-secondary multi-select-field\" multiple=\"multiple\"></select><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#test","url":"/","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph
|
37
|
+
expected = "<div class=\"field-refresh input-group ui_surround_field\"><select name=\"test[]\" id=\"test\" data-dropdown-classes=\"dropdown\" class=\"btn-secondary multi-select-field\" multiple=\"multiple\"></select><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#test","url":"/","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fa-solid fa-sync-alt\"></i></span></div>"
|
38
38
|
|
39
39
|
assert_equal expected, actual
|
40
40
|
end
|
@@ -14,7 +14,7 @@ class SelectFieldTest < ActionView::TestCase
|
|
14
14
|
|
15
15
|
test 'Select Field refresh' do
|
16
16
|
actual = UiBibz::Ui::Core::Forms::Selects::SelectField.new('example', refresh: { target: { url: '/' } }).render
|
17
|
-
expected = "<div class=\"field-refresh input-group ui_surround_field\"><select name=\"example\" id=\"example\" class=\"select-field form-control form-select\"></select><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#example","url":"/","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph
|
17
|
+
expected = "<div class=\"field-refresh input-group ui_surround_field\"><select name=\"example\" id=\"example\" class=\"select-field form-control form-select\"></select><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#example","url":"/","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fa-solid fa-sync-alt\"></i></span></div>"
|
18
18
|
|
19
19
|
assert_equal expected, actual
|
20
20
|
end
|
@@ -7,7 +7,7 @@ class SurroundFieldTest < ActionView::TestCase
|
|
7
7
|
actual = UiBibz::Ui::Core::Forms::Surrounds::SurroundField.new.tap do |sf|
|
8
8
|
sf.glyph 'pencil'
|
9
9
|
end.render
|
10
|
-
expected = '<div class="input-group ui_surround_field"><span class="input-group-text"><i class="glyph
|
10
|
+
expected = '<div class="input-group ui_surround_field"><span class="input-group-text"><i class="glyph fa-solid fa-pencil"></i></span></div>'
|
11
11
|
|
12
12
|
assert_equal expected, actual
|
13
13
|
end
|
@@ -31,7 +31,7 @@ class SurroundFieldTest < ActionView::TestCase
|
|
31
31
|
d.link 'Link3', url: '#link3'
|
32
32
|
end
|
33
33
|
end.render
|
34
|
-
expected = "<div class=\"input-group ui_surround_field\"><button class=\"btn btn-secondary dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\" id=\"dropdown-test\">Dropdown</button><div class=\"dropdown-menu\" arial-labelledby=\"dropdown-test\"><a class=\"dropdown-item\" href=\"#link1\"><i class=\"glyph
|
34
|
+
expected = "<div class=\"input-group ui_surround_field\"><button class=\"btn btn-secondary dropdown-toggle\" type=\"button\" data-bs-toggle=\"dropdown\" aria-expanded=\"false\" id=\"dropdown-test\">Dropdown</button><div class=\"dropdown-menu\" arial-labelledby=\"dropdown-test\"><a class=\"dropdown-item\" href=\"#link1\"><i class=\"glyph fa-solid fa-eye\"></i> Link 1</a><h6 class=\"dropdown-header\" role=\"presentation\">header</h6><a class=\"dropdown-item\" href=\"#link2\">Link 2</a><div class=\"dropdown-divider\"></div><a class=\"dropdown-item\" href=\"#link3\">Link3</a></div></div>"
|
35
35
|
|
36
36
|
assert_equal expected, actual
|
37
37
|
end
|
@@ -51,7 +51,7 @@ class SurroundFieldTest < ActionView::TestCase
|
|
51
51
|
sf.addon '€'
|
52
52
|
sf.glyph 'pencil'
|
53
53
|
end.render
|
54
|
-
expected = "<div class=\"input-group ui_surround_field\"><button class=\"btn-secondary btn\">Submit</button><span class=\"input-group-text\">€</span><span class=\"input-group-text\"><i class=\"glyph
|
54
|
+
expected = "<div class=\"input-group ui_surround_field\"><button class=\"btn-secondary btn\">Submit</button><span class=\"input-group-text\">€</span><span class=\"input-group-text\"><i class=\"glyph fa-solid fa-pencil\"></i></span></div>"
|
55
55
|
|
56
56
|
assert_equal expected, actual
|
57
57
|
end
|
@@ -87,7 +87,7 @@ class SurroundFieldTest < ActionView::TestCase
|
|
87
87
|
sf.button_refresh
|
88
88
|
end.render
|
89
89
|
|
90
|
-
expected = "<div class=\"input-group ui_surround_field\"><span class=\"input-group-text\"><i class=\"glyph
|
90
|
+
expected = "<div class=\"input-group ui_surround_field\"><span class=\"input-group-text\"><i class=\"glyph fa-solid fa-gem\"></i></span><span class=\"input-group-text\">test</span><button class=\"btn-secondary btn\">button</button><div class=\"input-group-btn\" role=\"group\"><button class=\"btn-secondary btn\">test</button></div><a class=\"btn-secondary btn\" role=\"button\" href=\"#\">link</a><div class=\"form-check\"><input type=\"checkbox\" name=\"check\" id=\"check\" value=\"1\" class=\"form-check-input input-group-text\" label=\"false\" /><label class=\"form-check-label\" for=\"check\">check</label></div><div class=\"form-check\"><input type=\"radio\" name=\"radio\" id=\"radio_\" class=\"form-check-input input-group-text\" label=\"false\" /><label class=\"form-check-label\" for=\"radio_\">radio</label></div><input type=\"text\" name=\"text\" id=\"text\" class=\"form-control\" /><input type=\"text\" name=\"date\" id=\"date\" data-date-locale=\"en\" data-provide=\"datepicker\" data-date-format=\"yyyy-mm-dd\" data-date-today-btn=\"linked\" data-date-toggle-active=\"true\" class=\"date_picker form-control\" /><select name=\"dropdown_select\" id=\"dropdown_select\" data-wrapper-classes=\"input-group-btn\" data-dropdown-classes=\"dropdown\" class=\"btn-secondary multi-select-field\"></select><select name=\"select\" id=\"select\" class=\"select-field form-control form-select\"></select><input type=\"text\" name=\"auto\" id=\"auto\" class=\"form-control auto-complete-field\" autocomplete=\"true\" list=\"auto-datalist\" /><datalist id=\"auto-datalist\"></datalist><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"","url":"","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fa-solid fa-sync-alt\"></i></span></div>"
|
91
91
|
|
92
92
|
assert_equal expected, actual
|
93
93
|
end
|
@@ -16,7 +16,7 @@ class AutoCompleteFieldTest < ActionView::TestCase
|
|
16
16
|
options = options_for_select(Array.new(2) { |i| "option #{i}" })
|
17
17
|
actual = UiBibz::Ui::Core::Forms::Texts::AutoCompleteField.new('test', { option_tags: options, refresh: { target: { url: '/' } } }, { id: 'test' }).render
|
18
18
|
expected = "<div class=\"field-refresh input-group ui_surround_field\"><input type=\"text\" name=\"test\" id=\"test\" class=\"form-control auto-complete-field\" autocomplete=\"true\" list=\"test-datalist\" /><datalist id=\"test-datalist\"><option value=\"option 0\">option 0</option>
|
19
|
-
<option value=\"option 1\">option 1</option></datalist><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#test-datalist","url":"/","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph
|
19
|
+
<option value=\"option 1\">option 1</option></datalist><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#test-datalist","url":"/","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fa-solid fa-sync-alt\"></i></span></div>"
|
20
20
|
|
21
21
|
assert_equal expected, actual
|
22
22
|
end
|
@@ -25,7 +25,7 @@ class AutoCompleteFieldTest < ActionView::TestCase
|
|
25
25
|
options = options_for_select(Array.new(2) { |i| "option #{i}" })
|
26
26
|
actual = UiBibz::Ui::Core::Forms::Texts::AutoCompleteField.new('test', { option_tags: options, append: 'Append content', refresh: { target: { url: '/' } } }, { id: 'test' }).render
|
27
27
|
expected = "<div class=\"field-refresh input-group ui_surround_field\"><span class=\"input-group-text\">Append content</span><input type=\"text\" name=\"test\" id=\"test\" class=\"form-control auto-complete-field\" autocomplete=\"true\" list=\"test-datalist\" /><datalist id=\"test-datalist\"><option value=\"option 0\">option 0</option>
|
28
|
-
<option value=\"option 1\">option 1</option></datalist><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#test-datalist","url":"/","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph
|
28
|
+
<option value=\"option 1\">option 1</option></datalist><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#test-datalist","url":"/","data":[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fa-solid fa-sync-alt\"></i></span></div>"
|
29
29
|
|
30
30
|
assert_equal expected, actual
|
31
31
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'test_helper'
|
4
|
+
|
5
|
+
class ComboboxFieldTest < ActionView::TestCase
|
6
|
+
test 'comobobox_field' do
|
7
|
+
actual = UiBibz::Ui::Core::Forms::Texts::ComboboxField.new('test', { url: root_url, debounce: 200 }, { id: 'test' }).render
|
8
|
+
expected = "<div data-controller=\"combobox\" data-combobox-url-value=\"http://test.host/\" data-combobox-debounce-value=\"200\" class=\"combobox\"><input type=\"text\" name=\"test\" id=\"test\" data-action=\"keyup->combobox#search\" class=\"form-control combobox-field\" autocomplete=\"false\" /><div class=\"combobox-list\"><turbo-frame id=\"test-combobox-list\" src=\"\"></turbo-frame></div></div>"
|
9
|
+
|
10
|
+
assert_equal expected, actual
|
11
|
+
end
|
12
|
+
|
13
|
+
test 'comobobox_field with prepend content' do
|
14
|
+
actual = UiBibz::Ui::Core::Forms::Texts::ComboboxField.new('test', { prepend: 'Append content' }, { id: 'test' }).render
|
15
|
+
expected = "<div class=\"input-group ui_surround_field\"><div data-controller=\"combobox\" class=\"combobox\"><input type=\"text\" name=\"test\" id=\"test\" data-action=\"keyup->combobox#search\" class=\"form-control combobox-field\" autocomplete=\"false\" /><div class=\"combobox-list\"><turbo-frame id=\"test-combobox-list\" src=\"\"></turbo-frame></div></div><span class=\"input-group-text\">Append content</span></div>"
|
16
|
+
|
17
|
+
assert_equal expected, actual
|
18
|
+
end
|
19
|
+
end
|
@@ -7,25 +7,29 @@ class GlyphTest < ActionView::TestCase
|
|
7
7
|
|
8
8
|
test 'create glyph with a name' do
|
9
9
|
actual = ui_glyph('add')
|
10
|
-
expected = '<i class="glyph
|
10
|
+
expected = '<i class="glyph fa-solid fa-add"></i>'
|
11
|
+
|
11
12
|
assert_equal expected, actual
|
12
13
|
end
|
13
14
|
|
14
15
|
test 'create glyph with hash' do
|
15
16
|
actual = ui_glyph({ name: 'add', size: 3, type: 'li' })
|
16
|
-
expected = '<i class="glyph
|
17
|
+
expected = '<i class="glyph fa-solid fa-add fa-3x fa-li"></i>'
|
18
|
+
|
17
19
|
assert_equal expected, actual
|
18
20
|
end
|
19
21
|
|
20
22
|
test 'create glyph with name and hash' do
|
21
23
|
actual = ui_glyph('add', { size: 3, type: 'li' })
|
22
|
-
expected = '<i class="glyph
|
24
|
+
expected = '<i class="glyph fa-solid fa-add fa-3x fa-li"></i>'
|
25
|
+
|
23
26
|
assert_equal expected, actual
|
24
27
|
end
|
25
28
|
|
26
29
|
test 'create glyph with label' do
|
27
30
|
actual = ui_glyph('add', { label: 'Example' })
|
28
|
-
expected = '<i class="glyph
|
31
|
+
expected = '<i class="glyph fa-solid fa-add"></i> Example'
|
32
|
+
|
29
33
|
assert_equal expected, actual
|
30
34
|
end
|
31
35
|
end
|
@@ -7,37 +7,43 @@ class StarTest < ActionView::TestCase
|
|
7
7
|
|
8
8
|
test 'stars with 1' do
|
9
9
|
actual = ui_star(1)
|
10
|
-
expected = '<span class="stars-notation"><i class="glyph
|
10
|
+
expected = '<span class="stars-notation"><i class="glyph fa-solid fa-star"></i> <i class="glyph fa-regular fa-star"></i> <i class="glyph fa-regular fa-star"></i> <i class="glyph fa-regular fa-star"></i> <i class="glyph fa-regular fa-star"></i></span>'
|
11
|
+
|
11
12
|
assert_equal expected, actual
|
12
13
|
end
|
13
14
|
|
14
15
|
test 'stars with 2.1' do
|
15
16
|
actual = ui_star(2.1)
|
16
|
-
expected = '<span class="stars-notation"><i class="glyph
|
17
|
+
expected = '<span class="stars-notation"><i class="glyph fa-solid fa-star"></i> <i class="glyph fa-solid fa-star"></i> <i class="glyph fa-solid fa-star-half-alt"></i> <i class="glyph fa-regular fa-star"></i> <i class="glyph fa-regular fa-star"></i></span>'
|
18
|
+
|
17
19
|
assert_equal expected, actual
|
18
20
|
end
|
19
21
|
|
20
22
|
test 'stars with 3.6 with status danger' do
|
21
23
|
actual = ui_star(3.6, { status: :danger })
|
22
|
-
expected = '<span class="stars-notation"><i class="glyph-danger glyph
|
24
|
+
expected = '<span class="stars-notation"><i class="glyph-danger glyph fa-solid fa-star"></i> <i class="glyph-danger glyph fa-solid fa-star"></i> <i class="glyph-danger glyph fa-solid fa-star"></i> <i class="glyph-danger glyph fa-solid fa-star-half-alt"></i> <i class="glyph-danger glyph fa-regular fa-star"></i></span>'
|
25
|
+
|
23
26
|
assert_equal expected, actual
|
24
27
|
end
|
25
28
|
|
26
29
|
test 'stars with 4.9' do
|
27
30
|
actual = ui_star(4.9)
|
28
|
-
expected = '<span class="stars-notation"><i class="glyph
|
31
|
+
expected = '<span class="stars-notation"><i class="glyph fa-solid fa-star"></i> <i class="glyph fa-solid fa-star"></i> <i class="glyph fa-solid fa-star"></i> <i class="glyph fa-solid fa-star"></i> <i class="glyph fa-solid fa-star-half-alt"></i></span>'
|
32
|
+
|
29
33
|
assert_equal expected, actual
|
30
34
|
end
|
31
35
|
|
32
36
|
test 'stars with 5' do
|
33
37
|
actual = ui_star(5)
|
34
|
-
expected = '<span class="stars-notation"><i class="glyph
|
38
|
+
expected = '<span class="stars-notation"><i class="glyph fa-solid fa-star"></i> <i class="glyph fa-solid fa-star"></i> <i class="glyph fa-solid fa-star"></i> <i class="glyph fa-solid fa-star"></i> <i class="glyph fa-solid fa-star"></i></span>'
|
39
|
+
|
35
40
|
assert_equal expected, actual
|
36
41
|
end
|
37
42
|
|
38
43
|
test 'stars with number options 11.2' do
|
39
44
|
actual = ui_star(2.5, { num: 11.2 })
|
40
|
-
expected = '<span class="stars-notation"><i class="glyph
|
45
|
+
expected = '<span class="stars-notation"><i class="glyph fa-solid fa-star"></i> <i class="glyph fa-solid fa-star"></i> <i class="glyph fa-solid fa-star-half-alt"></i> <i class="glyph fa-regular fa-star"></i> <i class="glyph fa-regular fa-star"></i> <i class="glyph fa-regular fa-star"></i> <i class="glyph fa-regular fa-star"></i> <i class="glyph fa-regular fa-star"></i> <i class="glyph fa-regular fa-star"></i> <i class="glyph fa-regular fa-star"></i> <i class="glyph fa-regular fa-star"></i></span>'
|
46
|
+
|
41
47
|
assert_equal expected, actual
|
42
48
|
end
|
43
49
|
end
|
@@ -10,7 +10,7 @@ class BreadcrumbTest < ActionView::TestCase
|
|
10
10
|
b.link 'Home', url: '#home', glyph: 'home'
|
11
11
|
b.link 'state', { url: '#state', state: :active }
|
12
12
|
end
|
13
|
-
expected = "<nav arial-label=\"breadcrumb\"><ol class=\"breadcrumb\"><li class=\"breadcrumb-item\"><a href=\"#home\"><i class=\"glyph
|
13
|
+
expected = "<nav arial-label=\"breadcrumb\"><ol class=\"breadcrumb\"><li class=\"breadcrumb-item\"><a href=\"#home\"><i class=\"glyph fa-solid fa-home\"></i> Home</a></li><li class=\"active breadcrumb-item\"><a href=\"#state\">state</a></li></ol></nav>"
|
14
14
|
|
15
15
|
assert_equal expected, actual
|
16
16
|
end
|
@@ -13,7 +13,7 @@ class LinkTest < ActionView::TestCase
|
|
13
13
|
|
14
14
|
test 'Link without text' do
|
15
15
|
actual = ui_link 'My link', glyph: 'gem', text: false, url: '#link'
|
16
|
-
expected = "<a href=\"#link\"><i class=\"glyph
|
16
|
+
expected = "<a href=\"#link\"><i class=\"glyph fa-solid fa-gem\"></i> <span class=\"visually-hidden\">My link</span></a>"
|
17
17
|
|
18
18
|
assert_equal expected, actual
|
19
19
|
end
|
@@ -69,4 +69,15 @@ class NavTest < ActionView::TestCase
|
|
69
69
|
|
70
70
|
assert_equal expected, actual
|
71
71
|
end
|
72
|
+
|
73
|
+
test 'underline' do
|
74
|
+
actual = ui_nav(underline: true) do |n|
|
75
|
+
n.link 'Home', state: :active, url: '#Home', selector: 'home'
|
76
|
+
n.link 'Profile', url: '#profile', selector: 'profile', label: 16
|
77
|
+
n.link 'Messages', url: '#messages', selector: 'messages', state: :disabled
|
78
|
+
end
|
79
|
+
expected = "<ul class=\"nav nav-underline\"><li class=\"nav-item\"><a href=\"#Home\" class=\"active nav-link\">Home</a></li><li class=\"nav-item\"><a href=\"#profile\" class=\"nav-link\">Profile</a></li><li class=\"nav-item\"><a href=\"#messages\" class=\"disabled nav-link\">Messages</a></li></ul>"
|
80
|
+
|
81
|
+
assert_equal expected, actual
|
82
|
+
end
|
72
83
|
end
|
@@ -16,7 +16,7 @@ class AlertTest < ActionView::TestCase
|
|
16
16
|
a.header 'Information'
|
17
17
|
a.body 'Body text'
|
18
18
|
end
|
19
|
-
expected = "<div class=\"alert-success alert alert-dismissible\" role=\"alert\"><h4 class=\"alert-header\"><i class=\"glyph
|
19
|
+
expected = "<div class=\"alert-success alert alert-dismissible\" role=\"alert\"><h4 class=\"alert-header\"><i class=\"glyph fa-solid fa-thumbs-o-up\"></i> Information<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\" aria-label=\"Close\"></button></h4><hr /><p class=\"alert-body mb-0\">Body text</p></div>"
|
20
20
|
|
21
21
|
assert_equal expected, actual
|
22
22
|
end
|
@@ -6,21 +6,21 @@ class BadgeTest < ActionView::TestCase
|
|
6
6
|
|
7
7
|
test 'badge' do
|
8
8
|
actual = ui_badge 'state', status: :success, glyph: 'pencil'
|
9
|
-
expected = "<span class=\"bg-success badge\"><i class=\"glyph
|
9
|
+
expected = "<span class=\"bg-success badge\"><i class=\"glyph fa-solid fa-pencil\"></i> state</span>"
|
10
10
|
|
11
11
|
assert_equal expected, actual
|
12
12
|
end
|
13
13
|
|
14
14
|
test 'badge with url' do
|
15
15
|
actual = ui_badge 'state', url: 'http://example.com'
|
16
|
-
expected = '<a class="bg-
|
16
|
+
expected = '<a class="bg-secondary badge" href="http://example.com">state</a>'
|
17
17
|
|
18
18
|
assert_equal expected, actual
|
19
19
|
end
|
20
20
|
|
21
21
|
test 'badge pill' do
|
22
22
|
actual = ui_badge 'state', status: :success, type: :pill, glyph: 'pencil'
|
23
|
-
expected = "<span class=\"bg-success badge rounded-pill\"><i class=\"glyph
|
23
|
+
expected = "<span class=\"bg-success badge rounded-pill\"><i class=\"glyph fa-solid fa-pencil\"></i> state</span>"
|
24
24
|
|
25
25
|
assert_equal expected, actual
|
26
26
|
end
|
@@ -37,22 +37,22 @@ class PopoverTest < ActionView::TestCase
|
|
37
37
|
|
38
38
|
test 'glyph with popover object' do
|
39
39
|
popover = UiBibz::Ui::Core::Notifications::Popover.new(@parameters.merge(content: "My Content"))
|
40
|
-
actual = UiBibz::Ui::Core::Icons::Glyph.new("diamond", popover:
|
41
|
-
expected = "<i data-bs-toggle=\"popover\" data-bs-content=\"My Content\" data-bs-placement=\"left\" data-bs-animation=\"true\" data-bs-container=\"body\" data-bs-delay=\"10\" data-bs-html=\"true\" data-bs-selector=\"false\" data-bs-template=\"<b>\" data-bs-title=\"My title\" data-bs-trigger=\"hover focus\" data-bs-offset=\"2\" data-bs-fallbackPlacement=\"top right\" data-bs-boundary=\"clippingParents\" data-bs-customClass=\"test\" data-bs-popperConfig=\"Mystring\" class=\"glyph
|
40
|
+
actual = UiBibz::Ui::Core::Icons::Glyph.new("diamond", popover:).render
|
41
|
+
expected = "<i data-bs-toggle=\"popover\" data-bs-content=\"My Content\" data-bs-placement=\"left\" data-bs-animation=\"true\" data-bs-container=\"body\" data-bs-delay=\"10\" data-bs-html=\"true\" data-bs-selector=\"false\" data-bs-template=\"<b>\" data-bs-title=\"My title\" data-bs-trigger=\"hover focus\" data-bs-offset=\"2\" data-bs-fallbackPlacement=\"top right\" data-bs-boundary=\"clippingParents\" data-bs-customClass=\"test\" data-bs-popperConfig=\"Mystring\" class=\"glyph fa-solid fa-diamond\"></i>"
|
42
42
|
|
43
43
|
assert_equal expected, actual
|
44
44
|
end
|
45
45
|
|
46
46
|
test 'glyph with popover hash' do
|
47
47
|
actual = UiBibz::Ui::Core::Icons::Glyph.new("diamond", popover: @parameters.merge(content: "My Content")).render
|
48
|
-
expected = "<i data-bs-toggle=\"popover\" data-bs-content=\"My Content\" data-bs-placement=\"left\" data-bs-animation=\"true\" data-bs-container=\"body\" data-bs-delay=\"10\" data-bs-html=\"true\" data-bs-selector=\"false\" data-bs-template=\"<b>\" data-bs-title=\"My title\" data-bs-trigger=\"hover focus\" data-bs-offset=\"2\" data-bs-fallbackPlacement=\"top right\" data-bs-boundary=\"clippingParents\" data-bs-customClass=\"test\" data-bs-popperConfig=\"Mystring\" class=\"glyph
|
48
|
+
expected = "<i data-bs-toggle=\"popover\" data-bs-content=\"My Content\" data-bs-placement=\"left\" data-bs-animation=\"true\" data-bs-container=\"body\" data-bs-delay=\"10\" data-bs-html=\"true\" data-bs-selector=\"false\" data-bs-template=\"<b>\" data-bs-title=\"My title\" data-bs-trigger=\"hover focus\" data-bs-offset=\"2\" data-bs-fallbackPlacement=\"top right\" data-bs-boundary=\"clippingParents\" data-bs-customClass=\"test\" data-bs-popperConfig=\"Mystring\" class=\"glyph fa-solid fa-diamond\"></i>"
|
49
49
|
|
50
50
|
assert_equal expected, actual
|
51
51
|
end
|
52
52
|
|
53
53
|
test 'glyph with popover String' do
|
54
54
|
actual = UiBibz::Ui::Core::Icons::Glyph.new("diamond", popover: "My Content").render
|
55
|
-
expected = "<i data-bs-toggle=\"popover\" data-bs-content=\"My Content\" class=\"glyph
|
55
|
+
expected = "<i data-bs-toggle=\"popover\" data-bs-content=\"My Content\" class=\"glyph fa-solid fa-diamond\"></i>"
|
56
56
|
|
57
57
|
assert_equal expected, actual
|
58
58
|
end
|
@@ -27,7 +27,7 @@ class SpinnerTest < ActionView::TestCase
|
|
27
27
|
|
28
28
|
test 'spinner in button' do
|
29
29
|
actual = ui_button 'Load', spinner: { status: :danger, type: :grow }
|
30
|
-
expected = '<button class="btn-secondary btn"><span class="text-danger
|
30
|
+
expected = '<button class="btn-secondary btn"><span class="me-2 text-danger spinner-grow spinner-grow-sm" role="status"><span class="sr-only">Loading...</span></span>Load</button>'
|
31
31
|
|
32
32
|
assert_equal expected, actual
|
33
33
|
end
|
@@ -9,7 +9,7 @@ class ToastTest < ActionView::TestCase
|
|
9
9
|
t.header 'My header toast', glyph: 'eye', time: 'Now', class: 'my-header-toast'
|
10
10
|
t.body 'My body toast', class: 'my-body-toast'
|
11
11
|
end
|
12
|
-
expected = "<div data-bs-autohide=\"true\" class=\"my-toast toast align-items-center\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\"><div class=\"my-header-toast toast-header\"><i class=\"me-2 glyph
|
12
|
+
expected = "<div data-bs-autohide=\"true\" class=\"my-toast toast align-items-center\" role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\"><div class=\"my-header-toast toast-header\"><i class=\"me-2 glyph fa-solid fa-eye\"></i><strong class=\"me-auto\">My header toast</strong><small class=\"text-muted\">Now</small><button class=\"ml-2 mb-1 btn-close\" data-bs-dismiss=\"toast\" aria-label=\"Close\"></button></div><div class=\"my-body-toast toast-body\">My body toast</div></div>"
|
13
13
|
|
14
14
|
assert_equal expected, actual
|
15
15
|
end
|