matestack-ui-core 0.7.0 → 0.7.4

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 (249) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -12
  3. data/Rakefile +32 -0
  4. data/app/concepts/matestack/ui/core/abbr/abbr.haml +5 -0
  5. data/app/concepts/matestack/ui/core/abbr/abbr.rb +12 -0
  6. data/app/concepts/matestack/ui/core/action/action.js +51 -29
  7. data/app/concepts/matestack/ui/core/action/action.rb +3 -0
  8. data/app/concepts/matestack/ui/core/actionview/dynamic.haml +6 -0
  9. data/app/concepts/matestack/ui/core/actionview/dynamic.rb +28 -0
  10. data/app/concepts/matestack/ui/core/actionview/static.haml +1 -0
  11. data/app/concepts/matestack/ui/core/actionview/static.rb +28 -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.js +7 -4
  15. data/app/concepts/matestack/ui/core/app/app.rb +3 -28
  16. data/app/concepts/matestack/ui/core/app/location.js +10 -0
  17. data/app/concepts/matestack/ui/core/app/store.js +1 -2
  18. data/app/concepts/matestack/ui/core/area/area.haml +1 -0
  19. data/app/concepts/matestack/ui/core/area/area.rb +18 -0
  20. data/app/concepts/matestack/ui/core/article/article.haml +5 -0
  21. data/app/concepts/matestack/ui/core/article/article.rb +5 -0
  22. data/app/concepts/matestack/ui/core/aside/aside.haml +3 -0
  23. data/app/concepts/matestack/ui/core/aside/aside.rb +5 -0
  24. data/app/concepts/matestack/ui/core/async/async.haml +1 -1
  25. data/app/concepts/matestack/ui/core/async/async.js +24 -5
  26. data/app/concepts/matestack/ui/core/async/async.rb +8 -6
  27. data/app/concepts/matestack/ui/core/b/b.haml +5 -0
  28. data/app/concepts/matestack/ui/core/b/b.rb +5 -0
  29. data/app/concepts/matestack/ui/core/bdi/bdi.haml +5 -0
  30. data/app/concepts/matestack/ui/core/bdi/bdi.rb +4 -0
  31. data/app/concepts/matestack/ui/core/bdo/bdo.haml +5 -0
  32. data/app/concepts/matestack/ui/core/bdo/bdo.rb +11 -0
  33. data/app/concepts/matestack/ui/core/blockquote/blockquote.haml +5 -0
  34. data/app/concepts/matestack/ui/core/blockquote/blockquote.rb +11 -0
  35. data/app/concepts/matestack/ui/core/button/button.haml +4 -6
  36. data/app/concepts/matestack/ui/core/button/button.rb +6 -0
  37. data/app/concepts/matestack/ui/core/caption/caption.haml +5 -0
  38. data/app/concepts/matestack/ui/core/caption/caption.rb +5 -0
  39. data/app/concepts/matestack/ui/core/cite/cite.haml +5 -0
  40. data/app/concepts/matestack/ui/core/cite/cite.rb +5 -0
  41. data/app/concepts/matestack/ui/core/code/code.haml +5 -0
  42. data/app/concepts/matestack/ui/core/code/code.rb +5 -0
  43. data/app/concepts/matestack/ui/core/collection/content/content.js +98 -0
  44. data/app/concepts/matestack/ui/core/collection/content/content.rb +18 -0
  45. data/app/concepts/matestack/ui/core/collection/content/next/next.haml +3 -0
  46. data/app/concepts/matestack/ui/core/collection/content/next/next.rb +5 -0
  47. data/app/concepts/matestack/ui/core/collection/content/page/link/link.haml +3 -0
  48. data/app/concepts/matestack/ui/core/collection/content/page/link/link.rb +5 -0
  49. data/app/concepts/matestack/ui/core/collection/content/previous/previous.haml +3 -0
  50. data/app/concepts/matestack/ui/core/collection/content/previous/previous.rb +5 -0
  51. data/app/concepts/matestack/ui/core/collection/filter/filter.js +48 -0
  52. data/app/concepts/matestack/ui/core/collection/filter/filter.rb +17 -0
  53. data/app/concepts/matestack/ui/core/collection/filter/input/input.haml +2 -0
  54. data/app/concepts/matestack/ui/core/collection/filter/input/input.rb +25 -0
  55. data/app/concepts/matestack/ui/core/collection/filter/reset/reset.haml +3 -0
  56. data/app/concepts/matestack/ui/core/collection/filter/reset/reset.rb +5 -0
  57. data/app/concepts/matestack/ui/core/collection/filter/submit/submit.haml +3 -0
  58. data/app/concepts/matestack/ui/core/collection/filter/submit/submit.rb +5 -0
  59. data/app/concepts/matestack/ui/core/collection/helper.rb +113 -0
  60. data/app/concepts/matestack/ui/core/collection/order/order.js +56 -0
  61. data/app/concepts/matestack/ui/core/collection/order/order.rb +17 -0
  62. data/app/concepts/matestack/ui/core/collection/order/toggle/indicator/indicator.rb +13 -0
  63. data/app/concepts/matestack/ui/core/collection/order/toggle/toggle.haml +3 -0
  64. data/app/concepts/matestack/ui/core/collection/order/toggle/toggle.rb +5 -0
  65. data/app/concepts/matestack/ui/core/component/anonym-dynamic-component.js +1 -1
  66. data/app/concepts/matestack/ui/core/component/component.js +3 -4
  67. data/app/concepts/matestack/ui/core/component/dynamic.rb +38 -33
  68. data/app/concepts/matestack/ui/core/data/data.haml +5 -0
  69. data/app/concepts/matestack/ui/core/data/data.rb +9 -0
  70. data/app/concepts/matestack/ui/core/dd/dd.haml +5 -0
  71. data/app/concepts/matestack/ui/core/dd/dd.rb +5 -0
  72. data/app/concepts/matestack/ui/core/del/del.haml +5 -0
  73. data/app/concepts/matestack/ui/core/del/del.rb +4 -0
  74. data/app/concepts/matestack/ui/core/details/details.haml +3 -0
  75. data/app/concepts/matestack/ui/core/details/details.rb +5 -0
  76. data/app/concepts/matestack/ui/core/dfn/dfn.haml +5 -0
  77. data/app/concepts/matestack/ui/core/dfn/dfn.rb +6 -0
  78. data/app/concepts/matestack/ui/core/dialog/dialog.haml +5 -0
  79. data/app/concepts/matestack/ui/core/dialog/dialog.rb +9 -0
  80. data/app/concepts/matestack/ui/core/div/div.rb +0 -1
  81. data/app/concepts/matestack/ui/core/dl/dl.haml +5 -0
  82. data/app/concepts/matestack/ui/core/dl/dl.rb +5 -0
  83. data/app/concepts/matestack/ui/core/dt/dt.haml +5 -0
  84. data/app/concepts/matestack/ui/core/dt/dt.rb +5 -0
  85. data/app/concepts/matestack/ui/core/em/em.haml +5 -0
  86. data/app/concepts/matestack/ui/core/em/em.rb +5 -0
  87. data/app/concepts/matestack/ui/core/fieldset/fieldset.haml +5 -0
  88. data/app/concepts/matestack/ui/core/fieldset/fieldset.rb +9 -0
  89. data/app/concepts/matestack/ui/core/figure/figure.haml +3 -0
  90. data/app/concepts/matestack/ui/core/figure/figure.rb +5 -0
  91. data/app/concepts/matestack/ui/core/form/form.js +42 -6
  92. data/app/concepts/matestack/ui/core/form/input/input.haml +4 -6
  93. data/app/concepts/matestack/ui/core/form/select/select.haml +10 -6
  94. data/app/concepts/matestack/ui/core/html/html.js +1 -1
  95. data/app/concepts/matestack/ui/core/icon/icon.haml +2 -3
  96. data/app/concepts/matestack/ui/core/iframe/iframe.haml +5 -0
  97. data/app/concepts/matestack/ui/core/iframe/iframe.rb +14 -0
  98. data/app/concepts/matestack/ui/core/img/img.haml +1 -1
  99. data/app/concepts/matestack/ui/core/img/img.rb +10 -0
  100. data/app/concepts/matestack/ui/core/ins/ins.haml +5 -0
  101. data/app/concepts/matestack/ui/core/ins/ins.rb +10 -0
  102. data/app/concepts/matestack/ui/core/isolate/isolate.haml +2 -0
  103. data/app/concepts/matestack/ui/core/isolate/isolate.rb +11 -0
  104. data/app/concepts/matestack/ui/core/js/core.js +15 -12
  105. data/app/concepts/matestack/ui/core/js/helpers/query-params-helper.js +56 -0
  106. data/app/concepts/matestack/ui/core/kbd/kbd.haml +5 -0
  107. data/app/concepts/matestack/ui/core/kbd/kbd.rb +4 -0
  108. data/app/concepts/matestack/ui/core/label/label.haml +4 -6
  109. data/app/concepts/matestack/ui/core/label/label.rb +6 -1
  110. data/app/concepts/matestack/ui/core/legend/legend.haml +5 -0
  111. data/app/concepts/matestack/ui/core/legend/legend.rb +5 -0
  112. data/app/concepts/matestack/ui/core/li/li.haml +2 -3
  113. data/app/concepts/matestack/ui/core/link/link.haml +5 -6
  114. data/app/concepts/matestack/ui/core/link/link.rb +5 -2
  115. data/app/concepts/matestack/ui/core/map/map.haml +3 -0
  116. data/app/concepts/matestack/ui/core/map/map.rb +11 -0
  117. data/app/concepts/matestack/ui/core/mark/mark.haml +5 -0
  118. data/app/concepts/matestack/ui/core/mark/mark.rb +4 -0
  119. data/app/concepts/matestack/ui/core/meter/meter.haml +4 -0
  120. data/app/concepts/matestack/ui/core/meter/meter.rb +14 -0
  121. data/app/concepts/matestack/ui/core/noscript/noscript.haml +5 -0
  122. data/app/concepts/matestack/ui/core/noscript/noscript.rb +5 -0
  123. data/app/concepts/matestack/ui/core/object/object.haml +1 -0
  124. data/app/concepts/matestack/ui/core/object/object.rb +15 -0
  125. data/app/concepts/matestack/ui/core/onclick/onclick.haml +1 -1
  126. data/app/concepts/matestack/ui/core/onclick/onclick.js +2 -3
  127. data/app/concepts/matestack/ui/core/onclick/onclick.rb +1 -2
  128. data/app/concepts/matestack/ui/core/optgroup/optgroup.haml +3 -0
  129. data/app/concepts/matestack/ui/core/optgroup/optgroup.rb +10 -0
  130. data/app/concepts/matestack/ui/core/option/option.haml +5 -0
  131. data/app/concepts/matestack/ui/core/option/option.rb +12 -0
  132. data/app/concepts/matestack/ui/core/output/output.haml +5 -0
  133. data/app/concepts/matestack/ui/core/output/output.rb +11 -0
  134. data/app/concepts/matestack/ui/core/page/content.js +1 -1
  135. data/app/concepts/matestack/ui/core/page/page.rb +63 -23
  136. data/app/concepts/matestack/ui/core/paragraph/paragraph.haml +4 -7
  137. data/app/concepts/matestack/ui/core/param/param.haml +1 -0
  138. data/app/concepts/matestack/ui/core/param/param.rb +10 -0
  139. data/app/concepts/matestack/ui/core/pg/pg.haml +4 -7
  140. data/app/concepts/matestack/ui/core/picture/picture.haml +3 -0
  141. data/app/concepts/matestack/ui/core/picture/picture.rb +4 -0
  142. data/app/concepts/matestack/ui/core/plain/plain.rb +1 -2
  143. data/app/concepts/matestack/ui/core/pre/pre.haml +5 -0
  144. data/app/concepts/matestack/ui/core/pre/pre.rb +5 -0
  145. data/app/concepts/matestack/ui/core/q/q.haml +5 -0
  146. data/app/concepts/matestack/ui/core/q/q.rb +11 -0
  147. data/app/concepts/matestack/ui/core/rp/rp.haml +5 -0
  148. data/app/concepts/matestack/ui/core/rp/rp.rb +5 -0
  149. data/app/concepts/matestack/ui/core/rt/rt.haml +5 -0
  150. data/app/concepts/matestack/ui/core/rt/rt.rb +5 -0
  151. data/app/concepts/matestack/ui/core/ruby/ruby.haml +5 -0
  152. data/app/concepts/matestack/ui/core/ruby/ruby.rb +5 -0
  153. data/app/concepts/matestack/ui/core/s/s.haml +5 -0
  154. data/app/concepts/matestack/ui/core/s/s.rb +6 -0
  155. data/app/concepts/matestack/ui/core/samp/samp.haml +5 -0
  156. data/app/concepts/matestack/ui/core/samp/samp.rb +4 -0
  157. data/app/concepts/matestack/ui/core/small/small.haml +5 -0
  158. data/app/concepts/matestack/ui/core/small/small.rb +5 -0
  159. data/app/concepts/matestack/ui/core/span/span.haml +3 -1
  160. data/app/concepts/matestack/ui/core/strong/strong.haml +5 -0
  161. data/app/concepts/matestack/ui/core/strong/strong.rb +5 -0
  162. data/app/concepts/matestack/ui/core/sub/sub.haml +5 -0
  163. data/app/concepts/matestack/ui/core/sub/sub.rb +5 -0
  164. data/app/concepts/matestack/ui/core/summary/summary.haml +5 -0
  165. data/app/concepts/matestack/ui/core/summary/summary.rb +5 -0
  166. data/app/concepts/matestack/ui/core/sup/sup.haml +5 -0
  167. data/app/concepts/matestack/ui/core/sup/sup.rb +5 -0
  168. data/app/concepts/matestack/ui/core/tbody/tbody.haml +3 -0
  169. data/app/concepts/matestack/ui/core/tbody/tbody.rb +5 -0
  170. data/app/concepts/matestack/ui/core/td/td.haml +4 -7
  171. data/app/concepts/matestack/ui/core/template/template.haml +3 -0
  172. data/app/concepts/matestack/ui/core/template/template.rb +4 -0
  173. data/app/concepts/matestack/ui/core/tfoot/tfoot.haml +3 -0
  174. data/app/concepts/matestack/ui/core/tfoot/tfoot.rb +5 -0
  175. data/app/concepts/matestack/ui/core/th/th.haml +4 -7
  176. data/app/concepts/matestack/ui/core/thead/thead.haml +3 -0
  177. data/app/concepts/matestack/ui/core/thead/thead.rb +5 -0
  178. data/app/concepts/matestack/ui/core/transition/transition.haml +4 -6
  179. data/app/concepts/matestack/ui/core/transition/transition.js +1 -1
  180. data/app/concepts/matestack/ui/core/u/u.haml +5 -0
  181. data/app/concepts/matestack/ui/core/u/u.rb +6 -0
  182. data/app/concepts/matestack/ui/core/unescaped/unescaped.rb +7 -0
  183. data/app/concepts/matestack/ui/core/var/var.haml +5 -0
  184. data/app/concepts/matestack/ui/core/var/var.rb +4 -0
  185. data/app/concepts/matestack/ui/core/video/video.haml +3 -0
  186. data/app/concepts/matestack/ui/core/video/video.rb +23 -0
  187. data/app/concepts/matestack/ui/core/wbr/wbr.haml +1 -0
  188. data/app/concepts/matestack/ui/core/wbr/wbr.rb +4 -0
  189. data/app/concepts/matestack/ui/core/youtube/youtube.haml +1 -0
  190. data/app/concepts/matestack/ui/core/youtube/youtube.rb +26 -0
  191. data/app/helpers/matestack/ui/core/application_helper.rb +3 -1
  192. data/app/javascript/matestack-ui-core/index.js +22 -0
  193. data/app/javascript/matestack-ui-core/styles/index.scss +5 -0
  194. data/app/javascript/packs/matestack-ui-core.js +8 -0
  195. data/app/lib/matestack/ui/core/component_node.rb +30 -12
  196. data/app/lib/matestack/ui/core/has_view_context.rb +10 -0
  197. data/app/lib/matestack/ui/core/page_node.rb +40 -6
  198. data/app/lib/matestack/ui/core/render.rb +89 -0
  199. data/app/lib/matestack/ui/core/to_cell.rb +3 -1
  200. data/app/lib/matestack/ui/dynamic_actionview_component.rb +1 -0
  201. data/app/lib/matestack/ui/static_actionview_component.rb +1 -0
  202. data/config/routes.rb +0 -1
  203. data/lib/generators/matestack/app/USAGE +21 -0
  204. data/lib/generators/matestack/app/app_generator.rb +25 -0
  205. data/lib/generators/matestack/app/templates/app/controllers/%file_name%_controller.rb.tt +5 -0
  206. data/lib/generators/matestack/app/templates/app/matestack/apps/%file_name%.rb.tt +28 -0
  207. data/lib/generators/matestack/component/USAGE +20 -0
  208. data/lib/generators/matestack/component/component_generator.rb +29 -0
  209. data/lib/generators/matestack/component/templates/app/matestack/components/%namespace%/%file_name%.haml.tt +5 -0
  210. data/lib/generators/matestack/component/templates/app/matestack/components/%namespace%/%file_name%.js.tt +17 -0
  211. data/lib/generators/matestack/component/templates/app/matestack/components/%namespace%/%file_name%.rb.tt +11 -0
  212. data/lib/generators/matestack/component/templates/app/matestack/components/%namespace%/%file_name%.scss.tt +1 -0
  213. data/lib/generators/matestack/core/component/USAGE +16 -0
  214. data/lib/generators/matestack/core/component/component_generator.rb +23 -0
  215. data/lib/generators/matestack/core/component/templates/app/concepts/matestack/ui/core/%file_name%/%file_name%.haml.tt +5 -0
  216. data/lib/generators/matestack/core/component/templates/app/concepts/matestack/ui/core/%file_name%/%file_name%.rb.tt +4 -0
  217. data/lib/generators/matestack/core/component/templates/docs/components/%file_name%.md.tt +45 -0
  218. data/lib/generators/matestack/core/component/templates/spec/usage/components/%file_name%_spec.rb +31 -0
  219. data/lib/generators/matestack/page/USAGE +28 -0
  220. data/lib/generators/matestack/page/page_generator.rb +54 -0
  221. data/lib/generators/matestack/page/templates/app/matestack/pages/%app_name%/%namespace%/%file_name%.rb.tt +29 -0
  222. data/lib/matestack/ui/core.rb +1 -0
  223. data/lib/matestack/ui/core/cell.rb +33 -0
  224. data/lib/matestack/ui/core/version.rb +1 -1
  225. data/vendor/assets/javascripts/dist/manifest.json +18 -0
  226. data/vendor/assets/javascripts/dist/manifest.json.br +0 -0
  227. data/vendor/assets/javascripts/dist/manifest.json.gz +0 -0
  228. data/vendor/assets/javascripts/dist/matestack-ui-core.css +3 -0
  229. data/vendor/assets/javascripts/dist/matestack-ui-core.css.map +1 -0
  230. data/vendor/assets/javascripts/dist/matestack-ui-core.js +16523 -0
  231. data/vendor/assets/javascripts/dist/matestack-ui-core.js.map +1 -0
  232. data/vendor/assets/javascripts/dist/matestack-ui-core.min.css +0 -0
  233. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js +3 -0
  234. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.LICENSE.txt +18 -0
  235. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.br +0 -0
  236. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.gz +0 -0
  237. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.map +1 -0
  238. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.map.br +0 -0
  239. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.map.gz +0 -0
  240. data/vendor/assets/javascripts/matestack-ui-core.js.erb +2 -0
  241. data/vendor/assets/stylesheets/dist +1 -0
  242. data/vendor/assets/stylesheets/matestack-ui-core.css.erb +2 -0
  243. metadata +203 -19
  244. data/app/concepts/matestack/ui/core/view/view.haml +0 -2
  245. data/app/concepts/matestack/ui/core/view/view.js +0 -42
  246. data/app/concepts/matestack/ui/core/view/view.rb +0 -7
  247. data/vendor/assets/javascripts/manifest.json +0 -4
  248. data/vendor/assets/javascripts/matestack-ui-core.js +0 -15055
  249. data/vendor/assets/javascripts/matestack-ui-core.js.map +0 -1
@@ -0,0 +1,4 @@
1
+ module Matestack::Ui::Core::Del
2
+ class Del < Matestack::Ui::Core::Component::Static
3
+ end
4
+ end
@@ -0,0 +1,3 @@
1
+ %details{@tag_attributes}
2
+ - if block_given?
3
+ = yield
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Details
2
+ class Details < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ %dfn{@tag_attributes}
2
+ - if options[:text].nil? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,6 @@
1
+ module Matestack::Ui::Core::Dfn
2
+ class Dfn < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
6
+
@@ -0,0 +1,5 @@
1
+ %dialog{@tag_attributes}
2
+ - if options[:text].blank? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,9 @@
1
+ module Matestack::Ui::Core::Dialog
2
+ class Dialog < Matestack::Ui::Core::Component::Static
3
+ def setup
4
+ @tag_attributes.merge!({
5
+ "open": options[:open] ||= nil
6
+ })
7
+ end
8
+ end
9
+ end
@@ -1,6 +1,5 @@
1
1
  module Matestack::Ui::Core::Div
2
2
  class Div < Matestack::Ui::Core::Component::Static
3
3
 
4
-
5
4
  end
6
5
  end
@@ -0,0 +1,5 @@
1
+ %dl{@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::Dl
2
+ class Dl < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ %dt{@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::Dt
2
+ class Dt < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ %em{@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::Em
2
+ class Em < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ %fieldset{@tag_attributes}
2
+ -if options[:text].nil? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,9 @@
1
+ module Matestack::Ui::Core::Fieldset
2
+ class Fieldset < Matestack::Ui::Core::Component::Static
3
+ def setup
4
+ @tag_attributes.merge!({
5
+ disabled: options[:disabled]
6
+ })
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ %figure{@tag_attributes}
2
+ - if block_given?
3
+ = yield
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Figure
2
+ class Figure < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -2,9 +2,8 @@ import Vue from 'vue/dist/vue.esm'
2
2
  import Vuex from 'vuex'
3
3
  import axios from 'axios'
4
4
 
5
- import matestackEventHub from 'js/event-hub'
6
-
7
- import componentMixin from 'component/component'
5
+ import matestackEventHub from '../js/event-hub'
6
+ import componentMixin from '../component/component'
8
7
 
9
8
  const componentDef = {
10
9
  mixins: [componentMixin],
@@ -88,6 +87,22 @@ const componentDef = {
88
87
  }
89
88
  self.data = data;
90
89
  },
90
+ shouldResetFormOnSuccessfulSubmit() {
91
+ const self = this
92
+ if (self.componentConfig['success'] != undefined && self.componentConfig['success']['reset'] != undefined) {
93
+ return self.componentConfig['success']['reset']
94
+ } else {
95
+ return self.shouldResetFormOnSuccessfulSubmitByDefault()
96
+ }
97
+ },
98
+ shouldResetFormOnSuccessfulSubmitByDefault() {
99
+ const self = this
100
+ if (self.componentConfig["method"] == "put") {
101
+ return false
102
+ } else {
103
+ return true
104
+ }
105
+ },
91
106
  perform: function(){
92
107
  const self = this
93
108
  let payload = {}
@@ -104,12 +119,33 @@ const componentDef = {
104
119
  if (self.componentConfig["success"] != undefined && self.componentConfig["success"]["emit"] != undefined) {
105
120
  matestackEventHub.$emit(self.componentConfig["success"]["emit"], response.data);
106
121
  }
107
- if (self.componentConfig["success"] != undefined && self.componentConfig["success"]["transition"] != undefined && self.$store != undefined) {
122
+ if (self.componentConfig["success"] != undefined
123
+ && self.componentConfig["success"]["transition"] != undefined
124
+ && (
125
+ self.componentConfig["success"]["transition"]["follow_response"] == undefined
126
+ ||
127
+ self.componentConfig["success"]["transition"]["follow_response"] === false
128
+ )
129
+ && self.$store != undefined
130
+ ) {
108
131
  let path = self.componentConfig["success"]["transition"]["path"]
109
132
  self.$store.dispatch('navigateTo', {url: path, backwards: false})
133
+ return;
134
+ }
135
+ if (self.componentConfig["success"] != undefined
136
+ && self.componentConfig["success"]["transition"] != undefined
137
+ && self.componentConfig["success"]["transition"]["follow_response"] === true
138
+ && self.$store != undefined
139
+ ) {
140
+ let path = response.data["transition_to"]
141
+ self.$store.dispatch('navigateTo', {url: path, backwards: false})
142
+ return;
143
+ }
144
+ if (self.shouldResetFormOnSuccessfulSubmit())
145
+ {
146
+ self.setProps(self.data, null);
147
+ self.initValues();
110
148
  }
111
- self.setProps(self.data, null);
112
- self.initValues()
113
149
  self.showInlineForm = false;
114
150
  })
115
151
  .catch(function(error){
@@ -2,10 +2,9 @@
2
2
  %label=options[:label]
3
3
 
4
4
  - if [:text, :number, :email, :date, :password].include?(options[:type])
5
- %input{"v-model#{'.number' if options[:type] == :number}": input_key,
5
+ %input{@tag_attributes,
6
+ "v-model#{'.number' if options[:type] == :number}": input_key,
6
7
  type: options[:type],
7
- class: options[:class],
8
- id: component_id,
9
8
  "@change": "inputChanged(\"#{attr_key}\")",
10
9
  ref: "input.#{attr_key}",
11
10
  placeholder: options[:placeholder],
@@ -15,9 +14,8 @@
15
14
  {{ error }}
16
15
 
17
16
  - if options[:type] == :textarea
18
- %textarea{"v-model": input_key,
19
- class: options[:class],
20
- id: component_id,
17
+ %textarea{@tag_attributes,
18
+ "v-model": input_key,
21
19
  "@change": "inputChanged(\"#{attr_key}\")",
22
20
  ref: "input.#{attr_key}",
23
21
  placeholder: options[:placeholder],
@@ -4,8 +4,8 @@
4
4
 
5
5
  - if options[:type] == :dropdown
6
6
 
7
- %select{"#{model_binding}" => input_key,
8
- id: component_id,
7
+ %select{@tag_attributes,
8
+ "#{model_binding}" => input_key,
9
9
  ref: "select.#{attr_key}",
10
10
  "@change": "inputChanged(\"#{attr_key}\")",
11
11
  "init-value": init_value,
@@ -26,7 +26,8 @@
26
26
  %div{id: component_id, ref: "select.multiple.#{attr_key}", "init-value": init_value}
27
27
  - if options[:options].is_a?(Hash)
28
28
  - options[:options].each do |key, value|
29
- %input{type: :checkbox,
29
+ %input{@tag_attributes,
30
+ type: :checkbox,
30
31
  "#{model_binding}": input_key,
31
32
  "@change": "inputChanged(\"#{attr_key}\")",
32
33
  "value-type": options_type,
@@ -35,7 +36,8 @@
35
36
  %label=value
36
37
  - if options[:options].is_a?(Array)
37
38
  - options[:options].each do |value|
38
- %input{type: :checkbox,
39
+ %input{@tag_attributes,
40
+ type: :checkbox,
39
41
  "#{model_binding}": input_key,
40
42
  "@change": "inputChanged(\"#{attr_key}\")",
41
43
  "value-type": options_type,
@@ -51,7 +53,8 @@
51
53
  %div{id: component_id, ref: "select.#{attr_key}", "init-value": init_value}
52
54
  - if options[:options].is_a?(Hash)
53
55
  - options[:options].each do |key, value|
54
- %input{type: :radio,
56
+ %input{@tag_attributes,
57
+ type: :radio,
55
58
  "#{model_binding}": input_key,
56
59
  "@change": "inputChanged(\"#{attr_key}\")",
57
60
  "value-type": options_type,
@@ -60,7 +63,8 @@
60
63
  %label=value
61
64
  - if options[:options].is_a?(Array)
62
65
  - options[:options].each do |value|
63
- %input{type: :radio,
66
+ %input{@tag_attributes,
67
+ type: :radio,
64
68
  "#{model_binding}": input_key,
65
69
  "@change": "inputChanged(\"#{attr_key}\")",
66
70
  "value-type": options_type,
@@ -1,5 +1,5 @@
1
1
  import Vue from 'vue/dist/vue.esm'
2
- import componentMixin from 'component/component'
2
+ import componentMixin from '../component/component'
3
3
 
4
4
  const componentDef = {
5
5
  mixins: [componentMixin]
@@ -1,6 +1,5 @@
1
1
  %i{@tag_attributes}
2
- - if options[:text].blank?
3
- - if block_given?
4
- = yield
2
+ - if options[:text].nil? && block_given?
3
+ = yield
5
4
  - else
6
5
  = options[:text]
@@ -0,0 +1,5 @@
1
+ %iframe{@tag_attributes}
2
+ - if options[:text].nil? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,14 @@
1
+ module Matestack::Ui::Core::Iframe
2
+ class Iframe < Matestack::Ui::Core::Component::Static
3
+
4
+ def setup
5
+ @tag_attributes.merge!({
6
+ src: options[:src],
7
+ height: options[:height],
8
+ width: options[:width],
9
+ srcdoc: options[:srcdoc]
10
+ })
11
+ end
12
+
13
+ end
14
+ end
@@ -1 +1 @@
1
- = image_tag(ActionController::Base.helpers.asset_path(options[:path]), height: options[:height], width: options[:width], alt: options[:alt], class: options[:class], id: options[:id])
1
+ %img{@tag_attributes}
@@ -1,5 +1,15 @@
1
1
  module Matestack::Ui::Core::Img
2
2
  class Img < Matestack::Ui::Core::Component::Static
3
3
 
4
+ def setup
5
+ @tag_attributes.merge!({
6
+ src: ActionController::Base.helpers.asset_path(options[:path]),
7
+ height: options[:height],
8
+ width: options[:width],
9
+ usemap: options[:usemap],
10
+ alt: options[:alt]
11
+ })
12
+ end
13
+
4
14
  end
5
15
  end
@@ -0,0 +1,5 @@
1
+ %ins{@tag_attributes}
2
+ - if options[:text].nil? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,10 @@
1
+ module Matestack::Ui::Core::Ins
2
+ class Ins < Matestack::Ui::Core::Component::Static
3
+ def setup
4
+ @tag_attributes.merge!({
5
+ cite: options[:cite],
6
+ datetime: options[:datetime]
7
+ })
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,2 @@
1
+ - @children_cells.each do |key, cell|
2
+ = cell.call(:show)
@@ -0,0 +1,11 @@
1
+ module Matestack::Ui::Core::Isolate
2
+ class Isolate < Matestack::Ui::Core::Component::Static
3
+
4
+ def setup
5
+ @component_key = @component_key + "__" + @argument.to_s
6
+ @component_key = @component_key + "(" + @cached_params.to_json + ")" if @cached_params.present?
7
+ @component_config[:component_key] = @component_key
8
+ end
9
+
10
+ end
11
+ end
@@ -1,17 +1,20 @@
1
1
  import Vue from 'vue/dist/vue.esm'
2
2
 
3
- import app from 'app/app'
4
- import async from 'async/async'
5
- import pageContent from 'page/content'
6
- import store from 'app/store'
7
- import component from 'component/component'
8
- import anonymDynamicComponent from 'component/anonym-dynamic-component'
9
- import html from 'html/html'
10
- import transition from 'transition/transition'
11
- import action from 'action/action'
12
- import form from 'form/form'
13
- import view from 'view/view'
14
- import onclick from 'onclick/onclick'
3
+ // Import from app/concepts/matestack/ui/core:
4
+ import app from '../app/app'
5
+ import async from '../async/async'
6
+ import pageContent from '../page/content'
7
+ import store from '../app/store'
8
+ import component from '../component/component'
9
+ import anonymDynamicComponent from '../component/anonym-dynamic-component'
10
+ import html from '../html/html'
11
+ import transition from '../transition/transition'
12
+ import action from '../action/action'
13
+ import form from '../form/form'
14
+ import onclick from '../onclick/onclick'
15
+ import collectionContent from '../collection/content/content'
16
+ import collectionFilter from '../collection/filter/filter'
17
+ import collectionOrder from '../collection/order/order'
15
18
 
16
19
  let matestackUiApp = undefined
17
20
 
@@ -0,0 +1,56 @@
1
+ const updateQueryParams = (key, value, url) => {
2
+ if (!url) url = window.location.href;
3
+ let re = new RegExp(`([?&])${key}=.*?(&|#|$)(.*)`, "gi"), hash;
4
+
5
+ if (re.test(url)) {
6
+ if (typeof value !== 'undefined' && value !== null)
7
+ return url.replace(re, `$1${key}=${value}$2$3`);
8
+ else {
9
+ hash = url.split('#');
10
+ url = hash[0].replace(re, '$1$3').replace(/(&|\?)$/, '');
11
+ if (typeof hash[1] !== 'undefined' && hash[1] !== null)
12
+ url += `#${hash[1]}`;
13
+ return url;
14
+ }
15
+ }
16
+ else {
17
+ if (typeof value !== 'undefined' && value !== null) {
18
+ const separator = url.indexOf('?') !== -1 ? '&' : '?';
19
+ hash = url.split('#');
20
+ url = `${hash[0]}${separator}${key}=${value}`;
21
+ if (typeof hash[1] !== 'undefined' && hash[1] !== null)
22
+ url += `#${hash[1]}`;
23
+ return url;
24
+ }
25
+ else
26
+ return url;
27
+ }
28
+ };
29
+
30
+ const getQueryParam = (name, url) => {
31
+ if (!url) url = window.location.href;
32
+ name = name.replace(/[\[\]]/g, '\\$&');
33
+ const regex = new RegExp(`[?&]${name}(=([^&#]*)|&|#|$)`), results = regex.exec(url);
34
+ if (!results) return null;
35
+ if (!results[2]) return '';
36
+ return decodeURIComponent(results[2].replace(/\+/g, ' '));
37
+ };
38
+
39
+ const queryParamsToObject = () => {
40
+ const search = window.location.search.substring(1);
41
+ if(search.length === 0){
42
+ return {}
43
+ } else {
44
+ const result = JSON.parse(
45
+ `{"${search.replace(/&/g, '","').replace(/=/g,'":"')}"}`,
46
+ (key, value) => { return key===""?value:decodeURIComponent(value) }
47
+ );
48
+ return result;
49
+ }
50
+ };
51
+
52
+ export default {
53
+ updateQueryParams: updateQueryParams,
54
+ getQueryParam: getQueryParam,
55
+ queryParamsToObject: queryParamsToObject
56
+ }