ui_bibz 3.0.13 → 4.0.0.beta4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
@@ -74,7 +74,7 @@ module UiBibz::Ui::Core::Forms::Numbers
|
|
74
74
|
end
|
75
75
|
|
76
76
|
def range_html_options
|
77
|
-
{ max: options[:max] || 100, min: options[:min] || 0, step: options[:step] || 1, disabled:
|
77
|
+
{ max: options[:max] || 100, min: options[:min] || 0, step: options[:step] || 1, disabled: }
|
78
78
|
end
|
79
79
|
|
80
80
|
def not_on_hundred_percent?
|
@@ -93,42 +93,42 @@ module UiBibz::Ui::Core::Forms::Selects
|
|
93
93
|
end
|
94
94
|
|
95
95
|
def clickable_opt_group
|
96
|
-
|
96
|
+
@data_html_options_builder.add('enable_clickable_opt_groups', value: options[:clickable_opt_group])
|
97
97
|
end
|
98
98
|
|
99
99
|
def collapsible_opt_group
|
100
|
-
|
100
|
+
@data_html_options_builder.add('enable_collapsible_opt_groups', value: options[:collapsible_opt_group])
|
101
101
|
end
|
102
102
|
|
103
103
|
def searchable
|
104
|
-
|
105
|
-
|
104
|
+
@data_html_options_builder.add('enable_filtering') if options[:searchable]
|
105
|
+
@data_html_options_builder.add('fuzzy_search') if options[:searchable] == :fuzzy
|
106
106
|
end
|
107
107
|
|
108
108
|
def n_selected_text
|
109
|
-
|
109
|
+
@data_html_options_builder.add('n_selected_text', value: options[:n_selected_text])
|
110
110
|
end
|
111
111
|
|
112
112
|
def number_displayed
|
113
|
-
|
113
|
+
@data_html_options_builder.add('number_displayed', value: options[:number_displayed])
|
114
114
|
end
|
115
115
|
|
116
116
|
def select_all_options
|
117
|
-
|
117
|
+
@data_html_options_builder.add('include_select_all_option', value: options[:select_all_options])
|
118
118
|
end
|
119
119
|
|
120
120
|
def non_selected_text
|
121
|
-
|
121
|
+
@data_html_options_builder.add('non_selected_text', value: options[:non_selected_text])
|
122
122
|
end
|
123
123
|
|
124
124
|
def dropdown_menu_classes
|
125
125
|
classes = join_classes(theme, alignment, open)
|
126
|
-
|
126
|
+
@data_html_options_builder.add('dropdown_menu_classes', value: classes&.join(' '))
|
127
127
|
end
|
128
128
|
|
129
129
|
def dropdown_classes
|
130
130
|
classes = join_classes(position, open)
|
131
|
-
|
131
|
+
@data_html_options_builder.add('dropdown_classes', value: classes&.join(' '))
|
132
132
|
end
|
133
133
|
|
134
134
|
def position
|
@@ -71,11 +71,11 @@ module UiBibz::Ui::Core::Forms::Selects
|
|
71
71
|
end
|
72
72
|
|
73
73
|
def searchable
|
74
|
-
|
74
|
+
@data_html_options_builder.add('searchable', value: options[:searchable])
|
75
75
|
end
|
76
76
|
|
77
77
|
def selectable_opt_group
|
78
|
-
|
78
|
+
@data_html_options_builder.add('selectable_optgroup', value: options[:selectable_opt_group])
|
79
79
|
end
|
80
80
|
|
81
81
|
def status
|
@@ -52,7 +52,7 @@ module UiBibz::Ui::Core::Forms::Surrounds
|
|
52
52
|
attr_reader :errors, :required_fields
|
53
53
|
|
54
54
|
# See UiBibz::Ui::Core::Component.initialize
|
55
|
-
def initialize(
|
55
|
+
def initialize(...)
|
56
56
|
super
|
57
57
|
@items = []
|
58
58
|
@errors = []
|
@@ -64,68 +64,68 @@ module UiBibz::Ui::Core::Forms::Surrounds
|
|
64
64
|
content_tag :div, @items.join.html_safe, html_options
|
65
65
|
end
|
66
66
|
|
67
|
-
def dropdown(content, options = nil, html_options = nil, &
|
68
|
-
@items << SurroundDropdown.new(content, options, html_options).tap(&
|
67
|
+
def dropdown(content, options = nil, html_options = nil, &)
|
68
|
+
@items << SurroundDropdown.new(content, options, html_options).tap(&).render
|
69
69
|
end
|
70
70
|
|
71
|
-
def input(attribute_name, options = {}, &
|
72
|
-
@items << @options[:form].input(attribute_name, options.merge({ label: false, wrapper: false, error: false }), &
|
71
|
+
def input(attribute_name, options = {}, &)
|
72
|
+
@items << @options[:form].input(attribute_name, options.merge({ label: false, wrapper: false, error: false }), &)
|
73
73
|
obj = @options[:form].object
|
74
74
|
@errors << obj.errors[attribute_name] unless obj.errors[attribute_name].empty?
|
75
|
-
@required_fields << (obj._validators[attribute_name].try(:first).
|
75
|
+
@required_fields << (obj._validators[attribute_name].try(:first).instance_of?(::ActiveRecord::Validations::PresenceValidator))
|
76
76
|
end
|
77
77
|
|
78
|
-
def glyph(content = nil, options = {}, html_options = nil, &
|
79
|
-
@items << SurroundAddon.new(UiBibz::Ui::Core::Icons::Glyph.new(content, options, html_options, &
|
78
|
+
def glyph(content = nil, options = {}, html_options = nil, &)
|
79
|
+
@items << SurroundAddon.new(UiBibz::Ui::Core::Icons::Glyph.new(content, options, html_options, &).render).render
|
80
80
|
end
|
81
81
|
|
82
|
-
def addon(content = nil, options = {}, html_options = nil, &
|
83
|
-
@items << SurroundAddon.new(content, options, html_options, &
|
82
|
+
def addon(content = nil, options = {}, html_options = nil, &)
|
83
|
+
@items << SurroundAddon.new(content, options, html_options, &).render
|
84
84
|
end
|
85
85
|
|
86
|
-
def button(content = nil, options = nil, html_options = nil, &
|
87
|
-
@items << SurroundButton.new(content, options, html_options, &
|
86
|
+
def button(content = nil, options = nil, html_options = nil, &)
|
87
|
+
@items << SurroundButton.new(content, options, html_options, &).render
|
88
88
|
end
|
89
89
|
|
90
|
-
def button_group(content = nil, options = nil, html_options = nil, &
|
91
|
-
@items << SurroundButtonGroup.new(content, options, html_options).tap(&
|
90
|
+
def button_group(content = nil, options = nil, html_options = nil, &)
|
91
|
+
@items << SurroundButtonGroup.new(content, options, html_options).tap(&).render
|
92
92
|
end
|
93
93
|
|
94
|
-
def button_link(content = nil, options = nil, html_options = nil, &
|
95
|
-
@items << SurroundButtonLink.new(content, options, html_options, &
|
94
|
+
def button_link(content = nil, options = nil, html_options = nil, &)
|
95
|
+
@items << SurroundButtonLink.new(content, options, html_options, &).render
|
96
96
|
end
|
97
97
|
|
98
|
-
def button_refresh(content = nil, options = nil, html_options = nil, &
|
99
|
-
@items << SurroundButtonRefresh.new(content, options, html_options, &
|
98
|
+
def button_refresh(content = nil, options = nil, html_options = nil, &)
|
99
|
+
@items << SurroundButtonRefresh.new(content, options, html_options, &).render
|
100
100
|
end
|
101
101
|
|
102
|
-
def checkbox_field(content = nil, options = nil, html_options = nil, &
|
103
|
-
@items << SurroundCheckboxField.new(content, options, html_options, &
|
102
|
+
def checkbox_field(content = nil, options = nil, html_options = nil, &)
|
103
|
+
@items << SurroundCheckboxField.new(content, options, html_options, &).render
|
104
104
|
end
|
105
105
|
|
106
|
-
def radio_field(content = nil, options = nil, html_options = nil, &
|
107
|
-
@items << SurroundRadioField.new(content, options, html_options, &
|
106
|
+
def radio_field(content = nil, options = nil, html_options = nil, &)
|
107
|
+
@items << SurroundRadioField.new(content, options, html_options, &).render
|
108
108
|
end
|
109
109
|
|
110
|
-
def text_field(content = nil, options = nil, html_options = nil, &
|
111
|
-
@items << UiBibz::Ui::Core::Forms::Texts::TextField.new(content, options, html_options, &
|
110
|
+
def text_field(content = nil, options = nil, html_options = nil, &)
|
111
|
+
@items << UiBibz::Ui::Core::Forms::Texts::TextField.new(content, options, html_options, &).render
|
112
112
|
end
|
113
113
|
|
114
|
-
def date_picker_field(content = nil, options = nil, html_options = nil, &
|
115
|
-
@items << UiBibz::Ui::Core::Forms::Dates::DatePickerField.new(content, options, html_options, &
|
114
|
+
def date_picker_field(content = nil, options = nil, html_options = nil, &)
|
115
|
+
@items << UiBibz::Ui::Core::Forms::Dates::DatePickerField.new(content, options, html_options, &).render
|
116
116
|
end
|
117
117
|
|
118
|
-
def dropdown_select_field(content = nil, options = nil, html_options = nil, &
|
118
|
+
def dropdown_select_field(content = nil, options = nil, html_options = nil, &)
|
119
119
|
html_options = (html_options || {}).merge('data-wrapper-classes': 'input-group-btn')
|
120
|
-
@items << UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new(content, options, html_options, &
|
120
|
+
@items << UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new(content, options, html_options, &).render
|
121
121
|
end
|
122
122
|
|
123
|
-
def select_field(content = nil, options = nil, html_options = nil, &
|
124
|
-
@items << UiBibz::Ui::Core::Forms::Selects::SelectField.new(content, options, html_options, &
|
123
|
+
def select_field(content = nil, options = nil, html_options = nil, &)
|
124
|
+
@items << UiBibz::Ui::Core::Forms::Selects::SelectField.new(content, options, html_options, &).render
|
125
125
|
end
|
126
126
|
|
127
|
-
def auto_complete_field(content = nil, options = nil, html_options = nil, &
|
128
|
-
@items << UiBibz::Ui::Core::Forms::Texts::AutoCompleteField.new(content, options, html_options, &
|
127
|
+
def auto_complete_field(content = nil, options = nil, html_options = nil, &)
|
128
|
+
@items << UiBibz::Ui::Core::Forms::Texts::AutoCompleteField.new(content, options, html_options, &).render
|
129
129
|
end
|
130
130
|
|
131
131
|
# Not correctly implemented
|
@@ -56,7 +56,6 @@ module UiBibz::Ui::Core::Forms::Textareas
|
|
56
56
|
private
|
57
57
|
|
58
58
|
def component_html_data
|
59
|
-
super
|
60
59
|
provide
|
61
60
|
autofocus
|
62
61
|
savable
|
@@ -67,31 +66,31 @@ module UiBibz::Ui::Core::Forms::Textareas
|
|
67
66
|
end
|
68
67
|
|
69
68
|
def provide
|
70
|
-
|
69
|
+
@data_html_options_builder.add('provide', value: 'markdown')
|
71
70
|
end
|
72
71
|
|
73
72
|
def autofocus
|
74
|
-
|
73
|
+
@data_html_options_builder.add('autofocus', value: options[:autofocus])
|
75
74
|
end
|
76
75
|
|
77
76
|
def savable
|
78
|
-
|
77
|
+
@data_html_options_builder.add('savable', value: options[:savable])
|
79
78
|
end
|
80
79
|
|
81
80
|
def hideable
|
82
|
-
|
81
|
+
@data_html_options_builder.add('hideable', value: options[:hideable])
|
83
82
|
end
|
84
83
|
|
85
84
|
def icon_library
|
86
|
-
|
85
|
+
@data_html_options_builder.add('iconlibrary', value: 'fa')
|
87
86
|
end
|
88
87
|
|
89
88
|
def hidden_buttons
|
90
|
-
|
89
|
+
@data_html_options_builder.add('hiddenButtons', value: options[:hidden_buttons])
|
91
90
|
end
|
92
91
|
|
93
92
|
def disabled_buttons
|
94
|
-
|
93
|
+
@data_html_options_builder.add('disabledButtons', value: options[:disabled_buttons])
|
95
94
|
end
|
96
95
|
|
97
96
|
def status
|
@@ -0,0 +1,96 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'ui_bibz/ui/extensions/core/forms/surround_extension'
|
4
|
+
module UiBibz::Ui::Core::Forms::Texts
|
5
|
+
# Create a ComboboxField
|
6
|
+
#
|
7
|
+
# This element is an extend of UiBibz::Ui::Core::Component.
|
8
|
+
#
|
9
|
+
# ==== Attributes
|
10
|
+
#
|
11
|
+
# * +content+ - Content of element
|
12
|
+
# * +options+ - Options of element
|
13
|
+
# * +html_options+ - Html Options of element
|
14
|
+
#
|
15
|
+
# ==== Options
|
16
|
+
#
|
17
|
+
# You can add HTML attributes using the +html_options+.
|
18
|
+
# You can pass arguments in options attribute:
|
19
|
+
# * +url+ - String [required]
|
20
|
+
# * +append+ - String, Html
|
21
|
+
# * +prepend+ - String, Html
|
22
|
+
#
|
23
|
+
# ==== Signatures
|
24
|
+
#
|
25
|
+
# UiBibz::Ui::Core::Forms::Texts::ComboboxField.new(content, options = {}, html_options = {}).render
|
26
|
+
#
|
27
|
+
# UiBibz::Ui::Core::Forms::Texts::ComboboxField.new(options = {}, html_options = {}) do
|
28
|
+
# content
|
29
|
+
# end.render
|
30
|
+
#
|
31
|
+
# ==== Examples
|
32
|
+
#
|
33
|
+
# UiBibz::Ui::Core::Forms::Texts::ComboboxField.new('company', { debounce: 200, url: 'http://exemple.com/list' }, { class: 'test' })
|
34
|
+
#
|
35
|
+
# UiBibz::Ui::Core::Forms::Texts::ComboboxField.new(url: 'http://exemple.com/list') do
|
36
|
+
# #content
|
37
|
+
# end
|
38
|
+
#
|
39
|
+
# ==== Helper
|
40
|
+
#
|
41
|
+
# combobox_field(options = {}, html_options = {}) do
|
42
|
+
# # content
|
43
|
+
# end
|
44
|
+
#
|
45
|
+
class ComboboxField < UiBibz::Ui::Core::Forms::Texts::TextField
|
46
|
+
# See UiBibz::Ui::Core::Component.initialize
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def text_field_input_tag
|
51
|
+
content_tag :div, data: data_controller_attributes, class: 'combobox' do
|
52
|
+
text_field_tag(content, options[:value] || html_options[:value], html_options) + combobox_list_render
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def combobox_list_render
|
57
|
+
content_tag :div, class: 'combobox-list' do
|
58
|
+
content_tag 'turbo-frame', '', id: combobox_list_name, src: ''
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def component_html_options
|
63
|
+
{ autocomplete: false, disabled: options[:state] }
|
64
|
+
end
|
65
|
+
|
66
|
+
def component_html_classes
|
67
|
+
super << 'combobox-field'
|
68
|
+
end
|
69
|
+
|
70
|
+
def combobox_list_name
|
71
|
+
@combobox_list_name ||= "#{html_options[:id] || content.to_s.parameterize.underscore}-combobox-list"
|
72
|
+
end
|
73
|
+
|
74
|
+
def component_html_data
|
75
|
+
@data_html_options_builder.add('action', value: data_actions)
|
76
|
+
end
|
77
|
+
|
78
|
+
def data_controller_attributes
|
79
|
+
{
|
80
|
+
controller: data_controllers,
|
81
|
+
'combobox-url-value': options[:url],
|
82
|
+
'combobox-debounce-value': options[:debounce]
|
83
|
+
}
|
84
|
+
end
|
85
|
+
|
86
|
+
def data_actions
|
87
|
+
actions = [options[:action], html_options.dig(:data, :action)].compact
|
88
|
+
actions.blank? ? 'keyup->combobox#search' : actions.join(' ')
|
89
|
+
end
|
90
|
+
|
91
|
+
def data_controllers
|
92
|
+
controllers = [options.delete(:controller), html_options.try(:[], :data).try(:delete, :controller), @data_html_options_builder.html_options.try(:[], :data).try(:delete, :controller)].compact
|
93
|
+
controllers.blank? ? 'combobox' : controllers.join(' ')
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
@@ -21,7 +21,7 @@ module UiBibz::Ui::Core::Icons::Components
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def transform
|
24
|
-
|
24
|
+
@data_html_options_builder.add 'fa_transform', value: options[:transform] if options[:transform]
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
@@ -67,7 +67,7 @@ module UiBibz::Ui::Core::Icons
|
|
67
67
|
private
|
68
68
|
|
69
69
|
def component_html_classes
|
70
|
-
join_classes(classes)
|
70
|
+
UiBibz::Builders::HtmlClassesBuilder.join_classes(classes)
|
71
71
|
end
|
72
72
|
|
73
73
|
def component_html_data
|
@@ -124,7 +124,7 @@ module UiBibz::Ui::Core::Icons
|
|
124
124
|
end
|
125
125
|
|
126
126
|
def transform
|
127
|
-
|
127
|
+
@data_html_options_builder.add 'fa_transform', value: options[:transform]
|
128
128
|
end
|
129
129
|
|
130
130
|
def content
|
@@ -136,7 +136,8 @@ module UiBibz::Ui::Core::Icons
|
|
136
136
|
end
|
137
137
|
|
138
138
|
def match_style
|
139
|
-
{ solid: '
|
139
|
+
{ solid: 'fa-solid', regular: 'fa-regular', light: 'fa-light',
|
140
|
+
brands: 'fa-brands', duotone: 'fa-duotone', thin: 'fa-thin' }
|
140
141
|
end
|
141
142
|
|
142
143
|
def label
|
@@ -60,8 +60,8 @@ module UiBibz::Ui::Core::Layouts
|
|
60
60
|
content_tag :div, @items.join.html_safe, html_options
|
61
61
|
end
|
62
62
|
|
63
|
-
def col(content = nil, options = nil, html_options = nil, &
|
64
|
-
@items << UiBibz::Ui::Core::Layouts::Col.new(content, options, html_options, &
|
63
|
+
def col(content = nil, options = nil, html_options = nil, &)
|
64
|
+
@items << UiBibz::Ui::Core::Layouts::Col.new(content, options, html_options, &).render
|
65
65
|
end
|
66
66
|
|
67
67
|
private
|
@@ -71,13 +71,13 @@ module UiBibz::Ui::Core::Lists::Components
|
|
71
71
|
end
|
72
72
|
|
73
73
|
# Add header which is a component
|
74
|
-
def header(content = nil, options = nil, html_options = nil, &
|
75
|
-
@header = UiBibz::Ui::Core::Lists::Components::ListHeader.new
|
74
|
+
def header(content = nil, options = nil, html_options = nil, &)
|
75
|
+
@header = UiBibz::Ui::Core::Lists::Components::ListHeader.new(content, options, html_options, &)
|
76
76
|
end
|
77
77
|
|
78
78
|
# Add body which is a component
|
79
|
-
def body(content = nil, options = nil, html_options = nil, &
|
80
|
-
@body = UiBibz::Ui::Core::Lists::Components::ListBody.new
|
79
|
+
def body(content = nil, options = nil, html_options = nil, &)
|
80
|
+
@body = UiBibz::Ui::Core::Lists::Components::ListBody.new(content, options, html_options, &)
|
81
81
|
end
|
82
82
|
|
83
83
|
private
|
@@ -71,7 +71,7 @@ module UiBibz::Ui::Core::Navigations
|
|
71
71
|
include UiBibz::Ui::Concerns::HtmlConcern
|
72
72
|
|
73
73
|
# See UiBibz::Ui::Core::Component.initialize
|
74
|
-
def initialize(
|
74
|
+
def initialize(...)
|
75
75
|
super
|
76
76
|
@links = []
|
77
77
|
generate_links unless @content.nil?
|
@@ -86,14 +86,16 @@ module UiBibz::Ui::Core::Navigations
|
|
86
86
|
|
87
87
|
# Add breadcrumb link items
|
88
88
|
# See UiBibz::Ui::Core::BreadcrumbLink
|
89
|
-
def link(content = nil, options = nil, html_options = nil, &
|
90
|
-
@links << UiBibz::Ui::Core::Navigations::Components::BreadcrumbLink.new(content, options, html_options, &
|
89
|
+
def link(content = nil, options = nil, html_options = nil, &)
|
90
|
+
@links << UiBibz::Ui::Core::Navigations::Components::BreadcrumbLink.new(content, options, html_options, &).render
|
91
91
|
end
|
92
92
|
|
93
93
|
private
|
94
94
|
|
95
95
|
def component_html_options
|
96
|
-
super.merge({ 'arial-label': 'breadcrumb' })
|
96
|
+
html_opts = super.merge({ 'arial-label': 'breadcrumb' })
|
97
|
+
html_opts = html_opts.merge(style: "--bs-breadcrumb-divider: '#{@options[:divider]}';") unless @options[:divider].nil?
|
98
|
+
html_opts
|
97
99
|
end
|
98
100
|
|
99
101
|
def model_name
|
@@ -49,7 +49,7 @@ module UiBibz::Ui::Core::Navigations
|
|
49
49
|
attr_accessor :html_options
|
50
50
|
|
51
51
|
def initialize(model_or_url, options = {}, &block)
|
52
|
-
init_haml_helpers
|
52
|
+
# init_haml_helpers
|
53
53
|
@content = block
|
54
54
|
@model_or_url = model_or_url
|
55
55
|
@options = options
|
@@ -60,22 +60,23 @@ module UiBibz::Ui::Core::Navigations
|
|
60
60
|
def render
|
61
61
|
case type
|
62
62
|
when :form_for
|
63
|
-
|
63
|
+
form_for(@model_or_url, html_options, &@content)
|
64
64
|
when :ui_form_for
|
65
65
|
begin
|
66
|
-
|
66
|
+
ui_form_for(@model_or_url, html_options, &@content)
|
67
67
|
rescue e
|
68
68
|
raise 'You must install simple form to use ui_form_for.'
|
69
69
|
end
|
70
70
|
else
|
71
|
-
|
71
|
+
context = eval('self', @content.binding, __FILE__, __LINE__)
|
72
|
+
form_tag_with_body(html_options, context.capture(&@content))
|
72
73
|
end
|
73
74
|
end
|
74
75
|
|
75
76
|
private
|
76
77
|
|
77
78
|
def new_option
|
78
|
-
(@options || {}).merge({ class: UiBibz::
|
79
|
+
(@options || {}).merge({ class: UiBibz::Builders::HtmlClassesBuilder.join_classes('d-flex', @options[:class]) })
|
79
80
|
end
|
80
81
|
|
81
82
|
def protect_against_forgery?
|
@@ -49,7 +49,7 @@ module UiBibz::Ui::Core::Navigations
|
|
49
49
|
attr_accessor :html_options
|
50
50
|
|
51
51
|
def initialize(model_or_url, options = {}, &block)
|
52
|
-
init_haml_helpers
|
52
|
+
# init_haml_helpers
|
53
53
|
@content = block
|
54
54
|
@model_or_url = model_or_url
|
55
55
|
@options = options
|
@@ -75,7 +75,7 @@ module UiBibz::Ui::Core::Navigations
|
|
75
75
|
private
|
76
76
|
|
77
77
|
def new_option
|
78
|
-
(@options || {}).merge({ class: UiBibz::
|
78
|
+
(@options || {}).merge({ class: UiBibz::Builders::HtmlClassesBuilder.join_classes('btn-group', @options[:class]) })
|
79
79
|
end
|
80
80
|
|
81
81
|
def protect_against_forgery?
|
@@ -70,7 +70,7 @@ module UiBibz::Ui::Core::Navigations
|
|
70
70
|
include UiBibz::Ui::Concerns::NavigationConcern
|
71
71
|
|
72
72
|
# See UiBibz::Ui::Core::Component.initialize
|
73
|
-
def initialize(
|
73
|
+
def initialize(...)
|
74
74
|
super
|
75
75
|
@items = []
|
76
76
|
end
|
@@ -99,20 +99,20 @@ module UiBibz::Ui::Core::Navigations
|
|
99
99
|
end
|
100
100
|
|
101
101
|
# Add nav in nav
|
102
|
-
def nav(content = nil, options = {}, html_options = nil, &
|
103
|
-
@items << UiBibz::Ui::Core::Component.new(Nav.new(content, options).tap(&
|
102
|
+
def nav(content = nil, options = {}, html_options = nil, &)
|
103
|
+
@items << UiBibz::Ui::Core::Component.new(Nav.new(content, options).tap(&).render, {}, html_options)
|
104
104
|
end
|
105
105
|
|
106
106
|
# Add nav dropdown items
|
107
107
|
# See UiBibz::Ui::Core::Navigations::NavDropdown
|
108
|
-
def dropdown(content = nil, options = {}, html_options = nil, &
|
109
|
-
@items << NavDropdown.new(content, options, html_options).tap(&
|
108
|
+
def dropdown(content = nil, options = {}, html_options = nil, &)
|
109
|
+
@items << NavDropdown.new(content, options, html_options).tap(&)
|
110
110
|
end
|
111
111
|
|
112
112
|
protected
|
113
113
|
|
114
114
|
def component_html_classes
|
115
|
-
[nav_class, type, position, stacked, justify, fill]
|
115
|
+
[nav_class, type, position, stacked, justify, fill, underline]
|
116
116
|
end
|
117
117
|
|
118
118
|
def component_html_options
|
@@ -173,5 +173,9 @@ module UiBibz::Ui::Core::Navigations
|
|
173
173
|
def nav_tags
|
174
174
|
@options[:nav_tags]
|
175
175
|
end
|
176
|
+
|
177
|
+
def underline
|
178
|
+
'nav-underline' if @options[:underline]
|
179
|
+
end
|
176
180
|
end
|
177
181
|
end
|
@@ -78,7 +78,7 @@ module UiBibz::Ui::Core::Navigations
|
|
78
78
|
include UiBibz::Ui::Concerns::NavigationConcern
|
79
79
|
|
80
80
|
# See UiBibz::Ui::Core::Component.initialize
|
81
|
-
def initialize(
|
81
|
+
def initialize(...)
|
82
82
|
super
|
83
83
|
@items = []
|
84
84
|
end
|
@@ -87,42 +87,44 @@ module UiBibz::Ui::Core::Navigations
|
|
87
87
|
def pre_render
|
88
88
|
content_tag :nav, html_options do
|
89
89
|
UiBibz::Ui::Core::Layouts::Container.new(options[:container], options[:container_html]) do
|
90
|
-
|
91
|
-
|
92
|
-
|
90
|
+
capture do
|
91
|
+
if brand_position == :left
|
92
|
+
concat title
|
93
|
+
concat @navbar_toggle_html
|
94
|
+
end
|
95
|
+
concat navbar_toggle_button_html
|
96
|
+
if brand_position == :right
|
97
|
+
concat title
|
98
|
+
concat @navbar_toggle_html
|
99
|
+
end
|
100
|
+
concat body_html
|
93
101
|
end
|
94
|
-
concat navbar_toggle_button_html
|
95
|
-
if brand_position == :right
|
96
|
-
concat title
|
97
|
-
concat @navbar_toggle_html
|
98
|
-
end
|
99
|
-
concat body_html
|
100
102
|
end.render
|
101
103
|
end
|
102
104
|
end
|
103
105
|
|
104
106
|
# Add navbar nav items
|
105
107
|
# See UiBibz::Ui::Core::NavbarNav
|
106
|
-
def nav(content = nil, options = nil, html_options = nil, &
|
108
|
+
def nav(content = nil, options = nil, html_options = nil, &)
|
107
109
|
options ||= {}
|
108
|
-
@items << UiBibz::Ui::Core::Navigations::NavbarNav.new(content, options, html_options).tap(&
|
110
|
+
@items << UiBibz::Ui::Core::Navigations::NavbarNav.new(content, options, html_options).tap(&)
|
109
111
|
end
|
110
112
|
|
111
113
|
# Add navbar form items
|
112
114
|
# See UiBibz::Ui::Core::NavbarForm
|
113
|
-
def form(model_or_url, options = {}, &
|
114
|
-
@items << UiBibz::Ui::Core::Navigations::NavbarForm.new(model_or_url, options, &
|
115
|
+
def form(model_or_url, options = {}, &)
|
116
|
+
@items << UiBibz::Ui::Core::Navigations::NavbarForm.new(model_or_url, options, &)
|
115
117
|
end
|
116
118
|
|
117
119
|
# Not use !!!!!
|
118
120
|
# Add navbar text items
|
119
121
|
# See UiBibz::Ui::Core::NavbarText
|
120
|
-
def text(content = nil, options = nil, html_options = nil, &
|
121
|
-
@items << UiBibz::Ui::Core::Navigations::NavbarText.new(content, options, html_options, &
|
122
|
+
def text(content = nil, options = nil, html_options = nil, &)
|
123
|
+
@items << UiBibz::Ui::Core::Navigations::NavbarText.new(content, options, html_options, &)
|
122
124
|
end
|
123
125
|
|
124
|
-
def brand(content = nil, options = nil, html_options = nil, &
|
125
|
-
@brand = UiBibz::Ui::Core::Navigations::NavbarBrand.new(content, options, html_options, &
|
126
|
+
def brand(content = nil, options = nil, html_options = nil, &)
|
127
|
+
@brand = UiBibz::Ui::Core::Navigations::NavbarBrand.new(content, options, html_options, &).render
|
126
128
|
end
|
127
129
|
|
128
130
|
def id
|
@@ -153,7 +155,7 @@ module UiBibz::Ui::Core::Navigations
|
|
153
155
|
end
|
154
156
|
|
155
157
|
def body_html
|
156
|
-
content_tag
|
158
|
+
content_tag(:div, class: 'navbar-collapse collapse', id:) do
|
157
159
|
concat @items.map(&:render).join.html_safe
|
158
160
|
end
|
159
161
|
end
|
@@ -56,7 +56,7 @@ module UiBibz::Ui::Core::Navigations
|
|
56
56
|
include UiBibz::Ui::Concerns::HtmlConcern
|
57
57
|
|
58
58
|
# See UiBibz::Ui::Core::Component.initialize
|
59
|
-
def initialize(
|
59
|
+
def initialize(...)
|
60
60
|
super
|
61
61
|
@items = []
|
62
62
|
end
|
@@ -70,8 +70,8 @@ module UiBibz::Ui::Core::Navigations
|
|
70
70
|
|
71
71
|
# Add nav link items
|
72
72
|
# See UiBibz::Ui::Core::Navigations::NavLink
|
73
|
-
def link(content = nil, options = {}, html_options = nil, &
|
74
|
-
@items << PaginationLink.new(content, options, html_options, &
|
73
|
+
def link(content = nil, options = {}, html_options = nil, &)
|
74
|
+
@items << PaginationLink.new(content, options, html_options, &).render
|
75
75
|
end
|
76
76
|
|
77
77
|
private
|