matestack-ui-core 0.7.2.1 → 1.0.0.rc.1
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/LICENSE +8 -0
- data/README.md +28 -204
- data/Rakefile +32 -0
- data/app/concepts/matestack/ui/core/abbr/abbr.haml +2 -2
- data/app/concepts/matestack/ui/core/abbr/abbr.rb +3 -2
- data/app/concepts/matestack/ui/core/action/action.js +114 -11
- data/app/concepts/matestack/ui/core/action/action.rb +41 -13
- data/app/concepts/matestack/ui/core/{component/response_dynamic.haml → actionview/dynamic.haml} +2 -3
- data/app/concepts/matestack/ui/core/actionview/dynamic.rb +28 -0
- data/app/concepts/matestack/ui/core/{component → actionview}/static.haml +0 -0
- data/app/concepts/matestack/ui/core/actionview/static.rb +28 -0
- data/app/concepts/matestack/ui/core/address/address.haml +2 -2
- data/app/concepts/matestack/ui/core/address/address.rb +1 -1
- data/app/concepts/matestack/ui/core/app/app.haml +2 -3
- data/app/concepts/matestack/ui/core/app/app.js +18 -4
- data/app/concepts/matestack/ui/core/app/app.rb +34 -81
- data/app/concepts/matestack/ui/core/app/location.js +9 -0
- data/app/concepts/matestack/ui/core/app/store.js +35 -6
- data/app/concepts/matestack/ui/core/area/area.haml +1 -0
- data/app/concepts/matestack/ui/core/area/area.rb +20 -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 +6 -2
- data/app/concepts/matestack/ui/core/async/async.js +64 -8
- data/app/concepts/matestack/ui/core/async/async.rb +29 -4
- data/app/concepts/matestack/ui/core/async/children_wrapper.haml +2 -0
- data/app/concepts/matestack/ui/core/{pg/pg.haml → b/b.haml} +1 -1
- 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/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 -4
- data/app/concepts/matestack/ui/core/collection/content/content.rb +2 -2
- data/app/concepts/matestack/ui/core/collection/content/page/link/link.rb +4 -2
- data/app/concepts/matestack/ui/core/collection/filter/filter.js +3 -3
- data/app/concepts/matestack/ui/core/collection/filter/filter.rb +4 -5
- data/app/concepts/matestack/ui/core/collection/filter/select/select.haml +10 -0
- data/app/concepts/matestack/ui/core/collection/filter/select/select.rb +29 -0
- data/app/concepts/matestack/ui/core/collection/helper.rb +14 -6
- data/app/concepts/matestack/ui/core/collection/order/order.js +4 -4
- data/app/concepts/matestack/ui/core/collection/order/order.rb +4 -5
- data/app/concepts/matestack/ui/core/collection/order/toggle/indicator/indicator.rb +6 -5
- data/app/concepts/matestack/ui/core/component/anonym-dynamic-component.js +1 -1
- data/app/concepts/matestack/ui/core/component/base.rb +424 -0
- data/app/concepts/matestack/ui/core/component/children.haml +2 -2
- data/app/concepts/matestack/ui/core/component/component.js +1 -55
- data/app/concepts/matestack/ui/core/component/dynamic.haml +1 -1
- data/app/concepts/matestack/ui/core/component/dynamic.rb +24 -239
- data/app/concepts/matestack/ui/core/component/rerender.rb +8 -0
- data/app/concepts/matestack/ui/core/component/static.rb +3 -12
- 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/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/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/checkbox/checkbox.rb +79 -0
- data/app/concepts/matestack/ui/core/form/form.js +266 -96
- data/app/concepts/matestack/ui/core/form/form.rb +29 -2
- data/app/concepts/matestack/ui/core/form/has_errors.rb +54 -0
- data/app/concepts/matestack/ui/core/form/has_input_html_attributes.rb +13 -0
- data/app/concepts/matestack/ui/core/form/input/input.rb +39 -52
- data/app/concepts/matestack/ui/core/form/radio/radio.rb +71 -0
- data/app/concepts/matestack/ui/core/form/select/select.haml +9 -76
- data/app/concepts/matestack/ui/core/form/select/select.rb +64 -49
- data/app/concepts/matestack/ui/core/form/submit/submit.rb +4 -1
- data/app/concepts/matestack/ui/core/form/textarea/textarea.rb +28 -0
- data/app/concepts/matestack/ui/core/form/utils.rb +47 -0
- data/app/concepts/matestack/ui/core/heading/heading.rb +2 -0
- 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.rb +1 -0
- data/app/concepts/matestack/ui/core/input/input.haml +1 -3
- data/app/concepts/matestack/ui/core/input/input.rb +8 -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/isolated/children_wrapper.haml +2 -0
- data/app/concepts/matestack/ui/core/isolated/isolated.haml +10 -0
- data/app/concepts/matestack/ui/core/isolated/isolated.js +108 -0
- data/app/concepts/matestack/ui/core/isolated/isolated.rb +59 -0
- data/app/concepts/matestack/ui/core/js/core.js +43 -19
- 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.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/link/link.rb +7 -6
- data/app/concepts/matestack/ui/core/{absolute/absolute.haml → map/map.haml} +1 -1
- 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.js +2 -3
- data/app/concepts/matestack/ui/core/onclick/onclick.rb +1 -0
- 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 → content/content.js} +8 -2
- data/app/concepts/matestack/ui/core/page/content/content.rb +29 -0
- data/app/concepts/matestack/ui/core/page/page.haml +3 -9
- data/app/concepts/matestack/ui/core/page/page.rb +15 -160
- 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/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 -1
- 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/progress/progress.rb +1 -1
- 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/slot/slot.rb +2 -2
- 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/template/template.haml +3 -0
- data/app/concepts/matestack/ui/core/template/template.rb +4 -0
- data/app/concepts/matestack/ui/core/textarea/textarea.haml +2 -0
- data/app/concepts/matestack/ui/core/textarea/textarea.rb +10 -0
- data/app/concepts/matestack/ui/core/toggle/toggle.haml +2 -0
- data/app/concepts/matestack/ui/core/toggle/toggle.js +71 -0
- data/app/concepts/matestack/ui/core/toggle/toggle.rb +14 -0
- data/app/concepts/matestack/ui/core/transition/transition.js +18 -2
- data/app/concepts/matestack/ui/core/transition/transition.rb +2 -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/view/view.haml +1 -2
- data/app/concepts/matestack/ui/core/view/view.rb +27 -2
- 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.rb +1 -1
- data/app/helpers/matestack/ui/core/application_helper.rb +89 -17
- 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/component.rb +1 -0
- data/app/lib/matestack/ui/core/has_view_context.rb +14 -0
- data/app/lib/matestack/ui/core/html_attributes.rb +43 -0
- data/app/lib/matestack/ui/core/properties.rb +88 -0
- data/app/lib/matestack/ui/core/rendering/default_renderer_class_determiner.rb +33 -0
- data/app/lib/matestack/ui/core/rendering/main_renderer.rb +199 -0
- data/app/lib/matestack/ui/dynamic_actionview_component.rb +1 -0
- data/app/lib/matestack/ui/isolated_component.rb +1 -0
- data/app/lib/matestack/ui/static_actionview_component.rb +1 -0
- data/app/lib/matestack/ui/vue_js_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 +5 -2
- data/lib/matestack/ui/core/cell.rb +31 -0
- data/lib/matestack/ui/core/component/registry.rb +47 -0
- data/lib/matestack/ui/core/components.rb +267 -0
- data/lib/matestack/ui/core/dsl.rb +6 -0
- data/lib/matestack/ui/core/engine.rb +16 -0
- data/lib/matestack/ui/core/version.rb +1 -1
- data/vendor/assets/javascripts/dist/manifest.json +18 -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 +17060 -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.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.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 +188 -89
- data/MIT-LICENSE +0 -20
- data/app/concepts/matestack/ui/core/absolute/absolute.rb +0 -17
- data/app/concepts/matestack/ui/core/component/response.haml +0 -2
- data/app/concepts/matestack/ui/core/component/response_dynamic_without_rerender.haml +0 -3
- data/app/concepts/matestack/ui/core/form/inline/inline.haml +0 -6
- data/app/concepts/matestack/ui/core/form/inline/inline.rb +0 -9
- data/app/concepts/matestack/ui/core/form/input/input.haml +0 -27
- data/app/concepts/matestack/ui/core/html/html.haml +0 -3
- data/app/concepts/matestack/ui/core/html/html.js +0 -10
- data/app/concepts/matestack/ui/core/html/html.rb +0 -17
- data/app/concepts/matestack/ui/core/isolate/isolate.haml +0 -2
- data/app/concepts/matestack/ui/core/isolate/isolate.rb +0 -11
- data/app/concepts/matestack/ui/core/page/content.haml +0 -7
- data/app/concepts/matestack/ui/core/page/content.rb +0 -5
- data/app/concepts/matestack/ui/core/pg/pg.rb +0 -5
- data/app/concepts/matestack/ui/core/view/view.js +0 -42
- data/app/lib/matestack/ui/core/app_node.rb +0 -53
- data/app/lib/matestack/ui/core/component_node.rb +0 -73
- data/app/lib/matestack/ui/core/page_node.rb +0 -96
- data/app/lib/matestack/ui/core/to_cell.rb +0 -129
- 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 -15309
- 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: 137c2f647ff054f09a0579d87a69a8db93ee92b084f7d0c20c8113ed7d995345
|
4
|
+
data.tar.gz: de53377ab8eabb7e0b4600cbb08e5f9545b95c38d4880feb3626da5a8a5c6440
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca823a70552dc8f98f04517236ad16f9cc40ab1074f3a363f5b9276ca8fa706919b031c084da1d782bf6d2c4717cc67765f084a40c9f22ff79af53fc2b12f7cb
|
7
|
+
data.tar.gz: e4cd65cd6a80535193cd17a7249562c2c196929a0b9ba84684ecf9242bac3db49dc605fce3809596d27ca8870ee703d72aef4da8f69961d70f973de1a7870207
|
data/LICENSE
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
Copyright (c) Matestack GmbH
|
2
|
+
|
3
|
+
matestack-ui-core is an Open Source project licensed under the terms of
|
4
|
+
the LGPLv3 license. Please see <http://www.gnu.org/licenses/lgpl-3.0.html>
|
5
|
+
for license text.
|
6
|
+
|
7
|
+
Matestack will provide a commercial-friendly license allowing private forks
|
8
|
+
and modifications of matestack-ui-core. Please request at jonas@matestack.io
|
data/README.md
CHANGED
@@ -1,228 +1,52 @@
|
|
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://docs.matestack.io/docs/guides/install)
|
4
5
|
|
5
6
|

|
6
7
|
|
7
|
-
# matestack
|
8
|
+
# matestack-ui-core
|
8
9
|
|
9
|
-
##
|
10
|
+
## Escape the frontend hustle & easily create interactive web apps in pure Ruby
|
10
11
|
|
11
|
-
|
12
|
+
`matestack-ui-core` is a Rails engine for Ruby on Rails developers.
|
13
|
+
|
14
|
+
`matestack-ui-core` enables you to craft interactive web UIs without JavaScript in pure Ruby with minimum effort.
|
15
|
+
UI code becomes a native and fun part of your Rails app.
|
16
|
+
|
17
|
+
Work with pure Ruby. If necessary, extend with pure JavaScript. No Opal involved.
|
18
|
+
|
19
|
+
The main goals are:
|
12
20
|
|
13
21
|
- Reduction of complexity of modern web development, moving front and backend closer together
|
14
22
|
- More maintainable UI code, using a component-based structure written in Ruby
|
15
|
-
- Increased development speed and happiness, offering prebuilt UI-Components for
|
23
|
+
- Increased development speed and happiness, offering prebuilt UI-Components for typical requirements
|
16
24
|
- Modern, dynamic UI feeling without the need to implement a separate JavaScript Application
|
17
25
|
|
18
|
-
matestack can progressively replace the classic Rails-View-Layer. You are able to use
|
26
|
+
`matestack-ui-core` can progressively replace the classic Rails-View-Layer. You are able to use
|
19
27
|
it alongside your classic views and incrementally turn your Rails-App into a
|
20
28
|
dynamic Web-App.
|
21
29
|
|
22
|
-
|
23
|
-
|
24
|
-
Click here to see how you can add Matestack UI to your existing Rails application: [Installation Guide](./docs/install)
|
25
|
-
|
26
|
-
### Features:
|
27
|
-
|
28
|
-
#### Define your UI in a Ruby Class
|
29
|
-
```ruby
|
30
|
-
class Pages::MyPage < Matestack::Ui::Page
|
31
|
-
|
32
|
-
def prepare
|
33
|
-
@technologies = ["Rails", "Vue.js", "Trailblazer", "Rspec", "Capybara"]
|
34
|
-
end
|
35
|
-
|
36
|
-
def response
|
37
|
-
components{
|
38
|
-
div id: "technologies" do
|
39
|
-
@technologies.each do |technology|
|
40
|
-
plain "matestack uses #{technology}"
|
41
|
-
end
|
42
|
-
end
|
43
|
-
}
|
44
|
-
end
|
45
|
-
|
46
|
-
end
|
47
|
-
```
|
48
|
-
#### Create a Single Page Application without JavaScript
|
49
|
-
|
50
|
-
```ruby
|
51
|
-
class Apps::MyApp < Matestack::Ui::App
|
52
|
-
|
53
|
-
def response
|
54
|
-
components{
|
55
|
-
header do
|
56
|
-
heading size: 1, text: "My App"
|
57
|
-
end
|
58
|
-
nav do
|
59
|
-
transition path: :my_first_page_path do
|
60
|
-
button text: "Page 1"
|
61
|
-
end
|
62
|
-
transition path: :my_second_page_path do
|
63
|
-
button text: "Page 2"
|
64
|
-
end
|
65
|
-
end
|
66
|
-
main do
|
67
|
-
page_content #pages are dynamically yielded here, when buttons are clicked!
|
68
|
-
end
|
69
|
-
footer do
|
70
|
-
plain "That's it!"
|
71
|
-
end
|
72
|
-
}
|
73
|
-
end
|
74
|
-
|
75
|
-
end
|
76
|
-
```
|
77
|
-
|
78
|
-
```ruby
|
79
|
-
class Pages::MyApp::MyFirstPage < Matestack::Ui::Page
|
80
|
-
|
81
|
-
def response
|
82
|
-
components{
|
83
|
-
div id: "div-on-page-1" do
|
84
|
-
plain "My First Page"
|
85
|
-
end
|
86
|
-
}
|
87
|
-
end
|
88
|
-
|
89
|
-
end
|
90
|
-
```
|
91
|
-
```ruby
|
92
|
-
class Pages::MyApp::MySecondPage < Matestack::Ui::Page
|
93
|
-
|
94
|
-
def response
|
95
|
-
components{
|
96
|
-
div id: "div-on-page-2" do
|
97
|
-
plain "My Second Page"
|
98
|
-
end
|
99
|
-
}
|
100
|
-
end
|
101
|
-
|
102
|
-
end
|
103
|
-
```
|
104
|
-
#### Handle User Interaction dynamically without JavaScript
|
105
|
-
```ruby
|
106
|
-
class Pages::MyPage < Matestack::Ui::Page
|
107
|
-
|
108
|
-
def response
|
109
|
-
components {
|
110
|
-
action my_action_config do
|
111
|
-
button text: "Click me!"
|
112
|
-
end
|
113
|
-
#content gets rerendered without page reload if action succeeded
|
114
|
-
async rerender_on: "my_action_succeeded" do
|
115
|
-
div id: "my-div" do
|
116
|
-
plain DateTime.now
|
117
|
-
end
|
118
|
-
end
|
119
|
-
}
|
120
|
-
end
|
121
|
-
|
122
|
-
def my_action_config
|
123
|
-
{
|
124
|
-
method: :post,
|
125
|
-
path: :some_rails_routing_path,
|
126
|
-
success: {
|
127
|
-
emit: "my_action_succeeded"
|
128
|
-
}
|
129
|
-
}
|
130
|
-
end
|
131
|
-
|
132
|
-
end
|
133
|
-
```
|
134
|
-
#### Handle User Input dynamically without JavaScript
|
135
|
-
```ruby
|
136
|
-
class Pages::MyApp::MyFirstPage < Matestack::Ui::Page
|
137
|
-
|
138
|
-
def prepare
|
139
|
-
@my_model = MyModel.new
|
140
|
-
end
|
141
|
-
|
142
|
-
def response
|
143
|
-
components {
|
144
|
-
form my_form_config, :include do
|
145
|
-
form_input key: :some_model_attribute, type: :text
|
146
|
-
form_submit do
|
147
|
-
button text: "Submit me!"
|
148
|
-
end
|
149
|
-
end
|
150
|
-
async show_on: "form_has_errors", hide_after: 5000 do
|
151
|
-
plain "Data could not be submitted, please check form"
|
152
|
-
end
|
153
|
-
}
|
154
|
-
end
|
155
|
-
|
156
|
-
def my_form_config
|
157
|
-
{
|
158
|
-
for: @my_model,
|
159
|
-
method: :post,
|
160
|
-
path: :some_action_path,
|
161
|
-
success: {
|
162
|
-
transition: {
|
163
|
-
path: :my_second_page_path,
|
164
|
-
}
|
165
|
-
},
|
166
|
-
failure: {
|
167
|
-
emit: "form_has_errors"
|
168
|
-
}
|
169
|
-
}
|
170
|
-
end
|
171
|
-
|
172
|
-
end
|
173
|
-
```
|
174
|
-
#### Websocket Integration without JavaScript
|
175
|
-
```ruby
|
176
|
-
class Pages::MyPage < Matestack::Ui::Page
|
177
|
-
|
178
|
-
def prepare
|
179
|
-
@comments = Comment.last(5)
|
180
|
-
end
|
181
|
-
|
182
|
-
def response
|
183
|
-
components {
|
184
|
-
#content gets rerendered without page reload when
|
185
|
-
#websocket event is received
|
186
|
-
async rerender_on: "comments_changed" do
|
187
|
-
@comments.each do |comment|
|
188
|
-
div do
|
189
|
-
plain comment.content
|
190
|
-
end
|
191
|
-
end
|
192
|
-
end
|
193
|
-
}
|
194
|
-
end
|
195
|
-
|
196
|
-
end
|
197
|
-
```
|
198
|
-
somewhere else on the backend:
|
199
|
-
|
200
|
-
```ruby
|
201
|
-
ActionCable.server.broadcast("matestack_ui_core", {
|
202
|
-
message: "comments_changed"
|
203
|
-
})
|
204
|
-
```
|
205
|
-
|
206
|
-
### Documentation
|
207
|
-
|
208
|
-
Documentation can be found [here](https://www.matestack.org/docs/install)
|
209
|
-
|
210
|
-
### Changelog
|
30
|
+
## Features
|
211
31
|
|
212
|
-
|
32
|
+
Please have a look at our [landingpage](https://www.matestack.io), presenting the main features of `matestack-ui-core`
|
213
33
|
|
214
|
-
|
34
|
+
## Documentation/Installation
|
35
|
+
|
36
|
+
Documentation can be found [here](https://docs.matestack.io/docs/guides/install)
|
37
|
+
|
38
|
+
## Changelog
|
39
|
+
|
40
|
+
Changelog can be found [here](./CHANGELOG.md)
|
215
41
|
|
216
|
-
We're currently finalizing the roadmap towards to a stable 1.0 release, supposed to happen towards the end of the year! For details make sure to check the [release management project](https://github.com/basemate/matestack-ui-core/projects/2) and get in touch via our [chat](https://gitter.im/basemate/community) for feedback!
|
217
42
|
|
218
|
-
|
43
|
+
## Community
|
219
44
|
|
220
45
|
As a low-barrier feedback channel for our early users, we have set up a Gitter chat that can be found [here](https://gitter.im/basemate/community). You are very welcome to ask questions and send us feedback there!
|
221
46
|
|
222
|
-
|
47
|
+
## Contribution
|
223
48
|
|
224
|
-
We are happy to accept contributors of any kind. Please refer to the [Contribution Guide](
|
49
|
+
We are happy to accept contributors of any kind. Please refer to the [Contribution Guide](https://docs.matestack.io/docs/guides/contribute)
|
225
50
|
|
226
|
-
|
227
|
-
|
228
|
-
[MIT License](https://opensource.org/licenses/MIT).
|
51
|
+
## License
|
52
|
+
matestack-ui-core is an Open Source project licensed under the terms of the [LGPLv3 license](./LICENSE)
|
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],
|
@@ -13,31 +12,135 @@ const componentDef = {
|
|
13
12
|
},
|
14
13
|
methods: {
|
15
14
|
perform: function(){
|
15
|
+
const self = this
|
16
|
+
if (
|
17
|
+
(self.componentConfig["confirm"] == undefined) || confirm(self.componentConfig["confirm_text"])
|
18
|
+
)
|
19
|
+
{
|
20
|
+
if (self.componentConfig["emit"] != undefined) {
|
21
|
+
matestackEventHub.$emit(self.componentConfig["emit"]);
|
22
|
+
}
|
23
|
+
if (self.componentConfig["delay"] != undefined) {
|
24
|
+
setTimeout(function () {
|
25
|
+
self.sendRequest()
|
26
|
+
}, parseInt(self.componentConfig["delay"]));
|
27
|
+
} else {
|
28
|
+
this.sendRequest()
|
29
|
+
}
|
30
|
+
}
|
31
|
+
},
|
32
|
+
sendRequest: function(){
|
16
33
|
const self = this
|
17
34
|
axios({
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
35
|
+
method: self.componentConfig["method"],
|
36
|
+
url: self.componentConfig["action_path"],
|
37
|
+
data: self.componentConfig["data"],
|
38
|
+
headers: {
|
39
|
+
'X-CSRF-Token': document.getElementsByName("csrf-token")[0].getAttribute('content')
|
40
|
+
}
|
23
41
|
}
|
24
|
-
|
42
|
+
)
|
25
43
|
.then(function(response){
|
26
44
|
if (self.componentConfig["success"] != undefined && self.componentConfig["success"]["emit"] != undefined) {
|
27
45
|
matestackEventHub.$emit(self.componentConfig["success"]["emit"], response.data);
|
28
46
|
}
|
29
|
-
|
47
|
+
|
48
|
+
// transition handling
|
49
|
+
if (self.componentConfig["success"] != undefined
|
50
|
+
&& self.componentConfig["success"]["transition"] != undefined
|
51
|
+
&& (
|
52
|
+
self.componentConfig["success"]["transition"]["follow_response"] == undefined
|
53
|
+
||
|
54
|
+
self.componentConfig["success"]["transition"]["follow_response"] === false
|
55
|
+
)
|
56
|
+
&& self.$store != undefined
|
57
|
+
) {
|
30
58
|
let path = self.componentConfig["success"]["transition"]["path"]
|
31
59
|
self.$store.dispatch('navigateTo', {url: path, backwards: false})
|
60
|
+
return;
|
61
|
+
}
|
62
|
+
if (self.componentConfig["success"] != undefined
|
63
|
+
&& self.componentConfig["success"]["transition"] != undefined
|
64
|
+
&& self.componentConfig["success"]["transition"]["follow_response"] === true
|
65
|
+
&& self.$store != undefined
|
66
|
+
) {
|
67
|
+
let path = response.data["transition_to"] || response.request.responseURL
|
68
|
+
self.$store.dispatch('navigateTo', {url: path, backwards: false})
|
69
|
+
return;
|
70
|
+
}
|
71
|
+
// redirect handling
|
72
|
+
if (self.componentConfig["success"] != undefined
|
73
|
+
&& self.componentConfig["success"]["redirect"] != undefined
|
74
|
+
&& (
|
75
|
+
self.componentConfig["success"]["redirect"]["follow_response"] == undefined
|
76
|
+
||
|
77
|
+
self.componentConfig["success"]["redirect"]["follow_response"] === false
|
78
|
+
)
|
79
|
+
&& self.$store != undefined
|
80
|
+
) {
|
81
|
+
let path = self.componentConfig["success"]["redirect"]["path"]
|
82
|
+
window.location.href = path
|
83
|
+
return;
|
84
|
+
}
|
85
|
+
if (self.componentConfig["success"] != undefined
|
86
|
+
&& self.componentConfig["success"]["redirect"] != undefined
|
87
|
+
&& self.componentConfig["success"]["redirect"]["follow_response"] === true
|
88
|
+
&& self.$store != undefined
|
89
|
+
) {
|
90
|
+
let path = response.data["redirect_to"] || response.request.responseURL
|
91
|
+
window.location.href = path
|
92
|
+
return;
|
32
93
|
}
|
33
94
|
})
|
34
95
|
.catch(function(error){
|
35
96
|
if (self.componentConfig["failure"] != undefined && self.componentConfig["failure"]["emit"] != undefined) {
|
36
97
|
matestackEventHub.$emit(self.componentConfig["failure"]["emit"], error.response.data);
|
37
98
|
}
|
38
|
-
|
99
|
+
// transition handling
|
100
|
+
if (self.componentConfig["failure"] != undefined
|
101
|
+
&& self.componentConfig["failure"]["transition"] != undefined
|
102
|
+
&& (
|
103
|
+
self.componentConfig["failure"]["transition"]["follow_response"] == undefined
|
104
|
+
||
|
105
|
+
self.componentConfig["failure"]["transition"]["follow_response"] === false
|
106
|
+
)
|
107
|
+
&& self.$store != undefined
|
108
|
+
) {
|
39
109
|
let path = self.componentConfig["failure"]["transition"]["path"]
|
40
110
|
self.$store.dispatch('navigateTo', {url: path, backwards: false})
|
111
|
+
return;
|
112
|
+
}
|
113
|
+
if (self.componentConfig["failure"] != undefined
|
114
|
+
&& self.componentConfig["failure"]["transition"] != undefined
|
115
|
+
&& self.componentConfig["failure"]["transition"]["follow_response"] === true
|
116
|
+
&& self.$store != undefined
|
117
|
+
) {
|
118
|
+
let path = error.response.data["transition_to"] || response.request.responseURL
|
119
|
+
self.$store.dispatch('navigateTo', {url: path, backwards: false})
|
120
|
+
return;
|
121
|
+
}
|
122
|
+
// redirect handling
|
123
|
+
if (self.componentConfig["failure"] != undefined
|
124
|
+
&& self.componentConfig["failure"]["redirect"] != undefined
|
125
|
+
&& (
|
126
|
+
self.componentConfig["failure"]["redirect"]["follow_response"] == undefined
|
127
|
+
||
|
128
|
+
self.componentConfig["failure"]["redirect"]["follow_response"] === false
|
129
|
+
)
|
130
|
+
&& self.$store != undefined
|
131
|
+
) {
|
132
|
+
let path = self.componentConfig["failure"]["redirect"]["path"]
|
133
|
+
window.location.href = path
|
134
|
+
return;
|
135
|
+
}
|
136
|
+
if (self.componentConfig["failure"] != undefined
|
137
|
+
&& self.componentConfig["failure"]["redirect"] != undefined
|
138
|
+
&& self.componentConfig["failure"]["redirect"]["follow_response"] === true
|
139
|
+
&& self.$store != undefined
|
140
|
+
) {
|
141
|
+
let path = error.response.data["redirect_to"] || response.request.responseURL
|
142
|
+
window.location.href = path
|
143
|
+
return;
|
41
144
|
}
|
42
145
|
})
|
43
146
|
}
|