-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip vue-vuetify: extract entries to separate files
- Loading branch information
1 parent
8c4b2f0
commit 9f64549
Showing
50 changed files
with
301 additions
and
260 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
11 changes: 11 additions & 0 deletions
11
packages/vue-vuetify/src/additional/LabelRenderer.entry.ts
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,11 @@ | ||
import { | ||
rankWith, | ||
uiTypeIs, | ||
type JsonFormsRendererRegistryEntry, | ||
} from '@jsonforms/core'; | ||
import labelRenderer from './LabelRenderer.vue'; | ||
|
||
export const entry: JsonFormsRendererRegistryEntry = { | ||
renderer: labelRenderer, | ||
tester: rankWith(1, uiTypeIs('Label')), | ||
}; |
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
13 changes: 13 additions & 0 deletions
13
packages/vue-vuetify/src/additional/ListWithDetailRenderer.entry.ts
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,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)), | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { | ||
isAllOfControl, | ||
rankWith, | ||
type JsonFormsRendererRegistryEntry, | ||
} from '@jsonforms/core'; | ||
import controlRenderer from './AllOfRenderer.vue'; | ||
|
||
export const entry: JsonFormsRendererRegistryEntry = { | ||
renderer: controlRenderer, | ||
tester: rankWith(3, isAllOfControl), | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { | ||
isAnyOfControl, | ||
rankWith, | ||
type JsonFormsRendererRegistryEntry, | ||
} from '@jsonforms/core'; | ||
import controlRenderer from './AnyOfRenderer.vue'; | ||
|
||
export const entry: JsonFormsRendererRegistryEntry = { | ||
renderer: controlRenderer, | ||
tester: rankWith(3, isAnyOfControl), | ||
}; |
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
13 changes: 13 additions & 0 deletions
13
packages/vue-vuetify/src/complex/ArrayControlRenderer.entry.ts
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,13 @@ | ||
import { | ||
isObjectArrayControl, | ||
isPrimitiveArrayControl, | ||
or, | ||
rankWith, | ||
type JsonFormsRendererRegistryEntry, | ||
} from '@jsonforms/core'; | ||
import controlRenderer from './ArrayControlRenderer.vue'; | ||
|
||
export const entry: JsonFormsRendererRegistryEntry = { | ||
renderer: controlRenderer, | ||
tester: rankWith(3, or(isObjectArrayControl, isPrimitiveArrayControl)), | ||
}; |
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
42 changes: 42 additions & 0 deletions
42
packages/vue-vuetify/src/complex/EnumArrayRenderer.entry.ts
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,42 @@ | ||
import { | ||
and, | ||
hasType, | ||
rankWith, | ||
schemaMatches, | ||
schemaSubPathMatches, | ||
uiTypeIs, | ||
type JsonFormsRendererRegistryEntry, | ||
type JsonSchema, | ||
} from '@jsonforms/core'; | ||
import controlRenderer from './EnumArrayRenderer.vue'; | ||
|
||
export const entry: JsonFormsRendererRegistryEntry = { | ||
renderer: controlRenderer, | ||
tester: rankWith( | ||
5, | ||
and( | ||
uiTypeIs('Control'), | ||
and( | ||
schemaMatches( | ||
(schema) => | ||
hasType(schema, 'array') && | ||
!Array.isArray(schema.items) && | ||
schema.uniqueItems === true, | ||
), | ||
schemaSubPathMatches('items', (schema) => { | ||
return hasOneOfItems(schema) || hasEnumItems(schema); | ||
}), | ||
), | ||
), | ||
), | ||
}; | ||
|
||
const hasOneOfItems = (schema: JsonSchema): boolean => | ||
schema.oneOf !== undefined && | ||
schema.oneOf.length > 0 && | ||
(schema.oneOf as JsonSchema[]).every((entry: JsonSchema) => { | ||
return entry.const !== undefined; | ||
}); | ||
|
||
const hasEnumItems = (schema: JsonSchema): boolean => | ||
schema.type === 'string' && schema.enum !== undefined; |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { | ||
isObjectControl, | ||
rankWith, | ||
type JsonFormsRendererRegistryEntry, | ||
} from '@jsonforms/core'; | ||
import controlRenderer from './ObjectRenderer.vue'; | ||
|
||
export const entry: JsonFormsRendererRegistryEntry = { | ||
renderer: controlRenderer, | ||
tester: rankWith(2, isObjectControl), | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { | ||
isOneOfControl, | ||
rankWith, | ||
type JsonFormsRendererRegistryEntry, | ||
} from '@jsonforms/core'; | ||
import controlRenderer from './OneOfRenderer.vue'; | ||
|
||
export const entry: JsonFormsRendererRegistryEntry = { | ||
renderer: controlRenderer, | ||
tester: rankWith(3, isOneOfControl), | ||
}; |
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
13 changes: 13 additions & 0 deletions
13
packages/vue-vuetify/src/complex/OneOfTabRenderer.entry.ts
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,13 @@ | ||
import { | ||
and, | ||
isOneOfControl, | ||
optionIs, | ||
rankWith, | ||
type JsonFormsRendererRegistryEntry, | ||
} from '@jsonforms/core'; | ||
import controlRenderer from './OneOfTabRenderer.vue'; | ||
|
||
export const entry: JsonFormsRendererRegistryEntry = { | ||
renderer: controlRenderer, | ||
tester: rankWith(4, and(isOneOfControl, optionIs('variant', 'tab'))), | ||
}; |
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
Oops, something went wrong.