matestack-ui-core 0.7.3 → 0.7.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -4
  3. data/Rakefile +32 -0
  4. data/app/concepts/matestack/ui/core/action/action.js +51 -29
  5. data/app/concepts/matestack/ui/core/action/action.rb +3 -0
  6. data/app/concepts/matestack/ui/core/app/app.js +7 -4
  7. data/app/concepts/matestack/ui/core/app/app.rb +1 -1
  8. data/app/concepts/matestack/ui/core/app/location.js +10 -0
  9. data/app/concepts/matestack/ui/core/app/store.js +1 -1
  10. data/app/concepts/matestack/ui/core/async/async.js +2 -2
  11. data/app/concepts/matestack/ui/core/bdi/bdi.haml +5 -0
  12. data/app/concepts/matestack/ui/core/bdi/bdi.rb +4 -0
  13. data/app/concepts/matestack/ui/core/bdo/bdo.haml +5 -0
  14. data/app/concepts/matestack/ui/core/bdo/bdo.rb +11 -0
  15. data/app/concepts/matestack/ui/core/collection/content/content.js +4 -4
  16. data/app/concepts/matestack/ui/core/collection/filter/filter.js +3 -3
  17. data/app/concepts/matestack/ui/core/collection/order/order.js +3 -3
  18. data/app/concepts/matestack/ui/core/component/anonym-dynamic-component.js +1 -1
  19. data/app/concepts/matestack/ui/core/component/component.js +1 -1
  20. data/app/concepts/matestack/ui/core/component/dynamic.rb +2 -2
  21. data/app/concepts/matestack/ui/core/data/data.haml +5 -0
  22. data/app/concepts/matestack/ui/core/data/data.rb +9 -0
  23. data/app/concepts/matestack/ui/core/del/del.haml +5 -0
  24. data/app/concepts/matestack/ui/core/del/del.rb +4 -0
  25. data/app/concepts/matestack/ui/core/dfn/dfn.haml +5 -0
  26. data/app/concepts/matestack/ui/core/dfn/dfn.rb +6 -0
  27. data/app/concepts/matestack/ui/core/dialog/dialog.haml +5 -0
  28. data/app/concepts/matestack/ui/core/dialog/dialog.rb +9 -0
  29. data/app/concepts/matestack/ui/core/form/form.js +23 -5
  30. data/app/concepts/matestack/ui/core/html/html.js +1 -1
  31. data/app/concepts/matestack/ui/core/iframe/iframe.haml +5 -0
  32. data/app/concepts/matestack/ui/core/iframe/iframe.rb +14 -0
  33. data/app/concepts/matestack/ui/core/js/core.js +15 -14
  34. data/app/concepts/matestack/ui/core/onclick/onclick.js +2 -3
  35. data/app/concepts/matestack/ui/core/optgroup/optgroup.haml +3 -0
  36. data/app/concepts/matestack/ui/core/optgroup/optgroup.rb +10 -0
  37. data/app/concepts/matestack/ui/core/option/option.haml +5 -0
  38. data/app/concepts/matestack/ui/core/option/option.rb +12 -0
  39. data/app/concepts/matestack/ui/core/page/content.js +1 -1
  40. data/app/concepts/matestack/ui/core/page/page.rb +3 -2
  41. data/app/concepts/matestack/ui/core/picture/picture.haml +3 -0
  42. data/app/concepts/matestack/ui/core/picture/picture.rb +4 -0
  43. data/app/concepts/matestack/ui/core/plain/plain.rb +1 -1
  44. data/app/concepts/matestack/ui/core/samp/samp.haml +5 -0
  45. data/app/concepts/matestack/ui/core/samp/samp.rb +4 -0
  46. data/app/concepts/matestack/ui/core/template/template.haml +3 -0
  47. data/app/concepts/matestack/ui/core/template/template.rb +4 -0
  48. data/app/concepts/matestack/ui/core/transition/transition.js +1 -1
  49. data/app/concepts/matestack/ui/core/u/u.haml +5 -0
  50. data/app/concepts/matestack/ui/core/u/u.rb +6 -0
  51. data/app/concepts/matestack/ui/core/unescaped/unescaped.rb +7 -0
  52. data/app/concepts/matestack/ui/core/wbr/wbr.haml +1 -0
  53. data/app/concepts/matestack/ui/core/wbr/wbr.rb +4 -0
  54. data/app/helpers/matestack/ui/core/application_helper.rb +3 -1
  55. data/app/javascript/matestack-ui-core/index.js +22 -0
  56. data/app/javascript/matestack-ui-core/styles/index.scss +5 -0
  57. data/app/javascript/packs/matestack-ui-core.js +8 -0
  58. data/app/lib/matestack/ui/core/component_node.rb +24 -10
  59. data/app/lib/matestack/ui/core/has_view_context.rb +10 -0
  60. data/app/lib/matestack/ui/core/page_node.rb +5 -1
  61. data/app/lib/matestack/ui/core/render.rb +89 -0
  62. data/lib/generators/matestack/core/component/templates/docs/components/%file_name%.md.tt +1 -0
  63. data/lib/generators/matestack/page/templates/app/matestack/pages/%app_name%/%namespace%/%file_name%.rb.tt +2 -1
  64. data/lib/matestack/ui/core.rb +1 -0
  65. data/lib/matestack/ui/core/cell.rb +33 -0
  66. data/lib/matestack/ui/core/version.rb +1 -1
  67. data/vendor/assets/javascripts/dist/manifest.json +18 -0
  68. data/vendor/assets/javascripts/dist/manifest.json.br +0 -0
  69. data/vendor/assets/javascripts/dist/manifest.json.gz +0 -0
  70. data/vendor/assets/javascripts/dist/matestack-ui-core.css +3 -0
  71. data/vendor/assets/javascripts/dist/matestack-ui-core.css.map +1 -0
  72. data/vendor/assets/javascripts/{matestack-ui-core.js → dist/matestack-ui-core.js} +11041 -10808
  73. data/vendor/assets/javascripts/dist/matestack-ui-core.js.map +1 -0
  74. data/vendor/assets/javascripts/dist/matestack-ui-core.min.css +0 -0
  75. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js +3 -0
  76. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.LICENSE.txt +18 -0
  77. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.br +0 -0
  78. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.gz +0 -0
  79. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.map +1 -0
  80. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.map.br +0 -0
  81. data/vendor/assets/javascripts/dist/matestack-ui-core.min.js.map.gz +0 -0
  82. data/vendor/assets/javascripts/matestack-ui-core.js.erb +2 -0
  83. data/vendor/assets/stylesheets/dist +1 -0
  84. data/vendor/assets/stylesheets/matestack-ui-core.css.erb +2 -0
  85. metadata +65 -14
  86. data/vendor/assets/javascripts/manifest.json +0 -4
  87. 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: 5c58a7c3107da2943a7443d50e8cf07ba1f379bc58b71a3f97d00700ad87773b
4
- data.tar.gz: d76f2c74cd96afad0b6e4071c751c46122a294690e03f6006ec395e84af24637
3
+ metadata.gz: e645c4e03f7a9cbc1104d1d84b20c108125a384534dc3da249aad457fa7974a7
4
+ data.tar.gz: c6bb027cd246f3ad8ca3ce317362b9437e09a88fe8fcc7ce61e8c2e2909e0033
5
5
  SHA512:
6
- metadata.gz: e02c8a827ab68d86343df60902c2c245b9eff1374d3c2f77adbb050472270ad4858c0d9b0b0473dd06315c2f33f089e9237870d7cfe4f977c6e1d65145b4b4fa
7
- data.tar.gz: 895b45ac12b0f494e5f40c3b5214884d28fb23657602d3b5c4f6637f6353817fda117898743f280dcfd7376aa508b4ae507cd28da6624e2a78fb77b9034d0542
6
+ metadata.gz: a13177effcfb1a6d26f7cb920f71a10dee6946c0d7a2c8d3dc09d4c18651c642e62bbf79f7793e4ae9e36cfbcd9ac645e7ab8c7fabea611d27930ae17c7aa628
7
+ data.tar.gz: 3896719f9b477a9745fd2cec800669dcb8257e21f87f2bc8fd10d7f26ca79610e77caaa04642c571e6a2ded10e64270a2d6f862d9f5a03c74d8a8e2a6bbcdc9d
data/README.md CHANGED
@@ -1,6 +1,7 @@
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)
1
+ ![](https://github.com/matestack/matestack-ui-core/workflows/specs/badge.svg)
2
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
3
  [![Gem Version](https://badge.fury.io/rb/matestack-ui-core.svg)](https://badge.fury.io/rb/matestack-ui-core)
4
+ [![Docs](https://img.shields.io/badge/docs-matestack-blue.svg)](https://www.matestack.org/docs/install)
4
5
 
5
6
  ![matestack logo](./logo.png)
6
7
 
@@ -19,9 +20,20 @@ matestack can progressively replace the classic Rails-View-Layer. You are able t
19
20
  it alongside your classic views and incrementally turn your Rails-App into a
20
21
  dynamic Web-App.
21
22
 
23
+ ### Current State:
24
+
25
+ We love to see more and more people using and contributing to matestack-ui-core. Our current version is 0.7.4 and it's not perfect yet. We recommend you to start using matestack-ui-core in a side project and report issues as this helps us to push matestack-ui-core towards a production ready 1.0.0. At matestack, we already use matestack-ui-core in production as we know how to handle current issues and bypass them with deep insights of the core implementation. We plan to invest time and money (yes, we're hiring) on following improvements:
26
+
27
+ * debugging and error handling
28
+ * core refactoring, increased core maintainability and code quality
29
+ * better integration in existing rails apps
30
+ * improved documentation
31
+ * improved dynamic core components (especially form components)
32
+
33
+
22
34
  ### Installation:
23
35
 
24
- Click here to see how you can add Matestack UI to your existing Rails application: [Installation Guide](https://www.matestack.org/docs/install)
36
+ Click here to see how you can add Matestack UI to your existing Rails application: [Installation Guide](./docs/install)
25
37
 
26
38
  ### Features:
27
39
 
@@ -30,7 +42,7 @@ Click here to see how you can add Matestack UI to your existing Rails applicatio
30
42
  class Pages::MyPage < Matestack::Ui::Page
31
43
 
32
44
  def prepare
33
- @technologies = ["Rails", "Vue.js", "Trailblazer", "Rspec", "Capybara"]
45
+ @technologies = ["Rails", "Vue.js", "Trailblazer", "RSpec", "Capybara"]
34
46
  end
35
47
 
36
48
  def response
@@ -213,7 +225,7 @@ Changelog can be found [here](./CHANGELOG.md)
213
225
 
214
226
  ### Roadmap
215
227
 
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!
228
+ In order to see what we planned to add and release the upcoming months, just have a look at our future [milestones](https://github.com/basemate/matestack-ui-core/milestones) and get in touch via our [chat](https://gitter.im/basemate/community) for feedback! The upcoming issues and feature requests will be added to one of these milestones regarding priority and implementation effort.
217
229
 
218
230
  ### Community
219
231
 
data/Rakefile CHANGED
@@ -32,3 +32,35 @@ require 'rake/testtask'
32
32
  # end
33
33
  #
34
34
  # task default: :test
35
+
36
+ task :webpack => 'webpack:build'
37
+
38
+ namespace :webpack do
39
+ task :build => ['build:development', 'build:production']
40
+
41
+ namespace :build do
42
+ task :development => 'yarn:install' do
43
+ Bundler.with_unbundled_env do
44
+ sh "cd builder && bin/webpack"
45
+ end
46
+ end
47
+ task :production => 'yarn:install' do
48
+ Bundler.with_unbundled_env do
49
+ sh "cd builder && bin/rake webpacker:compile"
50
+ end
51
+ end
52
+ end
53
+
54
+ task :watch => 'yarn:install' do
55
+ Bundler.with_unbundled_env do
56
+ sh "cd builder && bin/webpack --watch"
57
+ end
58
+ end
59
+
60
+ namespace :yarn do
61
+ task :install do
62
+ sh "yarn install && cd builder && yarn install"
63
+ end
64
+ end
65
+ end
66
+
@@ -2,9 +2,8 @@ import Vue from 'vue/dist/vue.esm'
2
2
  import Vuex from 'vuex'
3
3
  import axios from 'axios'
4
4
 
5
- import matestackEventHub from 'js/event-hub'
6
-
7
- import componentMixin from 'component/component'
5
+ import matestackEventHub from '../js/event-hub'
6
+ import componentMixin from '../component/component'
8
7
 
9
8
  const componentDef = {
10
9
  mixins: [componentMixin],
@@ -14,32 +13,55 @@ const componentDef = {
14
13
  methods: {
15
14
  perform: function(){
16
15
  const self = this
17
- axios({
18
- method: self.componentConfig["method"],
19
- url: self.componentConfig["action_path"],
20
- data: self.componentConfig["data"],
21
- headers: {
22
- 'X-CSRF-Token': document.getElementsByName("csrf-token")[0].getAttribute('content')
23
- }
24
- })
25
- .then(function(response){
26
- if (self.componentConfig["success"] != undefined && self.componentConfig["success"]["emit"] != undefined) {
27
- matestackEventHub.$emit(self.componentConfig["success"]["emit"], response.data);
28
- }
29
- if (self.componentConfig["success"] != undefined && self.componentConfig["success"]["transition"] != undefined && self.$store != undefined) {
30
- let path = self.componentConfig["success"]["transition"]["path"]
31
- self.$store.dispatch('navigateTo', {url: path, backwards: false})
32
- }
33
- })
34
- .catch(function(error){
35
- if (self.componentConfig["failure"] != undefined && self.componentConfig["failure"]["emit"] != undefined) {
36
- matestackEventHub.$emit(self.componentConfig["failure"]["emit"], error.response.data);
37
- }
38
- if (self.componentConfig["failure"] != undefined && self.componentConfig["failure"]["transition"] != undefined && self.$store != undefined) {
39
- let path = self.componentConfig["failure"]["transition"]["path"]
40
- self.$store.dispatch('navigateTo', {url: path, backwards: false})
41
- }
42
- })
16
+ if (
17
+ (self.componentConfig["confirm"] == undefined) || confirm(self.componentConfig["confirm_text"])
18
+ )
19
+ {
20
+ axios({
21
+ method: self.componentConfig["method"],
22
+ url: self.componentConfig["action_path"],
23
+ data: self.componentConfig["data"],
24
+ headers: {
25
+ 'X-CSRF-Token': document.getElementsByName("csrf-token")[0].getAttribute('content')
26
+ }
27
+ })
28
+ .then(function(response){
29
+ if (self.componentConfig["success"] != undefined && self.componentConfig["success"]["emit"] != undefined) {
30
+ matestackEventHub.$emit(self.componentConfig["success"]["emit"], response.data);
31
+ }
32
+ if (self.componentConfig["success"] != undefined
33
+ && self.componentConfig["success"]["transition"] != undefined
34
+ && (
35
+ self.componentConfig["success"]["transition"]["follow_response"] == undefined
36
+ ||
37
+ self.componentConfig["success"]["transition"]["follow_response"] === false
38
+ )
39
+ && self.$store != undefined
40
+ ) {
41
+ let path = self.componentConfig["success"]["transition"]["path"]
42
+ self.$store.dispatch('navigateTo', {url: path, backwards: false})
43
+ return;
44
+ }
45
+ if (self.componentConfig["success"] != undefined
46
+ && self.componentConfig["success"]["transition"] != undefined
47
+ && self.componentConfig["success"]["transition"]["follow_response"] === true
48
+ && self.$store != undefined
49
+ ) {
50
+ let path = response.data["transition_to"] || response.request.responseURL;
51
+ self.$store.dispatch('navigateTo', {url: path, backwards: false});
52
+ return;
53
+ }
54
+ })
55
+ .catch(function(error){
56
+ if (self.componentConfig["failure"] != undefined && self.componentConfig["failure"]["emit"] != undefined) {
57
+ matestackEventHub.$emit(self.componentConfig["failure"]["emit"], error.response.data);
58
+ }
59
+ if (self.componentConfig["failure"] != undefined && self.componentConfig["failure"]["transition"] != undefined && self.$store != undefined) {
60
+ let path = self.componentConfig["failure"]["transition"]["path"]
61
+ self.$store.dispatch('navigateTo', {url: path, backwards: false})
62
+ }
63
+ })
64
+ }
43
65
  }
44
66
  }
45
67
  }
@@ -19,6 +19,9 @@ module Matestack::Ui::Core::Action
19
19
  if options[:notify].nil?
20
20
  @component_config[:notify] = true
21
21
  end
22
+ if @component_config[:confirm] = options[:confirm]
23
+ @component_config[:confirm_text] = options[:confirm].try(:[], :text) || "Are you sure?"
24
+ end
22
25
  end
23
26
 
24
27
  def action_path
@@ -1,7 +1,7 @@
1
1
  import Vue from 'vue/dist/vue.esm'
2
- import axios from 'axios'
3
2
  import VRuntimeTemplate from "v-runtime-template"
4
3
  import Vuex from 'vuex'
4
+ import isNavigatingToAnotherPage from "./location"
5
5
 
6
6
  const componentDef = {
7
7
  props: ['appConfig', 'params'],
@@ -12,9 +12,10 @@ const componentDef = {
12
12
  asyncTemplate: state => state.pageTemplate,
13
13
  }),
14
14
  mounted: function(){
15
- const self = this;
16
- window.onpopstate = function(event) {
17
- self.$store.dispatch("navigateTo", {url: document.location.pathname, backwards: true} );
15
+ window.onpopstate = (event) => {
16
+ if (isNavigatingToAnotherPage(document.location, event)) {
17
+ this.$store.dispatch("navigateTo", {url: document.location.pathname, backwards: true} );
18
+ };
18
19
  }
19
20
  },
20
21
  components: {
@@ -22,6 +23,8 @@ const componentDef = {
22
23
  }
23
24
  }
24
25
 
26
+
27
+
25
28
  let component = Vue.component('matestack-ui-core-app', componentDef)
26
29
 
27
30
  export default componentDef
@@ -1,7 +1,7 @@
1
1
  module Matestack::Ui::Core::App
2
2
  class App < Trailblazer::Cell
3
3
 
4
- include ::Cell::Haml
4
+ include Matestack::Ui::Core::Cell
5
5
  include Matestack::Ui::Core::ApplicationHelper
6
6
  include Matestack::Ui::Core::ToCell
7
7
 
@@ -0,0 +1,10 @@
1
+ const isNavigatingToAnotherPage = function(currentLocation, popstateEvent) {
2
+ const targetLocation = popstateEvent.target.location;
3
+
4
+ // omits hash by design
5
+ return currentLocation.pathname !== targetLocation.pathname ||
6
+ currentLocation.origin !== targetLocation.origin ||
7
+ currentLocation.search !== targetLocation.search
8
+ }
9
+
10
+ export default isNavigatingToAnotherPage
@@ -1,7 +1,7 @@
1
1
  import Vue from 'vue/dist/vue.esm'
2
2
  import Vuex from 'vuex'
3
3
  import axios from 'axios'
4
- import matestackEventHub from 'js/event-hub'
4
+ import matestackEventHub from '../js/event-hub'
5
5
 
6
6
  Vue.use(Vuex)
7
7
 
@@ -1,6 +1,6 @@
1
1
  import Vue from 'vue/dist/vue.esm'
2
- import matestackEventHub from 'js/event-hub'
3
- import componentMixin from 'component/component'
2
+ import matestackEventHub from '../js/event-hub'
3
+ import componentMixin from '../component/component'
4
4
 
5
5
  const componentDef = {
6
6
  mixins: [componentMixin],
@@ -0,0 +1,5 @@
1
+ %bdi{@tag_attributes}
2
+ - if options[:text].blank? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,4 @@
1
+ module Matestack::Ui::Core::Bdi
2
+ class Bdi < Matestack::Ui::Core::Component::Static
3
+ end
4
+ end
@@ -0,0 +1,5 @@
1
+ %bdo{@tag_attributes}
2
+ - if options[:text].blank? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,11 @@
1
+ module Matestack::Ui::Core::Bdo
2
+ class Bdo < Matestack::Ui::Core::Component::Static
3
+ REQUIRED_KEYS = [:dir]
4
+
5
+ def setup
6
+ @tag_attributes.merge!({
7
+ "dir": options[:dir]
8
+ })
9
+ end
10
+ end
11
+ end
@@ -1,8 +1,8 @@
1
1
  import Vue from 'vue/dist/vue.esm'
2
- import matestackEventHub from 'js/event-hub'
3
- import queryParamsHelper from 'js/helpers/query-params-helper'
4
- import componentMixin from 'component/component'
5
- import asyncMixin from 'async/async'
2
+ import matestackEventHub from '../../js/event-hub'
3
+ import queryParamsHelper from '../../js/helpers/query-params-helper'
4
+ import componentMixin from '../../component/component'
5
+ import asyncMixin from '../../async/async'
6
6
 
7
7
  const componentDef = {
8
8
  mixins: [componentMixin, asyncMixin],
@@ -1,7 +1,7 @@
1
1
  import Vue from 'vue/dist/vue.esm'
2
- import matestackEventHub from 'js/event-hub'
3
- import queryParamsHelper from 'js/helpers/query-params-helper'
4
- import componentMixin from 'component/component'
2
+ import matestackEventHub from '../../js/event-hub'
3
+ import queryParamsHelper from '../../js/helpers/query-params-helper'
4
+ import componentMixin from '../../component/component'
5
5
 
6
6
  const componentDef = {
7
7
  mixins: [componentMixin],
@@ -1,7 +1,7 @@
1
1
  import Vue from 'vue/dist/vue.esm'
2
- import matestackEventHub from 'js/event-hub'
3
- import queryParamsHelper from 'js/helpers/query-params-helper'
4
- import componentMixin from 'component/component'
2
+ import matestackEventHub from '../../js/event-hub'
3
+ import queryParamsHelper from '../../js/helpers/query-params-helper'
4
+ import componentMixin from '../../component/component'
5
5
 
6
6
  const componentDef = {
7
7
  mixins: [componentMixin],
@@ -1,5 +1,5 @@
1
1
  import Vue from 'vue/dist/vue.esm'
2
- import componentMixin from 'component/component'
2
+ import componentMixin from './component'
3
3
 
4
4
  const componentDef = {
5
5
  mixins: [componentMixin]
@@ -1,7 +1,7 @@
1
1
  import Vue from 'vue/dist/vue.esm'
2
2
  import axios from 'axios'
3
3
  import VRuntimeTemplate from "v-runtime-template"
4
- import matestackEventHub from 'js/event-hub'
4
+ import matestackEventHub from '../js/event-hub'
5
5
 
6
6
  const componentMixin = {
7
7
  props: ['componentConfig', 'params'],
@@ -1,9 +1,9 @@
1
1
  module Matestack::Ui::Core::Component
2
2
  class Dynamic < Trailblazer::Cell
3
-
4
- include ::Cell::Haml
3
+ include Matestack::Ui::Core::Cell
5
4
  include Matestack::Ui::Core::ApplicationHelper
6
5
  include Matestack::Ui::Core::ToCell
6
+ include Matestack::Ui::Core::HasViewContext
7
7
 
8
8
  view_paths << "#{Matestack::Ui::Core::Engine.root}/app/concepts"
9
9
  view_paths << "#{::Rails.root}/app/matestack"
@@ -0,0 +1,5 @@
1
+ %data{@tag_attributes}
2
+ - if options[:text].blank? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,9 @@
1
+ module Matestack::Ui::Core::Data
2
+ class Data < Matestack::Ui::Core::Component::Static
3
+ def setup
4
+ @tag_attributes.merge!({
5
+ "value": options[:value] ||= nil
6
+ })
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ %del{@tag_attributes.merge({:cite => options[:cite], :datetime => options[:datetime]})}
2
+ - if options[:text].nil? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,4 @@
1
+ module Matestack::Ui::Core::Del
2
+ class Del < Matestack::Ui::Core::Component::Static
3
+ end
4
+ end
@@ -0,0 +1,5 @@
1
+ %dfn{@tag_attributes}
2
+ - if options[:text].nil? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,6 @@
1
+ module Matestack::Ui::Core::Dfn
2
+ class Dfn < Matestack::Ui::Core::Component::Static
3
+
4
+ end
5
+ end
6
+
@@ -0,0 +1,5 @@
1
+ %dialog{@tag_attributes}
2
+ - if options[:text].blank? && block_given?
3
+ = yield
4
+ - else
5
+ = options[:text]
@@ -0,0 +1,9 @@
1
+ module Matestack::Ui::Core::Dialog
2
+ class Dialog < Matestack::Ui::Core::Component::Static
3
+ def setup
4
+ @tag_attributes.merge!({
5
+ "open": options[:open] ||= nil
6
+ })
7
+ end
8
+ end
9
+ end
@@ -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],
@@ -88,6 +87,22 @@ const componentDef = {
88
87
  }
89
88
  self.data = data;
90
89
  },
90
+ shouldResetFormOnSuccessfulSubmit() {
91
+ const self = this
92
+ if (self.componentConfig['success'] != undefined && self.componentConfig['success']['reset'] != undefined) {
93
+ return self.componentConfig['success']['reset']
94
+ } else {
95
+ return self.shouldResetFormOnSuccessfulSubmitByDefault()
96
+ }
97
+ },
98
+ shouldResetFormOnSuccessfulSubmitByDefault() {
99
+ const self = this
100
+ if (self.componentConfig["method"] == "put") {
101
+ return false
102
+ } else {
103
+ return true
104
+ }
105
+ },
91
106
  perform: function(){
92
107
  const self = this
93
108
  let payload = {}
@@ -126,8 +141,11 @@ const componentDef = {
126
141
  self.$store.dispatch('navigateTo', {url: path, backwards: false})
127
142
  return;
128
143
  }
129
- self.setProps(self.data, null);
130
- self.initValues()
144
+ if (self.shouldResetFormOnSuccessfulSubmit())
145
+ {
146
+ self.setProps(self.data, null);
147
+ self.initValues();
148
+ }
131
149
  self.showInlineForm = false;
132
150
  })
133
151
  .catch(function(error){