matestack-ui-core 0.7.1 → 0.7.5
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.
- checksums.yaml +4 -4
- data/README.md +16 -4
- data/Rakefile +32 -0
- data/app/concepts/matestack/ui/core/abbr/abbr.haml +5 -0
- data/app/concepts/matestack/ui/core/abbr/abbr.rb +12 -0
- data/app/concepts/matestack/ui/core/action/action.js +51 -29
- data/app/concepts/matestack/ui/core/action/action.rb +3 -0
- data/app/concepts/matestack/ui/core/actionview/dynamic.haml +6 -0
- data/app/concepts/matestack/ui/core/actionview/dynamic.rb +28 -0
- data/app/concepts/matestack/ui/core/actionview/static.haml +1 -0
- data/app/concepts/matestack/ui/core/actionview/static.rb +28 -0
- data/app/concepts/matestack/ui/core/address/address.haml +5 -0
- data/app/concepts/matestack/ui/core/address/address.rb +5 -0
- data/app/concepts/matestack/ui/core/app/app.js +14 -3
- data/app/concepts/matestack/ui/core/app/app.rb +3 -28
- data/app/concepts/matestack/ui/core/app/location.js +9 -0
- data/app/concepts/matestack/ui/core/app/store.js +12 -6
- data/app/concepts/matestack/ui/core/area/area.haml +1 -0
- data/app/concepts/matestack/ui/core/area/area.rb +18 -0
- data/app/concepts/matestack/ui/core/article/article.haml +5 -0
- data/app/concepts/matestack/ui/core/article/article.rb +5 -0
- data/app/concepts/matestack/ui/core/aside/aside.haml +3 -0
- data/app/concepts/matestack/ui/core/aside/aside.rb +5 -0
- data/app/concepts/matestack/ui/core/async/async.haml +1 -1
- data/app/concepts/matestack/ui/core/async/async.js +5 -4
- data/app/concepts/matestack/ui/core/async/async.rb +8 -6
- data/app/concepts/matestack/ui/core/b/b.haml +5 -0
- data/app/concepts/matestack/ui/core/b/b.rb +5 -0
- data/app/concepts/matestack/ui/core/bdi/bdi.haml +5 -0
- data/app/concepts/matestack/ui/core/bdi/bdi.rb +4 -0
- data/app/concepts/matestack/ui/core/bdo/bdo.haml +5 -0
- data/app/concepts/matestack/ui/core/bdo/bdo.rb +11 -0
- data/app/concepts/matestack/ui/core/blockquote/blockquote.rb +3 -1
- data/app/concepts/matestack/ui/core/button/button.haml +4 -6
- data/app/concepts/matestack/ui/core/caption/caption.haml +2 -3
- data/app/concepts/matestack/ui/core/cite/cite.haml +5 -0
- data/app/concepts/matestack/ui/core/cite/cite.rb +5 -0
- data/app/concepts/matestack/ui/core/code/code.haml +5 -0
- data/app/concepts/matestack/ui/core/code/code.rb +5 -0
- data/app/concepts/matestack/ui/core/collection/content/content.js +4 -6
- data/app/concepts/matestack/ui/core/collection/content/content.rb +1 -1
- data/app/concepts/matestack/ui/core/collection/filter/filter.js +3 -5
- data/app/concepts/matestack/ui/core/collection/filter/filter.rb +1 -1
- data/app/concepts/matestack/ui/core/collection/filter/input/input.haml +1 -7
- data/app/concepts/matestack/ui/core/collection/filter/input/input.rb +12 -0
- data/app/concepts/matestack/ui/core/collection/helper.rb +0 -1
- data/app/concepts/matestack/ui/core/collection/order/order.js +3 -5
- data/app/concepts/matestack/ui/core/collection/order/order.rb +1 -1
- data/app/concepts/matestack/ui/core/collection/order/toggle/indicator/indicator.rb +3 -1
- data/app/concepts/matestack/ui/core/collection/order/toggle/toggle.rb +0 -1
- data/app/concepts/matestack/ui/core/component/anonym-dynamic-component.js +1 -1
- data/app/concepts/matestack/ui/core/component/component.js +1 -2
- data/app/concepts/matestack/ui/core/component/dynamic.rb +38 -33
- data/app/concepts/matestack/ui/core/data/data.haml +5 -0
- data/app/concepts/matestack/ui/core/data/data.rb +9 -0
- data/app/concepts/matestack/ui/core/datalist/datalist.haml +3 -0
- data/app/concepts/matestack/ui/core/datalist/datalist.rb +5 -0
- data/app/concepts/matestack/ui/core/dd/dd.haml +5 -0
- data/app/concepts/matestack/ui/core/dd/dd.rb +5 -0
- data/app/concepts/matestack/ui/core/del/del.haml +5 -0
- data/app/concepts/matestack/ui/core/del/del.rb +4 -0
- data/app/concepts/matestack/ui/core/details/details.rb +1 -0
- data/app/concepts/matestack/ui/core/dfn/dfn.haml +5 -0
- data/app/concepts/matestack/ui/core/dfn/dfn.rb +6 -0
- data/app/concepts/matestack/ui/core/dialog/dialog.haml +5 -0
- data/app/concepts/matestack/ui/core/dialog/dialog.rb +9 -0
- data/app/concepts/matestack/ui/core/div/div.rb +0 -1
- data/app/concepts/matestack/ui/core/dl/dl.haml +5 -0
- data/app/concepts/matestack/ui/core/dl/dl.rb +5 -0
- data/app/concepts/matestack/ui/core/dt/dt.haml +5 -0
- data/app/concepts/matestack/ui/core/dt/dt.rb +5 -0
- data/app/concepts/matestack/ui/core/em/em.haml +5 -0
- data/app/concepts/matestack/ui/core/em/em.rb +5 -0
- data/app/concepts/matestack/ui/core/fieldset/fieldset.haml +5 -0
- data/app/concepts/matestack/ui/core/fieldset/fieldset.rb +9 -0
- data/app/concepts/matestack/ui/core/figure/figure.haml +3 -0
- data/app/concepts/matestack/ui/core/figure/figure.rb +5 -0
- data/app/concepts/matestack/ui/core/form/form.js +42 -6
- data/app/concepts/matestack/ui/core/form/input/input.haml +30 -21
- data/app/concepts/matestack/ui/core/form/input/input.rb +36 -29
- data/app/concepts/matestack/ui/core/form/select/select.haml +10 -6
- data/app/concepts/matestack/ui/core/html/html.js +1 -1
- data/app/concepts/matestack/ui/core/icon/icon.haml +2 -3
- data/app/concepts/matestack/ui/core/iframe/iframe.haml +5 -0
- data/app/concepts/matestack/ui/core/iframe/iframe.rb +14 -0
- data/app/concepts/matestack/ui/core/img/img.haml +1 -1
- data/app/concepts/matestack/ui/core/img/img.rb +10 -0
- data/app/concepts/matestack/ui/core/input/input.haml +2 -3
- data/app/concepts/matestack/ui/core/input/input.rb +4 -0
- data/app/concepts/matestack/ui/core/ins/ins.haml +5 -0
- data/app/concepts/matestack/ui/core/ins/ins.rb +10 -0
- data/app/concepts/matestack/ui/core/isolate/isolate.haml +2 -0
- data/app/concepts/matestack/ui/core/isolate/isolate.rb +11 -0
- data/app/concepts/matestack/ui/core/js/core.js +41 -18
- data/app/concepts/matestack/ui/core/kbd/kbd.haml +5 -0
- data/app/concepts/matestack/ui/core/kbd/kbd.rb +4 -0
- data/app/concepts/matestack/ui/core/label/label.haml +4 -6
- data/app/concepts/matestack/ui/core/label/label.rb +6 -1
- data/app/concepts/matestack/ui/core/legend/legend.haml +5 -0
- data/app/concepts/matestack/ui/core/legend/legend.rb +5 -0
- data/app/concepts/matestack/ui/core/li/li.haml +2 -3
- data/app/concepts/matestack/ui/core/link/link.rb +2 -1
- data/app/concepts/matestack/ui/core/map/map.haml +3 -0
- data/app/concepts/matestack/ui/core/map/map.rb +11 -0
- data/app/concepts/matestack/ui/core/mark/mark.haml +5 -0
- data/app/concepts/matestack/ui/core/mark/mark.rb +4 -0
- data/app/concepts/matestack/ui/core/meter/meter.haml +4 -0
- data/app/concepts/matestack/ui/core/meter/meter.rb +14 -0
- data/app/concepts/matestack/ui/core/noscript/noscript.haml +5 -0
- data/app/concepts/matestack/ui/core/noscript/noscript.rb +5 -0
- data/app/concepts/matestack/ui/core/object/object.haml +1 -0
- data/app/concepts/matestack/ui/core/object/object.rb +15 -0
- data/app/concepts/matestack/ui/core/onclick/onclick.haml +1 -1
- data/app/concepts/matestack/ui/core/onclick/onclick.js +2 -3
- data/app/concepts/matestack/ui/core/onclick/onclick.rb +1 -2
- data/app/concepts/matestack/ui/core/optgroup/optgroup.haml +3 -0
- data/app/concepts/matestack/ui/core/optgroup/optgroup.rb +10 -0
- data/app/concepts/matestack/ui/core/option/option.haml +5 -0
- data/app/concepts/matestack/ui/core/option/option.rb +12 -0
- data/app/concepts/matestack/ui/core/output/output.haml +5 -0
- data/app/concepts/matestack/ui/core/output/output.rb +11 -0
- data/app/concepts/matestack/ui/core/page/content.js +1 -1
- data/app/concepts/matestack/ui/core/page/page.rb +61 -22
- data/app/concepts/matestack/ui/core/paragraph/paragraph.haml +4 -7
- data/app/concepts/matestack/ui/core/param/param.haml +1 -0
- data/app/concepts/matestack/ui/core/param/param.rb +10 -0
- data/app/concepts/matestack/ui/core/pg/pg.haml +4 -7
- data/app/concepts/matestack/ui/core/picture/picture.haml +3 -0
- data/app/concepts/matestack/ui/core/picture/picture.rb +4 -0
- data/app/concepts/matestack/ui/core/plain/plain.rb +1 -2
- data/app/concepts/matestack/ui/core/pre/pre.haml +5 -0
- data/app/concepts/matestack/ui/core/pre/pre.rb +5 -0
- data/app/concepts/matestack/ui/core/q/q.haml +5 -0
- data/app/concepts/matestack/ui/core/q/q.rb +11 -0
- data/app/concepts/matestack/ui/core/rp/rp.haml +5 -0
- data/app/concepts/matestack/ui/core/rp/rp.rb +5 -0
- data/app/concepts/matestack/ui/core/rt/rt.haml +5 -0
- data/app/concepts/matestack/ui/core/rt/rt.rb +5 -0
- data/app/concepts/matestack/ui/core/ruby/ruby.haml +5 -0
- data/app/concepts/matestack/ui/core/ruby/ruby.rb +5 -0
- data/app/concepts/matestack/ui/core/s/s.haml +5 -0
- data/app/concepts/matestack/ui/core/s/s.rb +6 -0
- data/app/concepts/matestack/ui/core/samp/samp.haml +5 -0
- data/app/concepts/matestack/ui/core/samp/samp.rb +4 -0
- data/app/concepts/matestack/ui/core/sub/sub.haml +5 -0
- data/app/concepts/matestack/ui/core/sub/sub.rb +5 -0
- data/app/concepts/matestack/ui/core/summary/summary.haml +2 -3
- data/app/concepts/matestack/ui/core/summary/summary.rb +1 -0
- data/app/concepts/matestack/ui/core/sup/sup.haml +5 -0
- data/app/concepts/matestack/ui/core/sup/sup.rb +5 -0
- data/app/concepts/matestack/ui/core/tbody/tbody.haml +3 -0
- data/app/concepts/matestack/ui/core/tbody/tbody.rb +5 -0
- data/app/concepts/matestack/ui/core/td/td.haml +4 -7
- data/app/concepts/matestack/ui/core/template/template.haml +3 -0
- data/app/concepts/matestack/ui/core/template/template.rb +4 -0
- data/app/concepts/matestack/ui/core/tfoot/tfoot.haml +3 -0
- data/app/concepts/matestack/ui/core/tfoot/tfoot.rb +5 -0
- data/app/concepts/matestack/ui/core/th/th.haml +4 -7
- data/app/concepts/matestack/ui/core/thead/thead.haml +3 -0
- data/app/concepts/matestack/ui/core/thead/thead.rb +5 -0
- data/app/concepts/matestack/ui/core/transition/transition.haml +4 -6
- data/app/concepts/matestack/ui/core/transition/transition.js +1 -1
- data/app/concepts/matestack/ui/core/u/u.haml +5 -0
- data/app/concepts/matestack/ui/core/u/u.rb +6 -0
- data/app/concepts/matestack/ui/core/unescaped/unescaped.rb +7 -0
- data/app/concepts/matestack/ui/core/var/var.haml +5 -0
- data/app/concepts/matestack/ui/core/var/var.rb +4 -0
- data/app/concepts/matestack/ui/core/video/video.haml +3 -1
- data/app/concepts/matestack/ui/core/video/video.rb +17 -1
- data/app/concepts/matestack/ui/core/wbr/wbr.haml +1 -0
- data/app/concepts/matestack/ui/core/wbr/wbr.rb +4 -0
- data/app/concepts/matestack/ui/core/youtube/youtube.haml +1 -0
- data/app/concepts/matestack/ui/core/youtube/youtube.rb +26 -0
- data/app/helpers/matestack/ui/core/application_helper.rb +3 -1
- data/app/javascript/matestack-ui-core/index.js +22 -0
- data/app/javascript/matestack-ui-core/styles/index.scss +5 -0
- data/app/javascript/packs/matestack-ui-core.js +8 -0
- data/app/lib/matestack/ui/core/component_node.rb +30 -12
- data/app/lib/matestack/ui/core/has_view_context.rb +14 -0
- data/app/lib/matestack/ui/core/page_node.rb +26 -1
- data/app/lib/matestack/ui/core/render.rb +89 -0
- data/app/lib/matestack/ui/core/to_cell.rb +3 -1
- data/app/lib/matestack/ui/dynamic_actionview_component.rb +1 -0
- data/app/lib/matestack/ui/static_actionview_component.rb +1 -0
- data/config/routes.rb +0 -1
- data/lib/generators/matestack/app/USAGE +21 -0
- data/lib/generators/matestack/app/app_generator.rb +25 -0
- data/lib/generators/{matestack_app/templates/matestack_app_controller.erb → matestack/app/templates/app/controllers/%file_name%_controller.rb.tt} +0 -2
- data/lib/generators/matestack/app/templates/app/matestack/apps/%file_name%.rb.tt +28 -0
- data/lib/generators/matestack/component/USAGE +20 -0
- data/lib/generators/matestack/component/component_generator.rb +29 -0
- data/lib/generators/{matestack_component/templates/matestack_component.haml.erb → matestack/component/templates/app/matestack/components/%namespace%/%file_name%.haml.tt} +0 -0
- data/lib/generators/{matestack_component/templates/matestack_component.js.erb → matestack/component/templates/app/matestack/components/%namespace%/%file_name%.js.tt} +2 -2
- data/lib/generators/matestack/component/templates/app/matestack/components/%namespace%/%file_name%.rb.tt +11 -0
- data/lib/generators/{matestack_component/templates/matestack_component.scss.erb → matestack/component/templates/app/matestack/components/%namespace%/%file_name%.scss.tt} +0 -0
- data/lib/generators/matestack/core/component/USAGE +16 -0
- data/lib/generators/matestack/core/component/component_generator.rb +23 -0
- data/lib/generators/matestack/core/component/templates/app/concepts/matestack/ui/core/%file_name%/%file_name%.haml.tt +5 -0
- data/lib/generators/matestack/core/component/templates/app/concepts/matestack/ui/core/%file_name%/%file_name%.rb.tt +4 -0
- data/lib/generators/matestack/core/component/templates/docs/components/%file_name%.md.tt +45 -0
- data/lib/generators/matestack/core/component/templates/spec/usage/components/%file_name%_spec.rb +31 -0
- data/lib/generators/matestack/page/USAGE +28 -0
- data/lib/generators/matestack/page/page_generator.rb +54 -0
- data/lib/generators/matestack/page/templates/app/matestack/pages/%app_name%/%namespace%/%file_name%.rb.tt +29 -0
- data/lib/matestack/ui/core.rb +1 -0
- data/lib/matestack/ui/core/cell.rb +33 -0
- data/lib/matestack/ui/core/version.rb +1 -1
- data/vendor/assets/javascripts/dist/manifest.json +22 -0
- data/vendor/assets/javascripts/dist/manifest.json.br +0 -0
- data/vendor/assets/javascripts/dist/manifest.json.gz +0 -0
- data/vendor/assets/javascripts/dist/matestack-ui-core.css +3 -0
- data/vendor/assets/javascripts/dist/matestack-ui-core.css.map +1 -0
- data/vendor/assets/javascripts/dist/matestack-ui-core.js +16605 -0
- data/vendor/assets/javascripts/dist/matestack-ui-core.js.map +1 -0
- data/vendor/assets/javascripts/dist/matestack-ui-core.min.css +0 -0
- data/vendor/assets/javascripts/dist/matestack-ui-core.min.js +3 -0
- data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.LICENSE.txt +18 -0
- data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.br +0 -0
- data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.gz +0 -0
- data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.map +1 -0
- data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.map.br +0 -0
- data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.map.gz +0 -0
- data/vendor/assets/javascripts/matestack-ui-core.js.erb +2 -0
- data/vendor/assets/stylesheets/dist +1 -0
- data/vendor/assets/stylesheets/matestack-ui-core.css.erb +2 -0
- metadata +168 -32
- data/app/concepts/matestack/ui/core/view/view.haml +0 -2
- data/app/concepts/matestack/ui/core/view/view.js +0 -42
- data/app/concepts/matestack/ui/core/view/view.rb +0 -7
- data/lib/generators/matestack_app/USAGE +0 -21
- data/lib/generators/matestack_app/matestack_app_generator.rb +0 -26
- data/lib/generators/matestack_app/templates/matestack_app.erb +0 -26
- data/lib/generators/matestack_component/USAGE +0 -20
- data/lib/generators/matestack_component/matestack_component_generator.rb +0 -30
- data/lib/generators/matestack_component/templates/matestack_component.rb.erb +0 -13
- data/lib/generators/matestack_page/USAGE +0 -28
- data/lib/generators/matestack_page/matestack_page_generator.rb +0 -41
- data/lib/generators/matestack_page/templates/matestack_page.erb +0 -15
- data/vendor/assets/javascripts/manifest.json +0 -4
- data/vendor/assets/javascripts/matestack-ui-core.js +0 -15392
- data/vendor/assets/javascripts/matestack-ui-core.js.map +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b08e2fe0f19b178aa377ca1cac852e56f5faee7abdf5ec08f0738c1c11c5b59
|
4
|
+
data.tar.gz: b79c9bc5a5609a50b274a83103c23bc659cca9ae582b49c931b34c2921f723f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 668b12bb85128ca1cd306e256fa8e75159f1e1f62edc7af46807fcb2537ea090ac9aeafab3fddfc5f437e76dfcb522c3db4fb01997165795811770e0d16b216d
|
7
|
+
data.tar.gz: 1bac122005918a5c46b5526e3d619ddf9fd1371e15b664e6c5c64293656d1f2c9706f5fbbfb369eb355e875fe38f2e4f68f9165dc788661aa41ae0f1ac47a72c
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
|
1
|
+

|
2
2
|
[](https://gitter.im/basemate/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
3
3
|
[](https://badge.fury.io/rb/matestack-ui-core)
|
4
|
+
[](https://www.matestack.org/docs/install)
|
4
5
|
|
5
6
|

|
6
7
|
|
@@ -19,6 +20,17 @@ matestack can progressively replace the classic Rails-View-Layer. You are able t
|
|
19
20
|
it alongside your classic views and incrementally turn your Rails-App into a
|
20
21
|
dynamic Web-App.
|
21
22
|
|
23
|
+
### Current State:
|
24
|
+
|
25
|
+
We love to see more and more people using and contributing to matestack-ui-core. Our current version is 0.7.4 and it's not perfect yet. We recommend you to start using matestack-ui-core in a side project and report issues as this helps us to push matestack-ui-core towards a production ready 1.0.0. At matestack, we already use matestack-ui-core in production as we know how to handle current issues and bypass them with deep insights of the core implementation. We plan to invest time and money (yes, we're hiring) on following improvements:
|
26
|
+
|
27
|
+
* debugging and error handling
|
28
|
+
* core refactoring, increased core maintainability and code quality
|
29
|
+
* better integration in existing rails apps
|
30
|
+
* improved documentation
|
31
|
+
* improved dynamic core components (especially form components)
|
32
|
+
|
33
|
+
|
22
34
|
### Installation:
|
23
35
|
|
24
36
|
Click here to see how you can add Matestack UI to your existing Rails application: [Installation Guide](./docs/install)
|
@@ -30,7 +42,7 @@ Click here to see how you can add Matestack UI to your existing Rails applicatio
|
|
30
42
|
class Pages::MyPage < Matestack::Ui::Page
|
31
43
|
|
32
44
|
def prepare
|
33
|
-
@technologies = ["Rails", "Vue.js", "Trailblazer", "
|
45
|
+
@technologies = ["Rails", "Vue.js", "Trailblazer", "RSpec", "Capybara"]
|
34
46
|
end
|
35
47
|
|
36
48
|
def response
|
@@ -205,7 +217,7 @@ ActionCable.server.broadcast("matestack_ui_core", {
|
|
205
217
|
|
206
218
|
### Documentation
|
207
219
|
|
208
|
-
Documentation can be found [here](
|
220
|
+
Documentation can be found [here](https://www.matestack.org/docs/install)
|
209
221
|
|
210
222
|
### Changelog
|
211
223
|
|
@@ -213,7 +225,7 @@ Changelog can be found [here](./CHANGELOG.md)
|
|
213
225
|
|
214
226
|
### Roadmap
|
215
227
|
|
216
|
-
|
228
|
+
In order to see what we planned to add and release the upcoming months, just have a look at our future [milestones](https://github.com/basemate/matestack-ui-core/milestones) and get in touch via our [chat](https://gitter.im/basemate/community) for feedback! The upcoming issues and feature requests will be added to one of these milestones regarding priority and implementation effort.
|
217
229
|
|
218
230
|
### Community
|
219
231
|
|
data/Rakefile
CHANGED
@@ -32,3 +32,35 @@ require 'rake/testtask'
|
|
32
32
|
# end
|
33
33
|
#
|
34
34
|
# task default: :test
|
35
|
+
|
36
|
+
task :webpack => 'webpack:build'
|
37
|
+
|
38
|
+
namespace :webpack do
|
39
|
+
task :build => ['build:development', 'build:production']
|
40
|
+
|
41
|
+
namespace :build do
|
42
|
+
task :development => 'yarn:install' do
|
43
|
+
Bundler.with_unbundled_env do
|
44
|
+
sh "cd builder && bin/webpack"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
task :production => 'yarn:install' do
|
48
|
+
Bundler.with_unbundled_env do
|
49
|
+
sh "cd builder && bin/rake webpacker:compile"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
task :watch => 'yarn:install' do
|
55
|
+
Bundler.with_unbundled_env do
|
56
|
+
sh "cd builder && bin/webpack --watch"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
namespace :yarn do
|
61
|
+
task :install do
|
62
|
+
sh "yarn install && cd builder && yarn install"
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
@@ -2,9 +2,8 @@ import Vue from 'vue/dist/vue.esm'
|
|
2
2
|
import Vuex from 'vuex'
|
3
3
|
import axios from 'axios'
|
4
4
|
|
5
|
-
import matestackEventHub from 'js/event-hub'
|
6
|
-
|
7
|
-
import componentMixin from 'component/component'
|
5
|
+
import matestackEventHub from '../js/event-hub'
|
6
|
+
import componentMixin from '../component/component'
|
8
7
|
|
9
8
|
const componentDef = {
|
10
9
|
mixins: [componentMixin],
|
@@ -14,32 +13,55 @@ const componentDef = {
|
|
14
13
|
methods: {
|
15
14
|
perform: function(){
|
16
15
|
const self = this
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
}
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
16
|
+
if (
|
17
|
+
(self.componentConfig["confirm"] == undefined) || confirm(self.componentConfig["confirm_text"])
|
18
|
+
)
|
19
|
+
{
|
20
|
+
axios({
|
21
|
+
method: self.componentConfig["method"],
|
22
|
+
url: self.componentConfig["action_path"],
|
23
|
+
data: self.componentConfig["data"],
|
24
|
+
headers: {
|
25
|
+
'X-CSRF-Token': document.getElementsByName("csrf-token")[0].getAttribute('content')
|
26
|
+
}
|
27
|
+
})
|
28
|
+
.then(function(response){
|
29
|
+
if (self.componentConfig["success"] != undefined && self.componentConfig["success"]["emit"] != undefined) {
|
30
|
+
matestackEventHub.$emit(self.componentConfig["success"]["emit"], response.data);
|
31
|
+
}
|
32
|
+
if (self.componentConfig["success"] != undefined
|
33
|
+
&& self.componentConfig["success"]["transition"] != undefined
|
34
|
+
&& (
|
35
|
+
self.componentConfig["success"]["transition"]["follow_response"] == undefined
|
36
|
+
||
|
37
|
+
self.componentConfig["success"]["transition"]["follow_response"] === false
|
38
|
+
)
|
39
|
+
&& self.$store != undefined
|
40
|
+
) {
|
41
|
+
let path = self.componentConfig["success"]["transition"]["path"]
|
42
|
+
self.$store.dispatch('navigateTo', {url: path, backwards: false})
|
43
|
+
return;
|
44
|
+
}
|
45
|
+
if (self.componentConfig["success"] != undefined
|
46
|
+
&& self.componentConfig["success"]["transition"] != undefined
|
47
|
+
&& self.componentConfig["success"]["transition"]["follow_response"] === true
|
48
|
+
&& self.$store != undefined
|
49
|
+
) {
|
50
|
+
let path = response.data["transition_to"] || response.request.responseURL;
|
51
|
+
self.$store.dispatch('navigateTo', {url: path, backwards: false});
|
52
|
+
return;
|
53
|
+
}
|
54
|
+
})
|
55
|
+
.catch(function(error){
|
56
|
+
if (self.componentConfig["failure"] != undefined && self.componentConfig["failure"]["emit"] != undefined) {
|
57
|
+
matestackEventHub.$emit(self.componentConfig["failure"]["emit"], error.response.data);
|
58
|
+
}
|
59
|
+
if (self.componentConfig["failure"] != undefined && self.componentConfig["failure"]["transition"] != undefined && self.$store != undefined) {
|
60
|
+
let path = self.componentConfig["failure"]["transition"]["path"]
|
61
|
+
self.$store.dispatch('navigateTo', {url: path, backwards: false})
|
62
|
+
}
|
63
|
+
})
|
64
|
+
}
|
43
65
|
}
|
44
66
|
}
|
45
67
|
}
|
@@ -19,6 +19,9 @@ module Matestack::Ui::Core::Action
|
|
19
19
|
if options[:notify].nil?
|
20
20
|
@component_config[:notify] = true
|
21
21
|
end
|
22
|
+
if @component_config[:confirm] = options[:confirm]
|
23
|
+
@component_config[:confirm_text] = options[:confirm].try(:[], :text) || "Are you sure?"
|
24
|
+
end
|
22
25
|
end
|
23
26
|
|
24
27
|
def action_path
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Matestack::Ui::Core::Actionview
|
2
|
+
class Dynamic < Matestack::Ui::Core::Component::Dynamic
|
3
|
+
|
4
|
+
include ActionView::Helpers::ActiveModelHelper
|
5
|
+
include ActionView::Helpers::ActiveModelInstanceTag
|
6
|
+
include ActionView::Helpers::AssetTagHelper
|
7
|
+
include ActionView::Helpers::AssetUrlHelper
|
8
|
+
include ActionView::Helpers::AtomFeedHelper
|
9
|
+
include ActionView::Helpers::CacheHelper
|
10
|
+
include ActionView::Helpers::CaptureHelper
|
11
|
+
include ActionView::Helpers::CspHelper
|
12
|
+
include ActionView::Helpers::CsrfHelper
|
13
|
+
include ActionView::Helpers::DateHelper
|
14
|
+
include ActionView::Helpers::DebugHelper
|
15
|
+
include ActionView::Helpers::FormHelper
|
16
|
+
include ActionView::Helpers::FormOptionsHelper
|
17
|
+
include ActionView::Helpers::FormTagHelper
|
18
|
+
include ActionView::Helpers::JavaScriptHelper
|
19
|
+
include ActionView::Helpers::NumberHelper
|
20
|
+
include ActionView::Helpers::OutputSafetyHelper
|
21
|
+
include ActionView::Helpers::SanitizeHelper
|
22
|
+
include ActionView::Helpers::TagHelper
|
23
|
+
include ActionView::Helpers::TextHelper
|
24
|
+
include ActionView::Helpers::TranslationHelper
|
25
|
+
include ActionView::Helpers::UrlHelper
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
= render_content
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Matestack::Ui::Core::Actionview
|
2
|
+
class Static < Matestack::Ui::Core::Component::Static
|
3
|
+
|
4
|
+
include ActionView::Helpers::ActiveModelHelper
|
5
|
+
include ActionView::Helpers::ActiveModelInstanceTag
|
6
|
+
include ActionView::Helpers::AssetTagHelper
|
7
|
+
include ActionView::Helpers::AssetUrlHelper
|
8
|
+
include ActionView::Helpers::AtomFeedHelper
|
9
|
+
include ActionView::Helpers::CacheHelper
|
10
|
+
include ActionView::Helpers::CaptureHelper
|
11
|
+
include ActionView::Helpers::CspHelper
|
12
|
+
include ActionView::Helpers::CsrfHelper
|
13
|
+
include ActionView::Helpers::DateHelper
|
14
|
+
include ActionView::Helpers::DebugHelper
|
15
|
+
include ActionView::Helpers::FormHelper
|
16
|
+
include ActionView::Helpers::FormOptionsHelper
|
17
|
+
include ActionView::Helpers::FormTagHelper
|
18
|
+
include ActionView::Helpers::JavaScriptHelper
|
19
|
+
include ActionView::Helpers::NumberHelper
|
20
|
+
include ActionView::Helpers::OutputSafetyHelper
|
21
|
+
include ActionView::Helpers::SanitizeHelper
|
22
|
+
include ActionView::Helpers::TagHelper
|
23
|
+
include ActionView::Helpers::TextHelper
|
24
|
+
include ActionView::Helpers::TranslationHelper
|
25
|
+
include ActionView::Helpers::UrlHelper
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import Vue from 'vue/dist/vue.esm'
|
2
|
-
import axios from 'axios'
|
3
2
|
import VRuntimeTemplate from "v-runtime-template"
|
4
3
|
import Vuex from 'vuex'
|
4
|
+
import isNavigatingToAnotherPage from "./location"
|
5
5
|
|
6
6
|
const componentDef = {
|
7
7
|
props: ['appConfig', 'params'],
|
@@ -10,11 +10,20 @@ const componentDef = {
|
|
10
10
|
},
|
11
11
|
computed: Vuex.mapState({
|
12
12
|
asyncTemplate: state => state.pageTemplate,
|
13
|
+
currentPathName: state => state.currentPathName,
|
14
|
+
currentSearch: state => state.currentSearch,
|
15
|
+
currentOrigin: state => state.currentOrigin,
|
13
16
|
}),
|
14
17
|
mounted: function(){
|
15
18
|
const self = this;
|
16
|
-
window.onpopstate =
|
17
|
-
|
19
|
+
window.onpopstate = (event) => {
|
20
|
+
if (isNavigatingToAnotherPage({
|
21
|
+
origin: self.currentOrigin,
|
22
|
+
pathName: self.currentPathName,
|
23
|
+
search: self.currentSearch
|
24
|
+
}, document.location)){
|
25
|
+
self.$store.dispatch("navigateTo", {url: document.location.pathname, backwards: true} );
|
26
|
+
}
|
18
27
|
}
|
19
28
|
},
|
20
29
|
components: {
|
@@ -22,6 +31,8 @@ const componentDef = {
|
|
22
31
|
}
|
23
32
|
}
|
24
33
|
|
34
|
+
|
35
|
+
|
25
36
|
let component = Vue.component('matestack-ui-core-app', componentDef)
|
26
37
|
|
27
38
|
export default componentDef
|
@@ -1,33 +1,9 @@
|
|
1
1
|
module Matestack::Ui::Core::App
|
2
2
|
class App < Trailblazer::Cell
|
3
|
-
|
4
|
-
include
|
5
|
-
include ActionView::Helpers::AssetTagHelper
|
6
|
-
include ActionView::Helpers::AssetUrlHelper
|
7
|
-
include ActionView::Helpers::AtomFeedHelper
|
8
|
-
include ActionView::Helpers::CacheHelper
|
9
|
-
include ActionView::Helpers::CaptureHelper
|
10
|
-
include ActionView::Helpers::CspHelper
|
11
|
-
include ActionView::Helpers::CsrfHelper
|
12
|
-
include ActionView::Helpers::DateHelper
|
13
|
-
include ActionView::Helpers::DebugHelper
|
14
|
-
include ActionView::Helpers::FormHelper
|
15
|
-
include ActionView::Helpers::FormOptionsHelper
|
16
|
-
include ActionView::Helpers::FormTagHelper
|
17
|
-
include ActionView::Helpers::JavaScriptHelper
|
18
|
-
include ActionView::Helpers::NumberHelper
|
19
|
-
include ActionView::Helpers::OutputSafetyHelper
|
20
|
-
include ActionView::Helpers::RecordTagHelper
|
21
|
-
# include ActionView::Helpers::RenderingHelper
|
22
|
-
include ActionView::Helpers::SanitizeHelper
|
23
|
-
include ActionView::Helpers::TagHelper
|
24
|
-
include ActionView::Helpers::TextHelper
|
25
|
-
include ActionView::Helpers::TranslationHelper
|
26
|
-
include ActionView::Helpers::UrlHelper
|
27
|
-
include ::Cell::Haml
|
3
|
+
|
4
|
+
include Matestack::Ui::Core::Cell
|
28
5
|
include Matestack::Ui::Core::ApplicationHelper
|
29
6
|
include Matestack::Ui::Core::ToCell
|
30
|
-
# include ::Rails.application.routes.url_helpers
|
31
7
|
|
32
8
|
view_paths << "#{Matestack::Ui::Core::Engine.root}/app/concepts"
|
33
9
|
|
@@ -53,7 +29,6 @@ module Matestack::Ui::Core::App
|
|
53
29
|
return ""
|
54
30
|
end
|
55
31
|
|
56
|
-
|
57
32
|
def initialize(model=nil, options={})
|
58
33
|
super
|
59
34
|
@nodes = {}
|
@@ -87,7 +62,7 @@ module Matestack::Ui::Core::App
|
|
87
62
|
@nodes = Matestack::Ui::Core::AppNode.build(self, &block)
|
88
63
|
|
89
64
|
@nodes.each do |key, node|
|
90
|
-
@cells[key] = to_cell(key, node["component_name"], node["config"], node["argument"], node["components"], nil)
|
65
|
+
@cells[key] = to_cell(key, node["component_name"], node["config"], node["argument"], node["components"], nil, node["cached_params"])
|
91
66
|
end
|
92
67
|
end
|
93
68
|
|
@@ -0,0 +1,9 @@
|
|
1
|
+
const isNavigatingToAnotherPage = function(currentLocation, targetLocation) {
|
2
|
+
|
3
|
+
// omits hash by design
|
4
|
+
return currentLocation.pathName !== targetLocation.pathname ||
|
5
|
+
currentLocation.origin !== targetLocation.origin ||
|
6
|
+
currentLocation.search !== targetLocation.search
|
7
|
+
}
|
8
|
+
|
9
|
+
export default isNavigatingToAnotherPage
|
@@ -1,22 +1,28 @@
|
|
1
1
|
import Vue from 'vue/dist/vue.esm'
|
2
2
|
import Vuex from 'vuex'
|
3
3
|
import axios from 'axios'
|
4
|
-
|
5
|
-
import matestackEventHub from 'js/event-hub'
|
4
|
+
import matestackEventHub from '../js/event-hub'
|
6
5
|
|
7
6
|
Vue.use(Vuex)
|
8
7
|
|
9
8
|
const store = new Vuex.Store({
|
10
9
|
state: {
|
11
10
|
pageTemplate: null,
|
12
|
-
|
11
|
+
currentPathName: document.location.pathname,
|
12
|
+
currentSearch: document.location.search,
|
13
|
+
currentOrigin: document.location.origin
|
13
14
|
},
|
14
15
|
mutations: {
|
15
16
|
setPageTemplate (state, serverResponse){
|
16
17
|
state.pageTemplate = serverResponse
|
17
18
|
},
|
18
|
-
|
19
|
-
state.
|
19
|
+
setCurrentLocation (state, current){
|
20
|
+
state.currentPathName = current.path
|
21
|
+
state.currentSearch = current.search
|
22
|
+
state.currentOrigin = current.origin
|
23
|
+
},
|
24
|
+
resetPageTemplate (state) {
|
25
|
+
state.pageTemplate = null;
|
20
26
|
}
|
21
27
|
},
|
22
28
|
actions: {
|
@@ -47,7 +53,7 @@ const store = new Vuex.Store({
|
|
47
53
|
setTimeout(function () {
|
48
54
|
resolve(response["data"])
|
49
55
|
commit('setPageTemplate', response["data"])
|
50
|
-
commit('
|
56
|
+
commit('setCurrentLocation', { path: url, search: document.location.search, origin: document.location.origin })
|
51
57
|
matestackEventHub.$emit("page_loaded", url);
|
52
58
|
if (typeof matestackUiCoreTransitionSuccess !== 'undefined') {
|
53
59
|
matestackUiCoreTransitionSuccess(url);
|