matestack-ui-vuejs 3.0.0.rc2 → 3.1.0.rc1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99ea040fb1ac6a1e9b49ae40b22a2ed30c703ede3cf7235eb0ddd2c1670c887e
4
- data.tar.gz: 54b4e7cb85b897ec45d4deae065cd5a8ba46b2f0588b44949e53eb7c7b01a839
3
+ metadata.gz: 2288e01bfdc882399c7dc6e1ff70c54c37ac6e547e0f744cb8bac28b6dc7a0e5
4
+ data.tar.gz: a3ad3450a2f5c6b248a483982441ff8bb17591f4d6ba7e595151112bb309c6a9
5
5
  SHA512:
6
- metadata.gz: aec4b501e33bbab1c1f7cc074f9913067481e72699ca924d123b504e8a0f4a7ac79bde2a376beeacffae0a9e6d9e5cbf8a1146cc99a1a6a959570e8063df506a
7
- data.tar.gz: e117235aa7d0df115ad8683a8f2f407e2fcb33633df689e3d2c938205a2497335dc7afa277f6081cfbd91606ec160593e4af4bb3823d988fbcb98c75fa67227d
6
+ metadata.gz: 9e74e6ecb663f7d7afe9ea8bafd074e43d55db3efb60742fb155426b524d1805ce506876a9568ce5349fc262915b40d70f6e7a1ba784d92358863ad834ab12cf
7
+ data.tar.gz: 39402772d0e5d3523cc7083aba41f138defc111aa62be7398ecd91b19df7caef5cd9b89c83a2f6e3965633e26c24800ce6f202d468e16405a05032691a04c440
data/README.md CHANGED
@@ -10,6 +10,8 @@
10
10
 
11
11
  Boost your productivity & easily create reactive web UIs in pure Ruby. Easily extend with pure JavaScript if required. No Opal involved.
12
12
 
13
+ **New repo, old git history? This repo was duplicated from `matestack-ui-core` in order to extract Vue.js features into `matestack-ui-vuejs` in Feburary 2022**
14
+
13
15
  ## About
14
16
 
15
17
  `matestack-ui-vuejs` ships all you need to build **reactive** UIs in **pure Ruby** orchestrating prebuilt Vue.js components with a simple Ruby DSL.
@@ -15,11 +15,19 @@ const componentDef = {
15
15
  methods: {
16
16
  addItem: function(key){
17
17
  var templateString = JSON.parse(this.getTemplateElement().querySelector('#prototype-template-for-'+key).dataset[":template"])
18
- var tmp_dom_elem = document.createElement('div')
19
- tmp_dom_elem.innerHTML = templateString
20
- var static_prototype_template_uid = tmp_dom_elem.querySelector('matestack-component-template').id.replace("uid-", "")
21
- var dynamic_prototype_template_uid = Math.floor(Math.random() * 1000000000);
22
- var templateString = templateString.replaceAll(static_prototype_template_uid, dynamic_prototype_template_uid);
18
+ var regex = /"component_uid":"(.+?)"/g
19
+ var staticComponentUidMatches = templateString.matchAll(regex)
20
+ var staticComponentUids = []
21
+ for (const match of staticComponentUidMatches) {
22
+ staticComponentUids.push(match[1])
23
+ }
24
+ staticComponentUids.forEach(function(uid){
25
+ var newUid = Math.floor(Math.random() * 1000000000);
26
+ templateString = templateString.replaceAll(uid, newUid);
27
+ })
28
+ var tmpDomElem = document.createElement('div')
29
+ tmpDomElem.innerHTML = templateString
30
+
23
31
  if (this.parentNestedFormRuntimeTemplateDomElements[key] == null){
24
32
  var dom_elem = document.createElement('div')
25
33
  dom_elem.innerHTML = templateString
@@ -1,5 +1,4 @@
1
- import Vue from 'vue'
2
-
1
+ import axios from 'axios'
3
2
  import eventHub from './event_hub'
4
3
  const matestackEventHub = eventHub // for compatibility with 1.x
5
4
 
@@ -70,14 +69,18 @@ const registerComponents = function(appInstance){
70
69
  }
71
70
 
72
71
  const mount = function(appInstance, elementId='#matestack-ui'){
73
- registerComponents(appInstance)
72
+ if (window.matestackAppMounted != true){
73
+ window.matestackAppMounted = true
74
+ registerComponents(appInstance)
74
75
 
75
- appInstance.mount(elementId)
76
+ appInstance.mount(elementId)
77
+ }
76
78
 
77
79
  return appInstance
78
80
  }
79
81
 
80
82
  const MatestackUiVueJs = {
83
+ axios,
81
84
  eventHub,
82
85
  matestackEventHub, // for compatibility with 1.x
83
86
  componentMixin,
@@ -1,7 +1,7 @@
1
1
  module Matestack
2
2
  module Ui
3
3
  module VueJs
4
- VERSION = '3.0.0.rc2'
4
+ VERSION = '3.1.0.rc1'
5
5
  end
6
6
  end
7
7
  end
@@ -0,0 +1 @@
1
+ require "matestack/ui/vue_js"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: matestack-ui-vuejs
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.rc2
4
+ version: 3.1.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Jabari
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-15 00:00:00.000000000 Z
11
+ date: 2022-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: matestack-ui-core
@@ -122,6 +122,7 @@ files:
122
122
  - lib/matestack/ui/vue_js/vue.rb
123
123
  - lib/matestack/ui/vue_js/vue_attributes.rb
124
124
  - lib/matestack/ui/vue_js_component.rb
125
+ - lib/matestack/ui/vuejs.rb
125
126
  homepage: https://matestack.io
126
127
  licenses:
127
128
  - MIT
@@ -142,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
143
  - !ruby/object:Gem::Version
143
144
  version: 1.3.1
144
145
  requirements: []
145
- rubygems_version: 3.1.4
146
+ rubygems_version: 3.2.15
146
147
  signing_key:
147
148
  specification_version: 4
148
149
  summary: Escape the frontend hustle & easily create interactive web apps in pure Ruby.