matestack-ui-core 0.7.2
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 +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +228 -0
- data/Rakefile +34 -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/absolute/absolute.haml +3 -0
- data/app/concepts/matestack/ui/core/absolute/absolute.rb +17 -0
- data/app/concepts/matestack/ui/core/action/action.haml +3 -0
- data/app/concepts/matestack/ui/core/action/action.js +49 -0
- data/app/concepts/matestack/ui/core/action/action.rb +52 -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.haml +4 -0
- data/app/concepts/matestack/ui/core/app/app.js +27 -0
- data/app/concepts/matestack/ui/core/app/app.rb +98 -0
- data/app/concepts/matestack/ui/core/app/store.js +70 -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/async/async.haml +2 -0
- data/app/concepts/matestack/ui/core/async/async.js +76 -0
- data/app/concepts/matestack/ui/core/async/async.rb +12 -0
- data/app/concepts/matestack/ui/core/blockquote/blockquote.haml +5 -0
- data/app/concepts/matestack/ui/core/blockquote/blockquote.rb +11 -0
- data/app/concepts/matestack/ui/core/br/br.haml +5 -0
- data/app/concepts/matestack/ui/core/br/br.rb +5 -0
- data/app/concepts/matestack/ui/core/button/button.haml +5 -0
- data/app/concepts/matestack/ui/core/button/button.rb +11 -0
- data/app/concepts/matestack/ui/core/caption/caption.haml +5 -0
- data/app/concepts/matestack/ui/core/caption/caption.rb +5 -0
- data/app/concepts/matestack/ui/core/collection/content/content.js +98 -0
- data/app/concepts/matestack/ui/core/collection/content/content.rb +18 -0
- data/app/concepts/matestack/ui/core/collection/content/next/next.haml +3 -0
- data/app/concepts/matestack/ui/core/collection/content/next/next.rb +5 -0
- data/app/concepts/matestack/ui/core/collection/content/page/link/link.haml +3 -0
- data/app/concepts/matestack/ui/core/collection/content/page/link/link.rb +5 -0
- data/app/concepts/matestack/ui/core/collection/content/previous/previous.haml +3 -0
- data/app/concepts/matestack/ui/core/collection/content/previous/previous.rb +5 -0
- data/app/concepts/matestack/ui/core/collection/filter/filter.js +48 -0
- data/app/concepts/matestack/ui/core/collection/filter/filter.rb +17 -0
- data/app/concepts/matestack/ui/core/collection/filter/input/input.haml +2 -0
- data/app/concepts/matestack/ui/core/collection/filter/input/input.rb +25 -0
- data/app/concepts/matestack/ui/core/collection/filter/reset/reset.haml +3 -0
- data/app/concepts/matestack/ui/core/collection/filter/reset/reset.rb +5 -0
- data/app/concepts/matestack/ui/core/collection/filter/submit/submit.haml +3 -0
- data/app/concepts/matestack/ui/core/collection/filter/submit/submit.rb +5 -0
- data/app/concepts/matestack/ui/core/collection/helper.rb +113 -0
- data/app/concepts/matestack/ui/core/collection/order/order.js +56 -0
- data/app/concepts/matestack/ui/core/collection/order/order.rb +17 -0
- data/app/concepts/matestack/ui/core/collection/order/toggle/indicator/indicator.rb +13 -0
- data/app/concepts/matestack/ui/core/collection/order/toggle/toggle.haml +3 -0
- data/app/concepts/matestack/ui/core/collection/order/toggle/toggle.rb +5 -0
- data/app/concepts/matestack/ui/core/component/anonym-dynamic-component.js +10 -0
- data/app/concepts/matestack/ui/core/component/children.haml +2 -0
- data/app/concepts/matestack/ui/core/component/component.js +59 -0
- data/app/concepts/matestack/ui/core/component/dynamic.haml +6 -0
- data/app/concepts/matestack/ui/core/component/dynamic.rb +261 -0
- data/app/concepts/matestack/ui/core/component/dynamic_without_rerender.haml +2 -0
- data/app/concepts/matestack/ui/core/component/response.haml +2 -0
- data/app/concepts/matestack/ui/core/component/response_dynamic.haml +7 -0
- data/app/concepts/matestack/ui/core/component/response_dynamic_without_rerender.haml +3 -0
- data/app/concepts/matestack/ui/core/component/static.haml +1 -0
- data/app/concepts/matestack/ui/core/component/static.rb +16 -0
- data/app/concepts/matestack/ui/core/details/details.haml +3 -0
- data/app/concepts/matestack/ui/core/details/details.rb +5 -0
- data/app/concepts/matestack/ui/core/div/div.haml +3 -0
- data/app/concepts/matestack/ui/core/div/div.rb +5 -0
- data/app/concepts/matestack/ui/core/footer/footer.haml +3 -0
- data/app/concepts/matestack/ui/core/footer/footer.rb +5 -0
- data/app/concepts/matestack/ui/core/form/form.haml +2 -0
- data/app/concepts/matestack/ui/core/form/form.js +136 -0
- data/app/concepts/matestack/ui/core/form/form.rb +71 -0
- data/app/concepts/matestack/ui/core/form/inline/inline.haml +6 -0
- data/app/concepts/matestack/ui/core/form/inline/inline.rb +9 -0
- data/app/concepts/matestack/ui/core/form/input/input.haml +27 -0
- data/app/concepts/matestack/ui/core/form/input/input.rb +74 -0
- data/app/concepts/matestack/ui/core/form/select/select.haml +76 -0
- data/app/concepts/matestack/ui/core/form/select/select.rb +73 -0
- data/app/concepts/matestack/ui/core/form/submit/submit.haml +3 -0
- data/app/concepts/matestack/ui/core/form/submit/submit.rb +9 -0
- data/app/concepts/matestack/ui/core/header/header.haml +3 -0
- data/app/concepts/matestack/ui/core/header/header.rb +5 -0
- data/app/concepts/matestack/ui/core/heading/heading.haml +50 -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/matestack/ui/core/html/html.haml +3 -0
- data/app/concepts/matestack/ui/core/html/html.js +10 -0
- data/app/concepts/matestack/ui/core/html/html.rb +17 -0
- data/app/concepts/matestack/ui/core/icon/icon.haml +5 -0
- data/app/concepts/matestack/ui/core/icon/icon.rb +5 -0
- data/app/concepts/matestack/ui/core/img/img.haml +1 -0
- data/app/concepts/matestack/ui/core/img/img.rb +5 -0
- data/app/concepts/matestack/ui/core/input/input.haml +3 -0
- data/app/concepts/matestack/ui/core/input/input.rb +5 -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 +30 -0
- data/app/concepts/matestack/ui/core/js/event-hub.js +5 -0
- data/app/concepts/matestack/ui/core/js/helpers/query-params-helper.js +56 -0
- data/app/concepts/matestack/ui/core/label/label.haml +5 -0
- data/app/concepts/matestack/ui/core/label/label.rb +5 -0
- data/app/concepts/matestack/ui/core/li/li.haml +5 -0
- data/app/concepts/matestack/ui/core/li/li.rb +5 -0
- data/app/concepts/matestack/ui/core/link/link.haml +5 -0
- data/app/concepts/matestack/ui/core/link/link.rb +26 -0
- data/app/concepts/matestack/ui/core/main/main.haml +3 -0
- data/app/concepts/matestack/ui/core/main/main.rb +5 -0
- data/app/concepts/matestack/ui/core/nav/nav.haml +3 -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/matestack/ui/core/onclick/onclick.haml +2 -0
- data/app/concepts/matestack/ui/core/onclick/onclick.js +21 -0
- data/app/concepts/matestack/ui/core/onclick/onclick.rb +5 -0
- data/app/concepts/matestack/ui/core/page/content.haml +7 -0
- data/app/concepts/matestack/ui/core/page/content.js +17 -0
- data/app/concepts/matestack/ui/core/page/content.rb +5 -0
- data/app/concepts/matestack/ui/core/page/page.haml +9 -0
- data/app/concepts/matestack/ui/core/page/page.rb +175 -0
- data/app/concepts/matestack/ui/core/paragraph/paragraph.haml +5 -0
- data/app/concepts/matestack/ui/core/paragraph/paragraph.rb +5 -0
- data/app/concepts/matestack/ui/core/partial/partial.haml +2 -0
- data/app/concepts/matestack/ui/core/partial/partial.rb +5 -0
- data/app/concepts/matestack/ui/core/pg/pg.haml +5 -0
- data/app/concepts/matestack/ui/core/pg/pg.rb +5 -0
- data/app/concepts/matestack/ui/core/plain/plain.rb +9 -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/matestack/ui/core/section/section.haml +3 -0
- data/app/concepts/matestack/ui/core/section/section.rb +5 -0
- data/app/concepts/matestack/ui/core/slot/slot.haml +2 -0
- data/app/concepts/matestack/ui/core/slot/slot.rb +5 -0
- data/app/concepts/matestack/ui/core/small/small.haml +5 -0
- data/app/concepts/matestack/ui/core/small/small.rb +5 -0
- data/app/concepts/matestack/ui/core/span/span.haml +5 -0
- data/app/concepts/matestack/ui/core/span/span.rb +5 -0
- data/app/concepts/matestack/ui/core/strong/strong.haml +5 -0
- data/app/concepts/matestack/ui/core/strong/strong.rb +5 -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 +5 -0
- data/app/concepts/matestack/ui/core/summary/summary.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/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 +5 -0
- data/app/concepts/matestack/ui/core/td/td.rb +5 -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 +5 -0
- data/app/concepts/matestack/ui/core/th/th.rb +5 -0
- 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/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/matestack/ui/core/transition/transition.haml +5 -0
- data/app/concepts/matestack/ui/core/transition/transition.js +26 -0
- data/app/concepts/matestack/ui/core/transition/transition.rb +31 -0
- data/app/concepts/matestack/ui/core/ul/ul.haml +3 -0
- data/app/concepts/matestack/ui/core/ul/ul.rb +5 -0
- data/app/concepts/matestack/ui/core/video/video.haml +1 -0
- data/app/concepts/matestack/ui/core/video/video.rb +7 -0
- data/app/concepts/matestack/ui/core/view/view.haml +2 -0
- data/app/concepts/matestack/ui/core/view/view.js +42 -0
- data/app/concepts/matestack/ui/core/view/view.rb +5 -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 +35 -0
- data/app/lib/matestack/ui/app.rb +1 -0
- data/app/lib/matestack/ui/core/app_node.rb +53 -0
- data/app/lib/matestack/ui/core/component_node.rb +73 -0
- data/app/lib/matestack/ui/core/page_node.rb +96 -0
- data/app/lib/matestack/ui/core/to_cell.rb +129 -0
- 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/config/routes.rb +3 -0
- data/lib/generators/matestack_app/USAGE +21 -0
- data/lib/generators/matestack_app/matestack_app_generator.rb +26 -0
- data/lib/generators/matestack_app/templates/matestack_app.erb +26 -0
- data/lib/generators/matestack_app/templates/matestack_app_controller.erb +7 -0
- data/lib/generators/matestack_component/USAGE +20 -0
- data/lib/generators/matestack_component/matestack_component_generator.rb +30 -0
- data/lib/generators/matestack_component/templates/matestack_component.haml.erb +5 -0
- data/lib/generators/matestack_component/templates/matestack_component.js.erb +17 -0
- data/lib/generators/matestack_component/templates/matestack_component.rb.erb +13 -0
- data/lib/generators/matestack_component/templates/matestack_component.scss.erb +1 -0
- data/lib/generators/matestack_page/USAGE +28 -0
- data/lib/generators/matestack_page/matestack_page_generator.rb +41 -0
- data/lib/generators/matestack_page/templates/matestack_page.erb +15 -0
- data/lib/matestack/ui/core.rb +15 -0
- data/lib/matestack/ui/core/engine.rb +19 -0
- data/lib/matestack/ui/core/version.rb +7 -0
- data/lib/tasks/matestack/ui/core_tasks.rake +4 -0
- data/vendor/assets/javascripts/manifest.json +4 -0
- data/vendor/assets/javascripts/matestack-ui-core.js +15309 -0
- data/vendor/assets/javascripts/matestack-ui-core.js.map +1 -0
- metadata +350 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import Vue from 'vue/dist/vue.esm'
|
|
2
|
+
import Vuex from 'vuex'
|
|
3
|
+
import componentMixin from 'component/component'
|
|
4
|
+
|
|
5
|
+
const componentDef = {
|
|
6
|
+
mixins: [componentMixin],
|
|
7
|
+
data: function(){
|
|
8
|
+
return {}
|
|
9
|
+
},
|
|
10
|
+
computed: Vuex.mapState({
|
|
11
|
+
isActive (state) {
|
|
12
|
+
return this.componentConfig["link_path"] === state.currentPath
|
|
13
|
+
}
|
|
14
|
+
}),
|
|
15
|
+
methods: {
|
|
16
|
+
navigateTo: function(url){
|
|
17
|
+
this.$store.dispatch('navigateTo', {url: url, backwards: false}).then((response) => {
|
|
18
|
+
// self.asyncTemplate = response;
|
|
19
|
+
})
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let component = Vue.component('matestack-ui-core-transition', componentDef)
|
|
25
|
+
|
|
26
|
+
export default componentDef
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
module Matestack::Ui::Core::Transition
|
|
2
|
+
class Transition < Matestack::Ui::Core::Component::Dynamic
|
|
3
|
+
|
|
4
|
+
def setup
|
|
5
|
+
@component_config[:link_path] = link_path
|
|
6
|
+
@tag_attributes.merge!({
|
|
7
|
+
"href": link_path,
|
|
8
|
+
"@click.prevent": navigate_to(link_path),
|
|
9
|
+
"v-bind:class": "{ active: isActive }"
|
|
10
|
+
})
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def link_path
|
|
14
|
+
if options[:path].is_a?(Symbol)
|
|
15
|
+
return resolve_path
|
|
16
|
+
end
|
|
17
|
+
if options[:path].is_a?(String)
|
|
18
|
+
return options[:path]
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def resolve_path
|
|
23
|
+
begin
|
|
24
|
+
return ::Rails.application.routes.url_helpers.send(options[:path], options[:params])
|
|
25
|
+
rescue => e
|
|
26
|
+
raise "path '#{options[:path]}' not found, using params: #{options[:params]}"
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
= video_tag(@tag_attributes, ActionController::Base.helpers.asset_path(options[:path]), height: options[:height], width: options[:width], preload: options[:preload], autoplay: options[:autoplay], muted: options[:muted], playsinline: options[:playsinline], loop: options[:loop], controls: options[:controls])
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import Vue from 'vue/dist/vue.esm'
|
|
2
|
+
|
|
3
|
+
import matestackEventHub from 'js/event-hub'
|
|
4
|
+
|
|
5
|
+
import componentMixin from 'component/component'
|
|
6
|
+
|
|
7
|
+
const componentDef = {
|
|
8
|
+
mixins: [componentMixin],
|
|
9
|
+
data: function(){
|
|
10
|
+
return {
|
|
11
|
+
showing: false
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
methods: {
|
|
15
|
+
show: function(){
|
|
16
|
+
this.showing = true
|
|
17
|
+
},
|
|
18
|
+
hide: function(){
|
|
19
|
+
this.showing = false
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
created: function () {
|
|
23
|
+
const self = this
|
|
24
|
+
matestackEventHub.$on(this.componentConfig["show"], self.show)
|
|
25
|
+
matestackEventHub.$on(this.componentConfig["hide"], self.hide)
|
|
26
|
+
if(this.componentConfig["init"] == "show"){
|
|
27
|
+
this.showing = true
|
|
28
|
+
}
|
|
29
|
+
if(this.componentConfig["init"] == "hide"){
|
|
30
|
+
this.showing = false
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
beforeDestroy: function() {
|
|
34
|
+
const self = this
|
|
35
|
+
matestackEventHub.$off(this.componentConfig["show"], self.show);
|
|
36
|
+
matestackEventHub.$off(this.componentConfig["hide"], self.hide);
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
let component = Vue.component('matestack-ui-core-view', componentDef)
|
|
41
|
+
|
|
42
|
+
export default componentDef
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
%iframe{@tag_attributes}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module Matestack::Ui::Core::Youtube
|
|
2
|
+
class Youtube < Matestack::Ui::Core::Component::Static
|
|
3
|
+
|
|
4
|
+
REQUIRED_KEYS = [:yt_id, :height, :width]
|
|
5
|
+
|
|
6
|
+
def setup
|
|
7
|
+
url = 'https://www.youtube.com/embed/'
|
|
8
|
+
url = 'https://www.youtube-nocookie.com/embed/' if options[:privacy_mode] == true
|
|
9
|
+
url << options[:yt_id]
|
|
10
|
+
url << '?' unless options[:no_controls] != true and options[:start_at].nil?
|
|
11
|
+
url << 'controls=0' if options[:no_controls] == true
|
|
12
|
+
url << '&' if (options[:no_controls] != nil) and (options[:start_at] != nil)
|
|
13
|
+
url << "start=#{options[:start_at]}" unless options[:start_at].nil?
|
|
14
|
+
|
|
15
|
+
@tag_attributes.merge!({
|
|
16
|
+
'src': url,
|
|
17
|
+
'allow': 'accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture',
|
|
18
|
+
'allowfullscreen': '',
|
|
19
|
+
'frameborder': 0,
|
|
20
|
+
'height': options[:height],
|
|
21
|
+
'width': options[:width]
|
|
22
|
+
})
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
module Matestack
|
|
2
|
+
module Ui
|
|
3
|
+
module Core
|
|
4
|
+
module ApplicationHelper
|
|
5
|
+
|
|
6
|
+
def render_page(page_class, only_page=false)
|
|
7
|
+
page_class.new(nil, context: {
|
|
8
|
+
params: params,
|
|
9
|
+
request: request
|
|
10
|
+
}, controller_instance: self).call(:show, nil, only_page)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def render_component(page_class, component_key)
|
|
14
|
+
page_class.new(nil, context: {
|
|
15
|
+
params: params,
|
|
16
|
+
request: request
|
|
17
|
+
}, controller_instance: self).call(:show, component_key)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def responder_for(page_class, options = {})
|
|
21
|
+
unless params[:component_key].blank?
|
|
22
|
+
render plain: render_component(page_class, params[:component_key])
|
|
23
|
+
return
|
|
24
|
+
end
|
|
25
|
+
if params[:only_page]
|
|
26
|
+
render html: render_page(page_class, true)
|
|
27
|
+
else
|
|
28
|
+
render html: render_page(page_class), layout: true
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|