@jseeio/jsee 0.2.4 → 0.2.5
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.
- package/CHANGELOG.md +2 -23
- package/dist/jsee.js +1 -1
- package/dist/jsee.runtime.js +1 -1
- package/package.json +1 -1
- package/src/app.js +14 -1
- package/templates/bulma-app.vue +58 -7
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -75,6 +75,11 @@ function createVueApp (env, mountedCallback, logMain) {
|
|
|
75
75
|
dataInit.outputs = []
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
// Flag that shows if data was changed from initial conditions
|
|
79
|
+
dataInit.dataChanged = false
|
|
80
|
+
// Flag for autorun feedback
|
|
81
|
+
dataInit.clickRun = false
|
|
82
|
+
|
|
78
83
|
function len(s) {
|
|
79
84
|
return s.length;
|
|
80
85
|
}
|
|
@@ -144,8 +149,9 @@ function createVueApp (env, mountedCallback, logMain) {
|
|
|
144
149
|
deep: true,
|
|
145
150
|
immediate: false,
|
|
146
151
|
handler (v) {
|
|
152
|
+
this.dataChanged = true // Used in the reset button
|
|
147
153
|
if (this.model.autorun) {
|
|
148
|
-
|
|
154
|
+
this.run()
|
|
149
155
|
}
|
|
150
156
|
}
|
|
151
157
|
}
|
|
@@ -160,9 +166,16 @@ function createVueApp (env, mountedCallback, logMain) {
|
|
|
160
166
|
},
|
|
161
167
|
reset () {
|
|
162
168
|
resetInputs(this.inputs)
|
|
169
|
+
this.$nextTick(() => {
|
|
170
|
+
this.dataChanged = false
|
|
171
|
+
})
|
|
163
172
|
},
|
|
164
173
|
run () {
|
|
174
|
+
this.clickRun = true
|
|
165
175
|
env.run()
|
|
176
|
+
setTimeout(() => {
|
|
177
|
+
this.clickRun = false
|
|
178
|
+
}, 150)
|
|
166
179
|
},
|
|
167
180
|
notify (msg) {
|
|
168
181
|
env.notify(msg)
|
package/templates/bulma-app.vue
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
justify-content: center;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
|
|
29
30
|
.card-header {
|
|
30
31
|
box-shadow: none;
|
|
31
32
|
border-bottom: 1px solid #ececec;
|
|
@@ -50,6 +51,55 @@
|
|
|
50
51
|
background-color: whitesmoke;
|
|
51
52
|
}
|
|
52
53
|
}
|
|
54
|
+
|
|
55
|
+
.card-footer {
|
|
56
|
+
/* background: linear-gradient(62deg, rgba(0,171,209,1) 0%, rgba(0,209,178,1) 100%); */
|
|
57
|
+
background: linear-gradient(90deg, #4395d0 0%, #00d1b2 100%);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.card-footer.reset {
|
|
61
|
+
background: linear-gradient(90deg, #ff577f 0%, #4395d0 50%, #00d1b2 100%);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.card-footer .button {
|
|
65
|
+
background: none;
|
|
66
|
+
padding: .75rem 1.5rem;
|
|
67
|
+
border: none !important;
|
|
68
|
+
font-size: 14px;
|
|
69
|
+
font-weight: 400;
|
|
70
|
+
border-radius: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.reset-button {
|
|
74
|
+
justify-content: left;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.reset-button:hover {
|
|
78
|
+
background-color: transparent !important;
|
|
79
|
+
background: linear-gradient(90deg, #ff3a56 0%, #fff0 80%)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.card-footer .run-button {
|
|
83
|
+
border-left: 1px dashed white;
|
|
84
|
+
justify-content: right;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.card-footer .run-button:hover,{
|
|
88
|
+
background-color: transparent !important;
|
|
89
|
+
background: linear-gradient(270deg, #02dbb2 0%, #fff0 80%);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.card-footer .run-button.running .run-icon {
|
|
93
|
+
color: #016c5c !important;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.field {
|
|
97
|
+
margin-bottom: 5px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.input, .textarea, .select select {
|
|
101
|
+
border-color: #e8e8e8;
|
|
102
|
+
}
|
|
53
103
|
}
|
|
54
104
|
</style>
|
|
55
105
|
<template>
|
|
@@ -73,21 +123,22 @@
|
|
|
73
123
|
<pre v-if="$parent.model.debug">{{ $parent.inputs }}</pre>
|
|
74
124
|
<!-- <button class="button is-primary" id="run"><span>▸</span> Run</button> -->
|
|
75
125
|
</div>
|
|
76
|
-
<footer class="card-footer">
|
|
126
|
+
<footer class="card-footer" v-bind:class="{ reset: $parent.dataChanged }">
|
|
77
127
|
<button
|
|
78
128
|
v-on:click="$parent.reset()"
|
|
79
|
-
v-if="$parent.inputs && $parent.inputs.length > 0"
|
|
80
|
-
class="button icon card-footer-item is-danger is-small"
|
|
129
|
+
v-if="$parent.inputs && $parent.inputs.length > 0 && $parent.dataChanged"
|
|
130
|
+
class="button reset-button icon card-footer-item is-danger is-small"
|
|
81
131
|
>
|
|
82
|
-
<span class="has-text-danger-dark">✕</span>
|
|
132
|
+
<span class="rest-icon has-text-danger-dark">✕</span>
|
|
83
133
|
<span> Reset</span>
|
|
84
134
|
</button>
|
|
85
135
|
<button
|
|
86
136
|
v-on:click="$parent.run()"
|
|
87
|
-
class="button icon card-footer-item is-primary is-small"
|
|
137
|
+
class="button run-button icon card-footer-item is-primary is-small"
|
|
138
|
+
v-bind:class="{ running: $parent.clickRun }"
|
|
88
139
|
>
|
|
89
|
-
<span
|
|
90
|
-
<span
|
|
140
|
+
<span> Run </span>
|
|
141
|
+
<span class="run-icon has-text-primary-dark">▸</span>
|
|
91
142
|
</button>
|
|
92
143
|
</footer>
|
|
93
144
|
</div>
|