Skip to content

Commit 2f6ab02

Browse files
committed
commited missing test component js files
1 parent 07bd43f commit 2f6ab02

File tree

1 file changed

+110
-0
lines changed

1 file changed

+110
-0
lines changed

spec/dummy/app/assets/javascripts/test/components.js

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,113 @@ MatestackUiCore.Vue.component('my-test-component', {
3838
}, 300);
3939
}
4040
});
41+
42+
MatestackUiCore.Vue.component('custom-form-input-test', {
43+
mixins: [MatestackUiCore.componentMixin, MatestackUiCore.formInputMixin],
44+
data() {
45+
return {};
46+
},
47+
methods: {
48+
changeValueViaJs: function(value){
49+
this.setValue(value);
50+
},
51+
afterInitialize: function(value){
52+
if(value == "change me via JS"){
53+
this.setValue("done");
54+
}
55+
}
56+
},
57+
mounted: function(){
58+
if(this.$el.querySelector("#bar") != undefined){
59+
this.$el.querySelector("#bar").classList.add("js-added-class")
60+
}
61+
}
62+
});
63+
64+
MatestackUiCore.Vue.component('custom-form-textarea-test', {
65+
mixins: [MatestackUiCore.componentMixin, MatestackUiCore.formTextareaMixin],
66+
data() {
67+
return {};
68+
},
69+
methods: {
70+
changeValueViaJs: function(value){
71+
this.setValue(value);
72+
},
73+
afterInitialize: function(value){
74+
if(value == "change me via JS"){
75+
this.setValue("done");
76+
}
77+
}
78+
},
79+
mounted: function(){
80+
if(this.$el.querySelector("#bar") != undefined){
81+
this.$el.querySelector("#bar").classList.add("js-added-class")
82+
}
83+
}
84+
});
85+
86+
MatestackUiCore.Vue.component('custom-form-radio-test', {
87+
mixins: [MatestackUiCore.componentMixin, MatestackUiCore.formRadioMixin],
88+
data() {
89+
return {};
90+
},
91+
methods: {
92+
changeValueViaJs: function(value){
93+
this.setValue(value);
94+
},
95+
afterInitialize: function(value){
96+
if(value == "change me via JS"){
97+
this.setValue("Array Option 1");
98+
}
99+
}
100+
},
101+
mounted: function(){
102+
if(this.$el.querySelector("#bar_1") != undefined){
103+
this.$el.querySelector("#bar_1").classList.add("js-added-class")
104+
}
105+
}
106+
});
107+
108+
MatestackUiCore.Vue.component('custom-form-checkbox-test', {
109+
mixins: [MatestackUiCore.componentMixin, MatestackUiCore.formCheckboxMixin],
110+
data() {
111+
return {};
112+
},
113+
methods: {
114+
changeValueViaJs: function(value){
115+
this.setValue(value);
116+
},
117+
afterInitialize: function(value){
118+
if(value == "change me via JS"){
119+
this.setValue(2);
120+
}
121+
}
122+
},
123+
mounted: function(){
124+
if(this.$el.querySelector("#bar_1") != undefined){
125+
this.$el.querySelector("#bar_1").classList.add("js-added-class")
126+
}
127+
}
128+
});
129+
130+
MatestackUiCore.Vue.component('custom-form-select-test', {
131+
mixins: [MatestackUiCore.componentMixin, MatestackUiCore.formSelectMixin],
132+
data() {
133+
return {};
134+
},
135+
methods: {
136+
changeValueViaJs: function(value){
137+
this.setValue(value);
138+
},
139+
afterInitialize: function(value){
140+
if(value == "change me via JS"){
141+
this.setValue(2);
142+
}
143+
}
144+
},
145+
mounted: function(){
146+
if(this.$el.querySelector("#bar") != undefined){
147+
this.$el.querySelector("#bar").classList.add("js-added-class")
148+
}
149+
}
150+
});

0 commit comments

Comments
 (0)