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,5 @@
1
+ %article{@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::Article
2
+ class Article < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ %aside{@tag_attributes}
2
+ - if block_given?
3
+ = yield
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Aside
2
+ class Aside < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -1,2 +1,2 @@
1
- %div{"v-if": "showing"}
1
+ %div{@tag_attributes}
2
2
  = yield
@@ -1,8 +1,6 @@
1
1
  import Vue from 'vue/dist/vue.esm'
2
-
3
- import matestackEventHub from 'js/event-hub'
4
-
5
- import componentMixin from 'component/component'
2
+ import matestackEventHub from '../js/event-hub'
3
+ import componentMixin from '../component/component'
6
4
 
7
5
  const componentDef = {
8
6
  mixins: [componentMixin],
@@ -18,8 +16,16 @@ const componentDef = {
18
16
  methods: {
19
17
  show: function(event_data){
20
18
  const self = this
19
+ if (this.showing === true){
20
+ return
21
+ }
21
22
  this.showing = true
22
23
  this.event.data = event_data
24
+ if(this.componentConfig["defer"] != undefined){
25
+ if(!isNaN(this.componentConfig["defer"])){
26
+ this.startDefer()
27
+ }
28
+ }
23
29
  if(this.componentConfig["hide_after"] != undefined){
24
30
  self.hide_after_timeout = setTimeout(function () {
25
31
  self.hide()
@@ -29,6 +35,12 @@ const componentDef = {
29
35
  hide: function(){
30
36
  this.showing = false
31
37
  this.event.data = {}
38
+ },
39
+ startDefer: function(){
40
+ const self = this
41
+ setTimeout(function () {
42
+ self.rerender()
43
+ }, parseInt(this.componentConfig["defer"]));
32
44
  }
33
45
  },
34
46
  created: function () {
@@ -39,7 +51,14 @@ const componentDef = {
39
51
  if(this.componentConfig["show_on"] != undefined){
40
52
  this.showing = false
41
53
  }
42
- if(this.componentConfig["hide_on"] != undefined){
54
+ if(this.componentConfig["defer"] != undefined){
55
+ if(!isNaN(this.componentConfig["defer"])){
56
+ if (this.componentConfig["show_on"] == undefined){
57
+ this.startDefer()
58
+ }
59
+ }
60
+ }
61
+ if(this.componentConfig["init_show"] == true){
43
62
  this.showing = true
44
63
  }
45
64
  },
@@ -1,10 +1,12 @@
1
1
  module Matestack::Ui::Core::Async
2
- class Async < Matestack::Ui::Core::Component::Dynamic
3
-
4
- def setup
5
- @rerender = true
6
- end
7
-
2
+ class Async < Matestack::Ui::Core::Component::Dynamic
8
3
 
4
+ def setup
5
+ @rerender = true
6
+ @tag_attributes.merge!({
7
+ "v-if": "showing"
8
+ })
9
9
  end
10
+
10
11
  end
12
+ end
@@ -0,0 +1,5 @@
1
+ %b{@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::B
2
+ class B < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ %bdi{@tag_attributes}
2
+ - if options[:text].blank? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,4 @@
1
+ module Matestack::Ui::Core::Bdi
2
+ class Bdi < Matestack::Ui::Core::Component::Static
3
+ end
4
+ end
@@ -0,0 +1,5 @@
1
+ %bdo{@tag_attributes}
2
+ - if options[:text].blank? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,11 @@
1
+ module Matestack::Ui::Core::Bdo
2
+ class Bdo < Matestack::Ui::Core::Component::Static
3
+ REQUIRED_KEYS = [:dir]
4
+
5
+ def setup
6
+ @tag_attributes.merge!({
7
+ "dir": options[:dir]
8
+ })
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ %blockquote{@tag_attributes}
2
+ - if options[:text].nil? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,11 @@
1
+ module Matestack::Ui::Core::Blockquote
2
+ class Blockquote < Matestack::Ui::Core::Component::Static
3
+
4
+ def setup
5
+ @tag_attributes.merge!({
6
+ "cite": options[:cite]
7
+ })
8
+ end
9
+
10
+ end
11
+ end
@@ -1,7 +1,5 @@
1
- - if options[:text].nil?
2
- %button{@tag_attributes}
3
- - if block_given?
4
- = yield
5
- - else
6
- %button{@tag_attributes}
1
+ %button{@tag_attributes}
2
+ - if options[:text].nil? && block_given?
3
+ = yield
4
+ - else
7
5
  = options[:text]
@@ -1,5 +1,11 @@
1
1
  module Matestack::Ui::Core::Button
2
2
  class Button < Matestack::Ui::Core::Component::Static
3
3
 
4
+ def setup
5
+ @tag_attributes.merge!({
6
+ "disabled": options[:disabled] ||= nil
7
+ })
8
+ end
9
+
4
10
  end
5
11
  end
@@ -0,0 +1,5 @@
1
+ %caption{@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::Caption
2
+ class Caption < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ %cite{@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::Cite
2
+ class Cite < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ %code{@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::Code
2
+ class Code < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,98 @@
1
+ import Vue from 'vue/dist/vue.esm'
2
+ import matestackEventHub from '../../js/event-hub'
3
+ import queryParamsHelper from '../../js/helpers/query-params-helper'
4
+ import componentMixin from '../../component/component'
5
+ import asyncMixin from '../../async/async'
6
+
7
+ const componentDef = {
8
+ mixins: [componentMixin, asyncMixin],
9
+ data: function(){
10
+ return {
11
+ currentLimit: null,
12
+ currentOffset: null,
13
+ currentFilteredCount: null,
14
+ currentBaseCount: null
15
+ }
16
+ },
17
+ methods: {
18
+ next: function(){
19
+ if (this.currentTo() < this.currentCount()){
20
+ this.currentOffset += this.currentLimit
21
+ var url = queryParamsHelper.updateQueryParams(this.componentConfig["id"] + "-offset", this.currentOffset)
22
+ window.history.pushState({matestackApp: true, url: url}, null, url);
23
+ matestackEventHub.$emit(this.componentConfig["id"] + "-update")
24
+ }
25
+ },
26
+ previous: function(){
27
+ if ((this.currentOffset - this.currentLimit)*-1 != this.currentLimit){
28
+ if((this.currentOffset - this.currentLimit) < 0){
29
+ this.currentOffset = 0
30
+ } else {
31
+ this.currentOffset -= this.currentLimit
32
+ }
33
+ var url = queryParamsHelper.updateQueryParams(this.componentConfig["id"] + "-offset", this.currentOffset)
34
+ window.history.pushState({matestackApp: true, url: url}, null, url);
35
+ matestackEventHub.$emit(this.componentConfig["id"] + "-update")
36
+ }
37
+ },
38
+ currentTo: function(){
39
+ var to = parseInt(this.currentOffset) + parseInt(this.currentLimit)
40
+ if (to > parseInt(this.currentCount())){
41
+ return this.currentCount();
42
+ } else {
43
+ return to;
44
+ }
45
+ },
46
+ currentCount: function(){
47
+ if (this.currentFilteredCount != null || this.currentFilteredCount != undefined){
48
+ return this.currentFilteredCount;
49
+ } else {
50
+ return this.currentBaseCount;
51
+ }
52
+ },
53
+ goToPage: function(page){
54
+ this.currentOffset = parseInt(this.currentLimit) * (parseInt(page)-1)
55
+ var url = queryParamsHelper.updateQueryParams(this.componentConfig["id"] + "-offset", this.currentOffset)
56
+ window.history.pushState({matestackApp: true, url: url}, null, url);
57
+ matestackEventHub.$emit(this.componentConfig["id"] + "-update")
58
+ }
59
+ },
60
+ mounted: function(){
61
+ if(queryParamsHelper.getQueryParam(this.componentConfig["id"] + "-offset") != null){
62
+ this.currentOffset = parseInt(queryParamsHelper.getQueryParam(this.componentConfig["id"] + "-offset"))
63
+ } else {
64
+ if(this.componentConfig["init_offset"] != undefined){
65
+ this.currentOffset = this.componentConfig["init_offset"]
66
+ } else {
67
+ this.currentOffset = 0
68
+ }
69
+ }
70
+
71
+ if(queryParamsHelper.getQueryParam(this.componentConfig["id"] + "-limit") != null){
72
+ this.currentOffset = parseInt(queryParamsHelper.getQueryParam(this.componentConfig["id"] + "-limit"))
73
+ } else {
74
+ if(this.componentConfig["init_limit"] != undefined){
75
+ this.currentLimit = this.componentConfig["init_limit"]
76
+ } else {
77
+ this.currentLimit = 10
78
+ }
79
+ }
80
+
81
+ if(this.componentConfig["filtered_count"] != undefined){
82
+ this.currentFilteredCount = this.componentConfig["filtered_count"]
83
+ if(this.currentOffset >= this.currentFilteredCount){
84
+ this.previous()
85
+ }
86
+ }
87
+ if(this.componentConfig["base_count"] != undefined){
88
+ this.currentBaseCount = this.componentConfig["base_count"]
89
+ if(this.currentOffset >= this.currentBaseCount){
90
+ this.previous()
91
+ }
92
+ }
93
+ }
94
+ }
95
+
96
+ let component = Vue.component('matestack-ui-core-collection-content', componentDef)
97
+
98
+ export default componentDef
@@ -0,0 +1,18 @@
1
+ module Matestack::Ui::Core::Collection::Content
2
+ class Content < Matestack::Ui::Core::Component::Dynamic
3
+
4
+ def setup
5
+ @rerender = true
6
+ @component_config = @component_config.except(:data, :paginated_data)
7
+ end
8
+
9
+ def response
10
+ components {
11
+ div @tag_attributes do
12
+ yield_components
13
+ end
14
+ }
15
+ end
16
+
17
+ end
18
+ end
@@ -0,0 +1,3 @@
1
+ %a{@tag_attributes, "@click": "next()"}
2
+ - if block_given?
3
+ = yield
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Collection::Content::Next
2
+ class Next < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ %a{@tag_attributes, "@click": "goToPage(#{@options[:page]})"}
2
+ - if block_given?
3
+ = yield
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Collection::Content::Page::Link
2
+ class Link < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ %a{@tag_attributes, "@click": "previous()"}
2
+ - if block_given?
3
+ = yield
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Collection::Content::Previous
2
+ class Previous < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -0,0 +1,48 @@
1
+ import Vue from 'vue/dist/vue.esm'
2
+ import matestackEventHub from '../../js/event-hub'
3
+ import queryParamsHelper from '../../js/helpers/query-params-helper'
4
+ import componentMixin from '../../component/component'
5
+
6
+ const componentDef = {
7
+ mixins: [componentMixin],
8
+ data: function(){
9
+ return {
10
+ filter: {}
11
+ }
12
+ },
13
+ methods: {
14
+ submitFilter: function(){
15
+ var url;
16
+ var filter = this.filter
17
+ for (var key in this.filter) {
18
+ url = queryParamsHelper.updateQueryParams(this.componentConfig["id"] + "-filter-" + key, this.filter[key], url)
19
+ }
20
+ url = queryParamsHelper.updateQueryParams(this.componentConfig["id"] + "-offset", 0, url)
21
+ window.history.pushState({matestackApp: true, url: url}, null, url);
22
+ matestackEventHub.$emit(this.componentConfig["id"] + "-update")
23
+ },
24
+ resetFilter: function(){
25
+ var url;
26
+ for (var key in this.filter) {
27
+ url = queryParamsHelper.updateQueryParams(this.componentConfig["id"] + "-filter-" + key, null, url)
28
+ this.filter[key] = null;
29
+ this.$forceUpdate();
30
+ }
31
+ window.history.pushState({matestackApp: true, url: url}, null, url);
32
+ matestackEventHub.$emit(this.componentConfig["id"] + "-update")
33
+ }
34
+ },
35
+ created: function(){
36
+ var self = this;
37
+ var queryParamsObject = queryParamsHelper.queryParamsToObject()
38
+ Object.keys(queryParamsObject).forEach(function(key){
39
+ if (key.startsWith(self.componentConfig["id"] + "-filter-")){
40
+ self.filter[key.replace(self.componentConfig["id"] + "-filter-", "")] = queryParamsObject[key]
41
+ }
42
+ })
43
+ }
44
+ }
45
+
46
+ let component = Vue.component('matestack-ui-core-collection-filter', componentDef)
47
+
48
+ export default componentDef
@@ -0,0 +1,17 @@
1
+ module Matestack::Ui::Core::Collection::Filter
2
+ class Filter < Matestack::Ui::Core::Component::Dynamic
3
+
4
+ def setup
5
+ @component_config = @component_config.except(:data, :paginated_data)
6
+ end
7
+
8
+ def response
9
+ components {
10
+ div @tag_attributes do
11
+ yield_components
12
+ end
13
+ }
14
+ end
15
+
16
+ end
17
+ end