-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move some files to /src folder, deprecate proxy form
- Loading branch information
Showing
82 changed files
with
1,597 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,24 @@ | ||
import STORE from "../config/store"; | ||
import Form from "../classes/Form"; | ||
|
||
export default new class debug{ | ||
msg(text: string, params: any = '') { | ||
if (STORE.debug) | ||
console.log(`%c[form]%c ${text}`, 'color: #42b883', 'color: black', params) | ||
class debug{ | ||
private static getName<T extends NamedElement>(element: T) { | ||
return element.name ? `(${element.name})` : ''; | ||
} | ||
static msg(...params: string[]) { | ||
if (!STORE.debug) return; | ||
|
||
console.log(`%c[form]%c`, 'color: #42b883', 'color: black', ...params) | ||
} | ||
static newForm(form: Form) { | ||
debug.msg(`form${debug.getName(form)}: created`); | ||
} | ||
static newSubscription<T extends NamedElement>(parent: T, child: T) { | ||
debug.msg(`subscription${debug.getName(child)}: add to ${debug.getName(parent)}`) | ||
} | ||
} | ||
export default debug; | ||
|
||
interface NamedElement { | ||
name?: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import debug from "./debug"; | ||
|
||
export default function warn(subject: string, text: string, error?: any) { | ||
console.log(`%c[${subject}] %c${text}`, 'color: #dac400', 'color: black',error); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<template> | ||
<div class="container-examples"> | ||
|
||
<form-field :name="name" label = "Username"/> | ||
<widget-composite/> | ||
<button @click = "change">changed</button> | ||
|
||
<div :key = "count">{{values}}</div> | ||
</div> | ||
</template> | ||
|
||
<script setup lang='ts'> | ||
import Form from "../../../src/classes/Form"; | ||
import FormField from "./../../../src/widgets/form-field.vue"; | ||
import {ref} from "vue"; | ||
import WidgetComposite from "./widget-composite.vue"; | ||
const form = new Form({ | ||
name: "Main" | ||
}); | ||
window.form = form | ||
const count = ref(0); | ||
setInterval(() => count.value++, 50); | ||
const values = ref(form.values); | ||
const name = ref('username'); | ||
function change() { | ||
name.value = name.value === 'username' ? 'age' : 'username'; | ||
} | ||
</script> | ||
|
||
<style> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<template> | ||
<div> | ||
<form-field name="x"/> | ||
<form-field name="y"/> | ||
|
||
<div :key = "count"> | ||
Value: {{values}} | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup lang = "ts"> | ||
import FormField from "./../../../src/widgets/form-field.vue"; | ||
import Form from "./../../../src/classes/Form"; | ||
import {ref} from "vue"; | ||
const form = new Form({ | ||
name: 'coordinate' | ||
}) | ||
const count = ref(0); | ||
setInterval(() => { | ||
count.value++; | ||
values.value = form.values; | ||
}, 50); | ||
const values = ref(form.values); | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.