ui_bibz 3.0.13 → 4.0.0.beta3
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 +178 -138
- data/app/assets/config/ui_bibz.js +12 -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 +8 -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/_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 +19 -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 +50 -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/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/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 +25 -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/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/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 +120 -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
@@ -58,7 +58,7 @@ module UiBibz::Ui::Core::Notifications
|
|
58
58
|
include UiBibz::Ui::Concerns::HtmlConcern
|
59
59
|
|
60
60
|
# See UiBibz::Ui::Core::Component.initialize
|
61
|
-
def initialize(
|
61
|
+
def initialize(...)
|
62
62
|
super
|
63
63
|
@items = []
|
64
64
|
end
|
@@ -68,8 +68,8 @@ module UiBibz::Ui::Core::Notifications
|
|
68
68
|
content_tag :div, bars.join.html_safe, html_options
|
69
69
|
end
|
70
70
|
|
71
|
-
def bar(content = nil, options = nil, html_options = nil, &
|
72
|
-
@items << UiBibz::Ui::Core::Notifications::Components::Bar.new(content, options, html_options, &
|
71
|
+
def bar(content = nil, options = nil, html_options = nil, &)
|
72
|
+
@items << UiBibz::Ui::Core::Notifications::Components::Bar.new(content, options, html_options, &).render
|
73
73
|
end
|
74
74
|
|
75
75
|
private
|
@@ -56,7 +56,7 @@ module UiBibz::Ui::Core::Notifications
|
|
56
56
|
#
|
57
57
|
class Toast < UiBibz::Ui::Core::Component
|
58
58
|
# See UiBibz::Ui::Core::Component.initialize
|
59
|
-
def initialize(
|
59
|
+
def initialize(...)
|
60
60
|
super
|
61
61
|
body(@content) unless @tapped
|
62
62
|
end
|
@@ -70,19 +70,19 @@ module UiBibz::Ui::Core::Notifications
|
|
70
70
|
end
|
71
71
|
|
72
72
|
# Add Header which is a component
|
73
|
-
def header(content = nil, options = nil, html_options = nil, &
|
74
|
-
@header = UiBibz::Ui::Core::Notifications::Components::ToastHeader.new(content, options, html_options, &
|
73
|
+
def header(content = nil, options = nil, html_options = nil, &)
|
74
|
+
@header = UiBibz::Ui::Core::Notifications::Components::ToastHeader.new(content, options, html_options, &).render
|
75
75
|
end
|
76
76
|
|
77
77
|
# Add Body which is a component
|
78
|
-
def body(content = nil, options = nil, html_options = nil, &
|
78
|
+
def body(content = nil, options = nil, html_options = nil, &)
|
79
79
|
@body = if @header.nil?
|
80
80
|
content_tag :div, class: 'd-flex' do
|
81
|
-
concat UiBibz::Ui::Core::Notifications::Components::ToastBody.new(content, options, html_options, &
|
81
|
+
concat UiBibz::Ui::Core::Notifications::Components::ToastBody.new(content, options, html_options, &).render
|
82
82
|
concat close_html if (options || {})[:closable]
|
83
83
|
end
|
84
84
|
else
|
85
|
-
UiBibz::Ui::Core::Notifications::Components::ToastBody.new(content, options, html_options, &
|
85
|
+
UiBibz::Ui::Core::Notifications::Components::ToastBody.new(content, options, html_options, &).render
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
@@ -106,8 +106,7 @@ module UiBibz::Ui::Core::Notifications
|
|
106
106
|
end
|
107
107
|
|
108
108
|
def component_html_data
|
109
|
-
|
110
|
-
add_html_data 'bs-autohide', value: options[:auto_hide] if options[:auto_hide]
|
109
|
+
@data_html_options_builder.add 'bs-autohide', value: options[:auto_hide]
|
111
110
|
end
|
112
111
|
|
113
112
|
def status
|
@@ -131,7 +130,7 @@ module UiBibz::Ui::Core::Notifications
|
|
131
130
|
end
|
132
131
|
|
133
132
|
def close_button_classes
|
134
|
-
UiBibz::
|
133
|
+
UiBibz::Builders::HtmlClassesBuilder.join_classes('btn-close', 'me-2', 'm-auto', white_btn_color)
|
135
134
|
end
|
136
135
|
end
|
137
136
|
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module UiBibz::Ui::Core::Windows::Components
|
4
|
+
# Create a offcanvas body
|
5
|
+
#
|
6
|
+
# ==== Attributes
|
7
|
+
#
|
8
|
+
# * +content+ - Content of element
|
9
|
+
# * +options+ - Options of element
|
10
|
+
# * +html_options+ - Html Options of element
|
11
|
+
#
|
12
|
+
# ==== Options
|
13
|
+
#
|
14
|
+
# You can add HTML attributes using the +html_options+.
|
15
|
+
# You can pass arguments in options attribute:
|
16
|
+
#
|
17
|
+
# ==== Signatures
|
18
|
+
#
|
19
|
+
# UiBibz::Ui::Core::OffcanvasBody.new(content, options = nil, html_options = nil)
|
20
|
+
#
|
21
|
+
# UiBibz::Ui::Core::OffcanvasBody.new(options = nil, html_options = nil) do
|
22
|
+
# content
|
23
|
+
# end
|
24
|
+
#
|
25
|
+
# ==== Examples
|
26
|
+
#
|
27
|
+
# UiBibz::Ui::Core::OffcanvasBody.new.render
|
28
|
+
#
|
29
|
+
# UiBibz::Ui::Core::OffcanvasBody.new do
|
30
|
+
# 'Exemple'
|
31
|
+
# end.render
|
32
|
+
#
|
33
|
+
class OffcanvasBody < UiBibz::Ui::Core::Component
|
34
|
+
# See UiBibz::Ui::Core::Component.initialize
|
35
|
+
|
36
|
+
# Render html tag
|
37
|
+
def pre_render
|
38
|
+
content_tag :div, content, html_options
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def component_html_classes
|
44
|
+
'offcanvas-body'
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module UiBibz::Ui::Core::Windows::Components
|
4
|
+
# Create a offcanvas header
|
5
|
+
#
|
6
|
+
# ==== Attributes
|
7
|
+
#
|
8
|
+
# * +content+ - Content of element
|
9
|
+
# * +options+ - Options of element
|
10
|
+
# * +html_options+ - Html Options of element
|
11
|
+
#
|
12
|
+
# ==== Options
|
13
|
+
#
|
14
|
+
# You can add HTML attributes using the +html_options+.
|
15
|
+
# You can pass arguments in options attribute:
|
16
|
+
#
|
17
|
+
# ==== Signatures
|
18
|
+
#
|
19
|
+
# UiBibz::Ui::Core::OffcanvasHeader.new(content, options = nil, html_options = nil)
|
20
|
+
#
|
21
|
+
# UiBibz::Ui::Core::CarHeader.new(options = nil, html_options = nil) do
|
22
|
+
# content
|
23
|
+
# end
|
24
|
+
#
|
25
|
+
# ==== Examples
|
26
|
+
#
|
27
|
+
# UiBibz::Ui::Core::OffcanvasHeader.new.render
|
28
|
+
#
|
29
|
+
# UiBibz::Ui::Core::OffcanvasHeader.new do
|
30
|
+
# 'Exemple'
|
31
|
+
# end.render
|
32
|
+
#
|
33
|
+
class OffcanvasHeader < UiBibz::Ui::Core::Component
|
34
|
+
# See UiBibz::Ui::Core::Component.initialize
|
35
|
+
|
36
|
+
# Render html tag
|
37
|
+
def pre_render
|
38
|
+
content_tag :div, html_options do
|
39
|
+
concat content_tag :h5, glyph_and_content_html, class: 'offcanvas-title'
|
40
|
+
concat close_button_html
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
def component_html_classes
|
47
|
+
'offcanvas-header'
|
48
|
+
end
|
49
|
+
|
50
|
+
def close_button_html
|
51
|
+
content_tag :button, '', class: 'btn-close', 'data-bs-dismiss' => 'offcanvas', 'aria-label' => 'Close'
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -73,22 +73,22 @@ module UiBibz::Ui::Core::Windows
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
-
def header(content = nil, options = nil, html_options = nil, &
|
77
|
-
@header = UiBibz::Ui::Core::Windows::Components::ModalHeader.new(content, options, html_options, &
|
76
|
+
def header(content = nil, options = nil, html_options = nil, &)
|
77
|
+
@header = UiBibz::Ui::Core::Windows::Components::ModalHeader.new(content, options, html_options, &)
|
78
78
|
end
|
79
79
|
|
80
|
-
def footer(content = nil, options = nil, html_options = nil, &
|
81
|
-
@footer = UiBibz::Ui::Core::Windows::Components::ModalFooter.new(content, options, html_options, &
|
80
|
+
def footer(content = nil, options = nil, html_options = nil, &)
|
81
|
+
@footer = UiBibz::Ui::Core::Windows::Components::ModalFooter.new(content, options, html_options, &)
|
82
82
|
end
|
83
83
|
|
84
|
-
def body(content = nil, options = nil, html_options = nil, &
|
85
|
-
@body = UiBibz::Ui::Core::Windows::Components::ModalBody.new(content, options, html_options, &
|
84
|
+
def body(content = nil, options = nil, html_options = nil, &)
|
85
|
+
@body = UiBibz::Ui::Core::Windows::Components::ModalBody.new(content, options, html_options, &)
|
86
86
|
end
|
87
87
|
|
88
88
|
private
|
89
89
|
|
90
90
|
def modal_dialog_classes
|
91
|
-
UiBibz::
|
91
|
+
UiBibz::Builders::HtmlClassesBuilder.join_classes('modal-dialog', fullscreen_size, size, position, scrollable)
|
92
92
|
end
|
93
93
|
|
94
94
|
def component_html_classes
|
@@ -146,8 +146,8 @@ module UiBibz::Ui::Core::Windows
|
|
146
146
|
def backdrop
|
147
147
|
return unless @options[:backdrop]
|
148
148
|
|
149
|
-
|
150
|
-
|
149
|
+
@data_html_options_builder.add 'bs-backdrop', value: @options[:backdrop]
|
150
|
+
@data_html_options_builder.add 'bs-keyboard', value: 'false'
|
151
151
|
end
|
152
152
|
end
|
153
153
|
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'ui_bibz/ui/core/windows/components/offcanvas_header'
|
4
|
+
require 'ui_bibz/ui/core/windows/components/offcanvas_body'
|
5
|
+
module UiBibz::Ui::Core::Windows
|
6
|
+
# Create a offcanvas
|
7
|
+
#
|
8
|
+
# This element is an extend of UiBibz::Ui::Core::Component.
|
9
|
+
#
|
10
|
+
# ==== Attributes
|
11
|
+
#
|
12
|
+
# * +content+ - Content of element
|
13
|
+
# * +options+ - Options of element
|
14
|
+
# * +html_options+ - Html Options of element
|
15
|
+
#
|
16
|
+
# ==== Options
|
17
|
+
#
|
18
|
+
# You can add HTML attributes using the +html_options+.
|
19
|
+
# You can pass arguments in options attribute:
|
20
|
+
# * +status+ - status of element with +symbol+ value:
|
21
|
+
# (+:primary+, +:secondary+, +:info+, +:warning+, +:danger+)
|
22
|
+
# * +size+ - Size of element with +symbol+ value:
|
23
|
+
# (+:xs+, +:sm+, +:lg+)
|
24
|
+
# * +position+ - Position vertical or horizontal with +symbol+ value:
|
25
|
+
# (+:vertical+, +:horizontal+)
|
26
|
+
#
|
27
|
+
# ==== Signatures
|
28
|
+
#
|
29
|
+
# UiBibz::Ui::Core::Windows::Offcanvas.new(options = nil, html_options = nil) do |bt|
|
30
|
+
# ...
|
31
|
+
# end
|
32
|
+
#
|
33
|
+
# ==== Examples
|
34
|
+
#
|
35
|
+
class Offcanvas < UiBibz::Ui::Core::Component
|
36
|
+
# Render html tag
|
37
|
+
def pre_render
|
38
|
+
content_tag :div, html_options do
|
39
|
+
concat @header&.render
|
40
|
+
concat @body&.render
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def header(content = nil, options = nil, html_options = nil, &)
|
45
|
+
@header = UiBibz::Ui::Core::Windows::Components::OffcanvasHeader.new(content, options, html_options, &)
|
46
|
+
end
|
47
|
+
|
48
|
+
def body(content = nil, options = nil, html_options = nil, &)
|
49
|
+
@body = UiBibz::Ui::Core::Windows::Components::OffcanvasBody.new(content, options, html_options, &)
|
50
|
+
end
|
51
|
+
|
52
|
+
private
|
53
|
+
|
54
|
+
def component_html_classes
|
55
|
+
['offcanvas', position]
|
56
|
+
end
|
57
|
+
|
58
|
+
def component_html_options
|
59
|
+
{ tabindex: '-1' }
|
60
|
+
end
|
61
|
+
|
62
|
+
def position
|
63
|
+
"offcanvas-#{options[:position] || 'start'}"
|
64
|
+
end
|
65
|
+
|
66
|
+
def component_html_data
|
67
|
+
super
|
68
|
+
backdrop
|
69
|
+
scrollable
|
70
|
+
end
|
71
|
+
|
72
|
+
def backdrop
|
73
|
+
return unless @options[:backdrop]
|
74
|
+
|
75
|
+
@data_html_options_builder.add 'bs-backdrop', value: @options[:backdrop]
|
76
|
+
end
|
77
|
+
|
78
|
+
def scrollable
|
79
|
+
return unless @options[:scrollable]
|
80
|
+
|
81
|
+
@data_html_options_builder.add 'bs-scroll', value: @options[:scrollable]
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -3,26 +3,10 @@
|
|
3
3
|
module GlyphExtension
|
4
4
|
# Render glyph and content html
|
5
5
|
def glyph_and_content_html(content_html = nil)
|
6
|
-
options[:glyph]
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
def generate_glyph(content_html)
|
11
|
-
glyph_options = if options[:glyph].is_a?(Hash)
|
12
|
-
options[:glyph]
|
13
|
-
elsif options[:glyph]
|
14
|
-
{ name: options[:glyph] }
|
15
|
-
else
|
16
|
-
{}
|
17
|
-
end
|
18
|
-
|
19
|
-
glyph_options = glyph_options.tap do |h|
|
20
|
-
h[:text] = options[:text]
|
21
|
-
h[:label] = options[:label] || content_html || content
|
22
|
-
h[:shortcut] = options[:shortcut] unless options[:shortcut].nil?
|
6
|
+
if options[:glyph]
|
7
|
+
UiBibz::ViewObjects::GlyphComponentViewObject.new(options, content_html || content).render
|
8
|
+
else
|
9
|
+
content_html || content
|
23
10
|
end
|
24
|
-
|
25
|
-
# UiBibz::Utils::GlyphChanger.new(glyph_options[:name], glyph_options).render unless glyph_options[:name].nil?
|
26
|
-
UiBibz::Ui::Core::Icons::Glyph.new(glyph_options[:name], glyph_options).render if glyph_options[:name].present?
|
27
11
|
end
|
28
12
|
end
|
@@ -2,47 +2,43 @@
|
|
2
2
|
|
3
3
|
module KlassExtension
|
4
4
|
def join_classes(*classes)
|
5
|
-
UiBibz::
|
5
|
+
UiBibz::Builders::HtmlClassesBuilder.join_classes classes
|
6
6
|
end
|
7
7
|
|
8
8
|
def exclude_classes(arr, *classes)
|
9
|
-
UiBibz::
|
9
|
+
UiBibz::Builders::HtmlClassesBuilder.exclude_classes arr, classes
|
10
10
|
end
|
11
11
|
|
12
12
|
# Override this method to add a status class
|
13
13
|
def status; end
|
14
14
|
|
15
|
+
# TODO: Refactor
|
16
|
+
# Not very clean but it's the only way to remove classes to html_options
|
15
17
|
def exclude_classes_in_html_options(*classes)
|
16
|
-
html_options[:class] = exclude_classes html_options[:class], classes
|
18
|
+
html_options[:class] = exclude_classes [html_options[:class], options[:classes]], classes
|
17
19
|
end
|
18
20
|
|
19
21
|
private
|
20
22
|
|
21
23
|
def initialize_component_html_classes
|
22
|
-
|
23
|
-
|
24
|
+
html_classes_builder = UiBibz::Builders::HtmlClassesBuilder.new
|
25
|
+
html_classes_builder.add [
|
26
|
+
html_options[:class],
|
27
|
+
options[:class],
|
24
28
|
state,
|
25
29
|
status,
|
26
30
|
effect,
|
27
|
-
options_classes,
|
28
31
|
connect,
|
29
32
|
component_html_classes
|
30
33
|
]
|
31
|
-
html_options[:class] =
|
32
|
-
|
33
|
-
|
34
|
-
def original_html_options
|
35
|
-
transform_classes_to_array(html_options[:class])
|
34
|
+
# html_options[:class] = html_classes_builder.output
|
35
|
+
html_classes_builder.output
|
36
36
|
end
|
37
37
|
|
38
38
|
def effect
|
39
39
|
options[:effect]
|
40
40
|
end
|
41
41
|
|
42
|
-
def options_classes
|
43
|
-
transform_classes_to_array(options[:class])
|
44
|
-
end
|
45
|
-
|
46
42
|
def state
|
47
43
|
options[:state] unless options[:state].nil?
|
48
44
|
end
|
@@ -50,8 +46,4 @@ module KlassExtension
|
|
50
46
|
def connect
|
51
47
|
'ui-bibz-connect' unless options[:connect].nil?
|
52
48
|
end
|
53
|
-
|
54
|
-
def transform_classes_to_array(classes)
|
55
|
-
UiBibz::Utils::Screwdriver.uniq_word_in_string(classes.is_a?(String) ? classes : classes.join(' ')) unless classes.nil?
|
56
|
-
end
|
57
49
|
end
|
@@ -26,7 +26,7 @@ module UiBibz::Ui::Ux::Containers::Components
|
|
26
26
|
include UiBibz::Ui::Concerns::HtmlConcern
|
27
27
|
|
28
28
|
# See UiBibz::Ui::Core::Component.initialize
|
29
|
-
def initialize(
|
29
|
+
def initialize(...)
|
30
30
|
super
|
31
31
|
@items = []
|
32
32
|
end
|
@@ -36,8 +36,8 @@ module UiBibz::Ui::Ux::Containers::Components
|
|
36
36
|
content_tag :div, @items.join.html_safe, html_options
|
37
37
|
end
|
38
38
|
|
39
|
-
def panel(content = nil, options = nil, html_options = nil, &
|
40
|
-
@items << UiBibz::Ui::Ux::Containers::Panel.new(content, options, html_options).tap(&
|
39
|
+
def panel(content = nil, options = nil, html_options = nil, &)
|
40
|
+
@items << UiBibz::Ui::Ux::Containers::Panel.new(content, options, html_options).tap(&).render
|
41
41
|
end
|
42
42
|
|
43
43
|
private
|
@@ -26,7 +26,7 @@ module UiBibz::Ui::Ux::Containers::Components
|
|
26
26
|
include UiBibz::Ui::Concerns::HtmlConcern
|
27
27
|
|
28
28
|
# See UiBibz::Ui::Core::Component.initialize
|
29
|
-
def initialize(
|
29
|
+
def initialize(...)
|
30
30
|
super
|
31
31
|
@items = []
|
32
32
|
end
|
@@ -38,8 +38,8 @@ module UiBibz::Ui::Ux::Containers::Components
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
def panel(content = nil, options = nil, html_options = nil, &
|
42
|
-
@items << UiBibz::Ui::Ux::Containers::Panel.new(content, options, html_options).tap(&
|
41
|
+
def panel(content = nil, options = nil, html_options = nil, &)
|
42
|
+
@items << UiBibz::Ui::Ux::Containers::Panel.new(content, options, html_options).tap(&).render
|
43
43
|
end
|
44
44
|
|
45
45
|
private
|
@@ -24,7 +24,7 @@ module UiBibz::Ui::Ux::Containers::Components
|
|
24
24
|
include UiBibz::Ui::Concerns::HtmlConcern
|
25
25
|
|
26
26
|
# See UiBibz::Ui::Core::Component.initialize
|
27
|
-
def initialize(
|
27
|
+
def initialize(...)
|
28
28
|
super
|
29
29
|
@items = []
|
30
30
|
end
|
@@ -34,8 +34,8 @@ module UiBibz::Ui::Ux::Containers::Components
|
|
34
34
|
content_tag :div, @items.join.html_safe, html_options
|
35
35
|
end
|
36
36
|
|
37
|
-
def panel(content = nil, options = nil, html_options = nil, &
|
38
|
-
@items << UiBibz::Ui::Ux::Containers::Panel.new(content, options, html_options).tap(&
|
37
|
+
def panel(content = nil, options = nil, html_options = nil, &)
|
38
|
+
@items << UiBibz::Ui::Ux::Containers::Panel.new(content, options, html_options).tap(&).render
|
39
39
|
end
|
40
40
|
|
41
41
|
private
|
@@ -43,12 +43,12 @@ module UiBibz::Ui::Ux::Containers::Components
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
def title(content = nil, options = nil, html_options = nil, &
|
47
|
-
@content = PanelHeaderTitle.new(content, options, html_options, &
|
46
|
+
def title(content = nil, options = nil, html_options = nil, &)
|
47
|
+
@content = PanelHeaderTitle.new(content, options, html_options, &).render
|
48
48
|
end
|
49
49
|
|
50
|
-
def actions(content = nil, options = nil, html_options = nil, &
|
51
|
-
@actions = UiBibz::Ui::Core::Forms::Buttons::ButtonGroup.new(content, options, html_options).tap(&
|
50
|
+
def actions(content = nil, options = nil, html_options = nil, &)
|
51
|
+
@actions = UiBibz::Ui::Core::Forms::Buttons::ButtonGroup.new(content, options, html_options).tap(&).render
|
52
52
|
end
|
53
53
|
|
54
54
|
def tab_group(content = nil, options = nil, html_options = nil, &block)
|
@@ -41,7 +41,7 @@ module UiBibz::Ui::Ux::Containers
|
|
41
41
|
class Panel < UiBibz::Ui::Core::Component
|
42
42
|
include UiBibz::Ui::Concerns::HtmlConcern
|
43
43
|
|
44
|
-
def initialize(
|
44
|
+
def initialize(...)
|
45
45
|
super
|
46
46
|
@items = []
|
47
47
|
end
|
@@ -50,28 +50,28 @@ module UiBibz::Ui::Ux::Containers
|
|
50
50
|
content_tag :div, html_structure, html_options
|
51
51
|
end
|
52
52
|
|
53
|
-
def toolbar(content = nil, options = nil, html_options = nil, &
|
54
|
-
@items << UiBibz::Ui::Ux::Containers::Components::PanelToolbar.new(content, options, html_options).tap(&
|
53
|
+
def toolbar(content = nil, options = nil, html_options = nil, &)
|
54
|
+
@items << UiBibz::Ui::Ux::Containers::Components::PanelToolbar.new(content, options, html_options).tap(&).render
|
55
55
|
end
|
56
56
|
|
57
|
-
def deck(content = nil, options = nil, html_options = nil, &
|
58
|
-
@items << UiBibz::Ui::Ux::Containers::Components::PanelDeck.new(content, options, html_options).tap(&
|
57
|
+
def deck(content = nil, options = nil, html_options = nil, &)
|
58
|
+
@items << UiBibz::Ui::Ux::Containers::Components::PanelDeck.new(content, options, html_options).tap(&).render
|
59
59
|
end
|
60
60
|
|
61
|
-
def column(content = nil, options = nil, html_options = nil, &
|
62
|
-
@items << UiBibz::Ui::Ux::Containers::Components::PanelColumn.new(content, options, html_options).tap(&
|
61
|
+
def column(content = nil, options = nil, html_options = nil, &)
|
62
|
+
@items << UiBibz::Ui::Ux::Containers::Components::PanelColumn.new(content, options, html_options).tap(&).render
|
63
63
|
end
|
64
64
|
|
65
|
-
def group(content = nil, options = nil, html_options = nil, &
|
66
|
-
@items << UiBibz::Ui::Ux::Containers::Components::PanelGroup.new(content, options, html_options).tap(&
|
65
|
+
def group(content = nil, options = nil, html_options = nil, &)
|
66
|
+
@items << UiBibz::Ui::Ux::Containers::Components::PanelGroup.new(content, options, html_options).tap(&).render
|
67
67
|
end
|
68
68
|
|
69
|
-
def panel(content = nil, options = nil, html_options = nil, &
|
70
|
-
@items << UiBibz::Ui::Ux::Containers::Panel.new(content, options, html_options).tap(&
|
69
|
+
def panel(content = nil, options = nil, html_options = nil, &)
|
70
|
+
@items << UiBibz::Ui::Ux::Containers::Panel.new(content, options, html_options).tap(&).render
|
71
71
|
end
|
72
72
|
|
73
|
-
def body(content = nil, options = nil, html_options = nil, &
|
74
|
-
@items << UiBibz::Ui::Ux::Containers::Components::PanelBody.new(content, options, html_options, &
|
73
|
+
def body(content = nil, options = nil, html_options = nil, &)
|
74
|
+
@items << UiBibz::Ui::Ux::Containers::Components::PanelBody.new(content, options, html_options, &).render
|
75
75
|
end
|
76
76
|
|
77
77
|
# Add Header which is a component
|
@@ -12,16 +12,16 @@ module UiBibz::Ui::Ux::Tables
|
|
12
12
|
end
|
13
13
|
|
14
14
|
# Add link action in table
|
15
|
-
def link(content = nil, options = nil, html_options = nil, &
|
16
|
-
@actions << UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownLink.new(content, options, html_options, &
|
15
|
+
def link(content = nil, options = nil, html_options = nil, &)
|
16
|
+
@actions << UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownLink.new(content, options, html_options, &).render
|
17
17
|
end
|
18
18
|
|
19
19
|
def divider
|
20
20
|
@actions << UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownDivider.new.render
|
21
21
|
end
|
22
22
|
|
23
|
-
def header(content = nil, options = nil, html_options = nil, &
|
24
|
-
@actions << UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownHeader.new(content, options, html_options, &
|
23
|
+
def header(content = nil, options = nil, html_options = nil, &)
|
24
|
+
@actions << UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownHeader.new(content, options, html_options, &).render
|
25
25
|
end
|
26
26
|
|
27
27
|
def html(content)
|
@@ -6,7 +6,7 @@ module UiBibz::Ui::Ux::Tables
|
|
6
6
|
:date_format, :sort, :format, :count, :custom_sort, :parent, :id, :progress_options,
|
7
7
|
:sortable
|
8
8
|
|
9
|
-
def initialize(content = nil, options = nil, html_options = nil, &
|
9
|
+
def initialize(content = nil, options = nil, html_options = nil, &)
|
10
10
|
super
|
11
11
|
@data_index = @content
|
12
12
|
@id = @options[:column_id] || @data_index
|
@@ -7,8 +7,8 @@ module UiBibz::Ui::Ux::Tables
|
|
7
7
|
end
|
8
8
|
|
9
9
|
# Add column in table
|
10
|
-
def column(data_index = nil, options = nil, html_options = nil, &
|
11
|
-
@columns << Column.new(data_index, options, html_options, &
|
10
|
+
def column(data_index = nil, options = nil, html_options = nil, &)
|
11
|
+
@columns << Column.new(data_index, options, html_options, &)
|
12
12
|
end
|
13
13
|
|
14
14
|
# Get all columns
|
@@ -96,20 +96,20 @@ module UiBibz::Ui::Ux::Tables
|
|
96
96
|
# end
|
97
97
|
class Table < UiBibz::Ui::Core::Component
|
98
98
|
# See UiBibz::Ui::Core::Component.initialize
|
99
|
-
def initialize(
|
99
|
+
def initialize(...)
|
100
100
|
super
|
101
101
|
@columns = Columns.new
|
102
102
|
@actions = Actions.new store
|
103
103
|
end
|
104
104
|
|
105
105
|
# Add table columns items
|
106
|
-
def columns(&
|
107
|
-
@columns.tap(&
|
106
|
+
def columns(&)
|
107
|
+
@columns.tap(&)
|
108
108
|
end
|
109
109
|
|
110
110
|
# Add table actions items
|
111
|
-
def actions(&
|
112
|
-
@actions.tap(&
|
111
|
+
def actions(&)
|
112
|
+
@actions.tap(&)
|
113
113
|
end
|
114
114
|
|
115
115
|
# for test
|
@@ -108,9 +108,9 @@ module UiBibz::Ui::Ux::Tables
|
|
108
108
|
include UiBibz::Ui::Concerns::HtmlConcern
|
109
109
|
|
110
110
|
# See UiBibz::Ui::Core::Boxes::Card.initialize
|
111
|
-
def initialize(
|
111
|
+
def initialize(...)
|
112
112
|
super
|
113
|
-
table_options = (@options[:table_options] || {}).merge({ store:
|
113
|
+
table_options = (@options[:table_options] || {}).merge({ store: })
|
114
114
|
@table = UiBibz::Ui::Ux::Tables::Table.new(table_options, @options[:table_html_options])
|
115
115
|
end
|
116
116
|
|
@@ -130,13 +130,13 @@ module UiBibz::Ui::Ux::Tables
|
|
130
130
|
end
|
131
131
|
|
132
132
|
# Add table columns item
|
133
|
-
def columns(&
|
134
|
-
@table.columns(&
|
133
|
+
def columns(&)
|
134
|
+
@table.columns(&)
|
135
135
|
end
|
136
136
|
|
137
137
|
# Add table actions item
|
138
|
-
def actions(&
|
139
|
-
@table.actions(&
|
138
|
+
def actions(&)
|
139
|
+
@table.actions(&)
|
140
140
|
end
|
141
141
|
|
142
142
|
# for test
|
@@ -40,7 +40,7 @@ module UiBibz::Ui::Ux::Tables
|
|
40
40
|
def search_field_html
|
41
41
|
# add surround_field maybe ?
|
42
42
|
content_tag :div, html_options do
|
43
|
-
concat content_tag(:span, UiBibz::Ui::Core::Icons::Glyph.new('
|
43
|
+
concat content_tag(:span, UiBibz::Ui::Core::Icons::Glyph.new('magnifying-glass').render, class: 'input-group-text')
|
44
44
|
concat tag(:input, type: 'search', value: search_content, name: 'search', class: 'form-control', placeholder: search_placeholder_field)
|
45
45
|
concat tag(:input, type: 'hidden', name: 'store_id', value: store.id) unless store.id.nil? # if there is more one table in html page
|
46
46
|
concat tag(:input, type: 'hidden', name: 'link_type', value: 'search')
|