lato_view 1.1 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +0 -12
  3. data/app/assets/javascripts/lato_view/build/FormManager.js +8 -2
  4. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/actionbar/cell.rb +1 -1
  5. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/actionbar/views/show.html.erb +0 -0
  6. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/block/cell.rb +1 -1
  7. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/buttongroup/cell.rb +1 -5
  8. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/buttongroup/views/show.html.erb +0 -0
  9. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/dropdown/cell.rb +2 -2
  10. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/dropdown/views/show.html.erb +0 -0
  11. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/index/cell.rb +2 -2
  12. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/index/views/head.html.erb +0 -0
  13. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/index/views/rows.html.erb +0 -0
  14. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/input/cell.rb +5 -4
  15. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/input/views/checkbox.html.erb +0 -0
  16. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/input/views/date.html.erb +0 -0
  17. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/input/views/editor.html.erb +0 -0
  18. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/input/views/email.html.erb +0 -0
  19. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/input/views/file.html.erb +0 -6
  20. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/input/views/multiple-select.html.erb +0 -0
  21. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/input/views/number.html.erb +0 -0
  22. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/input/views/password.html.erb +0 -0
  23. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/input/views/radio.html.erb +0 -0
  24. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/input/views/select.html.erb +0 -0
  25. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/input/views/text.html.erb +0 -0
  26. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/input/views/textarea.html.erb +0 -0
  27. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/input/views/time.html.erb +0 -0
  28. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/searchbar/cell.rb +1 -6
  29. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/searchbar/views/show.html.erb +0 -0
  30. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/table/cell.rb +2 -2
  31. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/table/views/head.html.erb +0 -0
  32. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/table/views/row.html.erb +0 -0
  33. data/app/{concepts/lato_view → cells/lato_view/cells_v1}/table/views/rows.html.erb +0 -0
  34. data/app/cells/lato_view/component/button/cell.rb +30 -0
  35. data/app/cells/lato_view/component/button/views/show.html.erb +1 -0
  36. data/app/cells/lato_view/component/buttongroup/cell.rb +31 -0
  37. data/app/cells/lato_view/component/buttongroup/views/show.html.erb +13 -0
  38. data/app/cells/lato_view/component/dropdown/cell.rb +26 -0
  39. data/app/cells/lato_view/component/dropdown/views/show.html.erb +43 -0
  40. data/app/cells/lato_view/component/form/cell.rb +35 -0
  41. data/app/cells/lato_view/component/form/views/open.html.erb +3 -0
  42. data/app/cells/lato_view/component/form/views/show.html.erb +1 -0
  43. data/app/cells/lato_view/component/searchbar/cell.rb +36 -0
  44. data/app/cells/lato_view/component/searchbar/views/show.html.erb +9 -0
  45. data/app/cells/lato_view/input/checkbox/cell.rb +48 -0
  46. data/app/cells/lato_view/input/checkbox/views/show.html.erb +17 -0
  47. data/app/cells/lato_view/input/date/cell.rb +45 -0
  48. data/app/cells/lato_view/input/date/views/show.html.erb +11 -0
  49. data/app/cells/lato_view/input/editor/cell.rb +45 -0
  50. data/app/cells/lato_view/input/editor/views/show.html.erb +12 -0
  51. data/app/cells/lato_view/input/email/cell.rb +45 -0
  52. data/app/cells/lato_view/input/email/views/show.html.erb +11 -0
  53. data/app/cells/lato_view/input/file/cell.rb +51 -0
  54. data/app/cells/lato_view/input/file/views/show.html.erb +18 -0
  55. data/app/cells/lato_view/input/number/cell.rb +45 -0
  56. data/app/cells/lato_view/input/number/views/show.html.erb +11 -0
  57. data/app/cells/lato_view/input/password/cell.rb +46 -0
  58. data/app/cells/lato_view/input/password/views/show.html.erb +15 -0
  59. data/app/cells/lato_view/input/radio/cell.rb +63 -0
  60. data/app/cells/lato_view/input/radio/views/show.html.erb +20 -0
  61. data/app/cells/lato_view/input/select/cell.rb +87 -0
  62. data/app/cells/lato_view/input/select/views/show.html.erb +21 -0
  63. data/app/cells/lato_view/input/text/cell.rb +45 -0
  64. data/app/cells/lato_view/input/text/views/show.html.erb +11 -0
  65. data/app/cells/lato_view/input/textarea/cell.rb +45 -0
  66. data/app/cells/lato_view/input/textarea/views/show.html.erb +12 -0
  67. data/app/cells/lato_view/input/time/cell.rb +45 -0
  68. data/app/cells/lato_view/input/time/views/show.html.erb +11 -0
  69. data/app/cells/lato_view/layout/actionbar/cell.rb +29 -0
  70. data/app/cells/lato_view/layout/actionbar/views/show.html.erb +13 -0
  71. data/app/cells/lato_view/layout/block/cell.rb +37 -0
  72. data/app/cells/lato_view/layout/index/cell.rb +73 -0
  73. data/app/cells/lato_view/layout/index/views/head.html.erb +12 -0
  74. data/app/cells/lato_view/layout/index/views/rows.html.erb +49 -0
  75. data/app/controllers/lato_view/assets_controller.rb +3 -6
  76. data/app/controllers/lato_view/develop_controller.rb +5 -5
  77. data/app/helpers/lato_view/application_helper.rb +19 -10
  78. data/config/example.yml +2 -2
  79. data/config/initializers/init.rb +1 -1
  80. data/config/initializers/lists.rb +2 -18
  81. data/config/initializers/ram.rb +1 -13
  82. data/config/routes.rb +1 -0
  83. data/lib/lato_view.rb +5 -7
  84. data/lib/lato_view/cells.rb +16 -0
  85. data/lib/lato_view/engine.rb +6 -5
  86. data/lib/lato_view/interface.rb +4 -5
  87. data/lib/lato_view/interface/assets.rb +67 -76
  88. data/lib/lato_view/interface/images.rb +52 -58
  89. data/lib/lato_view/interface/navigation.rb +6 -11
  90. data/lib/lato_view/interface/themes.rb +22 -28
  91. data/lib/tasks/{lato_starter_tasks.rake → lato_view_tasks.rake} +1 -4
  92. metadata +76 -115
  93. data/lib/lato_view/concepts.rb +0 -19
  94. data/test/controllers/lato_view/api/v1/api_controller_test.rb +0 -9
  95. data/test/controllers/lato_view/application_controller_test.rb +0 -9
  96. data/test/controllers/lato_view/back/back_controller_test.rb +0 -9
  97. data/test/dummy/README.rdoc +0 -28
  98. data/test/dummy/Rakefile +0 -6
  99. data/test/dummy/app/assets/javascripts/application.js +0 -13
  100. data/test/dummy/app/assets/stylesheets/application.css +0 -15
  101. data/test/dummy/app/controllers/application_controller.rb +0 -5
  102. data/test/dummy/app/helpers/application_helper.rb +0 -2
  103. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  104. data/test/dummy/bin/bundle +0 -3
  105. data/test/dummy/bin/rails +0 -4
  106. data/test/dummy/bin/rake +0 -4
  107. data/test/dummy/bin/setup +0 -29
  108. data/test/dummy/config.ru +0 -4
  109. data/test/dummy/config/application.rb +0 -25
  110. data/test/dummy/config/boot.rb +0 -5
  111. data/test/dummy/config/database.yml +0 -25
  112. data/test/dummy/config/environment.rb +0 -5
  113. data/test/dummy/config/environments/development.rb +0 -41
  114. data/test/dummy/config/environments/production.rb +0 -79
  115. data/test/dummy/config/environments/test.rb +0 -42
  116. data/test/dummy/config/initializers/assets.rb +0 -11
  117. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  118. data/test/dummy/config/initializers/cookies_serializer.rb +0 -3
  119. data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  120. data/test/dummy/config/initializers/inflections.rb +0 -16
  121. data/test/dummy/config/initializers/mime_types.rb +0 -4
  122. data/test/dummy/config/initializers/session_store.rb +0 -3
  123. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  124. data/test/dummy/config/locales/en.yml +0 -23
  125. data/test/dummy/config/routes.rb +0 -3
  126. data/test/dummy/config/secrets.yml +0 -22
  127. data/test/dummy/public/404.html +0 -67
  128. data/test/dummy/public/422.html +0 -67
  129. data/test/dummy/public/500.html +0 -66
  130. data/test/dummy/public/favicon.ico +0 -0
  131. data/test/integration/navigation_test.rb +0 -8
  132. data/test/lato_view_test.rb +0 -7
  133. data/test/test_helper.rb +0 -21
@@ -0,0 +1,36 @@
1
+ module LatoView
2
+ class Component::Searchbar::Cell < Cell
3
+
4
+ # Include ransack as dependences
5
+ include Ransack::Helpers::FormHelper
6
+
7
+ @@styles = VIEW_COMPONENTSTYLES
8
+
9
+ attr_accessor :elements, :filter, :url, :method, :style, :remote,
10
+ :custom_class
11
+
12
+ def initialize(elements: nil, filter: nil, url: nil, method: 'get',
13
+ style: 'normal', remote: false, custom_class: '')
14
+ # save params
15
+ @elements = elements
16
+ @filter = filter
17
+ @url = url
18
+ @method = method
19
+ @style = style
20
+ @remote = remote
21
+ @custom_class = custom_class
22
+ # check params
23
+ check_params
24
+ end
25
+
26
+ def show
27
+ render 'show.html'
28
+ end
29
+
30
+ # check params
31
+ private def check_params
32
+ raise 'Searchbar Cell: style value in not correct' unless @@styles.include? @style.to_s
33
+ end
34
+
35
+ end
36
+ end
@@ -0,0 +1,9 @@
1
+ <%= search_form_for @elements, method: @method, url: @url, remote: @remote, class: "search-bar #{@style}" do |f| %>
2
+
3
+ <%= f.text_field @filter, class: 'search-field' %>
4
+
5
+ <button type="submit" class="search-button">
6
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M495 466.2L377.2 348.4c29.2-35.6 46.8-81.2 46.8-130.9C424 103.5 331.5 11 217.5 11 103.4 11 11 103.5 11 217.5S103.4 424 217.5 424c49.7 0 95.2-17.5 130.8-46.7L466.1 495c8 8 20.9 8 28.9 0 8-7.9 8-20.9 0-28.8zm-277.5-83.3C126.2 382.9 52 308.7 52 217.5S126.2 52 217.5 52C308.7 52 383 126.3 383 217.5s-74.3 165.4-165.5 165.4z"/></svg>
7
+ </button>
8
+
9
+ <% end %>
@@ -0,0 +1,48 @@
1
+ module LatoView
2
+ class Input::Checkbox::Cell < Cell
3
+
4
+ @@widths = VIEW_INPUTWIDTH
5
+
6
+ attr_accessor :name, :placeholder, :value, :label, :width, :required,
7
+ :disabled, :custom_class
8
+
9
+ def initialize(name: 'input', placeholder: '', value: '', label: '',
10
+ width: 'large', required: false, disabled: false)
11
+ # save params
12
+ @name = name
13
+ @placeholder = placeholder
14
+ @value = value
15
+ @label = label
16
+ @width = width
17
+ @required = required
18
+ @disabled = disabled
19
+ # check params
20
+ check_params
21
+ end
22
+
23
+ def show
24
+ render "show.html"
25
+ end
26
+
27
+ # return required string to input
28
+ protected def required_data_input
29
+ return "data-input='required'" if @required
30
+ end
31
+
32
+ # return disabled string to input
33
+ protected def disabled_data_input
34
+ return "disabled='disabled'" if @disabled
35
+ end
36
+
37
+ # return checked string to input
38
+ protected def checked_data_input
39
+ return "checked" if @value
40
+ end
41
+
42
+ # check params
43
+ private def check_params
44
+ raise 'Input Cells: width has not a correct value' unless @@widths.include? width
45
+ end
46
+
47
+ end
48
+ end
@@ -0,0 +1,17 @@
1
+ <div class="form-control <%= @width %>" <%= required_data_input %>>
2
+
3
+ <div class="form-block">
4
+
5
+ <input type="hidden" name="<%= @name %>" value="0">
6
+
7
+ <input type="checkbox" class="check <%= @custom_class %>" name="<%= @name %>"
8
+ id="<%= @name %>" value="1" <%= checked_data_input %>
9
+ <%= disabled_data_input %>>
10
+
11
+ <label class="label-control" for="<%= @name %>"><%= @label%></label>
12
+
13
+ </div>
14
+
15
+ <div class="input-error-message"></div>
16
+
17
+ </div>
@@ -0,0 +1,45 @@
1
+ module LatoView
2
+ class Input::Date::Cell < Cell
3
+
4
+ @@widths = VIEW_INPUTWIDTH
5
+
6
+ attr_accessor :name, :placeholder, :value, :label, :width, :required,
7
+ :disabled, :custom_class
8
+
9
+ def initialize(name: 'input', placeholder: '', value: '', label: '',
10
+ width: 'large', required: false, disabled: false,
11
+ custom_class: '')
12
+ # save params
13
+ @name = name
14
+ @placeholder = placeholder
15
+ @value = value
16
+ @label = label
17
+ @width = width
18
+ @required = required
19
+ @disabled = disabled
20
+ @custom_class = custom_class
21
+ # check params
22
+ check_params
23
+ end
24
+
25
+ def show
26
+ render "show.html"
27
+ end
28
+
29
+ # return required string to input
30
+ protected def required_data_input
31
+ return "data-input='required'" if @required
32
+ end
33
+
34
+ # return disabled string to input
35
+ protected def disabled_data_input
36
+ return "disabled='disabled'" if @disabled
37
+ end
38
+
39
+ # check params
40
+ private def check_params
41
+ raise 'Input Cells: width has not a correct value' unless @@widths.include? width
42
+ end
43
+
44
+ end
45
+ end
@@ -0,0 +1,11 @@
1
+ <div class="form-control <%= @width %>" <%= required_data_input %>>
2
+
3
+ <label class="form-label"><%= @label %></label>
4
+
5
+ <input type="text" class="input date-picker <%= @custom_class %>"
6
+ name="<%= @name %>" placeholder="<%= @placeholder %>"
7
+ value="<%= @value %>" <%= disabled_data_input %>>
8
+
9
+ <div class="input-error-message"></div>
10
+
11
+ </div>
@@ -0,0 +1,45 @@
1
+ module LatoView
2
+ class Input::Editor::Cell < Cell
3
+
4
+ @@widths = VIEW_INPUTWIDTH
5
+
6
+ attr_accessor :name, :placeholder, :value, :label, :width, :required,
7
+ :disabled, :custom_class
8
+
9
+ def initialize(name: 'input', placeholder: '', value: '', label: '',
10
+ width: 'large', required: false, disabled: false,
11
+ custom_class: '')
12
+ # save params
13
+ @name = name
14
+ @placeholder = placeholder
15
+ @value = value
16
+ @label = label
17
+ @width = width
18
+ @required = required
19
+ @disabled = disabled
20
+ @custom_class = custom_class
21
+ # check params
22
+ check_params
23
+ end
24
+
25
+ def show
26
+ render "show.html"
27
+ end
28
+
29
+ # return required string to input
30
+ protected def required_data_input
31
+ return "data-input='required'" if @required
32
+ end
33
+
34
+ # return disabled string to input
35
+ protected def disabled_data_input
36
+ return "disabled='disabled'" if @disabled
37
+ end
38
+
39
+ # check params
40
+ private def check_params
41
+ raise 'Input Cells: width has not a correct value' unless @@widths.include? width
42
+ end
43
+
44
+ end
45
+ end
@@ -0,0 +1,12 @@
1
+ <div class="form-control <%= @width %>" <%= required_data_input %>>
2
+
3
+ <label class="form-label"><%= @label %></label>
4
+
5
+ <textarea class="editor <%= @custom_class %>" name="<%= @name %>"
6
+ placeholder="<%= @placeholder %>">
7
+ <%= @value %>
8
+ </textarea>
9
+
10
+ <div class="input-error-message"></div>
11
+
12
+ </div>
@@ -0,0 +1,45 @@
1
+ module LatoView
2
+ class Input::Email::Cell < Cell
3
+
4
+ @@widths = VIEW_INPUTWIDTH
5
+
6
+ attr_accessor :name, :placeholder, :value, :label, :width, :required,
7
+ :disabled, :custom_class
8
+
9
+ def initialize(name: 'input', placeholder: '', value: '', label: '',
10
+ width: 'large', required: false, disabled: false,
11
+ custom_class: '')
12
+ # save params
13
+ @name = name
14
+ @placeholder = placeholder
15
+ @value = value
16
+ @label = label
17
+ @width = width
18
+ @required = required
19
+ @disabled = disabled
20
+ @custom_class = custom_class
21
+ # check params
22
+ check_params
23
+ end
24
+
25
+ def show
26
+ render "show.html"
27
+ end
28
+
29
+ # return required string to input
30
+ protected def required_data_input
31
+ return "data-input='required'" if @required
32
+ end
33
+
34
+ # return disabled string to input
35
+ protected def disabled_data_input
36
+ return "disabled='disabled'" if @disabled
37
+ end
38
+
39
+ # check params
40
+ private def check_params
41
+ raise 'Input Cells: width has not a correct value' unless @@widths.include? width
42
+ end
43
+
44
+ end
45
+ end
@@ -0,0 +1,11 @@
1
+ <div class="form-control <%= @width %>" data-control="email" <%= required_data_input %>>
2
+
3
+ <label class="form-label"><%= @label %></label>
4
+
5
+ <input type="email" autocomplete="off" class="input input-email <%= @custom_class %>"
6
+ name="<%= @name %>" placeholder="<%= @placeholder %>" value="<%= @value %>"
7
+ <%= disabled_data_input %>>
8
+
9
+ <div class="input-error-message"></div>
10
+
11
+ </div>
@@ -0,0 +1,51 @@
1
+ module LatoView
2
+ class Input::File::Cell < Cell
3
+
4
+ @@widths = VIEW_INPUTWIDTH
5
+
6
+ attr_accessor :name, :placeholder, :value, :label, :width, :required,
7
+ :disabled, :custom_class, :multiple
8
+
9
+ def initialize(name: 'input', placeholder: '', value: '', label: '',
10
+ width: 'large', required: false, disabled: false,
11
+ custom_class: '', multiple: false)
12
+ # save params
13
+ @name = name
14
+ @placeholder = placeholder
15
+ @value = value
16
+ @label = label
17
+ @width = width
18
+ @required = required
19
+ @disabled = disabled
20
+ @custom_class = custom_class
21
+ @multiple = multiple
22
+ # check params
23
+ check_params
24
+ end
25
+
26
+ def show
27
+ render "show.html"
28
+ end
29
+
30
+ # return required string to input
31
+ protected def required_data_input
32
+ return "data-input='required'" if @required
33
+ end
34
+
35
+ # return disabled string to input
36
+ protected def disabled_data_input
37
+ return "disabled='disabled'" if @disabled
38
+ end
39
+
40
+ # return multiple string to input
41
+ protected def multiple_data_input
42
+ return "multiple" if @multiple
43
+ end
44
+
45
+ # check params
46
+ private def check_params
47
+ raise 'Input Cells: width has not a correct value' unless @@widths.include? width
48
+ end
49
+
50
+ end
51
+ end
@@ -0,0 +1,18 @@
1
+ <div class="form-control <%= @width %>" <%= required_data_input %>>
2
+
3
+ <input type="file" class="input-file <%= @custom_class %>" id="<%= @name %>"
4
+ name="<%= @name %>" placeholder="<%= @placeholder %>" value="<%= @value %>"
5
+ data-multiple-caption="{count} <%= VIEW_LANG['input']['selected_files'] %>"
6
+ <%= multiple_data_input %> <%= disabled_data_input %>>
7
+
8
+ <label for="<%= @name %>">
9
+ <div class="upload-icon">
10
+ <svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><path d="M189.9 126.9v57.6c0 6-4.5 10.5-10.5 10.5H19.2c-6 0-10.5-4.5-10.5-10.5v-57.6c0-6 4.5-10.5 10.5-10.5s10.5 4.5 10.5 10.5v46.5h139.1v-46.5c0-6 4.5-10.5 10.5-10.5s10.6 4.5 10.6 10.5zm-125.2-61l24-24.5v91.1c0 6 4.5 10.5 10.5 10.5s10.5-4.5 10.5-10.5V41.3l24 24.5c2 2 5 3 7.5 3s5.5-1 7.5-3c4-4 4-10.5 0-15l-42-43c-2-2-5-3-7.5-3s-5.5 1-7.5 3l-42 43c-4 4-4 10.5 0 15 4.5 4.6 11 4.1 15 .1z"/></svg>
11
+ </div>
12
+ <!--<span><%= VIEW_LANG['input']['choose_file'] %></span>-->
13
+ <span><%= @label %></span>
14
+ </label>
15
+
16
+ <div class="input-error-message"></div>
17
+
18
+ </div>
@@ -0,0 +1,45 @@
1
+ module LatoView
2
+ class Input::Number::Cell < Cell
3
+
4
+ @@widths = VIEW_INPUTWIDTH
5
+
6
+ attr_accessor :name, :placeholder, :value, :label, :width, :required,
7
+ :disabled, :custom_class
8
+
9
+ def initialize(name: 'input', placeholder: '', value: '', label: '',
10
+ width: 'large', required: false, disabled: false,
11
+ custom_class: '')
12
+ # save params
13
+ @name = name
14
+ @placeholder = placeholder
15
+ @value = value
16
+ @label = label
17
+ @width = width
18
+ @required = required
19
+ @disabled = disabled
20
+ @custom_class = custom_class
21
+ # check params
22
+ check_params
23
+ end
24
+
25
+ def show
26
+ render "show.html"
27
+ end
28
+
29
+ # return required string to input
30
+ protected def required_data_input
31
+ return "data-input='required'" if @required
32
+ end
33
+
34
+ # return disabled string to input
35
+ protected def disabled_data_input
36
+ return "disabled='disabled'" if @disabled
37
+ end
38
+
39
+ # check params
40
+ private def check_params
41
+ raise 'Input Cells: width has not a correct value' unless @@widths.include? width
42
+ end
43
+
44
+ end
45
+ end
@@ -0,0 +1,11 @@
1
+ <div class="form-control <%= @width %>" data-control="number" <%= required_data_input %>>
2
+
3
+ <label class="form-label"><%= @label %></label>
4
+
5
+ <input type="text" class="input input-number <%= @custom_class %>"
6
+ name="<%= @name %>" placeholder="<%= @placeholder %>" value="<%= @value %>"
7
+ <%= disabled_data_input %>>
8
+
9
+ <div class="input-error-message"></div>
10
+
11
+ </div>
@@ -0,0 +1,46 @@
1
+ module LatoView
2
+ class Input::Password::Cell < Cell
3
+
4
+ @@widths = VIEW_INPUTWIDTH
5
+
6
+ attr_accessor :name, :placeholder, :value, :label, :width, :required,
7
+ :disabled, :custom_class, :visible
8
+
9
+ def initialize(name: 'input', placeholder: '', value: '', label: '',
10
+ width: 'large', required: false, disabled: false,
11
+ custom_class: '', visible: false)
12
+ # save params
13
+ @name = name
14
+ @placeholder = placeholder
15
+ @value = value
16
+ @label = label
17
+ @width = width
18
+ @required = required
19
+ @disabled = disabled
20
+ @custom_class = custom_class
21
+ @visible = visible
22
+ # check params
23
+ check_params
24
+ end
25
+
26
+ def show
27
+ render "show.html"
28
+ end
29
+
30
+ # return required string to input
31
+ protected def required_data_input
32
+ return "data-input='required'" if @required
33
+ end
34
+
35
+ # return disabled string to input
36
+ protected def disabled_data_input
37
+ return "disabled='disabled'" if @disabled
38
+ end
39
+
40
+ # check params
41
+ private def check_params
42
+ raise 'Input Cells: width has not a correct value' unless @@widths.include? width
43
+ end
44
+
45
+ end
46
+ end