diff --git a/docs/components/widget-example-form-disable.vue b/docs/components/widget-example-form-disable.vue index 96f4df5..9ce72cc 100644 --- a/docs/components/widget-example-form-disable.vue +++ b/docs/components/widget-example-form-disable.vue @@ -26,7 +26,7 @@ + + diff --git a/src/pages/test/input-coord.vue b/project/pages/test/input-coord.vue similarity index 76% rename from src/pages/test/input-coord.vue rename to project/pages/test/input-coord.vue index 5d2dbbc..89666f5 100644 --- a/src/pages/test/input-coord.vue +++ b/project/pages/test/input-coord.vue @@ -8,12 +8,16 @@ + + \ No newline at end of file diff --git a/src/pages/test/widget-daughter.vue b/project/pages/test/widget-daughter.vue similarity index 100% rename from src/pages/test/widget-daughter.vue rename to project/pages/test/widget-daughter.vue diff --git a/src/pages/test/widget-double-child.vue b/project/pages/test/widget-double-child.vue similarity index 100% rename from src/pages/test/widget-double-child.vue rename to project/pages/test/widget-double-child.vue diff --git a/src/pages/test/widget-field.vue b/project/pages/test/widget-field.vue similarity index 100% rename from src/pages/test/widget-field.vue rename to project/pages/test/widget-field.vue diff --git a/src/pages/test/widget-grandmother.vue b/project/pages/test/widget-grandmother.vue similarity index 100% rename from src/pages/test/widget-grandmother.vue rename to project/pages/test/widget-grandmother.vue diff --git a/src/pages/test/widget-hello.vue b/project/pages/test/widget-hello.vue similarity index 100% rename from src/pages/test/widget-hello.vue rename to project/pages/test/widget-hello.vue diff --git a/src/pages/test/widget-input-account-type.vue b/project/pages/test/widget-input-account-type.vue similarity index 100% rename from src/pages/test/widget-input-account-type.vue rename to project/pages/test/widget-input-account-type.vue diff --git a/src/pages/test/widget-input-country.vue b/project/pages/test/widget-input-country.vue similarity index 100% rename from src/pages/test/widget-input-country.vue rename to project/pages/test/widget-input-country.vue diff --git a/src/pages/test/widget-mother.vue b/project/pages/test/widget-mother.vue similarity index 100% rename from src/pages/test/widget-mother.vue rename to project/pages/test/widget-mother.vue diff --git a/src/pages/test/widget-parent.vue b/project/pages/test/widget-parent.vue similarity index 100% rename from src/pages/test/widget-parent.vue rename to project/pages/test/widget-parent.vue diff --git a/src/classes/Form.ts b/src/classes/Form.ts new file mode 100644 index 0000000..3ee5fca --- /dev/null +++ b/src/classes/Form.ts @@ -0,0 +1,116 @@ +import grandObject from "../utils/grand-object"; +import mergeObjects from "../utils/merge-objects"; +import EventEmitter from "jenesius-event-emitter"; +import FormEvent from "./FormEvent"; +import {getCurrentInstance, inject as injectVue} from "vue"; +import getPropFromObject from "../../plugin/utils/get-prop-from-object"; +import {provide as provideVue} from "@vue/runtime-core"; +import checkNameInObject from "../utils/check-name-in-object"; +/** + * Main principe : GMN + * G - Grand + * M - Merge + * N - Notify + * */ +export default class Form extends EventEmitter implements FormDependence { + static EVENT_NAME = 'form-event' + static PROVIDE_NAME = 'form-controller'; + + static getParentForm() { + return injectVue