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
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module UiBibz
|
4
|
+
module Strategies
|
5
|
+
# Class to initialize component
|
6
|
+
class ComponentInitializeHashStrategy < UiBibz::Strategies::ComponentInitializeAbstractStrategy
|
7
|
+
def content; end
|
8
|
+
|
9
|
+
def options
|
10
|
+
with_indifferent_access(@content)
|
11
|
+
end
|
12
|
+
|
13
|
+
def html_options
|
14
|
+
with_indifferent_access(@options)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module UiBibz
|
4
|
+
module Strategies
|
5
|
+
# Class to initialize component
|
6
|
+
class ComponentInitializeStandardStrategy < UiBibz::Strategies::ComponentInitializeAbstractStrategy
|
7
|
+
attr_reader :content
|
8
|
+
|
9
|
+
def options
|
10
|
+
with_indifferent_access(@options)
|
11
|
+
end
|
12
|
+
|
13
|
+
def html_options
|
14
|
+
with_indifferent_access(@html_options)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -34,15 +34,15 @@ module UiBibz::Ui::Concerns::CardItemableConcern # :nodoc:
|
|
34
34
|
end
|
35
35
|
|
36
36
|
# Add List group which is a component
|
37
|
-
def list_group(content = nil, options = nil, html_options = nil, &
|
38
|
-
@items << UiBibz::Ui::Core::Boxes::Components::CardListGroup.new(content, options, html_options).tap(&
|
37
|
+
def list_group(content = nil, options = nil, html_options = nil, &)
|
38
|
+
@items << UiBibz::Ui::Core::Boxes::Components::CardListGroup.new(content, options, html_options).tap(&).render
|
39
39
|
end
|
40
40
|
|
41
41
|
# Add Image which is a component
|
42
|
-
def image(content = nil, options = nil, html_options = nil, &
|
42
|
+
def image(content = nil, options = nil, html_options = nil, &)
|
43
43
|
# Add position top to the image if the image is in top of the card
|
44
44
|
options = (options || {}).merge(position: :top) if @header.nil? && @items.empty? && options.try(:[], :position).nil?
|
45
|
-
@items << UiBibz::Ui::Core::Boxes::Components::CardImage.new(content, options, html_options, &
|
45
|
+
@items << UiBibz::Ui::Core::Boxes::Components::CardImage.new(content, options, html_options, &).render
|
46
46
|
end
|
47
47
|
|
48
48
|
# Add a row whih is a component
|
@@ -5,7 +5,7 @@ module UiBibz::Ui::Concerns::NotificationConcern # :nodoc:
|
|
5
5
|
|
6
6
|
included do
|
7
7
|
def data_attributes
|
8
|
-
self.class.const_get(
|
8
|
+
self.class.const_get(:DATA_ATTRIBUTES).filter_map do |data_attribute|
|
9
9
|
options[data_attribute].to_s.blank? ? nil : { "data-bs-#{data_attribute}" => data_attribute_value(data_attribute) }
|
10
10
|
end.reduce(&:merge) || {}
|
11
11
|
end
|
@@ -92,7 +92,7 @@ module UiBibz::Ui::Core::Boxes
|
|
92
92
|
include UiBibz::Ui::Concerns::CardItemableConcern
|
93
93
|
|
94
94
|
# (see UiBibz::Ui::Core::Component#initialize)
|
95
|
-
def initialize(
|
95
|
+
def initialize(...)
|
96
96
|
super
|
97
97
|
@items = @content.nil? ? [] : [UiBibz::Ui::Core::Boxes::Components::CardBody.new(@content).render]
|
98
98
|
end
|
@@ -34,7 +34,7 @@ module UiBibz::Ui::Core::Boxes
|
|
34
34
|
include UiBibz::Ui::Concerns::HtmlConcern
|
35
35
|
|
36
36
|
# See UiBibz::Ui::Core::Component.initialize
|
37
|
-
def initialize(
|
37
|
+
def initialize(...)
|
38
38
|
super
|
39
39
|
@items = []
|
40
40
|
end
|
@@ -44,9 +44,9 @@ module UiBibz::Ui::Core::Boxes
|
|
44
44
|
content_tag :div, @items.join.html_safe, html_options
|
45
45
|
end
|
46
46
|
|
47
|
-
def card(content = nil, options = nil, html_options = nil, &
|
47
|
+
def card(content = nil, options = nil, html_options = nil, &)
|
48
48
|
content = (content || {}).merge({ parent_collapse: id })
|
49
|
-
@items << UiBibz::Ui::Core::Boxes::Card.new(content, options, html_options).tap(&
|
49
|
+
@items << UiBibz::Ui::Core::Boxes::Card.new(content, options, html_options).tap(&).render
|
50
50
|
end
|
51
51
|
|
52
52
|
private
|
@@ -60,7 +60,7 @@ module UiBibz::Ui::Core::Boxes
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def component_html_options
|
63
|
-
{ id:
|
63
|
+
{ id: }
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
@@ -34,9 +34,6 @@ module UiBibz::Ui::Core::Boxes
|
|
34
34
|
include UiBibz::Ui::Concerns::HtmlConcern
|
35
35
|
|
36
36
|
# See UiBibz::Ui::Core::Component.initialize
|
37
|
-
def initialize(content = nil, options = nil, html_options = nil, &block)
|
38
|
-
super
|
39
|
-
end
|
40
37
|
|
41
38
|
# Render html tag
|
42
39
|
def pre_render
|
@@ -38,7 +38,7 @@ module UiBibz::Ui::Core::Boxes::Components
|
|
38
38
|
include UiBibz::Ui::Concerns::HtmlConcern
|
39
39
|
|
40
40
|
# See UiBibz::Ui::Core::Component.initialize
|
41
|
-
def initialize(
|
41
|
+
def initialize(...)
|
42
42
|
super
|
43
43
|
@items = [@content]
|
44
44
|
end
|
@@ -54,20 +54,20 @@ module UiBibz::Ui::Core::Boxes::Components
|
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
def title(content = nil, options = nil, html_options = nil, &
|
58
|
-
@items << UiBibz::Ui::Core::Boxes::Components::Body::CardBodyTitle.new(content, options, html_options, &
|
57
|
+
def title(content = nil, options = nil, html_options = nil, &)
|
58
|
+
@items << UiBibz::Ui::Core::Boxes::Components::Body::CardBodyTitle.new(content, options, html_options, &).render
|
59
59
|
end
|
60
60
|
|
61
|
-
def subtitle(content = nil, options = nil, html_options = nil, &
|
62
|
-
@items << UiBibz::Ui::Core::Boxes::Components::Body::CardBodySubtitle.new(content, options, html_options, &
|
61
|
+
def subtitle(content = nil, options = nil, html_options = nil, &)
|
62
|
+
@items << UiBibz::Ui::Core::Boxes::Components::Body::CardBodySubtitle.new(content, options, html_options, &).render
|
63
63
|
end
|
64
64
|
|
65
|
-
def link(content = nil, options = nil, html_options = nil, &
|
66
|
-
@items << UiBibz::Ui::Core::Boxes::Components::Body::CardBodyLink.new(content, options, html_options, &
|
65
|
+
def link(content = nil, options = nil, html_options = nil, &)
|
66
|
+
@items << UiBibz::Ui::Core::Boxes::Components::Body::CardBodyLink.new(content, options, html_options, &).render
|
67
67
|
end
|
68
68
|
|
69
|
-
def text(content = nil, options = nil, html_options = nil, &
|
70
|
-
@items << UiBibz::Ui::Core::Boxes::Components::Body::CardBodyText.new(content, options, html_options, &
|
69
|
+
def text(content = nil, options = nil, html_options = nil, &)
|
70
|
+
@items << UiBibz::Ui::Core::Boxes::Components::Body::CardBodyText.new(content, options, html_options, &).render
|
71
71
|
end
|
72
72
|
|
73
73
|
def row(content = nil, options = nil, html_options = nil, &block)
|
@@ -46,8 +46,8 @@ module UiBibz::Ui::Core::Boxes::Components
|
|
46
46
|
include UiBibz::Ui::Concerns::CardItemableConcern
|
47
47
|
|
48
48
|
# See UiBibz::Ui::Core::Component.initialize
|
49
|
-
def initialize(
|
50
|
-
|
49
|
+
def initialize(...)
|
50
|
+
{ num: content } if content.is_a?(Integer)
|
51
51
|
super
|
52
52
|
@items = [@content]
|
53
53
|
end
|
@@ -32,7 +32,7 @@ module UiBibz::Ui::Core::Boxes::Components
|
|
32
32
|
#
|
33
33
|
class CardListGroup < UiBibz::Ui::Core::Lists::ListGroup
|
34
34
|
# See UiBibz::Ui::Core::Component.initialize
|
35
|
-
def initialize(
|
35
|
+
def initialize(...)
|
36
36
|
super
|
37
37
|
@lists = []
|
38
38
|
end
|
@@ -45,7 +45,7 @@ module UiBibz::Ui::Core::Boxes::Components
|
|
45
45
|
#
|
46
46
|
class CardRow < UiBibz::Ui::Core::Layouts::Row
|
47
47
|
# See UiBibz::Ui::Core::Component.initialize
|
48
|
-
def initialize(
|
48
|
+
def initialize(...)
|
49
49
|
super
|
50
50
|
@items = [@content]
|
51
51
|
end
|
@@ -3,7 +3,6 @@
|
|
3
3
|
require 'haml'
|
4
4
|
require 'ui_bibz/ui/extensions/core/component/klass_extension'
|
5
5
|
require 'ui_bibz/ui/extensions/core/component/glyph_extension'
|
6
|
-
require 'ui_bibz/ui/extensions/core/component/popover_extension'
|
7
6
|
module UiBibz::Ui::Core
|
8
7
|
# Creates a component of the given +name+ using options created by the set of +options+.
|
9
8
|
#
|
@@ -44,7 +43,6 @@ module UiBibz::Ui::Core
|
|
44
43
|
class Component < UiBibz::Ui::Base
|
45
44
|
include KlassExtension
|
46
45
|
include GlyphExtension
|
47
|
-
include PopoverExtension
|
48
46
|
|
49
47
|
# Constants
|
50
48
|
STATUSES = %i[primary secondary success danger warning info light dark].freeze
|
@@ -59,27 +57,13 @@ module UiBibz::Ui::Core
|
|
59
57
|
# * Options of component is defined in hash options
|
60
58
|
# * Html options is defined in hash html_options
|
61
59
|
def initialize(content = nil, options = nil, html_options = nil, &block)
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
@content = context.capture(&block)
|
70
|
-
else
|
71
|
-
@content = read_cache
|
72
|
-
end
|
73
|
-
elsif content.is_a?(Hash)
|
74
|
-
@html_options = options
|
75
|
-
@options = content
|
76
|
-
else
|
77
|
-
@html_options = html_options
|
78
|
-
@options = options
|
79
|
-
@content = content
|
80
|
-
end
|
81
|
-
@html_options = (@html_options || {}).with_indifferent_access
|
82
|
-
@options = (@options || {}).with_indifferent_access
|
60
|
+
component_initialize_factory_method = UiBibz::FactoryMethods::ComponentInitializeFactoryMethod.new(self, self.binding).make
|
61
|
+
@content = component_initialize_factory_method.content
|
62
|
+
@html_options = component_initialize_factory_method.html_options
|
63
|
+
@options = component_initialize_factory_method.options
|
64
|
+
|
65
|
+
@data_html_options_builder = UiBibz::Builders::DataHtmlOptionsBuilder.new(@html_options, @options)
|
66
|
+
|
83
67
|
init_options
|
84
68
|
init_component_html_options
|
85
69
|
end
|
@@ -108,25 +92,7 @@ module UiBibz::Ui::Core
|
|
108
92
|
end
|
109
93
|
|
110
94
|
# Override this method to add html data
|
111
|
-
def component_html_data
|
112
|
-
# To stimulusjs
|
113
|
-
data_target = html_options.try(:[], :data).try(:[], :target) || options.try(:delete, :target)
|
114
|
-
add_html_data(:target, value: data_target) unless data_target.nil?
|
115
|
-
|
116
|
-
data_controller = html_options.try(:[], :data).try(:[], :controller) || options.try(:delete, :controller)
|
117
|
-
add_html_data(:controller, value: data_controller) unless data_controller.nil?
|
118
|
-
|
119
|
-
data_action = html_options.try(:[], :data).try(:[], :action) || options.try(:delete, :action)
|
120
|
-
add_html_data(:action, value: data_action) unless data_action.nil?
|
121
|
-
|
122
|
-
# To turbolinks
|
123
|
-
data_turbolinks = html_options.try(:[], :data).try(:[], :turbolinks) || options.try(:delete, :turbolinks)
|
124
|
-
add_html_data(:turbolinks, value: data_turbolinks) unless data_turbolinks.nil?
|
125
|
-
|
126
|
-
# To Turbo
|
127
|
-
data_turbo = html_options.try(:[], :data).try(:[], :turbo) || options.try(:delete, :turbo)
|
128
|
-
add_html_data(:turbo, value: data_turbo) unless data_turbo.nil?
|
129
|
-
end
|
95
|
+
def component_html_data; end
|
130
96
|
|
131
97
|
# Override this method to add html Options
|
132
98
|
# Accept Hash
|
@@ -145,13 +111,6 @@ module UiBibz::Ui::Core
|
|
145
111
|
[]
|
146
112
|
end
|
147
113
|
|
148
|
-
# Add html data arguments
|
149
|
-
def add_html_data(name, value: true)
|
150
|
-
html_options[:data] = {} if html_options[:data].nil?
|
151
|
-
value = value.strip if value.is_a?(String)
|
152
|
-
html_options[:data].update({ name => value })
|
153
|
-
end
|
154
|
-
|
155
114
|
def disabled?
|
156
115
|
options[:state] == :disabled || html_options[:disabled]
|
157
116
|
end
|
@@ -181,20 +140,12 @@ module UiBibz::Ui::Core
|
|
181
140
|
@options = component_options.merge(@options).with_indifferent_access
|
182
141
|
end
|
183
142
|
|
184
|
-
def initialize_component_html_data
|
185
|
-
component_html_data
|
186
|
-
popover_data_html
|
187
|
-
tooltip_data_html
|
188
|
-
end
|
189
|
-
|
190
|
-
def initialize_component_html_options
|
191
|
-
html_options.merge!(component_html_options)
|
192
|
-
end
|
193
|
-
|
194
143
|
def init_component_html_options
|
195
|
-
|
196
|
-
|
197
|
-
|
144
|
+
component_html_data
|
145
|
+
html_options_builder = UiBibz::Builders::HtmlOptionsBuilder.new(@data_html_options_builder.output, options)
|
146
|
+
html_options_builder.initialize_component_html_classes initialize_component_html_classes
|
147
|
+
html_options_builder.initialize_component_html_options component_html_options
|
148
|
+
@html_options = html_options_builder.html_options
|
198
149
|
end
|
199
150
|
end
|
200
151
|
end
|
@@ -52,6 +52,8 @@ module UiBibz::Ui::Core::Forms::Buttons
|
|
52
52
|
# content
|
53
53
|
# end
|
54
54
|
class Button < UiBibz::Ui::Core::Component
|
55
|
+
include GlyphExtension
|
56
|
+
|
55
57
|
# Render html tag
|
56
58
|
def pre_render
|
57
59
|
button_html_tag
|
@@ -107,7 +109,7 @@ module UiBibz::Ui::Core::Forms::Buttons
|
|
107
109
|
end
|
108
110
|
|
109
111
|
def action
|
110
|
-
|
112
|
+
@data_html_options_builder.add('action', value: options[:action])
|
111
113
|
end
|
112
114
|
|
113
115
|
def badge_html
|
@@ -50,7 +50,7 @@ module UiBibz::Ui::Core::Forms::Buttons
|
|
50
50
|
include UiBibz::Ui::Concerns::HtmlConcern
|
51
51
|
|
52
52
|
# See UiBibz::Ui::Core::Component.initialize
|
53
|
-
def initialize(
|
53
|
+
def initialize(...)
|
54
54
|
super
|
55
55
|
@items = []
|
56
56
|
end
|
@@ -80,28 +80,28 @@ module UiBibz::Ui::Core::Forms::Buttons
|
|
80
80
|
@items << ButtonLink.new(content, options, html_options, &block)
|
81
81
|
end
|
82
82
|
|
83
|
-
def dropdown(content, options = {}, html_options = nil, &
|
83
|
+
def dropdown(content, options = {}, html_options = nil, &)
|
84
84
|
options = @options.merge(options)
|
85
|
-
@items << ButtonGroupDropdown.new(content, options, html_options).tap(&
|
85
|
+
@items << ButtonGroupDropdown.new(content, options, html_options).tap(&)
|
86
86
|
end
|
87
87
|
|
88
|
-
def split_dropdown(content, options = {}, html_options = nil, &
|
88
|
+
def split_dropdown(content, options = {}, html_options = nil, &)
|
89
89
|
options = @options.merge(options)
|
90
|
-
@items << ButtonGroupSplitDropdown.new(content, options, html_options).tap(&
|
90
|
+
@items << ButtonGroupSplitDropdown.new(content, options, html_options).tap(&)
|
91
91
|
end
|
92
92
|
|
93
|
-
def input(attribute_name, options = {}, &
|
93
|
+
def input(attribute_name, options = {}, &)
|
94
94
|
options = @options.merge(options)
|
95
95
|
|
96
|
-
@items << @options[:form].input(attribute_name, options.merge({ label: false, wrapper: false }), &
|
96
|
+
@items << @options[:form].input(attribute_name, options.merge({ label: false, wrapper: false }), &)
|
97
97
|
end
|
98
98
|
|
99
|
-
def html(content = nil, options = nil, html_options = nil, &
|
100
|
-
@items << UiBibz::Ui::Core::Component.new(content, options, html_options, &
|
99
|
+
def html(content = nil, options = nil, html_options = nil, &)
|
100
|
+
@items << UiBibz::Ui::Core::Component.new(content, options, html_options, &)
|
101
101
|
end
|
102
102
|
|
103
|
-
def choice_group(content = nil, options = nil, html_options = nil, &
|
104
|
-
@items << UiBibz::Ui::Core::Forms::Choices::ChoiceGroup.new(content, options, html_options).tap(&
|
103
|
+
def choice_group(content = nil, options = nil, html_options = nil, &)
|
104
|
+
@items << UiBibz::Ui::Core::Forms::Choices::ChoiceGroup.new(content, options, html_options).tap(&)
|
105
105
|
end
|
106
106
|
|
107
107
|
private
|
@@ -88,7 +88,7 @@ module UiBibz::Ui::Core::Forms::Choices
|
|
88
88
|
|
89
89
|
# '', 'mini', 'small', 'normal', 'large'
|
90
90
|
def size
|
91
|
-
|
91
|
+
@data_html_options_builder.add('size', value: matching_size[options[:size]])
|
92
92
|
end
|
93
93
|
|
94
94
|
def matching_size
|
@@ -97,7 +97,7 @@ module UiBibz::Ui::Core::Forms::Choices
|
|
97
97
|
|
98
98
|
# true, false => default : true
|
99
99
|
def animate
|
100
|
-
|
100
|
+
@data_html_options_builder.add('animate', value: options.delete(:animate)) unless options[:animate].nil?
|
101
101
|
end
|
102
102
|
|
103
103
|
# active, disabled => default : active
|
@@ -107,27 +107,27 @@ module UiBibz::Ui::Core::Forms::Choices
|
|
107
107
|
|
108
108
|
# 'primary', 'info', 'success', 'warning', 'danger', 'default' => default : default
|
109
109
|
def left_color
|
110
|
-
|
110
|
+
@data_html_options_builder.add('on_color', value: options[:left_color])
|
111
111
|
end
|
112
112
|
|
113
113
|
# 'primary', 'info', 'success', 'warning', 'danger', 'default' => default : default
|
114
114
|
def right_color
|
115
|
-
|
115
|
+
@data_html_options_builder.add('off_color', value: options[:right_color])
|
116
116
|
end
|
117
117
|
|
118
118
|
# String => default : "ON"
|
119
119
|
def left_text
|
120
|
-
|
120
|
+
@data_html_options_builder.add('on_text', value: options[:left_text])
|
121
121
|
end
|
122
122
|
|
123
123
|
# String => default : "OFF"
|
124
124
|
def right_text
|
125
|
-
|
125
|
+
@data_html_options_builder.add('off_text', value: options[:right_text])
|
126
126
|
end
|
127
127
|
|
128
128
|
# String => default : ' '
|
129
129
|
def middle_text
|
130
|
-
|
130
|
+
@data_html_options_builder.add('label_text', value: options[:middle_text])
|
131
131
|
end
|
132
132
|
|
133
133
|
def inline
|
@@ -65,13 +65,13 @@ module UiBibz::Ui::Core::Forms::Choices
|
|
65
65
|
|
66
66
|
def wrapper_html_options
|
67
67
|
(options[:wrapper_html] || {}).tap do |option|
|
68
|
-
option[:class] = UiBibz::
|
68
|
+
option[:class] = UiBibz::Builders::HtmlClassesBuilder.join_classes(wrapper_classes, inline, options[:wrapper_html].try(:[], :class))
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
72
|
def label_html_options
|
73
73
|
(options[:label_html] || {}).tap do |option|
|
74
|
-
option[:class] = UiBibz::
|
74
|
+
option[:class] = UiBibz::Builders::HtmlClassesBuilder.join_classes(label_classes, options[:label_html].try(:[], :class))
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
@@ -52,7 +52,7 @@ module UiBibz::Ui::Core::Forms::Choices
|
|
52
52
|
|
53
53
|
# See UiBibz::Ui::Core::Forms::Choices::Button.initialize
|
54
54
|
#
|
55
|
-
def initialize(
|
55
|
+
def initialize(...)
|
56
56
|
super
|
57
57
|
@items = []
|
58
58
|
@errors = []
|
@@ -72,14 +72,14 @@ module UiBibz::Ui::Core::Forms::Choices
|
|
72
72
|
@items << Choice.new(content, opts, html_options, &block)
|
73
73
|
end
|
74
74
|
|
75
|
-
def input(attribute_name, options = {}, &
|
75
|
+
def input(attribute_name, options = {}, &)
|
76
76
|
new_options = options.merge(old_label: options[:label], label: false, wrapper: false, error: false)
|
77
77
|
new_options = new_options.merge(name: @radio_name, type: :radio) if @options[:type] == :radio
|
78
78
|
|
79
|
-
@items << @options[:form].input(attribute_name, new_options, &
|
79
|
+
@items << @options[:form].input(attribute_name, new_options, &)
|
80
80
|
obj = @options[:form].object
|
81
81
|
@errors << obj.errors[attribute_name] unless obj.errors[attribute_name].empty?
|
82
|
-
@required_fields << (obj._validators[attribute_name].try(:first).
|
82
|
+
@required_fields << (obj._validators[attribute_name].try(:first).instance_of?(::ActiveRecord::Validations::PresenceValidator))
|
83
83
|
end
|
84
84
|
|
85
85
|
private
|
@@ -93,8 +93,7 @@ module UiBibz::Ui::Core::Forms::Choices
|
|
93
93
|
end
|
94
94
|
|
95
95
|
def component_html_data
|
96
|
-
|
97
|
-
add_html_data 'toggle', value: 'buttons' if @options[:form].nil?
|
96
|
+
@data_html_options_builder.add('toggle', value: 'buttons') if @options[:form].nil?
|
98
97
|
end
|
99
98
|
end
|
100
99
|
end
|
@@ -61,7 +61,7 @@ module UiBibz::Ui::Core::Forms::Choices
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def input_options
|
64
|
-
@input_options ||= { type
|
64
|
+
@input_options ||= { type:, autocomplete: :off, class: 'btn-check' }
|
65
65
|
.merge(checked)
|
66
66
|
.merge(value)
|
67
67
|
.merge(name)
|
@@ -95,15 +95,15 @@ module UiBibz::Ui::Core::Forms::Dates
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def date_locale
|
98
|
-
|
98
|
+
@data_html_options_builder.add 'date_locale', value: I18n.locale.to_s
|
99
99
|
end
|
100
100
|
|
101
101
|
def provide
|
102
|
-
|
102
|
+
@data_html_options_builder.add 'provide', value: 'datepicker'
|
103
103
|
end
|
104
104
|
|
105
105
|
def format
|
106
|
-
|
106
|
+
@data_html_options_builder.add 'date_format', value: picker_pattern
|
107
107
|
end
|
108
108
|
|
109
109
|
def picker_pattern
|
@@ -111,51 +111,51 @@ module UiBibz::Ui::Core::Forms::Dates
|
|
111
111
|
end
|
112
112
|
|
113
113
|
def today_btn
|
114
|
-
|
114
|
+
@data_html_options_builder.add 'date_today_btn', value: 'linked'
|
115
115
|
end
|
116
116
|
|
117
117
|
def today_highlight
|
118
|
-
|
118
|
+
@data_html_options_builder.add('date_today_highlight') if options[:today_highlight]
|
119
119
|
end
|
120
120
|
|
121
121
|
def calendar_weeks
|
122
|
-
|
122
|
+
@data_html_options_builder.add('date_calendar_weeks') if options[:calendar_weeks]
|
123
123
|
end
|
124
124
|
|
125
125
|
def autoclose
|
126
|
-
|
126
|
+
@data_html_options_builder.add('date_autoclose') if options[:autoclose]
|
127
127
|
end
|
128
128
|
|
129
129
|
def dates_disabled
|
130
|
-
|
130
|
+
@data_html_options_builder.add('dates_disabled', value: [options[:dates_disabled]].flatten) if options[:dates_disabled]
|
131
131
|
end
|
132
132
|
|
133
133
|
def toggle_active
|
134
|
-
|
134
|
+
@data_html_options_builder.add('date_toggle_active')
|
135
135
|
end
|
136
136
|
|
137
137
|
def display_mode
|
138
|
-
|
138
|
+
@data_html_options_builder.add('date_start_view', value: views[options[:display_mode]]) if options[:display_mode]
|
139
139
|
end
|
140
140
|
|
141
141
|
def display_mode_min
|
142
|
-
|
142
|
+
@data_html_options_builder.add('date_min_view_mode', value: views[options[:display_mode_min]]) if options[:display_mode_min]
|
143
143
|
end
|
144
144
|
|
145
145
|
def display_mode_max
|
146
|
-
|
146
|
+
@data_html_options_builder.add('date_max_view_mode', value: views[options[:display_mode_max]]) if options[:display_mode_max]
|
147
147
|
end
|
148
148
|
|
149
149
|
def days_of_week_disabled
|
150
|
-
|
150
|
+
@data_html_options_builder.add('date_days_of_week_disabled', value: [options[:days_of_week_disabled]].flatten) if options[:days_of_week_disabled]
|
151
151
|
end
|
152
152
|
|
153
153
|
def days_of_week_highlighted
|
154
|
-
|
154
|
+
@data_html_options_builder.add('date_days_of_week_highlighted', value: [options[:days_of_week_highlighted]].flatten) if options[:days_of_week_highlighted]
|
155
155
|
end
|
156
156
|
|
157
157
|
def multiple
|
158
|
-
|
158
|
+
@data_html_options_builder.add('date_multidate', value: options[:multiple])
|
159
159
|
end
|
160
160
|
|
161
161
|
# :lg, :sm or :xs
|
@@ -42,7 +42,7 @@ module UiBibz::Ui::Core::Forms::Dropdowns::Components
|
|
42
42
|
#
|
43
43
|
class DropdownLink < UiBibz::Ui::Core::Component
|
44
44
|
# See UiBibz::Ui::Core::Component.initialize
|
45
|
-
def initialize(
|
45
|
+
def initialize(...)
|
46
46
|
super
|
47
47
|
@html_options = @html_options.merge(link_html_options)
|
48
48
|
end
|
@@ -70,7 +70,7 @@ module UiBibz::Ui::Core::Forms::Dropdowns
|
|
70
70
|
class Dropdown < UiBibz::Ui::Core::Component
|
71
71
|
include UiBibz::Ui::Concerns::HtmlConcern
|
72
72
|
|
73
|
-
def initialize(
|
73
|
+
def initialize(...)
|
74
74
|
super
|
75
75
|
@items = []
|
76
76
|
@status = @options.delete(:status)
|
@@ -86,8 +86,8 @@ module UiBibz::Ui::Core::Forms::Dropdowns
|
|
86
86
|
|
87
87
|
# Add dropdown header
|
88
88
|
# See UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownHeader
|
89
|
-
def header(content = nil, options = nil, html_options = nil, &
|
90
|
-
@items << UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownHeader.new(content, options, html_options, &
|
89
|
+
def header(content = nil, options = nil, html_options = nil, &)
|
90
|
+
@items << UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownHeader.new(content, options, html_options, &).render
|
91
91
|
end
|
92
92
|
|
93
93
|
# Add dropdown Separator
|
@@ -98,8 +98,8 @@ module UiBibz::Ui::Core::Forms::Dropdowns
|
|
98
98
|
|
99
99
|
# Add dropdown link in list
|
100
100
|
# See UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownLink
|
101
|
-
def link(content = nil, options = nil, html_options = nil, &
|
102
|
-
@items << UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownLink.new(content, options, html_options, &
|
101
|
+
def link(content = nil, options = nil, html_options = nil, &)
|
102
|
+
@items << UiBibz::Ui::Core::Forms::Dropdowns::Components::DropdownLink.new(content, options, html_options, &).render
|
103
103
|
end
|
104
104
|
|
105
105
|
def id
|