@lowdefy/docs 4.0.0-alpha.7 → 4.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/operators/client/filter_default_value.js +55 -0
- package/{public/modules/connectDocsearch.js → dist/operatorsClient.js} +1 -19
- package/{templates/blocks/schemaTransformer.js → dist/types.js} +5 -10
- package/package.json +19 -3
- package/404.yaml +0 -26
- package/CHANGELOG.md +0 -697
- package/actions/CallMethod.yaml +0 -57
- package/actions/JsAction.yaml +0 -281
- package/actions/Link.yaml +0 -120
- package/actions/Login.yaml +0 -123
- package/actions/Logout.yaml +0 -44
- package/actions/Message.yaml +0 -68
- package/actions/Notification.yaml +0 -84
- package/actions/Request.yaml +0 -70
- package/actions/Reset.yaml +0 -42
- package/actions/ResetValidation.yaml +0 -102
- package/actions/ScrollTo.yaml +0 -100
- package/actions/SetGlobal.yaml +0 -78
- package/actions/SetState.yaml +0 -85
- package/actions/Throw.yaml +0 -89
- package/actions/Validate.yaml +0 -104
- package/actions/Wait.yaml +0 -40
- package/blocks/all_icons.yaml +0 -803
- package/blocks/container/Affix.yaml +0 -26
- package/blocks/container/Alert.yaml +0 -27
- package/blocks/container/Badge.yaml +0 -27
- package/blocks/container/Box.yaml +0 -27
- package/blocks/container/Card.yaml +0 -29
- package/blocks/container/Collapse.yaml +0 -38
- package/blocks/container/Comment.yaml +0 -43
- package/blocks/container/ConfirmModal.yaml +0 -36
- package/blocks/container/Descriptions.yaml +0 -51
- package/blocks/container/Drawer.yaml +0 -46
- package/blocks/container/Label.yaml +0 -28
- package/blocks/container/Modal.yaml +0 -46
- package/blocks/container/PageHCF.yaml +0 -28
- package/blocks/container/PageHCSF.yaml +0 -29
- package/blocks/container/PageHSCF.yaml +0 -29
- package/blocks/container/PageHeaderMenu.yaml +0 -52
- package/blocks/container/PageSHCF.yaml +0 -29
- package/blocks/container/PageSiderMenu.yaml +0 -53
- package/blocks/container/Result.yaml +0 -34
- package/blocks/container/Span.yaml +0 -27
- package/blocks/container/Spin.yaml +0 -27
- package/blocks/container/Tabs.yaml +0 -41
- package/blocks/container/Tooltip.yaml +0 -38
- package/blocks/display/Anchor.yaml +0 -25
- package/blocks/display/Avatar.yaml +0 -23
- package/blocks/display/Breadcrumb.yaml +0 -28
- package/blocks/display/Button.yaml +0 -43
- package/blocks/display/DangerousHtml.yaml +0 -62
- package/blocks/display/DangerousMarkdown.yaml +0 -46
- package/blocks/display/Divider.yaml +0 -23
- package/blocks/display/EChart.yaml +0 -53
- package/blocks/display/Html.yaml +0 -50
- package/blocks/display/Icon.yaml +0 -23
- package/blocks/display/Img.yaml +0 -40
- package/blocks/display/Markdown.yaml +0 -31
- package/blocks/display/MarkdownWithCode.yaml +0 -46
- package/blocks/display/Menu.yaml +0 -48
- package/blocks/display/Message.yaml +0 -34
- package/blocks/display/MobileMenu.yaml +0 -47
- package/blocks/display/Notification.yaml +0 -34
- package/blocks/display/Paragraph.yaml +0 -30
- package/blocks/display/Progress.yaml +0 -52
- package/blocks/display/Skeleton.yaml +0 -27
- package/blocks/display/Statistic.yaml +0 -35
- package/blocks/display/Title.yaml +0 -32
- package/blocks/input/AutoComplete.yaml +0 -30
- package/blocks/input/ButtonSelector.yaml +0 -36
- package/blocks/input/CheckboxSelector.yaml +0 -36
- package/blocks/input/CheckboxSwitch.yaml +0 -56
- package/blocks/input/ChromeColorSelector.yaml +0 -24
- package/blocks/input/CircleColorSelector.yaml +0 -24
- package/blocks/input/ColorSelector.yaml +0 -24
- package/blocks/input/CompactColorSelector.yaml +0 -24
- package/blocks/input/DateRangeSelector.yaml +0 -26
- package/blocks/input/DateSelector.yaml +0 -26
- package/blocks/input/DateTimeSelector.yaml +0 -28
- package/blocks/input/GithubColorSelector.yaml +0 -24
- package/blocks/input/MonthSelector.yaml +0 -26
- package/blocks/input/MultipleSelector.yaml +0 -117
- package/blocks/input/NumberInput.yaml +0 -24
- package/blocks/input/Pagination.yaml +0 -33
- package/blocks/input/ParagraphInput.yaml +0 -32
- package/blocks/input/PasswordInput.yaml +0 -48
- package/blocks/input/RadioSelector.yaml +0 -36
- package/blocks/input/RatingSlider.yaml +0 -24
- package/blocks/input/S3UploadButton.yaml +0 -28
- package/blocks/input/Selector.yaml +0 -98
- package/blocks/input/SliderColorSelector.yaml +0 -24
- package/blocks/input/SwatchesColorSelector.yaml +0 -24
- package/blocks/input/Switch.yaml +0 -24
- package/blocks/input/TextArea.yaml +0 -27
- package/blocks/input/TextInput.yaml +0 -59
- package/blocks/input/TitleInput.yaml +0 -32
- package/blocks/input/TwitterColorSelector.yaml +0 -24
- package/blocks/input/WeekSelector.yaml +0 -26
- package/blocks/list/ControlledList.yaml +0 -191
- package/blocks/list/List.yaml +0 -157
- package/blocks/list/TimelineList.yaml +0 -136
- package/body.html +0 -1
- package/concepts/blocks.yaml +0 -249
- package/concepts/cli.yaml +0 -173
- package/concepts/connections-and-requests.yaml +0 -114
- package/concepts/context-and-state.yaml +0 -82
- package/concepts/custom-blocks.yaml +0 -190
- package/concepts/custom-code.yaml +0 -197
- package/concepts/events-and-actions.yaml +0 -224
- package/concepts/hosting-files.yaml +0 -50
- package/concepts/layout.yaml +0 -1464
- package/concepts/lists.yaml +0 -162
- package/concepts/lowdefy-schema.yaml +0 -245
- package/concepts/operators.yaml +0 -66
- package/concepts/overview.yaml +0 -48
- package/concepts/secrets.yaml +0 -56
- package/connections/AWSS3.yaml +0 -228
- package/connections/AmazonRedshift.yaml +0 -75
- package/connections/AxiosHttp.yaml +0 -194
- package/connections/Elasticsearch.yaml +0 -378
- package/connections/GoogleSheet.yaml +0 -332
- package/connections/Knex.yaml +0 -181
- package/connections/KnexRequests.md +0 -121
- package/connections/MSSQL.yaml +0 -90
- package/connections/MariaDB.yaml +0 -77
- package/connections/MongoDB.yaml +0 -581
- package/connections/MySQL.yaml +0 -92
- package/connections/OracleDB.yaml +0 -73
- package/connections/PostgreSQL.yaml +0 -99
- package/connections/Redis.yaml +0 -147
- package/connections/SQLite.yaml +0 -94
- package/connections/SendGridMail.yaml +0 -113
- package/connections/Stripe.yaml +0 -139
- package/deployment/aws-lambda.yaml +0 -128
- package/deployment/docker.yaml +0 -118
- package/deployment/netlify.yaml +0 -69
- package/deployment/node-server.yaml +0 -111
- package/head.html +0 -7
- package/howto/generate-csv.yaml.njk +0 -252
- package/howto/generate-pdf.yaml.njk +0 -651
- package/howto/generateCsv/lowdefy.yaml +0 -64
- package/howto/generateCsv/public/csvMake.js +0 -27
- package/howto/generatePdf/inv_template.yaml +0 -200
- package/howto/generatePdf/lowdefy.yaml +0 -117
- package/howto/generatePdf/my_header.html +0 -1
- package/howto/generatePdf/public/logo_example.png +0 -0
- package/howto/generatePdf/public/modules/importUmd.js +0 -7
- package/howto/generatePdf/public/modules/pdfMake.js +0 -7
- package/howto/generatePdf/public/modules/vfs_fonts.js +0 -12
- package/howto/use-refrences.md +0 -5
- package/introduction.yaml +0 -100
- package/lowdefy.yaml +0 -66
- package/menus.yaml +0 -832
- package/operators/_actions.yaml +0 -123
- package/operators/_and.yaml +0 -90
- package/operators/_args.yaml +0 -79
- package/operators/_array.yaml +0 -326
- package/operators/_base64.yaml +0 -56
- package/operators/_change_case.yaml +0 -347
- package/operators/_date.yaml +0 -71
- package/operators/_diff.yaml +0 -75
- package/operators/_divide.yaml +0 -46
- package/operators/_eq.yaml +0 -67
- package/operators/_event.yaml +0 -103
- package/operators/_format.yaml +0 -209
- package/operators/_function.yaml +0 -66
- package/operators/_get.yaml +0 -108
- package/operators/_global.yaml +0 -107
- package/operators/_gt.yaml +0 -65
- package/operators/_gte.yaml +0 -65
- package/operators/_hash.yaml +0 -109
- package/operators/_if.yaml +0 -44
- package/operators/_if_none.yaml +0 -61
- package/operators/_index.yaml +0 -65
- package/operators/_input.yaml +0 -114
- package/operators/_js.yaml +0 -189
- package/operators/_json.yaml +0 -128
- package/operators/_list_contexts.yaml +0 -37
- package/operators/_location.yaml +0 -59
- package/operators/_log.yaml +0 -36
- package/operators/_lt.yaml +0 -65
- package/operators/_lte.yaml +0 -65
- package/operators/_math.yaml +0 -374
- package/operators/_media.yaml +0 -86
- package/operators/_menu.yaml +0 -81
- package/operators/_mql.yaml +0 -101
- package/operators/_ne.yaml +0 -77
- package/operators/_not.yaml +0 -47
- package/operators/_number.yaml +0 -157
- package/operators/_nunjucks.yaml +0 -73
- package/operators/_object.yaml +0 -193
- package/operators/_operator.yaml +0 -47
- package/operators/_or.yaml +0 -81
- package/operators/_product.yaml +0 -59
- package/operators/_random.yaml +0 -104
- package/operators/_ref.yaml +0 -266
- package/operators/_regex.yaml +0 -83
- package/operators/_request.yaml +0 -50
- package/operators/_secret.yaml +0 -74
- package/operators/_state.yaml +0 -114
- package/operators/_string.yaml +0 -283
- package/operators/_subtract.yaml +0 -38
- package/operators/_sum.yaml +0 -59
- package/operators/_switch.yaml +0 -51
- package/operators/_type.yaml +0 -92
- package/operators/_uri.yaml +0 -56
- package/operators/_url_query.yaml +0 -120
- package/operators/_user.yaml +0 -107
- package/operators/_uuid.yaml +0 -114
- package/operators/_var.yaml +0 -105
- package/operators/_yaml.yaml +0 -107
- package/pages.yaml +0 -227
- package/public/images/authors/gervwyk.jpeg +0 -0
- package/public/images/authors/sandile.jpeg +0 -0
- package/public/images/howto/header_generate_csv.jpg +0 -0
- package/public/images/howto/header_generate_pdf.jpg +0 -0
- package/public/logo_example.png +0 -0
- package/public/lowdefy_app_schema.png +0 -0
- package/public/modules/csvMake.js +0 -27
- package/public/modules/filterDefaultValue.js +0 -48
- package/public/modules/importUmd.js +0 -7
- package/public/modules/index.js +0 -5
- package/public/modules/pdfMake.js +0 -7
- package/public/modules/test/filterDefaultValue.test.js +0 -91
- package/public/modules/vfs_fonts.js +0 -12
- package/public/sitemap.xml +0 -1024
- package/templates/actions.yaml.njk +0 -68
- package/templates/blocks/defaultValueTransformer.js +0 -53
- package/templates/blocks/exampleTransformer.js +0 -81
- package/templates/blocks/layout.yaml +0 -114
- package/templates/blocks/propertiesFormTransformer.js +0 -419
- package/templates/blocks/propertiesGetterTransformer.js +0 -132
- package/templates/blocks/schema.yaml.njk +0 -42
- package/templates/blocks/style.yaml +0 -26
- package/templates/blocks/template.yaml.njk +0 -495
- package/templates/blog.yaml.njk +0 -221
- package/templates/cli_command.yaml.njk +0 -37
- package/templates/footer.yaml.njk +0 -604
- package/templates/general.yaml.njk +0 -124
- package/templates/generateSitemap.js +0 -41
- package/templates/header.yaml +0 -138
- package/templates/navigation_buttons.yaml +0 -68
- package/templates/operators.yaml.njk +0 -82
- package/templates/operatorsMethodTransformer.js +0 -119
- package/templates/test/array.test.js +0 -1335
- package/templates/test/boolean.test.js +0 -98
- package/templates/test/button.test.js +0 -166
- package/templates/test/color.test.js +0 -126
- package/templates/test/enum.test.js +0 -105
- package/templates/test/icon.test.js +0 -109
- package/templates/test/integer.test.js +0 -99
- package/templates/test/manual.test.js +0 -238
- package/templates/test/number.test.js +0 -99
- package/templates/test/object.test.js +0 -434
- package/templates/test/oneOf.test.js +0 -794
- package/templates/test/string.test.js +0 -98
- package/templates/test/yaml.test.js +0 -605
- package/tutorial/next-steps.yaml +0 -83
- package/tutorial/tutorial-actions-operators-config.yaml +0 -142
- package/tutorial/tutorial-actions-operators.yaml +0 -436
- package/tutorial/tutorial-add-blocks-config.yaml +0 -109
- package/tutorial/tutorial-add-blocks.yaml +0 -195
- package/tutorial/tutorial-create-page-config.yaml +0 -77
- package/tutorial/tutorial-create-page.yaml +0 -196
- package/tutorial/tutorial-deploy.yaml +0 -146
- package/tutorial/tutorial-requests-config.yaml +0 -186
- package/tutorial/tutorial-requests.yaml +0 -338
- package/tutorial/tutorial-start.yaml +0 -282
- package/users/login-and-logout.yaml +0 -164
- package/users/openid-connect.yaml +0 -84
- package/users/protected-pages.yaml +0 -67
- package/users/roles.yaml +0 -70
- package/users/user-object.yaml +0 -73
- package/users/users-introduction.yaml +0 -80
- package/version.yaml +0 -1
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2021 Lowdefy, Inc
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import propertiesFormTransformer from '../blocks/propertiesFormTransformer';
|
|
18
|
-
import propertiesGetterTransformer from '../blocks/propertiesGetterTransformer';
|
|
19
|
-
import defaultValueTransformer from '../blocks/defaultValueTransformer';
|
|
20
|
-
|
|
21
|
-
const schema = {
|
|
22
|
-
properties: {
|
|
23
|
-
type: 'object',
|
|
24
|
-
additionalProperties: false,
|
|
25
|
-
properties: {
|
|
26
|
-
bool: {
|
|
27
|
-
type: 'boolean',
|
|
28
|
-
description: 'description.',
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
test('boolean propertiesFormTransformer', () => {
|
|
35
|
-
expect(propertiesFormTransformer(schema)).toMatchInlineSnapshot(`
|
|
36
|
-
Array [
|
|
37
|
-
Object {
|
|
38
|
-
"id": "block.properties.bool",
|
|
39
|
-
"layout": Object {
|
|
40
|
-
"_global": "settings_input_layout",
|
|
41
|
-
},
|
|
42
|
-
"properties": Object {
|
|
43
|
-
"label": Object {
|
|
44
|
-
"align": "right",
|
|
45
|
-
"extra": "description.",
|
|
46
|
-
"span": 8,
|
|
47
|
-
},
|
|
48
|
-
"size": "small",
|
|
49
|
-
"title": "bool",
|
|
50
|
-
},
|
|
51
|
-
"required": false,
|
|
52
|
-
"type": "Switch",
|
|
53
|
-
},
|
|
54
|
-
]
|
|
55
|
-
`);
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
test('boolean propertiesGetterTransformer', () => {
|
|
59
|
-
expect(propertiesGetterTransformer(schema, { block_type: 'Block' })).toMatchInlineSnapshot(`
|
|
60
|
-
Object {
|
|
61
|
-
"_object.assign": Array [
|
|
62
|
-
Object {
|
|
63
|
-
"_state": Object {
|
|
64
|
-
"contextId": "Block:Block:{}",
|
|
65
|
-
"default": Object {},
|
|
66
|
-
"key": "block.properties",
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
}
|
|
71
|
-
`);
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
test('boolean defaultValueTransformer', () => {
|
|
75
|
-
expect(defaultValueTransformer(schema)).toMatchInlineSnapshot(`
|
|
76
|
-
Object {
|
|
77
|
-
"bool": false,
|
|
78
|
-
}
|
|
79
|
-
`);
|
|
80
|
-
const schemaDV = {
|
|
81
|
-
properties: {
|
|
82
|
-
type: 'object',
|
|
83
|
-
additionalProperties: false,
|
|
84
|
-
properties: {
|
|
85
|
-
bool: {
|
|
86
|
-
type: 'boolean',
|
|
87
|
-
default: true,
|
|
88
|
-
description: 'description.',
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
expect(defaultValueTransformer(schemaDV)).toMatchInlineSnapshot(`
|
|
94
|
-
Object {
|
|
95
|
-
"bool": true,
|
|
96
|
-
}
|
|
97
|
-
`);
|
|
98
|
-
});
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2021 Lowdefy, Inc
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import propertiesFormTransformer from '../blocks/propertiesFormTransformer';
|
|
18
|
-
import propertiesGetterTransformer from '../blocks/propertiesGetterTransformer';
|
|
19
|
-
import defaultValueTransformer from '../blocks/defaultValueTransformer';
|
|
20
|
-
|
|
21
|
-
const schema = {
|
|
22
|
-
properties: {
|
|
23
|
-
type: 'object',
|
|
24
|
-
additionalProperties: false,
|
|
25
|
-
properties: {
|
|
26
|
-
field: {
|
|
27
|
-
type: 'object',
|
|
28
|
-
description: 'description',
|
|
29
|
-
docs: {
|
|
30
|
-
displayType: 'button',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
test('button propertiesFormTransformer', () => {
|
|
38
|
-
expect(propertiesFormTransformer(schema)).toMatchInlineSnapshot(`
|
|
39
|
-
Array [
|
|
40
|
-
Object {
|
|
41
|
-
"blocks": Array [
|
|
42
|
-
Object {
|
|
43
|
-
"id": "block.properties.field.icon",
|
|
44
|
-
"layout": Object {
|
|
45
|
-
"_global": "settings_input_layout",
|
|
46
|
-
},
|
|
47
|
-
"properties": Object {
|
|
48
|
-
"allowClear": true,
|
|
49
|
-
"label": Object {
|
|
50
|
-
"align": "right",
|
|
51
|
-
"extra": "Name of an Ant Design Icon or properties of an Icon block to use icon in button.",
|
|
52
|
-
"span": 8,
|
|
53
|
-
},
|
|
54
|
-
"options": Object {
|
|
55
|
-
"_global": "all_icons",
|
|
56
|
-
},
|
|
57
|
-
"showSearch": true,
|
|
58
|
-
"size": "small",
|
|
59
|
-
"title": "icon",
|
|
60
|
-
},
|
|
61
|
-
"type": "Selector",
|
|
62
|
-
},
|
|
63
|
-
Object {
|
|
64
|
-
"id": "block.properties.field.title",
|
|
65
|
-
"layout": Object {
|
|
66
|
-
"_global": "settings_input_layout",
|
|
67
|
-
},
|
|
68
|
-
"properties": Object {
|
|
69
|
-
"label": Object {
|
|
70
|
-
"align": "right",
|
|
71
|
-
"extra": "Title text on the button.",
|
|
72
|
-
"span": 8,
|
|
73
|
-
},
|
|
74
|
-
"size": "small",
|
|
75
|
-
"title": "title",
|
|
76
|
-
},
|
|
77
|
-
"type": "TextInput",
|
|
78
|
-
},
|
|
79
|
-
Object {
|
|
80
|
-
"id": "block.properties.field.type",
|
|
81
|
-
"layout": Object {
|
|
82
|
-
"_global": "settings_input_layout",
|
|
83
|
-
},
|
|
84
|
-
"properties": Object {
|
|
85
|
-
"label": Object {
|
|
86
|
-
"align": "right",
|
|
87
|
-
"extra": "The button type.",
|
|
88
|
-
"span": 8,
|
|
89
|
-
},
|
|
90
|
-
"options": Array [
|
|
91
|
-
"primary",
|
|
92
|
-
"default",
|
|
93
|
-
"dashed",
|
|
94
|
-
"danger",
|
|
95
|
-
"link",
|
|
96
|
-
"text",
|
|
97
|
-
],
|
|
98
|
-
"size": "small",
|
|
99
|
-
"title": "type",
|
|
100
|
-
},
|
|
101
|
-
"type": "ButtonSelector",
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
"id": "block.properties.field_button_card",
|
|
105
|
-
"layout": Object {
|
|
106
|
-
"contentGutter": 0,
|
|
107
|
-
},
|
|
108
|
-
"properties": Object {
|
|
109
|
-
"inner": true,
|
|
110
|
-
"size": "small",
|
|
111
|
-
"title": "button:",
|
|
112
|
-
},
|
|
113
|
-
"type": "Card",
|
|
114
|
-
},
|
|
115
|
-
]
|
|
116
|
-
`);
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
test('button propertiesGetterTransformer', () => {
|
|
120
|
-
expect(propertiesGetterTransformer(schema, { block_type: 'Block' })).toMatchInlineSnapshot(`
|
|
121
|
-
Object {
|
|
122
|
-
"_object.assign": Array [
|
|
123
|
-
Object {
|
|
124
|
-
"_state": Object {
|
|
125
|
-
"contextId": "Block:Block:{}",
|
|
126
|
-
"default": Object {},
|
|
127
|
-
"key": "block.properties",
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
],
|
|
131
|
-
}
|
|
132
|
-
`);
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
test('button defaultValueTransformer', () => {
|
|
136
|
-
expect(defaultValueTransformer(schema)).toMatchInlineSnapshot(`Object {}`);
|
|
137
|
-
const schemaDV = {
|
|
138
|
-
properties: {
|
|
139
|
-
type: 'object',
|
|
140
|
-
additionalProperties: false,
|
|
141
|
-
properties: {
|
|
142
|
-
field: {
|
|
143
|
-
type: 'object',
|
|
144
|
-
description: 'description',
|
|
145
|
-
docs: {
|
|
146
|
-
displayType: 'button',
|
|
147
|
-
},
|
|
148
|
-
default: {
|
|
149
|
-
icon: 'UploadOutlined',
|
|
150
|
-
title: 'Upload',
|
|
151
|
-
type: 'default',
|
|
152
|
-
},
|
|
153
|
-
},
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
};
|
|
157
|
-
expect(defaultValueTransformer(schemaDV)).toMatchInlineSnapshot(`
|
|
158
|
-
Object {
|
|
159
|
-
"field": Object {
|
|
160
|
-
"icon": "UploadOutlined",
|
|
161
|
-
"title": "Upload",
|
|
162
|
-
"type": "default",
|
|
163
|
-
},
|
|
164
|
-
}
|
|
165
|
-
`);
|
|
166
|
-
});
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2021 Lowdefy, Inc
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import propertiesFormTransformer from '../blocks/propertiesFormTransformer';
|
|
18
|
-
import propertiesGetterTransformer from '../blocks/propertiesGetterTransformer';
|
|
19
|
-
import defaultValueTransformer from '../blocks/defaultValueTransformer';
|
|
20
|
-
|
|
21
|
-
const schema = {
|
|
22
|
-
properties: {
|
|
23
|
-
type: 'object',
|
|
24
|
-
additionalProperties: false,
|
|
25
|
-
properties: {
|
|
26
|
-
field: {
|
|
27
|
-
type: 'string',
|
|
28
|
-
description: 'description',
|
|
29
|
-
docs: {
|
|
30
|
-
displayType: 'color',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
test.todo(
|
|
38
|
-
'color propertiesFormTransformer' /*() => {
|
|
39
|
-
expect(propertiesFormTransformer(schema)).toMatchInlineSnapshot(`
|
|
40
|
-
Array [
|
|
41
|
-
Object {
|
|
42
|
-
"id": "block.properties.field",
|
|
43
|
-
"layout": Object {
|
|
44
|
-
"_global": "settings_input_layout",
|
|
45
|
-
},
|
|
46
|
-
"properties": Object {
|
|
47
|
-
"circleSize": 14,
|
|
48
|
-
"circleSpacing": 8,
|
|
49
|
-
"colors": Array [
|
|
50
|
-
"#f5222d",
|
|
51
|
-
"#fa541c",
|
|
52
|
-
"#fa8c16",
|
|
53
|
-
"#faad14",
|
|
54
|
-
"#fadb14",
|
|
55
|
-
"#a0d911",
|
|
56
|
-
"#52c41a",
|
|
57
|
-
"#13c2c2",
|
|
58
|
-
"#1890ff",
|
|
59
|
-
"#2f54eb",
|
|
60
|
-
"#722ed1",
|
|
61
|
-
"#eb2f96",
|
|
62
|
-
"#595959",
|
|
63
|
-
"#bfbfbf",
|
|
64
|
-
"#d9d9d9",
|
|
65
|
-
],
|
|
66
|
-
"label": Object {
|
|
67
|
-
"align": "right",
|
|
68
|
-
"extra": "description",
|
|
69
|
-
"span": 8,
|
|
70
|
-
},
|
|
71
|
-
"showValue": true,
|
|
72
|
-
"size": "small",
|
|
73
|
-
"title": "field",
|
|
74
|
-
},
|
|
75
|
-
"required": false,
|
|
76
|
-
"type": "CircleColorSelector",
|
|
77
|
-
},
|
|
78
|
-
]
|
|
79
|
-
`);
|
|
80
|
-
}*/
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
test('color propertiesGetterTransformer', () => {
|
|
84
|
-
expect(propertiesGetterTransformer(schema, { block_type: 'Block' })).toMatchInlineSnapshot(`
|
|
85
|
-
Object {
|
|
86
|
-
"_object.assign": Array [
|
|
87
|
-
Object {
|
|
88
|
-
"_state": Object {
|
|
89
|
-
"contextId": "Block:Block:{}",
|
|
90
|
-
"default": Object {},
|
|
91
|
-
"key": "block.properties",
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
],
|
|
95
|
-
}
|
|
96
|
-
`);
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
test('color defaultValueTransformer', () => {
|
|
100
|
-
expect(defaultValueTransformer(schema)).toMatchInlineSnapshot(`
|
|
101
|
-
Object {
|
|
102
|
-
"field": null,
|
|
103
|
-
}
|
|
104
|
-
`);
|
|
105
|
-
const schemaDV = {
|
|
106
|
-
properties: {
|
|
107
|
-
type: 'object',
|
|
108
|
-
additionalProperties: false,
|
|
109
|
-
properties: {
|
|
110
|
-
field: {
|
|
111
|
-
type: 'string',
|
|
112
|
-
default: 'value',
|
|
113
|
-
description: 'description',
|
|
114
|
-
docs: {
|
|
115
|
-
displayType: 'color',
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
};
|
|
121
|
-
expect(defaultValueTransformer(schemaDV)).toMatchInlineSnapshot(`
|
|
122
|
-
Object {
|
|
123
|
-
"field": "value",
|
|
124
|
-
}
|
|
125
|
-
`);
|
|
126
|
-
});
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2021 Lowdefy, Inc
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import propertiesFormTransformer from '../blocks/propertiesFormTransformer';
|
|
18
|
-
import propertiesGetterTransformer from '../blocks/propertiesGetterTransformer';
|
|
19
|
-
import defaultValueTransformer from '../blocks/defaultValueTransformer';
|
|
20
|
-
|
|
21
|
-
const schema = {
|
|
22
|
-
properties: {
|
|
23
|
-
type: 'object',
|
|
24
|
-
additionalProperties: false,
|
|
25
|
-
properties: {
|
|
26
|
-
enum: {
|
|
27
|
-
type: 'string',
|
|
28
|
-
enum: ['a', 'b', 'c'],
|
|
29
|
-
description: 'description.',
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
test('enum propertiesFormTransformer', () => {
|
|
36
|
-
expect(propertiesFormTransformer(schema)).toMatchInlineSnapshot(`
|
|
37
|
-
Array [
|
|
38
|
-
Object {
|
|
39
|
-
"id": "block.properties.enum",
|
|
40
|
-
"layout": Object {
|
|
41
|
-
"_global": "settings_input_layout",
|
|
42
|
-
},
|
|
43
|
-
"properties": Object {
|
|
44
|
-
"label": Object {
|
|
45
|
-
"align": "right",
|
|
46
|
-
"extra": "description.",
|
|
47
|
-
"span": 8,
|
|
48
|
-
},
|
|
49
|
-
"options": Array [
|
|
50
|
-
"a",
|
|
51
|
-
"b",
|
|
52
|
-
"c",
|
|
53
|
-
],
|
|
54
|
-
"size": "small",
|
|
55
|
-
"title": "enum",
|
|
56
|
-
},
|
|
57
|
-
"required": false,
|
|
58
|
-
"type": "ButtonSelector",
|
|
59
|
-
},
|
|
60
|
-
]
|
|
61
|
-
`);
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
test('enum propertiesGetterTransformer', () => {
|
|
65
|
-
expect(propertiesGetterTransformer(schema, { block_type: 'Block' })).toMatchInlineSnapshot(`
|
|
66
|
-
Object {
|
|
67
|
-
"_object.assign": Array [
|
|
68
|
-
Object {
|
|
69
|
-
"_state": Object {
|
|
70
|
-
"contextId": "Block:Block:{}",
|
|
71
|
-
"default": Object {},
|
|
72
|
-
"key": "block.properties",
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
],
|
|
76
|
-
}
|
|
77
|
-
`);
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
test('enum defaultValueTransformer', () => {
|
|
81
|
-
expect(defaultValueTransformer(schema)).toMatchInlineSnapshot(`
|
|
82
|
-
Object {
|
|
83
|
-
"enum": null,
|
|
84
|
-
}
|
|
85
|
-
`);
|
|
86
|
-
const schemaDV = {
|
|
87
|
-
properties: {
|
|
88
|
-
type: 'object',
|
|
89
|
-
additionalProperties: false,
|
|
90
|
-
properties: {
|
|
91
|
-
enum: {
|
|
92
|
-
type: 'string',
|
|
93
|
-
enum: ['a', 'b', 'c'],
|
|
94
|
-
default: 'a',
|
|
95
|
-
description: 'description.',
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
};
|
|
100
|
-
expect(defaultValueTransformer(schemaDV)).toMatchInlineSnapshot(`
|
|
101
|
-
Object {
|
|
102
|
-
"enum": "a",
|
|
103
|
-
}
|
|
104
|
-
`);
|
|
105
|
-
});
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2021 Lowdefy, Inc
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import propertiesFormTransformer from '../blocks/propertiesFormTransformer';
|
|
18
|
-
import propertiesGetterTransformer from '../blocks/propertiesGetterTransformer';
|
|
19
|
-
import defaultValueTransformer from '../blocks/defaultValueTransformer';
|
|
20
|
-
|
|
21
|
-
const schema = {
|
|
22
|
-
properties: {
|
|
23
|
-
type: 'object',
|
|
24
|
-
additionalProperties: false,
|
|
25
|
-
properties: {
|
|
26
|
-
field: {
|
|
27
|
-
type: ['string', 'object'],
|
|
28
|
-
description: 'description',
|
|
29
|
-
docs: {
|
|
30
|
-
displayType: 'icon',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
test('icon propertiesFormTransformer', () => {
|
|
38
|
-
expect(propertiesFormTransformer(schema)).toMatchInlineSnapshot(`
|
|
39
|
-
Array [
|
|
40
|
-
Object {
|
|
41
|
-
"id": "block.properties.field",
|
|
42
|
-
"layout": Object {
|
|
43
|
-
"_global": "settings_input_layout",
|
|
44
|
-
},
|
|
45
|
-
"properties": Object {
|
|
46
|
-
"allowClear": true,
|
|
47
|
-
"label": Object {
|
|
48
|
-
"align": "right",
|
|
49
|
-
"extra": "description",
|
|
50
|
-
"span": 8,
|
|
51
|
-
},
|
|
52
|
-
"options": Object {
|
|
53
|
-
"_global": "all_icons",
|
|
54
|
-
},
|
|
55
|
-
"showSearch": true,
|
|
56
|
-
"size": "small",
|
|
57
|
-
"title": "field",
|
|
58
|
-
},
|
|
59
|
-
"required": false,
|
|
60
|
-
"type": "Selector",
|
|
61
|
-
},
|
|
62
|
-
]
|
|
63
|
-
`);
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
test('icon propertiesGetterTransformer', () => {
|
|
67
|
-
expect(propertiesGetterTransformer(schema, { block_type: 'Block' })).toMatchInlineSnapshot(`
|
|
68
|
-
Object {
|
|
69
|
-
"_object.assign": Array [
|
|
70
|
-
Object {
|
|
71
|
-
"_state": Object {
|
|
72
|
-
"contextId": "Block:Block:{}",
|
|
73
|
-
"default": Object {},
|
|
74
|
-
"key": "block.properties",
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
],
|
|
78
|
-
}
|
|
79
|
-
`);
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
test('icon defaultValueTransformer', () => {
|
|
83
|
-
expect(defaultValueTransformer(schema)).toMatchInlineSnapshot(`
|
|
84
|
-
Object {
|
|
85
|
-
"field": null,
|
|
86
|
-
}
|
|
87
|
-
`);
|
|
88
|
-
const schemaDV = {
|
|
89
|
-
properties: {
|
|
90
|
-
type: 'object',
|
|
91
|
-
additionalProperties: false,
|
|
92
|
-
properties: {
|
|
93
|
-
field: {
|
|
94
|
-
type: ['string', 'object'],
|
|
95
|
-
default: 'value',
|
|
96
|
-
description: 'description',
|
|
97
|
-
docs: {
|
|
98
|
-
displayType: 'icon',
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
expect(defaultValueTransformer(schemaDV)).toMatchInlineSnapshot(`
|
|
105
|
-
Object {
|
|
106
|
-
"field": "value",
|
|
107
|
-
}
|
|
108
|
-
`);
|
|
109
|
-
});
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2021 Lowdefy, Inc
|
|
3
|
-
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
you may not use this file except in compliance with the License.
|
|
6
|
-
You may obtain a copy of the License at
|
|
7
|
-
|
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
|
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
See the License for the specific language governing permissions and
|
|
14
|
-
limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import propertiesFormTransformer from '../blocks/propertiesFormTransformer';
|
|
18
|
-
import propertiesGetterTransformer from '../blocks/propertiesGetterTransformer';
|
|
19
|
-
import defaultValueTransformer from '../blocks/defaultValueTransformer';
|
|
20
|
-
|
|
21
|
-
const schema = {
|
|
22
|
-
properties: {
|
|
23
|
-
type: 'object',
|
|
24
|
-
additionalProperties: false,
|
|
25
|
-
properties: {
|
|
26
|
-
num: {
|
|
27
|
-
type: 'integer',
|
|
28
|
-
description: 'description.',
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
test('integer propertiesFormTransformer', () => {
|
|
35
|
-
expect(propertiesFormTransformer(schema)).toMatchInlineSnapshot(`
|
|
36
|
-
Array [
|
|
37
|
-
Object {
|
|
38
|
-
"id": "block.properties.num",
|
|
39
|
-
"layout": Object {
|
|
40
|
-
"_global": "settings_input_layout",
|
|
41
|
-
},
|
|
42
|
-
"properties": Object {
|
|
43
|
-
"label": Object {
|
|
44
|
-
"align": "right",
|
|
45
|
-
"extra": "description.",
|
|
46
|
-
"span": 8,
|
|
47
|
-
},
|
|
48
|
-
"size": "small",
|
|
49
|
-
"step": 1,
|
|
50
|
-
"title": "num",
|
|
51
|
-
},
|
|
52
|
-
"required": false,
|
|
53
|
-
"type": "NumberInput",
|
|
54
|
-
},
|
|
55
|
-
]
|
|
56
|
-
`);
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
test('integer propertiesGetterTransformer', () => {
|
|
60
|
-
expect(propertiesGetterTransformer(schema, { block_type: 'Block' })).toMatchInlineSnapshot(`
|
|
61
|
-
Object {
|
|
62
|
-
"_object.assign": Array [
|
|
63
|
-
Object {
|
|
64
|
-
"_state": Object {
|
|
65
|
-
"contextId": "Block:Block:{}",
|
|
66
|
-
"default": Object {},
|
|
67
|
-
"key": "block.properties",
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
}
|
|
72
|
-
`);
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
test('integer defaultValueTransformer', () => {
|
|
76
|
-
expect(defaultValueTransformer(schema)).toMatchInlineSnapshot(`
|
|
77
|
-
Object {
|
|
78
|
-
"num": null,
|
|
79
|
-
}
|
|
80
|
-
`);
|
|
81
|
-
const schemaDV = {
|
|
82
|
-
properties: {
|
|
83
|
-
type: 'object',
|
|
84
|
-
additionalProperties: false,
|
|
85
|
-
properties: {
|
|
86
|
-
num: {
|
|
87
|
-
type: 'integer',
|
|
88
|
-
default: 1,
|
|
89
|
-
description: 'description.',
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
};
|
|
94
|
-
expect(defaultValueTransformer(schemaDV)).toMatchInlineSnapshot(`
|
|
95
|
-
Object {
|
|
96
|
-
"num": 1,
|
|
97
|
-
}
|
|
98
|
-
`);
|
|
99
|
-
});
|