matestack-ui-core 0.7.2

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 (202) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +228 -0
  4. data/Rakefile +34 -0
  5. data/app/concepts/matestack/ui/core/abbr/abbr.haml +5 -0
  6. data/app/concepts/matestack/ui/core/abbr/abbr.rb +12 -0
  7. data/app/concepts/matestack/ui/core/absolute/absolute.haml +3 -0
  8. data/app/concepts/matestack/ui/core/absolute/absolute.rb +17 -0
  9. data/app/concepts/matestack/ui/core/action/action.haml +3 -0
  10. data/app/concepts/matestack/ui/core/action/action.js +49 -0
  11. data/app/concepts/matestack/ui/core/action/action.rb +52 -0
  12. data/app/concepts/matestack/ui/core/address/address.haml +5 -0
  13. data/app/concepts/matestack/ui/core/address/address.rb +5 -0
  14. data/app/concepts/matestack/ui/core/app/app.haml +4 -0
  15. data/app/concepts/matestack/ui/core/app/app.js +27 -0
  16. data/app/concepts/matestack/ui/core/app/app.rb +98 -0
  17. data/app/concepts/matestack/ui/core/app/store.js +70 -0
  18. data/app/concepts/matestack/ui/core/article/article.haml +5 -0
  19. data/app/concepts/matestack/ui/core/article/article.rb +5 -0
  20. data/app/concepts/matestack/ui/core/async/async.haml +2 -0
  21. data/app/concepts/matestack/ui/core/async/async.js +76 -0
  22. data/app/concepts/matestack/ui/core/async/async.rb +12 -0
  23. data/app/concepts/matestack/ui/core/blockquote/blockquote.haml +5 -0
  24. data/app/concepts/matestack/ui/core/blockquote/blockquote.rb +11 -0
  25. data/app/concepts/matestack/ui/core/br/br.haml +5 -0
  26. data/app/concepts/matestack/ui/core/br/br.rb +5 -0
  27. data/app/concepts/matestack/ui/core/button/button.haml +5 -0
  28. data/app/concepts/matestack/ui/core/button/button.rb +11 -0
  29. data/app/concepts/matestack/ui/core/caption/caption.haml +5 -0
  30. data/app/concepts/matestack/ui/core/caption/caption.rb +5 -0
  31. data/app/concepts/matestack/ui/core/collection/content/content.js +98 -0
  32. data/app/concepts/matestack/ui/core/collection/content/content.rb +18 -0
  33. data/app/concepts/matestack/ui/core/collection/content/next/next.haml +3 -0
  34. data/app/concepts/matestack/ui/core/collection/content/next/next.rb +5 -0
  35. data/app/concepts/matestack/ui/core/collection/content/page/link/link.haml +3 -0
  36. data/app/concepts/matestack/ui/core/collection/content/page/link/link.rb +5 -0
  37. data/app/concepts/matestack/ui/core/collection/content/previous/previous.haml +3 -0
  38. data/app/concepts/matestack/ui/core/collection/content/previous/previous.rb +5 -0
  39. data/app/concepts/matestack/ui/core/collection/filter/filter.js +48 -0
  40. data/app/concepts/matestack/ui/core/collection/filter/filter.rb +17 -0
  41. data/app/concepts/matestack/ui/core/collection/filter/input/input.haml +2 -0
  42. data/app/concepts/matestack/ui/core/collection/filter/input/input.rb +25 -0
  43. data/app/concepts/matestack/ui/core/collection/filter/reset/reset.haml +3 -0
  44. data/app/concepts/matestack/ui/core/collection/filter/reset/reset.rb +5 -0
  45. data/app/concepts/matestack/ui/core/collection/filter/submit/submit.haml +3 -0
  46. data/app/concepts/matestack/ui/core/collection/filter/submit/submit.rb +5 -0
  47. data/app/concepts/matestack/ui/core/collection/helper.rb +113 -0
  48. data/app/concepts/matestack/ui/core/collection/order/order.js +56 -0
  49. data/app/concepts/matestack/ui/core/collection/order/order.rb +17 -0
  50. data/app/concepts/matestack/ui/core/collection/order/toggle/indicator/indicator.rb +13 -0
  51. data/app/concepts/matestack/ui/core/collection/order/toggle/toggle.haml +3 -0
  52. data/app/concepts/matestack/ui/core/collection/order/toggle/toggle.rb +5 -0
  53. data/app/concepts/matestack/ui/core/component/anonym-dynamic-component.js +10 -0
  54. data/app/concepts/matestack/ui/core/component/children.haml +2 -0
  55. data/app/concepts/matestack/ui/core/component/component.js +59 -0
  56. data/app/concepts/matestack/ui/core/component/dynamic.haml +6 -0
  57. data/app/concepts/matestack/ui/core/component/dynamic.rb +261 -0
  58. data/app/concepts/matestack/ui/core/component/dynamic_without_rerender.haml +2 -0
  59. data/app/concepts/matestack/ui/core/component/response.haml +2 -0
  60. data/app/concepts/matestack/ui/core/component/response_dynamic.haml +7 -0
  61. data/app/concepts/matestack/ui/core/component/response_dynamic_without_rerender.haml +3 -0
  62. data/app/concepts/matestack/ui/core/component/static.haml +1 -0
  63. data/app/concepts/matestack/ui/core/component/static.rb +16 -0
  64. data/app/concepts/matestack/ui/core/details/details.haml +3 -0
  65. data/app/concepts/matestack/ui/core/details/details.rb +5 -0
  66. data/app/concepts/matestack/ui/core/div/div.haml +3 -0
  67. data/app/concepts/matestack/ui/core/div/div.rb +5 -0
  68. data/app/concepts/matestack/ui/core/footer/footer.haml +3 -0
  69. data/app/concepts/matestack/ui/core/footer/footer.rb +5 -0
  70. data/app/concepts/matestack/ui/core/form/form.haml +2 -0
  71. data/app/concepts/matestack/ui/core/form/form.js +136 -0
  72. data/app/concepts/matestack/ui/core/form/form.rb +71 -0
  73. data/app/concepts/matestack/ui/core/form/inline/inline.haml +6 -0
  74. data/app/concepts/matestack/ui/core/form/inline/inline.rb +9 -0
  75. data/app/concepts/matestack/ui/core/form/input/input.haml +27 -0
  76. data/app/concepts/matestack/ui/core/form/input/input.rb +74 -0
  77. data/app/concepts/matestack/ui/core/form/select/select.haml +76 -0
  78. data/app/concepts/matestack/ui/core/form/select/select.rb +73 -0
  79. data/app/concepts/matestack/ui/core/form/submit/submit.haml +3 -0
  80. data/app/concepts/matestack/ui/core/form/submit/submit.rb +9 -0
  81. data/app/concepts/matestack/ui/core/header/header.haml +3 -0
  82. data/app/concepts/matestack/ui/core/header/header.rb +5 -0
  83. data/app/concepts/matestack/ui/core/heading/heading.haml +50 -0
  84. data/app/concepts/matestack/ui/core/heading/heading.rb +5 -0
  85. data/app/concepts/matestack/ui/core/hr/hr.haml +1 -0
  86. data/app/concepts/matestack/ui/core/hr/hr.rb +5 -0
  87. data/app/concepts/matestack/ui/core/html/html.haml +3 -0
  88. data/app/concepts/matestack/ui/core/html/html.js +10 -0
  89. data/app/concepts/matestack/ui/core/html/html.rb +17 -0
  90. data/app/concepts/matestack/ui/core/icon/icon.haml +5 -0
  91. data/app/concepts/matestack/ui/core/icon/icon.rb +5 -0
  92. data/app/concepts/matestack/ui/core/img/img.haml +1 -0
  93. data/app/concepts/matestack/ui/core/img/img.rb +5 -0
  94. data/app/concepts/matestack/ui/core/input/input.haml +3 -0
  95. data/app/concepts/matestack/ui/core/input/input.rb +5 -0
  96. data/app/concepts/matestack/ui/core/isolate/isolate.haml +2 -0
  97. data/app/concepts/matestack/ui/core/isolate/isolate.rb +11 -0
  98. data/app/concepts/matestack/ui/core/js/core.js +30 -0
  99. data/app/concepts/matestack/ui/core/js/event-hub.js +5 -0
  100. data/app/concepts/matestack/ui/core/js/helpers/query-params-helper.js +56 -0
  101. data/app/concepts/matestack/ui/core/label/label.haml +5 -0
  102. data/app/concepts/matestack/ui/core/label/label.rb +5 -0
  103. data/app/concepts/matestack/ui/core/li/li.haml +5 -0
  104. data/app/concepts/matestack/ui/core/li/li.rb +5 -0
  105. data/app/concepts/matestack/ui/core/link/link.haml +5 -0
  106. data/app/concepts/matestack/ui/core/link/link.rb +26 -0
  107. data/app/concepts/matestack/ui/core/main/main.haml +3 -0
  108. data/app/concepts/matestack/ui/core/main/main.rb +5 -0
  109. data/app/concepts/matestack/ui/core/nav/nav.haml +3 -0
  110. data/app/concepts/matestack/ui/core/nav/nav.rb +5 -0
  111. data/app/concepts/matestack/ui/core/ol/ol.haml +3 -0
  112. data/app/concepts/matestack/ui/core/ol/ol.rb +5 -0
  113. data/app/concepts/matestack/ui/core/onclick/onclick.haml +2 -0
  114. data/app/concepts/matestack/ui/core/onclick/onclick.js +21 -0
  115. data/app/concepts/matestack/ui/core/onclick/onclick.rb +5 -0
  116. data/app/concepts/matestack/ui/core/page/content.haml +7 -0
  117. data/app/concepts/matestack/ui/core/page/content.js +17 -0
  118. data/app/concepts/matestack/ui/core/page/content.rb +5 -0
  119. data/app/concepts/matestack/ui/core/page/page.haml +9 -0
  120. data/app/concepts/matestack/ui/core/page/page.rb +175 -0
  121. data/app/concepts/matestack/ui/core/paragraph/paragraph.haml +5 -0
  122. data/app/concepts/matestack/ui/core/paragraph/paragraph.rb +5 -0
  123. data/app/concepts/matestack/ui/core/partial/partial.haml +2 -0
  124. data/app/concepts/matestack/ui/core/partial/partial.rb +5 -0
  125. data/app/concepts/matestack/ui/core/pg/pg.haml +5 -0
  126. data/app/concepts/matestack/ui/core/pg/pg.rb +5 -0
  127. data/app/concepts/matestack/ui/core/plain/plain.rb +9 -0
  128. data/app/concepts/matestack/ui/core/progress/progress.haml +3 -0
  129. data/app/concepts/matestack/ui/core/progress/progress.rb +14 -0
  130. data/app/concepts/matestack/ui/core/section/section.haml +3 -0
  131. data/app/concepts/matestack/ui/core/section/section.rb +5 -0
  132. data/app/concepts/matestack/ui/core/slot/slot.haml +2 -0
  133. data/app/concepts/matestack/ui/core/slot/slot.rb +5 -0
  134. data/app/concepts/matestack/ui/core/small/small.haml +5 -0
  135. data/app/concepts/matestack/ui/core/small/small.rb +5 -0
  136. data/app/concepts/matestack/ui/core/span/span.haml +5 -0
  137. data/app/concepts/matestack/ui/core/span/span.rb +5 -0
  138. data/app/concepts/matestack/ui/core/strong/strong.haml +5 -0
  139. data/app/concepts/matestack/ui/core/strong/strong.rb +5 -0
  140. data/app/concepts/matestack/ui/core/sub/sub.haml +5 -0
  141. data/app/concepts/matestack/ui/core/sub/sub.rb +5 -0
  142. data/app/concepts/matestack/ui/core/summary/summary.haml +5 -0
  143. data/app/concepts/matestack/ui/core/summary/summary.rb +5 -0
  144. data/app/concepts/matestack/ui/core/table/table.haml +3 -0
  145. data/app/concepts/matestack/ui/core/table/table.rb +5 -0
  146. data/app/concepts/matestack/ui/core/tbody/tbody.haml +3 -0
  147. data/app/concepts/matestack/ui/core/tbody/tbody.rb +5 -0
  148. data/app/concepts/matestack/ui/core/td/td.haml +5 -0
  149. data/app/concepts/matestack/ui/core/td/td.rb +5 -0
  150. data/app/concepts/matestack/ui/core/tfoot/tfoot.haml +3 -0
  151. data/app/concepts/matestack/ui/core/tfoot/tfoot.rb +5 -0
  152. data/app/concepts/matestack/ui/core/th/th.haml +5 -0
  153. data/app/concepts/matestack/ui/core/th/th.rb +5 -0
  154. data/app/concepts/matestack/ui/core/thead/thead.haml +3 -0
  155. data/app/concepts/matestack/ui/core/thead/thead.rb +5 -0
  156. data/app/concepts/matestack/ui/core/time/time.haml +3 -0
  157. data/app/concepts/matestack/ui/core/time/time.rb +11 -0
  158. data/app/concepts/matestack/ui/core/tr/tr.haml +3 -0
  159. data/app/concepts/matestack/ui/core/tr/tr.rb +5 -0
  160. data/app/concepts/matestack/ui/core/transition/transition.haml +5 -0
  161. data/app/concepts/matestack/ui/core/transition/transition.js +26 -0
  162. data/app/concepts/matestack/ui/core/transition/transition.rb +31 -0
  163. data/app/concepts/matestack/ui/core/ul/ul.haml +3 -0
  164. data/app/concepts/matestack/ui/core/ul/ul.rb +5 -0
  165. data/app/concepts/matestack/ui/core/video/video.haml +1 -0
  166. data/app/concepts/matestack/ui/core/video/video.rb +7 -0
  167. data/app/concepts/matestack/ui/core/view/view.haml +2 -0
  168. data/app/concepts/matestack/ui/core/view/view.js +42 -0
  169. data/app/concepts/matestack/ui/core/view/view.rb +5 -0
  170. data/app/concepts/matestack/ui/core/youtube/youtube.haml +1 -0
  171. data/app/concepts/matestack/ui/core/youtube/youtube.rb +26 -0
  172. data/app/helpers/matestack/ui/core/application_helper.rb +35 -0
  173. data/app/lib/matestack/ui/app.rb +1 -0
  174. data/app/lib/matestack/ui/core/app_node.rb +53 -0
  175. data/app/lib/matestack/ui/core/component_node.rb +73 -0
  176. data/app/lib/matestack/ui/core/page_node.rb +96 -0
  177. data/app/lib/matestack/ui/core/to_cell.rb +129 -0
  178. data/app/lib/matestack/ui/dynamic_component.rb +1 -0
  179. data/app/lib/matestack/ui/page.rb +1 -0
  180. data/app/lib/matestack/ui/static_component.rb +1 -0
  181. data/config/routes.rb +3 -0
  182. data/lib/generators/matestack_app/USAGE +21 -0
  183. data/lib/generators/matestack_app/matestack_app_generator.rb +26 -0
  184. data/lib/generators/matestack_app/templates/matestack_app.erb +26 -0
  185. data/lib/generators/matestack_app/templates/matestack_app_controller.erb +7 -0
  186. data/lib/generators/matestack_component/USAGE +20 -0
  187. data/lib/generators/matestack_component/matestack_component_generator.rb +30 -0
  188. data/lib/generators/matestack_component/templates/matestack_component.haml.erb +5 -0
  189. data/lib/generators/matestack_component/templates/matestack_component.js.erb +17 -0
  190. data/lib/generators/matestack_component/templates/matestack_component.rb.erb +13 -0
  191. data/lib/generators/matestack_component/templates/matestack_component.scss.erb +1 -0
  192. data/lib/generators/matestack_page/USAGE +28 -0
  193. data/lib/generators/matestack_page/matestack_page_generator.rb +41 -0
  194. data/lib/generators/matestack_page/templates/matestack_page.erb +15 -0
  195. data/lib/matestack/ui/core.rb +15 -0
  196. data/lib/matestack/ui/core/engine.rb +19 -0
  197. data/lib/matestack/ui/core/version.rb +7 -0
  198. data/lib/tasks/matestack/ui/core_tasks.rake +4 -0
  199. data/vendor/assets/javascripts/manifest.json +4 -0
  200. data/vendor/assets/javascripts/matestack-ui-core.js +15309 -0
  201. data/vendor/assets/javascripts/matestack-ui-core.js.map +1 -0
  202. metadata +350 -0
@@ -0,0 +1,5 @@
1
+ %p{@tag_attributes}
2
+ - if options[:text].nil? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Paragraph
2
+ class Paragraph < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,2 @@
1
+ - @children_cells.each do |key, cell|
2
+ = cell.call(:show)
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Partial
2
+ class Partial < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ %p{@tag_attributes}
2
+ - if options[:text].nil? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Pg
2
+ class Pg < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ module Matestack::Ui::Core::Plain
2
+ class Plain < Matestack::Ui::Core::Component::Static
3
+
4
+ def show
5
+ @argument
6
+ end
7
+
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ %progress{@tag_attributes}
2
+ - if block_given?
3
+ = yield
@@ -0,0 +1,14 @@
1
+ module Matestack::Ui::Core::Progress
2
+ class Progress < Matestack::Ui::Core::Component::Static
3
+
4
+ REQUIRED_KEYS = [:max]
5
+
6
+ def setup
7
+ @tag_attributes.merge!({
8
+ 'value': options[:value] ||= 0,
9
+ 'max': options[:max]
10
+ })
11
+ end
12
+
13
+ end
14
+ end
@@ -0,0 +1,3 @@
1
+ %section{@tag_attributes}
2
+ - if block_given?
3
+ = yield
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Section
2
+ class Section < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,2 @@
1
+ - @children_cells.each do |key, cell|
2
+ = cell.call(:show)
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Slot
2
+ class Slot < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ %small{@tag_attributes}
2
+ - if options[:text].nil? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Small
2
+ class Small < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ %span{@tag_attributes}
2
+ - if options[:text].nil? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Span
2
+ class Span < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ %strong{@tag_attributes}
2
+ - if options[:text].nil? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Strong
2
+ class Strong < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ %sub{@tag_attributes}
2
+ - if options[:text].nil? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Sub
2
+ class Sub < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ %summary{@tag_attributes}
2
+ - if options[:text].nil? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Summary
2
+ class Summary < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ %table{@tag_attributes}
2
+ - if block_given?
3
+ = yield
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Table
2
+ class Table < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ %tbody{@tag_attributes}
2
+ - if block_given?
3
+ = yield
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Tbody
2
+ class Tbody < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ %td{@tag_attributes}
2
+ - if options[:text].nil? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Td
2
+ class Td < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ %tfoot{@tag_attributes}
2
+ - if block_given?
3
+ = yield
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Tfoot
2
+ class Tfoot < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ %th{@tag_attributes}
2
+ - if options[:text].nil? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Th
2
+ class Th < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ %thead{@tag_attributes}
2
+ - if block_given?
3
+ = yield
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Thead
2
+ class Thead < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ %time{@tag_attributes}
2
+ - if block_given?
3
+ = yield
@@ -0,0 +1,11 @@
1
+ module Matestack::Ui::Core::Time
2
+ class Time < Matestack::Ui::Core::Component::Static
3
+
4
+ def setup
5
+ @tag_attributes.merge!({
6
+ "datetime": options[:datetime] ||= nil
7
+ })
8
+ end
9
+
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ %tr{@tag_attributes}
2
+ - if block_given?
3
+ = yield
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Tr
2
+ class Tr < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ %a{@tag_attributes}
2
+ - if options[:text].nil? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,26 @@
1
+ import Vue from 'vue/dist/vue.esm'
2
+ import Vuex from 'vuex'
3
+ import componentMixin from 'component/component'
4
+
5
+ const componentDef = {
6
+ mixins: [componentMixin],
7
+ data: function(){
8
+ return {}
9
+ },
10
+ computed: Vuex.mapState({
11
+ isActive (state) {
12
+ return this.componentConfig["link_path"] === state.currentPath
13
+ }
14
+ }),
15
+ methods: {
16
+ navigateTo: function(url){
17
+ this.$store.dispatch('navigateTo', {url: url, backwards: false}).then((response) => {
18
+ // self.asyncTemplate = response;
19
+ })
20
+ }
21
+ }
22
+ }
23
+
24
+ let component = Vue.component('matestack-ui-core-transition', componentDef)
25
+
26
+ export default componentDef
@@ -0,0 +1,31 @@
1
+ module Matestack::Ui::Core::Transition
2
+ class Transition < Matestack::Ui::Core::Component::Dynamic
3
+
4
+ def setup
5
+ @component_config[:link_path] = link_path
6
+ @tag_attributes.merge!({
7
+ "href": link_path,
8
+ "@click.prevent": navigate_to(link_path),
9
+ "v-bind:class": "{ active: isActive }"
10
+ })
11
+ end
12
+
13
+ def link_path
14
+ if options[:path].is_a?(Symbol)
15
+ return resolve_path
16
+ end
17
+ if options[:path].is_a?(String)
18
+ return options[:path]
19
+ end
20
+ end
21
+
22
+ def resolve_path
23
+ begin
24
+ return ::Rails.application.routes.url_helpers.send(options[:path], options[:params])
25
+ rescue => e
26
+ raise "path '#{options[:path]}' not found, using params: #{options[:params]}"
27
+ end
28
+ end
29
+
30
+ end
31
+ end
@@ -0,0 +1,3 @@
1
+ %ul{@tag_attributes}
2
+ - if block_given?
3
+ = yield
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Ul
2
+ class Ul < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1 @@
1
+ = video_tag(@tag_attributes, ActionController::Base.helpers.asset_path(options[:path]), height: options[:height], width: options[:width], preload: options[:preload], autoplay: options[:autoplay], muted: options[:muted], playsinline: options[:playsinline], loop: options[:loop], controls: options[:controls])
@@ -0,0 +1,7 @@
1
+ module Matestack::Ui::Core::Video
2
+ class Video < Matestack::Ui::Core::Component::Static
3
+
4
+ REQUIRED_KEYS = [:path]
5
+
6
+ end
7
+ end
@@ -0,0 +1,2 @@
1
+ %div{"v-if": "showing"}
2
+ = yield
@@ -0,0 +1,42 @@
1
+ import Vue from 'vue/dist/vue.esm'
2
+
3
+ import matestackEventHub from 'js/event-hub'
4
+
5
+ import componentMixin from 'component/component'
6
+
7
+ const componentDef = {
8
+ mixins: [componentMixin],
9
+ data: function(){
10
+ return {
11
+ showing: false
12
+ }
13
+ },
14
+ methods: {
15
+ show: function(){
16
+ this.showing = true
17
+ },
18
+ hide: function(){
19
+ this.showing = false
20
+ }
21
+ },
22
+ created: function () {
23
+ const self = this
24
+ matestackEventHub.$on(this.componentConfig["show"], self.show)
25
+ matestackEventHub.$on(this.componentConfig["hide"], self.hide)
26
+ if(this.componentConfig["init"] == "show"){
27
+ this.showing = true
28
+ }
29
+ if(this.componentConfig["init"] == "hide"){
30
+ this.showing = false
31
+ }
32
+ },
33
+ beforeDestroy: function() {
34
+ const self = this
35
+ matestackEventHub.$off(this.componentConfig["show"], self.show);
36
+ matestackEventHub.$off(this.componentConfig["hide"], self.hide);
37
+ },
38
+ }
39
+
40
+ let component = Vue.component('matestack-ui-core-view', componentDef)
41
+
42
+ export default componentDef
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::View::Cell
2
+ class View < Matestack::Ui::Core::Component::Dynamic
3
+
4
+ end
5
+ end
@@ -0,0 +1 @@
1
+ %iframe{@tag_attributes}
@@ -0,0 +1,26 @@
1
+ module Matestack::Ui::Core::Youtube
2
+ class Youtube < Matestack::Ui::Core::Component::Static
3
+
4
+ REQUIRED_KEYS = [:yt_id, :height, :width]
5
+
6
+ def setup
7
+ url = 'https://www.youtube.com/embed/'
8
+ url = 'https://www.youtube-nocookie.com/embed/' if options[:privacy_mode] == true
9
+ url << options[:yt_id]
10
+ url << '?' unless options[:no_controls] != true and options[:start_at].nil?
11
+ url << 'controls=0' if options[:no_controls] == true
12
+ url << '&amp;' if (options[:no_controls] != nil) and (options[:start_at] != nil)
13
+ url << "start=#{options[:start_at]}" unless options[:start_at].nil?
14
+
15
+ @tag_attributes.merge!({
16
+ 'src': url,
17
+ 'allow': 'accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture',
18
+ 'allowfullscreen': '',
19
+ 'frameborder': 0,
20
+ 'height': options[:height],
21
+ 'width': options[:width]
22
+ })
23
+ end
24
+
25
+ end
26
+ end
@@ -0,0 +1,35 @@
1
+ module Matestack
2
+ module Ui
3
+ module Core
4
+ module ApplicationHelper
5
+
6
+ def render_page(page_class, only_page=false)
7
+ page_class.new(nil, context: {
8
+ params: params,
9
+ request: request
10
+ }, controller_instance: self).call(:show, nil, only_page)
11
+ end
12
+
13
+ def render_component(page_class, component_key)
14
+ page_class.new(nil, context: {
15
+ params: params,
16
+ request: request
17
+ }, controller_instance: self).call(:show, component_key)
18
+ end
19
+
20
+ def responder_for(page_class, options = {})
21
+ unless params[:component_key].blank?
22
+ render plain: render_component(page_class, params[:component_key])
23
+ return
24
+ end
25
+ if params[:only_page]
26
+ render html: render_page(page_class, true)
27
+ else
28
+ render html: render_page(page_class), layout: true
29
+ end
30
+ end
31
+
32
+ end
33
+ end
34
+ end
35
+ end