matestack-ui-core 0.7.1 → 0.7.2

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.

Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/app/concepts/matestack/ui/core/abbr/abbr.haml +5 -0
  3. data/app/concepts/matestack/ui/core/abbr/abbr.rb +12 -0
  4. data/app/concepts/matestack/ui/core/address/address.haml +5 -0
  5. data/app/concepts/matestack/ui/core/address/address.rb +5 -0
  6. data/app/concepts/matestack/ui/core/app/app.rb +1 -2
  7. data/app/concepts/matestack/ui/core/app/store.js +0 -1
  8. data/app/concepts/matestack/ui/core/article/article.haml +5 -0
  9. data/app/concepts/matestack/ui/core/article/article.rb +5 -0
  10. data/app/concepts/matestack/ui/core/async/async.haml +1 -1
  11. data/app/concepts/matestack/ui/core/async/async.js +3 -2
  12. data/app/concepts/matestack/ui/core/async/async.rb +8 -6
  13. data/app/concepts/matestack/ui/core/blockquote/blockquote.rb +3 -1
  14. data/app/concepts/matestack/ui/core/button/button.haml +4 -6
  15. data/app/concepts/matestack/ui/core/caption/caption.haml +2 -3
  16. data/app/concepts/matestack/ui/core/collection/content/content.js +0 -2
  17. data/app/concepts/matestack/ui/core/collection/content/content.rb +1 -1
  18. data/app/concepts/matestack/ui/core/collection/filter/filter.js +0 -2
  19. data/app/concepts/matestack/ui/core/collection/filter/filter.rb +1 -1
  20. data/app/concepts/matestack/ui/core/collection/filter/input/input.haml +1 -7
  21. data/app/concepts/matestack/ui/core/collection/filter/input/input.rb +12 -0
  22. data/app/concepts/matestack/ui/core/collection/helper.rb +0 -1
  23. data/app/concepts/matestack/ui/core/collection/order/order.js +0 -2
  24. data/app/concepts/matestack/ui/core/collection/order/order.rb +1 -1
  25. data/app/concepts/matestack/ui/core/collection/order/toggle/indicator/indicator.rb +3 -1
  26. data/app/concepts/matestack/ui/core/collection/order/toggle/toggle.rb +0 -1
  27. data/app/concepts/matestack/ui/core/component/component.js +0 -1
  28. data/app/concepts/matestack/ui/core/component/dynamic.rb +5 -8
  29. data/app/concepts/matestack/ui/core/details/details.rb +1 -0
  30. data/app/concepts/matestack/ui/core/div/div.rb +0 -1
  31. data/app/concepts/matestack/ui/core/form/input/input.haml +4 -6
  32. data/app/concepts/matestack/ui/core/form/select/select.haml +10 -6
  33. data/app/concepts/matestack/ui/core/icon/icon.haml +2 -3
  34. data/app/concepts/matestack/ui/core/img/img.haml +1 -1
  35. data/app/concepts/matestack/ui/core/isolate/isolate.haml +2 -0
  36. data/app/concepts/matestack/ui/core/isolate/isolate.rb +11 -0
  37. data/app/concepts/matestack/ui/core/label/label.haml +4 -6
  38. data/app/concepts/matestack/ui/core/li/li.haml +2 -3
  39. data/app/concepts/matestack/ui/core/onclick/onclick.haml +1 -1
  40. data/app/concepts/matestack/ui/core/onclick/onclick.rb +1 -2
  41. data/app/concepts/matestack/ui/core/page/page.rb +30 -6
  42. data/app/concepts/matestack/ui/core/paragraph/paragraph.haml +4 -7
  43. data/app/concepts/matestack/ui/core/pg/pg.haml +4 -7
  44. data/app/concepts/matestack/ui/core/plain/plain.rb +0 -1
  45. data/app/concepts/matestack/ui/core/sub/sub.haml +5 -0
  46. data/app/concepts/matestack/ui/core/sub/sub.rb +5 -0
  47. data/app/concepts/matestack/ui/core/summary/summary.haml +2 -3
  48. data/app/concepts/matestack/ui/core/summary/summary.rb +1 -0
  49. data/app/concepts/matestack/ui/core/tbody/tbody.haml +3 -0
  50. data/app/concepts/matestack/ui/core/tbody/tbody.rb +5 -0
  51. data/app/concepts/matestack/ui/core/td/td.haml +4 -7
  52. data/app/concepts/matestack/ui/core/tfoot/tfoot.haml +3 -0
  53. data/app/concepts/matestack/ui/core/tfoot/tfoot.rb +5 -0
  54. data/app/concepts/matestack/ui/core/th/th.haml +4 -7
  55. data/app/concepts/matestack/ui/core/thead/thead.haml +3 -0
  56. data/app/concepts/matestack/ui/core/thead/thead.rb +5 -0
  57. data/app/concepts/matestack/ui/core/transition/transition.haml +4 -6
  58. data/app/concepts/matestack/ui/core/video/video.haml +1 -1
  59. data/app/concepts/matestack/ui/core/view/view.rb +1 -3
  60. data/app/concepts/matestack/ui/core/youtube/youtube.haml +1 -0
  61. data/app/concepts/matestack/ui/core/youtube/youtube.rb +26 -0
  62. data/app/lib/matestack/ui/core/component_node.rb +5 -1
  63. data/app/lib/matestack/ui/core/page_node.rb +21 -0
  64. data/app/lib/matestack/ui/core/to_cell.rb +3 -1
  65. data/lib/generators/matestack_page/matestack_page_generator.rb +3 -3
  66. data/lib/matestack/ui/core/version.rb +1 -1
  67. data/vendor/assets/javascripts/matestack-ui-core.js +53 -136
  68. data/vendor/assets/javascripts/matestack-ui-core.js.map +1 -1
  69. metadata +20 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b357485aaf4b5a49cc255719c7113ffc12b0d65f540130bfa04d64e8fd9afc9
4
- data.tar.gz: e2c691da1526db9e715eecb9609b283d49f7d7edaf30b7fe537d430cca0a7c88
3
+ metadata.gz: af1594c493057f5f1ef5e9548d9485d2fcac014a9c79519554ed53d61de90703
4
+ data.tar.gz: 1441194ad2d3da09a0d4ebb60def765442042e77d069afe7a75abae9ab565464
5
5
  SHA512:
6
- metadata.gz: 224bb5440913ee5d88d67a9b118652e278a72d1f42d064f9ff89593f35922310533978f3014a86022bca3ec3b6a7f1220f1e5e303d4a771c5cd011792d6aedf7
7
- data.tar.gz: b203163b2a42cdc4aa31849f799fa061826dc42509033cfb2fc9aed61f1f101d163bf0bfcf6d18e2a485448bd1b149b3b4e0fd92b6d8627c0d2e71be600292d2
6
+ metadata.gz: 70bf6d472b902d96adde03e06ca5ac062fed60f79220ac4de499f996c391198e64fbe8e72fb0a2a7d8c2b08c75de4cb328a9a81b23cf2c2bb92a137de4a92f70
7
+ data.tar.gz: 141ce7ca2f0857b8c2f4ec3c740d0e89f23c009340b041a4145e8f04000744bacf2fa948c7ac99bb64294f4b5a4321de0713b27bd4feb3f851c8848350f1dc4e
@@ -0,0 +1,5 @@
1
+ %abbr{@tag_attributes}
2
+ - if options[:text].blank? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,12 @@
1
+ module Matestack::Ui::Core::Abbr
2
+ class Abbr < Matestack::Ui::Core::Component::Static
3
+ REQUIRED_KEYS = [:title]
4
+
5
+ def setup
6
+ @tag_attributes.merge!({
7
+ "title": options[:title]
8
+ })
9
+ end
10
+
11
+ end
12
+ end
@@ -0,0 +1,5 @@
1
+ %address{@tag_attributes}
2
+ - if options[:text].nil? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Address
2
+ class Address < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -53,7 +53,6 @@ module Matestack::Ui::Core::App
53
53
  return ""
54
54
  end
55
55
 
56
-
57
56
  def initialize(model=nil, options={})
58
57
  super
59
58
  @nodes = {}
@@ -87,7 +86,7 @@ module Matestack::Ui::Core::App
87
86
  @nodes = Matestack::Ui::Core::AppNode.build(self, &block)
88
87
 
89
88
  @nodes.each do |key, node|
90
- @cells[key] = to_cell(key, node["component_name"], node["config"], node["argument"], node["components"], nil)
89
+ @cells[key] = to_cell(key, node["component_name"], node["config"], node["argument"], node["components"], nil, node["cached_params"])
91
90
  end
92
91
  end
93
92
 
@@ -1,7 +1,6 @@
1
1
  import Vue from 'vue/dist/vue.esm'
2
2
  import Vuex from 'vuex'
3
3
  import axios from 'axios'
4
-
5
4
  import matestackEventHub from 'js/event-hub'
6
5
 
7
6
  Vue.use(Vuex)
@@ -0,0 +1,5 @@
1
+ %article{@tag_attributes}
2
+ - if options[:text].nil? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,5 @@
1
+ module Matestack::Ui::Core::Article
2
+ class Article < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
@@ -1,2 +1,2 @@
1
- %div{"v-if": "showing"}
1
+ %div{@tag_attributes}
2
2
  = yield
@@ -1,7 +1,5 @@
1
1
  import Vue from 'vue/dist/vue.esm'
2
-
3
2
  import matestackEventHub from 'js/event-hub'
4
-
5
3
  import componentMixin from 'component/component'
6
4
 
7
5
  const componentDef = {
@@ -60,6 +58,9 @@ const componentDef = {
60
58
  }
61
59
  }
62
60
  }
61
+ if(this.componentConfig["init_show"] == true){
62
+ this.showing = true
63
+ }
63
64
  },
64
65
  beforeDestroy: function() {
65
66
  const self = this
@@ -1,10 +1,12 @@
1
1
  module Matestack::Ui::Core::Async
2
- class Async < Matestack::Ui::Core::Component::Dynamic
3
-
4
- def setup
5
- @rerender = true
6
- end
7
-
2
+ class Async < Matestack::Ui::Core::Component::Dynamic
8
3
 
4
+ def setup
5
+ @rerender = true
6
+ @tag_attributes.merge!({
7
+ "v-if": "showing"
8
+ })
9
9
  end
10
+
10
11
  end
12
+ end
@@ -1,9 +1,11 @@
1
1
  module Matestack::Ui::Core::Blockquote
2
2
  class Blockquote < Matestack::Ui::Core::Component::Static
3
+
3
4
  def setup
4
5
  @tag_attributes.merge!({
5
6
  "cite": options[:cite]
6
- })
7
+ })
7
8
  end
9
+
8
10
  end
9
11
  end
@@ -1,7 +1,5 @@
1
- - if options[:text].nil?
2
- %button{@tag_attributes}
3
- - if block_given?
4
- = yield
5
- - else
6
- %button{@tag_attributes}
1
+ %button{@tag_attributes}
2
+ - if options[:text].nil? && block_given?
3
+ = yield
4
+ - else
7
5
  = options[:text]
@@ -1,6 +1,5 @@
1
1
  %caption{@tag_attributes}
2
- - if options[:text].nil?
3
- - if block_given?
4
- = yield
2
+ - if options[:text].nil? && block_given?
3
+ = yield
5
4
  - else
6
5
  = options[:text]
@@ -1,8 +1,6 @@
1
1
  import Vue from 'vue/dist/vue.esm'
2
-
3
2
  import matestackEventHub from 'js/event-hub'
4
3
  import queryParamsHelper from 'js/helpers/query-params-helper'
5
-
6
4
  import componentMixin from 'component/component'
7
5
  import asyncMixin from 'async/async'
8
6
 
@@ -8,7 +8,7 @@ module Matestack::Ui::Core::Collection::Content
8
8
 
9
9
  def response
10
10
  components {
11
- div do
11
+ div @tag_attributes do
12
12
  yield_components
13
13
  end
14
14
  }
@@ -1,8 +1,6 @@
1
1
  import Vue from 'vue/dist/vue.esm'
2
-
3
2
  import matestackEventHub from 'js/event-hub'
4
3
  import queryParamsHelper from 'js/helpers/query-params-helper'
5
-
6
4
  import componentMixin from 'component/component'
7
5
 
8
6
  const componentDef = {
@@ -7,7 +7,7 @@ module Matestack::Ui::Core::Collection::Filter
7
7
 
8
8
  def response
9
9
  components {
10
- div do
10
+ div @tag_attributes do
11
11
  yield_components
12
12
  end
13
13
  }
@@ -1,8 +1,2 @@
1
1
  - if [:text, :number, :email, :date, :password].include?(options[:type])
2
- %input{"v-model#{'.number' if options[:type] == :number}": input_key,
3
- type: options[:type],
4
- class: options[:class],
5
- id: component_id,
6
- "@keyup.enter": "submitFilter()",
7
- ref: "filter.#{attr_key}",
8
- placeholder: options[:placeholder]}
2
+ %input{@tag_attributes}
@@ -1,6 +1,18 @@
1
1
  module Matestack::Ui::Core::Collection::Filter::Input
2
2
  class Input < Matestack::Ui::Core::Component::Static
3
3
 
4
+ def setup
5
+ @tag_attributes.merge!({
6
+ "v-model#{'.number' if options[:type] == :number}": input_key,
7
+ type: options[:type],
8
+ class: options[:class],
9
+ id: component_id,
10
+ "@keyup.enter": "submitFilter()",
11
+ ref: "filter.#{attr_key}",
12
+ placeholder: options[:placeholder]
13
+ })
14
+ end
15
+
4
16
  def input_key
5
17
  'filter["' + options[:key].to_s + '"]'
6
18
  end
@@ -59,7 +59,6 @@ module Matestack::Ui::Core::Collection
59
59
 
60
60
  end
61
61
 
62
-
63
62
  module Helper
64
63
 
65
64
  def get_collection_filter collection_id, key=nil
@@ -1,8 +1,6 @@
1
1
  import Vue from 'vue/dist/vue.esm'
2
-
3
2
  import matestackEventHub from 'js/event-hub'
4
3
  import queryParamsHelper from 'js/helpers/query-params-helper'
5
-
6
4
  import componentMixin from 'component/component'
7
5
 
8
6
  const componentDef = {
@@ -7,7 +7,7 @@ module Matestack::Ui::Core::Collection::Order
7
7
 
8
8
  def response
9
9
  components {
10
- div do
10
+ div @tag_attributes do
11
11
  yield_components
12
12
  end
13
13
  }
@@ -3,7 +3,9 @@ module Matestack::Ui::Core::Collection::Order::Toggle::Indicator
3
3
 
4
4
  def response
5
5
  components {
6
- plain "{{orderIndicator( '#{@component_config[:key]}', {asc: '#{@component_config[:asc]}', desc: '#{@component_config[:desc]}'} ) }}"
6
+ span @tag_attributes do
7
+ plain "{{orderIndicator( '#{@component_config[:key]}', {asc: '#{@component_config[:asc]}', desc: '#{@component_config[:desc]}'} ) }}"
8
+ end
7
9
  }
8
10
  end
9
11
 
@@ -1,6 +1,5 @@
1
1
  module Matestack::Ui::Core::Collection::Order::Toggle
2
2
  class Toggle < Matestack::Ui::Core::Component::Static
3
3
 
4
-
5
4
  end
6
5
  end
@@ -1,7 +1,6 @@
1
1
  import Vue from 'vue/dist/vue.esm'
2
2
  import axios from 'axios'
3
3
  import VRuntimeTemplate from "v-runtime-template"
4
-
5
4
  import matestackEventHub from 'js/event-hub'
6
5
 
7
6
  const componentMixin = {
@@ -1,7 +1,6 @@
1
1
  module Matestack::Ui::Core::Component
2
2
  class Dynamic < Trailblazer::Cell
3
3
 
4
-
5
4
  include ActionView::Helpers::ActiveModelHelper
6
5
  include ActionView::Helpers::ActiveModelInstanceTag
7
6
  include ActionView::Helpers::AssetTagHelper
@@ -26,8 +25,6 @@ module Matestack::Ui::Core::Component
26
25
  include ActionView::Helpers::TextHelper
27
26
  include ActionView::Helpers::TranslationHelper
28
27
  include ActionView::Helpers::UrlHelper
29
- # include ActionView::Helpers::UrlHelper
30
- # include ActionView::Helpers::TranslationHelper
31
28
  include ::Cell::Haml
32
29
  include Matestack::Ui::Core::ApplicationHelper
33
30
  include Matestack::Ui::Core::ToCell
@@ -69,13 +66,14 @@ module Matestack::Ui::Core::Component
69
66
  @nodes = {}
70
67
  @cells = {}
71
68
  @included_config = options[:included_config]
69
+ @cached_params = options[:cached_params]
72
70
  @rerender = false
73
71
  @options = options
72
+ set_tag_attributes
73
+ setup
74
74
  generate_component_name
75
75
  generate_children_cells
76
- set_tag_attributes
77
76
  validate_options
78
- setup
79
77
  end
80
78
 
81
79
  def validate_options
@@ -160,7 +158,7 @@ module Matestack::Ui::Core::Component
160
158
  @nodes = Matestack::Ui::Core::ComponentNode.build(self, nil, &block)
161
159
 
162
160
  @nodes.each do |key, node|
163
- @cells[key] = to_cell(key, node["component_name"], node["config"], node["argument"], node["components"], node["included_config"])
161
+ @cells[key] = to_cell(key, node["component_name"], node["config"], node["argument"], node["components"], node["included_config"], node["cached_params"])
164
162
  end
165
163
  end
166
164
 
@@ -193,7 +191,6 @@ module Matestack::Ui::Core::Component
193
191
  result.join(" ")
194
192
  end
195
193
 
196
-
197
194
  private
198
195
 
199
196
  def generate_children_cells
@@ -201,7 +198,7 @@ module Matestack::Ui::Core::Component
201
198
  #needs refactoring --> in some cases, :component_key, :children, :origin_url, :url_params, :included_config get passed into options[:children] which causes errors
202
199
  #quickfix: except them from iteration
203
200
  options[:children].except(:component_key, :children, :origin_url, :url_params, :included_config).each do |key, node|
204
- @children_cells[key] = to_cell("#{@component_key}__#{key}", node["component_name"], node["config"], node["argument"], node["components"], node["included_config"])
201
+ @children_cells[key] = to_cell("#{@component_key}__#{key}", node["component_name"], node["config"], node["argument"], node["components"], node["included_config"], node["cached_params"])
205
202
  end
206
203
  end
207
204
  end
@@ -1,4 +1,5 @@
1
1
  module Matestack::Ui::Core::Details
2
2
  class Details < Matestack::Ui::Core::Component::Static
3
+
3
4
  end
4
5
  end
@@ -1,6 +1,5 @@
1
1
  module Matestack::Ui::Core::Div
2
2
  class Div < Matestack::Ui::Core::Component::Static
3
3
 
4
-
5
4
  end
6
5
  end
@@ -2,10 +2,9 @@
2
2
  %label=options[:label]
3
3
 
4
4
  - if [:text, :number, :email, :date, :password].include?(options[:type])
5
- %input{"v-model#{'.number' if options[:type] == :number}": input_key,
5
+ %input{@tag_attributes,
6
+ "v-model#{'.number' if options[:type] == :number}": input_key,
6
7
  type: options[:type],
7
- class: options[:class],
8
- id: component_id,
9
8
  "@change": "inputChanged(\"#{attr_key}\")",
10
9
  ref: "input.#{attr_key}",
11
10
  placeholder: options[:placeholder],
@@ -15,9 +14,8 @@
15
14
  {{ error }}
16
15
 
17
16
  - if options[:type] == :textarea
18
- %textarea{"v-model": input_key,
19
- class: options[:class],
20
- id: component_id,
17
+ %textarea{@tag_attributes,
18
+ "v-model": input_key,
21
19
  "@change": "inputChanged(\"#{attr_key}\")",
22
20
  ref: "input.#{attr_key}",
23
21
  placeholder: options[:placeholder],
@@ -4,8 +4,8 @@
4
4
 
5
5
  - if options[:type] == :dropdown
6
6
 
7
- %select{"#{model_binding}" => input_key,
8
- id: component_id,
7
+ %select{@tag_attributes,
8
+ "#{model_binding}" => input_key,
9
9
  ref: "select.#{attr_key}",
10
10
  "@change": "inputChanged(\"#{attr_key}\")",
11
11
  "init-value": init_value,
@@ -26,7 +26,8 @@
26
26
  %div{id: component_id, ref: "select.multiple.#{attr_key}", "init-value": init_value}
27
27
  - if options[:options].is_a?(Hash)
28
28
  - options[:options].each do |key, value|
29
- %input{type: :checkbox,
29
+ %input{@tag_attributes,
30
+ type: :checkbox,
30
31
  "#{model_binding}": input_key,
31
32
  "@change": "inputChanged(\"#{attr_key}\")",
32
33
  "value-type": options_type,
@@ -35,7 +36,8 @@
35
36
  %label=value
36
37
  - if options[:options].is_a?(Array)
37
38
  - options[:options].each do |value|
38
- %input{type: :checkbox,
39
+ %input{@tag_attributes,
40
+ type: :checkbox,
39
41
  "#{model_binding}": input_key,
40
42
  "@change": "inputChanged(\"#{attr_key}\")",
41
43
  "value-type": options_type,
@@ -51,7 +53,8 @@
51
53
  %div{id: component_id, ref: "select.#{attr_key}", "init-value": init_value}
52
54
  - if options[:options].is_a?(Hash)
53
55
  - options[:options].each do |key, value|
54
- %input{type: :radio,
56
+ %input{@tag_attributes,
57
+ type: :radio,
55
58
  "#{model_binding}": input_key,
56
59
  "@change": "inputChanged(\"#{attr_key}\")",
57
60
  "value-type": options_type,
@@ -60,7 +63,8 @@
60
63
  %label=value
61
64
  - if options[:options].is_a?(Array)
62
65
  - options[:options].each do |value|
63
- %input{type: :radio,
66
+ %input{@tag_attributes,
67
+ type: :radio,
64
68
  "#{model_binding}": input_key,
65
69
  "@change": "inputChanged(\"#{attr_key}\")",
66
70
  "value-type": options_type,
@@ -1,6 +1,5 @@
1
1
  %i{@tag_attributes}
2
- - if options[:text].blank?
3
- - if block_given?
4
- = yield
2
+ - if options[:text].nil? && block_given?
3
+ = yield
5
4
  - else
6
5
  = options[:text]