meta: folding, foreignKey
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Sebastian Frank 2023-03-18 09:48:26 +00:00
parent b51fe632de
commit 922cf2ff2e
Signed by: apairon
GPG Key ID: 9A9F8F10A937E426
3 changed files with 179 additions and 0 deletions

View File

@ -132,6 +132,10 @@
"properties": {
"label": {
"$ref": "definitions.json#/definitions/i18nString"
},
"renderValue": {
"description": "render value based on entry ($ variable)",
"$ref": "definitions.json#/definitions/evalObjectWithRaw"
}
}
}

View File

@ -11,6 +11,20 @@
}
},
"evalObjectWithRaw": {
"type": "object",
"properties": {
"eval": {
"type": "string",
"description": "js code which must return same schema as value if directly defined"
},
"raw": {
"type": "boolean",
"description": "if true, the result of the eval passed as pure html"
}
}
},
"i18nString": {
"oneOf": [
{

View File

@ -189,6 +189,57 @@
}
]
},
{
"$ref": "#/definitions/minimum",
"patternProperties": {
"^x-.*|widget|foreign$": { "$comment": "stub for allOf" }
},
"allOf": [
{
"properties": {
"widget": {
"enum": ["foreignKey"]
},
"foreign": {
"additionalProperties": false,
"description": "foreign key configuration",
"type": "object",
"properties": {
"collection": {
"type": "string",
"description": "collection name"
},
"id": {
"type": "string",
"description": "id field name"
},
"projection": {
"type": "string",
"description": "projection name used for fetching initial foreign entries from database"
},
"sort": {
"type": "string",
"description": "sort field name (-field for descending)"
},
"subNavigation": {
"type": "number",
"description": "sub navigation index in foreign collection"
},
"render": {
"description": "field name or eval object which returns string",
"oneOf": [
{ "type": "string" },
{
"$ref": "definitions.json#/definitions/evalObjectWithRaw"
}
]
}
}
}
}
}
]
},
{
"$ref": "#/definitions/minimum",
"patternProperties": {
@ -291,10 +342,103 @@
"$ref": "definitions.json#/definitions/i18nString",
"description": "label for field"
},
"addElementLabel": {
"$ref": "definitions.json#/definitions/i18nString",
"description": "label for adding element to list"
},
"helperText": {
"$ref": "definitions.json#/definitions/i18nString",
"description": "helper text for field"
},
"filter": {
"type": "object",
"description": "filter configuration for list view of this field",
"additionalProperties": false,
"properties": {
"type": {
"type": "string",
"description": "filter type",
"enum": [
"default",
"select",
"bool",
"boolean",
"input",
"number",
"foreignKey"
]
}
}
},
"folding": {
"type": "object",
"description": "folding configuration for array fields",
"additionalProperties": false,
"properties": {
"previewUnfolded": {
"description": "preview for unfolded array element",
"oneOf": [
{ "type": "string" },
{
"$ref": "definitions.json#/definitions/evalObjectWithRaw"
}
]
},
"previewFolded": {
"description": "preview for folded array element",
"oneOf": [
{ "type": "string" },
{
"$ref": "definitions.json#/definitions/evalObjectWithRaw"
}
]
}
}
},
"css": {
"description": "css styles for field widgets",
"type": "object",
"properties": {
"input": {
"type": "object",
"description": "css styles for input widget",
"additionalProperties": false,
"properties": {
"wrapper": {
"description": "css styles for input widget wrapper",
"$ref": "#/definitions/css"
},
"element": {
"description": "css styles for input widget sub elements",
"$ref": "#/definitions/css"
},
"foreignEntry": {
"description": "css styles for input widget linked foreign entries",
"$ref": "#/definitions/css"
}
}
},
"view": {
"type": "object",
"description": "css styles for input widget",
"additionalProperties": false,
"properties": {
"wrapper": {
"description": "css styles for view widget wrapper",
"$ref": "#/definitions/css"
},
"element": {
"description": "css styles for view widget sub elements",
"$ref": "#/definitions/css"
},
"foreignEntry": {
"description": "css styles for input widget linked foreign entries",
"$ref": "#/definitions/css"
}
}
}
}
},
"dependsOn": {
"description": "depends on rule",
"oneOf": [
@ -378,6 +522,23 @@
"$ref": "definitions.json#/definitions/evalObject"
}
]
},
"css": {
"anyOf": [
{ "type": "string" },
{
"$ref": "https://raw.githubusercontent.com/rcorp/css-schema/master/schema.json"
},
{
"type": "object",
"properties": {
"eval": {
"type": "string",
"description": "javascript code evaled to string or css object"
}
}
}
]
}
}
}