diff --git a/f/examples/rational_app.app/app.yaml b/f/examples/rational_app.app/app.yaml new file mode 100644 index 0000000..5712de6 --- /dev/null +++ b/f/examples/rational_app.app/app.yaml @@ -0,0 +1,460 @@ +summary: '' +value: + fullscreen: false + grid: + - '12': + fixed: false + fullHeight: false + h: 1 + w: 12 + x: 0 + y: 0 + '3': + fixed: false + fullHeight: false + h: 2 + w: 6 + x: 0 + y: 0 + id: a + data: + id: a + type: containercomponent + actions: [] + configuration: {} + customCss: + container: + class: '!p-0' + style: '' + numberOfSubgrids: 1 + - '12': + fixed: false + fullHeight: false + h: 2 + w: 8 + x: 0 + y: 1 + '3': + fixed: false + fullHeight: false + h: 8 + w: 3 + x: 0 + y: 2 + id: d + data: + id: d + type: schemaformcomponent + actions: [] + componentInput: + type: static + value: + order: + - gmail + properties: + gmail: + type: object + default: {} + format: resource-gmail + required: [] + fieldType: schema + configuration: + defaultValues: + type: static + value: {} + displayType: + type: static + value: false + dynamicEnums: + type: static + value: {} + largeGap: + type: static + value: false + customCss: + description: + class: '' + style: '' + container: + class: '' + style: '' + label: + class: '' + style: '' + - '12': + fixed: false + fullHeight: false + h: 12 + w: 12 + x: 0 + y: 3 + '3': + fixed: false + fullHeight: false + h: 10 + w: 3 + x: 0 + y: 10 + id: e + data: + id: e + type: aggridcomponent + actions: + - id: e_a + type: buttoncomponent + actions: [] + componentInput: + type: runnable + fields: {} + fieldType: any + configuration: + afterIcon: + type: static + value: '' + beforeIcon: + type: static + value: '' + color: + type: static + value: blue + confirmationModal: + type: oneOf + configuration: + confirmationModal: + description: + type: static + value: Are you sure? + confirmationText: + type: static + value: Confirm + title: + type: static + value: Title + none: {} + selected: none + disabled: + type: static + value: false + fillContainer: + type: static + value: false + label: + type: static + value: Press me + onError: + type: oneOf + configuration: + close: + id: + type: static + value: '' + errorOverlay: {} + gotoUrl: + newTab: + type: static + value: true + url: + type: static + value: '' + open: + id: + type: static + value: '' + sendErrorToast: + appendError: + type: static + value: true + message: + type: static + value: An error occured + setTab: + setTab: + type: static + value: [] + selected: errorOverlay + onSuccess: + type: oneOf + configuration: + clearFiles: + id: + type: static + value: '' + close: + id: + type: static + value: '' + closeModal: + modalId: + type: static + value: '' + gotoUrl: + newTab: + type: static + value: true + url: + type: static + value: '' + none: {} + open: + id: + type: static + value: '' + openModal: + modalId: + type: static + value: '' + sendToast: + message: + type: static + value: Do something + setTab: + setTab: + type: static + value: [] + selected: sendToast + size: + type: static + value: xs + triggerOnAppLoad: + type: static + value: false + customCss: + button: + class: '' + style: '' + container: + class: '' + style: '' + horizontalAlignment: center + recomputeIds: [] + verticalAlignment: center + componentInput: + type: runnable + value: + - id: 1 + name: A cell with a long name + age: 42 + - id: 2 + name: A briefer cell + age: 84 + autoRefresh: true + fields: + x: + type: evalv2 + value: null + allowUserResources: true + connections: + - id: values + componentId: d + expr: d.values.gmail + fieldType: object + format: resource-gmail + fieldType: array + recomputeOnInputChanged: true + runnable: + type: runnableByName + name: Inline Script 0 + inlineScript: + content: '!inline inline_script_0.inline_script.ts' + lock: '!inline inline_script_0.inline_script.lock' + language: bun + path: f/examples/rational_app/Inline_Script_0 + schema: + $schema: 'https://json-schema.org/draft/2020-12/schema' + type: object + properties: + x: + type: object + description: '' + default: null + format: resource-gmail + required: + - x + subFieldType: object + configuration: + allEditable: + type: static + value: false + columnDefs: + type: static + value: + - field: id + flex: 1 + - editable: true + field: name + flex: 1 + - field: age + flex: 1 + compactness: + type: static + value: normal + customActionsHeader: + type: static + extraConfig: + type: static + value: {} + flex: + type: static + value: true + footer: + type: static + value: true + multipleSelectable: + type: static + value: false + pagination: + type: static + value: false + rowMultiselectWithClick: + type: static + value: true + selectFirstRowByDefault: + type: static + value: true + wrapActions: + type: static + value: false + customCss: + container: + class: '' + style: '' + - '12': + fixed: false + fullHeight: false + h: 5 + w: 11 + x: 0 + y: 15 + '3': + fixed: false + fullHeight: false + h: 8 + w: 2 + x: 0 + y: 20 + id: f + data: + id: f + type: displaycomponent + actions: [] + componentInput: + type: evalv2 + value: + foo: 42 + connections: + - id: values + componentId: d + expr: d.values + fieldType: object + configuration: + hideDetails: + type: static + value: false + title: + type: static + value: Result + customCss: + container: + class: '' + style: '' + header: + class: '' + style: '' + hiddenInlineScripts: [] + hideLegacyTopBar: true + norefreshbar: false + subgrids: + a-0: + - '12': + fixed: false + fullHeight: false + h: 1 + w: 6 + x: 0 + y: 0 + '3': + fixed: false + fullHeight: false + h: 1 + w: 6 + x: 0 + y: 0 + id: b + data: + id: b + type: textcomponent + actions: [] + componentInput: + type: templatev2 + connections: + - id: summary + componentId: ctx + eval: '${ctx.summary}' + fieldType: template + configuration: + copyButton: + type: static + value: false + disableNoText: + type: static + value: true + fieldType: boolean + style: + type: static + value: Body + tooltip: + type: evalv2 + value: '' + connections: + - id: author + componentId: ctx + expr: '`Author: ${ctx.author}`' + fieldType: text + customCss: + container: + class: '' + style: '' + text: + class: text-xl font-semibold whitespace-nowrap truncate + style: '' + horizontalAlignment: left + verticalAlignment: center + - '12': + fixed: false + fullHeight: false + h: 1 + w: 6 + x: 6 + y: 0 + '3': + fixed: false + fullHeight: false + h: 1 + w: 3 + x: 0 + y: 1 + id: c + data: + id: c + type: recomputeallcomponent + actions: [] + configuration: {} + customCss: + container: + class: '' + style: '' + horizontalAlignment: right + menuItems: [] + verticalAlignment: center + theme: + type: path + path: f/app_themes/theme_0 + unusedInlineScripts: [] +policy: + execution_mode: publisher + triggerables_v2: + 'e:rawscript/094997a84ee8d057b046eb321df55cb1eec1427e95849872a8aeac616fc69ee2': + allow_user_resources: + - x + one_of_inputs: {} + static_inputs: {} diff --git a/f/examples/rational_app.app/inline_script_0.inline_script.lock b/f/examples/rational_app.app/inline_script_0.inline_script.lock new file mode 100644 index 0000000..789f01c --- /dev/null +++ b/f/examples/rational_app.app/inline_script_0.inline_script.lock @@ -0,0 +1,5 @@ +{ + "dependencies": {} +} +//bun.lockb + \ No newline at end of file diff --git a/f/examples/rational_app.app/inline_script_0.inline_script.ts b/f/examples/rational_app.app/inline_script_0.inline_script.ts new file mode 100644 index 0000000..46166e0 --- /dev/null +++ b/f/examples/rational_app.app/inline_script_0.inline_script.ts @@ -0,0 +1,18 @@ +type gmail = {} +export async function main(x: gmail) { + if (Object.keys(x ?? {}).length == 0) { + return [] + } + return [ + { + "id": 1, + "name": "A cell with a long name", + "age": 42 + }, + { + "id": 2, + "name": "A briefer cell", + "age": 84 + } + ] +} \ No newline at end of file