kono_utils_bootstrap_view4 0.1.0.pre.rc.2 → 0.1.0.pre.rc.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/app/concepts/kono_utils/object/cell/base.rb +101 -97
  3. data/app/concepts/kono_utils/object/cell/buttons/base.rb +55 -54
  4. data/app/concepts/kono_utils/object/cell/buttons/collapse_search.rb +29 -23
  5. data/app/concepts/kono_utils/object/cell/buttons/create.rb +20 -15
  6. data/app/concepts/kono_utils/object/cell/buttons/delete.rb +29 -24
  7. data/app/concepts/kono_utils/object/cell/buttons/download.rb +22 -16
  8. data/app/concepts/kono_utils/object/cell/buttons/edit.rb +17 -12
  9. data/app/concepts/kono_utils/object/cell/buttons/list.rb +17 -11
  10. data/app/concepts/kono_utils/object/cell/buttons/reset_search.rb +21 -15
  11. data/app/concepts/kono_utils/object/cell/create/base.rb +6 -5
  12. data/app/concepts/kono_utils/object/cell/create/page_title.rb +11 -6
  13. data/app/concepts/kono_utils/object/cell/create/side_title.rb +8 -2
  14. data/app/concepts/kono_utils/object/cell/edits/base.rb +6 -5
  15. data/app/concepts/kono_utils/object/cell/edits/page_title.rb +11 -6
  16. data/app/concepts/kono_utils/object/cell/edits/side_title.rb +9 -3
  17. data/app/concepts/kono_utils/object/cell/form.rb +51 -48
  18. data/app/concepts/kono_utils/object/cell/forms/base.rb +12 -10
  19. data/app/concepts/kono_utils/object/cell/forms/container.rb +22 -18
  20. data/app/concepts/kono_utils/object/cell/forms/containers/layout.rb +14 -10
  21. data/app/concepts/kono_utils/object/cell/forms/containers/modal_layout.rb +10 -4
  22. data/app/concepts/kono_utils/object/cell/forms/containers/search_layout.rb +10 -4
  23. data/app/concepts/kono_utils/object/cell/forms/containers/table_layout.rb +11 -5
  24. data/app/concepts/kono_utils/object/cell/forms/field_selector.rb +68 -64
  25. data/app/concepts/kono_utils/object/cell/forms/field_selectors/layout.rb +9 -4
  26. data/app/concepts/kono_utils/object/cell/forms/field_selectors/modal_layout.rb +10 -4
  27. data/app/concepts/kono_utils/object/cell/forms/field_selectors/table_layout.rb +11 -5
  28. data/app/concepts/kono_utils/object/cell/forms/fields/association.rb +11 -4
  29. data/app/concepts/kono_utils/object/cell/forms/fields/base.rb +21 -16
  30. data/app/concepts/kono_utils/object/cell/forms/fields/bases/layout.rb +24 -17
  31. data/app/concepts/kono_utils/object/cell/forms/fields/bases/modal_layout.rb +14 -4
  32. data/app/concepts/kono_utils/object/cell/forms/fields/bases/table_layout.rb +17 -7
  33. data/app/concepts/kono_utils/object/cell/forms/fields/check_box.rb +14 -6
  34. data/app/concepts/kono_utils/object/cell/forms/fields/collection.rb +20 -12
  35. data/app/concepts/kono_utils/object/cell/forms/fields/date_field.rb +18 -10
  36. data/app/concepts/kono_utils/object/cell/forms/fields/date_time_field.rb +34 -30
  37. data/app/concepts/kono_utils/object/cell/forms/fields/enum.rb +23 -15
  38. data/app/concepts/kono_utils/object/cell/forms/fields/file_field.rb +29 -21
  39. data/app/concepts/kono_utils/object/cell/forms/fields/nested_modal_wrapper.rb +10 -3
  40. data/app/concepts/kono_utils/object/cell/forms/fields/nested_modal_wrappers/forms_container.rb +13 -5
  41. data/app/concepts/kono_utils/object/cell/forms/fields/nested_modal_wrappers/show.rb +19 -10
  42. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrapper.rb +54 -49
  43. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/form.rb +41 -35
  44. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms/layout.rb +17 -8
  45. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms/modal_layout.rb +14 -4
  46. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms/table_layout.rb +14 -4
  47. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms_container.rb +44 -36
  48. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms_containers/layout.rb +17 -10
  49. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms_containers/modal_layout.rb +17 -6
  50. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/forms_containers/table_layout.rb +20 -11
  51. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/header.rb +31 -23
  52. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/remove_button.rb +46 -40
  53. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/remove_buttons/layout.rb +14 -7
  54. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/remove_buttons/modal_layout.rb +14 -4
  55. data/app/concepts/kono_utils/object/cell/forms/fields/nested_wrappers/remove_buttons/table_layout.rb +14 -4
  56. data/app/concepts/kono_utils/object/cell/forms/fields/read_only.rb +16 -9
  57. data/app/concepts/kono_utils/object/cell/forms/fields/time_field.rb +14 -7
  58. data/app/concepts/kono_utils/object/cell/forms/layout.rb +8 -4
  59. data/app/concepts/kono_utils/object/cell/forms/submit.rb +21 -16
  60. data/app/concepts/kono_utils/object/cell/index/base.rb +9 -7
  61. data/app/concepts/kono_utils/object/cell/index/page_title.rb +11 -6
  62. data/app/concepts/kono_utils/object/cell/index/row.rb +38 -36
  63. data/app/concepts/kono_utils/object/cell/index/row_buttons.rb +8 -4
  64. data/app/concepts/kono_utils/object/cell/index/row_footer.rb +8 -3
  65. data/app/concepts/kono_utils/object/cell/index/row_header.rb +13 -7
  66. data/app/concepts/kono_utils/object/cell/index/side_title.rb +8 -2
  67. data/app/concepts/kono_utils/object/cell/index/table.rb +12 -9
  68. data/app/concepts/kono_utils/object/cell/inject.rb +103 -102
  69. data/app/concepts/kono_utils/object/cell/modals/base.rb +7 -3
  70. data/app/concepts/kono_utils/object/cell/modals/bodies/layout.rb +9 -4
  71. data/app/concepts/kono_utils/object/cell/modals/body.rb +7 -3
  72. data/app/concepts/kono_utils/object/cell/modals/container.rb +5 -1
  73. data/app/concepts/kono_utils/object/cell/modals/containers/layout.rb +12 -6
  74. data/app/concepts/kono_utils/object/cell/modals/footer.rb +5 -2
  75. data/app/concepts/kono_utils/object/cell/modals/footers/layout.rb +9 -4
  76. data/app/concepts/kono_utils/object/cell/modals/header.rb +6 -3
  77. data/app/concepts/kono_utils/object/cell/modals/headers/layout.rb +9 -4
  78. data/app/concepts/kono_utils/object/cell/search.rb +22 -19
  79. data/app/concepts/kono_utils/object/cell/searches/form.rb +12 -9
  80. data/app/concepts/kono_utils/object/cell/show.rb +25 -20
  81. data/app/concepts/kono_utils/object/cell/shows/base.rb +6 -5
  82. data/app/concepts/kono_utils/object/cell/shows/page_title.rb +11 -6
  83. data/app/concepts/kono_utils/object/cell/shows/side_title.rb +8 -2
  84. data/lib/kono_utils_bootstrap_view4.rb +14 -8
  85. data/lib/kono_utils_bootstrap_view4/engine.rb +1 -1
  86. data/lib/kono_utils_bootstrap_view4/version.rb +1 -1
  87. metadata +8 -16
@@ -1,32 +1,37 @@
1
- module KonoUtils::Object::Cell::Buttons # namespace
2
- class Delete < Base
1
+ module KonoUtils
2
+ module Object
3
+ module Cell
4
+ module Buttons # namespace
5
+ class Delete < Base
3
6
 
4
- def url_to
5
- options[:url_to] || destroy_custom_polymorphic_path(model)
6
- end
7
+ def url_to
8
+ options[:url_to] || destroy_custom_polymorphic_path(model)
9
+ end
7
10
 
8
- def specific_button_class
9
- 'btn-danger'
10
- end
11
+ def specific_button_class
12
+ 'btn-danger'
13
+ end
11
14
 
12
- def btn_opts(opts = {})
13
- custom_options = options.dig(:button_options) || opts
14
- super(automatic_remove_options.merge(custom_options))
15
- end
15
+ def btn_opts(opts = {})
16
+ custom_options = options.dig(:button_options) || opts
17
+ super(automatic_remove_options.merge(custom_options))
18
+ end
16
19
 
17
- ##
18
- # Metodo che è possibili fare override per rimuovere le funzioni di rails di conferma automatica
19
- def automatic_remove_options
20
- {
21
- method: :delete,
22
- data: {confirm: t(:are_you_sure), title: I18n.t('kono_utils.bootstrap4.buttons.delete.title')},
23
- }
24
- end
25
-
26
- def button_content
27
- options.fetch(:content, fa_icon("trash"))
28
- end
20
+ ##
21
+ # Metodo che è possibili fare override per rimuovere le funzioni di rails di conferma automatica
22
+ def automatic_remove_options
23
+ {
24
+ method: :delete,
25
+ data: { confirm: t(:are_you_sure), title: I18n.t('kono_utils.bootstrap4.buttons.delete.title') },
26
+ }
27
+ end
29
28
 
29
+ def button_content
30
+ options.fetch(:content, fa_icon("trash"))
31
+ end
30
32
 
33
+ end
34
+ end
35
+ end
31
36
  end
32
37
  end
@@ -1,23 +1,29 @@
1
- module KonoUtils::Object::Cell::Buttons # namespace
2
- class Download < Base
1
+ module KonoUtils
2
+ module Object
3
+ module Cell
4
+ module Buttons # namespace
5
+ class Download < Base
3
6
 
4
- def url_to
5
- options[:url_to] || url_for(model)
6
- end
7
+ def url_to
8
+ options[:url_to] || url_for(model)
9
+ end
7
10
 
8
- def specific_button_class
9
- 'btn-light'
10
- end
11
+ def specific_button_class
12
+ 'btn-light'
13
+ end
11
14
 
12
- def button_content
13
- options.fetch(:content, fa_icon("download", text: I18n.t('kono_utils.bootstrap4.buttons.download.alt')))
14
- end
15
+ def button_content
16
+ options.fetch(:content, fa_icon("download", text: I18n.t('kono_utils.bootstrap4.buttons.download.alt')))
17
+ end
15
18
 
16
- def btn_opts(opts = {})
17
- {
18
- target: :_blank
19
- }.merge(super)
20
- end
19
+ def btn_opts(opts = {})
20
+ {
21
+ target: :_blank
22
+ }.merge(super)
23
+ end
21
24
 
25
+ end
26
+ end
27
+ end
22
28
  end
23
29
  end
@@ -1,18 +1,23 @@
1
- module KonoUtils::Object::Cell::Buttons # namespace
2
- class Edit < Base
1
+ module KonoUtils
2
+ module Object
3
+ module Cell
4
+ module Buttons # namespace
5
+ class Edit < Base
3
6
 
4
- def url_to
5
- options[:url_to] || edit_custom_polymorphic_path(model)
6
- end
7
+ def url_to
8
+ options[:url_to] || edit_custom_polymorphic_path(model)
9
+ end
7
10
 
8
- def specific_button_class
9
- 'btn-primary'
10
- end
11
-
12
- def button_content
13
- options.fetch(:content, fa_icon("edit"))
14
- end
11
+ def specific_button_class
12
+ 'btn-primary'
13
+ end
15
14
 
15
+ def button_content
16
+ options.fetch(:content, fa_icon("edit"))
17
+ end
16
18
 
19
+ end
20
+ end
21
+ end
17
22
  end
18
23
  end
@@ -1,17 +1,23 @@
1
- module KonoUtils::Object::Cell::Buttons # namespace
2
- class List < Base
1
+ module KonoUtils
2
+ module Object
3
+ module Cell
4
+ module Buttons # namespace
5
+ class List < Base
3
6
 
4
- def url_to
5
- options[:url_to] || index_custom_polymorphic_path(model)
6
- end
7
+ def url_to
8
+ options[:url_to] || index_custom_polymorphic_path(model)
9
+ end
7
10
 
8
- def specific_button_class
9
- 'btn-link'
10
- end
11
+ def specific_button_class
12
+ 'btn-link'
13
+ end
11
14
 
12
- def button_content
13
- options.fetch(:content, fa_icon("list"))
14
- end
15
+ def button_content
16
+ options.fetch(:content, fa_icon("list"))
17
+ end
15
18
 
19
+ end
20
+ end
21
+ end
16
22
  end
17
23
  end
@@ -1,21 +1,27 @@
1
- module KonoUtils::Object::Cell::Buttons # namespace
2
- ##
3
- # Bottone per la struttura del collapse search
4
- # *Options*
5
- # - collapsed_target -> identificativo del contenitore che devo espandere
6
- class ResetSearch < Base
1
+ module KonoUtils
2
+ module Object
3
+ module Cell
4
+ module Buttons # namespace
5
+ ##
6
+ # Bottone per la struttura del collapse search
7
+ # *Options*
8
+ # - collapsed_target -> identificativo del contenitore che devo espandere
9
+ class ResetSearch < Base
7
10
 
8
- def url_to
9
- options[:url_to] || index_custom_polymorphic_path(model)
10
- end
11
+ def url_to
12
+ options[:url_to] || index_custom_polymorphic_path(model)
13
+ end
11
14
 
12
- def specific_button_class
13
- "btn-secondary"
14
- end
15
+ def specific_button_class
16
+ "btn-secondary"
17
+ end
15
18
 
16
- def button_content
17
- options.fetch(:content, fa_icon("times"))
18
- end
19
+ def button_content
20
+ options.fetch(:content, fa_icon("times"))
21
+ end
19
22
 
23
+ end
24
+ end
25
+ end
20
26
  end
21
27
  end
@@ -1,8 +1,9 @@
1
- module KonoUtils::Object::Cell # namespace
2
- class Create::Base < Base
3
-
4
-
5
-
1
+ module KonoUtils
2
+ module Object
3
+ module Cell
4
+ class Create::Base < Base
6
5
 
6
+ end
7
+ end
7
8
  end
8
9
  end
@@ -1,10 +1,15 @@
1
- module KonoUtils::Object::Cell::Create # namespace
2
- class PageTitle < Base
3
-
4
- def show
5
- title_new_g
6
- end
1
+ module KonoUtils
2
+ module Object
3
+ module Cell
4
+ module Create
5
+ class PageTitle < Base
7
6
 
7
+ def show
8
+ title_new_g
9
+ end
8
10
 
11
+ end
12
+ end
13
+ end
9
14
  end
10
15
  end
@@ -1,5 +1,11 @@
1
- module KonoUtils::Object::Cell::Create # namespace
2
- class SideTitle < Base
1
+ module KonoUtils
2
+ module Object
3
+ module Cell
4
+ module Create
5
+ class SideTitle < Base
3
6
 
7
+ end
8
+ end
9
+ end
4
10
  end
5
11
  end
@@ -1,8 +1,9 @@
1
- module KonoUtils::Object::Cell # namespace
2
- class Edits::Base < Base
3
-
4
-
5
-
1
+ module KonoUtils
2
+ module Object
3
+ module Cell
4
+ class Edits::Base < Base
6
5
 
6
+ end
7
+ end
7
8
  end
8
9
  end
@@ -1,10 +1,15 @@
1
- module KonoUtils::Object::Cell::Edits # namespace
2
- class PageTitle < Base
3
-
4
- def show
5
- title_edit_g
6
- end
1
+ module KonoUtils
2
+ module Object
3
+ module Cell
4
+ module Edits
5
+ class PageTitle < Base
7
6
 
7
+ def show
8
+ title_edit_g
9
+ end
8
10
 
11
+ end
12
+ end
13
+ end
9
14
  end
10
15
  end
@@ -1,5 +1,11 @@
1
- module KonoUtils::Object::Cell::Edits # namespace
2
- class SideTitle < Base
1
+ module KonoUtils
2
+ module Object
3
+ module Cell
4
+ module Edits
5
+ class SideTitle < Base
3
6
 
7
+ end
8
+ end
9
+ end
4
10
  end
5
- end
11
+ end
@@ -1,51 +1,54 @@
1
- module KonoUtils::Object::Cell # namespace
2
- class Form < Base
3
-
4
- load('action_view/helpers/form_helper.rb')
5
- include ActionView::Helpers::FormHelper
6
- include SimpleForm::ActionViewExtensions::FormHelper
7
- include ActionView::Helpers::DateHelper
8
- include ActionView::Helpers::FormOptionsHelper
9
-
10
-
11
- layout("forms/layout")
12
-
13
- ##
14
- # Metodo che mi ritorna la lista degli argomenti da passare a simple form.
15
- # @return [Array]
16
- #
17
- # ES:
18
- # [model] -> model deve essere l'ActiveRecord da utilizzare come oggetto della form
19
- #
20
- # [model,{ url:helper_path_custom }] -> come secondo parametro abbiamo l'hash delle opzioni da poter passare al form builder
21
- # se al concept passiamo form_options come opzione, queste vengono mergiate nelle opzioni standard
22
- def forms_options
23
- [model, _form_options]
1
+ module KonoUtils
2
+ module Object
3
+ module Cell
4
+ class Form < Base
5
+
6
+ load('action_view/helpers/form_helper.rb')
7
+ include ActionView::Helpers::FormHelper
8
+ include SimpleForm::ActionViewExtensions::FormHelper
9
+ include ActionView::Helpers::DateHelper
10
+ include ActionView::Helpers::FormOptionsHelper
11
+
12
+ layout("forms/layout")
13
+
14
+ ##
15
+ # Metodo che mi ritorna la lista degli argomenti da passare a simple form.
16
+ # @return [Array]
17
+ #
18
+ # ES:
19
+ # [model] -> model deve essere l'ActiveRecord da utilizzare come oggetto della form
20
+ #
21
+ # [model,{ url:helper_path_custom }] -> come secondo parametro abbiamo l'hash delle opzioni da poter passare al form builder
22
+ # se al concept passiamo form_options come opzione, queste vengono mergiate nelle opzioni standard
23
+ def forms_options
24
+ [model, _form_options]
25
+ end
26
+
27
+ protected
28
+
29
+ def form_id
30
+ dom_id(model, SecureRandom.uuid)
31
+ end
32
+
33
+ def container_layout
34
+ layout = context[:nested_layout].blank? ? "layout" : context[:nested_layout]
35
+ layout_ns("cell/forms/containers/#{layout}")
36
+ end
37
+
38
+ private
39
+
40
+ ##
41
+ # Opzioni aggiuntive per la form
42
+ def _form_options
43
+ opts = options[:form_options] || {}
44
+ html = opts.fetch(:html, { multipart: true })
45
+ html[:id] = form_id
46
+
47
+ opts.merge({ html: html })
48
+
49
+ end
50
+
51
+ end
24
52
  end
25
-
26
- protected
27
- def form_id
28
- dom_id(model, SecureRandom.uuid)
29
- end
30
-
31
- def container_layout
32
- layout = context[:nested_layout].blank? ? "layout" : context[:nested_layout]
33
- layout_ns("cell/forms/containers/#{layout}")
34
- end
35
-
36
- private
37
-
38
- ##
39
- # Opzioni aggiuntive per la form
40
- def _form_options
41
- opts = options[:form_options] || {}
42
- html = opts.fetch(:html, {multipart: true})
43
- html[:id] = form_id
44
-
45
- opts.merge({html: html})
46
-
47
- end
48
-
49
-
50
53
  end
51
54
  end
@@ -1,13 +1,15 @@
1
- module KonoUtils::Object::Cell # namespace
2
- # La cella base dei componenti della form
3
- # ha sempre un metodo form che viene ricevuto dal contesto della form
4
- class Forms::Base < Base
5
-
6
-
7
- def form
8
- context[:form]
1
+ module KonoUtils
2
+ module Object
3
+ module Cell
4
+ # La cella base dei componenti della form
5
+ # ha sempre un metodo form che viene ricevuto dal contesto della form
6
+ class Forms::Base < Base
7
+
8
+ def form
9
+ context[:form]
10
+ end
11
+
12
+ end
9
13
  end
10
-
11
-
12
14
  end
13
15
  end