Skip to content

Commit ca64a39

Browse files
committed
working functor
1 parent d6ffbe7 commit ca64a39

File tree

15 files changed

+2687
-265
lines changed

15 files changed

+2687
-265
lines changed

package-lock.json

Lines changed: 2087 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@
99
},
1010
"dependencies": {
1111
"@primeuix/themes": "^1.0.0",
12+
"browserify": "^17.0.1",
13+
"buffer": "^6.0.3",
1214
"chart.js": "3.3.2",
15+
"csv-parse": "^5.6.0",
1316
"csv-parser": "^3.2.0",
1417
"json-tree-view-vue3": "^1.0.2",
18+
"node-jq": "^6.0.1",
1519
"primeflex": "^4.0.0",
1620
"primeicons": "^7.0.0",
1721
"primevue": "^4.3.1",
22+
"sql-formatter": "^15.5.2",
1823
"tailwindcss-primeui": "^0.5.0",
1924
"vue": "^3.4.34",
25+
"vue-json-editor": "^1.4.3",
2026
"vue-papa-parse": "^3.1.0",
2127
"vue-router": "^4.4.0"
2228
},

src/components/SimpleForm.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<script setup>
2+
3+
</script>
4+
5+
<template>
6+
7+
</template>
8+
9+
<style scoped lang="scss">
10+
11+
</style>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<script setup>
2+
</script>
3+
4+
<template>
5+
<InputGroup>
6+
<InputGroupAddon>
7+
<div :style="color"></div>
8+
</InputGroupAddon>
9+
<InputText v-bind="$attrs" mask="#******" placeholder="color" :maxlength="7" />
10+
</InputGroup>
11+
</template>
12+
13+
<style scoped lang="scss">
14+
15+
</style>
16+
<script>
17+
export default {
18+
computed: {
19+
color() {
20+
return {'background-color': this.$attrs.modelValue, 'width': '100%', 'height': '100%'};
21+
}
22+
}
23+
}
24+
</script>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<script setup>
2+
</script>
3+
4+
<template>
5+
<InputGroup>
6+
<Textarea :model-value="text" @update:model-value="wrap_function" rows="5" cols="30" :invalid="invalid" />
7+
</InputGroup>
8+
</template>
9+
10+
<style scoped lang="scss">
11+
12+
</style>
13+
<script>
14+
export default {
15+
props: ['modelValue', 'args'],
16+
emits: ['update:modelValue'],
17+
data () {
18+
const text = this.modelValue || '';
19+
return {text};
20+
},
21+
computed: {
22+
function () {
23+
try {
24+
return new Function(...this.args, this.text);
25+
} catch {
26+
return null;
27+
}
28+
},
29+
invalid() {
30+
this.function === null;
31+
}
32+
},
33+
methods: {
34+
wrap_function(text) {
35+
this.text = text;
36+
this.$emit('update:modelValue', this.function);
37+
}
38+
}
39+
}
40+
</script>

0 commit comments

Comments
 (0)