matestack-ui-core 1.0.0.rc.1 → 1.3.0

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 (259) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +784 -18
  3. data/app/concepts/matestack/ui/core/abbr/abbr.haml +1 -1
  4. data/app/concepts/matestack/ui/core/abbr/abbr.rb +0 -8
  5. data/app/concepts/matestack/ui/core/action/action.haml +1 -1
  6. data/app/concepts/matestack/ui/core/actionview/dynamic.haml +4 -4
  7. data/app/concepts/matestack/ui/core/address/address.haml +2 -2
  8. data/app/concepts/matestack/ui/core/app/store.js +5 -1
  9. data/app/concepts/matestack/ui/core/area/area.haml +1 -1
  10. data/app/concepts/matestack/ui/core/area/area.rb +2 -16
  11. data/app/concepts/matestack/ui/core/article/article.haml +3 -3
  12. data/app/concepts/matestack/ui/core/article/article.rb +1 -1
  13. data/app/concepts/matestack/ui/core/aside/aside.haml +1 -1
  14. data/app/concepts/matestack/ui/core/aside/aside.rb +0 -1
  15. data/app/concepts/matestack/ui/core/async/async.js +6 -28
  16. data/app/concepts/matestack/ui/core/async/async.rb +11 -11
  17. data/app/concepts/matestack/ui/core/async/children_wrapper.haml +1 -1
  18. data/app/concepts/matestack/ui/core/b/b.haml +3 -3
  19. data/app/concepts/matestack/ui/core/b/b.rb +1 -1
  20. data/app/concepts/matestack/ui/core/bdi/bdi.haml +3 -3
  21. data/app/concepts/matestack/ui/core/bdi/bdi.rb +1 -0
  22. data/app/concepts/matestack/ui/core/bdo/bdo.haml +3 -3
  23. data/app/concepts/matestack/ui/core/bdo/bdo.rb +2 -7
  24. data/app/concepts/matestack/ui/core/blockquote/blockquote.haml +3 -3
  25. data/app/concepts/matestack/ui/core/blockquote/blockquote.rb +2 -7
  26. data/app/concepts/matestack/ui/core/br/br.haml +4 -4
  27. data/app/concepts/matestack/ui/core/br/br.rb +1 -1
  28. data/app/concepts/matestack/ui/core/button/button.haml +3 -3
  29. data/app/concepts/matestack/ui/core/button/button.rb +3 -7
  30. data/app/concepts/matestack/ui/core/cable/cable.haml +4 -0
  31. data/app/concepts/matestack/ui/core/cable/cable.js +100 -0
  32. data/app/concepts/matestack/ui/core/cable/cable.rb +28 -0
  33. data/app/concepts/matestack/ui/core/cable/children_wrapper.haml +2 -0
  34. data/app/concepts/matestack/ui/core/caption/caption.haml +3 -3
  35. data/app/concepts/matestack/ui/core/caption/caption.rb +1 -1
  36. data/app/concepts/matestack/ui/core/cite/cite.haml +3 -3
  37. data/app/concepts/matestack/ui/core/cite/cite.rb +1 -1
  38. data/app/concepts/matestack/ui/core/code/code.haml +3 -3
  39. data/app/concepts/matestack/ui/core/code/code.rb +1 -1
  40. data/app/concepts/matestack/ui/core/collection/content/content.js +2 -2
  41. data/app/concepts/matestack/ui/core/collection/content/content.rb +4 -6
  42. data/app/concepts/matestack/ui/core/collection/content/next/next.haml +1 -1
  43. data/app/concepts/matestack/ui/core/collection/content/page/link/link.haml +1 -1
  44. data/app/concepts/matestack/ui/core/collection/content/page/link/link.rb +1 -1
  45. data/app/concepts/matestack/ui/core/collection/content/previous/previous.haml +1 -1
  46. data/app/concepts/matestack/ui/core/collection/filter/filter.rb +1 -1
  47. data/app/concepts/matestack/ui/core/collection/filter/input/input.rb +11 -8
  48. data/app/concepts/matestack/ui/core/collection/filter/reset/reset.haml +1 -1
  49. data/app/concepts/matestack/ui/core/collection/filter/select/select.haml +6 -6
  50. data/app/concepts/matestack/ui/core/collection/filter/select/select.rb +10 -9
  51. data/app/concepts/matestack/ui/core/collection/filter/submit/submit.haml +1 -1
  52. data/app/concepts/matestack/ui/core/collection/order/order.rb +1 -1
  53. data/app/concepts/matestack/ui/core/collection/order/toggle/indicator/indicator.rb +5 -2
  54. data/app/concepts/matestack/ui/core/collection/order/toggle/toggle.haml +1 -1
  55. data/app/concepts/matestack/ui/core/collection/order/toggle/toggle.rb +0 -1
  56. data/app/concepts/matestack/ui/core/component/base.rb +10 -4
  57. data/app/concepts/matestack/ui/core/component/component.js +18 -1
  58. data/app/concepts/matestack/ui/core/component/dynamic.rb +2 -1
  59. data/app/concepts/matestack/ui/core/data/data.haml +3 -3
  60. data/app/concepts/matestack/ui/core/data/data.rb +2 -5
  61. data/app/concepts/matestack/ui/core/datalist/datalist.haml +2 -2
  62. data/app/concepts/matestack/ui/core/datalist/datalist.rb +1 -2
  63. data/app/concepts/matestack/ui/core/dd/dd.haml +3 -3
  64. data/app/concepts/matestack/ui/core/dd/dd.rb +1 -1
  65. data/app/concepts/matestack/ui/core/del/del.haml +3 -3
  66. data/app/concepts/matestack/ui/core/del/del.rb +2 -0
  67. data/app/concepts/matestack/ui/core/details/details.haml +1 -1
  68. data/app/concepts/matestack/ui/core/details/details.rb +1 -1
  69. data/app/concepts/matestack/ui/core/dfn/dfn.haml +3 -3
  70. data/app/concepts/matestack/ui/core/dfn/dfn.rb +1 -1
  71. data/app/concepts/matestack/ui/core/dialog/dialog.haml +3 -3
  72. data/app/concepts/matestack/ui/core/dialog/dialog.rb +2 -5
  73. data/app/concepts/matestack/ui/core/div/div.haml +1 -1
  74. data/app/concepts/matestack/ui/core/div/div.rb +0 -1
  75. data/app/concepts/matestack/ui/core/dl/dl.haml +3 -3
  76. data/app/concepts/matestack/ui/core/dl/dl.rb +2 -2
  77. data/app/concepts/matestack/ui/core/dt/dt.haml +3 -3
  78. data/app/concepts/matestack/ui/core/dt/dt.rb +1 -1
  79. data/app/concepts/matestack/ui/core/em/em.haml +3 -3
  80. data/app/concepts/matestack/ui/core/em/em.rb +1 -1
  81. data/app/concepts/matestack/ui/core/fieldset/fieldset.haml +4 -4
  82. data/app/concepts/matestack/ui/core/fieldset/fieldset.rb +3 -6
  83. data/app/concepts/matestack/ui/core/figure/figure.haml +1 -1
  84. data/app/concepts/matestack/ui/core/figure/figure.rb +0 -1
  85. data/app/concepts/matestack/ui/core/footer/footer.haml +1 -1
  86. data/app/concepts/matestack/ui/core/footer/footer.rb +0 -1
  87. data/app/concepts/matestack/ui/core/form/checkbox/base.rb +120 -0
  88. data/app/concepts/matestack/ui/core/form/checkbox/checkbox.js +15 -0
  89. data/app/concepts/matestack/ui/core/form/checkbox/checkbox.rb +7 -70
  90. data/app/concepts/matestack/ui/core/form/checkbox/mixin.js +80 -0
  91. data/app/concepts/matestack/ui/core/form/form.haml +1 -1
  92. data/app/concepts/matestack/ui/core/form/form.js +15 -46
  93. data/app/concepts/matestack/ui/core/form/form.rb +34 -28
  94. data/app/concepts/matestack/ui/core/form/input/base.rb +75 -0
  95. data/app/concepts/matestack/ui/core/form/input/input.js +15 -0
  96. data/app/concepts/matestack/ui/core/form/input/input.rb +8 -52
  97. data/app/concepts/matestack/ui/core/form/input/mixin.js +55 -0
  98. data/app/concepts/matestack/ui/core/form/radio/base.rb +90 -0
  99. data/app/concepts/matestack/ui/core/form/radio/mixin.js +62 -0
  100. data/app/concepts/matestack/ui/core/form/radio/radio.js +15 -0
  101. data/app/concepts/matestack/ui/core/form/radio/radio.rb +7 -62
  102. data/app/concepts/matestack/ui/core/form/select/base.rb +98 -0
  103. data/app/concepts/matestack/ui/core/form/select/mixin.js +58 -0
  104. data/app/concepts/matestack/ui/core/form/select/select.js +15 -0
  105. data/app/concepts/matestack/ui/core/form/select/select.rb +11 -80
  106. data/app/concepts/matestack/ui/core/form/submit/base.rb +12 -0
  107. data/app/concepts/matestack/ui/core/form/submit/submit.js +19 -0
  108. data/app/concepts/matestack/ui/core/form/submit/submit.rb +9 -6
  109. data/app/concepts/matestack/ui/core/form/textarea/base.rb +49 -0
  110. data/app/concepts/matestack/ui/core/form/textarea/mixin.js +41 -0
  111. data/app/concepts/matestack/ui/core/form/textarea/textarea.js +15 -0
  112. data/app/concepts/matestack/ui/core/form/textarea/textarea.rb +10 -21
  113. data/app/concepts/matestack/ui/core/header/header.haml +1 -1
  114. data/app/concepts/matestack/ui/core/header/header.rb +0 -1
  115. data/app/concepts/matestack/ui/core/heading/heading.haml +4 -49
  116. data/app/concepts/matestack/ui/core/heading/heading.rb +1 -3
  117. data/app/concepts/matestack/ui/core/hr/hr.haml +1 -1
  118. data/app/concepts/matestack/ui/core/hr/hr.rb +0 -1
  119. data/app/concepts/matestack/ui/core/icon/icon.haml +3 -3
  120. data/app/concepts/matestack/ui/core/icon/icon.rb +1 -1
  121. data/app/concepts/matestack/ui/core/iframe/iframe.haml +3 -3
  122. data/app/concepts/matestack/ui/core/iframe/iframe.rb +3 -10
  123. data/app/concepts/matestack/ui/core/img/img.haml +1 -1
  124. data/app/concepts/matestack/ui/core/img/img.rb +8 -8
  125. data/app/concepts/matestack/ui/core/input/input.rb +0 -4
  126. data/app/concepts/matestack/ui/core/ins/ins.haml +3 -3
  127. data/app/concepts/matestack/ui/core/ins/ins.rb +2 -6
  128. data/app/concepts/matestack/ui/core/isolated/children_wrapper.haml +1 -1
  129. data/app/concepts/matestack/ui/core/isolated/isolated.rb +1 -1
  130. data/app/concepts/matestack/ui/core/js/core.js +12 -0
  131. data/app/concepts/matestack/ui/core/kbd/kbd.haml +3 -3
  132. data/app/concepts/matestack/ui/core/kbd/kbd.rb +1 -0
  133. data/app/concepts/matestack/ui/core/label/label.haml +3 -3
  134. data/app/concepts/matestack/ui/core/label/label.rb +2 -6
  135. data/app/concepts/matestack/ui/core/legend/legend.haml +3 -3
  136. data/app/concepts/matestack/ui/core/legend/legend.rb +1 -1
  137. data/app/concepts/matestack/ui/core/li/li.haml +3 -3
  138. data/app/concepts/matestack/ui/core/li/li.rb +2 -1
  139. data/app/concepts/matestack/ui/core/link/link.haml +3 -3
  140. data/app/concepts/matestack/ui/core/link/link.rb +10 -14
  141. data/app/concepts/matestack/ui/core/main/main.haml +1 -1
  142. data/app/concepts/matestack/ui/core/main/main.rb +0 -1
  143. data/app/concepts/matestack/ui/core/map/map.haml +1 -1
  144. data/app/concepts/matestack/ui/core/map/map.rb +1 -7
  145. data/app/concepts/matestack/ui/core/mark/mark.haml +3 -3
  146. data/app/concepts/matestack/ui/core/mark/mark.rb +1 -0
  147. data/app/concepts/matestack/ui/core/meter/meter.haml +1 -1
  148. data/app/concepts/matestack/ui/core/meter/meter.rb +1 -10
  149. data/app/concepts/matestack/ui/core/nav/nav.haml +1 -1
  150. data/app/concepts/matestack/ui/core/nav/nav.rb +0 -1
  151. data/app/concepts/matestack/ui/core/noscript/noscript.haml +3 -3
  152. data/app/concepts/matestack/ui/core/noscript/noscript.rb +1 -1
  153. data/app/concepts/matestack/ui/core/object/object.haml +1 -1
  154. data/app/concepts/matestack/ui/core/object/object.rb +1 -11
  155. data/app/concepts/matestack/ui/core/ol/ol.haml +1 -1
  156. data/app/concepts/matestack/ui/core/ol/ol.rb +1 -1
  157. data/app/concepts/matestack/ui/core/onclick/onclick.haml +1 -1
  158. data/app/concepts/matestack/ui/core/optgroup/optgroup.haml +1 -1
  159. data/app/concepts/matestack/ui/core/optgroup/optgroup.rb +1 -6
  160. data/app/concepts/matestack/ui/core/option/option.haml +3 -3
  161. data/app/concepts/matestack/ui/core/option/option.rb +2 -8
  162. data/app/concepts/matestack/ui/core/output/output.haml +3 -3
  163. data/app/concepts/matestack/ui/core/output/output.rb +2 -7
  164. data/app/concepts/matestack/ui/core/page/content/content.rb +0 -1
  165. data/app/concepts/matestack/ui/core/page/page.haml +1 -1
  166. data/app/concepts/matestack/ui/core/paragraph/paragraph.haml +3 -3
  167. data/app/concepts/matestack/ui/core/paragraph/paragraph.rb +1 -1
  168. data/app/concepts/matestack/ui/core/param/param.haml +1 -1
  169. data/app/concepts/matestack/ui/core/param/param.rb +1 -6
  170. data/app/concepts/matestack/ui/core/partial/partial.rb +0 -1
  171. data/app/concepts/matestack/ui/core/picture/picture.haml +1 -1
  172. data/app/concepts/matestack/ui/core/pre/pre.haml +3 -3
  173. data/app/concepts/matestack/ui/core/pre/pre.rb +1 -1
  174. data/app/concepts/matestack/ui/core/progress/progress.haml +1 -1
  175. data/app/concepts/matestack/ui/core/progress/progress.rb +1 -10
  176. data/app/concepts/matestack/ui/core/q/q.haml +3 -3
  177. data/app/concepts/matestack/ui/core/q/q.rb +2 -7
  178. data/app/concepts/matestack/ui/core/rp/rp.haml +3 -3
  179. data/app/concepts/matestack/ui/core/rp/rp.rb +1 -1
  180. data/app/concepts/matestack/ui/core/rt/rt.haml +3 -3
  181. data/app/concepts/matestack/ui/core/rt/rt.rb +1 -1
  182. data/app/concepts/matestack/ui/core/ruby/ruby.haml +3 -3
  183. data/app/concepts/matestack/ui/core/ruby/ruby.rb +1 -1
  184. data/app/concepts/matestack/ui/core/s/s.haml +3 -3
  185. data/app/concepts/matestack/ui/core/s/s.rb +1 -1
  186. data/app/concepts/matestack/ui/core/samp/samp.haml +3 -3
  187. data/app/concepts/matestack/ui/core/samp/samp.rb +1 -0
  188. data/app/concepts/matestack/ui/core/section/section.haml +1 -1
  189. data/app/concepts/matestack/ui/core/section/section.rb +0 -1
  190. data/app/concepts/matestack/ui/core/{form/submit/submit.haml → select/select.haml} +1 -1
  191. data/app/concepts/matestack/ui/core/select/select.rb +7 -0
  192. data/app/concepts/matestack/ui/core/slot/slot.rb +0 -1
  193. data/app/concepts/matestack/ui/core/small/small.haml +3 -3
  194. data/app/concepts/matestack/ui/core/small/small.rb +1 -1
  195. data/app/concepts/matestack/ui/core/span/span.haml +3 -3
  196. data/app/concepts/matestack/ui/core/span/span.rb +1 -1
  197. data/app/concepts/matestack/ui/core/strong/strong.haml +3 -3
  198. data/app/concepts/matestack/ui/core/strong/strong.rb +1 -1
  199. data/app/concepts/matestack/ui/core/sub/sub.haml +3 -3
  200. data/app/concepts/matestack/ui/core/sub/sub.rb +1 -1
  201. data/app/concepts/matestack/ui/core/summary/summary.haml +3 -3
  202. data/app/concepts/matestack/ui/core/summary/summary.rb +1 -1
  203. data/app/concepts/matestack/ui/core/sup/sup.haml +3 -3
  204. data/app/concepts/matestack/ui/core/sup/sup.rb +1 -1
  205. data/app/concepts/matestack/ui/core/table/table.haml +1 -1
  206. data/app/concepts/matestack/ui/core/table/table.rb +0 -1
  207. data/app/concepts/matestack/ui/core/tbody/tbody.haml +1 -1
  208. data/app/concepts/matestack/ui/core/tbody/tbody.rb +0 -1
  209. data/app/concepts/matestack/ui/core/td/td.haml +3 -3
  210. data/app/concepts/matestack/ui/core/td/td.rb +2 -1
  211. data/app/concepts/matestack/ui/core/template/template.haml +1 -1
  212. data/app/concepts/matestack/ui/core/textarea/textarea.haml +4 -1
  213. data/app/concepts/matestack/ui/core/tfoot/tfoot.haml +1 -1
  214. data/app/concepts/matestack/ui/core/tfoot/tfoot.rb +0 -1
  215. data/app/concepts/matestack/ui/core/th/th.haml +3 -3
  216. data/app/concepts/matestack/ui/core/th/th.rb +2 -1
  217. data/app/concepts/matestack/ui/core/thead/thead.haml +1 -1
  218. data/app/concepts/matestack/ui/core/thead/thead.rb +0 -1
  219. data/app/concepts/matestack/ui/core/time/time.haml +1 -1
  220. data/app/concepts/matestack/ui/core/time/time.rb +1 -7
  221. data/app/concepts/matestack/ui/core/toggle/toggle.haml +1 -1
  222. data/app/concepts/matestack/ui/core/toggle/toggle.rb +4 -5
  223. data/app/concepts/matestack/ui/core/tr/tr.haml +1 -1
  224. data/app/concepts/matestack/ui/core/tr/tr.rb +0 -1
  225. data/app/concepts/matestack/ui/core/transition/transition.haml +3 -3
  226. data/app/concepts/matestack/ui/core/transition/transition.rb +13 -7
  227. data/app/concepts/matestack/ui/core/u/u.haml +3 -3
  228. data/app/concepts/matestack/ui/core/u/u.rb +1 -1
  229. data/app/concepts/matestack/ui/core/ul/ul.haml +1 -1
  230. data/app/concepts/matestack/ui/core/ul/ul.rb +0 -1
  231. data/app/concepts/matestack/ui/core/unescaped/unescaped.rb +2 -0
  232. data/app/concepts/matestack/ui/core/var/var.haml +3 -3
  233. data/app/concepts/matestack/ui/core/var/var.rb +1 -0
  234. data/app/concepts/matestack/ui/core/video/video.haml +2 -2
  235. data/app/concepts/matestack/ui/core/video/video.rb +3 -13
  236. data/app/concepts/matestack/ui/core/wbr/wbr.haml +5 -1
  237. data/app/concepts/matestack/ui/core/wbr/wbr.rb +1 -0
  238. data/app/concepts/matestack/ui/core/youtube/youtube.haml +1 -1
  239. data/app/concepts/matestack/ui/core/youtube/youtube.rb +18 -16
  240. data/app/helpers/matestack/ui/core/application_helper.rb +6 -2
  241. data/app/javascript/matestack-ui-core/index.js +12 -2
  242. data/app/lib/matestack/ui/core/has_view_context.rb +4 -2
  243. data/app/lib/matestack/ui/core/html_attributes.rb +1 -1
  244. data/app/lib/matestack/ui/core/properties.rb +95 -22
  245. data/app/lib/matestack/ui/core/rendering/main_renderer.rb +11 -7
  246. data/lib/matestack/ui/core/components.rb +6 -2
  247. data/lib/matestack/ui/core/version.rb +1 -1
  248. data/vendor/assets/javascripts/dist/matestack-ui-core.js +773 -99
  249. data/vendor/assets/javascripts/dist/matestack-ui-core.js.map +1 -1
  250. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js +1 -1
  251. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.br +0 -0
  252. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.gz +0 -0
  253. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.map +1 -1
  254. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.map.br +0 -0
  255. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.map.gz +0 -0
  256. metadata +29 -8
  257. data/app/concepts/matestack/ui/core/collection/filter/input/input.haml +0 -2
  258. data/app/concepts/matestack/ui/core/component/rerender.rb +0 -8
  259. data/app/concepts/matestack/ui/core/form/select/select.haml +0 -9
@@ -0,0 +1,28 @@
1
+ module Matestack::Ui::Core::Cable
2
+ class Cable < Matestack::Ui::Core::Component::Dynamic
3
+ vue_js_component_name 'matestack-ui-core-cable'
4
+
5
+ requires :id
6
+
7
+ def setup
8
+ component_config[:component_key] = id
9
+ end
10
+
11
+ def show
12
+ render :cable
13
+ end
14
+
15
+ def render_content
16
+ render :children_wrapper do
17
+ render :children
18
+ end
19
+ end
20
+
21
+ def children_wrapper_attributes
22
+ html_attributes.merge({
23
+ id: component_config[:component_key]
24
+ })
25
+ end
26
+
27
+ end
28
+ end
@@ -0,0 +1,2 @@
1
+ %div{ children_wrapper_attributes.merge(class: "matestack-cable-component-root") }
2
+ =yield
@@ -1,5 +1,5 @@
1
- %caption{@tag_attributes}
2
- - if options[:text].nil? && block_given?
1
+ %caption{ html_attributes }
2
+ - if text.nil? && block_given?
3
3
  = yield
4
4
  - else
5
- = options[:text]
5
+ = text
@@ -1,5 +1,5 @@
1
1
  module Matestack::Ui::Core::Caption
2
2
  class Caption < Matestack::Ui::Core::Component::Static
3
-
3
+ optional :text
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
- %cite{@tag_attributes}
2
- - if options[:text].nil? && block_given?
1
+ %cite{ html_attributes }
2
+ - if text.nil? && block_given?
3
3
  = yield
4
4
  - else
5
- = options[:text]
5
+ = text
@@ -1,5 +1,5 @@
1
1
  module Matestack::Ui::Core::Cite
2
2
  class Cite < Matestack::Ui::Core::Component::Static
3
-
3
+ optional :text
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
- %code{@tag_attributes}
2
- - if options[:text].nil? && block_given?
1
+ %code{ html_attributes }
2
+ - if text.nil? && block_given?
3
3
  = yield
4
4
  - else
5
- = options[:text]
5
+ = text
@@ -1,5 +1,5 @@
1
1
  module Matestack::Ui::Core::Code
2
2
  class Code < Matestack::Ui::Core::Component::Static
3
-
3
+ optional :text
4
4
  end
5
5
  end
@@ -2,10 +2,10 @@ import Vue from 'vue/dist/vue.esm'
2
2
  import matestackEventHub from '../../js/event-hub'
3
3
  import queryParamsHelper from '../../js/helpers/query-params-helper'
4
4
  import componentMixin from '../../component/component'
5
- import asyncMixin from '../../async/async'
5
+ // import asyncMixin from '../../async/async'
6
6
 
7
7
  const componentDef = {
8
- mixins: [componentMixin, asyncMixin],
8
+ mixins: [componentMixin],
9
9
  data: function(){
10
10
  return {
11
11
  currentLimit: null,
@@ -1,5 +1,5 @@
1
1
  module Matestack::Ui::Core::Collection::Content
2
- class Content < Matestack::Ui::Core::Component::Rerender
2
+ class Content < Matestack::Ui::Core::Component::Dynamic
3
3
  vue_js_component_name 'matestack-ui-core-collection-content'
4
4
 
5
5
  def setup
@@ -7,11 +7,9 @@ module Matestack::Ui::Core::Collection::Content
7
7
  end
8
8
 
9
9
  def response
10
- components {
11
- div @tag_attributes do
12
- yield_components
13
- end
14
- }
10
+ div @tag_attributes do
11
+ yield_components
12
+ end
15
13
  end
16
14
 
17
15
  end
@@ -1,3 +1,3 @@
1
- %a{@tag_attributes, "@click": "next()"}
1
+ %a{ html_attributes , "@click": "next()" }
2
2
  - if block_given?
3
3
  = yield
@@ -1,3 +1,3 @@
1
- %a{@tag_attributes, "@click": "goToPage(#{@options[:page]})"}
1
+ %a{ html_attributes, "@click": "goToPage(#{page})" }
2
2
  - if block_given?
3
3
  = yield
@@ -1,7 +1,7 @@
1
1
  module Matestack::Ui::Core::Collection::Content::Page
2
2
  module Link
3
3
  class Link::Link < Matestack::Ui::Core::Component::Static
4
-
4
+ requires :page
5
5
  end
6
6
  end
7
7
  end
@@ -1,3 +1,3 @@
1
- %a{@tag_attributes, "@click": "previous()"}
1
+ %a{ html_attributes, "@click": "previous()" }
2
2
  - if block_given?
3
3
  = yield
@@ -7,7 +7,7 @@ module Matestack::Ui::Core::Collection::Filter
7
7
  end
8
8
 
9
9
  def response
10
- div @tag_attributes do
10
+ div html_attributes do
11
11
  yield_components
12
12
  end
13
13
  end
@@ -1,24 +1,27 @@
1
1
  module Matestack::Ui::Core::Collection::Filter::Input
2
2
  class Input < Matestack::Ui::Core::Component::Static
3
+ include Matestack::Ui::Core::Form::HasInputHtmlAttributes
3
4
 
4
- def setup
5
- @tag_attributes.merge!({
6
- "v-model#{'.number' if options[:type] == :number}": input_key,
7
- type: options[:type],
8
- class: options[:class],
5
+ requires :key, :type
6
+ optional :placeholder, class: { as: :klass }
7
+
8
+ def response
9
+ input html_attributes.merge(attributes: {
10
+ "v-model#{'.number' if type == :number}": input_key,
11
+ type: type,
9
12
  id: component_id,
10
13
  "@keyup.enter": "submitFilter()",
11
14
  ref: "filter.#{attr_key}",
12
- placeholder: options[:placeholder]
15
+ placeholder: placeholder
13
16
  })
14
17
  end
15
18
 
16
19
  def input_key
17
- 'filter["' + options[:key].to_s + '"]'
20
+ 'filter["' + key.to_s + '"]'
18
21
  end
19
22
 
20
23
  def attr_key
21
- return options[:key].to_s
24
+ key.to_s
22
25
  end
23
26
 
24
27
  end
@@ -1,3 +1,3 @@
1
- %a{@tag_attributes, "@click": "resetFilter()"}
1
+ %a{ html_attributes , "@click": "resetFilter()"}
2
2
  - if block_given?
3
3
  = yield
@@ -1,10 +1,10 @@
1
1
  - if options[:type] == :dropdown
2
2
 
3
- %select{@tag_attributes}
4
- %option{disabled: true}= options[:placeholder]
5
- - if @options[:options].is_a?(Hash)
6
- - @options[:options].each do |key, value|
3
+ %select{ select_attributes }
4
+ %option{disabled: true}= placeholder
5
+ - if select_options.is_a?(Hash)
6
+ - select_options.each do |key, value|
7
7
  %option{value: key}=value
8
- - if @options[:options].is_a?(Array)
9
- - @options[:options].each do |option|
8
+ - if select_options.is_a?(Array)
9
+ - select_options.each do |option|
10
10
  %option{value: option}=option
@@ -1,28 +1,29 @@
1
1
  module Matestack::Ui::Core::Collection::Filter::Select
2
2
  class Select < Matestack::Ui::Core::Component::Static
3
3
 
4
+ requires :key
5
+ optional :placeholder, options: { as: :select_options }
6
+
4
7
  def setup
5
8
  if options[:type].nil?
6
9
  options[:type] = :dropdown #nothing else supported at the moment
7
10
  end
8
- @tag_attributes.merge!({
11
+ end
12
+
13
+ def select_attributes
14
+ html_attributes.merge!({
9
15
  "v-model#{'.number' if options[:type] == :number}": input_key,
10
16
  type: options[:type],
11
- class: options[:class],
12
17
  id: component_id,
13
18
  "@keyup.enter": "submitFilter()",
14
19
  "@change": "$forceUpdate()",
15
- ref: "filter.#{attr_key}",
16
- placeholder: options[:placeholder]
20
+ ref: "filter.#{key.to_s}",
21
+ placeholder: placeholder
17
22
  })
18
23
  end
19
24
 
20
25
  def input_key
21
- 'filter["' + options[:key].to_s + '"]'
22
- end
23
-
24
- def attr_key
25
- return options[:key].to_s
26
+ 'filter["' + key.to_s + '"]'
26
27
  end
27
28
 
28
29
  end
@@ -1,3 +1,3 @@
1
- %a{@tag_attributes, "@click": "submitFilter()"}
1
+ %a{ html_attributes, "@click": "submitFilter()" }
2
2
  - if block_given?
3
3
  = yield
@@ -7,7 +7,7 @@ module Matestack::Ui::Core::Collection::Order
7
7
  end
8
8
 
9
9
  def response
10
- div @tag_attributes do
10
+ div html_attributes do
11
11
  yield_components
12
12
  end
13
13
  end
@@ -2,10 +2,13 @@ module Matestack::Ui::Core::Collection::Order::Toggle::Indicator
2
2
  class Indicator < Matestack::Ui::Core::Component::Static
3
3
 
4
4
  def response
5
- span @tag_attributes do
5
+ span html_attributes do
6
6
  span attributes: {"v-if": "ordering['#{@component_config[:key]}'] === undefined"}, text: @component_config[:default]
7
7
  unescaped "{{
8
- orderIndicator('#{@component_config[:key]}', { asc: '#{@component_config[:asc]}', desc: '#{@component_config[:desc]}'})
8
+ orderIndicator(
9
+ '#{@component_config[:key]}',
10
+ { asc: '#{@component_config[:asc]}', desc: '#{@component_config[:desc]}'}
11
+ )
9
12
  }}"
10
13
  end
11
14
  end
@@ -1,3 +1,3 @@
1
- %a{@tag_attributes, "@click": "toggleOrder(\"#{@component_config[:key]}\")"}
1
+ %a{ html_attributes, "@click": "toggleOrder(\"#{@component_config[:key]}\")" }
2
2
  - if block_given?
3
3
  = yield
@@ -1,5 +1,4 @@
1
1
  module Matestack::Ui::Core::Collection::Order::Toggle
2
2
  class Toggle < Matestack::Ui::Core::Component::Static
3
-
4
3
  end
5
4
  end
@@ -4,12 +4,11 @@ module Matestack::Ui::Core::Component
4
4
  include Matestack::Ui::Core::HasViewContext
5
5
  include Matestack::Ui::Core::HtmlAttributes
6
6
  include Matestack::Ui::Core::Properties
7
+ include Matestack::Ui::Core::DSL
7
8
 
8
9
  # define html global attributes
9
10
  html_attributes *HTML_GLOBAL_ATTRIBUTES, *HTML_EVENT_ATTRIBUTES
10
11
 
11
- # probably need to remove for other tests to be green again
12
- include Matestack::Ui::Core::DSL
13
12
 
14
13
  view_paths << "#{Matestack::Ui::Core::Engine.root}/app/concepts"
15
14
  view_paths << "#{::Rails.root}#{'/' unless ::Rails.root.nil?}app/matestack"
@@ -99,6 +98,11 @@ module Matestack::Ui::Core::Component
99
98
  def get_included_config
100
99
  @included_config
101
100
  end
101
+ alias :included_config :get_included_config
102
+
103
+ def component_config
104
+ @component_config
105
+ end
102
106
 
103
107
  # TODO: modifies/recreates view lookup paths on every invocation?!
104
108
  # At least memoize it I guess...
@@ -161,8 +165,10 @@ module Matestack::Ui::Core::Component
161
165
  def params
162
166
  if @matestack_context.present? && @matestack_context[:controller].present?
163
167
  @matestack_context[:controller].params
164
- else
168
+ elsif context.present? && context[:params]
165
169
  context[:params]
170
+ else
171
+ ActionController::Parameters.new({})
166
172
  end
167
173
  end
168
174
 
@@ -239,7 +245,7 @@ module Matestack::Ui::Core::Component
239
245
 
240
246
  # check only allowed keys are passed to isolated components
241
247
  if child_class < Matestack::Ui::Core::Isolated::Isolated
242
- unless args.empty? || args[0].keys.all? { |key| [:defer, :public_options, :rerender_on, :init_on, :rerender_delay, :matestack_context].include? key }
248
+ unless args.empty? || args[0].keys.all? { |key| [:defer, :public_options, :rerender_on, :init_on, :rerender_delay, :matestack_context, :context].include? key }
243
249
  raise "isolated components can only take params in a public_options hash, which will be exposed to the client side in order to perform an async request with these params."
244
250
  end
245
251
  if args.any? { |arg| arg[:init_on].present? } && @matestack_skip_defer == true
@@ -1,5 +1,22 @@
1
+ import matestackEventHub from '../js/event-hub'
2
+
1
3
  const componentMixin = {
2
- props: ['componentConfig', 'params']
4
+ props: ['componentConfig', 'params'],
5
+ methods: {
6
+ registerEvents: function(events, callback){
7
+ if(events != undefined){
8
+ var event_names = events.split(",")
9
+ event_names.forEach(event_name => matestackEventHub.$on(event_name.trim(), callback));
10
+ }
11
+ },
12
+ removeEvents: function(events, callback){
13
+ if(events != undefined){
14
+ var event_names = events.split(",")
15
+ event_names.forEach(event_name => matestackEventHub.$off(event_name.trim(), callback));
16
+ }
17
+ }
18
+ }
19
+
3
20
  }
4
21
 
5
22
  export default componentMixin
@@ -16,7 +16,7 @@ module Matestack::Ui::Core::Component
16
16
  "is": get_vue_js_name,
17
17
  "ref": component_id,
18
18
  ":params": params.except(:controller, :action).to_json,
19
- ":component-config": @component_config.to_json,
19
+ ":component-config": component_config.to_json,
20
20
  "inline-template": true,
21
21
  }
22
22
  attrs.merge!(options[:attributes]) unless options[:attributes].nil?
@@ -30,6 +30,7 @@ module Matestack::Ui::Core::Component
30
30
  class << self
31
31
 
32
32
  def inherited(subclass)
33
+ super # do not overwrite inherited implementation of Base
33
34
  subclass.vue_js_component_name vue_js_name unless self == Matestack::Ui::Core::Component::Dynamic
34
35
  end
35
36
 
@@ -1,5 +1,5 @@
1
- %data{@tag_attributes}
2
- - if options[:text].blank? && block_given?
1
+ %data{ html_attributes }
2
+ - if text.blank? && block_given?
3
3
  = yield
4
4
  - else
5
- = options[:text]
5
+ = text
@@ -1,9 +1,6 @@
1
1
  module Matestack::Ui::Core::Data
2
2
  class Data < Matestack::Ui::Core::Component::Static
3
- def setup
4
- @tag_attributes.merge!({
5
- "value": options[:value] ||= nil
6
- })
7
- end
3
+ html_attributes :value
4
+ optional :text
8
5
  end
9
6
  end
@@ -1,3 +1,3 @@
1
- %datalist{@tag_attributes}
1
+ %datalist{ html_attributes }
2
2
  - if block_given?
3
- = yield
3
+ = yield
@@ -1,5 +1,4 @@
1
1
  module Matestack::Ui::Core::Datalist
2
2
  class Datalist < Matestack::Ui::Core::Component::Static
3
-
4
3
  end
5
- end
4
+ end
@@ -1,5 +1,5 @@
1
- %dd{@tag_attributes}
2
- - if options[:text].nil? && block_given?
1
+ %dd{ html_attributes }
2
+ - if text.nil? && block_given?
3
3
  = yield
4
4
  - else
5
- = options[:text]
5
+ = text
@@ -1,5 +1,5 @@
1
1
  module Matestack::Ui::Core::Dd
2
2
  class Dd < Matestack::Ui::Core::Component::Static
3
-
3
+ optional :text
4
4
  end
5
5
  end