ui_bibz 3.0.0.alpha2 → 3.0.0.alpha9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +9 -9
  3. data/README.md +1 -1
  4. data/lib/ui_bibz.rb +0 -1
  5. data/lib/ui_bibz/helpers/ui/core/forms_helper.rb +2 -1
  6. data/lib/ui_bibz/infos.rb +3 -3
  7. data/lib/ui_bibz/inputs/ui_bibz_inputs/base_input.rb +4 -3
  8. data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_checkbox_field_input.rb +5 -1
  9. data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_multi_select_field_input.rb +3 -3
  10. data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_slider_field_input.rb +1 -0
  11. data/lib/ui_bibz/rails/engine.rb +0 -4
  12. data/lib/ui_bibz/ui/concerns/card_itemable_concern.rb +2 -0
  13. data/lib/ui_bibz/ui/concerns/html_concern.rb +3 -3
  14. data/lib/ui_bibz/ui/core/boxes/components/card_body.rb +8 -0
  15. data/lib/ui_bibz/ui/core/boxes/components/card_image.rb +6 -2
  16. data/lib/ui_bibz/ui/core/forms/buttons/button.rb +3 -12
  17. data/lib/ui_bibz/ui/core/forms/buttons/button_link.rb +0 -1
  18. data/lib/ui_bibz/ui/core/forms/buttons/button_refresh.rb +0 -1
  19. data/lib/ui_bibz/ui/core/forms/choices/checkbox_field.rb +13 -4
  20. data/lib/ui_bibz/ui/core/forms/choices/radio_field.rb +7 -1
  21. data/lib/ui_bibz/ui/core/forms/choices/switch_field.rb +4 -0
  22. data/lib/ui_bibz/ui/core/forms/dropdowns/dropdown.rb +12 -8
  23. data/lib/ui_bibz/ui/core/forms/dropdowns/split_dropdown.rb +7 -2
  24. data/lib/ui_bibz/ui/core/forms/numbers/formula_field.rb +2 -0
  25. data/lib/ui_bibz/ui/core/forms/numbers/range_field.rb +19 -1
  26. data/lib/ui_bibz/ui/core/forms/numbers/slider_field.rb +14 -2
  27. data/lib/ui_bibz/ui/core/forms/numbers/slider_header.rb +3 -3
  28. data/lib/ui_bibz/ui/core/forms/selects/dropdown_select_field.rb +41 -59
  29. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button.rb +1 -3
  30. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button_link.rb +1 -3
  31. data/lib/ui_bibz/ui/core/forms/surrounds/surround_field.rb +3 -8
  32. data/lib/ui_bibz/ui/core/icons/glyph.rb +9 -1
  33. data/lib/ui_bibz/ui/core/navigations/components/nav_dropdown.rb +2 -2
  34. data/lib/ui_bibz/ui/core/navigations/components/nav_link_link.rb +2 -2
  35. data/lib/ui_bibz/ui/core/navigations/nav.rb +1 -1
  36. data/lib/ui_bibz/ui/core/navigations/navbar.rb +6 -4
  37. data/lib/ui_bibz/ui/core/navigations/tab_group.rb +4 -0
  38. data/lib/ui_bibz/ui/core/windows/modal.rb +6 -2
  39. data/lib/ui_bibz/ui/extensions/core/component/glyph_extension.rb +12 -24
  40. data/lib/ui_bibz/ui/extensions/core/forms/surround_extension.rb +1 -1
  41. data/lib/ui_bibz/ui/ux/containers/components/panel_header.rb +3 -2
  42. data/lib/ui_bibz/ui/ux/containers/components/panel_header_title.rb +47 -0
  43. data/lib/ui_bibz/ui/ux/tables/table_pagination_per_page.rb +3 -3
  44. data/lib/ui_bibz/ui/ux/tables/table_search_field.rb +4 -4
  45. data/lib/ui_bibz/utils/breakdown_class_name_generator.rb +20 -7
  46. data/lib/ui_bibz/utils/internationalization.rb +1 -1
  47. data/test/simple_form_test.rb +6 -28
  48. data/test/ui/core/boxes/card_test.rb +2 -2
  49. data/test/ui/core/component_test.rb +2 -2
  50. data/test/ui/core/forms/buttons/button_group_test.rb +2 -2
  51. data/test/ui/core/forms/buttons/button_link_test.rb +1 -8
  52. data/test/ui/core/forms/buttons/button_refresh_test.rb +1 -1
  53. data/test/ui/core/forms/buttons/button_test.rb +2 -9
  54. data/test/ui/core/forms/choices/checkbox_field_test.rb +8 -1
  55. data/test/ui/core/forms/choices/choice_group_test.rb +3 -3
  56. data/test/ui/core/forms/choices/radio_field_test.rb +1 -1
  57. data/test/ui/core/forms/dropdowns/dropdown_test.rb +2 -2
  58. data/test/ui/core/forms/numbers/range_field_test.rb +14 -0
  59. data/test/ui/core/forms/numbers/slider_field_test.rb +2 -2
  60. data/test/ui/core/forms/selects/multi_select_field_test.rb +6 -6
  61. data/test/ui/core/forms/selects/select_field_test.rb +1 -1
  62. data/test/ui/core/forms/surrounds/surround_field_test.rb +27 -3
  63. data/test/ui/core/forms/texts/auto_complete_field_test.rb +2 -2
  64. data/test/ui/core/navigations/breadcrumb_test.rb +1 -1
  65. data/test/ui/core/navigations/link_test.rb +1 -1
  66. data/test/ui/core/navigations/nav_test.rb +7 -6
  67. data/test/ui/core/navigations/navbar_test.rb +5 -6
  68. data/test/ui/core/navigations/tab_group_test.rb +5 -5
  69. data/test/ui/core/notifications/alert_test.rb +1 -1
  70. data/test/ui/core/notifications/badge_test.rb +2 -2
  71. data/test/ui/utils/breakdown_class_name_generator_test.rb +14 -0
  72. data/test/ui/ux/containers/panel_test.rb +1 -1
  73. data/test/ui/ux/tables/table_test.rb +2 -2
  74. metadata +5 -8
  75. data/lib/ui_bibz/ui/core/forms/selects/multi_select_field.rb +0 -122
  76. data/package.json +0 -5
  77. data/test/ui/core/forms/selects/dropdown_select_field_test.rb +0 -84
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ui_bibz
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.alpha2
4
+ version: 3.0.0.alpha9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thooams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-14 00:00:00.000000000 Z
11
+ date: 2020-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -240,7 +240,7 @@ dependencies:
240
240
  - - ">="
241
241
  - !ruby/object:Gem::Version
242
242
  version: '0'
243
- description: A Rails Interface Framework using Bootstrap 5.0.0.alpha2.
243
+ description: A Rails Interface Framework using Bootstrap 5.0.0.alpha3.
244
244
  email: thomas@hummel.link
245
245
  executables:
246
246
  - test
@@ -357,7 +357,6 @@ files:
357
357
  - lib/ui_bibz/ui/core/forms/selects/abstract_select.rb
358
358
  - lib/ui_bibz/ui/core/forms/selects/dropdown_select_field.rb
359
359
  - lib/ui_bibz/ui/core/forms/selects/multi_column_field.rb
360
- - lib/ui_bibz/ui/core/forms/selects/multi_select_field.rb
361
360
  - lib/ui_bibz/ui/core/forms/selects/select_field.rb
362
361
  - lib/ui_bibz/ui/core/forms/surrounds/components/surround_addon.rb
363
362
  - lib/ui_bibz/ui/core/forms/surrounds/components/surround_button.rb
@@ -428,6 +427,7 @@ files:
428
427
  - lib/ui_bibz/ui/ux/containers/components/panel_footer.rb
429
428
  - lib/ui_bibz/ui/ux/containers/components/panel_group.rb
430
429
  - lib/ui_bibz/ui/ux/containers/components/panel_header.rb
430
+ - lib/ui_bibz/ui/ux/containers/components/panel_header_title.rb
431
431
  - lib/ui_bibz/ui/ux/containers/components/panel_tab_group.rb
432
432
  - lib/ui_bibz/ui/ux/containers/components/panel_toolbar.rb
433
433
  - lib/ui_bibz/ui/ux/containers/panel.rb
@@ -450,7 +450,6 @@ files:
450
450
  - lib/ui_bibz/utils/glyph_changer.rb
451
451
  - lib/ui_bibz/utils/internationalization.rb
452
452
  - lib/ui_bibz/utils/screwdriver.rb
453
- - package.json
454
453
  - structure.md
455
454
  - test/dummy/README.rdoc
456
455
  - test/dummy/Rakefile
@@ -541,7 +540,6 @@ files:
541
540
  - test/ui/core/forms/numbers/number_field_test.rb
542
541
  - test/ui/core/forms/numbers/range_field_test.rb
543
542
  - test/ui/core/forms/numbers/slider_field_test.rb
544
- - test/ui/core/forms/selects/dropdown_select_field_test.rb
545
543
  - test/ui/core/forms/selects/multi_column_field_test.rb
546
544
  - test/ui/core/forms/selects/multi_select_field_test.rb
547
545
  - test/ui/core/forms/selects/select_field_test.rb
@@ -661,7 +659,7 @@ rubygems_version: 3.1.2
661
659
  signing_key:
662
660
  specification_version: 4
663
661
  summary: Ui Bibz is an Ui Framework that allows you to build an interface very quickly
664
- and simply using Bootstrap 5.0.0.alpha2.
662
+ and simply using Bootstrap 5.0.0.alpha3.
665
663
  test_files:
666
664
  - test/dummy/README.rdoc
667
665
  - test/dummy/Rakefile
@@ -752,7 +750,6 @@ test_files:
752
750
  - test/ui/core/forms/numbers/number_field_test.rb
753
751
  - test/ui/core/forms/numbers/range_field_test.rb
754
752
  - test/ui/core/forms/numbers/slider_field_test.rb
755
- - test/ui/core/forms/selects/dropdown_select_field_test.rb
756
753
  - test/ui/core/forms/selects/multi_column_field_test.rb
757
754
  - test/ui/core/forms/selects/multi_select_field_test.rb
758
755
  - test/ui/core/forms/selects/select_field_test.rb
@@ -1,122 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module UiBibz::Ui::Core::Forms::Selects
4
- # Create a MultiSelectField
5
- #
6
- # This element is an extend of UiBibz::Ui::Core::Forms::Buttons::Button
7
- # source : http://loudev.com/
8
- #
9
- # ==== Attributes
10
- #
11
- # * +content+ - Content of element
12
- # * +options+ - Options of element
13
- # * +html_options+ - Html Options of element
14
- #
15
- # ==== Options
16
- #
17
- # You can add HTML attributes using the +html_options+.
18
- # You can pass arguments in options attribute:
19
- # * +option_tags+ - Array, Object [required]
20
- # * +clickable_opt_group+ - Boolean
21
- # * +collapsible_opt_group+ - Boolean
22
- # * +searchable+ - Boolean
23
- # * +select_all_option+ - Boolean
24
- # * +append+ - String, Html
25
- # * +prepend+ - String, Html
26
- # * +connect+ - Hash
27
- # * +event+ - String
28
- # * +mode+ - String
29
- # * +target+ - Hash
30
- # * +selector+ - String
31
- # * +data+ - Array
32
- # * +url+ - String
33
- #
34
- # ==== Signatures
35
- #
36
- # UiBibz::Ui::Core::Forms::Selects::MultiSelectField.new(content, options = {}, html_options = {}).render
37
- #
38
- # UiBibz::Ui::Core::Forms::Selects::MultiSelectField.new(options = {}, html_options = {}) do
39
- # content
40
- # end.render
41
- #
42
- # ==== Examples
43
- #
44
- # UiBibz::Ui::Core::Forms::Selects::MultiSelectField.new('fruits', { option_tags: list_of_fruits, searchable: true }, { class: 'test' })
45
- #
46
- # UiBibz::Ui::Core::Forms::Selects::MultiSelectField.new({ option_tags: list_of_fruits, select_all_option: true }, { class: 'test' }) do
47
- # 'fruits'
48
- # end
49
- #
50
- # ==== Helper
51
- #
52
- # multi_select_field(content, options = {}, html_options = {})
53
- #
54
- class MultiSelectField < UiBibz::Ui::Core::Forms::Selects::AbstractSelect
55
- # See UiBibz::Ui::Core::Forms::Buttons::Button.initialize
56
-
57
- private
58
-
59
- def component_html_options
60
- super.merge({
61
- multiple: true,
62
- disabled: options[:state] == :disabled,
63
- include_blank: false,
64
- prompt: false
65
- })
66
- end
67
-
68
- def component_html_classes
69
- super << [size, type, status, button_outline, 'multi-select-field']
70
- end
71
-
72
- def component_html_data
73
- super
74
- clickable_opt_group
75
- collapsible_opt_group
76
- searchable
77
- select_all_options
78
- number_displayed
79
- end
80
-
81
- def clickable_opt_group
82
- add_html_data('enable_clickable_opt_groups') if options[:clickable_opt_group]
83
- end
84
-
85
- def collapsible_opt_group
86
- add_html_data('enable_collapsible_opt_groups') if options[:collapsible_opt_group]
87
- end
88
-
89
- def searchable
90
- add_html_data('enable_filtering') if options[:searchable]
91
- end
92
-
93
- def number_displayed
94
- add_html_data('number_displayed') if options[:number_displayed]
95
- end
96
-
97
- def select_all_options
98
- add_html_data('include_select_all_option') if options[:select_all_options]
99
- end
100
-
101
- def status
102
- options[:status].nil? ? 'btn-secondary' : "btn-#{options[:status]}"
103
- end
104
-
105
- def type
106
- 'btn-block' if options[:type] == :block
107
- end
108
-
109
- # :lg, :sm or :xs
110
- def size
111
- "btn-#{options[:size]}" if options[:size]
112
- end
113
-
114
- def button_outline
115
- ['btn', outline, @status || :secondary].compact.join('-')
116
- end
117
-
118
- def outline
119
- 'outline' if @options[:outline]
120
- end
121
- end
122
- end
@@ -1,5 +0,0 @@
1
- {
2
- "dependencies": {
3
- "ui-bibz-js": "file:/home/thomas/Apps/ui-bibz-js"
4
- }
5
- }
@@ -1,84 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'test_helper'
4
-
5
- class DropdownSelectFieldTest < ActionView::TestCase
6
- test 'dropdown_select_field' do
7
- options = options_for_select(Array.new(2) { |i| "option #{i}" })
8
- actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', options_tags: options).render
9
- expected = '<select name="test" id="test" data-style="btn-secondary" class="dropdown-select-field"></select>'
10
-
11
- assert_equal expected, actual
12
- end
13
-
14
- test 'dropdown_select_field searchable' do
15
- options = options_for_select(Array.new(2) { |i| "option #{i}" })
16
- actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { options_tags: options, searchable: true }).render
17
- expected = '<select name="test" id="test" data-live-search="true" data-style="btn-secondary" class="dropdown-select-field"></select>'
18
-
19
- assert_equal expected, actual
20
- end
21
-
22
- test 'dropdown_select_field max_options' do
23
- options = options_for_select(Array.new(2) { |i| "option #{i}" })
24
- actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { options_tags: options, max_options: 2 }).render
25
- expected = '<select name="test" id="test" data-max-options="2" data-style="btn-secondary" class="dropdown-select-field"></select>'
26
-
27
- assert_equal expected, actual
28
- end
29
-
30
- test 'dropdown_select_field selected_text_format' do
31
- options = options_for_select(Array.new(2) { |i| "option #{i}" })
32
- actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { options_tags: options, selected_text_format: 'count > x' }).render
33
- expected = '<select name="test" id="test" data-selected-text-format="count &gt; x" data-style="btn-secondary" class="dropdown-select-field"></select>'
34
-
35
- assert_equal expected, actual
36
- end
37
-
38
- test 'dropdown_select_field menu_size' do
39
- options = options_for_select(Array.new(2) { |i| "option #{i}" })
40
- actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { options_tags: options, menu_size: 2 }).render
41
- expected = '<select name="test" id="test" data-size="2" data-style="btn-secondary" class="dropdown-select-field"></select>'
42
-
43
- assert_equal expected, actual
44
- end
45
-
46
- test 'dropdown_select_field actions_box' do
47
- options = options_for_select(Array.new(2) { |i| "option #{i}" })
48
- actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { options_tags: options, actions_box: true }).render
49
- expected = '<select name="test" id="test" data-style="btn-secondary" data-actions-box="true" class="dropdown-select-field"></select>'
50
-
51
- assert_equal expected, actual
52
- end
53
-
54
- test 'dropdown_select_field show_tick' do
55
- options = options_for_select(Array.new(2) { |i| "option #{i}" })
56
- actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { options_tags: options, show_tick: true }).render
57
- expected = '<select name="test" id="test" data-style="btn-secondary" class="dropdown-select-field show-tick"></select>'
58
-
59
- assert_equal expected, actual
60
- end
61
-
62
- test 'dropdown_select_field show_menu_arrow' do
63
- options = options_for_select(Array.new(2) { |i| "option #{i}" })
64
- actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { options_tags: options, show_menu_arrow: true }).render
65
- expected = '<select name="test" id="test" data-style="btn-secondary" class="dropdown-select-field"></select>'
66
-
67
- assert_equal expected, actual
68
- end
69
-
70
- test 'dropdown_select_field dropup' do
71
- options = options_for_select(Array.new(2) { |i| "option #{i}" })
72
- actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { options_tags: options, dropup: true }).render
73
- expected = '<select name="test" id="test" data-style="btn-secondary" class="dropdown-select-field dropup"></select>'
74
-
75
- assert_equal expected, actual
76
- end
77
-
78
- test 'dropdown_select_field refresh' do
79
- actual = UiBibz::Ui::Core::Forms::Selects::DropdownSelectField.new('test', { refresh: { mode: 'local', target: { data: [] } } }).render
80
- expected = '<div class="field-refresh input-group ui_surround_field"><select name="test" id="test" data-style="btn-secondary" class="dropdown-select-field"></select><span data-connect="{&quot;events&quot;:&quot;click&quot;,&quot;mode&quot;:&quot;local&quot;,&quot;target&quot;:{&quot;selector&quot;:&quot;#test&quot;,&quot;url&quot;:&quot;&quot;,&quot;data&quot;:[]}}" class="btn-secondary ui-bibz-connect btn input-refresh-button"><i class="glyph fas fa-sync-alt"></i> </span></div>'
81
-
82
- assert_equal expected, actual
83
- end
84
- end