matestack-ui-core 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of matestack-ui-core might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +18 -12
- data/app/concepts/{absolute/view → matestack/ui/core/absolute}/absolute.haml +0 -0
- data/app/concepts/{absolute/cell → matestack/ui/core/absolute}/absolute.rb +2 -2
- data/app/concepts/matestack/ui/core/action/action.haml +3 -0
- data/app/concepts/{action/js → matestack/ui/core/action}/action.js +3 -3
- data/app/concepts/{action/cell → matestack/ui/core/action}/action.rb +2 -2
- data/app/concepts/{app/view → matestack/ui/core/app}/app.haml +1 -1
- data/app/concepts/{app/js → matestack/ui/core/app}/app.js +1 -1
- data/app/concepts/{app/cell → matestack/ui/core/app}/app.rb +28 -5
- data/app/concepts/{app/js → matestack/ui/core/app}/store.js +1 -1
- data/app/concepts/{async/view → matestack/ui/core/async}/async.haml +0 -0
- data/app/concepts/{async/js → matestack/ui/core/async}/async.js +3 -3
- data/app/concepts/matestack/ui/core/async/async.rb +10 -0
- data/app/concepts/{br/view → matestack/ui/core/br}/br.haml +2 -2
- data/app/concepts/matestack/ui/core/br/br.rb +5 -0
- data/app/concepts/{button/view → matestack/ui/core/button}/button.haml +0 -0
- data/app/concepts/matestack/ui/core/button/button.rb +5 -0
- data/app/concepts/matestack/ui/core/component/anonym-dynamic-component.js +10 -0
- data/app/concepts/{component/view → matestack/ui/core/component}/children.haml +0 -0
- data/app/concepts/{component/js → matestack/ui/core/component}/component.js +1 -1
- data/app/concepts/{component/view → matestack/ui/core/component}/dynamic.haml +0 -0
- data/app/concepts/{component/cell → matestack/ui/core/component}/dynamic.rb +51 -13
- data/app/concepts/{component/view → matestack/ui/core/component}/dynamic_without_rerender.haml +0 -0
- data/app/concepts/{component/view → matestack/ui/core/component}/response.haml +0 -0
- data/app/concepts/{component/view → matestack/ui/core/component}/response_dynamic.haml +0 -0
- data/app/concepts/{component/view → matestack/ui/core/component}/response_dynamic_without_rerender.haml +0 -0
- data/app/concepts/{component/view → matestack/ui/core/component}/static.haml +0 -0
- data/app/concepts/{component/cell → matestack/ui/core/component}/static.rb +3 -3
- data/app/concepts/{div/view → matestack/ui/core/div}/div.haml +0 -0
- data/app/concepts/matestack/ui/core/div/div.rb +6 -0
- data/app/concepts/{footer/view → matestack/ui/core/footer}/footer.haml +0 -0
- data/app/concepts/matestack/ui/core/footer/footer.rb +5 -0
- data/app/concepts/{form/view → matestack/ui/core/form}/form.haml +0 -0
- data/app/concepts/{form/js → matestack/ui/core/form}/form.js +3 -3
- data/app/concepts/{form/cell → matestack/ui/core/form}/form.rb +2 -2
- data/app/concepts/{form/view → matestack/ui/core/form/inline}/inline.haml +0 -0
- data/app/concepts/matestack/ui/core/form/inline/inline.rb +9 -0
- data/app/concepts/{form/view → matestack/ui/core/form/input}/input.haml +0 -0
- data/app/concepts/{form/cell → matestack/ui/core/form/input}/input.rb +2 -2
- data/app/concepts/{form/view → matestack/ui/core/form/select}/select.haml +0 -0
- data/app/concepts/{form/cell → matestack/ui/core/form/select}/select.rb +2 -2
- data/app/concepts/{form/view → matestack/ui/core/form/submit}/submit.haml +0 -0
- data/app/concepts/matestack/ui/core/form/submit/submit.rb +9 -0
- data/app/concepts/{header/view → matestack/ui/core/header}/header.haml +0 -0
- data/app/concepts/matestack/ui/core/header/header.rb +5 -0
- data/app/concepts/{heading/view → matestack/ui/core/heading}/heading.haml +0 -0
- data/app/concepts/matestack/ui/core/heading/heading.rb +5 -0
- data/app/concepts/matestack/ui/core/hr/hr.haml +1 -0
- data/app/concepts/matestack/ui/core/hr/hr.rb +5 -0
- data/app/concepts/{html/view → matestack/ui/core/html}/html.haml +0 -0
- data/app/concepts/matestack/ui/core/html/html.js +10 -0
- data/app/concepts/{html/cell → matestack/ui/core/html}/html.rb +2 -2
- data/app/concepts/{icon/view → matestack/ui/core/icon}/icon.haml +0 -0
- data/app/concepts/matestack/ui/core/icon/icon.rb +5 -0
- data/app/concepts/{img/view → matestack/ui/core/img}/img.haml +0 -0
- data/app/concepts/matestack/ui/core/img/img.rb +5 -0
- data/app/concepts/{input/view → matestack/ui/core/input}/input.haml +0 -0
- data/app/concepts/matestack/ui/core/input/input.rb +5 -0
- data/app/concepts/matestack/ui/core/js/core.js +27 -0
- data/app/concepts/{core → matestack/ui/core}/js/event-hub.js +0 -0
- data/app/concepts/{label/view → matestack/ui/core/label}/label.haml +0 -0
- data/app/concepts/matestack/ui/core/label/label.rb +5 -0
- data/app/concepts/{li/view → matestack/ui/core/li}/li.haml +0 -0
- data/app/concepts/matestack/ui/core/li/li.rb +5 -0
- data/app/concepts/{link/view → matestack/ui/core/link}/link.haml +0 -0
- data/app/concepts/{link/cell → matestack/ui/core/link}/link.rb +2 -2
- data/app/concepts/{main/view → matestack/ui/core/main}/main.haml +0 -0
- data/app/concepts/matestack/ui/core/main/main.rb +5 -0
- data/app/concepts/{nav/view → matestack/ui/core/nav}/nav.haml +0 -0
- data/app/concepts/matestack/ui/core/nav/nav.rb +5 -0
- data/app/concepts/matestack/ui/core/ol/ol.haml +3 -0
- data/app/concepts/matestack/ui/core/ol/ol.rb +5 -0
- data/app/concepts/{onclick/view → matestack/ui/core/onclick}/onclick.haml +0 -0
- data/app/concepts/{onclick/js → matestack/ui/core/onclick}/onclick.js +3 -3
- data/app/concepts/matestack/ui/core/onclick/onclick.rb +6 -0
- data/app/concepts/{page/view → matestack/ui/core/page}/content.haml +0 -0
- data/app/concepts/{page/js → matestack/ui/core/page}/content.js +2 -2
- data/app/concepts/matestack/ui/core/page/content.rb +5 -0
- data/app/concepts/{page/view → matestack/ui/core/page}/page.haml +0 -0
- data/app/concepts/{page/cell → matestack/ui/core/page}/page.rb +28 -6
- data/app/concepts/{pg/view/pg.haml → matestack/ui/core/paragraph/paragraph.haml} +0 -0
- data/app/concepts/matestack/ui/core/paragraph/paragraph.rb +5 -0
- data/app/concepts/{partial/view → matestack/ui/core/partial}/partial.haml +0 -0
- data/app/concepts/matestack/ui/core/partial/partial.rb +5 -0
- data/app/concepts/matestack/ui/core/pg/pg.haml +8 -0
- data/app/concepts/matestack/ui/core/pg/pg.rb +5 -0
- data/app/concepts/matestack/ui/core/plain/plain.rb +10 -0
- data/app/concepts/matestack/ui/core/progress/progress.haml +3 -0
- data/app/concepts/matestack/ui/core/progress/progress.rb +14 -0
- data/app/concepts/{section/view → matestack/ui/core/section}/section.haml +0 -0
- data/app/concepts/matestack/ui/core/section/section.rb +5 -0
- data/app/concepts/{slot/view → matestack/ui/core/slot}/slot.haml +0 -0
- data/app/concepts/matestack/ui/core/slot/slot.rb +5 -0
- data/app/concepts/{span/view → matestack/ui/core/span}/span.haml +0 -0
- data/app/concepts/matestack/ui/core/span/span.rb +5 -0
- data/app/concepts/matestack/ui/core/table/table.haml +3 -0
- data/app/concepts/matestack/ui/core/table/table.rb +5 -0
- data/app/concepts/matestack/ui/core/td/td.haml +8 -0
- data/app/concepts/matestack/ui/core/td/td.rb +5 -0
- data/app/concepts/matestack/ui/core/th/th.haml +8 -0
- data/app/concepts/matestack/ui/core/th/th.rb +5 -0
- data/app/concepts/matestack/ui/core/time/time.haml +3 -0
- data/app/concepts/matestack/ui/core/time/time.rb +11 -0
- data/app/concepts/matestack/ui/core/tr/tr.haml +3 -0
- data/app/concepts/matestack/ui/core/tr/tr.rb +5 -0
- data/app/concepts/{transition/view → matestack/ui/core/transition}/transition.haml +0 -0
- data/app/concepts/{transition/js → matestack/ui/core/transition}/transition.js +2 -2
- data/app/concepts/{transition/cell → matestack/ui/core/transition}/transition.rb +2 -2
- data/app/concepts/{ul/view → matestack/ui/core/ul}/ul.haml +0 -0
- data/app/concepts/matestack/ui/core/ul/ul.rb +5 -0
- data/app/concepts/{view → matestack/ui/core}/view/view.haml +0 -0
- data/app/concepts/{view/js → matestack/ui/core/view}/view.js +3 -3
- data/app/concepts/matestack/ui/core/view/view.rb +7 -0
- data/app/lib/matestack/ui/app.rb +1 -0
- data/app/{concepts/app/utils → lib/matestack/ui/core}/app_node.rb +1 -1
- data/app/{concepts/component/utils → lib/matestack/ui/core}/component_node.rb +1 -1
- data/app/{concepts/page/utils → lib/matestack/ui/core}/page_node.rb +1 -1
- data/app/{concepts/shared/utils → lib/matestack/ui/core}/to_cell.rb +26 -25
- data/app/lib/matestack/ui/dynamic_component.rb +1 -0
- data/app/lib/matestack/ui/page.rb +1 -0
- data/app/lib/matestack/ui/static_component.rb +1 -0
- data/lib/matestack/ui/core/version.rb +1 -1
- data/vendor/assets/javascripts/matestack-ui-core.js +117 -117
- data/vendor/assets/javascripts/matestack-ui-core.js.map +1 -1
- metadata +125 -120
- data/app/assets/config/basemate_ui_core_manifest.js +0 -2
- data/app/assets/javascripts/basemate/ui/core/application.js +0 -15
- data/app/assets/stylesheets/basemate/ui/core/application.css +0 -15
- data/app/concepts/action/view/action.haml +0 -3
- data/app/concepts/async/cell/async.rb +0 -10
- data/app/concepts/br/cell/br.rb +0 -5
- data/app/concepts/button/cell/button.rb +0 -5
- data/app/concepts/component/js/anonym-dynamic-component.js +0 -10
- data/app/concepts/core/js/core.js +0 -27
- data/app/concepts/div/cell/div.rb +0 -6
- data/app/concepts/footer/cell/footer.rb +0 -5
- data/app/concepts/form/cell/inline.rb +0 -9
- data/app/concepts/form/cell/submit.rb +0 -9
- data/app/concepts/header/cell/header.rb +0 -5
- data/app/concepts/heading/cell/heading.rb +0 -5
- data/app/concepts/html/js/html.js +0 -10
- data/app/concepts/icon/cell/icon.rb +0 -5
- data/app/concepts/img/cell/img.rb +0 -5
- data/app/concepts/input/cell/input.rb +0 -5
- data/app/concepts/label/cell/label.rb +0 -5
- data/app/concepts/li/cell/li.rb +0 -5
- data/app/concepts/main/cell/main.rb +0 -5
- data/app/concepts/nav/cell/nav.rb +0 -5
- data/app/concepts/ol/cell/ol.rb +0 -5
- data/app/concepts/ol/view/ol.haml +0 -3
- data/app/concepts/onclick/cell/onclick.rb +0 -6
- data/app/concepts/page/cell/content.rb +0 -5
- data/app/concepts/partial/cell/partial.rb +0 -5
- data/app/concepts/pg/cell/pg.rb +0 -5
- data/app/concepts/plain/cell/plain.rb +0 -10
- data/app/concepts/progress/cell/progress.rb +0 -5
- data/app/concepts/progress/view/progress.haml +0 -3
- data/app/concepts/section/cell/section.rb +0 -5
- data/app/concepts/slot/cell/slot.rb +0 -10
- data/app/concepts/span/cell/span.rb +0 -5
- data/app/concepts/table/cell/table.rb +0 -5
- data/app/concepts/table/view/table.haml +0 -3
- data/app/concepts/td/cell/td.rb +0 -5
- data/app/concepts/td/view/td.haml +0 -8
- data/app/concepts/th/cell/th.rb +0 -5
- data/app/concepts/th/view/th.haml +0 -8
- data/app/concepts/tr/cell/tr.rb +0 -5
- data/app/concepts/tr/view/tr.haml +0 -3
- data/app/concepts/ul/cell/ul.rb +0 -5
- data/app/concepts/view/cell/view.rb +0 -7
- data/app/controllers/basemate/ui/core/application_controller.rb +0 -9
- data/app/controllers/basemate/ui/core/docs_controller.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99d5baa395a0bbd08fb3dd6ba51de334b3408399aa7bde23057fc1e2c6fd7f8a
|
4
|
+
data.tar.gz: 3cc9af9f8129174ae0628119476dc6c4760ffe49d6edca24478afacb74494818
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b998a602726e454b65525852bfe72e7c604c18ac4f9f789afbd0c6321c0cc752ad9837cc4b90da71789080bfc1f672d768d3b1240029e0f4c740e8b72edd7dd8
|
7
|
+
data.tar.gz: acf096659352f4eca3c0f7861e291e3cbe022b8a0cb17c5391163057a60941cceef4cf604c9b3dfc26b8553f8475d466959880ed60116ff28a842985728712f0
|
data/README.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
[![CircleCI](https://circleci.com/gh/basemate/matestack-ui-core/tree/master.svg?style=shield)](https://circleci.com/gh/basemate/matestack-ui-core/tree/master)
|
2
|
+
[![Gitter](https://badges.gitter.im/basemate/community.svg)](https://gitter.im/basemate/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/matestack-ui-core.svg)](https://badge.fury.io/rb/matestack-ui-core)
|
2
4
|
|
3
5
|
![matestack logo](./logo.png)
|
4
6
|
|
5
|
-
#
|
7
|
+
# matestack: Escape the frontend hustle
|
6
8
|
|
7
9
|
## Create maintainable, dynamic and beautiful UIs easily
|
8
10
|
|
@@ -17,11 +19,15 @@ matestack can progressively replace the classic Rails-View-Layer. You are able t
|
|
17
19
|
it alongside your classic views and incrementally turn your Rails-App into a
|
18
20
|
dynamic Web-App.
|
19
21
|
|
22
|
+
### Installation:
|
23
|
+
|
24
|
+
Click here to see how you can add Matestack UI to your existing Rails application: [Installation Guide](./docs/install)
|
25
|
+
|
20
26
|
### Features:
|
21
27
|
|
22
28
|
#### Define your UI in a Ruby Class
|
23
29
|
```ruby
|
24
|
-
class Pages::MyPage <
|
30
|
+
class Pages::MyPage < Matestack::Ui::Page
|
25
31
|
|
26
32
|
def prepare
|
27
33
|
@technologies = ["Rails", "Vue.js", "Trailblazer", "Rspec", "Capybara"]
|
@@ -42,7 +48,7 @@ end
|
|
42
48
|
#### Create a Single Page Application without JavaScript
|
43
49
|
|
44
50
|
```ruby
|
45
|
-
class Apps::MyApp <
|
51
|
+
class Apps::MyApp < Matestack::Ui::App
|
46
52
|
|
47
53
|
def response
|
48
54
|
components{
|
@@ -51,10 +57,10 @@ class Apps::MyApp < App::Cell::App
|
|
51
57
|
end
|
52
58
|
nav do
|
53
59
|
transition path: :my_first_page_path do
|
54
|
-
button "Page 1"
|
60
|
+
button text: "Page 1"
|
55
61
|
end
|
56
62
|
transition path: :my_second_page_path do
|
57
|
-
button "Page 2"
|
63
|
+
button text: "Page 2"
|
58
64
|
end
|
59
65
|
end
|
60
66
|
main do
|
@@ -70,7 +76,7 @@ end
|
|
70
76
|
```
|
71
77
|
|
72
78
|
```ruby
|
73
|
-
class Pages::MyApp::MyFirstPage <
|
79
|
+
class Pages::MyApp::MyFirstPage < Matestack::Ui::Page
|
74
80
|
|
75
81
|
def response
|
76
82
|
components{
|
@@ -83,7 +89,7 @@ class Pages::MyApp::MyFirstPage < Page::Cell::Page
|
|
83
89
|
end
|
84
90
|
```
|
85
91
|
```ruby
|
86
|
-
class Pages::MyApp::MySecondPage <
|
92
|
+
class Pages::MyApp::MySecondPage < Matestack::Ui::Page
|
87
93
|
|
88
94
|
def response
|
89
95
|
components{
|
@@ -97,7 +103,7 @@ end
|
|
97
103
|
```
|
98
104
|
#### Handle User Interaction dynamically without JavaScript
|
99
105
|
```ruby
|
100
|
-
class Pages::MyPage <
|
106
|
+
class Pages::MyPage < Matestack::Ui::Page
|
101
107
|
|
102
108
|
def response
|
103
109
|
components {
|
@@ -127,7 +133,7 @@ end
|
|
127
133
|
```
|
128
134
|
#### Handle User Input dynamically without JavaScript
|
129
135
|
```ruby
|
130
|
-
class Pages::MyApp::MyFirstPage <
|
136
|
+
class Pages::MyApp::MyFirstPage < Matestack::Ui::Page
|
131
137
|
|
132
138
|
def prepare
|
133
139
|
@my_model = MyModel.new
|
@@ -167,7 +173,7 @@ end
|
|
167
173
|
```
|
168
174
|
#### Websocket Integration without JavaScript
|
169
175
|
```ruby
|
170
|
-
class Pages::MyPage <
|
176
|
+
class Pages::MyPage < Matestack::Ui::Page
|
171
177
|
|
172
178
|
def prepare
|
173
179
|
@comments = Comment.last(5)
|
@@ -208,6 +214,7 @@ Changelog can be found [here](./CHANGELOG.md)
|
|
208
214
|
### Roadmap
|
209
215
|
|
210
216
|
Scheduled for 0.7.0:
|
217
|
+
- Better naming conventions
|
211
218
|
- Webpacker/Yarn Integration
|
212
219
|
- Advanced Websockets Integration
|
213
220
|
- 1:n Relations in Form components
|
@@ -216,10 +223,9 @@ Scheduled for 0.7.0:
|
|
216
223
|
- Rails View Integration
|
217
224
|
- Dockerized Core Development
|
218
225
|
|
219
|
-
|
220
226
|
### Community
|
221
227
|
|
222
|
-
|
228
|
+
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!
|
223
229
|
|
224
230
|
### Contribution
|
225
231
|
|
File without changes
|
@@ -2,9 +2,9 @@ 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 '
|
5
|
+
import matestackEventHub from 'js/event-hub'
|
6
6
|
|
7
|
-
import componentMixin from 'component/
|
7
|
+
import componentMixin from 'component/component'
|
8
8
|
|
9
9
|
const componentDef = {
|
10
10
|
mixins: [componentMixin],
|
@@ -44,6 +44,6 @@ const componentDef = {
|
|
44
44
|
}
|
45
45
|
}
|
46
46
|
|
47
|
-
let component = Vue.component('action
|
47
|
+
let component = Vue.component('matestack-ui-core-action', componentDef)
|
48
48
|
|
49
49
|
export default componentDef
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module App
|
1
|
+
module Matestack::Ui::Core::App
|
2
2
|
class App < Trailblazer::Cell
|
3
3
|
include ActionView::Helpers::ActiveModelHelper
|
4
4
|
include ActionView::Helpers::ActiveModelInstanceTag
|
@@ -25,12 +25,35 @@ module App::Cell
|
|
25
25
|
include ActionView::Helpers::TranslationHelper
|
26
26
|
include ActionView::Helpers::UrlHelper
|
27
27
|
include ::Cell::Haml
|
28
|
-
include
|
29
|
-
include
|
28
|
+
include Matestack::Ui::Core::ApplicationHelper
|
29
|
+
include Matestack::Ui::Core::ToCell
|
30
30
|
# include ::Rails.application.routes.url_helpers
|
31
31
|
|
32
32
|
view_paths << "#{Matestack::Ui::Core::Engine.root}/app/concepts"
|
33
33
|
|
34
|
+
extend ViewName::Flat
|
35
|
+
|
36
|
+
def self.prefixes
|
37
|
+
_prefixes = super
|
38
|
+
modified_prefixes = _prefixes.map do |prefix|
|
39
|
+
prefix_parts = prefix.split("/")
|
40
|
+
|
41
|
+
if prefix_parts.last.include?(self.name.split("::")[-1].downcase)
|
42
|
+
prefix_parts[0..-2].join("/")
|
43
|
+
else
|
44
|
+
prefix
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
return modified_prefixes
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.views_dir
|
53
|
+
return ""
|
54
|
+
end
|
55
|
+
|
56
|
+
|
34
57
|
def initialize(model=nil, options={})
|
35
58
|
super
|
36
59
|
@nodes = {}
|
@@ -61,7 +84,7 @@ module App::Cell
|
|
61
84
|
end
|
62
85
|
|
63
86
|
def components(&block)
|
64
|
-
@nodes = ::
|
87
|
+
@nodes = Matestack::Ui::Core::AppNode.build(self, &block)
|
65
88
|
|
66
89
|
@nodes.each do |key, node|
|
67
90
|
@cells[key] = to_cell(key, node["component_name"], node["config"], node["argument"], node["components"], nil)
|
@@ -69,7 +92,7 @@ module App::Cell
|
|
69
92
|
end
|
70
93
|
|
71
94
|
def partial(&block)
|
72
|
-
::
|
95
|
+
Matestack::Ui::Core::AppNode.build(self, &block)
|
73
96
|
end
|
74
97
|
|
75
98
|
end
|
File without changes
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import Vue from 'vue/dist/vue.esm'
|
2
2
|
|
3
|
-
import matestackEventHub from '
|
3
|
+
import matestackEventHub from 'js/event-hub'
|
4
4
|
|
5
|
-
import componentMixin from 'component/
|
5
|
+
import componentMixin from 'component/component'
|
6
6
|
|
7
7
|
const componentDef = {
|
8
8
|
mixins: [componentMixin],
|
@@ -52,6 +52,6 @@ const componentDef = {
|
|
52
52
|
},
|
53
53
|
}
|
54
54
|
|
55
|
-
let component = Vue.component('async
|
55
|
+
let component = Vue.component('matestack-ui-core-async', componentDef)
|
56
56
|
|
57
57
|
export default componentDef
|
File without changes
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import Vue from 'vue/dist/vue.esm'
|
2
|
+
import componentMixin from 'component/component'
|
3
|
+
|
4
|
+
const componentDef = {
|
5
|
+
mixins: [componentMixin]
|
6
|
+
}
|
7
|
+
|
8
|
+
let component = Vue.component('matestack-ui-core-anonym-dynamic-component', componentDef)
|
9
|
+
|
10
|
+
export default componentDef
|
File without changes
|
@@ -2,7 +2,7 @@ import Vue from 'vue/dist/vue.esm'
|
|
2
2
|
import axios from 'axios'
|
3
3
|
import VRuntimeTemplate from "v-runtime-template"
|
4
4
|
|
5
|
-
import matestackEventHub from '
|
5
|
+
import matestackEventHub from 'js/event-hub'
|
6
6
|
|
7
7
|
const componentMixin = {
|
8
8
|
props: ['componentConfig', 'params'],
|
File without changes
|
@@ -1,5 +1,7 @@
|
|
1
|
-
module Component
|
1
|
+
module Matestack::Ui::Core::Component
|
2
2
|
class Dynamic < Trailblazer::Cell
|
3
|
+
|
4
|
+
|
3
5
|
include ActionView::Helpers::ActiveModelHelper
|
4
6
|
include ActionView::Helpers::ActiveModelInstanceTag
|
5
7
|
include ActionView::Helpers::AssetTagHelper
|
@@ -27,12 +29,34 @@ module Component::Cell
|
|
27
29
|
# include ActionView::Helpers::UrlHelper
|
28
30
|
# include ActionView::Helpers::TranslationHelper
|
29
31
|
include ::Cell::Haml
|
30
|
-
include
|
31
|
-
include
|
32
|
+
include Matestack::Ui::Core::ApplicationHelper
|
33
|
+
include Matestack::Ui::Core::ToCell
|
32
34
|
|
33
35
|
view_paths << "#{Matestack::Ui::Core::Engine.root}/app/concepts"
|
34
36
|
view_paths << "#{::Rails.root}/app/matestack"
|
35
37
|
|
38
|
+
extend ViewName::Flat
|
39
|
+
|
40
|
+
def self.prefixes
|
41
|
+
_prefixes = super
|
42
|
+
modified_prefixes = _prefixes.map do |prefix|
|
43
|
+
prefix_parts = prefix.split("/")
|
44
|
+
|
45
|
+
if prefix_parts.last.include?(self.name.split("::")[-1].downcase)
|
46
|
+
prefix_parts[0..-2].join("/")
|
47
|
+
else
|
48
|
+
prefix
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
return modified_prefixes + _prefixes
|
54
|
+
end
|
55
|
+
|
56
|
+
def self.views_dir
|
57
|
+
return ""
|
58
|
+
end
|
59
|
+
|
36
60
|
def initialize(model=nil, options={})
|
37
61
|
super
|
38
62
|
@component_config = options.except(:context, :children, :url_params, :included_config)
|
@@ -111,6 +135,7 @@ module Component::Cell
|
|
111
135
|
response &block
|
112
136
|
render :response
|
113
137
|
else
|
138
|
+
# render(view: self.class.name.split("::")[-1].downcase.to_sym) do
|
114
139
|
render do
|
115
140
|
render_children
|
116
141
|
end
|
@@ -132,7 +157,7 @@ module Component::Cell
|
|
132
157
|
end
|
133
158
|
|
134
159
|
def components(&block)
|
135
|
-
@nodes = ::
|
160
|
+
@nodes = Matestack::Ui::Core::ComponentNode.build(self, nil, &block)
|
136
161
|
|
137
162
|
@nodes.each do |key, node|
|
138
163
|
@cells[key] = to_cell(key, node["component_name"], node["config"], node["argument"], node["components"], node["included_config"])
|
@@ -140,11 +165,11 @@ module Component::Cell
|
|
140
165
|
end
|
141
166
|
|
142
167
|
def partial(&block)
|
143
|
-
return ::
|
168
|
+
return Matestack::Ui::Core::ComponentNode.build(self, nil, &block)
|
144
169
|
end
|
145
170
|
|
146
171
|
def slot(&block)
|
147
|
-
return ::
|
172
|
+
return Matestack::Ui::Core::ComponentNode.build(self, nil, &block)
|
148
173
|
end
|
149
174
|
|
150
175
|
def get_children
|
@@ -185,17 +210,30 @@ module Component::Cell
|
|
185
210
|
name_parts = self.class.name.split("::")
|
186
211
|
module_name = name_parts[0]
|
187
212
|
if module_name == "Components"
|
188
|
-
name_parts
|
213
|
+
name_parts[0] = "Custom"
|
189
214
|
end
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
215
|
+
if name_parts.count > 1
|
216
|
+
if name_parts.include?("Cell")
|
217
|
+
name = name_parts[0] + name_parts[1]
|
218
|
+
if name_parts[0] == name_parts[2]
|
219
|
+
name = name_parts[0] + name_parts[1]
|
220
|
+
@component_class = name.underscore.gsub("_", "-")
|
221
|
+
else
|
222
|
+
name = name_parts[0] + name_parts[2] + name_parts[1]
|
223
|
+
@component_class = name.underscore.gsub("_", "-")
|
224
|
+
end
|
225
|
+
else
|
226
|
+
if name_parts[-2] == name_parts[-1]
|
227
|
+
@component_class = name_parts[0..-2].join("-").downcase
|
228
|
+
else
|
229
|
+
@component_class = name_parts.join("-").downcase
|
230
|
+
end
|
231
|
+
end
|
194
232
|
else
|
195
|
-
name = name_parts[0]
|
233
|
+
name = name_parts[0]
|
196
234
|
@component_class = name.underscore.gsub("_", "-")
|
197
235
|
end
|
198
|
-
@component_name = @component_class
|
236
|
+
@component_name = @component_class
|
199
237
|
end
|
200
238
|
|
201
239
|
def set_tag_attributes
|