matestack-ui-core 0.7.5 → 1.1.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 (300) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +8 -0
  3. data/README.md +28 -216
  4. data/app/concepts/matestack/ui/core/abbr/abbr.haml +3 -3
  5. data/app/concepts/matestack/ui/core/abbr/abbr.rb +1 -8
  6. data/app/concepts/matestack/ui/core/action/action.haml +1 -1
  7. data/app/concepts/matestack/ui/core/action/action.js +120 -39
  8. data/app/concepts/matestack/ui/core/action/action.rb +40 -15
  9. data/app/concepts/matestack/ui/core/actionview/dynamic.haml +4 -4
  10. data/app/concepts/matestack/ui/core/address/address.haml +3 -3
  11. data/app/concepts/matestack/ui/core/address/address.rb +1 -1
  12. data/app/concepts/matestack/ui/core/app/app.haml +2 -3
  13. data/app/concepts/matestack/ui/core/app/app.js +6 -3
  14. data/app/concepts/matestack/ui/core/app/app.rb +33 -56
  15. data/app/concepts/matestack/ui/core/app/store.js +28 -2
  16. data/app/concepts/matestack/ui/core/area/area.haml +1 -1
  17. data/app/concepts/matestack/ui/core/area/area.rb +2 -14
  18. data/app/concepts/matestack/ui/core/article/article.haml +3 -3
  19. data/app/concepts/matestack/ui/core/article/article.rb +1 -1
  20. data/app/concepts/matestack/ui/core/aside/aside.haml +1 -1
  21. data/app/concepts/matestack/ui/core/aside/aside.rb +0 -1
  22. data/app/concepts/matestack/ui/core/async/async.haml +6 -2
  23. data/app/concepts/matestack/ui/core/async/async.js +43 -9
  24. data/app/concepts/matestack/ui/core/async/async.rb +29 -4
  25. data/app/concepts/matestack/ui/core/async/children_wrapper.haml +2 -0
  26. data/app/concepts/matestack/ui/core/b/b.haml +3 -3
  27. data/app/concepts/matestack/ui/core/b/b.rb +1 -1
  28. data/app/concepts/matestack/ui/core/bdi/bdi.haml +3 -3
  29. data/app/concepts/matestack/ui/core/bdi/bdi.rb +1 -0
  30. data/app/concepts/matestack/ui/core/bdo/bdo.haml +3 -3
  31. data/app/concepts/matestack/ui/core/bdo/bdo.rb +2 -7
  32. data/app/concepts/matestack/ui/core/blockquote/blockquote.haml +3 -3
  33. data/app/concepts/matestack/ui/core/blockquote/blockquote.rb +2 -7
  34. data/app/concepts/matestack/ui/core/br/br.haml +4 -4
  35. data/app/concepts/matestack/ui/core/br/br.rb +1 -1
  36. data/app/concepts/matestack/ui/core/button/button.haml +3 -3
  37. data/app/concepts/matestack/ui/core/button/button.rb +3 -7
  38. data/app/concepts/matestack/ui/core/cable/cable.haml +4 -0
  39. data/app/concepts/matestack/ui/core/cable/cable.js +100 -0
  40. data/app/concepts/matestack/ui/core/cable/cable.rb +28 -0
  41. data/app/concepts/matestack/ui/core/cable/children_wrapper.haml +2 -0
  42. data/app/concepts/matestack/ui/core/caption/caption.haml +3 -3
  43. data/app/concepts/matestack/ui/core/caption/caption.rb +1 -1
  44. data/app/concepts/matestack/ui/core/cite/cite.haml +3 -3
  45. data/app/concepts/matestack/ui/core/cite/cite.rb +1 -1
  46. data/app/concepts/matestack/ui/core/code/code.haml +3 -3
  47. data/app/concepts/matestack/ui/core/code/code.rb +1 -1
  48. data/app/concepts/matestack/ui/core/collection/content/content.js +2 -2
  49. data/app/concepts/matestack/ui/core/collection/content/content.rb +4 -6
  50. data/app/concepts/matestack/ui/core/collection/content/next/next.haml +1 -1
  51. data/app/concepts/matestack/ui/core/collection/content/page/link/link.haml +1 -1
  52. data/app/concepts/matestack/ui/core/collection/content/page/link/link.rb +5 -3
  53. data/app/concepts/matestack/ui/core/collection/content/previous/previous.haml +1 -1
  54. data/app/concepts/matestack/ui/core/collection/filter/filter.rb +4 -5
  55. data/app/concepts/matestack/ui/core/collection/filter/input/input.rb +11 -8
  56. data/app/concepts/matestack/ui/core/collection/filter/reset/reset.haml +1 -1
  57. data/app/concepts/matestack/ui/core/collection/filter/select/select.haml +10 -0
  58. data/app/concepts/matestack/ui/core/collection/filter/select/select.rb +30 -0
  59. data/app/concepts/matestack/ui/core/collection/filter/submit/submit.haml +1 -1
  60. data/app/concepts/matestack/ui/core/collection/helper.rb +14 -6
  61. data/app/concepts/matestack/ui/core/collection/order/order.js +1 -1
  62. data/app/concepts/matestack/ui/core/collection/order/order.rb +4 -5
  63. data/app/concepts/matestack/ui/core/collection/order/toggle/indicator/indicator.rb +9 -5
  64. data/app/concepts/matestack/ui/core/collection/order/toggle/toggle.haml +1 -1
  65. data/app/concepts/matestack/ui/core/collection/order/toggle/toggle.rb +0 -1
  66. data/app/concepts/matestack/ui/core/component/base.rb +430 -0
  67. data/app/concepts/matestack/ui/core/component/children.haml +2 -2
  68. data/app/concepts/matestack/ui/core/component/component.js +9 -46
  69. data/app/concepts/matestack/ui/core/component/dynamic.haml +1 -1
  70. data/app/concepts/matestack/ui/core/component/dynamic.rb +25 -247
  71. data/app/concepts/matestack/ui/core/component/static.rb +3 -12
  72. data/app/concepts/matestack/ui/core/data/data.haml +3 -3
  73. data/app/concepts/matestack/ui/core/data/data.rb +2 -5
  74. data/app/concepts/matestack/ui/core/datalist/datalist.haml +2 -2
  75. data/app/concepts/matestack/ui/core/datalist/datalist.rb +1 -2
  76. data/app/concepts/matestack/ui/core/dd/dd.haml +3 -3
  77. data/app/concepts/matestack/ui/core/dd/dd.rb +1 -1
  78. data/app/concepts/matestack/ui/core/del/del.haml +3 -3
  79. data/app/concepts/matestack/ui/core/del/del.rb +2 -0
  80. data/app/concepts/matestack/ui/core/details/details.haml +1 -1
  81. data/app/concepts/matestack/ui/core/details/details.rb +1 -1
  82. data/app/concepts/matestack/ui/core/dfn/dfn.haml +3 -3
  83. data/app/concepts/matestack/ui/core/dfn/dfn.rb +1 -1
  84. data/app/concepts/matestack/ui/core/dialog/dialog.haml +3 -3
  85. data/app/concepts/matestack/ui/core/dialog/dialog.rb +2 -5
  86. data/app/concepts/matestack/ui/core/div/div.haml +1 -1
  87. data/app/concepts/matestack/ui/core/div/div.rb +0 -1
  88. data/app/concepts/matestack/ui/core/dl/dl.haml +3 -3
  89. data/app/concepts/matestack/ui/core/dl/dl.rb +2 -2
  90. data/app/concepts/matestack/ui/core/dt/dt.haml +3 -3
  91. data/app/concepts/matestack/ui/core/dt/dt.rb +1 -1
  92. data/app/concepts/matestack/ui/core/em/em.haml +3 -3
  93. data/app/concepts/matestack/ui/core/em/em.rb +1 -1
  94. data/app/concepts/matestack/ui/core/fieldset/fieldset.haml +4 -4
  95. data/app/concepts/matestack/ui/core/fieldset/fieldset.rb +3 -6
  96. data/app/concepts/matestack/ui/core/figure/figure.haml +1 -1
  97. data/app/concepts/matestack/ui/core/figure/figure.rb +0 -1
  98. data/app/concepts/matestack/ui/core/footer/footer.haml +1 -1
  99. data/app/concepts/matestack/ui/core/footer/footer.rb +0 -1
  100. data/app/concepts/matestack/ui/core/form/checkbox/checkbox.rb +79 -0
  101. data/app/concepts/matestack/ui/core/form/form.haml +1 -1
  102. data/app/concepts/matestack/ui/core/form/form.js +257 -123
  103. data/app/concepts/matestack/ui/core/form/form.rb +52 -19
  104. data/app/concepts/matestack/ui/core/form/has_errors.rb +54 -0
  105. data/app/concepts/matestack/ui/core/form/has_input_html_attributes.rb +13 -0
  106. data/app/concepts/matestack/ui/core/form/input/input.rb +32 -52
  107. data/app/concepts/matestack/ui/core/form/radio/radio.rb +71 -0
  108. data/app/concepts/matestack/ui/core/form/select/select.haml +9 -76
  109. data/app/concepts/matestack/ui/core/form/select/select.rb +44 -49
  110. data/app/concepts/matestack/ui/core/form/submit/submit.haml +1 -1
  111. data/app/concepts/matestack/ui/core/form/submit/submit.rb +5 -2
  112. data/app/concepts/matestack/ui/core/form/textarea/textarea.rb +28 -0
  113. data/app/concepts/matestack/ui/core/form/utils.rb +47 -0
  114. data/app/concepts/matestack/ui/core/header/header.haml +1 -1
  115. data/app/concepts/matestack/ui/core/header/header.rb +0 -1
  116. data/app/concepts/matestack/ui/core/heading/heading.haml +4 -49
  117. data/app/concepts/matestack/ui/core/heading/heading.rb +1 -1
  118. data/app/concepts/matestack/ui/core/hr/hr.haml +1 -1
  119. data/app/concepts/matestack/ui/core/hr/hr.rb +0 -1
  120. data/app/concepts/matestack/ui/core/icon/icon.haml +3 -3
  121. data/app/concepts/matestack/ui/core/icon/icon.rb +1 -1
  122. data/app/concepts/matestack/ui/core/iframe/iframe.haml +3 -3
  123. data/app/concepts/matestack/ui/core/iframe/iframe.rb +3 -10
  124. data/app/concepts/matestack/ui/core/img/img.haml +1 -1
  125. data/app/concepts/matestack/ui/core/img/img.rb +8 -8
  126. data/app/concepts/matestack/ui/core/input/input.haml +1 -2
  127. data/app/concepts/matestack/ui/core/input/input.rb +4 -4
  128. data/app/concepts/matestack/ui/core/ins/ins.haml +3 -3
  129. data/app/concepts/matestack/ui/core/ins/ins.rb +2 -6
  130. data/app/concepts/matestack/ui/core/isolated/children_wrapper.haml +2 -0
  131. data/app/concepts/matestack/ui/core/isolated/isolated.haml +10 -0
  132. data/app/concepts/matestack/ui/core/isolated/isolated.js +108 -0
  133. data/app/concepts/matestack/ui/core/isolated/isolated.rb +59 -0
  134. data/app/concepts/matestack/ui/core/js/core.js +6 -4
  135. data/app/concepts/matestack/ui/core/kbd/kbd.haml +3 -3
  136. data/app/concepts/matestack/ui/core/kbd/kbd.rb +1 -0
  137. data/app/concepts/matestack/ui/core/label/label.haml +3 -3
  138. data/app/concepts/matestack/ui/core/label/label.rb +2 -6
  139. data/app/concepts/matestack/ui/core/legend/legend.haml +3 -3
  140. data/app/concepts/matestack/ui/core/legend/legend.rb +1 -1
  141. data/app/concepts/matestack/ui/core/li/li.haml +3 -3
  142. data/app/concepts/matestack/ui/core/li/li.rb +2 -1
  143. data/app/concepts/matestack/ui/core/link/link.haml +3 -3
  144. data/app/concepts/matestack/ui/core/link/link.rb +10 -14
  145. data/app/concepts/matestack/ui/core/main/main.haml +1 -1
  146. data/app/concepts/matestack/ui/core/main/main.rb +0 -1
  147. data/app/concepts/matestack/ui/core/map/map.haml +1 -1
  148. data/app/concepts/matestack/ui/core/map/map.rb +1 -7
  149. data/app/concepts/matestack/ui/core/mark/mark.haml +3 -3
  150. data/app/concepts/matestack/ui/core/mark/mark.rb +1 -0
  151. data/app/concepts/matestack/ui/core/meter/meter.haml +1 -1
  152. data/app/concepts/matestack/ui/core/meter/meter.rb +1 -10
  153. data/app/concepts/matestack/ui/core/nav/nav.haml +1 -1
  154. data/app/concepts/matestack/ui/core/nav/nav.rb +0 -1
  155. data/app/concepts/matestack/ui/core/noscript/noscript.haml +3 -3
  156. data/app/concepts/matestack/ui/core/noscript/noscript.rb +1 -1
  157. data/app/concepts/matestack/ui/core/object/object.haml +1 -1
  158. data/app/concepts/matestack/ui/core/object/object.rb +1 -11
  159. data/app/concepts/matestack/ui/core/ol/ol.haml +1 -1
  160. data/app/concepts/matestack/ui/core/ol/ol.rb +1 -1
  161. data/app/concepts/matestack/ui/core/onclick/onclick.haml +1 -1
  162. data/app/concepts/matestack/ui/core/onclick/onclick.rb +1 -0
  163. data/app/concepts/matestack/ui/core/optgroup/optgroup.haml +1 -1
  164. data/app/concepts/matestack/ui/core/optgroup/optgroup.rb +1 -6
  165. data/app/concepts/matestack/ui/core/option/option.haml +3 -3
  166. data/app/concepts/matestack/ui/core/option/option.rb +2 -8
  167. data/app/concepts/matestack/ui/core/output/output.haml +3 -3
  168. data/app/concepts/matestack/ui/core/output/output.rb +2 -7
  169. data/app/concepts/matestack/ui/core/page/{content.js → content/content.js} +8 -2
  170. data/app/concepts/matestack/ui/core/page/content/content.rb +28 -0
  171. data/app/concepts/matestack/ui/core/page/page.haml +3 -9
  172. data/app/concepts/matestack/ui/core/page/page.rb +15 -175
  173. data/app/concepts/matestack/ui/core/paragraph/paragraph.haml +3 -3
  174. data/app/concepts/matestack/ui/core/paragraph/paragraph.rb +1 -1
  175. data/app/concepts/matestack/ui/core/param/param.haml +1 -1
  176. data/app/concepts/matestack/ui/core/param/param.rb +1 -6
  177. data/app/concepts/matestack/ui/core/partial/partial.rb +0 -1
  178. data/app/concepts/matestack/ui/core/picture/picture.haml +1 -1
  179. data/app/concepts/matestack/ui/core/pre/pre.haml +3 -3
  180. data/app/concepts/matestack/ui/core/pre/pre.rb +1 -1
  181. data/app/concepts/matestack/ui/core/progress/progress.haml +1 -1
  182. data/app/concepts/matestack/ui/core/progress/progress.rb +1 -10
  183. data/app/concepts/matestack/ui/core/q/q.haml +3 -3
  184. data/app/concepts/matestack/ui/core/q/q.rb +2 -7
  185. data/app/concepts/matestack/ui/core/rp/rp.haml +3 -3
  186. data/app/concepts/matestack/ui/core/rp/rp.rb +1 -1
  187. data/app/concepts/matestack/ui/core/rt/rt.haml +3 -3
  188. data/app/concepts/matestack/ui/core/rt/rt.rb +1 -1
  189. data/app/concepts/matestack/ui/core/ruby/ruby.haml +3 -3
  190. data/app/concepts/matestack/ui/core/ruby/ruby.rb +1 -1
  191. data/app/concepts/matestack/ui/core/s/s.haml +3 -3
  192. data/app/concepts/matestack/ui/core/s/s.rb +1 -1
  193. data/app/concepts/matestack/ui/core/samp/samp.haml +3 -3
  194. data/app/concepts/matestack/ui/core/samp/samp.rb +1 -0
  195. data/app/concepts/matestack/ui/core/section/section.haml +1 -1
  196. data/app/concepts/matestack/ui/core/section/section.rb +0 -1
  197. data/app/concepts/matestack/ui/core/slot/slot.rb +1 -2
  198. data/app/concepts/matestack/ui/core/small/small.haml +3 -3
  199. data/app/concepts/matestack/ui/core/small/small.rb +1 -1
  200. data/app/concepts/matestack/ui/core/span/span.haml +3 -3
  201. data/app/concepts/matestack/ui/core/span/span.rb +1 -1
  202. data/app/concepts/matestack/ui/core/strong/strong.haml +3 -3
  203. data/app/concepts/matestack/ui/core/strong/strong.rb +1 -1
  204. data/app/concepts/matestack/ui/core/sub/sub.haml +3 -3
  205. data/app/concepts/matestack/ui/core/sub/sub.rb +1 -1
  206. data/app/concepts/matestack/ui/core/summary/summary.haml +3 -3
  207. data/app/concepts/matestack/ui/core/summary/summary.rb +1 -1
  208. data/app/concepts/matestack/ui/core/sup/sup.haml +3 -3
  209. data/app/concepts/matestack/ui/core/sup/sup.rb +1 -1
  210. data/app/concepts/matestack/ui/core/table/table.haml +1 -1
  211. data/app/concepts/matestack/ui/core/table/table.rb +0 -1
  212. data/app/concepts/matestack/ui/core/tbody/tbody.haml +1 -1
  213. data/app/concepts/matestack/ui/core/tbody/tbody.rb +0 -1
  214. data/app/concepts/matestack/ui/core/td/td.haml +3 -3
  215. data/app/concepts/matestack/ui/core/td/td.rb +2 -1
  216. data/app/concepts/matestack/ui/core/template/template.haml +1 -1
  217. data/app/concepts/matestack/ui/core/textarea/textarea.haml +5 -0
  218. data/app/concepts/matestack/ui/core/textarea/textarea.rb +10 -0
  219. data/app/concepts/matestack/ui/core/tfoot/tfoot.haml +1 -1
  220. data/app/concepts/matestack/ui/core/tfoot/tfoot.rb +0 -1
  221. data/app/concepts/matestack/ui/core/th/th.haml +3 -3
  222. data/app/concepts/matestack/ui/core/th/th.rb +2 -1
  223. data/app/concepts/matestack/ui/core/thead/thead.haml +1 -1
  224. data/app/concepts/matestack/ui/core/thead/thead.rb +0 -1
  225. data/app/concepts/matestack/ui/core/time/time.haml +1 -1
  226. data/app/concepts/matestack/ui/core/time/time.rb +1 -7
  227. data/app/concepts/matestack/ui/core/toggle/toggle.haml +2 -0
  228. data/app/concepts/matestack/ui/core/toggle/toggle.js +71 -0
  229. data/app/concepts/matestack/ui/core/toggle/toggle.rb +13 -0
  230. data/app/concepts/matestack/ui/core/tr/tr.haml +1 -1
  231. data/app/concepts/matestack/ui/core/tr/tr.rb +0 -1
  232. data/app/concepts/matestack/ui/core/transition/transition.haml +3 -3
  233. data/app/concepts/matestack/ui/core/transition/transition.js +17 -1
  234. data/app/concepts/matestack/ui/core/transition/transition.rb +15 -8
  235. data/app/concepts/matestack/ui/core/u/u.haml +3 -3
  236. data/app/concepts/matestack/ui/core/u/u.rb +1 -1
  237. data/app/concepts/matestack/ui/core/ul/ul.haml +1 -1
  238. data/app/concepts/matestack/ui/core/ul/ul.rb +0 -1
  239. data/app/concepts/matestack/ui/core/unescaped/unescaped.rb +3 -1
  240. data/app/concepts/matestack/ui/core/var/var.haml +3 -3
  241. data/app/concepts/matestack/ui/core/var/var.rb +1 -0
  242. data/app/concepts/matestack/ui/core/video/video.haml +2 -2
  243. data/app/concepts/matestack/ui/core/video/video.rb +4 -14
  244. data/app/concepts/matestack/ui/core/view/view.haml +1 -0
  245. data/app/concepts/matestack/ui/core/view/view.rb +30 -0
  246. data/app/concepts/matestack/ui/core/wbr/wbr.haml +5 -1
  247. data/app/concepts/matestack/ui/core/wbr/wbr.rb +1 -0
  248. data/app/concepts/matestack/ui/core/youtube/youtube.haml +1 -1
  249. data/app/concepts/matestack/ui/core/youtube/youtube.rb +18 -16
  250. data/app/helpers/matestack/ui/core/application_helper.rb +94 -20
  251. data/app/lib/matestack/ui/component.rb +1 -0
  252. data/app/lib/matestack/ui/core/has_view_context.rb +4 -4
  253. data/app/lib/matestack/ui/core/html_attributes.rb +43 -0
  254. data/app/lib/matestack/ui/core/properties.rb +161 -0
  255. data/app/lib/matestack/ui/core/rendering/default_renderer_class_determiner.rb +33 -0
  256. data/app/lib/matestack/ui/core/rendering/main_renderer.rb +200 -0
  257. data/app/lib/matestack/ui/isolated_component.rb +1 -0
  258. data/app/lib/matestack/ui/vue_js_component.rb +1 -0
  259. data/lib/matestack/ui/core.rb +4 -2
  260. data/lib/matestack/ui/core/cell.rb +0 -2
  261. data/lib/matestack/ui/core/component/registry.rb +47 -0
  262. data/lib/matestack/ui/core/components.rb +269 -0
  263. data/lib/matestack/ui/core/dsl.rb +6 -0
  264. data/lib/matestack/ui/core/engine.rb +16 -0
  265. data/lib/matestack/ui/core/version.rb +1 -1
  266. data/vendor/assets/javascripts/dist/manifest.json +6 -10
  267. data/vendor/assets/javascripts/dist/matestack-ui-core.js +834 -261
  268. data/vendor/assets/javascripts/dist/matestack-ui-core.js.map +1 -1
  269. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js +1 -1
  270. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.br +0 -0
  271. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.gz +0 -0
  272. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.map +1 -1
  273. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.map.br +0 -0
  274. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.map.gz +0 -0
  275. metadata +50 -65
  276. data/MIT-LICENSE +0 -20
  277. data/app/concepts/matestack/ui/core/absolute/absolute.haml +0 -3
  278. data/app/concepts/matestack/ui/core/absolute/absolute.rb +0 -17
  279. data/app/concepts/matestack/ui/core/collection/filter/input/input.haml +0 -2
  280. data/app/concepts/matestack/ui/core/component/response.haml +0 -2
  281. data/app/concepts/matestack/ui/core/component/response_dynamic.haml +0 -7
  282. data/app/concepts/matestack/ui/core/component/response_dynamic_without_rerender.haml +0 -3
  283. data/app/concepts/matestack/ui/core/component/static.haml +0 -1
  284. data/app/concepts/matestack/ui/core/form/inline/inline.haml +0 -6
  285. data/app/concepts/matestack/ui/core/form/inline/inline.rb +0 -9
  286. data/app/concepts/matestack/ui/core/form/input/input.haml +0 -38
  287. data/app/concepts/matestack/ui/core/html/html.haml +0 -3
  288. data/app/concepts/matestack/ui/core/html/html.js +0 -10
  289. data/app/concepts/matestack/ui/core/html/html.rb +0 -17
  290. data/app/concepts/matestack/ui/core/isolate/isolate.haml +0 -2
  291. data/app/concepts/matestack/ui/core/isolate/isolate.rb +0 -11
  292. data/app/concepts/matestack/ui/core/page/content.haml +0 -7
  293. data/app/concepts/matestack/ui/core/page/content.rb +0 -5
  294. data/app/concepts/matestack/ui/core/pg/pg.haml +0 -5
  295. data/app/concepts/matestack/ui/core/pg/pg.rb +0 -5
  296. data/app/lib/matestack/ui/core/app_node.rb +0 -53
  297. data/app/lib/matestack/ui/core/component_node.rb +0 -87
  298. data/app/lib/matestack/ui/core/page_node.rb +0 -100
  299. data/app/lib/matestack/ui/core/render.rb +0 -89
  300. data/app/lib/matestack/ui/core/to_cell.rb +0 -129
@@ -0,0 +1,6 @@
1
+ module Matestack::Ui::Core
2
+ # Central DSL module, target of registry module definitions.
3
+ module DSL
4
+
5
+ end
6
+ end
@@ -10,8 +10,24 @@ module Matestack
10
10
  # end
11
11
  # Rails.configuration.autoload_paths << Dir.glob(File.join(Rails.root, 'config/matestack/**/*.rb'))
12
12
  # require_dependency "#{Rails.root}/config/matestack-ui-core"
13
+
14
+ components_path = "#{Rails.root}/app/matestack/register_components"
15
+ if File.exist?("#{components_path}.rb")
16
+ # the other dependencies need to be loaded otherwise require_dependency crashes silently
17
+ # we don't need to require_dependency them because they don't need reloading
18
+ # anyhow, they should probably be required somewhere else before this anyhow?
19
+ require 'matestack/ui/core/dsl'
20
+ require 'matestack/ui/core/component/registry'
21
+ require_dependency "#{Rails.root}/app/matestack/register_components"
22
+ end
13
23
  end
14
24
 
25
+ # config.to_prepare takes a block that should be run to set up
26
+ # your Railtie/Engine. It is run once in production mode and on
27
+ # every request in development, and is the only code guaranteed to
28
+ # be called on every single request in development mode.
29
+ # source: https://stackoverflow.com/a/5109348
30
+ # (couldn't find official docs)
15
31
  config.to_prepare &method(:activate).to_proc
16
32
  end
17
33
  end
@@ -1,7 +1,7 @@
1
1
  module Matestack
2
2
  module Ui
3
3
  module Core
4
- VERSION = '0.7.5'
4
+ VERSION = '1.1.0'
5
5
  end
6
6
  end
7
7
  end
@@ -2,21 +2,17 @@
2
2
  "entrypoints": {
3
3
  "matestack-ui-core": {
4
4
  "css": [
5
- "/dist/matestack-ui-core.css"
5
+ "/dist/matestack-ui-core.min.css"
6
6
  ],
7
7
  "js": [
8
- "/dist/matestack-ui-core.js"
9
- ],
10
- "css.map": [
11
- "/dist/matestack-ui-core.css.map"
8
+ "/dist/matestack-ui-core.min.js"
12
9
  ],
13
10
  "js.map": [
14
- "/dist/matestack-ui-core.js.map"
11
+ "/dist/matestack-ui-core.min.js.map"
15
12
  ]
16
13
  }
17
14
  },
18
- "matestack-ui-core.css": "/dist/matestack-ui-core.css",
19
- "matestack-ui-core.css.map": "/dist/matestack-ui-core.css.map",
20
- "matestack-ui-core.js": "/dist/matestack-ui-core.js",
21
- "matestack-ui-core.js.map": "/dist/matestack-ui-core.js.map"
15
+ "matestack-ui-core.css": "/dist/matestack-ui-core.min.css",
16
+ "matestack-ui-core.js": "/dist/matestack-ui-core.min.js",
17
+ "matestack-ui-core.js.map": "/dist/matestack-ui-core.min.js.map"
22
18
  }
@@ -120,51 +120,132 @@ const componentDef = {
120
120
  (self.componentConfig["confirm"] == undefined) || confirm(self.componentConfig["confirm_text"])
121
121
  )
122
122
  {
123
- axios__WEBPACK_IMPORTED_MODULE_2___default()({
123
+ if (self.componentConfig["emit"] != undefined) {
124
+ _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$emit(self.componentConfig["emit"]);
125
+ }
126
+ if (self.componentConfig["delay"] != undefined) {
127
+ setTimeout(function () {
128
+ self.sendRequest()
129
+ }, parseInt(self.componentConfig["delay"]));
130
+ } else {
131
+ this.sendRequest()
132
+ }
133
+ }
134
+ },
135
+ sendRequest: function(){
136
+ const self = this
137
+ axios__WEBPACK_IMPORTED_MODULE_2___default()({
124
138
  method: self.componentConfig["method"],
125
139
  url: self.componentConfig["action_path"],
126
140
  data: self.componentConfig["data"],
127
141
  headers: {
128
142
  'X-CSRF-Token': document.getElementsByName("csrf-token")[0].getAttribute('content')
129
143
  }
130
- })
131
- .then(function(response){
132
- if (self.componentConfig["success"] != undefined && self.componentConfig["success"]["emit"] != undefined) {
133
- _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$emit(self.componentConfig["success"]["emit"], response.data);
134
- }
135
- if (self.componentConfig["success"] != undefined
136
- && self.componentConfig["success"]["transition"] != undefined
137
- && (
138
- self.componentConfig["success"]["transition"]["follow_response"] == undefined
139
- ||
140
- self.componentConfig["success"]["transition"]["follow_response"] === false
141
- )
142
- && self.$store != undefined
143
- ) {
144
- let path = self.componentConfig["success"]["transition"]["path"]
145
- self.$store.dispatch('navigateTo', {url: path, backwards: false})
146
- return;
147
- }
148
- if (self.componentConfig["success"] != undefined
149
- && self.componentConfig["success"]["transition"] != undefined
150
- && self.componentConfig["success"]["transition"]["follow_response"] === true
151
- && self.$store != undefined
152
- ) {
153
- let path = response.data["transition_to"] || response.request.responseURL;
154
- self.$store.dispatch('navigateTo', {url: path, backwards: false});
155
- return;
156
- }
157
- })
158
- .catch(function(error){
159
- if (self.componentConfig["failure"] != undefined && self.componentConfig["failure"]["emit"] != undefined) {
160
- _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$emit(self.componentConfig["failure"]["emit"], error.response.data);
161
- }
162
- if (self.componentConfig["failure"] != undefined && self.componentConfig["failure"]["transition"] != undefined && self.$store != undefined) {
163
- let path = self.componentConfig["failure"]["transition"]["path"]
164
- self.$store.dispatch('navigateTo', {url: path, backwards: false})
165
- }
166
- })
167
- }
144
+ }
145
+ )
146
+ .then(function(response){
147
+ if (self.componentConfig["success"] != undefined && self.componentConfig["success"]["emit"] != undefined) {
148
+ _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$emit(self.componentConfig["success"]["emit"], response.data);
149
+ }
150
+
151
+ // transition handling
152
+ if (self.componentConfig["success"] != undefined
153
+ && self.componentConfig["success"]["transition"] != undefined
154
+ && (
155
+ self.componentConfig["success"]["transition"]["follow_response"] == undefined
156
+ ||
157
+ self.componentConfig["success"]["transition"]["follow_response"] === false
158
+ )
159
+ && self.$store != undefined
160
+ ) {
161
+ let path = self.componentConfig["success"]["transition"]["path"]
162
+ self.$store.dispatch('navigateTo', {url: path, backwards: false})
163
+ return;
164
+ }
165
+ if (self.componentConfig["success"] != undefined
166
+ && self.componentConfig["success"]["transition"] != undefined
167
+ && self.componentConfig["success"]["transition"]["follow_response"] === true
168
+ && self.$store != undefined
169
+ ) {
170
+ let path = response.data["transition_to"] || response.request.responseURL
171
+ self.$store.dispatch('navigateTo', {url: path, backwards: false})
172
+ return;
173
+ }
174
+ // redirect handling
175
+ if (self.componentConfig["success"] != undefined
176
+ && self.componentConfig["success"]["redirect"] != undefined
177
+ && (
178
+ self.componentConfig["success"]["redirect"]["follow_response"] == undefined
179
+ ||
180
+ self.componentConfig["success"]["redirect"]["follow_response"] === false
181
+ )
182
+ && self.$store != undefined
183
+ ) {
184
+ let path = self.componentConfig["success"]["redirect"]["path"]
185
+ window.location.href = path
186
+ return;
187
+ }
188
+ if (self.componentConfig["success"] != undefined
189
+ && self.componentConfig["success"]["redirect"] != undefined
190
+ && self.componentConfig["success"]["redirect"]["follow_response"] === true
191
+ && self.$store != undefined
192
+ ) {
193
+ let path = response.data["redirect_to"] || response.request.responseURL
194
+ window.location.href = path
195
+ return;
196
+ }
197
+ })
198
+ .catch(function(error){
199
+ if (self.componentConfig["failure"] != undefined && self.componentConfig["failure"]["emit"] != undefined) {
200
+ _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$emit(self.componentConfig["failure"]["emit"], error.response.data);
201
+ }
202
+ // transition handling
203
+ if (self.componentConfig["failure"] != undefined
204
+ && self.componentConfig["failure"]["transition"] != undefined
205
+ && (
206
+ self.componentConfig["failure"]["transition"]["follow_response"] == undefined
207
+ ||
208
+ self.componentConfig["failure"]["transition"]["follow_response"] === false
209
+ )
210
+ && self.$store != undefined
211
+ ) {
212
+ let path = self.componentConfig["failure"]["transition"]["path"]
213
+ self.$store.dispatch('navigateTo', {url: path, backwards: false})
214
+ return;
215
+ }
216
+ if (self.componentConfig["failure"] != undefined
217
+ && self.componentConfig["failure"]["transition"] != undefined
218
+ && self.componentConfig["failure"]["transition"]["follow_response"] === true
219
+ && self.$store != undefined
220
+ ) {
221
+ let path = error.response.data["transition_to"] || response.request.responseURL
222
+ self.$store.dispatch('navigateTo', {url: path, backwards: false})
223
+ return;
224
+ }
225
+ // redirect handling
226
+ if (self.componentConfig["failure"] != undefined
227
+ && self.componentConfig["failure"]["redirect"] != undefined
228
+ && (
229
+ self.componentConfig["failure"]["redirect"]["follow_response"] == undefined
230
+ ||
231
+ self.componentConfig["failure"]["redirect"]["follow_response"] === false
232
+ )
233
+ && self.$store != undefined
234
+ ) {
235
+ let path = self.componentConfig["failure"]["redirect"]["path"]
236
+ window.location.href = path
237
+ return;
238
+ }
239
+ if (self.componentConfig["failure"] != undefined
240
+ && self.componentConfig["failure"]["redirect"] != undefined
241
+ && self.componentConfig["failure"]["redirect"]["follow_response"] === true
242
+ && self.$store != undefined
243
+ ) {
244
+ let path = error.response.data["redirect_to"] || response.request.responseURL
245
+ window.location.href = path
246
+ return;
247
+ }
248
+ })
168
249
  }
169
250
  }
170
251
  }
@@ -189,6 +270,8 @@ __webpack_require__.r(__webpack_exports__);
189
270
  /* harmony import */ var v_runtime_template__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! v-runtime-template */ "../node_modules/v-runtime-template/dist/v-runtime-template.es.js");
190
271
  /* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vuex */ "../node_modules/vuex/dist/vuex.esm.js");
191
272
  /* harmony import */ var _location__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./location */ "../app/concepts/matestack/ui/core/app/location.js");
273
+ /* harmony import */ var _js_event_hub__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../js/event-hub */ "../app/concepts/matestack/ui/core/js/event-hub.js");
274
+
192
275
 
193
276
 
194
277
 
@@ -207,15 +290,17 @@ const componentDef = {
207
290
  }),
208
291
  mounted: function(){
209
292
  const self = this;
210
- window.onpopstate = (event) => {
293
+ window.addEventListener("popstate", (event) => {
211
294
  if (Object(_location__WEBPACK_IMPORTED_MODULE_3__["default"])({
212
295
  origin: self.currentOrigin,
213
296
  pathName: self.currentPathName,
214
297
  search: self.currentSearch
215
298
  }, document.location)){
216
- self.$store.dispatch("navigateTo", {url: document.location.pathname, backwards: true} );
299
+ _js_event_hub__WEBPACK_IMPORTED_MODULE_4__["default"].$emit("page_loading_triggered", document.location.pathname + document.location.search);
300
+ this.$store.commit('setPageLoading', true);
301
+ self.$store.dispatch("navigateTo", { url: document.location.pathname + document.location.search, backwards: true } );
217
302
  }
218
- }
303
+ })
219
304
  },
220
305
  components: {
221
306
  VRuntimeTemplate: v_runtime_template__WEBPACK_IMPORTED_MODULE_1__["default"]
@@ -277,6 +362,7 @@ vue_dist_vue_esm__WEBPACK_IMPORTED_MODULE_0__["default"].use(vuex__WEBPACK_IMPOR
277
362
  const store = new vuex__WEBPACK_IMPORTED_MODULE_1__["default"].Store({
278
363
  state: {
279
364
  pageTemplate: null,
365
+ pageLoading: false,
280
366
  currentPathName: document.location.pathname,
281
367
  currentSearch: document.location.search,
282
368
  currentOrigin: document.location.origin
@@ -285,6 +371,9 @@ const store = new vuex__WEBPACK_IMPORTED_MODULE_1__["default"].Store({
285
371
  setPageTemplate (state, serverResponse){
286
372
  state.pageTemplate = serverResponse
287
373
  },
374
+ setPageLoading (state, boolean){
375
+ state.pageLoading = boolean
376
+ },
288
377
  setCurrentLocation (state, current){
289
378
  state.currentPathName = current.path
290
379
  state.currentSearch = current.search
@@ -292,10 +381,30 @@ const store = new vuex__WEBPACK_IMPORTED_MODULE_1__["default"].Store({
292
381
  },
293
382
  resetPageTemplate (state) {
294
383
  state.pageTemplate = null;
384
+ },
385
+ pageScrollTop (state) {
386
+ //https://stackoverflow.com/a/35940276/13886137
387
+ const getScrollParent = function(node) {
388
+ if (node == null) {
389
+ return null
390
+ }
391
+ if (node.scrollHeight > node.clientHeight) {
392
+ return node
393
+ } else {
394
+ return getScrollParent(node.parentNode)
395
+ }
396
+ }
397
+ var scrollParent = getScrollParent(document.getElementsByClassName("matestack-page-root")[0])
398
+ if(scrollParent){
399
+ scrollParent.scrollTop = 0;
400
+ }
401
+ // getScrollParent(document.getElementsByClassName("matestack-page-root")[0]).scrollTop = 0
295
402
  }
296
403
  },
297
404
  actions: {
298
405
  navigateTo ({ commit, state }, { url, backwards }) {
406
+ const self = this
407
+ commit('setPageLoading', true)
299
408
  _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$emit("page_loading", url);
300
409
  if (typeof matestackUiCoreTransitionStart !== 'undefined') {
301
410
  matestackUiCoreTransitionStart(url);
@@ -320,9 +429,11 @@ const store = new vuex__WEBPACK_IMPORTED_MODULE_1__["default"].Store({
320
429
  window.history.pushState({matestackApp: true, url: url}, null, url);
321
430
  }
322
431
  setTimeout(function () {
323
- resolve(response["data"])
432
+ resolve(response["data"]);
324
433
  commit('setPageTemplate', response["data"])
325
- commit('setCurrentLocation', { path: url, search: document.location.search, origin: document.location.origin })
434
+ commit('setCurrentLocation', { path: url.split("?")[0], search: document.location.search, origin: document.location.origin })
435
+ commit('setPageLoading', false)
436
+ commit('pageScrollTop')
326
437
  _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$emit("page_loaded", url);
327
438
  if (typeof matestackUiCoreTransitionSuccess !== 'undefined') {
328
439
  matestackUiCoreTransitionSuccess(url);
@@ -358,18 +469,25 @@ const store = new vuex__WEBPACK_IMPORTED_MODULE_1__["default"].Store({
358
469
  "use strict";
359
470
  __webpack_require__.r(__webpack_exports__);
360
471
  /* harmony import */ var vue_dist_vue_esm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue/dist/vue.esm */ "../node_modules/vue/dist/vue.esm.js");
361
- /* harmony import */ var _js_event_hub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../js/event-hub */ "../app/concepts/matestack/ui/core/js/event-hub.js");
362
- /* harmony import */ var _component_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../component/component */ "../app/concepts/matestack/ui/core/component/component.js");
472
+ /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ "../node_modules/axios/index.js");
473
+ /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_1__);
474
+ /* harmony import */ var v_runtime_template__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! v-runtime-template */ "../node_modules/v-runtime-template/dist/v-runtime-template.es.js");
475
+ /* harmony import */ var _js_event_hub__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../js/event-hub */ "../app/concepts/matestack/ui/core/js/event-hub.js");
476
+ /* harmony import */ var _component_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../component/component */ "../app/concepts/matestack/ui/core/component/component.js");
477
+
478
+
363
479
 
364
480
 
365
481
 
366
482
 
367
483
  const componentDef = {
368
- mixins: [_component_component__WEBPACK_IMPORTED_MODULE_2__["default"]],
484
+ mixins: [_component_component__WEBPACK_IMPORTED_MODULE_4__["default"]],
369
485
  data: function(){
370
486
  return {
487
+ asyncTemplate: null,
371
488
  showing: true,
372
- hide_after_timeout: null,
489
+ loading: false,
490
+ hideAfterTimeout: null,
373
491
  event: {
374
492
  data: {}
375
493
  }
@@ -389,7 +507,7 @@ const componentDef = {
389
507
  }
390
508
  }
391
509
  if(this.componentConfig["hide_after"] != undefined){
392
- self.hide_after_timeout = setTimeout(function () {
510
+ self.hideAfterTimeout = setTimeout(function () {
393
511
  self.hide()
394
512
  }, parseInt(this.componentConfig["hide_after"]));
395
513
  }
@@ -400,16 +518,43 @@ const componentDef = {
400
518
  },
401
519
  startDefer: function(){
402
520
  const self = this
521
+ self.loading = true;
403
522
  setTimeout(function () {
404
523
  self.rerender()
405
524
  }, parseInt(this.componentConfig["defer"]));
525
+ },
526
+ rerender: function(){
527
+ var self = this;
528
+ self.loading = true;
529
+ axios__WEBPACK_IMPORTED_MODULE_1___default()({
530
+ method: "get",
531
+ url: location.pathname + location.search,
532
+ headers: {
533
+ 'X-CSRF-Token': document.getElementsByName("csrf-token")[0].getAttribute('content')
534
+ },
535
+ params: {
536
+ "component_key": self.componentConfig["component_key"],
537
+ "component_class": self.componentConfig["parent_class"]
538
+ }
539
+ })
540
+ .then(function(response){
541
+ var tmp_dom_element = document.createElement('div');
542
+ tmp_dom_element.innerHTML = response['data'];
543
+ var template = tmp_dom_element.querySelector('#' + self.componentConfig["component_key"]).outerHTML;
544
+ self.loading = false;
545
+ self.asyncTemplate = template;
546
+ })
547
+ .catch(function(error){
548
+ console.log(error)
549
+ _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$emit('async_rerender_error', { id: self.componentConfig["component_key"] })
550
+ })
406
551
  }
407
552
  },
408
553
  created: function () {
409
554
  const self = this
410
- _js_event_hub__WEBPACK_IMPORTED_MODULE_1__["default"].$on(this.componentConfig["rerender_on"], self.rerender)
411
- _js_event_hub__WEBPACK_IMPORTED_MODULE_1__["default"].$on(this.componentConfig["show_on"], self.show)
412
- _js_event_hub__WEBPACK_IMPORTED_MODULE_1__["default"].$on(this.componentConfig["hide_on"], self.hide)
555
+ self.registerEvents(this.componentConfig['show_on'], self.show)
556
+ self.registerEvents(this.componentConfig['hide_on'], self.hide)
557
+ self.registerEvents(this.componentConfig['rerender_on'], self.rerender)
413
558
  if(this.componentConfig["show_on"] != undefined){
414
559
  this.showing = false
415
560
  }
@@ -426,11 +571,14 @@ const componentDef = {
426
571
  },
427
572
  beforeDestroy: function() {
428
573
  const self = this
429
- clearTimeout(self.hide_after_timeout)
430
- _js_event_hub__WEBPACK_IMPORTED_MODULE_1__["default"].$off(this.componentConfig["rerender_on"], self.rerender);
431
- _js_event_hub__WEBPACK_IMPORTED_MODULE_1__["default"].$off(this.componentConfig["show_on"], self.show);
432
- _js_event_hub__WEBPACK_IMPORTED_MODULE_1__["default"].$off(this.componentConfig["hide_on"], self.hide);
574
+ clearTimeout(self.hideAfterTimeout)
575
+ self.removeEvents(this.componentConfig["show_on"], self.show)
576
+ self.removeEvents(this.componentConfig["hide_on"], self.hide)
577
+ self.removeEvents(this.componentConfig["rerender_on"], self.rerender)
433
578
  },
579
+ components: {
580
+ VRuntimeTemplate: v_runtime_template__WEBPACK_IMPORTED_MODULE_2__["default"]
581
+ }
434
582
  }
435
583
 
436
584
  let component = vue_dist_vue_esm__WEBPACK_IMPORTED_MODULE_0__["default"].component('matestack-ui-core-async', componentDef)
@@ -438,6 +586,123 @@ let component = vue_dist_vue_esm__WEBPACK_IMPORTED_MODULE_0__["default"].compone
438
586
  /* harmony default export */ __webpack_exports__["default"] = (componentDef);
439
587
 
440
588
 
589
+ /***/ }),
590
+
591
+ /***/ "../app/concepts/matestack/ui/core/cable/cable.js":
592
+ /*!********************************************************!*\
593
+ !*** ../app/concepts/matestack/ui/core/cable/cable.js ***!
594
+ \********************************************************/
595
+ /*! exports provided: default */
596
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
597
+
598
+ "use strict";
599
+ __webpack_require__.r(__webpack_exports__);
600
+ /* harmony import */ var vue_dist_vue_esm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue/dist/vue.esm */ "../node_modules/vue/dist/vue.esm.js");
601
+ /* harmony import */ var v_runtime_template__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! v-runtime-template */ "../node_modules/v-runtime-template/dist/v-runtime-template.es.js");
602
+ /* harmony import */ var _js_event_hub__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../js/event-hub */ "../app/concepts/matestack/ui/core/js/event-hub.js");
603
+ /* harmony import */ var _component_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../component/component */ "../app/concepts/matestack/ui/core/component/component.js");
604
+
605
+
606
+
607
+
608
+
609
+ const componentDef = {
610
+ mixins: [_component_component__WEBPACK_IMPORTED_MODULE_3__["default"]],
611
+ props: {
612
+ initialTemplate: String,
613
+ },
614
+ data: function(){
615
+ return {
616
+ cableTemplate: null,
617
+ cableTemplateDomElement: null,
618
+ loading: false,
619
+ event: {
620
+ data: {}
621
+ }
622
+ }
623
+ },
624
+ methods: {
625
+ append: function(payload){
626
+ var html = this.formatPayload(payload)
627
+ this.cableTemplateDomElement.insertAdjacentHTML(
628
+ 'beforeend',
629
+ html.join('')
630
+ )
631
+ this.updateCableTemplate()
632
+ },
633
+ prepend: function(payload){
634
+ var html = this.formatPayload(payload)
635
+ this.cableTemplateDomElement.insertAdjacentHTML(
636
+ 'afterbegin',
637
+ html.join('')
638
+ )
639
+ this.updateCableTemplate()
640
+ },
641
+ delete: function(payload){
642
+ var ids = this.formatPayload(payload)
643
+ ids.forEach(id =>
644
+ this.cableTemplateDomElement.querySelector('#' + id).remove()
645
+ )
646
+ this.updateCableTemplate()
647
+ },
648
+ update: function(payload){
649
+ const self = this
650
+ var html = this.formatPayload(payload)
651
+ html.forEach(function(elem){
652
+ var dom_elem = document.createElement('div')
653
+ dom_elem.innerHTML = elem
654
+ var id = dom_elem.firstChild.id
655
+ var old_elem = self.cableTemplateDomElement.querySelector('#' + id)
656
+ old_elem.parentNode.replaceChild(dom_elem.firstChild, old_elem)
657
+ })
658
+ this.updateCableTemplate()
659
+ },
660
+ replace: function(payload){
661
+ var html = this.formatPayload(payload)
662
+ this.cableTemplateDomElement.innerHTML = html.join('')
663
+ this.updateCableTemplate()
664
+ },
665
+ updateCableTemplate: function(){
666
+ this.cableTemplate = this.cableTemplateDomElement.outerHTML
667
+ },
668
+ formatPayload: function(payload){
669
+ if(!Array.isArray(payload.data)){
670
+ return [payload.data]
671
+ }
672
+ return payload.data
673
+ },
674
+ },
675
+ mounted: function() {
676
+ const self = this
677
+ var dom_elem = document.createElement('div')
678
+ dom_elem.innerHTML = this.initialTemplate
679
+ this.cableTemplateDomElement = dom_elem.querySelector("#" + this.componentConfig["id"])
680
+ this.cableTemplate = this.cableTemplateDomElement.outerHTML
681
+ this.registerEvents(this.componentConfig['append_on'], self.append)
682
+ this.registerEvents(this.componentConfig['prepend_on'], self.prepend)
683
+ this.registerEvents(this.componentConfig['delete_on'], self.delete)
684
+ this.registerEvents(this.componentConfig['update_on'], self.update)
685
+ this.registerEvents(this.componentConfig['replace_on'], self.replace)
686
+ },
687
+ beforeDestroy: function() {
688
+ const self = this
689
+ this.cableTemplate = null
690
+ this.removeEvents(this.componentConfig['append_on'], self.append)
691
+ this.removeEvents(this.componentConfig['prepend_on'], self.prepend)
692
+ this.removeEvents(this.componentConfig['delete_on'], self.delete)
693
+ this.removeEvents(this.componentConfig['update_on'], self.update)
694
+ this.removeEvents(this.componentConfig['replace_on'], self.replace)
695
+ },
696
+ components: {
697
+ VRuntimeTemplate: v_runtime_template__WEBPACK_IMPORTED_MODULE_1__["default"]
698
+ }
699
+ }
700
+
701
+ let component = vue_dist_vue_esm__WEBPACK_IMPORTED_MODULE_0__["default"].component('matestack-ui-core-cable', componentDef)
702
+
703
+ /* harmony default export */ __webpack_exports__["default"] = (componentDef);
704
+
705
+
441
706
  /***/ }),
442
707
 
443
708
  /***/ "../app/concepts/matestack/ui/core/collection/content/content.js":
@@ -453,15 +718,14 @@ __webpack_require__.r(__webpack_exports__);
453
718
  /* harmony import */ var _js_event_hub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../js/event-hub */ "../app/concepts/matestack/ui/core/js/event-hub.js");
454
719
  /* harmony import */ var _js_helpers_query_params_helper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../js/helpers/query-params-helper */ "../app/concepts/matestack/ui/core/js/helpers/query-params-helper.js");
455
720
  /* harmony import */ var _component_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../component/component */ "../app/concepts/matestack/ui/core/component/component.js");
456
- /* harmony import */ var _async_async__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../async/async */ "../app/concepts/matestack/ui/core/async/async.js");
457
-
458
721
 
459
722
 
460
723
 
461
724
 
725
+ // import asyncMixin from '../../async/async'
462
726
 
463
727
  const componentDef = {
464
- mixins: [_component_component__WEBPACK_IMPORTED_MODULE_3__["default"], _async_async__WEBPACK_IMPORTED_MODULE_4__["default"]],
728
+ mixins: [_component_component__WEBPACK_IMPORTED_MODULE_3__["default"]],
465
729
  data: function(){
466
730
  return {
467
731
  currentLimit: null,
@@ -652,7 +916,7 @@ const componentDef = {
652
916
  this.ordering[key] = "asc"
653
917
  } else if (this.ordering[key] == "asc") {
654
918
  this.ordering[key] = "desc"
655
- } else if (this.ordering[key] = "desc") {
919
+ } else if (this.ordering[key] == "desc") {
656
920
  this.ordering[key] = undefined
657
921
  }
658
922
  var url;
@@ -728,67 +992,26 @@ let component = vue_dist_vue_esm__WEBPACK_IMPORTED_MODULE_0__["default"].compone
728
992
 
729
993
  "use strict";
730
994
  __webpack_require__.r(__webpack_exports__);
731
- /* harmony import */ var vue_dist_vue_esm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue/dist/vue.esm */ "../node_modules/vue/dist/vue.esm.js");
732
- /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ "../node_modules/axios/index.js");
733
- /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_1__);
734
- /* harmony import */ var v_runtime_template__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! v-runtime-template */ "../node_modules/v-runtime-template/dist/v-runtime-template.es.js");
735
- /* harmony import */ var _js_event_hub__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../js/event-hub */ "../app/concepts/matestack/ui/core/js/event-hub.js");
736
-
737
-
738
-
995
+ /* harmony import */ var _js_event_hub__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../js/event-hub */ "../app/concepts/matestack/ui/core/js/event-hub.js");
739
996
 
740
997
 
741
998
  const componentMixin = {
742
999
  props: ['componentConfig', 'params'],
743
- data: function(){
744
- return {
745
- asyncTemplate: null
746
- }
747
- },
748
1000
  methods: {
749
- onRerender: function(event){
750
- if (this.$el.id === event+"__wrapper"){
751
- this.rerender()
1001
+ registerEvents: function(events, callback){
1002
+ if(events != undefined){
1003
+ var event_names = events.split(",")
1004
+ event_names.forEach(event_name => _js_event_hub__WEBPACK_IMPORTED_MODULE_0__["default"].$on(event_name.trim(), callback));
752
1005
  }
753
1006
  },
754
- onMatestackUiCoreChannel: function(event){
755
- if (this.componentConfig["rerender_on"] == event.message){
756
- this.rerender()
1007
+ removeEvents: function(events, callback){
1008
+ if(events != undefined){
1009
+ var event_names = events.split(",")
1010
+ event_names.forEach(event_name => _js_event_hub__WEBPACK_IMPORTED_MODULE_0__["default"].$off(event_name.trim(), callback));
757
1011
  }
758
- },
759
- rerender: function(){
760
- var self = this;
761
- self.params["component_key"] = self.componentConfig["component_key"]
762
- axios__WEBPACK_IMPORTED_MODULE_1___default()({
763
- method: "get",
764
- url: location.pathname + location.search,
765
- headers: {
766
- 'X-CSRF-Token': document.getElementsByName("csrf-token")[0].getAttribute('content')
767
- },
768
- params: {"component_key": self.componentConfig["component_key"]}
769
- })
770
- .then(function(response){
771
- self.asyncTemplate = response["data"];
772
- })
773
- },
774
- rerenderWith: function(newParams){
775
- Object.assign(this.params, newParams);
776
- this.rerender()
777
1012
  }
778
- },
779
- created: function () {
780
- const self = this
781
- _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$on('rerender', self.onRerender)
782
- _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$on('MatestackUiCoreChannel', self.onMatestackUiCoreChannel)
783
- },
784
- beforeDestroy: function() {
785
- const self = this
786
- _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$off('rerender', self.onRerender);
787
- _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$off('MatestackUiCoreChannel', self.onMatestackUiCoreChannel)
788
- },
789
- components: {
790
- VRuntimeTemplate: v_runtime_template__WEBPACK_IMPORTED_MODULE_2__["default"]
791
1013
  }
1014
+
792
1015
  }
793
1016
 
794
1017
  /* harmony default export */ __webpack_exports__["default"] = (componentMixin);
@@ -820,194 +1043,429 @@ __webpack_require__.r(__webpack_exports__);
820
1043
 
821
1044
  const componentDef = {
822
1045
  mixins: [_component_component__WEBPACK_IMPORTED_MODULE_4__["default"]],
823
- data: function(){
1046
+ data: function () {
824
1047
  return {
825
1048
  data: {},
826
- showInlineForm: false,
827
- errors: {}
828
- }
1049
+ errors: {},
1050
+ loading: false
1051
+ };
829
1052
  },
830
1053
  methods: {
831
- initDataKey: function(key, initValue){
1054
+ initDataKey: function (key, initValue) {
832
1055
  this.data[key] = initValue;
833
1056
  },
834
- inputChanged: function(key){
835
- this.resetErrors(key)
1057
+ inputChanged: function (key) {
1058
+ this.resetErrors(key);
836
1059
  },
837
- updateFormValue: function(key, value){
1060
+ updateFormValue: function (key, value) {
838
1061
  this.data[key] = value;
839
1062
  },
840
- resetErrors: function(key){
841
- if (this.errors[key]){
842
- this.errors[key] = null;
1063
+ hasErrors: function(){
1064
+ //https://stackoverflow.com/a/27709663/13886137
1065
+ for (var key in this.errors) {
1066
+ if (this.errors[key] !== null && this.errors[key] != ""){
1067
+ return true;
1068
+ }
843
1069
  }
1070
+ return false;
844
1071
  },
845
- launchInlineForm: function(key, value){
846
- this.showInlineForm = true;
847
- this.data[key] = value;
848
- const self = this;
849
- setTimeout(function () {
850
- self.$refs.inlineinput.focus();
851
- }, 300);
1072
+ resetErrors: function (key) {
1073
+ if (this.errors[key]) {
1074
+ this.errors[key] = null;
1075
+ }
852
1076
  },
853
- closeInlineForm: function(){
854
- this.showInlineForm = false;
1077
+ setProps: function (flat, newVal) {
1078
+ for (var i in flat) {
1079
+ if (flat[i] === null){
1080
+ flat[i] = newVal;
1081
+ } else if (flat[i] instanceof File){
1082
+ flat[i] = newVal;
1083
+ this.$refs["input."+i].value = newVal
1084
+ } else if (flat[i] instanceof Array) {
1085
+ if(flat[i][0] instanceof File){
1086
+ flat[i] = newVal
1087
+ this.$refs["input."+i].value = newVal
1088
+ }
1089
+ } else if (typeof flat[i] === "object" && !(flat[i] instanceof Array)) {
1090
+ setProps(flat[i], newVal);
1091
+ } else {
1092
+ flat[i] = newVal;
1093
+ }
1094
+ }
855
1095
  },
856
- setProps: function(flat, newVal){
857
- for(var i in flat){
858
- if((typeof flat[i] === "object") && !(flat[i] instanceof Array)){
859
- setProps(flat[i], newVal);
860
- return;
861
- } else {
862
- flat[i] = newVal;
863
- }
1096
+ filesAdded: function (key) {
1097
+ const dataTransfer = event.dataTransfer || event.target;
1098
+ const files = dataTransfer.files;
1099
+ if (event.target.attributes.multiple) {
1100
+ this.data[key] = [];
1101
+ for (let index in files) {
1102
+ if (files[index] instanceof File) {
1103
+ this.data[key].push(files[index]);
1104
+ }
1105
+ }
1106
+ } else {
1107
+ this.data[key] = files[0];
864
1108
  }
865
1109
  },
866
- initValues: function(){
1110
+ initValues: function () {
867
1111
  let self = this;
868
- let data = {}
1112
+ let data = {};
869
1113
  for (let key in self.$refs) {
870
- let initValue = self.$refs[key]["attributes"]["init-value"]
871
- let valueType = self.$refs[key]["attributes"]["value-type"]
872
-
873
- if (key.startsWith("input.")){
874
- if(initValue){
875
- data[key.replace('input.', '')] = initValue["value"]
876
- }else{
877
- data[key.replace('input.', '')] = null
1114
+ let initValue = self.$refs[key]["attributes"]["init-value"];
1115
+ let valueType = self.$refs[key]["attributes"]["value-type"];
1116
+
1117
+ if (key.startsWith("input.")) {
1118
+ if (initValue) {
1119
+ data[key.replace("input.", "")] = initValue["value"];
1120
+ } else {
1121
+ data[key.replace("input.", "")] = null;
878
1122
  }
879
1123
  }
880
- if (key.startsWith("select.")){
881
- if (key.startsWith("select.multiple.")){
882
- if(initValue){
883
- data[key.replace('select.multiple.', '')] = JSON.parse(initValue["value"])
884
- }else{
885
- data[key.replace('select.multiple.', '')] = []
1124
+ if (key.startsWith("select.")) {
1125
+ if (key.startsWith("select.multiple.")) {
1126
+ if (initValue) {
1127
+ data[key.replace("select.multiple.", "")] = JSON.parse(initValue["value"]);
1128
+ } else {
1129
+ data[key.replace("select.multiple.", "")] = [];
886
1130
  }
887
- }else{
888
- if(initValue){
889
- if(valueType && valueType["value"] == "Integer")
890
- data[key.replace('select.', '')] = parseInt(initValue["value"])
891
- else{
892
- data[key.replace('select.', '')] = initValue["value"]
1131
+ } else {
1132
+ if (initValue) {
1133
+ if (valueType && valueType["value"] == "Integer") data[key.replace("select.", "")] = parseInt(initValue["value"]);
1134
+ else {
1135
+ data[key.replace("select.", "")] = initValue["value"];
893
1136
  }
894
- }else{
895
- data[key.replace('select.', '')] = null
1137
+ } else {
1138
+ data[key.replace("select.", "")] = null;
896
1139
  }
897
1140
  }
898
-
899
1141
  }
900
1142
  }
901
1143
  self.data = data;
902
1144
  },
903
1145
  shouldResetFormOnSuccessfulSubmit() {
904
- const self = this
905
- if (self.componentConfig['success'] != undefined && self.componentConfig['success']['reset'] != undefined) {
906
- return self.componentConfig['success']['reset']
1146
+ const self = this;
1147
+ if (self.componentConfig["success"] != undefined && self.componentConfig["success"]["reset"] != undefined) {
1148
+ return self.componentConfig["success"]["reset"];
907
1149
  } else {
908
- return self.shouldResetFormOnSuccessfulSubmitByDefault()
1150
+ return self.shouldResetFormOnSuccessfulSubmitByDefault();
909
1151
  }
910
1152
  },
911
1153
  shouldResetFormOnSuccessfulSubmitByDefault() {
912
- const self = this
1154
+ const self = this;
913
1155
  if (self.componentConfig["method"] == "put") {
914
- return false
1156
+ return false;
915
1157
  } else {
916
- return true
1158
+ return true;
917
1159
  }
918
1160
  },
919
1161
  perform: function(){
920
1162
  const self = this
921
- let payload = {}
922
- payload[self.componentConfig["for"]] = self.data
923
- axios__WEBPACK_IMPORTED_MODULE_2___default()({
924
- method: self.componentConfig["method"],
925
- url: self.componentConfig["submit_path"],
926
- data: payload,
927
- headers: {
928
- 'X-CSRF-Token': document.getElementsByName("csrf-token")[0].getAttribute('content')
929
- }
930
- })
931
- .then(function(response){
932
- if (self.componentConfig["success"] != undefined && self.componentConfig["success"]["emit"] != undefined) {
933
- _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$emit(self.componentConfig["success"]["emit"], response.data);
934
- }
935
- if (self.componentConfig["success"] != undefined
936
- && self.componentConfig["success"]["transition"] != undefined
937
- && (
938
- self.componentConfig["success"]["transition"]["follow_response"] == undefined
939
- ||
940
- self.componentConfig["success"]["transition"]["follow_response"] === false
941
- )
942
- && self.$store != undefined
943
- ) {
944
- let path = self.componentConfig["success"]["transition"]["path"]
945
- self.$store.dispatch('navigateTo', {url: path, backwards: false})
946
- return;
947
- }
948
- if (self.componentConfig["success"] != undefined
949
- && self.componentConfig["success"]["transition"] != undefined
950
- && self.componentConfig["success"]["transition"]["follow_response"] === true
951
- && self.$store != undefined
952
- ) {
953
- let path = response.data["transition_to"] || response.request.responseURL
954
- self.$store.dispatch('navigateTo', {url: path, backwards: false})
955
- return;
1163
+ var form = self.$el.tagName == 'FORM' ? self.$el : self.$el.querySelector('form');
1164
+ if(form.checkValidity()){
1165
+ self.loading = true;
1166
+ if (self.componentConfig["emit"] != undefined) {
1167
+ _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$emit(self.componentConfig["emit"]);
956
1168
  }
957
- if (self.shouldResetFormOnSuccessfulSubmit())
958
- {
959
- self.setProps(self.data, null);
960
- self.initValues();
961
- }
962
- self.showInlineForm = false;
963
- })
964
- .catch(function(error){
965
- if(error.response && error.response.data && error.response.data.errors){
966
- self.errors = error.response.data.errors;
967
- }
968
- if (self.componentConfig["failure"] != undefined && self.componentConfig["failure"]["emit"] != undefined) {
969
- _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$emit(self.componentConfig["failure"]["emit"], error.response.data);
1169
+ if (self.componentConfig["delay"] != undefined) {
1170
+ setTimeout(function () {
1171
+ self.sendRequest()
1172
+ }, parseInt(self.componentConfig["delay"]));
1173
+ } else {
1174
+ self.sendRequest()
970
1175
  }
971
- if (self.componentConfig["failure"] != undefined && self.componentConfig["failure"]["transition"] != undefined && self.$store != undefined) {
972
- let path = self.componentConfig["failure"]["transition"]["path"]
973
- self.$store.dispatch('navigateTo', {url: path, backwards: false})
1176
+ } else {
1177
+ _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$emit('static_form_errors');
1178
+ }
1179
+ },
1180
+ sendRequest: function(){
1181
+ const self = this;
1182
+ let payload = {};
1183
+ payload[self.componentConfig["for"]] = self.data;
1184
+ let axios_config = {};
1185
+ if (self.componentConfig["multipart"] == true ) {
1186
+ let form_data = new FormData();
1187
+ for (let key in self.data) {
1188
+ if (key.endsWith("[]")) {
1189
+ for (let i in self.data[key]) {
1190
+ let file = self.data[key][i];
1191
+ form_data.append(self.componentConfig["for"] + "[" + key.slice(0, -2) + "][]", file);
1192
+ }
1193
+ } else {
1194
+ if (self.data[key] != null){
1195
+ form_data.append(self.componentConfig["for"] + "[" + key + "]", self.data[key]);
1196
+ }
1197
+ }
974
1198
  }
975
- })
976
- }
1199
+ axios_config = {
1200
+ method: self.componentConfig["method"],
1201
+ url: self.componentConfig["submit_path"],
1202
+ data: form_data,
1203
+ headers: {
1204
+ "X-CSRF-Token": document.getElementsByName("csrf-token")[0].getAttribute("content"),
1205
+ "Content-Type": "multipart/form-data",
1206
+ },
1207
+ };
1208
+ } else {
1209
+ axios_config = {
1210
+ method: self.componentConfig["method"],
1211
+ url: self.componentConfig["submit_path"],
1212
+ data: payload,
1213
+ headers: {
1214
+ "X-CSRF-Token": document.getElementsByName("csrf-token")[0].getAttribute("content"),
1215
+ "Content-Type": "application/json",
1216
+ },
1217
+ };
1218
+ }
1219
+ axios__WEBPACK_IMPORTED_MODULE_2___default()(axios_config)
1220
+ .then(function (response) {
1221
+ self.loading = false;
1222
+ if (self.componentConfig["success"] != undefined && self.componentConfig["success"]["emit"] != undefined) {
1223
+ _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$emit(self.componentConfig["success"]["emit"], response.data);
1224
+ }
1225
+ // transition handling
1226
+ if (self.componentConfig["success"] != undefined
1227
+ && self.componentConfig["success"]["transition"] != undefined
1228
+ && (
1229
+ self.componentConfig["success"]["transition"]["follow_response"] == undefined
1230
+ ||
1231
+ self.componentConfig["success"]["transition"]["follow_response"] === false
1232
+ )
1233
+ && self.$store != undefined
1234
+ ) {
1235
+ let path = self.componentConfig["success"]["transition"]["path"]
1236
+ self.$store.dispatch('navigateTo', {url: path, backwards: false})
1237
+ return;
1238
+ }
1239
+ if (self.componentConfig["success"] != undefined
1240
+ && self.componentConfig["success"]["transition"] != undefined
1241
+ && self.componentConfig["success"]["transition"]["follow_response"] === true
1242
+ && self.$store != undefined
1243
+ ) {
1244
+ let path = response.data["transition_to"] || response.request.responseURL
1245
+ self.$store.dispatch('navigateTo', {url: path, backwards: false})
1246
+ return;
1247
+ }
1248
+ // redirect handling
1249
+ if (self.componentConfig["success"] != undefined
1250
+ && self.componentConfig["success"]["redirect"] != undefined
1251
+ && (
1252
+ self.componentConfig["success"]["redirect"]["follow_response"] == undefined
1253
+ ||
1254
+ self.componentConfig["success"]["redirect"]["follow_response"] === false
1255
+ )
1256
+ && self.$store != undefined
1257
+ ) {
1258
+ let path = self.componentConfig["success"]["redirect"]["path"]
1259
+ window.location.href = path
1260
+ return;
1261
+ }
1262
+ if (self.componentConfig["success"] != undefined
1263
+ && self.componentConfig["success"]["redirect"] != undefined
1264
+ && self.componentConfig["success"]["redirect"]["follow_response"] === true
1265
+ && self.$store != undefined
1266
+ ) {
1267
+ let path = response.data["redirect_to"] || response.request.responseURL
1268
+ window.location.href = path
1269
+ return;
1270
+ }
1271
+
1272
+ if (self.shouldResetFormOnSuccessfulSubmit())
1273
+ {
1274
+ self.setProps(self.data, null);
1275
+ self.initValues();
1276
+ }
1277
+ })
1278
+ .catch(function (error) {
1279
+ self.loading = false;
1280
+ if (error.response && error.response.data && error.response.data.errors) {
1281
+ self.errors = error.response.data.errors;
1282
+ }
1283
+ if (self.componentConfig["failure"] != undefined && self.componentConfig["failure"]["emit"] != undefined) {
1284
+ _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$emit(self.componentConfig["failure"]["emit"], error.response.data);
1285
+ }
1286
+ // transition handling
1287
+ if (self.componentConfig["failure"] != undefined
1288
+ && self.componentConfig["failure"]["transition"] != undefined
1289
+ && (
1290
+ self.componentConfig["failure"]["transition"]["follow_response"] == undefined
1291
+ ||
1292
+ self.componentConfig["failure"]["transition"]["follow_response"] === false
1293
+ )
1294
+ && self.$store != undefined
1295
+ ) {
1296
+ let path = self.componentConfig["failure"]["transition"]["path"]
1297
+ self.$store.dispatch('navigateTo', {url: path, backwards: false})
1298
+ return;
1299
+ }
1300
+ if (self.componentConfig["failure"] != undefined
1301
+ && self.componentConfig["failure"]["transition"] != undefined
1302
+ && self.componentConfig["failure"]["transition"]["follow_response"] === true
1303
+ && self.$store != undefined
1304
+ ) {
1305
+ let path = error.response.data["transition_to"] || response.request.responseURL
1306
+ self.$store.dispatch('navigateTo', {url: path, backwards: false})
1307
+ return;
1308
+ }
1309
+ // redirect handling
1310
+ if (self.componentConfig["failure"] != undefined
1311
+ && self.componentConfig["failure"]["redirect"] != undefined
1312
+ && (
1313
+ self.componentConfig["failure"]["redirect"]["follow_response"] == undefined
1314
+ ||
1315
+ self.componentConfig["failure"]["redirect"]["follow_response"] === false
1316
+ )
1317
+ && self.$store != undefined
1318
+ ) {
1319
+ let path = self.componentConfig["failure"]["redirect"]["path"]
1320
+ window.location.href = path
1321
+ return;
1322
+ }
1323
+ if (self.componentConfig["failure"] != undefined
1324
+ && self.componentConfig["failure"]["redirect"] != undefined
1325
+ && self.componentConfig["failure"]["redirect"]["follow_response"] === true
1326
+ && self.$store != undefined
1327
+ ) {
1328
+ let path = error.response.data["redirect_to"] || response.request.responseURL
1329
+ window.location.href = path
1330
+ return;
1331
+ }
1332
+ });
1333
+ },
977
1334
  },
978
- mounted: function(){
979
- this.initValues()
980
- }
981
- }
1335
+ mounted: function () {
1336
+ this.initValues();
1337
+ },
1338
+ };
982
1339
 
983
- let component = vue_dist_vue_esm__WEBPACK_IMPORTED_MODULE_0__["default"].component('matestack-ui-core-form', componentDef)
1340
+ let component = vue_dist_vue_esm__WEBPACK_IMPORTED_MODULE_0__["default"].component("matestack-ui-core-form", componentDef);
984
1341
 
985
1342
  /* harmony default export */ __webpack_exports__["default"] = (componentDef);
986
1343
 
987
1344
 
988
1345
  /***/ }),
989
1346
 
990
- /***/ "../app/concepts/matestack/ui/core/html/html.js":
991
- /*!******************************************************!*\
992
- !*** ../app/concepts/matestack/ui/core/html/html.js ***!
993
- \******************************************************/
1347
+ /***/ "../app/concepts/matestack/ui/core/isolated/isolated.js":
1348
+ /*!**************************************************************!*\
1349
+ !*** ../app/concepts/matestack/ui/core/isolated/isolated.js ***!
1350
+ \**************************************************************/
994
1351
  /*! exports provided: default */
995
1352
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
996
1353
 
997
1354
  "use strict";
998
1355
  __webpack_require__.r(__webpack_exports__);
999
1356
  /* harmony import */ var vue_dist_vue_esm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue/dist/vue.esm */ "../node_modules/vue/dist/vue.esm.js");
1000
- /* harmony import */ var _component_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../component/component */ "../app/concepts/matestack/ui/core/component/component.js");
1357
+ /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ "../node_modules/axios/index.js");
1358
+ /* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_1__);
1359
+ /* harmony import */ var v_runtime_template__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! v-runtime-template */ "../node_modules/v-runtime-template/dist/v-runtime-template.es.js");
1360
+ /* harmony import */ var _js_event_hub__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../js/event-hub */ "../app/concepts/matestack/ui/core/js/event-hub.js");
1361
+
1362
+
1001
1363
 
1002
1364
 
1003
1365
 
1004
1366
  const componentDef = {
1005
- mixins: [_component_component__WEBPACK_IMPORTED_MODULE_1__["default"]]
1367
+ props: ['componentConfig', 'params'],
1368
+ data: function(){
1369
+ return {
1370
+ isolatedTemplate: null,
1371
+ loading: false,
1372
+ loadingError: false
1373
+ }
1374
+ },
1375
+ methods: {
1376
+ rerender: function(){
1377
+ var self = this;
1378
+ self.loading = true;
1379
+ self.loadingError = false;
1380
+ if(self.componentConfig["rerender_delay"] != undefined){
1381
+ setTimeout(function () {
1382
+ self.renderIsolatedContent();
1383
+ }, parseInt(this.componentConfig["rerender_delay"]));
1384
+ } else {
1385
+ self.renderIsolatedContent();
1386
+ }
1387
+ },
1388
+ renderIsolatedContent: function(){
1389
+ var self = this;
1390
+ self.loading = true;
1391
+ self.loadingError = false;
1392
+ axios__WEBPACK_IMPORTED_MODULE_1___default()({
1393
+ method: "get",
1394
+ url: location.pathname + location.search,
1395
+ headers: {
1396
+ 'X-CSRF-Token': document.getElementsByName("csrf-token")[0].getAttribute('content')
1397
+ },
1398
+ params: {
1399
+ "component_class": self.componentConfig["component_class"],
1400
+ "public_options": self.componentConfig["public_options"]
1401
+ }
1402
+ })
1403
+ .then(function(response){
1404
+ self.loading = false;
1405
+ self.loadingStart = false;
1406
+ self.loadingEnd = true;
1407
+ self.isolatedTemplate = response['data'];
1408
+ })
1409
+ .catch(function(error){
1410
+ self.loadingError = true;
1411
+ _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$emit('isolate_rerender_error', { class: self.componentConfig["component_class"] })
1412
+ })
1413
+ },
1414
+ startDefer: function(){
1415
+ const self = this
1416
+ self.loading = true;
1417
+ setTimeout(function () {
1418
+ self.renderIsolatedContent()
1419
+ }, parseInt(this.componentConfig["defer"]));
1420
+ }
1421
+ },
1422
+ created: function () {
1423
+ const self = this
1424
+ },
1425
+ beforeDestroy: function() {
1426
+ const self = this
1427
+ if(this.componentConfig["rerender_on"] != undefined){
1428
+ var rerender_events = this.componentConfig["rerender_on"].split(",")
1429
+ rerender_events.forEach(rerender_event => _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$off(rerender_event.trim(), self.renderIsolatedContent));
1430
+ }
1431
+ },
1432
+ mounted: function (){
1433
+ const self = this
1434
+ if(this.componentConfig["init_on"] === undefined || this.componentConfig["init_on"] === null){
1435
+ if(self.componentConfig["defer"] == true || Number.isInteger(self.componentConfig["defer"])){
1436
+ if(!isNaN(self.componentConfig["defer"])){
1437
+ self.startDefer()
1438
+ }
1439
+ else{
1440
+ self.renderIsolatedContent();
1441
+ }
1442
+ }
1443
+ }else{
1444
+ if(self.componentConfig["defer"] != undefined){
1445
+ if(!isNaN(self.componentConfig["defer"])){
1446
+ var init_on_events = this.componentConfig["init_on"].split(",")
1447
+ init_on_events.forEach(init_on_event => _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$on(init_on_event.trim(), self.startDefer));
1448
+ }
1449
+ }else{
1450
+ var init_on_events = this.componentConfig["init_on"].split(",")
1451
+ init_on_events.forEach(init_on_event => _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$on(init_on_event.trim(), self.renderIsolatedContent));
1452
+ }
1453
+ }
1454
+
1455
+ if(this.componentConfig["rerender_on"] != undefined){
1456
+ var rerender_events = this.componentConfig["rerender_on"].split(",")
1457
+ rerender_events.forEach(rerender_event => _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$on(rerender_event.trim(), self.rerender));
1458
+ }
1459
+
1460
+ },
1461
+ components: {
1462
+ VRuntimeTemplate: v_runtime_template__WEBPACK_IMPORTED_MODULE_2__["default"]
1463
+ }
1006
1464
  }
1007
1465
 
1008
- let component = vue_dist_vue_esm__WEBPACK_IMPORTED_MODULE_0__["default"].component('matestack-ui-core-html', componentDef)
1466
+ let component = vue_dist_vue_esm__WEBPACK_IMPORTED_MODULE_0__["default"].component('matestack-ui-core-isolate', componentDef)
1009
1467
 
1010
- /* harmony default export */ __webpack_exports__["default"] = (component);
1468
+ /* harmony default export */ __webpack_exports__["default"] = (componentDef);
1011
1469
 
1012
1470
 
1013
1471
  /***/ }),
@@ -1025,18 +1483,20 @@ __webpack_require__.r(__webpack_exports__);
1025
1483
  /* harmony import */ var vue_turbolinks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue-turbolinks */ "../node_modules/vue-turbolinks/index.js");
1026
1484
  /* harmony import */ var _app_app__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../app/app */ "../app/concepts/matestack/ui/core/app/app.js");
1027
1485
  /* harmony import */ var _async_async__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../async/async */ "../app/concepts/matestack/ui/core/async/async.js");
1028
- /* harmony import */ var _page_content__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../page/content */ "../app/concepts/matestack/ui/core/page/content.js");
1029
- /* harmony import */ var _app_store__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../app/store */ "../app/concepts/matestack/ui/core/app/store.js");
1030
- /* harmony import */ var _component_component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../component/component */ "../app/concepts/matestack/ui/core/component/component.js");
1031
- /* harmony import */ var _component_anonym_dynamic_component__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../component/anonym-dynamic-component */ "../app/concepts/matestack/ui/core/component/anonym-dynamic-component.js");
1032
- /* harmony import */ var _html_html__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../html/html */ "../app/concepts/matestack/ui/core/html/html.js");
1033
- /* harmony import */ var _transition_transition__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../transition/transition */ "../app/concepts/matestack/ui/core/transition/transition.js");
1034
- /* harmony import */ var _action_action__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../action/action */ "../app/concepts/matestack/ui/core/action/action.js");
1035
- /* harmony import */ var _form_form__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../form/form */ "../app/concepts/matestack/ui/core/form/form.js");
1036
- /* harmony import */ var _onclick_onclick__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../onclick/onclick */ "../app/concepts/matestack/ui/core/onclick/onclick.js");
1037
- /* harmony import */ var _collection_content_content__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../collection/content/content */ "../app/concepts/matestack/ui/core/collection/content/content.js");
1038
- /* harmony import */ var _collection_filter_filter__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../collection/filter/filter */ "../app/concepts/matestack/ui/core/collection/filter/filter.js");
1039
- /* harmony import */ var _collection_order_order__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../collection/order/order */ "../app/concepts/matestack/ui/core/collection/order/order.js");
1486
+ /* harmony import */ var _cable_cable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../cable/cable */ "../app/concepts/matestack/ui/core/cable/cable.js");
1487
+ /* harmony import */ var _page_content_content__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../page/content/content */ "../app/concepts/matestack/ui/core/page/content/content.js");
1488
+ /* harmony import */ var _toggle_toggle__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../toggle/toggle */ "../app/concepts/matestack/ui/core/toggle/toggle.js");
1489
+ /* harmony import */ var _app_store__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../app/store */ "../app/concepts/matestack/ui/core/app/store.js");
1490
+ /* harmony import */ var _component_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../component/component */ "../app/concepts/matestack/ui/core/component/component.js");
1491
+ /* harmony import */ var _component_anonym_dynamic_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../component/anonym-dynamic-component */ "../app/concepts/matestack/ui/core/component/anonym-dynamic-component.js");
1492
+ /* harmony import */ var _transition_transition__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../transition/transition */ "../app/concepts/matestack/ui/core/transition/transition.js");
1493
+ /* harmony import */ var _action_action__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../action/action */ "../app/concepts/matestack/ui/core/action/action.js");
1494
+ /* harmony import */ var _form_form__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../form/form */ "../app/concepts/matestack/ui/core/form/form.js");
1495
+ /* harmony import */ var _onclick_onclick__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../onclick/onclick */ "../app/concepts/matestack/ui/core/onclick/onclick.js");
1496
+ /* harmony import */ var _collection_content_content__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../collection/content/content */ "../app/concepts/matestack/ui/core/collection/content/content.js");
1497
+ /* harmony import */ var _collection_filter_filter__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../collection/filter/filter */ "../app/concepts/matestack/ui/core/collection/filter/filter.js");
1498
+ /* harmony import */ var _collection_order_order__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../collection/order/order */ "../app/concepts/matestack/ui/core/collection/order/order.js");
1499
+ /* harmony import */ var _isolated_isolated__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../isolated/isolated */ "../app/concepts/matestack/ui/core/isolated/isolated.js");
1040
1500
 
1041
1501
 
1042
1502
 
@@ -1056,6 +1516,8 @@ __webpack_require__.r(__webpack_exports__);
1056
1516
 
1057
1517
 
1058
1518
 
1519
+
1520
+
1059
1521
  let matestackUiApp = undefined
1060
1522
 
1061
1523
  // this event fires first and always
@@ -1066,9 +1528,9 @@ document.addEventListener('DOMContentLoaded', () => {
1066
1528
  // if they were present on the first page, which was loaded and activated turbolinks
1067
1529
  // the mixin does not impact the app when turbolinks is disabled
1068
1530
  matestackUiApp = new vue_dist_vue_esm__WEBPACK_IMPORTED_MODULE_0__["default"]({
1069
- el: "#matestack_ui",
1531
+ el: "#matestack-ui",
1070
1532
  mixins: [vue_turbolinks__WEBPACK_IMPORTED_MODULE_1__["turbolinksAdapterMixin"]],
1071
- store: _app_store__WEBPACK_IMPORTED_MODULE_5__["default"]
1533
+ store: _app_store__WEBPACK_IMPORTED_MODULE_7__["default"]
1072
1534
  })
1073
1535
  })
1074
1536
 
@@ -1078,14 +1540,14 @@ document.addEventListener('turbolinks:load', () => {
1078
1540
  // otherwise the matestack page will jump back to the latest pageTemplate
1079
1541
  // fetched during the last matestack transition as the turbolinks powered
1080
1542
  // page transition does not write the matestack store pageTemplate state variable
1081
- _app_store__WEBPACK_IMPORTED_MODULE_5__["default"].commit('resetPageTemplate')
1543
+ _app_store__WEBPACK_IMPORTED_MODULE_7__["default"].commit('resetPageTemplate')
1082
1544
  // we need to destroy the vue app instance
1083
1545
  matestackUiApp.$destroy();
1084
1546
  // and recreate it right afterwards in order to work when used with turbolinks
1085
1547
  matestackUiApp = new vue_dist_vue_esm__WEBPACK_IMPORTED_MODULE_0__["default"]({
1086
- el: "#matestack_ui",
1548
+ el: "#matestack-ui",
1087
1549
  mixins: [vue_turbolinks__WEBPACK_IMPORTED_MODULE_1__["turbolinksAdapterMixin"]],
1088
- store: _app_store__WEBPACK_IMPORTED_MODULE_5__["default"]
1550
+ store: _app_store__WEBPACK_IMPORTED_MODULE_7__["default"]
1089
1551
  })
1090
1552
  })
1091
1553
 
@@ -1218,10 +1680,10 @@ let component = vue_dist_vue_esm__WEBPACK_IMPORTED_MODULE_0__["default"].compone
1218
1680
 
1219
1681
  /***/ }),
1220
1682
 
1221
- /***/ "../app/concepts/matestack/ui/core/page/content.js":
1222
- /*!*********************************************************!*\
1223
- !*** ../app/concepts/matestack/ui/core/page/content.js ***!
1224
- \*********************************************************/
1683
+ /***/ "../app/concepts/matestack/ui/core/page/content/content.js":
1684
+ /*!*****************************************************************!*\
1685
+ !*** ../app/concepts/matestack/ui/core/page/content/content.js ***!
1686
+ \*****************************************************************/
1225
1687
  /*! exports provided: default */
1226
1688
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1227
1689
 
@@ -1229,7 +1691,10 @@ let component = vue_dist_vue_esm__WEBPACK_IMPORTED_MODULE_0__["default"].compone
1229
1691
  __webpack_require__.r(__webpack_exports__);
1230
1692
  /* harmony import */ var vue_dist_vue_esm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue/dist/vue.esm */ "../node_modules/vue/dist/vue.esm.js");
1231
1693
  /* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vuex */ "../node_modules/vuex/dist/vuex.esm.js");
1232
- /* harmony import */ var _component_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../component/component */ "../app/concepts/matestack/ui/core/component/component.js");
1694
+ /* harmony import */ var _component_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../component/component */ "../app/concepts/matestack/ui/core/component/component.js");
1695
+ /* harmony import */ var v_runtime_template__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! v-runtime-template */ "../node_modules/v-runtime-template/dist/v-runtime-template.es.js");
1696
+
1697
+
1233
1698
 
1234
1699
 
1235
1700
 
@@ -1241,7 +1706,11 @@ const componentDef = {
1241
1706
  },
1242
1707
  computed: vuex__WEBPACK_IMPORTED_MODULE_1__["default"].mapState({
1243
1708
  asyncPageTemplate: state => state.pageTemplate,
1244
- })
1709
+ loading: state => state.pageLoading
1710
+ }),
1711
+ components: {
1712
+ VRuntimeTemplate: v_runtime_template__WEBPACK_IMPORTED_MODULE_3__["default"]
1713
+ }
1245
1714
  }
1246
1715
 
1247
1716
  let component = vue_dist_vue_esm__WEBPACK_IMPORTED_MODULE_0__["default"].component('matestack-ui-core-page-content', componentDef)
@@ -1249,6 +1718,93 @@ let component = vue_dist_vue_esm__WEBPACK_IMPORTED_MODULE_0__["default"].compone
1249
1718
  /* harmony default export */ __webpack_exports__["default"] = (componentDef);
1250
1719
 
1251
1720
 
1721
+ /***/ }),
1722
+
1723
+ /***/ "../app/concepts/matestack/ui/core/toggle/toggle.js":
1724
+ /*!**********************************************************!*\
1725
+ !*** ../app/concepts/matestack/ui/core/toggle/toggle.js ***!
1726
+ \**********************************************************/
1727
+ /*! exports provided: default */
1728
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1729
+
1730
+ "use strict";
1731
+ __webpack_require__.r(__webpack_exports__);
1732
+ /* harmony import */ var vue_dist_vue_esm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue/dist/vue.esm */ "../node_modules/vue/dist/vue.esm.js");
1733
+ /* harmony import */ var _js_event_hub__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../js/event-hub */ "../app/concepts/matestack/ui/core/js/event-hub.js");
1734
+ /* harmony import */ var _component_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../component/component */ "../app/concepts/matestack/ui/core/component/component.js");
1735
+
1736
+
1737
+
1738
+
1739
+ const componentDef = {
1740
+ mixins: [_component_component__WEBPACK_IMPORTED_MODULE_2__["default"]],
1741
+ data: function(){
1742
+ return {
1743
+ showing: true,
1744
+ hide_after_timeout: null,
1745
+ event: {
1746
+ data: {}
1747
+ }
1748
+ }
1749
+ },
1750
+ methods: {
1751
+ show: function(event_data){
1752
+ const self = this
1753
+ if (this.showing === true){
1754
+ return
1755
+ }
1756
+ this.showing = true
1757
+ this.event.data = event_data
1758
+ if(this.componentConfig["hide_after"] != undefined){
1759
+ self.hide_after_timeout = setTimeout(function () {
1760
+ self.hide()
1761
+ }, parseInt(this.componentConfig["hide_after"]));
1762
+ }
1763
+ },
1764
+ hide: function(){
1765
+ this.showing = false
1766
+ this.event.data = {}
1767
+ }
1768
+ },
1769
+ created: function () {
1770
+ const self = this
1771
+ if(this.componentConfig["show_on"] != undefined){
1772
+ this.showing = false
1773
+ var show_events = this.componentConfig["show_on"].split(",")
1774
+ show_events.forEach(show_event => _js_event_hub__WEBPACK_IMPORTED_MODULE_1__["default"].$on(show_event.trim(), self.show));
1775
+ }
1776
+ if(this.componentConfig["hide_on"] != undefined){
1777
+ var hide_events = this.componentConfig["hide_on"].split(",")
1778
+ hide_events.forEach(hide_event => _js_event_hub__WEBPACK_IMPORTED_MODULE_1__["default"].$on(hide_event.trim(), self.hide));
1779
+ }
1780
+ if(this.componentConfig["show_on"] != undefined){
1781
+ this.showing = false
1782
+ }
1783
+ if(this.componentConfig["init_show"] == true){
1784
+ this.showing = true
1785
+ }
1786
+ },
1787
+ beforeDestroy: function() {
1788
+ const self = this
1789
+ clearTimeout(self.hide_after_timeout)
1790
+ _js_event_hub__WEBPACK_IMPORTED_MODULE_1__["default"].$off(this.componentConfig["show_on"], self.show);
1791
+ _js_event_hub__WEBPACK_IMPORTED_MODULE_1__["default"].$off(this.componentConfig["hide_on"], self.hide);
1792
+ if(this.componentConfig["show_on"] != undefined){
1793
+ var shown_events = this.componentConfig["show_on"].split(",")
1794
+ shown_events.forEach(show_event => _js_event_hub__WEBPACK_IMPORTED_MODULE_1__["default"].$off(show_event.trim(), self.show));
1795
+ }
1796
+ if(this.componentConfig["hide_on"] != undefined){
1797
+ var hiden_events = this.componentConfig["hide_on"].split(",")
1798
+ hiden_events.forEach(hide_event => _js_event_hub__WEBPACK_IMPORTED_MODULE_1__["default"].$off(hide_event.trim(), self.hide));
1799
+ }
1800
+ },
1801
+ }
1802
+
1803
+ let component = vue_dist_vue_esm__WEBPACK_IMPORTED_MODULE_0__["default"].component('matestack-ui-core-toggle', componentDef)
1804
+
1805
+ /* harmony default export */ __webpack_exports__["default"] = (componentDef);
1806
+
1807
+
1252
1808
  /***/ }),
1253
1809
 
1254
1810
  /***/ "../app/concepts/matestack/ui/core/transition/transition.js":
@@ -1263,6 +1819,8 @@ __webpack_require__.r(__webpack_exports__);
1263
1819
  /* harmony import */ var vue_dist_vue_esm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue/dist/vue.esm */ "../node_modules/vue/dist/vue.esm.js");
1264
1820
  /* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vuex */ "../node_modules/vuex/dist/vuex.esm.js");
1265
1821
  /* harmony import */ var _component_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../component/component */ "../app/concepts/matestack/ui/core/component/component.js");
1822
+ /* harmony import */ var _js_event_hub__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../js/event-hub */ "../app/concepts/matestack/ui/core/js/event-hub.js");
1823
+
1266
1824
 
1267
1825
 
1268
1826
 
@@ -1274,11 +1832,26 @@ const componentDef = {
1274
1832
  },
1275
1833
  computed: vuex__WEBPACK_IMPORTED_MODULE_1__["default"].mapState({
1276
1834
  isActive (state) {
1277
- return this.componentConfig["link_path"] === state.currentPath
1835
+ return (this.componentConfig["link_path"].split("?")[0]) === state.currentPathName
1836
+ },
1837
+ isChildActive (state) {
1838
+ return ((this.componentConfig["link_path"].split("?")[0]) !== state.currentPathName) && (state.currentPathName.indexOf(this.componentConfig["link_path"].split("?")[0]) !== -1)
1278
1839
  }
1279
1840
  }),
1280
1841
  methods: {
1281
1842
  navigateTo: function(url){
1843
+ const self = this
1844
+ _js_event_hub__WEBPACK_IMPORTED_MODULE_3__["default"].$emit("page_loading_triggered", url);
1845
+ this.$store.commit('setPageLoading', true);
1846
+ if (self.componentConfig["delay"] != undefined) {
1847
+ setTimeout(function () {
1848
+ self.performNavigation(url)
1849
+ }, parseInt(self.componentConfig["delay"]));
1850
+ } else {
1851
+ this.performNavigation(url)
1852
+ }
1853
+ },
1854
+ performNavigation: function(url){
1282
1855
  this.$store.dispatch('navigateTo', {url: url, backwards: false}).then((response) => {
1283
1856
  // self.asyncTemplate = response;
1284
1857
  })