Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sub-PR: expression fields schema #1097

Merged
merged 4 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/form-js-playground/test/spec/form.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"$schema": "../../../form-json-schema/resources/schema.json",
"components": [
{
"type": "expression",
"key": "expressionResult",
"expression": "= 3 + 4",
"computeOn": "change"
},
{
"type": "text",
"text": "# Invoice\nLorem _ipsum_ __dolor__ `sit`.\n \n \nA list of BPMN symbols:\n* Start Event\n* Task\nLearn more about [forms](https://bpmn.io).\n \n \nThis [malicious link](javascript:throw onerror=alert,'some string',123,'haha') __should not work__.",
Expand Down
2 changes: 1 addition & 1 deletion packages/form-js-viewer/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export * from './render';
export * from './util';
export * from './features';

const schemaVersion = 15;
const schemaVersion = 16;

export {
Form,
Expand Down
2 changes: 1 addition & 1 deletion packages/form-js/test/spec/Form.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ describe('viewer exports', function() {
it('should expose schemaVersion', function() {
expect(typeof schemaVersion).to.eql('number');

expect(schemaVersion).to.eql(15);
expect(schemaVersion).to.eql(16);
});


Expand Down
340 changes: 174 additions & 166 deletions packages/form-json-schema/src/defs/examples/components.json
Original file line number Diff line number Diff line change
@@ -1,167 +1,175 @@
{
"examples": [
[
{
"text": "Create a text",
"type": "text"
}
],
[
{
"content": "<h1>HTML</h1>",
"type": "html"
}
],
[
{
"label": "Create a text field",
"type": "textfield",
"key": "textfield"
}
],
[
{
"label": "Create a number field",
"type": "number",
"key": "number"
}
],
[
{
"label": "Create a check box",
"type": "checkbox",
"key": "checkbox"
}
],
[
{
"label": "Create a check list",
"values": [
{
"label": "Option 1",
"value": "option_1"
},
{
"label": "Option 2",
"value": "option_2"
}
],
"type": "checklist",
"key": "checklist"
}
],
[
{
"label": "Create a tag list",
"values": [
{
"label": "Option 1",
"value": "option_1"
},
{
"label": "Option 2",
"value": "option_2"
}
],
"type": "taglist",
"key": "taglist"
}
],
[
{
"label": "Create a radio button",
"values": [
{
"label": "Option 1",
"value": "option_1"
},
{
"label": "Option 2",
"value": "option_2"
}
],
"type": "radio",
"key": "radio"
}
],
[
{
"label": "Create a select",
"values": [
{
"label": "Option 1",
"value": "option_1"
},
{
"label": "Option 2",
"value": "option_2"
}
],
"type": "select",
"key": "select"
}
],
[
{
"alt": "Create an image",
"type": "image"
}
],
[
{
"label": "Create a text area",
"type": "textarea",
"key": "textarea"
}
],
[
{
"dateLabel": "Create a date time picker",
"subtype": "date",
"type": "datetime",
"key": "date"
}
],
[
{
"type": "spacer",
"height": 60
}
],
[
{
"label": "Create a button",
"type": "button",
"action": "submit"
}
],
[
{
"label": "Create a group",
"type": "group",
"components": []
}
],
[
{
"label": "Create a dynamic list",
"type": "dymamiclist",
"components": []
}
],
[
{
"label": "Create an iframe",
"type": "iframe",
"url": "https://bpmn.io"
}
],
[
{
"label": "Create a dynamic table",
"type": "table",
"rowCount": 10
}
]
]
{
"examples": [
[
{
"text": "Create a text",
"type": "text"
}
],
[
{
"type": "expression",
"expression": "=1 + 1",
"computeOn": "change",
"key": "expression"
}
],
[
{
"content": "<h1>HTML</h1>",
"type": "html"
}
],
[
{
"label": "Create a text field",
"type": "textfield",
"key": "textfield"
}
],
[
{
"label": "Create a number field",
"type": "number",
"key": "number"
}
],
[
{
"label": "Create a check box",
"type": "checkbox",
"key": "checkbox"
}
],
[
{
"label": "Create a check list",
"values": [
{
"label": "Option 1",
"value": "option_1"
},
{
"label": "Option 2",
"value": "option_2"
}
],
"type": "checklist",
"key": "checklist"
}
],
[
{
"label": "Create a tag list",
"values": [
{
"label": "Option 1",
"value": "option_1"
},
{
"label": "Option 2",
"value": "option_2"
}
],
"type": "taglist",
"key": "taglist"
}
],
[
{
"label": "Create a radio button",
"values": [
{
"label": "Option 1",
"value": "option_1"
},
{
"label": "Option 2",
"value": "option_2"
}
],
"type": "radio",
"key": "radio"
}
],
[
{
"label": "Create a select",
"values": [
{
"label": "Option 1",
"value": "option_1"
},
{
"label": "Option 2",
"value": "option_2"
}
],
"type": "select",
"key": "select"
}
],
[
{
"alt": "Create an image",
"type": "image"
}
],
[
{
"label": "Create a text area",
"type": "textarea",
"key": "textarea"
}
],
[
{
"dateLabel": "Create a date time picker",
"subtype": "date",
"type": "datetime",
"key": "date"
}
],
[
{
"type": "spacer",
"height": 60
}
],
[
{
"label": "Create a button",
"type": "button",
"action": "submit"
}
],
[
{
"label": "Create a group",
"type": "group",
"components": []
}
],
[
{
"label": "Create a dynamic list",
"type": "dymamiclist",
"components": []
}
],
[
{
"label": "Create an iframe",
"type": "iframe",
"url": "https://bpmn.io"
}
],
[
{
"label": "Create a dynamic table",
"type": "table",
"rowCount": 10
}
]
]
}
Loading
Loading