ui_bibz 2.0.0.alpha32 → 2.0.0.beta2

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.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -1
  3. data/Gemfile.lock +111 -87
  4. data/app/assets/javascripts/form.coffee +24 -8
  5. data/app/assets/javascripts/ui_bibz.coffee +3 -2
  6. data/app/assets/stylesheets/bootstrap-switch.sass +17 -8
  7. data/app/assets/stylesheets/fix-dropdown-select.sass +1 -1
  8. data/app/assets/stylesheets/table.sass +1 -1
  9. data/app/assets/stylesheets/ui_bibz.sass +60 -22
  10. data/app/inputs/ui_bibz_form/ui_bibz_form_builder.rb +35 -0
  11. data/app/inputs/ui_bibz_inputs/auto_complete_field_input.rb +14 -0
  12. data/app/inputs/{custom_inputs → ui_bibz_inputs}/base_input.rb +7 -1
  13. data/app/inputs/{custom_inputs → ui_bibz_inputs}/collection_input.rb +6 -3
  14. data/app/inputs/{custom_inputs → ui_bibz_inputs}/string_input.rb +5 -1
  15. data/app/inputs/ui_bibz_inputs/ui_auto_complete_field_input.rb +14 -0
  16. data/app/inputs/ui_bibz_inputs/ui_button_choices_input.rb +20 -0
  17. data/app/inputs/{custom_inputs/date_picker_field_input.rb → ui_bibz_inputs/ui_date_picker_field_input.rb} +2 -2
  18. data/app/inputs/{custom_inputs/dropdown_select_field_input.rb → ui_bibz_inputs/ui_dropdown_select_field_input.rb} +2 -2
  19. data/app/inputs/{custom_inputs/formula_field_input.rb → ui_bibz_inputs/ui_formula_field_input.rb} +2 -2
  20. data/app/inputs/{custom_inputs/markdown_editor_field_input.rb → ui_bibz_inputs/ui_markdown_editor_field_input.rb} +2 -2
  21. data/app/inputs/{custom_inputs/multi_column_field_input.rb → ui_bibz_inputs/ui_multi_column_field_input.rb} +2 -2
  22. data/app/inputs/ui_bibz_inputs/ui_multi_select_field_input.rb +9 -0
  23. data/app/inputs/{custom_inputs/radio_field_input.rb → ui_bibz_inputs/ui_radio_field_input.rb} +2 -2
  24. data/app/inputs/{custom_inputs/select_field_input.rb → ui_bibz_inputs/ui_select_field_input.rb} +2 -2
  25. data/app/inputs/{custom_inputs/switch_field_input.rb → ui_bibz_inputs/ui_switch_field_input.rb} +2 -2
  26. data/app/inputs/ui_bibz_inputs/ui_text_field_input.rb +13 -0
  27. data/config/initializers/ui_bibz.rb +7 -0
  28. data/lib/ui_bibz/helpers/ui/core/cards_helper.rb +42 -0
  29. data/lib/ui_bibz/helpers/ui/core/dropdowns_helper.rb +21 -0
  30. data/lib/ui_bibz/helpers/ui/core/forms_helper.rb +148 -0
  31. data/lib/ui_bibz/helpers/ui/core/layouts_helper.rb +27 -0
  32. data/lib/ui_bibz/helpers/ui/core/lists_helper.rb +11 -0
  33. data/lib/ui_bibz/helpers/ui/core/navs_helper.rb +27 -0
  34. data/lib/ui_bibz/helpers/ui/core/paths_helper.rb +16 -0
  35. data/lib/ui_bibz/helpers/ui/core/windows_helper.rb +11 -0
  36. data/lib/ui_bibz/helpers/ui/core_helper.rb +89 -0
  37. data/lib/ui_bibz/helpers/{ui_ux_helper.rb → ui/ux_helper.rb} +8 -18
  38. data/lib/ui_bibz/helpers/utils_helper.rb +22 -1
  39. data/lib/ui_bibz/rails/engine.rb +6 -2
  40. data/lib/ui_bibz/ui/base.rb +4 -0
  41. data/lib/ui_bibz/ui/core/{tag.rb → badge.rb} +10 -10
  42. data/lib/ui_bibz/ui/core/cards/card.rb +37 -13
  43. data/lib/ui_bibz/ui/core/cards/components/{block/card_block_link.rb → body/card_body_link.rb} +6 -6
  44. data/lib/ui_bibz/ui/core/cards/components/{block/card_block_text.rb → body/card_body_text.rb} +6 -6
  45. data/lib/ui_bibz/ui/core/cards/components/{block/card_block_title.rb → body/card_body_title.rb} +6 -6
  46. data/lib/ui_bibz/ui/core/cards/components/{card_block.rb → card_body.rb} +17 -13
  47. data/lib/ui_bibz/ui/core/cards/components/card_footer.rb +5 -1
  48. data/lib/ui_bibz/ui/core/cards/components/card_header.rb +5 -1
  49. data/lib/ui_bibz/ui/core/cards/components/card_image.rb +3 -2
  50. data/lib/ui_bibz/ui/core/component.rb +8 -6
  51. data/lib/ui_bibz/ui/core/dropdowns/dropdown.rb +21 -5
  52. data/lib/ui_bibz/ui/core/forms/buttons/button.rb +37 -8
  53. data/lib/ui_bibz/ui/core/forms/buttons/button_choice.rb +17 -29
  54. data/lib/ui_bibz/ui/core/forms/buttons/button_group.rb +51 -11
  55. data/lib/ui_bibz/ui/core/forms/buttons/button_link.rb +18 -5
  56. data/lib/ui_bibz/ui/core/forms/buttons/button_refresh.rb +13 -4
  57. data/lib/ui_bibz/ui/core/forms/buttons/button_toolbar.rb +90 -0
  58. data/lib/ui_bibz/ui/core/forms/buttons/components/choice.rb +116 -0
  59. data/lib/ui_bibz/ui/core/forms/choices/checkbox_field.rb +21 -8
  60. data/lib/ui_bibz/ui/core/forms/choices/radio_field.rb +22 -9
  61. data/lib/ui_bibz/ui/core/forms/choices/switch_field.rb +17 -5
  62. data/lib/ui_bibz/ui/core/forms/dates/date_picker_field.rb +36 -16
  63. data/lib/ui_bibz/ui/core/forms/numbers/formula_field.rb +20 -19
  64. data/lib/ui_bibz/ui/core/forms/selects/abstract_select.rb +99 -0
  65. data/lib/ui_bibz/ui/core/forms/selects/dropdown_select_field.rb +16 -16
  66. data/lib/ui_bibz/ui/core/forms/selects/multi_column_field.rb +8 -13
  67. data/lib/ui_bibz/ui/core/forms/selects/multi_select_field.rb +17 -18
  68. data/lib/ui_bibz/ui/core/forms/selects/select_field.rb +8 -20
  69. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_addon.rb +25 -0
  70. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button.rb +16 -0
  71. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button_group.rb +16 -0
  72. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button_link.rb +16 -0
  73. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button_refresh.rb +16 -0
  74. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_checkbox_field.rb +16 -0
  75. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_dropdown.rb +16 -0
  76. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_radio_field.rb +16 -0
  77. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_switch_field.rb +16 -0
  78. data/lib/ui_bibz/ui/core/forms/surrounds/surround_field.rb +153 -0
  79. data/lib/ui_bibz/ui/core/forms/texts/auto_complete_field.rb +13 -38
  80. data/lib/ui_bibz/ui/core/forms/texts/text_field.rb +81 -0
  81. data/lib/ui_bibz/ui/core/glyph.rb +1 -1
  82. data/lib/ui_bibz/ui/core/layouts/col.rb +10 -2
  83. data/lib/ui_bibz/ui/core/layouts/row.rb +7 -1
  84. data/lib/ui_bibz/ui/core/lists/components/list/list_body.rb +4 -2
  85. data/lib/ui_bibz/ui/core/lists/components/list/list_header.rb +5 -2
  86. data/lib/ui_bibz/ui/core/lists/components/list.rb +35 -14
  87. data/lib/ui_bibz/ui/core/lists/list_group.rb +4 -4
  88. data/lib/ui_bibz/ui/core/navs/components/navbar_form.rb +7 -2
  89. data/lib/ui_bibz/ui/core/navs/components/navbar_nav.rb +4 -0
  90. data/lib/ui_bibz/ui/core/navs/components/navbar_text.rb +1 -1
  91. data/lib/ui_bibz/ui/core/navs/components/pagination_link.rb +60 -0
  92. data/lib/ui_bibz/ui/core/navs/nav.rb +31 -3
  93. data/lib/ui_bibz/ui/core/navs/navbar.rb +32 -22
  94. data/lib/ui_bibz/ui/core/navs/pagination.rb +97 -0
  95. data/lib/ui_bibz/ui/core/{alert.rb → notifications/alert.rb} +23 -11
  96. data/lib/ui_bibz/ui/core/notifications/components/alert_body.rb +50 -0
  97. data/lib/ui_bibz/ui/core/notifications/components/alert_header.rb +67 -0
  98. data/lib/ui_bibz/ui/core/{progress.rb → progresses/components/bar.rb} +21 -28
  99. data/lib/ui_bibz/ui/core/progresses/progress_bar.rb +115 -0
  100. data/lib/ui_bibz/ui/core/windows/components/modal_header.rb +1 -1
  101. data/lib/ui_bibz/ui/{core → extensions/core}/component/glyph_extension.rb +2 -2
  102. data/lib/ui_bibz/ui/{core → extensions/core}/component/klass_extension.rb +1 -2
  103. data/lib/ui_bibz/ui/extensions/core/forms/connect_extension.rb +31 -0
  104. data/lib/ui_bibz/ui/extensions/core/forms/surround_extension.rb +48 -0
  105. data/lib/ui_bibz/utils/internationalization.rb +9 -0
  106. data/lib/ui_bibz/version.rb +1 -1
  107. data/lib/ui_bibz.rb +23 -7
  108. data/test/simple_form_test.rb +58 -41
  109. data/test/ui/core/badge_test.rb +19 -0
  110. data/test/ui/core/cards/card_test.rb +34 -35
  111. data/test/ui/{component_test.rb → core/component_test.rb} +0 -1
  112. data/test/ui/core/dropdowns/dropdown_test.rb +5 -5
  113. data/test/ui/core/forms/buttons/button_choice_test.rb +23 -7
  114. data/test/ui/core/forms/buttons/button_group_test.rb +35 -17
  115. data/test/ui/core/forms/buttons/button_link_test.rb +74 -4
  116. data/test/ui/core/forms/buttons/button_refresh_test.rb +1 -2
  117. data/test/ui/core/forms/buttons/button_test.rb +66 -3
  118. data/test/ui/core/forms/choices/checkbox_field_test.rb +1 -2
  119. data/test/ui/core/forms/choices/radio_field_test.rb +1 -2
  120. data/test/ui/core/forms/choices/switch_field_test.rb +0 -1
  121. data/test/ui/core/forms/dates/date_picker_field_test.rb +2 -3
  122. data/test/ui/core/forms/numbers/formula_field_test.rb +1 -2
  123. data/test/ui/core/forms/selects/dropdown_select_field_test.rb +1 -2
  124. data/test/ui/core/forms/selects/multi_column_field_test.rb +0 -1
  125. data/test/ui/core/forms/selects/multi_select_field_test.rb +1 -2
  126. data/test/ui/core/forms/selects/select_field_test.rb +1 -2
  127. data/test/ui/core/forms/surrounds/surround_field_test.rb +58 -0
  128. data/test/ui/core/forms/textareas/markdown_editor_field_test.rb +0 -1
  129. data/test/ui/core/forms/texts/auto_complete_field_test.rb +21 -4
  130. data/test/ui/core/forms/texts/text_field_test.rb +25 -0
  131. data/test/ui/{glyph_test.rb → core/glyph_test.rb} +5 -5
  132. data/test/ui/core/jumbotron_test.rb +20 -0
  133. data/test/ui/core/layouts/col_test.rb +31 -0
  134. data/test/ui/core/layouts/container_test.rb +13 -0
  135. data/test/ui/core/layouts/row_test.rb +24 -0
  136. data/test/ui/core/lists/list_group_test.rb +5 -4
  137. data/test/ui/core/navs/nav_test.rb +4 -5
  138. data/test/ui/core/navs/navbar_test.rb +39 -0
  139. data/test/ui/core/notifications/alert_test.rb +22 -0
  140. data/test/ui/core/paths/breadcrumb_test.rb +15 -4
  141. data/test/ui/core/progress_test.rb +14 -0
  142. data/test/ui/{star_test.rb → core/star_test.rb} +6 -7
  143. data/test/ui/core/windows/modal_test.rb +20 -0
  144. data/test/ui/ux/tables/table_test.rb +2 -3
  145. data/ui_bibz.gemspec +2 -1
  146. data/vendor/assets/javascripts/bootstrap-select.min.js +8 -7
  147. data/vendor/assets/stylesheets/awesome-bootstrap-checkbox.scss +62 -42
  148. data/vendor/assets/stylesheets/bootstrap-multiselect.min.css +1 -1
  149. data/vendor/assets/stylesheets/bootstrap-select.min.css +3 -3
  150. data/vendor/assets/stylesheets/bootstrap-theme.min.css +1 -1
  151. metadata +105 -44
  152. data/app/inputs/custom_inputs/auto_complete_field_input.rb +0 -16
  153. data/app/inputs/custom_inputs/multi_select_field_input.rb +0 -9
  154. data/app/inputs/custom_inputs/surround_field_input.rb +0 -10
  155. data/lib/ui_bibz/helpers/ui_core_helper.rb +0 -347
  156. data/lib/ui_bibz/ui/core/connected_component.rb +0 -87
  157. data/lib/ui_bibz/ui/core/forms/texts/surround_field.rb +0 -87
  158. data/test/ui/core/forms/texts/surround_field_test.rb +0 -26
  159. data/test/ui/grid_test.rb +0 -31
  160. data/test/ui_helper_test.rb +0 -109
@@ -1,30 +1,33 @@
1
- module CustomInputs
1
+ module UiBibzInputs
2
2
  class CollectionInput < SimpleForm::Inputs::CollectionInput
3
3
  include UiBibz::Ui::Core::Forms::Selects
4
4
  include ActionView::Helpers::FormOptionsHelper
5
5
 
6
6
  def input_html_options
7
7
  opts = super
8
+ input_classes = UiBibz::Utils::Screwdriver.join_classes(@builder.options[:input_html].try(:[], :class), options[:input_html].try(:[], :class), options[:class])
8
9
  opts = opts.merge({ prompt: options[:prompt] }) unless options[:prompt].blank?
9
10
  opts = opts.merge({ disabled: options[:disabled] }) unless options[:disabled].blank?
10
11
  opts = opts.merge({ include_blank: options[:include_blank] }) unless options[:include_blank].blank?
11
12
  opts = opts.merge({ multiple: options[:multiple] }) unless options[:multiple].blank?
13
+ opts = (@builder.options[:input_html] || {}).merge(options[:input_html] || {}).merge(opts || {}).merge({ class: input_classes })
12
14
  opts
13
15
  end
14
16
 
15
17
  def new_options
16
18
  label_method, value_method = detect_collection_methods
19
+ new_value = @builder.object.send(attribute_name).blank? ? @builder.object.send(attribute_name) : ActiveSupport::JSON.decode(@builder.object.send(attribute_name).to_s)
17
20
 
18
21
  if options[:grouped] == true
19
22
  options.merge({ option_tags: option_groups_from_collection_for_select(
20
23
  grouped_collection,
21
24
  group_method, group_label_method,
22
25
  value_method, label_method,
23
- @builder.object.send(attribute_name)
26
+ new_value
24
27
  )})
25
28
  else
26
29
  options.merge({ option_tags: options_from_collection_for_select(
27
- collection, value_method, label_method, @builder.object.send(attribute_name)
30
+ collection, value_method, label_method, new_value
28
31
  )})
29
32
  end
30
33
  end
@@ -1,4 +1,4 @@
1
- module CustomInputs
1
+ module UiBibzInputs
2
2
  class StringInput < SimpleForm::Inputs::Base
3
3
 
4
4
  enable :placeholder, :maxlength, :minlength, :pattern
@@ -14,6 +14,10 @@ module CustomInputs
14
14
  @builder.text_field(attribute_name, merged_input_options)
15
15
  end
16
16
 
17
+ def options
18
+ super.merge({ value: @builder.object.send(attribute_name) || super[:value] })
19
+ end
20
+
17
21
  private
18
22
 
19
23
  def string?
@@ -0,0 +1,14 @@
1
+ module UiBibzInputs
2
+ class UiAutoCompleteFieldInput < CollectionInput
3
+ include UiBibz::Ui::Core::Forms::Texts
4
+
5
+ def input(wrapper_options)
6
+ UiBibz::Ui::Core::Forms::Texts::AutoCompleteField.new(input_attribute_name, new_options, input_html_options).render
7
+ end
8
+
9
+ def new_options
10
+ super.merge({ value: @builder.object.send(attribute_name) })
11
+ end
12
+
13
+ end
14
+ end
@@ -0,0 +1,20 @@
1
+ module UiBibzInputs
2
+ class UiButtonChoicesInput < CollectionInput#::Inputs::CollectionRadioButtonsInput
3
+ include UiBibz::Ui::Core::Forms::Buttons
4
+
5
+ def input(wrapper_options = nil)
6
+ label_method, value_method = detect_collection_methods
7
+
8
+ merged_input_options = merge_wrapper_options(input_html_options, wrapper_options)
9
+
10
+ UiBibz::Ui::Core::Forms::Buttons::ButtonChoice.new(input_options).tap do |bc|
11
+ collection.each do |item|
12
+ opts = { name: "#{ @builder.object.class.name.underscore }[#{ attribute_name }]", value: item[1] }
13
+ opts = opts.merge({ state: :active }) if @builder.object.send(attribute_name).to_s == item[1].to_s
14
+ bc.button item[0], opts
15
+ end
16
+ end.render
17
+ end
18
+
19
+ end
20
+ end
@@ -1,5 +1,5 @@
1
- module CustomInputs
2
- class DatePickerFieldInput < BaseInput
1
+ module UiBibzInputs
2
+ class UiDatePickerFieldInput < BaseInput
3
3
  include UiBibz::Ui::Core::Forms::Dates
4
4
 
5
5
  def input(wrapper_options)
@@ -1,5 +1,5 @@
1
- module CustomInputs
2
- class DropdownSelectFieldInput < CollectionInput
1
+ module UiBibzInputs
2
+ class UiDropdownSelectFieldInput < CollectionInput
3
3
 
4
4
  def input(wrapper_options)
5
5
  UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new(input_attribute_name, new_options, input_html_options).render
@@ -1,5 +1,5 @@
1
- module CustomInputs
2
- class FormulaFieldInput < StringInput
1
+ module UiBibzInputs
2
+ class UiFormulaFieldInput < StringInput
3
3
  include UiBibz::Ui::Core::Forms::Numbers
4
4
 
5
5
  def input(wrapper_options)
@@ -1,5 +1,5 @@
1
- module CustomInputs
2
- class MarkdownEditorFieldInput < StringInput
1
+ module UiBibzInputs
2
+ class UiMarkdownEditorFieldInput < StringInput
3
3
  include UiBibz::Ui::Core::Forms::Textareas
4
4
 
5
5
  def input(wrapper_options)
@@ -1,5 +1,5 @@
1
- module CustomInputs
2
- class MultiColumnFieldInput < CollectionInput
1
+ module UiBibzInputs
2
+ class UiMultiColumnFieldInput < CollectionInput
3
3
  include UiBibz::Ui::Core::Forms::Selects
4
4
 
5
5
  def input(wrapper_options)
@@ -0,0 +1,9 @@
1
+ module UiBibzInputs
2
+ class UiMultiSelectFieldInput < CollectionInput
3
+
4
+ def input(wrapper_options)
5
+ UiBibz::Ui::Core::Forms::Selects::MultiSelectField.new(input_attribute_name, new_options, input_html_options).render
6
+ end
7
+
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
- module CustomInputs
2
- class RadioFieldInput < SimpleForm::Inputs::CollectionRadioButtonsInput
1
+ module UiBibzInputs
2
+ class UiRadioFieldInput < SimpleForm::Inputs::CollectionRadioButtonsInput
3
3
  include UiBibz::Ui::Core::Forms::Choices
4
4
 
5
5
  def input(wrapper_options)
@@ -1,5 +1,5 @@
1
- module CustomInputs
2
- class SelectFieldInput < CollectionInput
1
+ module UiBibzInputs
2
+ class UiSelectFieldInput < CollectionInput
3
3
 
4
4
  def input(wrapper_options)
5
5
  UiBibz::Ui::Core::Forms::Selects::SelectField.new(input_attribute_name, new_options, input_html_options).render
@@ -1,5 +1,5 @@
1
- module CustomInputs
2
- class SwitchFieldInput < BaseInput
1
+ module UiBibzInputs
2
+ class UiSwitchFieldInput < BaseInput
3
3
  include UiBibz::Ui::Core::Forms::Choices
4
4
 
5
5
  def input(wrapper_options)
@@ -0,0 +1,13 @@
1
+ module UiBibzInputs
2
+ class UiTextFieldInput < StringInput
3
+ include UiBibz::Ui::Core::Forms::Texts
4
+
5
+ def input(wrapper_options)
6
+ UiBibz::Ui::Core::Forms::Texts::TextField.new(input_attribute_name, options, input_html_options).render
7
+ end
8
+
9
+ def input_attribute_name
10
+ "#{ @builder.object.class.to_s.parameterize.underscore }[#{ attribute_name }]"
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,7 @@
1
+ SimpleForm.setup do |config|
2
+ # Namespaces where SimpleForm should look for custom input classes that
3
+ # override default inputs.
4
+ config.custom_inputs_namespaces << "UiBibzInputs"
5
+ end
6
+
7
+ Rails.application.config.autoload_paths += Dir[File.join(Rails.root, "app", "ui", "**", "*.rb")].each {|l| require l }
@@ -0,0 +1,42 @@
1
+ module UiBibz::Helpers::Ui::Core::CardsHelper
2
+
3
+ # Card Component
4
+ #
5
+ # +options+ (Hash)
6
+ # +html_options+ (Hash)
7
+ #
8
+ # Option +tap: true+ is required if you want add +header+, +block+ or
9
+ # +footer+.
10
+ def ui_card content = nil, options = nil, html_options = nil, &block
11
+ if is_tap(content, options)
12
+ UiBibz::Ui::Core::Cards::Card.new(content, options, html_options).tap(&block).render
13
+ else
14
+ UiBibz::Ui::Core::Cards::Card.new(content, options, html_options, &block).render
15
+ end
16
+ end
17
+
18
+ # Card Group Component
19
+ #
20
+ # +options+ (Hash)
21
+ # +html_options+ (Hash)
22
+ def ui_card_group content = nil, options = nil, html_options = nil, &block
23
+ UiBibz::Ui::Core::Cards::CardGroup.new(content, options, html_options).tap(&block).render
24
+ end
25
+
26
+ # Card Deck Component
27
+ #
28
+ # +options+ (Hash)
29
+ # +html_options+ (Hash)
30
+ def ui_card_deck content = nil, options = nil, html_options = nil, &block
31
+ UiBibz::Ui::Core::Cards::CardDeck.new(content, options, html_options).tap(&block).render
32
+ end
33
+
34
+ # Card Column Component
35
+ #
36
+ # +options+ (Hash)
37
+ # +html_options+ (Hash)
38
+ def ui_card_column content = nil, options = nil, html_options = nil, &block
39
+ UiBibz::Ui::Core::Cards::CardColumn.new(content, options, html_options).tap(&block).render
40
+ end
41
+
42
+ end
@@ -0,0 +1,21 @@
1
+ module UiBibz::Helpers::Ui::Core::DropdownsHelper
2
+
3
+ # Dropdown Component
4
+ #
5
+ # +name+ (String) [Required]
6
+ # +options+ (Hash)
7
+ # +html_options+ (Hash)
8
+ def ui_dropdown name, options = nil, html_options = nil, &block
9
+ UiBibz::Ui::Core::Dropdowns::Dropdown.new(name, options, html_options).tap(&block).render
10
+ end
11
+
12
+ # Split Dropdown Component
13
+ #
14
+ # +name+ (String) [Required]
15
+ # +options+ (Hash)
16
+ # +html_options+ (Hash)
17
+ def ui_split_dropdown name, options = nil, html_options = nil, &block
18
+ UiBibz::Ui::Core::Dropdowns::SplitDropdown.new(name, options, html_options).tap(&block).render
19
+ end
20
+
21
+ end
@@ -0,0 +1,148 @@
1
+ module UiBibz::Helpers::Ui::Core::FormsHelper
2
+
3
+ # Button Component
4
+ #
5
+ # +options+ (Hash)
6
+ # +html_options+ (Hash)
7
+ def ui_button content = nil, options = nil, html_options = nil, &block
8
+ UiBibz::Ui::Core::Forms::Buttons::Button.new(content, options, html_options, &block).render
9
+ end
10
+
11
+ # Button Choice Component
12
+ #
13
+ # +options+ (Hash)
14
+ # +html_options+ (Hash)
15
+ def ui_button_choice content = nil, options = nil, html_options = nil, &block
16
+ UiBibz::Ui::Core::Forms::Buttons::ButtonChoice.new(content, options, html_options).tap(&block).render
17
+ end
18
+
19
+ # Button Group Component
20
+ #
21
+ # +options+ (Hash)
22
+ # +html_options+ (Hash)
23
+ def ui_button_group content = nil, options = nil, html_options = nil, &block
24
+ UiBibz::Ui::Core::Forms::Buttons::ButtonGroup.new(content, options, html_options).tap(&block).render
25
+ end
26
+
27
+ # Button Link Component
28
+ #
29
+ # +options+ (Hash)
30
+ # +html_options+ (Hash)
31
+ def ui_button_link content = nil, options = nil, html_options = nil, &block
32
+ UiBibz::Ui::Core::Forms::Buttons::ButtonLink.new(content, options, html_options, &block).render
33
+ end
34
+
35
+ # Button Toolbar Component
36
+ #
37
+ # +options+ (Hash)
38
+ # +html_options+ (Hash)
39
+ def ui_button_toolbar content = nil, options = nil, html_options = nil, &block
40
+ UiBibz::Ui::Core::Forms::Buttons::ButtonToolbar.new(content, options, html_options).tap(&block).render
41
+ end
42
+
43
+ # Date Picker Field Component
44
+ #
45
+ # +options+ (Hash)
46
+ # +html_options+ (Hash)
47
+ def ui_date_picker_field content = nil, options = nil, html_options = nil, &block
48
+ UiBibz::Ui::Core::Forms::Dates::DatePickerField.new(content, options, html_options, &block).render
49
+ end
50
+
51
+ # Markdown Editor Field Component
52
+ #
53
+ # +options+ (Hash)
54
+ # +html_options+ (Hash)
55
+ def ui_markdown_editor_field content = nil, options = nil, html_options = nil, &block
56
+ UiBibz::Ui::Core::Forms::Textareas::MarkdownEditorField.new(content, options, html_options, &block).render
57
+ end
58
+
59
+ # Multi Column Field Component
60
+ #
61
+ # +options+ (Hash)
62
+ # +html_options+ (Hash)
63
+ def ui_multi_column_field content = nil, options = nil, html_options = nil, &block
64
+ UiBibz::Ui::Core::Forms::Selects::MultiColumnField.new(content, options, html_options, &block).render
65
+ end
66
+
67
+ # Multi Select Field Component
68
+ #
69
+ # +options+ (Hash)
70
+ # +html_options+ (Hash)
71
+ def ui_multi_select_field content = nil, options = nil, html_options = nil, &block
72
+ UiBibz::Ui::Core::Forms::Selects::MultiSelectField.new(content, options, html_options, &block).render
73
+ end
74
+
75
+ # Formula Field Component
76
+ #
77
+ # +options+ (Hash)
78
+ # +html_options+ (Hash)
79
+ def ui_formula_field content = nil, options = nil, html_options = nil, &block
80
+ UiBibz::Ui::Core::Forms::Numbers::FormulaField.new(content, options, html_options, &block).render
81
+ end
82
+
83
+ # String Field Component
84
+ #
85
+ # +options+ (Hash)
86
+ # +html_options+ (Hash)
87
+ def ui_text_field content = nil, options = nil, html_options = nil, &block
88
+ UiBibz::Ui::Core::Forms::Texts::TextField.new(content, options, html_options, &block).render
89
+ end
90
+
91
+ # Switch Field Component
92
+ #
93
+ # +options+ (Hash)
94
+ # +html_options+ (Hash)
95
+ def ui_switch_field content = nil, options = nil, html_options = nil, &block
96
+ UiBibz::Ui::Core::Forms::Choices::SwitchField.new(content, options, html_options, &block).render
97
+ end
98
+
99
+ # Checkbox Field Component
100
+ #
101
+ # +options+ (Hash)
102
+ # +html_options+ (Hash)
103
+ def ui_checkbox_field content = nil, options = nil, html_options = nil, &block
104
+ UiBibz::Ui::Core::Forms::Choices::CheckboxField.new(content, options, html_options, &block).render
105
+ end
106
+
107
+ # Radio Field Component
108
+ #
109
+ # +options+ (Hash)
110
+ # +html_options+ (Hash)
111
+ def ui_radio_field content = nil, options = nil, html_options = nil, &block
112
+ UiBibz::Ui::Core::Forms::Choices::RadioField.new(content, options, html_options, &block).render
113
+ end
114
+
115
+ # Select Field Component
116
+ #
117
+ # +options+ (Hash)
118
+ # +html_options+ (Hash)
119
+ def ui_select_field content = nil, options = nil, html_options = nil, &block
120
+ UiBibz::Ui::Core::Forms::Selects::SelectField.new(content, options, html_options, &block).render
121
+ end
122
+
123
+ # Dropdown Select Field Component
124
+ #
125
+ # +options+ (Hash)
126
+ # +html_options+ (Hash)
127
+ def ui_dropdown_select_field content = nil, options = nil, html_options = nil, &block
128
+ UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new(content, options, html_options, &block).render
129
+ end
130
+
131
+ # Auto Complete Field Component
132
+ #
133
+ # +options+ (Hash)
134
+ # +html_options+ (Hash)
135
+ def ui_auto_complete_field content = nil, options = nil, html_options = nil, &block
136
+ UiBibz::Ui::Core::Forms::Texts::AutoCompleteField.new(content, options, html_options, &block).render
137
+ end
138
+
139
+ # Surround Field Component
140
+ #
141
+ # +options+ (Hash)
142
+ # +html_options+ (Hash)
143
+ def ui_surround_field content = nil, options = nil, html_options = nil, &block
144
+ UiBibz::Ui::Core::Forms::Surrounds::SurroundField.new(content, options, html_options).tap(&block).render
145
+ end
146
+
147
+ end
148
+
@@ -0,0 +1,27 @@
1
+ module UiBibz::Helpers::Ui::Core::LayoutsHelper
2
+
3
+ # Row Component
4
+ #
5
+ # +options+ (Hash)
6
+ # +html_options+ (Hash)
7
+ def ui_row content = nil, options = nil, html_options = nil, &block
8
+ UiBibz::Ui::Core::Layouts::Row.new(content, options, html_options, &block).render
9
+ end
10
+
11
+ # Col Component
12
+ #
13
+ # +options+ (Hash)
14
+ # +html_options+ (Hash)
15
+ def ui_col content = nil, options = nil, html_options = nil, &block
16
+ UiBibz::Ui::Core::Layouts::Col.new(content, options, html_options, &block).render
17
+ end
18
+
19
+ # Container Component
20
+ #
21
+ # +options+ (Hash)
22
+ # +html_options+ (Hash)
23
+ def ui_container content = nil, options = nil, html_options = nil, &block
24
+ UiBibz::Ui::Core::Layouts::Container.new(content, options, html_options, &block).render
25
+ end
26
+
27
+ end
@@ -0,0 +1,11 @@
1
+ module UiBibz::Helpers::Ui::Core::ListsHelper
2
+
3
+ # List Group Component
4
+ #
5
+ # +options+ (Hash)
6
+ # +html_options+ (Hash)
7
+ def ui_list_group content = nil, options = nil, html_options = nil, &block
8
+ UiBibz::Ui::Core::Lists::ListGroup.new(content, options, html_options).tap(&block).render
9
+ end
10
+
11
+ end
@@ -0,0 +1,27 @@
1
+ module UiBibz::Helpers::Ui::Core::NavsHelper
2
+
3
+ # Nav Component
4
+ #
5
+ # +options+ (Hash)
6
+ # +html_options+ (Hash)
7
+ def ui_nav content = nil, options = nil, html_options = nil, &block
8
+ UiBibz::Ui::Core::Navs::Nav.new(content, options, html_options).tap(&block).render
9
+ end
10
+
11
+ # Navbar Component
12
+ #
13
+ # +options+ (Hash)
14
+ # +html_options+ (Hash)
15
+ def ui_navbar content = nil, options = nil, html_options = nil, &block
16
+ UiBibz::Ui::Core::Navs::Navbar.new(content, options, html_options).tap(&block).render
17
+ end
18
+
19
+ # Pagination Component
20
+ #
21
+ # +options+ (Hash)
22
+ # +html_options+ (Hash)
23
+ def ui_pagination content = nil, options = nil, html_options = nil, &block
24
+ UiBibz::Ui::Core::Navs::Pagination.new(content, options, html_options).tap(&block).render
25
+ end
26
+
27
+ end
@@ -0,0 +1,16 @@
1
+ module UiBibz::Helpers::Ui::Core::PathsHelper
2
+
3
+ # Breadcrumb Component
4
+ #
5
+ # +options+ (Hash)
6
+ # +html_options+ (Hash)
7
+ #
8
+ def ui_breadcrumb content = nil, options = nil, html_options = nil, &block
9
+ if is_tap(content, options)
10
+ UiBibz::Ui::Core::Paths::Breadcrumb.new(content, options, html_options).tap(&block).render
11
+ else
12
+ UiBibz::Ui::Core::Paths::Breadcrumb.new(content, options, html_options, &block).render
13
+ end
14
+ end
15
+
16
+ end
@@ -0,0 +1,11 @@
1
+ module UiBibz::Helpers::Ui::Core::WindowsHelper
2
+
3
+ # Modal Component
4
+ #
5
+ # +options+ (Hash)
6
+ # +html_options+ (Hash)
7
+ def ui_modal content = nil, options = nil, html_options = nil, &block
8
+ UiBibz::Ui::Core::Windows::Modal.new(content, options, html_options).tap(&block).render
9
+ end
10
+
11
+ end
@@ -0,0 +1,89 @@
1
+ require 'ui_bibz/helpers/ui/core/cards_helper'
2
+ require 'ui_bibz/helpers/ui/core/dropdowns_helper'
3
+ require 'ui_bibz/helpers/ui/core/forms_helper'
4
+ require 'ui_bibz/helpers/ui/core/layouts_helper'
5
+ require 'ui_bibz/helpers/ui/core/lists_helper'
6
+ require 'ui_bibz/helpers/ui/core/navs_helper'
7
+ require 'ui_bibz/helpers/ui/core/paths_helper'
8
+ require 'ui_bibz/helpers/ui/core/windows_helper'
9
+ module UiBibz::Helpers::Ui::CoreHelper
10
+ include UiBibz::Helpers::Ui::Core::CardsHelper
11
+ include UiBibz::Helpers::Ui::Core::DropdownsHelper
12
+ include UiBibz::Helpers::Ui::Core::FormsHelper
13
+ include UiBibz::Helpers::Ui::Core::LayoutsHelper
14
+ include UiBibz::Helpers::Ui::Core::ListsHelper
15
+ include UiBibz::Helpers::Ui::Core::NavsHelper
16
+ include UiBibz::Helpers::Ui::Core::PathsHelper
17
+ include UiBibz::Helpers::Ui::Core::WindowsHelper
18
+
19
+ # Alert Component
20
+ #
21
+ # +options+ (Hash)
22
+ # +html_options+ (Hash)
23
+ #
24
+ def ui_alert content = nil, options = nil, html_options = nil, &block
25
+ if is_tap(content, options)
26
+ UiBibz::Ui::Core::Notifications::Alert.new(content, options, html_options).tap(&block).render
27
+ else
28
+ UiBibz::Ui::Core::Notifications::Alert.new(content, options, html_options, &block).render
29
+ end
30
+ end
31
+
32
+ # Glyph Component
33
+ #
34
+ # + content+ (String || Hash) [Required]
35
+ # +options+ (Hash)
36
+ # +html_options+ (Hash)
37
+ #
38
+ # Glyph component with some exeption, it can be written
39
+ # => glyph 'calendar', size: :xs
40
+ # or
41
+ # => glyph { name: 'calendar', size: :xs }
42
+ def ui_glyph content, options = nil, html_options = nil, &block
43
+ UiBibz::Ui::Core::Glyph.new(content, options, html_options, &block).render
44
+ end
45
+
46
+ # Jumbotron Component
47
+ #
48
+ # +options+ (Hash)
49
+ # +html_options+ (Hash)
50
+ def ui_jumbotron content = nil, options = nil, html_options = nil, &block
51
+ UiBibz::Ui::Core::Jumbotron.new(content, options, html_options, &block).render
52
+ end
53
+
54
+ # Badge (Label) Component
55
+ #
56
+ # +options+ (Hash)
57
+ # +html_options+ (Hash)
58
+ #
59
+ def ui_badge content = nil, options = nil, html_options = nil, &block
60
+ UiBibz::Ui::Core::Badge.new(content, options, html_options, &block).render
61
+ end
62
+
63
+ # ProgressBar Component
64
+ #
65
+ # +options+ (Hash)
66
+ # +html_options+ (Hash)
67
+ def ui_progress_bar percentage = nil, options = nil, html_options = nil, &block
68
+ if is_tap(percentage, options)
69
+ UiBibz::Ui::Core::Progresses::ProgressBar.new(percentage, options, html_options).tap(&block).render
70
+ else
71
+ UiBibz::Ui::Core::Progresses::ProgressBar.new(percentage, options, html_options, &block).render
72
+ end
73
+ end
74
+
75
+ # Stars Component
76
+ #
77
+ # +options+ (Hash)
78
+ # +html_options+ (Hash)
79
+ def ui_star content = nil, options = nil, html_options = nil, &block
80
+ UiBibz::Ui::Core::Star.new(content, options, html_options, &block).render
81
+ end
82
+
83
+ private
84
+
85
+ def is_tap content, options
86
+ (content[:tap] if content.kind_of?(Hash)) || (options[:tap] unless options.nil?)
87
+ end
88
+
89
+ end
@@ -1,6 +1,4 @@
1
- module UiBibz::Helpers::UiUxHelper
2
-
3
- # Table section begin ------------------------------------------------------
1
+ module UiBibz::Helpers::Ui::UxHelper
4
2
 
5
3
  # Table Component
6
4
  #
@@ -9,7 +7,7 @@ module UiBibz::Helpers::UiUxHelper
9
7
  #
10
8
  # Option +tap: true+ is required if you want add +header+, +block+ or
11
9
  # +footer+.
12
- def table content = nil, options = nil, html_options = nil, &block
10
+ def ui_table content = nil, options = nil, html_options = nil, &block
13
11
  if is_tap(content, options)
14
12
  UiBibz::Ui::Ux::Tables::Table.new(content, options, html_options).tap(&block).render
15
13
  else
@@ -21,7 +19,7 @@ module UiBibz::Helpers::UiUxHelper
21
19
  #
22
20
  # +options+ (Hash) [Required]
23
21
  # +html_options+ (Hash)
24
- def table_search_field options, html_options = nil
22
+ def ui_table_search_field options, html_options = nil
25
23
  UiBibz::Ui::Ux::Tables::TableSearchField.new(options, html_options).render
26
24
  end
27
25
 
@@ -29,7 +27,7 @@ module UiBibz::Helpers::UiUxHelper
29
27
  #
30
28
  # +options+ (Hash) [Required]
31
29
  # +html_options+ (Hash)
32
- def table_pagination_per_page options, html_options = nil
30
+ def ui_table_pagination_per_page options, html_options = nil
33
31
  UiBibz::Ui::Ux::Tables::TablePaginationPerPage.new(options, html_options).render
34
32
  end
35
33
 
@@ -37,15 +35,15 @@ module UiBibz::Helpers::UiUxHelper
37
35
  #
38
36
  # +options+ (Hash) [Required]
39
37
  # +html_options+ (Hash)
40
- def table_pagination options, html_options = nil
38
+ def ui_table_pagination options, html_options = nil
41
39
  UiBibz::Ui::Ux::Tables::TablePagination.new(options, html_options).render
42
40
  end
43
41
 
44
42
  # Glyph and Text method
45
43
  #
46
44
  # Merge glyph and text with html_safe
47
- def glyph_and_text glyph_args, text
48
- "#{ glyph glyph_args } #{ text }".html_safe
45
+ def ui_glyph_and_text glyph_args, text
46
+ "#{ ui_glyph glyph_args } #{ text }".html_safe
49
47
  end
50
48
 
51
49
  # Table Pagination Component
@@ -55,7 +53,7 @@ module UiBibz::Helpers::UiUxHelper
55
53
  #
56
54
  # Option +tap: true+ is required if you want add +header+, +block+ or
57
55
  # +footer+.
58
- def table_card content = nil, options = nil, html_options = nil, &block
56
+ def ui_table_card content = nil, options = nil, html_options = nil, &block
59
57
  if is_tap(content, options)
60
58
  UiBibz::Ui::Ux::Tables::TableCard.new(content, options, html_options).tap(&block).render
61
59
  else
@@ -63,12 +61,4 @@ module UiBibz::Helpers::UiUxHelper
63
61
  end
64
62
  end
65
63
 
66
- # Table section end -------------------------------------------------------
67
-
68
- private
69
-
70
- def is_tap content, options
71
- (content[:tap] if content.kind_of?(Hash)) || (options[:tap] unless options.nil?)
72
- end
73
-
74
64
  end