From 9f6454974be83a8bdd52f3642781f9fc628a1868 Mon Sep 17 00:00:00 2001 From: Lucas Koehler Date: Wed, 25 Sep 2024 11:59:25 +0200 Subject: [PATCH] wip vue-vuetify: extract entries to separate files --- packages/vue-vuetify/README.md | 3 +- .../src/additional/LabelRenderer.entry.ts | 11 +++++ .../src/additional/LabelRenderer.vue | 12 +---- .../ListWithDetailRenderer.entry.ts | 13 ++++++ .../src/additional/ListWithDetailRenderer.vue | 5 --- packages/vue-vuetify/src/additional/index.ts | 4 +- .../src/complex/AllOfRenderer.entry.ts | 11 +++++ .../vue-vuetify/src/complex/AllOfRenderer.vue | 8 ---- .../src/complex/AnyOfRenderer.entry.ts | 11 +++++ .../vue-vuetify/src/complex/AnyOfRenderer.vue | 8 ---- .../src/complex/ArrayControlRenderer.entry.ts | 13 ++++++ .../src/complex/ArrayControlRenderer.vue | 10 ----- .../src/complex/EnumArrayRenderer.entry.ts | 42 ++++++++++++++++++ .../src/complex/EnumArrayRenderer.vue | 44 +------------------ .../src/complex/ObjectRenderer.entry.ts | 11 +++++ .../src/complex/ObjectRenderer.vue | 5 --- .../src/complex/OneOfRenderer.entry.ts | 11 +++++ .../vue-vuetify/src/complex/OneOfRenderer.vue | 8 ---- .../src/complex/OneOfTabRenderer.entry.ts | 13 ++++++ .../src/complex/OneOfTabRenderer.vue | 10 ----- packages/vue-vuetify/src/complex/index.ts | 14 +++--- .../controls/SliderControlRenderer.tester.ts | 11 +++++ .../src/controls/SliderControlRenderer.vue | 12 +---- .../controls/StringControlRenderer.tester.ts | 10 +++++ .../src/controls/StringControlRenderer.vue | 12 +---- packages/vue-vuetify/src/controls/index.ts | 4 +- .../AutocompleteEnumControlRenderer.entry.ts | 11 +++++ .../AutocompleteEnumControlRenderer.vue | 12 +---- ...ocompleteOneOfEnumControlRenderer.entry.ts | 11 +++++ .../AutocompleteOneOfEnumControlRenderer.vue | 12 +---- packages/vue-vuetify/src/extended/index.ts | 4 +- .../src/layouts/ArrayLayoutRenderer.entry.ts | 11 +++++ .../src/layouts/ArrayLayoutRenderer.vue | 8 ---- .../layouts/CategorizationRenderer.entry.ts | 13 ++++++ .../src/layouts/CategorizationRenderer.vue | 5 --- .../CategorizationStepperRenderer.entry.ts | 21 +++++++++ .../layouts/CategorizationStepperRenderer.vue | 22 +--------- .../src/layouts/GroupRenderer.entry.ts | 13 ++++++ .../vue-vuetify/src/layouts/GroupRenderer.vue | 14 +----- .../layouts/HorizontalLayoutRenderer.entry.ts | 11 +++++ .../src/layouts/HorizontalLayoutRenderer.vue | 12 +---- .../layouts/VerticalLayoutRenderer.entry.ts | 11 +++++ .../src/layouts/VerticalLayoutRenderer.vue | 12 +---- packages/vue-vuetify/src/layouts/index.ts | 12 ++--- .../unit/additional/LabelRenderer.spec.ts | 5 +-- .../additional/ListWithDetailRenderer.spec.ts | 5 +-- .../unit/complex/ArrayControlRenderer.spec.ts | 5 +-- .../tests/unit/complex/OneOfRenderer.spec.ts | 5 +-- .../controls/StringControlRenderer.spec.ts | 5 +-- .../unit/layout/ArrayLayoutRenderer.spec.ts | 5 +-- 50 files changed, 301 insertions(+), 260 deletions(-) create mode 100644 packages/vue-vuetify/src/additional/LabelRenderer.entry.ts create mode 100644 packages/vue-vuetify/src/additional/ListWithDetailRenderer.entry.ts create mode 100644 packages/vue-vuetify/src/complex/AllOfRenderer.entry.ts create mode 100644 packages/vue-vuetify/src/complex/AnyOfRenderer.entry.ts create mode 100644 packages/vue-vuetify/src/complex/ArrayControlRenderer.entry.ts create mode 100644 packages/vue-vuetify/src/complex/EnumArrayRenderer.entry.ts create mode 100644 packages/vue-vuetify/src/complex/ObjectRenderer.entry.ts create mode 100644 packages/vue-vuetify/src/complex/OneOfRenderer.entry.ts create mode 100644 packages/vue-vuetify/src/complex/OneOfTabRenderer.entry.ts create mode 100644 packages/vue-vuetify/src/controls/SliderControlRenderer.tester.ts create mode 100644 packages/vue-vuetify/src/controls/StringControlRenderer.tester.ts create mode 100644 packages/vue-vuetify/src/extended/AutocompleteEnumControlRenderer.entry.ts create mode 100644 packages/vue-vuetify/src/extended/AutocompleteOneOfEnumControlRenderer.entry.ts create mode 100644 packages/vue-vuetify/src/layouts/ArrayLayoutRenderer.entry.ts create mode 100644 packages/vue-vuetify/src/layouts/CategorizationRenderer.entry.ts create mode 100644 packages/vue-vuetify/src/layouts/CategorizationStepperRenderer.entry.ts create mode 100644 packages/vue-vuetify/src/layouts/GroupRenderer.entry.ts create mode 100644 packages/vue-vuetify/src/layouts/HorizontalLayoutRenderer.entry.ts create mode 100644 packages/vue-vuetify/src/layouts/VerticalLayoutRenderer.entry.ts diff --git a/packages/vue-vuetify/README.md b/packages/vue-vuetify/README.md index 3fd325204..0a714a053 100644 --- a/packages/vue-vuetify/README.md +++ b/packages/vue-vuetify/README.md @@ -36,10 +36,9 @@ Use the `json-forms` component for each form you want to render and hand over th ```vue diff --git a/packages/vue-vuetify/src/additional/ListWithDetailRenderer.entry.ts b/packages/vue-vuetify/src/additional/ListWithDetailRenderer.entry.ts new file mode 100644 index 000000000..8d2fb6111 --- /dev/null +++ b/packages/vue-vuetify/src/additional/ListWithDetailRenderer.entry.ts @@ -0,0 +1,13 @@ +import { + and, + isObjectArray, + rankWith, + uiTypeIs, + type JsonFormsRendererRegistryEntry, +} from '@jsonforms/core'; +import controlRenderer from './ListWithDetailRenderer.vue'; + +export const entry: JsonFormsRendererRegistryEntry = { + renderer: controlRenderer, + tester: rankWith(4, and(uiTypeIs('ListWithDetail'), isObjectArray)), +}; diff --git a/packages/vue-vuetify/src/additional/ListWithDetailRenderer.vue b/packages/vue-vuetify/src/additional/ListWithDetailRenderer.vue index 4fb649661..7d77ae9ee 100644 --- a/packages/vue-vuetify/src/additional/ListWithDetailRenderer.vue +++ b/packages/vue-vuetify/src/additional/ListWithDetailRenderer.vue @@ -318,11 +318,6 @@ const controlRenderer = defineComponent({ }); export default controlRenderer; - -export const entry: JsonFormsRendererRegistryEntry = { - renderer: controlRenderer, - tester: rankWith(4, and(uiTypeIs('ListWithDetail'), isObjectArray)), -};