Merge pull request #1173 from lowdefy/loading-blocks

Block loading and skeletons ☠️
This commit is contained in:
Gerrie van Wyk 2022-04-26 18:16:25 +02:00 committed by GitHub
commit 84a37c97b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
386 changed files with 359585 additions and 52033 deletions

View File

@ -22,7 +22,7 @@ jobs:
run: yarn build
# format tests don't pass on node 12 since icu is missing and tests don't work with locales
- name: Test packages
run: yarn test --ignore='@lowdefy/engine' --ignore='@lowdefy/format' --ignore='@lowdefy/blocks-*' --ignore='@lowdefy/plugin-aws'
run: yarn test-ci
- name: Upload coverage to codecov
run: bash <(curl -s https://codecov.io/bash)
- name: Upload coverage to codeclimate

View File

@ -19,7 +19,7 @@ jobs:
run: yarn build
- name: Test packages
run: yarn test --ignore='@lowdefy/engine' --ignore='@lowdefy/format' --ignore='@lowdefy/blocks-*' --ignore='@lowdefy/plugin-aws'
run: yarn test-ci
- name: Upload coverage to codecov
run: bash <(curl -s https://codecov.io/bash)

49
.pnp.cjs generated
View File

@ -1505,39 +1505,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"linkType": "HARD",
}]
]],
["@emotion/react", [
["npm:11.7.1", {
"packageLocation": "./.yarn/cache/@emotion-react-npm-11.7.1-29be6cd15f-3392aa71f9.zip/node_modules/@emotion/react/",
"packageDependencies": [
["@emotion/react", "npm:11.7.1"]
],
"linkType": "SOFT",
}],
["virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:11.7.1", {
"packageLocation": "./.yarn/__virtual__/@emotion-react-virtual-c0347ba1b1/0/cache/@emotion-react-npm-11.7.1-29be6cd15f-3392aa71f9.zip/node_modules/@emotion/react/",
"packageDependencies": [
["@emotion/react", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:11.7.1"],
["@babel/core", null],
["@babel/runtime", "npm:7.16.7"],
["@emotion/cache", "npm:11.7.1"],
["@emotion/serialize", "npm:1.0.2"],
["@emotion/sheet", "npm:1.1.0"],
["@emotion/utils", "npm:1.0.0"],
["@emotion/weak-memoize", "npm:0.2.5"],
["@types/babel__core", null],
["@types/react", null],
["hoist-non-react-statics", "npm:3.3.2"],
["react", "npm:17.0.2"]
],
"packagePeers": [
"@babel/core",
"@types/babel__core",
"@types/react",
"react"
],
"linkType": "HARD",
}]
]],
["@emotion/serialize", [
["npm:1.0.2", {
"packageLocation": "./.yarn/cache/@emotion-serialize-npm-1.0.2-a692afdb82-ff84fbe09e.zip/node_modules/@emotion/serialize/",
@ -2861,7 +2828,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["@ant-design/icons", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:4.7.0"],
["@emotion/css", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:11.7.1"],
["@emotion/jest", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:11.7.1"],
["@emotion/react", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:11.7.1"],
["@lowdefy/helpers", "workspace:packages/utils/helpers"],
["@swc/cli", "virtual:babee6e81435a5d101529cd67f2c6b175f4db37a4ab0b58df15adf73dd11be8917ac14caf44ab4e6882a92c61661055072365b349016e85173e049f006fc2305#npm:0.1.55"],
["@swc/core", "npm:1.2.135"],
@ -2870,6 +2836,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["@testing-library/react", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:13.0.0-alpha.4"],
["@testing-library/user-event", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:14.0.0-alpha.14"],
["classnames", "npm:2.3.1"],
["copyfiles", "npm:2.4.1"],
["dompurify", "npm:2.3.5"],
["jest", "virtual:babee6e81435a5d101529cd67f2c6b175f4db37a4ab0b58df15adf73dd11be8917ac14caf44ab4e6882a92c61661055072365b349016e85173e049f006fc2305#npm:27.5.1"],
["jest-serializer-html", "npm:7.1.0"],
@ -3524,8 +3491,12 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"packageLocation": "./packages/server/",
"packageDependencies": [
["@lowdefy/server", "workspace:packages/server"],
["@lowdefy/actions-core", "workspace:packages/plugins/actions/actions-core"],
["@lowdefy/api", "workspace:packages/api"],
["@lowdefy/block-utils", "workspace:packages/utils/block-utils"],
["@lowdefy/blocks-antd", "workspace:packages/plugins/blocks/blocks-antd"],
["@lowdefy/blocks-basic", "workspace:packages/plugins/blocks/blocks-basic"],
["@lowdefy/blocks-loaders", "workspace:packages/plugins/blocks/blocks-loaders"],
["@lowdefy/build", "workspace:packages/build"],
["@lowdefy/engine", "workspace:packages/engine"],
["@lowdefy/helpers", "workspace:packages/utils/helpers"],
@ -9638,16 +9609,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"linkType": "HARD",
}]
]],
["hoist-non-react-statics", [
["npm:3.3.2", {
"packageLocation": "./.yarn/cache/hoist-non-react-statics-npm-3.3.2-e7b709e6c1-b153827042.zip/node_modules/hoist-non-react-statics/",
"packageDependencies": [
["hoist-non-react-statics", "npm:3.3.2"],
["react-is", "npm:16.13.1"]
],
"linkType": "HARD",
}]
]],
["hosted-git-info", [
["npm:2.8.9", {
"packageLocation": "./.yarn/cache/hosted-git-info-npm-2.8.9-62c44fa93f-c955394bda.zip/node_modules/hosted-git-info/",

View File

@ -52,9 +52,10 @@
"start:server-dev:docs": "yarn workspace @lowdefy/server-dev start --package-manager yarn --config-directory ../docs",
"start:server:app": "yarn workspace @lowdefy/server build:lowdefy --config-directory ../../app && yarn && yarn workspace @lowdefy/server build:next && yarn workspace @lowdefy/server start",
"start:server:docs": "yarn workspace @lowdefy/server build:lowdefy --config-directory ../docs && yarn && yarn workspace @lowdefy/server build:next && yarn workspace @lowdefy/server start",
"start:server:next-dev:app": "yarn workspace @lowdefy/server build:lowdefy --config-directory ../../app && yarn && yarn workspace @lowdefy/server dev",
"start:server:next-dev:docs": "yarn workspace @lowdefy/server build:lowdefy --config-directory ../docs && yarn && yarn workspace @lowdefy/server dev",
"test": "lerna run test"
"start:server:next-dev:app": "yarn start:cli:build:app && yarn && yarn workspace @lowdefy/server dev",
"start:server:next-dev:docs": "yarn start:cli:build:docs && yarn && yarn workspace @lowdefy/server dev",
"test": "lerna run test",
"test-ci": "yarn test --ignore='@lowdefy/engine' --ignore='@lowdefy/format' --ignore='@lowdefy/blocks-*' --ignore='@lowdefy/plugin-aws'"
},
"devDependencies": {
"@yarnpkg/pnpify": "3.1.1-rc.13",

View File

@ -37,7 +37,7 @@ async function callRequest(context, { pageId, payload, requestId }) {
const connection = getConnection(context, { connectionConfig });
const requestResolver = getRequestResolver(context, { connection, requestConfig });
const { connectionProperties, requestProperties } = await evaluateOperators(context, {
const { connectionProperties, requestProperties } = evaluateOperators(context, {
connectionConfig,
payload: serializer.deserialize(payload),
requestConfig,

View File

@ -18,7 +18,7 @@ import { NodeParser } from '@lowdefy/operators';
import { RequestError } from '../../context/errors.js';
async function evaluateOperators(
function evaluateOperators(
{ operators, secrets, user },
{ connectionConfig, payload, requestConfig }
) {
@ -28,7 +28,6 @@ async function evaluateOperators(
secrets,
user,
});
await operatorsParser.init();
const { output: connectionProperties, errors: connectionErrors } = operatorsParser.parse({
input: connectionConfig.properties || {},
location: connectionConfig.connectionId,

View File

@ -50,6 +50,8 @@
},
"dependencies": {
"@lowdefy/ajv": "4.0.0-alpha.8",
"@lowdefy/blocks-basic": "4.0.0-alpha.8",
"@lowdefy/blocks-loaders": "4.0.0-alpha.8",
"@lowdefy/helpers": "4.0.0-alpha.8",
"@lowdefy/node-utils": "4.0.0-alpha.8",
"@lowdefy/nunjucks": "4.0.0-alpha.8",
@ -65,10 +67,8 @@
"@jest/globals": "27.5.1",
"@lowdefy/actions-core": "4.0.0-alpha.8",
"@lowdefy/blocks-antd": "4.0.0-alpha.8",
"@lowdefy/blocks-basic": "4.0.0-alpha.8",
"@lowdefy/blocks-color-selectors": "4.0.0-alpha.8",
"@lowdefy/blocks-echarts": "4.0.0-alpha.8",
"@lowdefy/blocks-loaders": "4.0.0-alpha.8",
"@lowdefy/blocks-markdown": "4.0.0-alpha.8",
"@lowdefy/connection-axios-http": "4.0.0-alpha.8",
"@lowdefy/connection-elasticsearch": "4.0.0-alpha.8",

View File

@ -18,17 +18,21 @@ import buildEvents from './buildEvents.js';
import buildRequests from './buildRequests.js';
import buildSubBlocks from './buildSubBlocks.js';
import countBlockOperators from './countBlockOperators.js';
import countBlockTypes from './countBlockTypes.js';
import moveSubBlocksToArea from './moveSubBlocksToArea.js';
import moveSkeletonBlocksToArea from './moveSkeletonBlocksToArea.js';
import setBlockId from './setBlockId.js';
import validateBlock from './validateBlock.js';
async function buildBlock(block, pageContext) {
validateBlock(block, pageContext);
countBlockOperators(block, pageContext);
setBlockId(block, pageContext);
countBlockOperators(block, pageContext);
buildEvents(block, pageContext);
buildRequests(block, pageContext);
moveSubBlocksToArea(block, pageContext);
moveSkeletonBlocksToArea(block, pageContext);
countBlockTypes(block, pageContext);
await buildSubBlocks(block, pageContext);
}

View File

@ -18,8 +18,7 @@ import countOperators from '../../../utils/countOperators.js';
function countBlockOperators(block, { typeCounters }) {
// eslint-disable-next-line no-unused-vars
const { requests, blocks, areas, ...webBlock } = block;
const { requests, areas, blocks, ...webBlock } = block;
countOperators(webBlock, { counter: typeCounters.operators.client });
(requests || []).forEach((request) => {
countOperators(request.payload || {}, { counter: typeCounters.operators.client });

View File

@ -14,30 +14,8 @@
limitations under the License.
*/
.loading-bar {
animation: loading-bar-morph 0.5s linear alternate 0s infinite;
transform-origin: bottom;
function countBlockTypes(block, { typeCounters }) {
typeCounters.blocks.increment(block.type);
}
@keyframes loading-bar-morph {
0% {
transform: scaleY(0.6);
}
100% {
transform: scaleY(0.95) translateY(5%);
}
}
.loading-bar-sm {
animation: loading-bar-morph-sm 0.5s linear alternate 0s infinite;
transform-origin: bottom;
}
@keyframes loading-bar-morph-sm {
0% {
transform: scaleY(1.4) translateY(5%);
}
100% {
transform: scaleY(0.9);
}
}
export default countBlockTypes;

View File

@ -0,0 +1,44 @@
/*
Copyright 2020-2022 Lowdefy, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { set, type } from '@lowdefy/helpers';
function recMoveSkeletonBlocksToArea(block, blockId, pageId) {
if (!type.isNone(block.blocks)) {
if (!type.isArray(block.blocks)) {
throw new Error(
`Skeleton blocks at ${blockId} on page ${pageId} is not an array. Received ${JSON.stringify(
block.blocks
)}`
);
}
set(block, 'areas.content.blocks', block.blocks);
delete block.blocks;
}
Object.keys(block.areas || {}).forEach((area) => {
block.areas[area].blocks.forEach((block, i) => {
recMoveSkeletonBlocksToArea(block, `${blockId}.areas.${area}.${i}.blocks`, pageId);
});
});
}
function moveSkeletonBlocksToArea(block, pageContext) {
if (type.isObject(block.skeleton)) {
recMoveSkeletonBlocksToArea(block.skeleton, `${block.blockId}.skeleton`, pageContext.pageId);
}
}
export default moveSkeletonBlocksToArea;

View File

@ -16,7 +16,7 @@
import { type } from '@lowdefy/helpers';
function validateBlock(block, { pageId, typeCounters }) {
function validateBlock(block, { pageId }) {
if (!type.isObject(block)) {
throw new Error(
`Expected block to be an object on page "${pageId}". Received ${JSON.stringify(block)}.`
@ -40,7 +40,6 @@ function validateBlock(block, { pageId, typeCounters }) {
)}.`
);
}
typeCounters.blocks.increment(block.type);
if (!type.isNone(block.requests)) {
if (!type.isArray(block.requests)) {
throw new Error(

View File

@ -791,23 +791,27 @@ describe('block areas', () => {
});
});
test('user defined loading', async () => {
test('user defined skeleton', async () => {
const components = {
pages: [
{
id: 'page_1',
type: 'Container',
auth,
loading: {
custom: true,
},
skeleton: [
{
custom: true,
},
],
blocks: [
{
id: 'block_1',
type: 'Input',
loading: {
custom: true,
},
skeleton: [
{
custom: true,
},
],
},
],
},
@ -823,9 +827,11 @@ test('user defined loading', async () => {
pageId: 'page_1',
blockId: 'page_1',
type: 'Container',
loading: {
custom: true,
},
skeleton: [
{
custom: true,
},
],
requests: [],
areas: {
content: {
@ -834,9 +840,11 @@ test('user defined loading', async () => {
id: 'block:page_1:block_1:0',
blockId: 'block_1',
type: 'Input',
loading: {
custom: true,
},
skeleton: [
{
custom: true,
},
],
},
],
},

View File

@ -14,6 +14,9 @@
limitations under the License.
*/
import basicTypes from '@lowdefy/blocks-basic/types';
import loaderTypes from '@lowdefy/blocks-loaders/types';
function buildTypeClass(
context,
{ counter, definitions, store, typeClass, warnIfMissing = false }
@ -39,9 +42,13 @@ function buildTypeClass(
function buildTypes({ components, context }) {
const { typeCounters } = context;
// Add Mandatory Types
// Add operators used by form validation
typeCounters.operators.client.increment('_not');
typeCounters.operators.client.increment('_type');
// Add loaders and basic
basicTypes.blocks.forEach((block) => typeCounters.blocks.increment(block));
loaderTypes.blocks.forEach((block) => typeCounters.blocks.increment(block));
components.types = {
actions: {},

View File

@ -17,6 +17,7 @@
import { nunjucksFunction } from '@lowdefy/nunjucks';
const template = `@import '@lowdefy/layout/style.less';
@import '@lowdefy/block-utils/style.less';
{% for style in styles -%}
@import '{{ style }}';
{% endfor -%}

View File

@ -219,10 +219,10 @@ export default {
type: 'Block "layout" should be an object.',
},
},
loading: {
skeleton: {
type: 'object',
errorMessage: {
type: 'Block "loading" should be an object.',
type: 'Block "skeleton" should be an object.',
},
},
style: {
@ -232,6 +232,7 @@ export default {
},
},
visible: {},
loading: {},
blocks: {
type: 'array',
items: {

View File

@ -121,7 +121,7 @@ test('No version specified', async () => {
return `
pages:
- id: page1
type: Context
type: Box
`;
}
return null;

View File

@ -25,11 +25,11 @@ _ref:
(requestIds: string[]): void
```
description: |
The `Request` action calls a request, or if used during an `onInit` or `onEnter` events, calls those requests while a page loads.
The `Request` action calls a request, or if used during an `onInit` event, calls those requests while a page loads.
`Request` can be used to call all requests on a `context`, a list of requests, or a single request. The `Request` action is synchronous, actions defined after
it will only run once all the called requests have returned.
To call requests that load data, the `onInitAsync` and `onEnterAsync` events can be used. These will execute the actions while the page begins to render. If the `onInit` or `onEnter` events are used, the page will only start rendering after the actions have completed.
To call requests that load data, the `onInitAsync`, `onMount` and `onMountAsync` events can be used. These will execute the actions while the page begins to render. If the `onInit` event is used, the page will only start rendering after the actions have completed.
`Request` can be called without any parameters to call all requests in the `context`. It can also be called with a list of requestIds or a single requestId to call.

View File

@ -25,7 +25,7 @@ _ref:
description: |
The `Reset` actions resets a context to the state it was in just after the `onInit` event was executed. This clears the user's inputs.
> The `Reset` action resets the state to the state before the `onEnter` event is executed, and the `onEnter` event is not executed after the reset happens. This might cause unexpected behavior if you used an `onEnter` event to initialize the state.
> The `Reset` action resets the state to the state after the `onInit` event was executed, and the `onMount` events are not executed after the reset happens. This might cause unexpected behavior if you used an `onInitAsync`, `onMount` or `onMountAsync` event to initialize the state.
params: |
The `Reset` action does not take any parameters.
examples: |

View File

@ -12,795 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- { label: 'AccountBookFilled', value: 'AccountBookFilled' }
- { label: 'AccountBookOutlined', value: 'AccountBookOutlined' }
- { label: 'AccountBookTwoTone', value: 'AccountBookTwoTone' }
- { label: 'AimOutlined', value: 'AimOutlined' }
- { label: 'AlertFilled', value: 'AlertFilled' }
- { label: 'AlertOutlined', value: 'AlertOutlined' }
- { label: 'AlertTwoTone', value: 'AlertTwoTone' }
- { label: 'AlibabaOutlined', value: 'AlibabaOutlined' }
- { label: 'AlignCenterOutlined', value: 'AlignCenterOutlined' }
- { label: 'AlignLeftOutlined', value: 'AlignLeftOutlined' }
- { label: 'AlignRightOutlined', value: 'AlignRightOutlined' }
- { label: 'AlipayCircleFilled', value: 'AlipayCircleFilled' }
- { label: 'AlipayCircleOutlined', value: 'AlipayCircleOutlined' }
- { label: 'AlipayOutlined', value: 'AlipayOutlined' }
- { label: 'AlipaySquareFilled', value: 'AlipaySquareFilled' }
- { label: 'AliwangwangFilled', value: 'AliwangwangFilled' }
- { label: 'AliwangwangOutlined', value: 'AliwangwangOutlined' }
- { label: 'AliyunOutlined', value: 'AliyunOutlined' }
- { label: 'AmazonCircleFilled', value: 'AmazonCircleFilled' }
- { label: 'AmazonOutlined', value: 'AmazonOutlined' }
- { label: 'AmazonSquareFilled', value: 'AmazonSquareFilled' }
- { label: 'AndroidFilled', value: 'AndroidFilled' }
- { label: 'AndroidOutlined', value: 'AndroidOutlined' }
- { label: 'AntCloudOutlined', value: 'AntCloudOutlined' }
- { label: 'AntDesignOutlined', value: 'AntDesignOutlined' }
- { label: 'ApartmentOutlined', value: 'ApartmentOutlined' }
- { label: 'ApiFilled', value: 'ApiFilled' }
- { label: 'ApiOutlined', value: 'ApiOutlined' }
- { label: 'ApiTwoTone', value: 'ApiTwoTone' }
- { label: 'AppleFilled', value: 'AppleFilled' }
- { label: 'AppleOutlined', value: 'AppleOutlined' }
- { label: 'AppstoreAddOutlined', value: 'AppstoreAddOutlined' }
- { label: 'AppstoreFilled', value: 'AppstoreFilled' }
- { label: 'AppstoreOutlined', value: 'AppstoreOutlined' }
- { label: 'AppstoreTwoTone', value: 'AppstoreTwoTone' }
- { label: 'AreaChartOutlined', value: 'AreaChartOutlined' }
- { label: 'ArrowDownOutlined', value: 'ArrowDownOutlined' }
- { label: 'ArrowLeftOutlined', value: 'ArrowLeftOutlined' }
- { label: 'ArrowRightOutlined', value: 'ArrowRightOutlined' }
- { label: 'ArrowUpOutlined', value: 'ArrowUpOutlined' }
- { label: 'ArrowsAltOutlined', value: 'ArrowsAltOutlined' }
- { label: 'AudioFilled', value: 'AudioFilled' }
- { label: 'AudioMutedOutlined', value: 'AudioMutedOutlined' }
- { label: 'AudioOutlined', value: 'AudioOutlined' }
- { label: 'AudioTwoTone', value: 'AudioTwoTone' }
- { label: 'AuditOutlined', value: 'AuditOutlined' }
- { label: 'BackwardFilled', value: 'BackwardFilled' }
- { label: 'BackwardOutlined', value: 'BackwardOutlined' }
- { label: 'BankFilled', value: 'BankFilled' }
- { label: 'BankOutlined', value: 'BankOutlined' }
- { label: 'BankTwoTone', value: 'BankTwoTone' }
- { label: 'BarChartOutlined', value: 'BarChartOutlined' }
- { label: 'BarcodeOutlined', value: 'BarcodeOutlined' }
- { label: 'BarsOutlined', value: 'BarsOutlined' }
- { label: 'BehanceCircleFilled', value: 'BehanceCircleFilled' }
- { label: 'BehanceOutlined', value: 'BehanceOutlined' }
- { label: 'BehanceSquareFilled', value: 'BehanceSquareFilled' }
- { label: 'BehanceSquareOutlined', value: 'BehanceSquareOutlined' }
- { label: 'BellFilled', value: 'BellFilled' }
- { label: 'BellOutlined', value: 'BellOutlined' }
- { label: 'BellTwoTone', value: 'BellTwoTone' }
- { label: 'BgColorsOutlined', value: 'BgColorsOutlined' }
- { label: 'BlockOutlined', value: 'BlockOutlined' }
- { label: 'BoldOutlined', value: 'BoldOutlined' }
- { label: 'BookFilled', value: 'BookFilled' }
- { label: 'BookOutlined', value: 'BookOutlined' }
- { label: 'BookTwoTone', value: 'BookTwoTone' }
- { label: 'BorderBottomOutlined', value: 'BorderBottomOutlined' }
- { label: 'BorderHorizontalOutlined', value: 'BorderHorizontalOutlined' }
- { label: 'BorderInnerOutlined', value: 'BorderInnerOutlined' }
- { label: 'BorderLeftOutlined', value: 'BorderLeftOutlined' }
- { label: 'BorderOuterOutlined', value: 'BorderOuterOutlined' }
- { label: 'BorderOutlined', value: 'BorderOutlined' }
- { label: 'BorderRightOutlined', value: 'BorderRightOutlined' }
- { label: 'BorderTopOutlined', value: 'BorderTopOutlined' }
- { label: 'BorderVerticleOutlined', value: 'BorderVerticleOutlined' }
- { label: 'BorderlessTableOutlined', value: 'BorderlessTableOutlined' }
- { label: 'BoxPlotFilled', value: 'BoxPlotFilled' }
- { label: 'BoxPlotOutlined', value: 'BoxPlotOutlined' }
- { label: 'BoxPlotTwoTone', value: 'BoxPlotTwoTone' }
- { label: 'BranchesOutlined', value: 'BranchesOutlined' }
- { label: 'BugFilled', value: 'BugFilled' }
- { label: 'BugOutlined', value: 'BugOutlined' }
- { label: 'BugTwoTone', value: 'BugTwoTone' }
- { label: 'BuildFilled', value: 'BuildFilled' }
- { label: 'BuildOutlined', value: 'BuildOutlined' }
- { label: 'BuildTwoTone', value: 'BuildTwoTone' }
- { label: 'BulbFilled', value: 'BulbFilled' }
- { label: 'BulbOutlined', value: 'BulbOutlined' }
- { label: 'BulbTwoTone', value: 'BulbTwoTone' }
- { label: 'CalculatorFilled', value: 'CalculatorFilled' }
- { label: 'CalculatorOutlined', value: 'CalculatorOutlined' }
- { label: 'CalculatorTwoTone', value: 'CalculatorTwoTone' }
- { label: 'CalendarFilled', value: 'CalendarFilled' }
- { label: 'AiOutlineCalendar', value: 'AiOutlineCalendar' }
- { label: 'CalendarTwoTone', value: 'CalendarTwoTone' }
- { label: 'CameraFilled', value: 'CameraFilled' }
- { label: 'CameraOutlined', value: 'CameraOutlined' }
- { label: 'CameraTwoTone', value: 'CameraTwoTone' }
- { label: 'CarFilled', value: 'CarFilled' }
- { label: 'CarOutlined', value: 'CarOutlined' }
- { label: 'CarTwoTone', value: 'CarTwoTone' }
- { label: 'CaretDownFilled', value: 'CaretDownFilled' }
- { label: 'CaretDownOutlined', value: 'CaretDownOutlined' }
- { label: 'CaretLeftFilled', value: 'CaretLeftFilled' }
- { label: 'CaretLeftOutlined', value: 'CaretLeftOutlined' }
- { label: 'CaretRightFilled', value: 'CaretRightFilled' }
- { label: 'CaretRightOutlined', value: 'CaretRightOutlined' }
- { label: 'CaretUpFilled', value: 'CaretUpFilled' }
- { label: 'CaretUpOutlined', value: 'CaretUpOutlined' }
- { label: 'CarryOutFilled', value: 'CarryOutFilled' }
- { label: 'CarryOutOutlined', value: 'CarryOutOutlined' }
- { label: 'CarryOutTwoTone', value: 'CarryOutTwoTone' }
- { label: 'CheckCircleFilled', value: 'CheckCircleFilled' }
- { label: 'CheckCircleOutlined', value: 'CheckCircleOutlined' }
- { label: 'CheckCircleTwoTone', value: 'CheckCircleTwoTone' }
- { label: 'CheckOutlined', value: 'CheckOutlined' }
- { label: 'CheckSquareFilled', value: 'CheckSquareFilled' }
- { label: 'CheckSquareOutlined', value: 'CheckSquareOutlined' }
- { label: 'CheckSquareTwoTone', value: 'CheckSquareTwoTone' }
- { label: 'ChromeFilled', value: 'ChromeFilled' }
- { label: 'ChromeOutlined', value: 'ChromeOutlined' }
- { label: 'CiCircleFilled', value: 'CiCircleFilled' }
- { label: 'CiCircleOutlined', value: 'CiCircleOutlined' }
- { label: 'CiCircleTwoTone', value: 'CiCircleTwoTone' }
- { label: 'CiOutlined', value: 'CiOutlined' }
- { label: 'CiTwoTone', value: 'CiTwoTone' }
- { label: 'ClearOutlined', value: 'ClearOutlined' }
- { label: 'ClockCircleFilled', value: 'ClockCircleFilled' }
- { label: 'ClockCircleOutlined', value: 'ClockCircleOutlined' }
- { label: 'ClockCircleTwoTone', value: 'ClockCircleTwoTone' }
- { label: 'CloseCircleFilled', value: 'CloseCircleFilled' }
- { label: 'CloseCircleOutlined', value: 'CloseCircleOutlined' }
- { label: 'CloseCircleTwoTone', value: 'CloseCircleTwoTone' }
- { label: 'CloseOutlined', value: 'CloseOutlined' }
- { label: 'CloseSquareFilled', value: 'CloseSquareFilled' }
- { label: 'CloseSquareOutlined', value: 'CloseSquareOutlined' }
- { label: 'CloseSquareTwoTone', value: 'CloseSquareTwoTone' }
- { label: 'CloudDownloadOutlined', value: 'CloudDownloadOutlined' }
- { label: 'CloudFilled', value: 'CloudFilled' }
- { label: 'CloudOutlined', value: 'CloudOutlined' }
- { label: 'CloudServerOutlined', value: 'CloudServerOutlined' }
- { label: 'CloudSyncOutlined', value: 'CloudSyncOutlined' }
- { label: 'CloudTwoTone', value: 'CloudTwoTone' }
- { label: 'CloudUploadOutlined', value: 'CloudUploadOutlined' }
- { label: 'ClusterOutlined', value: 'ClusterOutlined' }
- { label: 'CodeFilled', value: 'CodeFilled' }
- { label: 'CodeOutlined', value: 'CodeOutlined' }
- { label: 'CodeSandboxCircleFilled', value: 'CodeSandboxCircleFilled' }
- { label: 'CodeSandboxOutlined', value: 'CodeSandboxOutlined' }
- { label: 'CodeSandboxSquareFilled', value: 'CodeSandboxSquareFilled' }
- { label: 'CodeTwoTone', value: 'CodeTwoTone' }
- { label: 'CodepenCircleFilled', value: 'CodepenCircleFilled' }
- { label: 'CodepenCircleOutlined', value: 'CodepenCircleOutlined' }
- { label: 'CodepenOutlined', value: 'CodepenOutlined' }
- { label: 'CodepenSquareFilled', value: 'CodepenSquareFilled' }
- { label: 'CoffeeOutlined', value: 'CoffeeOutlined' }
- { label: 'ColumnHeightOutlined', value: 'ColumnHeightOutlined' }
- { label: 'ColumnWidthOutlined', value: 'ColumnWidthOutlined' }
- { label: 'CommentOutlined', value: 'CommentOutlined' }
- { label: 'CompassFilled', value: 'CompassFilled' }
- { label: 'CompassOutlined', value: 'CompassOutlined' }
- { label: 'CompassTwoTone', value: 'CompassTwoTone' }
- { label: 'CompressOutlined', value: 'CompressOutlined' }
- { label: 'ConsoleSqlOutlined', value: 'ConsoleSqlOutlined' }
- { label: 'ContactsFilled', value: 'ContactsFilled' }
- { label: 'ContactsOutlined', value: 'ContactsOutlined' }
- { label: 'ContactsTwoTone', value: 'ContactsTwoTone' }
- { label: 'ContainerFilled', value: 'ContainerFilled' }
- { label: 'ContainerOutlined', value: 'ContainerOutlined' }
- { label: 'ContainerTwoTone', value: 'ContainerTwoTone' }
- { label: 'ControlFilled', value: 'ControlFilled' }
- { label: 'ControlOutlined', value: 'ControlOutlined' }
- { label: 'ControlTwoTone', value: 'ControlTwoTone' }
- { label: 'CopyFilled', value: 'CopyFilled' }
- { label: 'CopyOutlined', value: 'CopyOutlined' }
- { label: 'CopyTwoTone', value: 'CopyTwoTone' }
- { label: 'CopyrightCircleFilled', value: 'CopyrightCircleFilled' }
- { label: 'CopyrightCircleOutlined', value: 'CopyrightCircleOutlined' }
- { label: 'CopyrightCircleTwoTone', value: 'CopyrightCircleTwoTone' }
- { label: 'CopyrightOutlined', value: 'CopyrightOutlined' }
- { label: 'CopyrightTwoTone', value: 'CopyrightTwoTone' }
- { label: 'CreditCardFilled', value: 'CreditCardFilled' }
- { label: 'CreditCardOutlined', value: 'CreditCardOutlined' }
- { label: 'CreditCardTwoTone', value: 'CreditCardTwoTone' }
- { label: 'CrownFilled', value: 'CrownFilled' }
- { label: 'CrownOutlined', value: 'CrownOutlined' }
- { label: 'CrownTwoTone', value: 'CrownTwoTone' }
- { label: 'CustomerServiceFilled', value: 'CustomerServiceFilled' }
- { label: 'CustomerServiceOutlined', value: 'CustomerServiceOutlined' }
- { label: 'CustomerServiceTwoTone', value: 'CustomerServiceTwoTone' }
- { label: 'DashOutlined', value: 'DashOutlined' }
- { label: 'DashboardFilled', value: 'DashboardFilled' }
- { label: 'DashboardOutlined', value: 'DashboardOutlined' }
- { label: 'DashboardTwoTone', value: 'DashboardTwoTone' }
- { label: 'DatabaseFilled', value: 'DatabaseFilled' }
- { label: 'DatabaseOutlined', value: 'DatabaseOutlined' }
- { label: 'DatabaseTwoTone', value: 'DatabaseTwoTone' }
- { label: 'DeleteColumnOutlined', value: 'DeleteColumnOutlined' }
- { label: 'DeleteFilled', value: 'DeleteFilled' }
- { label: 'DeleteOutlined', value: 'DeleteOutlined' }
- { label: 'DeleteRowOutlined', value: 'DeleteRowOutlined' }
- { label: 'DeleteTwoTone', value: 'DeleteTwoTone' }
- { label: 'DeliveredProcedureOutlined', value: 'DeliveredProcedureOutlined' }
- { label: 'DeploymentUnitOutlined', value: 'DeploymentUnitOutlined' }
- { label: 'DesktopOutlined', value: 'DesktopOutlined' }
- { label: 'DiffFilled', value: 'DiffFilled' }
- { label: 'DiffOutlined', value: 'DiffOutlined' }
- { label: 'DiffTwoTone', value: 'DiffTwoTone' }
- { label: 'DingdingOutlined', value: 'DingdingOutlined' }
- { label: 'DingtalkCircleFilled', value: 'DingtalkCircleFilled' }
- { label: 'DingtalkOutlined', value: 'DingtalkOutlined' }
- { label: 'DingtalkSquareFilled', value: 'DingtalkSquareFilled' }
- { label: 'DisconnectOutlined', value: 'DisconnectOutlined' }
- { label: 'DislikeFilled', value: 'DislikeFilled' }
- { label: 'DislikeOutlined', value: 'DislikeOutlined' }
- { label: 'DislikeTwoTone', value: 'DislikeTwoTone' }
- { label: 'DollarCircleFilled', value: 'DollarCircleFilled' }
- { label: 'DollarCircleOutlined', value: 'DollarCircleOutlined' }
- { label: 'DollarCircleTwoTone', value: 'DollarCircleTwoTone' }
- { label: 'DollarOutlined', value: 'DollarOutlined' }
- { label: 'DollarTwoTone', value: 'DollarTwoTone' }
- { label: 'DotChartOutlined', value: 'DotChartOutlined' }
- { label: 'DoubleLeftOutlined', value: 'DoubleLeftOutlined' }
- { label: 'DoubleRightOutlined', value: 'DoubleRightOutlined' }
- { label: 'DownCircleFilled', value: 'DownCircleFilled' }
- { label: 'DownCircleOutlined', value: 'DownCircleOutlined' }
- { label: 'DownCircleTwoTone', value: 'DownCircleTwoTone' }
- { label: 'DownOutlined', value: 'DownOutlined' }
- { label: 'DownSquareFilled', value: 'DownSquareFilled' }
- { label: 'DownSquareOutlined', value: 'DownSquareOutlined' }
- { label: 'DownSquareTwoTone', value: 'DownSquareTwoTone' }
- { label: 'DownloadOutlined', value: 'DownloadOutlined' }
- { label: 'DragOutlined', value: 'DragOutlined' }
- { label: 'DribbbleCircleFilled', value: 'DribbbleCircleFilled' }
- { label: 'DribbbleOutlined', value: 'DribbbleOutlined' }
- { label: 'DribbbleSquareFilled', value: 'DribbbleSquareFilled' }
- { label: 'DribbbleSquareOutlined', value: 'DribbbleSquareOutlined' }
- { label: 'DropboxCircleFilled', value: 'DropboxCircleFilled' }
- { label: 'DropboxOutlined', value: 'DropboxOutlined' }
- { label: 'DropboxSquareFilled', value: 'DropboxSquareFilled' }
- { label: 'EditFilled', value: 'EditFilled' }
- { label: 'EditOutlined', value: 'EditOutlined' }
- { label: 'EditTwoTone', value: 'EditTwoTone' }
- { label: 'EllipsisOutlined', value: 'EllipsisOutlined' }
- { label: 'EnterOutlined', value: 'EnterOutlined' }
- { label: 'EnvironmentFilled', value: 'EnvironmentFilled' }
- { label: 'EnvironmentOutlined', value: 'EnvironmentOutlined' }
- { label: 'EnvironmentTwoTone', value: 'EnvironmentTwoTone' }
- { label: 'EuroCircleFilled', value: 'EuroCircleFilled' }
- { label: 'EuroCircleOutlined', value: 'EuroCircleOutlined' }
- { label: 'EuroCircleTwoTone', value: 'EuroCircleTwoTone' }
- { label: 'EuroOutlined', value: 'EuroOutlined' }
- { label: 'EuroTwoTone', value: 'EuroTwoTone' }
- { label: 'ExceptionOutlined', value: 'ExceptionOutlined' }
- { label: 'ExclamationCircleFilled', value: 'ExclamationCircleFilled' }
- { label: 'ExclamationCircleOutlined', value: 'ExclamationCircleOutlined' }
- { label: 'ExclamationCircleTwoTone', value: 'ExclamationCircleTwoTone' }
- { label: 'ExclamationOutlined', value: 'ExclamationOutlined' }
- { label: 'ExpandAltOutlined', value: 'ExpandAltOutlined' }
- { label: 'ExpandOutlined', value: 'ExpandOutlined' }
- { label: 'ExperimentFilled', value: 'ExperimentFilled' }
- { label: 'ExperimentOutlined', value: 'ExperimentOutlined' }
- { label: 'ExperimentTwoTone', value: 'ExperimentTwoTone' }
- { label: 'ExportOutlined', value: 'ExportOutlined' }
- { label: 'EyeFilled', value: 'EyeFilled' }
- { label: 'EyeInvisibleFilled', value: 'EyeInvisibleFilled' }
- { label: 'EyeInvisibleOutlined', value: 'EyeInvisibleOutlined' }
- { label: 'EyeInvisibleTwoTone', value: 'EyeInvisibleTwoTone' }
- { label: 'EyeOutlined', value: 'EyeOutlined' }
- { label: 'EyeTwoTone', value: 'EyeTwoTone' }
- { label: 'FacebookFilled', value: 'FacebookFilled' }
- { label: 'FacebookOutlined', value: 'FacebookOutlined' }
- { label: 'FallOutlined', value: 'FallOutlined' }
- { label: 'FastBackwardFilled', value: 'FastBackwardFilled' }
- { label: 'FastBackwardOutlined', value: 'FastBackwardOutlined' }
- { label: 'FastForwardFilled', value: 'FastForwardFilled' }
- { label: 'FastForwardOutlined', value: 'FastForwardOutlined' }
- { label: 'FieldBinaryOutlined', value: 'FieldBinaryOutlined' }
- { label: 'FieldNumberOutlined', value: 'FieldNumberOutlined' }
- { label: 'FieldStringOutlined', value: 'FieldStringOutlined' }
- { label: 'FieldTimeOutlined', value: 'FieldTimeOutlined' }
- { label: 'FileAddFilled', value: 'FileAddFilled' }
- { label: 'FileAddOutlined', value: 'FileAddOutlined' }
- { label: 'FileAddTwoTone', value: 'FileAddTwoTone' }
- { label: 'FileDoneOutlined', value: 'FileDoneOutlined' }
- { label: 'FileExcelFilled', value: 'FileExcelFilled' }
- { label: 'FileExcelOutlined', value: 'FileExcelOutlined' }
- { label: 'FileExcelTwoTone', value: 'FileExcelTwoTone' }
- { label: 'FileExclamationFilled', value: 'FileExclamationFilled' }
- { label: 'FileExclamationOutlined', value: 'FileExclamationOutlined' }
- { label: 'FileExclamationTwoTone', value: 'FileExclamationTwoTone' }
- { label: 'FileFilled', value: 'FileFilled' }
- { label: 'FileGifOutlined', value: 'FileGifOutlined' }
- { label: 'FileImageFilled', value: 'FileImageFilled' }
- { label: 'FileImageOutlined', value: 'FileImageOutlined' }
- { label: 'FileImageTwoTone', value: 'FileImageTwoTone' }
- { label: 'FileJpgOutlined', value: 'FileJpgOutlined' }
- { label: 'FileMarkdownFilled', value: 'FileMarkdownFilled' }
- { label: 'FileMarkdownOutlined', value: 'FileMarkdownOutlined' }
- { label: 'FileMarkdownTwoTone', value: 'FileMarkdownTwoTone' }
- { label: 'FileOutlined', value: 'FileOutlined' }
- { label: 'FilePdfFilled', value: 'FilePdfFilled' }
- { label: 'FilePdfOutlined', value: 'FilePdfOutlined' }
- { label: 'FilePdfTwoTone', value: 'FilePdfTwoTone' }
- { label: 'FilePptFilled', value: 'FilePptFilled' }
- { label: 'FilePptOutlined', value: 'FilePptOutlined' }
- { label: 'FilePptTwoTone', value: 'FilePptTwoTone' }
- { label: 'FileProtectOutlined', value: 'FileProtectOutlined' }
- { label: 'FileSearchOutlined', value: 'FileSearchOutlined' }
- { label: 'FileSyncOutlined', value: 'FileSyncOutlined' }
- { label: 'FileTextFilled', value: 'FileTextFilled' }
- { label: 'FileTextOutlined', value: 'FileTextOutlined' }
- { label: 'FileTextTwoTone', value: 'FileTextTwoTone' }
- { label: 'FileTwoTone', value: 'FileTwoTone' }
- { label: 'FileUnknownFilled', value: 'FileUnknownFilled' }
- { label: 'FileUnknownOutlined', value: 'FileUnknownOutlined' }
- { label: 'FileUnknownTwoTone', value: 'FileUnknownTwoTone' }
- { label: 'FileWordFilled', value: 'FileWordFilled' }
- { label: 'FileWordOutlined', value: 'FileWordOutlined' }
- { label: 'FileWordTwoTone', value: 'FileWordTwoTone' }
- { label: 'FileZipFilled', value: 'FileZipFilled' }
- { label: 'FileZipOutlined', value: 'FileZipOutlined' }
- { label: 'FileZipTwoTone', value: 'FileZipTwoTone' }
- { label: 'FilterFilled', value: 'FilterFilled' }
- { label: 'FilterOutlined', value: 'FilterOutlined' }
- { label: 'FilterTwoTone', value: 'FilterTwoTone' }
- { label: 'FireFilled', value: 'FireFilled' }
- { label: 'AiOutlineFire', value: 'AiOutlineFire' }
- { label: 'FireTwoTone', value: 'FireTwoTone' }
- { label: 'FlagFilled', value: 'FlagFilled' }
- { label: 'FlagOutlined', value: 'FlagOutlined' }
- { label: 'FlagTwoTone', value: 'FlagTwoTone' }
- { label: 'FolderAddFilled', value: 'FolderAddFilled' }
- { label: 'FolderAddOutlined', value: 'FolderAddOutlined' }
- { label: 'FolderAddTwoTone', value: 'FolderAddTwoTone' }
- { label: 'FolderFilled', value: 'FolderFilled' }
- { label: 'FolderOpenFilled', value: 'FolderOpenFilled' }
- { label: 'FolderOpenOutlined', value: 'FolderOpenOutlined' }
- { label: 'FolderOpenTwoTone', value: 'FolderOpenTwoTone' }
- { label: 'FolderOutlined', value: 'FolderOutlined' }
- { label: 'FolderTwoTone', value: 'FolderTwoTone' }
- { label: 'FolderViewOutlined', value: 'FolderViewOutlined' }
- { label: 'FontColorsOutlined', value: 'FontColorsOutlined' }
- { label: 'FontSizeOutlined', value: 'FontSizeOutlined' }
- { label: 'ForkOutlined', value: 'ForkOutlined' }
- { label: 'FormOutlined', value: 'FormOutlined' }
- { label: 'FormatPainterFilled', value: 'FormatPainterFilled' }
- { label: 'FormatPainterOutlined', value: 'FormatPainterOutlined' }
- { label: 'ForwardFilled', value: 'ForwardFilled' }
- { label: 'ForwardOutlined', value: 'ForwardOutlined' }
- { label: 'FrownFilled', value: 'FrownFilled' }
- { label: 'FrownOutlined', value: 'FrownOutlined' }
- { label: 'FrownTwoTone', value: 'FrownTwoTone' }
- { label: 'FullscreenExitOutlined', value: 'FullscreenExitOutlined' }
- { label: 'FullscreenOutlined', value: 'FullscreenOutlined' }
- { label: 'FunctionOutlined', value: 'FunctionOutlined' }
- { label: 'FundFilled', value: 'FundFilled' }
- { label: 'FundOutlined', value: 'FundOutlined' }
- {
label: 'FundProjectionScreenOutlined',
value: 'FundProjectionScreenOutlined',
}
- { label: 'FundTwoTone', value: 'FundTwoTone' }
- { label: 'FundViewOutlined', value: 'FundViewOutlined' }
- { label: 'FunnelPlotFilled', value: 'FunnelPlotFilled' }
- { label: 'FunnelPlotOutlined', value: 'FunnelPlotOutlined' }
- { label: 'FunnelPlotTwoTone', value: 'FunnelPlotTwoTone' }
- { label: 'GatewayOutlined', value: 'GatewayOutlined' }
- { label: 'GifOutlined', value: 'GifOutlined' }
- { label: 'GiftFilled', value: 'GiftFilled' }
- { label: 'GiftOutlined', value: 'GiftOutlined' }
- { label: 'GiftTwoTone', value: 'GiftTwoTone' }
- { label: 'GithubFilled', value: 'GithubFilled' }
- { label: 'GithubOutlined', value: 'GithubOutlined' }
- { label: 'GitlabFilled', value: 'GitlabFilled' }
- { label: 'GitlabOutlined', value: 'GitlabOutlined' }
- { label: 'GlobalOutlined', value: 'GlobalOutlined' }
- { label: 'GoldFilled', value: 'GoldFilled' }
- { label: 'GoldOutlined', value: 'GoldOutlined' }
- { label: 'GoldTwoTone', value: 'GoldTwoTone' }
- { label: 'GoldenFilled', value: 'GoldenFilled' }
- { label: 'GoogleCircleFilled', value: 'GoogleCircleFilled' }
- { label: 'GoogleOutlined', value: 'GoogleOutlined' }
- { label: 'GooglePlusCircleFilled', value: 'GooglePlusCircleFilled' }
- { label: 'GooglePlusOutlined', value: 'GooglePlusOutlined' }
- { label: 'GooglePlusSquareFilled', value: 'GooglePlusSquareFilled' }
- { label: 'GoogleSquareFilled', value: 'GoogleSquareFilled' }
- { label: 'GroupOutlined', value: 'GroupOutlined' }
- { label: 'HddFilled', value: 'HddFilled' }
- { label: 'HddOutlined', value: 'HddOutlined' }
- { label: 'HddTwoTone', value: 'HddTwoTone' }
- { label: 'HeartFilled', value: 'HeartFilled' }
- { label: 'HeartOutlined', value: 'HeartOutlined' }
- { label: 'HeartTwoTone', value: 'HeartTwoTone' }
- { label: 'HeatMapOutlined', value: 'HeatMapOutlined' }
- { label: 'HighlightFilled', value: 'HighlightFilled' }
- { label: 'HighlightOutlined', value: 'HighlightOutlined' }
- { label: 'HighlightTwoTone', value: 'HighlightTwoTone' }
- { label: 'HistoryOutlined', value: 'HistoryOutlined' }
- { label: 'HolderOutlined', value: 'HolderOutlined' }
- { label: 'HomeFilled', value: 'HomeFilled' }
- { label: 'HomeOutlined', value: 'HomeOutlined' }
- { label: 'HomeTwoTone', value: 'HomeTwoTone' }
- { label: 'HourglassFilled', value: 'HourglassFilled' }
- { label: 'HourglassOutlined', value: 'HourglassOutlined' }
- { label: 'HourglassTwoTone', value: 'HourglassTwoTone' }
- { label: 'Html5Filled', value: 'Html5Filled' }
- { label: 'Html5Outlined', value: 'Html5Outlined' }
- { label: 'Html5TwoTone', value: 'Html5TwoTone' }
- { label: 'IdcardFilled', value: 'IdcardFilled' }
- { label: 'IdcardOutlined', value: 'IdcardOutlined' }
- { label: 'IdcardTwoTone', value: 'IdcardTwoTone' }
- { label: 'IeCircleFilled', value: 'IeCircleFilled' }
- { label: 'IeOutlined', value: 'IeOutlined' }
- { label: 'IeSquareFilled', value: 'IeSquareFilled' }
- { label: 'ImportOutlined', value: 'ImportOutlined' }
- { label: 'InboxOutlined', value: 'InboxOutlined' }
- { label: 'InfoCircleFilled', value: 'InfoCircleFilled' }
- { label: 'InfoCircleOutlined', value: 'InfoCircleOutlined' }
- { label: 'InfoCircleTwoTone', value: 'InfoCircleTwoTone' }
- { label: 'InfoOutlined', value: 'InfoOutlined' }
- { label: 'InsertRowAboveOutlined', value: 'InsertRowAboveOutlined' }
- { label: 'InsertRowBelowOutlined', value: 'InsertRowBelowOutlined' }
- { label: 'InsertRowLeftOutlined', value: 'InsertRowLeftOutlined' }
- { label: 'InsertRowRightOutlined', value: 'InsertRowRightOutlined' }
- { label: 'InstagramFilled', value: 'InstagramFilled' }
- { label: 'InstagramOutlined', value: 'InstagramOutlined' }
- { label: 'InsuranceFilled', value: 'InsuranceFilled' }
- { label: 'InsuranceOutlined', value: 'InsuranceOutlined' }
- { label: 'InsuranceTwoTone', value: 'InsuranceTwoTone' }
- { label: 'InteractionFilled', value: 'InteractionFilled' }
- { label: 'InteractionOutlined', value: 'InteractionOutlined' }
- { label: 'InteractionTwoTone', value: 'InteractionTwoTone' }
- { label: 'IssuesCloseOutlined', value: 'IssuesCloseOutlined' }
- { label: 'ItalicOutlined', value: 'ItalicOutlined' }
- { label: 'KeyOutlined', value: 'KeyOutlined' }
- { label: 'LaptopOutlined', value: 'LaptopOutlined' }
- { label: 'LayoutFilled', value: 'LayoutFilled' }
- { label: 'LayoutOutlined', value: 'LayoutOutlined' }
- { label: 'LayoutTwoTone', value: 'LayoutTwoTone' }
- { label: 'LeftCircleFilled', value: 'LeftCircleFilled' }
- { label: 'LeftCircleOutlined', value: 'LeftCircleOutlined' }
- { label: 'LeftCircleTwoTone', value: 'LeftCircleTwoTone' }
- { label: 'LeftOutlined', value: 'LeftOutlined' }
- { label: 'LeftSquareFilled', value: 'LeftSquareFilled' }
- { label: 'LeftSquareOutlined', value: 'LeftSquareOutlined' }
- { label: 'LeftSquareTwoTone', value: 'LeftSquareTwoTone' }
- { label: 'LikeFilled', value: 'LikeFilled' }
- { label: 'LikeOutlined', value: 'LikeOutlined' }
- { label: 'LikeTwoTone', value: 'LikeTwoTone' }
- { label: 'LineChartOutlined', value: 'LineChartOutlined' }
- { label: 'LineHeightOutlined', value: 'LineHeightOutlined' }
- { label: 'LineOutlined', value: 'LineOutlined' }
- { label: 'LinkOutlined', value: 'LinkOutlined' }
- { label: 'LinkedinFilled', value: 'LinkedinFilled' }
- { label: 'LinkedinOutlined', value: 'LinkedinOutlined' }
- { label: 'Loading3QuartersOutlined', value: 'Loading3QuartersOutlined' }
- { label: 'LoadingOutlined', value: 'LoadingOutlined' }
- { label: 'LockFilled', value: 'LockFilled' }
- { label: 'LockOutlined', value: 'LockOutlined' }
- { label: 'LockTwoTone', value: 'LockTwoTone' }
- { label: 'LoginOutlined', value: 'LoginOutlined' }
- { label: 'LogoutOutlined', value: 'LogoutOutlined' }
- { label: 'MacCommandFilled', value: 'MacCommandFilled' }
- { label: 'MacCommandOutlined', value: 'MacCommandOutlined' }
- { label: 'MailFilled', value: 'MailFilled' }
- { label: 'MailOutlined', value: 'MailOutlined' }
- { label: 'MailTwoTone', value: 'MailTwoTone' }
- { label: 'ManOutlined', value: 'ManOutlined' }
- { label: 'MedicineBoxFilled', value: 'MedicineBoxFilled' }
- { label: 'MedicineBoxOutlined', value: 'MedicineBoxOutlined' }
- { label: 'MedicineBoxTwoTone', value: 'MedicineBoxTwoTone' }
- { label: 'MediumCircleFilled', value: 'MediumCircleFilled' }
- { label: 'MediumOutlined', value: 'MediumOutlined' }
- { label: 'MediumSquareFilled', value: 'MediumSquareFilled' }
- { label: 'MediumWorkmarkOutlined', value: 'MediumWorkmarkOutlined' }
- { label: 'MehFilled', value: 'MehFilled' }
- { label: 'MehOutlined', value: 'MehOutlined' }
- { label: 'MehTwoTone', value: 'MehTwoTone' }
- { label: 'MenuFoldOutlined', value: 'MenuFoldOutlined' }
- { label: 'MenuOutlined', value: 'MenuOutlined' }
- { label: 'MenuUnfoldOutlined', value: 'MenuUnfoldOutlined' }
- { label: 'MergeCellsOutlined', value: 'MergeCellsOutlined' }
- { label: 'MessageFilled', value: 'MessageFilled' }
- { label: 'MessageOutlined', value: 'MessageOutlined' }
- { label: 'MessageTwoTone', value: 'MessageTwoTone' }
- { label: 'MinusCircleFilled', value: 'MinusCircleFilled' }
- { label: 'MinusCircleOutlined', value: 'MinusCircleOutlined' }
- { label: 'MinusCircleTwoTone', value: 'MinusCircleTwoTone' }
- { label: 'MinusOutlined', value: 'MinusOutlined' }
- { label: 'MinusSquareFilled', value: 'MinusSquareFilled' }
- { label: 'MinusSquareOutlined', value: 'MinusSquareOutlined' }
- { label: 'MinusSquareTwoTone', value: 'MinusSquareTwoTone' }
- { label: 'MobileFilled', value: 'MobileFilled' }
- { label: 'MobileOutlined', value: 'MobileOutlined' }
- { label: 'MobileTwoTone', value: 'MobileTwoTone' }
- { label: 'MoneyCollectFilled', value: 'MoneyCollectFilled' }
- { label: 'MoneyCollectOutlined', value: 'MoneyCollectOutlined' }
- { label: 'MoneyCollectTwoTone', value: 'MoneyCollectTwoTone' }
- { label: 'MonitorOutlined', value: 'MonitorOutlined' }
- { label: 'MoreOutlined', value: 'MoreOutlined' }
- { label: 'NodeCollapseOutlined', value: 'NodeCollapseOutlined' }
- { label: 'NodeExpandOutlined', value: 'NodeExpandOutlined' }
- { label: 'NodeIndexOutlined', value: 'NodeIndexOutlined' }
- { label: 'NotificationFilled', value: 'NotificationFilled' }
- { label: 'NotificationOutlined', value: 'NotificationOutlined' }
- { label: 'NotificationTwoTone', value: 'NotificationTwoTone' }
- { label: 'NumberOutlined', value: 'NumberOutlined' }
- { label: 'OneToOneOutlined', value: 'OneToOneOutlined' }
- { label: 'OrderedListOutlined', value: 'OrderedListOutlined' }
- { label: 'PaperClipOutlined', value: 'PaperClipOutlined' }
- { label: 'PartitionOutlined', value: 'PartitionOutlined' }
- { label: 'PauseCircleFilled', value: 'PauseCircleFilled' }
- { label: 'PauseCircleOutlined', value: 'PauseCircleOutlined' }
- { label: 'PauseCircleTwoTone', value: 'PauseCircleTwoTone' }
- { label: 'PauseOutlined', value: 'PauseOutlined' }
- { label: 'PayCircleFilled', value: 'PayCircleFilled' }
- { label: 'PayCircleOutlined', value: 'PayCircleOutlined' }
- { label: 'PercentageOutlined', value: 'PercentageOutlined' }
- { label: 'PhoneFilled', value: 'PhoneFilled' }
- { label: 'PhoneOutlined', value: 'PhoneOutlined' }
- { label: 'PhoneTwoTone', value: 'PhoneTwoTone' }
- { label: 'PicCenterOutlined', value: 'PicCenterOutlined' }
- { label: 'PicLeftOutlined', value: 'PicLeftOutlined' }
- { label: 'PicRightOutlined', value: 'PicRightOutlined' }
- { label: 'PictureFilled', value: 'PictureFilled' }
- { label: 'PictureOutlined', value: 'PictureOutlined' }
- { label: 'PictureTwoTone', value: 'PictureTwoTone' }
- { label: 'PieChartFilled', value: 'PieChartFilled' }
- { label: 'PieChartOutlined', value: 'PieChartOutlined' }
- { label: 'PieChartTwoTone', value: 'PieChartTwoTone' }
- { label: 'PlayCircleFilled', value: 'PlayCircleFilled' }
- { label: 'PlayCircleOutlined', value: 'PlayCircleOutlined' }
- { label: 'PlayCircleTwoTone', value: 'PlayCircleTwoTone' }
- { label: 'PlaySquareFilled', value: 'PlaySquareFilled' }
- { label: 'PlaySquareOutlined', value: 'PlaySquareOutlined' }
- { label: 'PlaySquareTwoTone', value: 'PlaySquareTwoTone' }
- { label: 'PlusCircleFilled', value: 'PlusCircleFilled' }
- { label: 'PlusCircleOutlined', value: 'PlusCircleOutlined' }
- { label: 'PlusCircleTwoTone', value: 'PlusCircleTwoTone' }
- { label: 'PlusOutlined', value: 'PlusOutlined' }
- { label: 'PlusSquareFilled', value: 'PlusSquareFilled' }
- { label: 'PlusSquareOutlined', value: 'PlusSquareOutlined' }
- { label: 'PlusSquareTwoTone', value: 'PlusSquareTwoTone' }
- { label: 'PoundCircleFilled', value: 'PoundCircleFilled' }
- { label: 'PoundCircleOutlined', value: 'PoundCircleOutlined' }
- { label: 'PoundCircleTwoTone', value: 'PoundCircleTwoTone' }
- { label: 'PoundOutlined', value: 'PoundOutlined' }
- { label: 'PoweroffOutlined', value: 'PoweroffOutlined' }
- { label: 'PrinterFilled', value: 'PrinterFilled' }
- { label: 'PrinterOutlined', value: 'PrinterOutlined' }
- { label: 'PrinterTwoTone', value: 'PrinterTwoTone' }
- { label: 'ProfileFilled', value: 'ProfileFilled' }
- { label: 'ProfileOutlined', value: 'ProfileOutlined' }
- { label: 'ProfileTwoTone', value: 'ProfileTwoTone' }
- { label: 'ProjectFilled', value: 'ProjectFilled' }
- { label: 'ProjectOutlined', value: 'ProjectOutlined' }
- { label: 'ProjectTwoTone', value: 'ProjectTwoTone' }
- { label: 'PropertySafetyFilled', value: 'PropertySafetyFilled' }
- { label: 'PropertySafetyOutlined', value: 'PropertySafetyOutlined' }
- { label: 'PropertySafetyTwoTone', value: 'PropertySafetyTwoTone' }
- { label: 'PullRequestOutlined', value: 'PullRequestOutlined' }
- { label: 'PushpinFilled', value: 'PushpinFilled' }
- { label: 'PushpinOutlined', value: 'PushpinOutlined' }
- { label: 'PushpinTwoTone', value: 'PushpinTwoTone' }
- { label: 'QqCircleFilled', value: 'QqCircleFilled' }
- { label: 'QqOutlined', value: 'QqOutlined' }
- { label: 'QqSquareFilled', value: 'QqSquareFilled' }
- { label: 'QrcodeOutlined', value: 'QrcodeOutlined' }
- { label: 'QuestionCircleFilled', value: 'QuestionCircleFilled' }
- { label: 'QuestionCircleOutlined', value: 'QuestionCircleOutlined' }
- { label: 'QuestionCircleTwoTone', value: 'QuestionCircleTwoTone' }
- { label: 'QuestionOutlined', value: 'QuestionOutlined' }
- { label: 'RadarChartOutlined', value: 'RadarChartOutlined' }
- { label: 'RadiusBottomleftOutlined', value: 'RadiusBottomleftOutlined' }
- { label: 'RadiusBottomrightOutlined', value: 'RadiusBottomrightOutlined' }
- { label: 'RadiusSettingOutlined', value: 'RadiusSettingOutlined' }
- { label: 'RadiusUpleftOutlined', value: 'RadiusUpleftOutlined' }
- { label: 'RadiusUprightOutlined', value: 'RadiusUprightOutlined' }
- { label: 'ReadFilled', value: 'ReadFilled' }
- { label: 'ReadOutlined', value: 'ReadOutlined' }
- { label: 'ReconciliationFilled', value: 'ReconciliationFilled' }
- { label: 'ReconciliationOutlined', value: 'ReconciliationOutlined' }
- { label: 'ReconciliationTwoTone', value: 'ReconciliationTwoTone' }
- { label: 'RedEnvelopeFilled', value: 'RedEnvelopeFilled' }
- { label: 'RedEnvelopeOutlined', value: 'RedEnvelopeOutlined' }
- { label: 'RedEnvelopeTwoTone', value: 'RedEnvelopeTwoTone' }
- { label: 'RedditCircleFilled', value: 'RedditCircleFilled' }
- { label: 'RedditOutlined', value: 'RedditOutlined' }
- { label: 'RedditSquareFilled', value: 'RedditSquareFilled' }
- { label: 'RedoOutlined', value: 'RedoOutlined' }
- { label: 'ReloadOutlined', value: 'ReloadOutlined' }
- { label: 'RestFilled', value: 'RestFilled' }
- { label: 'RestOutlined', value: 'RestOutlined' }
- { label: 'RestTwoTone', value: 'RestTwoTone' }
- { label: 'RetweetOutlined', value: 'RetweetOutlined' }
- { label: 'RightCircleFilled', value: 'RightCircleFilled' }
- { label: 'RightCircleOutlined', value: 'RightCircleOutlined' }
- { label: 'RightCircleTwoTone', value: 'RightCircleTwoTone' }
- { label: 'RightOutlined', value: 'RightOutlined' }
- { label: 'RightSquareFilled', value: 'RightSquareFilled' }
- { label: 'RightSquareOutlined', value: 'RightSquareOutlined' }
- { label: 'RightSquareTwoTone', value: 'RightSquareTwoTone' }
- { label: 'RiseOutlined', value: 'RiseOutlined' }
- { label: 'RobotFilled', value: 'RobotFilled' }
- { label: 'RobotOutlined', value: 'RobotOutlined' }
- { label: 'RocketFilled', value: 'RocketFilled' }
- { label: 'AiOutlineRocket', value: 'AiOutlineRocket' }
- { label: 'RocketTwoTone', value: 'RocketTwoTone' }
- { label: 'RollbackOutlined', value: 'RollbackOutlined' }
- { label: 'RotateLeftOutlined', value: 'RotateLeftOutlined' }
- { label: 'RotateRightOutlined', value: 'RotateRightOutlined' }
- { label: 'SafetyCertificateFilled', value: 'SafetyCertificateFilled' }
- { label: 'SafetyCertificateOutlined', value: 'SafetyCertificateOutlined' }
- { label: 'SafetyCertificateTwoTone', value: 'SafetyCertificateTwoTone' }
- { label: 'SafetyOutlined', value: 'SafetyOutlined' }
- { label: 'SaveFilled', value: 'SaveFilled' }
- { label: 'SaveOutlined', value: 'SaveOutlined' }
- { label: 'SaveTwoTone', value: 'SaveTwoTone' }
- { label: 'ScanOutlined', value: 'ScanOutlined' }
- { label: 'ScheduleFilled', value: 'ScheduleFilled' }
- { label: 'ScheduleOutlined', value: 'ScheduleOutlined' }
- { label: 'ScheduleTwoTone', value: 'ScheduleTwoTone' }
- { label: 'ScissorOutlined', value: 'ScissorOutlined' }
- { label: 'SearchOutlined', value: 'SearchOutlined' }
- { label: 'SecurityScanFilled', value: 'SecurityScanFilled' }
- { label: 'SecurityScanOutlined', value: 'SecurityScanOutlined' }
- { label: 'SecurityScanTwoTone', value: 'SecurityScanTwoTone' }
- { label: 'SelectOutlined', value: 'SelectOutlined' }
- { label: 'SendOutlined', value: 'SendOutlined' }
- { label: 'SettingFilled', value: 'SettingFilled' }
- { label: 'SettingOutlined', value: 'SettingOutlined' }
- { label: 'SettingTwoTone', value: 'SettingTwoTone' }
- { label: 'ShakeOutlined', value: 'ShakeOutlined' }
- { label: 'ShareAltOutlined', value: 'ShareAltOutlined' }
- { label: 'ShopFilled', value: 'ShopFilled' }
- { label: 'ShopOutlined', value: 'ShopOutlined' }
- { label: 'ShopTwoTone', value: 'ShopTwoTone' }
- { label: 'ShoppingCartOutlined', value: 'ShoppingCartOutlined' }
- { label: 'ShoppingFilled', value: 'ShoppingFilled' }
- { label: 'ShoppingOutlined', value: 'ShoppingOutlined' }
- { label: 'ShoppingTwoTone', value: 'ShoppingTwoTone' }
- { label: 'ShrinkOutlined', value: 'ShrinkOutlined' }
- { label: 'SignalFilled', value: 'SignalFilled' }
- { label: 'SisternodeOutlined', value: 'SisternodeOutlined' }
- { label: 'SketchCircleFilled', value: 'SketchCircleFilled' }
- { label: 'SketchOutlined', value: 'SketchOutlined' }
- { label: 'SketchSquareFilled', value: 'SketchSquareFilled' }
- { label: 'SkinFilled', value: 'SkinFilled' }
- { label: 'SkinOutlined', value: 'SkinOutlined' }
- { label: 'SkinTwoTone', value: 'SkinTwoTone' }
- { label: 'SkypeFilled', value: 'SkypeFilled' }
- { label: 'SkypeOutlined', value: 'SkypeOutlined' }
- { label: 'SlackCircleFilled', value: 'SlackCircleFilled' }
- { label: 'SlackOutlined', value: 'SlackOutlined' }
- { label: 'SlackSquareFilled', value: 'SlackSquareFilled' }
- { label: 'SlackSquareOutlined', value: 'SlackSquareOutlined' }
- { label: 'SlidersFilled', value: 'SlidersFilled' }
- { label: 'SlidersOutlined', value: 'SlidersOutlined' }
- { label: 'SlidersTwoTone', value: 'SlidersTwoTone' }
- { label: 'SmallDashOutlined', value: 'SmallDashOutlined' }
- { label: 'SmileFilled', value: 'SmileFilled' }
- { label: 'SmileOutlined', value: 'SmileOutlined' }
- { label: 'SmileTwoTone', value: 'SmileTwoTone' }
- { label: 'SnippetsFilled', value: 'SnippetsFilled' }
- { label: 'SnippetsOutlined', value: 'SnippetsOutlined' }
- { label: 'SnippetsTwoTone', value: 'SnippetsTwoTone' }
- { label: 'SolutionOutlined', value: 'SolutionOutlined' }
- { label: 'SortAscendingOutlined', value: 'SortAscendingOutlined' }
- { label: 'SortDescendingOutlined', value: 'SortDescendingOutlined' }
- { label: 'SoundFilled', value: 'SoundFilled' }
- { label: 'SoundOutlined', value: 'SoundOutlined' }
- { label: 'SoundTwoTone', value: 'SoundTwoTone' }
- { label: 'SplitCellsOutlined', value: 'SplitCellsOutlined' }
- { label: 'StarFilled', value: 'StarFilled' }
- { label: 'StarOutlined', value: 'StarOutlined' }
- { label: 'StarTwoTone', value: 'StarTwoTone' }
- { label: 'StepBackwardFilled', value: 'StepBackwardFilled' }
- { label: 'StepBackwardOutlined', value: 'StepBackwardOutlined' }
- { label: 'StepForwardFilled', value: 'StepForwardFilled' }
- { label: 'StepForwardOutlined', value: 'StepForwardOutlined' }
- { label: 'StockOutlined', value: 'StockOutlined' }
- { label: 'StopFilled', value: 'StopFilled' }
- { label: 'StopOutlined', value: 'StopOutlined' }
- { label: 'StopTwoTone', value: 'StopTwoTone' }
- { label: 'StrikethroughOutlined', value: 'StrikethroughOutlined' }
- { label: 'SubnodeOutlined', value: 'SubnodeOutlined' }
- { label: 'SwapLeftOutlined', value: 'SwapLeftOutlined' }
- { label: 'SwapOutlined', value: 'SwapOutlined' }
- { label: 'SwapRightOutlined', value: 'SwapRightOutlined' }
- { label: 'SwitcherFilled', value: 'SwitcherFilled' }
- { label: 'SwitcherOutlined', value: 'SwitcherOutlined' }
- { label: 'SwitcherTwoTone', value: 'SwitcherTwoTone' }
- { label: 'SyncOutlined', value: 'SyncOutlined' }
- { label: 'TableOutlined', value: 'TableOutlined' }
- { label: 'TabletFilled', value: 'TabletFilled' }
- { label: 'TabletOutlined', value: 'TabletOutlined' }
- { label: 'TabletTwoTone', value: 'TabletTwoTone' }
- { label: 'TagFilled', value: 'TagFilled' }
- { label: 'TagOutlined', value: 'TagOutlined' }
- { label: 'TagTwoTone', value: 'TagTwoTone' }
- { label: 'TagsFilled', value: 'TagsFilled' }
- { label: 'TagsOutlined', value: 'TagsOutlined' }
- { label: 'TagsTwoTone', value: 'TagsTwoTone' }
- { label: 'TaobaoCircleFilled', value: 'TaobaoCircleFilled' }
- { label: 'TaobaoCircleOutlined', value: 'TaobaoCircleOutlined' }
- { label: 'TaobaoOutlined', value: 'TaobaoOutlined' }
- { label: 'TaobaoSquareFilled', value: 'TaobaoSquareFilled' }
- { label: 'TeamOutlined', value: 'TeamOutlined' }
- { label: 'ThunderboltFilled', value: 'ThunderboltFilled' }
- { label: 'ThunderboltOutlined', value: 'ThunderboltOutlined' }
- { label: 'ThunderboltTwoTone', value: 'ThunderboltTwoTone' }
- { label: 'ToTopOutlined', value: 'ToTopOutlined' }
- { label: 'ToolFilled', value: 'ToolFilled' }
- { label: 'ToolOutlined', value: 'ToolOutlined' }
- { label: 'ToolTwoTone', value: 'ToolTwoTone' }
- { label: 'TrademarkCircleFilled', value: 'TrademarkCircleFilled' }
- { label: 'TrademarkCircleOutlined', value: 'TrademarkCircleOutlined' }
- { label: 'TrademarkCircleTwoTone', value: 'TrademarkCircleTwoTone' }
- { label: 'TrademarkOutlined', value: 'TrademarkOutlined' }
- { label: 'TransactionOutlined', value: 'TransactionOutlined' }
- { label: 'TranslationOutlined', value: 'TranslationOutlined' }
- { label: 'TrophyFilled', value: 'TrophyFilled' }
- { label: 'TrophyOutlined', value: 'TrophyOutlined' }
- { label: 'TrophyTwoTone', value: 'TrophyTwoTone' }
- { label: 'TwitterCircleFilled', value: 'TwitterCircleFilled' }
- { label: 'TwitterOutlined', value: 'TwitterOutlined' }
- { label: 'TwitterSquareFilled', value: 'TwitterSquareFilled' }
- { label: 'UnderlineOutlined', value: 'UnderlineOutlined' }
- { label: 'UndoOutlined', value: 'UndoOutlined' }
- { label: 'UngroupOutlined', value: 'UngroupOutlined' }
- { label: 'UnlockFilled', value: 'UnlockFilled' }
- { label: 'UnlockOutlined', value: 'UnlockOutlined' }
- { label: 'UnlockTwoTone', value: 'UnlockTwoTone' }
- { label: 'UnorderedListOutlined', value: 'UnorderedListOutlined' }
- { label: 'UpCircleFilled', value: 'UpCircleFilled' }
- { label: 'UpCircleOutlined', value: 'UpCircleOutlined' }
- { label: 'UpCircleTwoTone', value: 'UpCircleTwoTone' }
- { label: 'UpOutlined', value: 'UpOutlined' }
- { label: 'UpSquareFilled', value: 'UpSquareFilled' }
- { label: 'UpSquareOutlined', value: 'UpSquareOutlined' }
- { label: 'UpSquareTwoTone', value: 'UpSquareTwoTone' }
- { label: 'UploadOutlined', value: 'UploadOutlined' }
- { label: 'UsbFilled', value: 'UsbFilled' }
- { label: 'UsbOutlined', value: 'UsbOutlined' }
- { label: 'UsbTwoTone', value: 'UsbTwoTone' }
- { label: 'UserAddOutlined', value: 'UserAddOutlined' }
- { label: 'UserDeleteOutlined', value: 'UserDeleteOutlined' }
- { label: 'UserOutlined', value: 'UserOutlined' }
- { label: 'UserSwitchOutlined', value: 'UserSwitchOutlined' }
- { label: 'UsergroupAddOutlined', value: 'UsergroupAddOutlined' }
- { label: 'UsergroupDeleteOutlined', value: 'UsergroupDeleteOutlined' }
- { label: 'VerifiedOutlined', value: 'VerifiedOutlined' }
- { label: 'VerticalAlignBottomOutlined', value: 'VerticalAlignBottomOutlined' }
- { label: 'VerticalAlignMiddleOutlined', value: 'VerticalAlignMiddleOutlined' }
- { label: 'VerticalAlignTopOutlined', value: 'VerticalAlignTopOutlined' }
- { label: 'VerticalLeftOutlined', value: 'VerticalLeftOutlined' }
- { label: 'VerticalRightOutlined', value: 'VerticalRightOutlined' }
- { label: 'VideoCameraAddOutlined', value: 'VideoCameraAddOutlined' }
- { label: 'VideoCameraFilled', value: 'VideoCameraFilled' }
- { label: 'VideoCameraOutlined', value: 'VideoCameraOutlined' }
- { label: 'VideoCameraTwoTone', value: 'VideoCameraTwoTone' }
- { label: 'WalletFilled', value: 'WalletFilled' }
- { label: 'WalletOutlined', value: 'WalletOutlined' }
- { label: 'WalletTwoTone', value: 'WalletTwoTone' }
- { label: 'WarningFilled', value: 'WarningFilled' }
- { label: 'WarningOutlined', value: 'WarningOutlined' }
- { label: 'WarningTwoTone', value: 'WarningTwoTone' }
- { label: 'WechatFilled', value: 'WechatFilled' }
- { label: 'WechatOutlined', value: 'WechatOutlined' }
- { label: 'WeiboCircleFilled', value: 'WeiboCircleFilled' }
- { label: 'WeiboCircleOutlined', value: 'WeiboCircleOutlined' }
- { label: 'WeiboOutlined', value: 'WeiboOutlined' }
- { label: 'WeiboSquareFilled', value: 'WeiboSquareFilled' }
- { label: 'WeiboSquareOutlined', value: 'WeiboSquareOutlined' }
- { label: 'WhatsAppOutlined', value: 'WhatsAppOutlined' }
- { label: 'WifiOutlined', value: 'WifiOutlined' }
- { label: 'WindowsFilled', value: 'WindowsFilled' }
- { label: 'WindowsOutlined', value: 'WindowsOutlined' }
- { label: 'WomanOutlined', value: 'WomanOutlined' }
- { label: 'YahooFilled', value: 'YahooFilled' }
- { label: 'YahooOutlined', value: 'YahooOutlined' }
- { label: 'YoutubeFilled', value: 'YoutubeFilled' }
- { label: 'YoutubeOutlined', value: 'YoutubeOutlined' }
- { label: 'YuqueFilled', value: 'YuqueFilled' }
- { label: 'YuqueOutlined', value: 'YuqueOutlined' }
- { label: 'ZhihuCircleFilled', value: 'ZhihuCircleFilled' }
- { label: 'ZhihuOutlined', value: 'ZhihuOutlined' }
- { label: 'ZhihuSquareFilled', value: 'ZhihuSquareFilled' }
- { label: 'ZoomInOutlined', value: 'ZoomInOutlined' }
- { label: 'ZoomOutOutlined', value: 'ZoomOutOutlined' }
- AiFillAlert
- AiFillApi
- AiFillBell
- AiFillCamera
- AiFillCheckCircle
- AiOutlineCloseCircle
- AiOutlineException
- AiOutlineExclamation
- AiOutlineExperiment
- AiOutlineForm
- AiOutlineHome

View File

@ -126,8 +126,8 @@ _ref:
- id: remove
type: CallMethod
messages:
loading: sd f sdfgsdfg
success: hi sdfg sdfgs g
loading: Removing Item...
success: Item Removed.
params:
blockId: todos
method: removeItem

View File

@ -38,8 +38,8 @@ _ref:
- All blocks have`onMount` and `onMountAsync` events.
- Each block implements it's own additional events such as `onClick` etc.
##### Block loading
- By default all blocks render a loading skeleton when the block's source code is fetched or while the block is waiting on data from a request.
- A block's default loading can be overwritten by defining custom `loading` settings on a block.
- Some blocks gracefully handle a loading state while `onMount` events are being executed.
- A block's default loading can be overwritten by defining custom `skeleton` settings on a block.
-------
A Lowdefy page is compiled out of an arrangement of blocks. Every HTML element of this page is render as a result of a block placed and configured on the page. Blocks make it simple for Lowdefy developers to create apps since they only have to decide what block type to use, where in the layout the block should render, and what the block should do by defining the block's `properties`. How a block implements these `properties` is up to the specific block type selected.
@ -64,7 +64,8 @@ _ref:
- `blocks: array`: A array of blocks to render to the default `content` area for `container`, `context` and `list` blocks. See [layout](/layout) for more details on how to use the `blocks` array.
- `events: object`: Used to defined [`actions`](/events-and-actions) that run when the block triggers an [`event`](/events-and-actions).
- `layout: object`: Used to define the [layout](/layout) properties for a block. __Operators are evaluated__.
- `loading: object`: Used to overwrite a block's default loading behavior.
- `skeleton: object`: Used to overwrite a block's default loading behavior by rendering a skeleton. Any block types from [`@lowdefy/blocks-basic`](https://www.npmjs.com/package/@lowdefy/blocks-basic) and [`@lowdefy/blocks-loaders`](https://www.npmjs.com/package/@lowdefy/blocks-loaders) can be used in the skeleton definition, including sub-blocks.
- `loading: boolean`: When true, renders the block in loading. If a `skeleton` is defined, it will be rendered, else the block's default loading behavior will be rendered.
- `required: boolean | string`: For `input` blocks, whether or not a value value is required in `state` when the [`Validate`](/Validate) action is called. Can be either a boolean or a string that is used as the validation error message . __Operators are evaluated__.
- `style: css object`: Used to apply css style settings to the block's top level `div` element. __Operators are evaluated__.
- `validate: array`: A list of validation tests to pass when the [`Validate`](/Validate) action is called. __Operators are evaluated__.
@ -97,7 +98,7 @@ _ref:
url: https://blocks-cdn.lowdefy.com/v3.10.1/blocks-amcharts/meta/AmChartsXY.json
pages:
- id: example_dashboard
type: Context
type: Box
blocks:
- id: basic_chart
type: AmChartsXY
@ -164,21 +165,25 @@ _ref:
# Block loading
Block loading renders a placeholder block while the block component is being fetched, or a block is waiting on a request to return before to rendering the block. This allows for a smoother user experience and reduces 'bounce' in the user interface as more blocks takes up their full width and height on the page while in a loading state.
Blocks will only start rendering when the `onInit` event has completed its actions. The `onMount` event on blocks will render blocks loading active. By default, some blocks will change behavior while it is in loading. For example, input blocks will be disabled during loading. The loading behavior of blocks can be controlled using the `loading` block property. Setting `loading` to `true` on a container and list block, will result in rendering all child blocks with loading active.
By default, Lowdefy tries to give a reasonable definition for how much space a block should take up in while loading, however this can vary depending on how the block is used. The `loading` property on blocks allows the Lowdefy developer to set a custom loading configuration for a block.
Often it is useful te render a skeleton of blocks instead of the blocks' default loading behavior. When block definitions are provided to the `skeleton` property on a block, this `skeleton` definition will be rendered when loading is active. Any block types from [`@lowdefy/blocks-basic`](https://www.npmjs.com/package/@lowdefy/blocks-basic) and [`@lowdefy/blocks-loaders`](https://www.npmjs.com/package/@lowdefy/blocks-loaders) can be used as the skeleton definition, including sub-blocks.
##### Custom block `loading` example:
##### Block `loading` and `skeleton` example:
```yaml
pages:
- id: page_one
type: Context
type: Box
blocks:
# ...
- id: paragraph_one
type: Title
loading:
_eq:
- _state: done
- false
skeleton:
type: SkeletonParagraph
properties:
lines: 1
@ -187,59 +192,6 @@ _ref:
# ...
```
## Loading placeholder types
The following loading placeholder types are available:
##### Spinner
A Lowdefy logo loading spinner placed at the center of the block. Often used as the full page loading spinner logo. The following `properties` apply to `Spinner`:
- `barColor: string`: Color of the bars in the Lowdefy spinner logo.
- `color: string`: Color of spinner logo. Default is `#f1f1f1`.
- `height: number | string`: Height of the spinner block including background. Default is `100%`.
- `shaded: boolean`: Masks the spinner block including background.
- `size: number | string`: Size of the spinner icon. Default is `50px`.
##### IconSpinner
A spinning loading icon. The following `properties` apply to `IconSpinner`:
- `size: number | enum`: Size of the spinner icon. Options are `small`, `medium` and `large`. Default is `20px`.
##### Skeleton
A rectangular loading skeleton to fill the full size of the block. The following `properties` apply to `Skeleton`:
- `height: number | string`: Height of the skeleton block. Default is `100%`.
- `width: number | string`: Width of the skeleton block. Default is `100%`.
##### SkeletonAvatar
A avatar loading skeleton. The following `properties` apply to `SkeletonAvatar`:
- `size: number | enum`: Size of the avatar skeleton. Options are `small`, `medium` and `large`. Default is `32px`.
- `shape: enum`: Shape of the avatar skeleton. Options are `square` and `round`. Default is `round`.
##### SkeletonButton
A button loading skeleton, matches the size of [`Button`](/Button) blocks. The following `properties` apply to `SkeletonButton`:
- `size: enum`: Size of the button skeleton. Options are `small`, `medium` and `large`. Default is `medium`.
- `shape: enum`: Shape of the button skeleton corners. Options are `square` and `round`. Default is `round`.
- `height: number | string`: Height of the button skeleton. Overwrites the size setting.
- `width: number | string`: Width of the button skeleton. Default is `100%`.
##### SkeletonInput
A input loading skeleton, used as a placeholder for input blocks with labels. The following `properties` apply to `SkeletonInput`:
- `size: enum`: Size of the input skeleton. Options are `small`, `medium` and `large`. Default is `medium`.
- `labelHeight: number | string`: Height of the label part of the input skeleton.
- `inputHeight: number | string`: Height of the input part of the input skeleton. Overwrites the size setting.
- `labelWidth: number | string`: Width of the label part of the input skeleton. Default is `100%`.
- `width: number | string`: Width of the input part of input skeleton. Default is `100%`.
##### SkeletonParagraph
A paragraph loading skeleton, used as a placeholder for text intensive section. The following `properties` apply to `SkeletonParagraph`:
- `lines: number`: The number of paragraph lines to render. Default is `4`.
- `width: number | string`: Width of the paragraph skeleton. Default is `100%`.
- _ref:
path: templates/navigation_buttons.yaml
vars:

View File

@ -65,7 +65,7 @@ _ref:
- [`_state`](/_state): A `state` object is unique to a `context` and every [`input` block](/blocks) maintains a value in it's parent `state` object. This `state` object is passed to the server when requests are called. The [`SetState`](/SetState) action can be used to modify the value of a `state` object in the same `context` from which `SetState` is called.
- [`_url_query`](/_url_query): The `urlQuery` object is used to access variables set in the url. Url query parameters can be set using the `urlQuery` field in the [`Link`](/Link) action. It can be useful to create sharable links containing some additional information other than the page route. For example setting a document id in the url so that the document can be retrieved when the link is opened during the page [`onEnter`](/events-and-actions) event. __Note that any variables set to `urlQuery` will be publicly visible__.
- [`_url_query`](/_url_query): The `urlQuery` object is used to access variables set in the url. Url query parameters can be set using the `urlQuery` field in the [`Link`](/Link) action. It can be useful to create sharable links containing some additional information other than the page route. For example setting a document id in the url so that the document can be retrieved when the link is opened during the page [`onInit`](/events-and-actions) event. __Note that any variables set to `urlQuery` will be publicly visible__.
- [`_input`](/_input): The `input` object is unique to a page, and works similar to the `urlQuery` object. The `input` object is used to pass information between page transitions. This variable set to the `input` object are not written to the url, so they are not visible publicly but also cannot be used to share the data in a link since a `input` object is only consistent between one `context` and the next to which it links. A `input` object is set to the `input` field of the [`Link`](/Link) action when linking from one page `context` to the next.

View File

@ -114,8 +114,8 @@ _ref:
- `category: enum`: How this block should be rendered in the Lowdefy app. Can be either `display`, `input`, `container`, `context` or `list`.
- `valueType: enum`: For blocks of the `input` block category, Lowdefy enforces a value type in `state`. This can be either a `boolean`, `number`, `string`, `object` or `array`. Lowdefy provides a default value for the block. This is usually `null`, but is `false` for boolean blocks, and the empty array, `[]`, for array blocks.
- `loading: boolean | object`: Settings for the default loading skeleton to render while the block is in a loading status. `false` will render an empty div element while `true` will render the default block skeleton based on the block category. Else an `object` can be provided for more refined settings, see the [loading placeholder types](/blocks) for more details A Lowdefy app developer can over write these defaults by defining the `loading` settings when configuring a block.
- `schema: object`: Provide a valid [JSON-Schema](https://json-schema.org/) definition for the block `properties` and `events`.
# TODO: add icon.
### Block React Component Props
@ -156,6 +156,7 @@ _ref:
- `index: number`: Index of the action in the event array.
- `response: any`: The returned result of the action.
- `skipped: boolean`: True if the action was skipped.
- `loading: boolean`: True while loading is activated for the block.
- `methods: object`: All application methods built into Lowdefy, available for the block.
- `makeCssClass(cssObject | cssObject[]): string`: This methods creates a css class for the block to apply to DOM elements. Css classes are created using [Emotion](https://emotion.sh/docs/introduction). If a list of cssObject are given the cssObjects are shallow merged with the preceding objects properties being overwritten by the latter. Any valid css style object can be passed, including media queries. Default media queries are built in:
- `xs?: object`: Css object applied for screen media with max width of 576px.

View File

@ -108,7 +108,7 @@ _ref:
- id: todos
type: PageHeaderMenu
events:
onEnter:
onInit:
- id: get_todos
type: JsAction # TODO:
params:

View File

@ -34,13 +34,13 @@ _ref:
- The [`_actions`](/_actions)) operator is available for sequential actions to use the values returned from preceding actions in the chain.
- Actions have a `skip` field that can be used to skip action execution.
- The `onInit` event is triggered the first time a context is mounted and keeps the page in loading until all actions have finished.
- The `onEnter` event is triggered the every time a context is mounted and keeps the page in loading until all actions have finished.
- The `onInitAsync` event is triggered the first time a context is mounted and does not keep the page in loading.
- The `onEnterAsync` event is triggered the every time a context is mounted and does not keep the page in loading.
- The `onMount` events is triggered the every time a block is mounted and keeps the block in loading until all actions have finished.
- The `onMountAsync` event is triggered the every time a block is mounted, after `onMount` has completed, and does not keep the block in loading.
-----------
Blocks can define _events_ which the block can trigger when something happens on the page, like a button being clicked, an input's value being modified or a page being loaded. Some examples are `onClick` on a [`Button`](/Button) or `onEnter` on a [`PageHeaderMenu`](/PageHeaderMenu) block.
Blocks can define _events_ which the block can trigger when something happens on the page, like a button being clicked, an input's value being modified or a page being loaded. Some examples are `onClick` on a [`Button`](/Button) or `onMount` on a [`PageHeaderMenu`](/PageHeaderMenu) block.
All blocks implements `onMount` and `onMountAsync` events. These are useful for triggering actions when a block is mounted. For the `onMount` event, the block only mounts when the event action chain is completed, however, for the `onMountAsync` event, the block will mount as soon as possible while the event actions completes execution.
@ -182,23 +182,17 @@ _ref:
type: ActionType2
```
# Context initialisation events
# Page initialization events
Four events are always defined for [`context`](/context) type blocks, called in the following order:
- `onInit`
- `onEnter`
- `onInitAsync`
- `onEnterAsync`
The first blocks on a page, usually a [`container`](/container) type block, can define `onInit` and `onInitAsync` events. All blocks have `onMount` and `onMountAsync` events, that can be used to initialize the page or blocks.
These events can be used to initialize the context or page.
The `onInit` event is triggered the first time a page is loaded. This event blocks page render, in other words, the page __will__ remain in a loading state, rendering only the progress bar, until all the actions have completed execution. It can be used to set up [`state`](/context-and-state). Actions that take a long time to execute, like `Request`, should be used sparingly here for a better user experience.
The `onInit` event is triggered the first time a context is mounted, for example if a page is loaded for the first time. This event blocks page render, in other words, the page __will__ remain in a loading state until all the actions have completed execution. It can be used to set up a context. Actions that take a long time to execute, like `Request`, should be used sparingly here.
The `onInitAsync` event is triggered the first time a page loaded, but does not block page render. In other words, the page __will not__ remain in a loading state until all the actions have completed execution. This is a good place to execute non-blocking tasks or requests that might take longer to execute.
The `onEnter` event is triggered every time a context is mounted to a page, for example if a user left a page, and returns to it. This event also blocks page render. It can be used to execute actions that should be run each time a page is loaded, like checking if an id is present in the [url query parameters](/_url_query), and initializing the [`state`](/context-and-state).
The `onMount` event is triggered every time a block is rendered on a page. This event can be used on any block, and causes the block and it's children to render in their loading state. It typically executes actions that should be run each time a block is loaded, like checking if an id is present in the [url query parameters](/_url_query), or fetching data for [`Selector`](/Selector) options using a [`Request`](/Request) action.
The `onInitAsync` event is triggered the first time a context is mounted, but does not block page render. In other words, the page __will not__ remain in a loading state until all the actions have completed execution. This is a good place to execute non-blocking tasks or requests that might take longer to execute.
The `onEnterAsync` event is triggered every time a context is mounted, but does not block page render.
The `onMountAsync` event is triggered every time a block is mounted, but does not render the block in loading.
# Action types
@ -215,6 +209,8 @@ _ref:
- [`SetGlobal`](/SetGlobal) - Set a value to the `global` variable object.
- [`SetState`](/SetState) - Set a value to the page `state`.
- [`Validate`](/Validate) - Validate the inputs on the page.
See additional action type available under the Actions tab in the menu.
- _ref:
path: templates/navigation_buttons.yaml
vars:

View File

@ -44,7 +44,6 @@ _ref:
- `basePath: string`: Set the base path to serve the Lowdefy application from. This will route all pages under `https://example.com/<base-path>/<page-id>` instead of the default `https://example.com/<page-id>`. The basePath value must start with "/".
- `homePageId: string`: The pageId of the page that should be loaded when a user loads the app without a pageId in the url route. This is the page that is loaded when you navigate to `yourdomain.com`.
- `experimental_initPageId: string`: The pageId of the page that should be loaded when app is initialized. User is then redirected to requeted page. You can use onInit/onInitAsync/onEnter/onEnterAsync events to fetch and prepare global variables for other parts of the app.
- id: alert1
type: Alert

View File

@ -105,7 +105,7 @@ _ref:
properties:
url: /posts
events:
onEnter:
onInit:
- id: fetch_get_posts
type: Request
params: get_posts

View File

@ -173,7 +173,7 @@ _ref:
## 3. Add a JsAction to a button's onClick event with parameters populated
Lowdefy actions are triggered by events, like `onClick` when a user clicks a button, or `onEnter` when the page loads. Lowdefy comes with a list of predefined actions, however, sometimes custom code is just what you need.
Lowdefy actions are triggered by events, like `onClick` when a user clicks a button, or `onInit` when the page loads. Lowdefy comes with a list of predefined actions, however, sometimes custom code is just what you need.
By default Lowdefy builds apps with a set of pre-configured, default block types to make it easier to build apps, for example using [`Button`](/Button), [`TextInput`](/TextInput), [`Box`](/Box), etc. All the blocks documented in the Lowdefy docs are default types.

View File

@ -163,7 +163,7 @@ _ref:
## 2. Register a custom JavaScript Action
Lowdefy actions are triggered by page events, like `onClick` when a user clicks a button, or `onEnter` when the page loads. Lowdefy comes with a list of predefined actions, however, sometimes custom code is the best awnser. Let's create a custom action which will generate a PDF based on pdfMake config.
Lowdefy actions are triggered by page events, like `onClick` when a user clicks a button, or `onInit` when the page loads. Lowdefy comes with a list of predefined actions, however, sometimes custom code is the best awnser. Let's create a custom action which will generate a PDF based on pdfMake config.
1) Create a `public` folder inside your Lowdefy working directory.
2) Since all content in the `public` folder is served by the Lowdefy server, simply create a `pdfMake.js` file inside the `public` folder.
@ -316,7 +316,7 @@ _ref:
properties:
title: Example
events:
onEnter:
onMount:
- id: init_data
type: SetState
params:

View File

@ -12,7 +12,7 @@ pages:
properties:
title: Example
events:
onEnter:
onMount:
- id: init_data
type: SetState
params:

View File

@ -21,7 +21,7 @@ cli:
plugins:
- name: '@lowdefy/docs'
version: '4.0.0-alpha.7'
version: '4.0.0-alpha.8'
global:
all_icons:

View File

@ -86,7 +86,8 @@ const button = (path) => ({
label: {
span: 8,
align: 'right',
extra: 'Name of an Ant Design Icon or properties of an Icon block to use icon in button.',
extra:
'Name of an React-Icon (See <a href="https://react-icons.github.io/react-icons/">all icons</a>) or properties of an Icon block to use icon in button.',
},
showSearch: true,
allowClear: true,

View File

@ -74,7 +74,7 @@ events:
params:
_var: init_state_values
onEnterAsync:
onInitAsync:
{# - id: connect_docsearch
type: JsAction # TODO:
params:
@ -367,25 +367,6 @@ areas:
title: 'style:'
- key: events
title: 'events:'
disabled:
_not:
_get:
key: '0.events'
from:
_mql.aggregate:
on:
- events:
_get:
key: schema.events.properties
default: {}
from:
_ref:
path:
_var: schema
pipeline:
- $project:
events:
$objectToArray: $events
- key: required
title: 'required:'
disabled:
@ -417,9 +398,6 @@ areas:
- id: event_description
type: Markdown
properties:
style:
'& > .markdown-body':
fontSize: 14
content:
_nunjucks:
template: |
@ -438,13 +416,20 @@ areas:
_mql.aggregate:
on:
- events:
_get:
key: schema.events.properties
default: {}
from:
_ref:
path:
_var: schema
_object.assign:
- _get:
key: schema.events.properties
default: {}
from:
_ref:
path:
_var: schema
- onMount:
type: array
description: Trigger actions every time the block is mounted and render the block in its loading state until all actions have finished.
onMountAsync:
type: array
description: Trigger actions every time the block is mounted and do not render the block in its loading state.
pipeline:
- $project:
events:

View File

@ -43,7 +43,7 @@ events:
_random:
type: string
length: 16
onEnterAsync:
onInitAsync:
{# - id: connect_docsearch
type: JsAction # TODO:
params:

View File

@ -43,7 +43,7 @@ events:
_random:
type: string
length: 16
onEnterAsync:
onInitAsync:
{# - id: connect_docsearch
type: JsAction # TODO:
params:

View File

@ -48,7 +48,7 @@ test('button propertiesFormTransformer', () => {
"allowClear": true,
"label": Object {
"align": "right",
"extra": "Name of an Ant Design Icon or properties of an Icon block to use icon in button.",
"extra": "Name of an React-Icon (See <a href=\\"https://react-icons.github.io/react-icons/\\">all icons</a>) or properties of an Icon block to use icon in button.",
"span": 8,
},
"options": Object {

View File

@ -42,12 +42,12 @@ _ref:
#### Examples
###### A login page that redirects users in the onEnter event:
###### A login page that redirects users in the onMount event:
```yaml
id: login
type: Context
type: Box
events:
onEnter:
onMount:
# Redirect to "page1" if user is already logged in.
- id: logged_in_redirect
type: Link

View File

@ -44,7 +44,7 @@ class Actions {
}
}
async callActionLoop({ actions, arrayIndices, block, event, responses }) {
async callActionLoop({ actions, arrayIndices, block, event, progress, responses }) {
for (const [index, action] of actions.entries()) {
try {
if (action.async === true) {
@ -54,6 +54,7 @@ class Actions {
block,
event,
index,
progress,
responses,
});
} else {
@ -63,6 +64,7 @@ class Actions {
block,
event,
index,
progress,
responses,
});
responses[action.id] = response;
@ -77,15 +79,22 @@ class Actions {
}
}
async callActions({ actions, arrayIndices, block, catchActions, event, eventName }) {
async callActions({ actions, arrayIndices, block, catchActions, event, eventName, progress }) {
const startTimestamp = new Date();
const responses = {};
try {
await this.callActionLoop({ actions, arrayIndices, block, event, responses });
await this.callActionLoop({ actions, arrayIndices, block, event, responses, progress });
} catch (error) {
console.error(error);
try {
await this.callActionLoop({ actions: catchActions, arrayIndices, block, event, responses });
await this.callActionLoop({
actions: catchActions,
arrayIndices,
block,
event,
responses,
progress,
});
} catch (errorCatch) {
console.error(errorCatch);
return {
@ -125,7 +134,7 @@ class Actions {
};
}
async callAction({ action, arrayIndices, block, event, index, responses }) {
async callAction({ action, arrayIndices, block, event, index, progress, responses }) {
if (!this.actions[action.type]) {
throw {
error: new Error(`Invalid action type "${action.type}" at "${block.blockId}".`),
@ -167,6 +176,9 @@ class Actions {
params: parsedAction.params,
window: this.context._internal.lowdefy._internal.window,
});
if (progress) {
progress();
}
} catch (error) {
responses[action.id] = { error, index, type: action.type };
const { output: parsedMessages, errors: parserErrors } = this.context._internal.parser.parse({

View File

@ -19,7 +19,6 @@
import { applyArrayIndices, get, serializer, swap, type } from '@lowdefy/helpers';
import Events from './Events.js';
import getFieldValues from './getFieldValues.js';
class Blocks {
constructor({ arrayIndices, areas, context }) {
@ -46,7 +45,6 @@ class Blocks {
this.resetValidation = this.resetValidation.bind(this);
this.resetValidationRec = this.resetValidationRec.bind(this);
this.setBlocksCache = this.setBlocksCache.bind(this);
this.setBlocksLoadingCache = this.setBlocksLoadingCache.bind(this);
this.update = this.update.bind(this);
this.updateState = this.updateState.bind(this);
this.updateStateFromRoot = this.updateStateFromRoot.bind(this);
@ -74,18 +72,22 @@ class Blocks {
? applyArrayIndices(this.arrayIndices, block.fieldPattern)
: block.blockId;
this.context._internal.RootBlocks.map[block.id] = block;
block.visible = type.isNone(block.visible) ? true : block.visible;
block.required = type.isNone(block.required) ? false : block.required;
block.validate = type.isArray(block.validate) ? block.validate : [];
block.properties = type.isNone(block.properties) ? {} : block.properties;
block.style = type.isNone(block.style) ? {} : block.style;
block.layout = type.isNone(block.layout) ? {} : block.layout;
block.events = type.isNone(block.events) ? {} : block.events;
block.layout = type.isNone(block.layout) ? {} : block.layout;
block.loading = type.isNone(block.loading) ? false : block.loading;
block.properties = type.isNone(block.properties) ? {} : block.properties;
block.required = type.isNone(block.required) ? false : block.required;
block.skeleton = type.isNone(block.skeleton) ? null : block.skeleton;
block.style = type.isNone(block.style) ? {} : block.style;
block.validate = type.isNone(block.validate) ? [] : block.validate;
block.visible = type.isNone(block.visible) ? true : block.visible;
block.areasLayoutEval = {};
block.layoutEval = {};
block.loadingEval = {};
block.propertiesEval = {};
block.requiredEval = {};
block.skeletonEval = {};
block.styleEval = {};
block.validationEval = {};
block.visibleEval = {};
@ -103,14 +105,6 @@ class Blocks {
block.areasLayout = {};
}
block.requestKeys = getFieldValues(
'_request',
block.style,
block.properties,
block.validate,
block.visible,
block.required
);
block.methods = {};
block.registerMethod = (methodName, method) => {
block.methods[methodName] = method;
@ -282,8 +276,10 @@ class Blocks {
return serializer.serializeToString({
areasLayoutEval: block.areasLayoutEval,
layoutEval: block.layoutEval,
loadingEval: block.loadingEval,
propertiesEval: block.propertiesEval,
requiredEval: block.requiredEval,
skeletonEval: block.skeletonEval,
styleEval: block.styleEval,
validationEval: block.validationEval,
value: block.value,
@ -390,6 +386,16 @@ class Blocks {
location: block.blockId,
arrayIndices: this.arrayIndices,
});
block.loadingEval = this.context._internal.parser.parse({
input: block.loading,
location: block.blockId,
arrayIndices: this.arrayIndices,
});
block.skeletonEval = this.context._internal.parser.parse({
input: block.skeleton,
location: block.blockId,
arrayIndices: this.arrayIndices,
});
block.areasLayoutEval = this.context._internal.parser.parse({
input: block.areasLayout,
location: block.blockId,
@ -570,15 +576,12 @@ class Blocks {
this.loopBlocks((block) => {
if (block.update) {
block.update = false;
block.loading = block.requestKeys.reduce(
(acc, key) =>
acc || (this.context.requests[key] ? this.context.requests[key].loading : true),
false
);
block.eval = {
areas: block.areasLayoutEval.output,
events: type.isNone(block.Events.events) ? null : block.Events.events,
properties: block.propertiesEval.output,
loading: block.loadingEval.output,
skeleton: block.skeletonEval.output,
required: block.requiredEval.output,
layout: block.layoutEval.output,
style: block.styleEval.output,
@ -598,25 +601,6 @@ class Blocks {
});
});
}
setBlocksLoadingCache() {
this.loopBlocks((block) => {
block.loading_prev = block.loading;
block.loading = block.requestKeys.reduce(
(acc, key) =>
acc || (this.context.requests[key] ? this.context.requests[key].loading : true),
false
);
if (block.loading_prev !== block.loading) {
this.context._internal.lowdefy._internal.updateBlock(block.id);
}
});
Object.keys(this.subBlocks).forEach((subKey) => {
this.subBlocks[subKey].forEach((subBlock) => {
subBlock.setBlocksLoadingCache();
});
});
}
}
export default Blocks;

View File

@ -53,7 +53,7 @@ class Events {
this.events[name] = this.initEvent(actions);
}
async triggerEvent({ name, event }) {
async triggerEvent({ name, event, progress }) {
const eventDescription = this.events[name];
let result = {
blockId: this.block.blockId,
@ -81,6 +81,7 @@ class Events {
catchActions: eventDescription.catchActions,
event,
eventName: name,
progress,
});
eventDescription.history.unshift(res);
this.context.eventLog.unshift(res);

View File

@ -86,9 +86,6 @@ class Requests {
async fetch({ requestId, payload }) {
this.context.requests[requestId].loading = true;
if (this.context._internal.RootBlocks) {
this.context._internal.RootBlocks.setBlocksLoadingCache();
}
try {
const response = await this.context._internal.lowdefy._internal.callRequest({

View File

@ -89,7 +89,7 @@ test('CallMethod with no args, synchronous method', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { textInput: 'init' },
@ -173,7 +173,7 @@ test('CallMethod method return a promise', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { textInput: 'init' },
@ -245,7 +245,7 @@ test('CallMethod with args not an array', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { textInput: 'init' },
@ -339,7 +339,7 @@ test('CallMethod with multiple positional args, synchronous method', async () =>
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { textInput: 'init' },
@ -432,7 +432,7 @@ test('CallMethod of block in array by explicit id', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: [{ textInput: '0' }, { textInput: '1' }] },
@ -510,7 +510,7 @@ test('CallMethod of block in array by block with same indices and id pattern', a
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: [{ textInput: '0' }, { textInput: '1' }] },
@ -571,7 +571,7 @@ test('CallMethod with method does not exist', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { textInput: 'init' },

View File

@ -36,7 +36,7 @@ const lowdefy = {
},
};
test('DisplayMessage with content', async () => {
test('DisplayMessage with content', () => {
const rootBlock = {
id: 'block:root:root:0',
blockId: 'root',
@ -68,7 +68,7 @@ test('DisplayMessage with content', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -83,7 +83,7 @@ test('DisplayMessage with content', async () => {
]);
});
test('DisplayMessage with all params', async () => {
test('DisplayMessage with all params', () => {
const rootBlock = {
id: 'block:root:root:0',
blockId: 'root',
@ -120,7 +120,7 @@ test('DisplayMessage with all params', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -138,7 +138,7 @@ test('DisplayMessage with all params', async () => {
]);
});
test('DisplayMessage with no params', async () => {
test('DisplayMessage with no params', () => {
const rootBlock = {
id: 'block:root:root:0',
blockId: 'root',
@ -169,7 +169,7 @@ test('DisplayMessage with no params', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -82,7 +82,7 @@ test('getActions params is true', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -153,7 +153,7 @@ test('getActions params is a', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -216,7 +216,7 @@ test('getActions params is none', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -291,7 +291,7 @@ test('getActions params.key is null', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -358,7 +358,7 @@ test('getActions params.all is true', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -426,7 +426,7 @@ test('getActions params.key is not string or int', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -506,7 +506,7 @@ test('getActions params.key is a', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -75,7 +75,7 @@ test('getBlockId no params', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -76,7 +76,7 @@ test('getEvent params is true', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -133,7 +133,7 @@ test('getEvent params is some', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -187,7 +187,7 @@ test('getEvent params is none', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -257,7 +257,7 @@ test('getEvent params.key is null', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -314,7 +314,7 @@ test('getEvent params.all is true', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -371,7 +371,7 @@ test('getEvent params.key is not string or int', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -446,7 +446,7 @@ test('getEvent params.key is some', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -79,7 +79,7 @@ test('getGlobal params is true', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -134,7 +134,7 @@ test('getGlobal params is some', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -188,7 +188,7 @@ test('getGlobal params is none', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -258,7 +258,7 @@ test('getGlobal params.key is null', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -315,7 +315,7 @@ test('getGlobal params.all is true', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -372,7 +372,7 @@ test('getGlobal params.key is not string or int', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -447,7 +447,7 @@ test('getGlobal params.key is some', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -79,7 +79,7 @@ test('getInput params is true', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -134,7 +134,7 @@ test('getInput params is some', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -188,7 +188,7 @@ test('getInput params is none', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -258,7 +258,7 @@ test('getInput params.key is null', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -315,7 +315,7 @@ test('getInput params.all is true', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -372,7 +372,7 @@ test('getInput params.key is not string or int', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -447,7 +447,7 @@ test('getInput params.key is some', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -75,7 +75,7 @@ test('getPageId no params', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -111,7 +111,7 @@ test('getRequestDetails params is true', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -183,7 +183,7 @@ test('getRequestDetails params is req_one', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -252,7 +252,7 @@ test('getRequestDetails params is none', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -333,7 +333,7 @@ test('getRequestDetails params.key is null', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -401,7 +401,7 @@ test('getRequestDetails params.all is true', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -475,7 +475,7 @@ test('getRequestDetails params.key is not string or int', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -561,7 +561,7 @@ test('getRequestDetails params.key is req_one', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -76,7 +76,7 @@ test('getState params is true', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { some: 'data' },
@ -132,7 +132,7 @@ test('getState params is some', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { some: 'data' },
@ -187,7 +187,7 @@ test('getState params is none', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { some: 'data' },
@ -258,7 +258,7 @@ test('getState params.key is null', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { some: 'data' },
@ -316,7 +316,7 @@ test('getState params.all is true', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { some: 'data' },
@ -374,7 +374,7 @@ test('getState params.key is not string or int', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { some: 'data' },
@ -450,7 +450,7 @@ test('getState params.key is some', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { some: 'data' },

View File

@ -79,7 +79,7 @@ test('getUrlQuery params is true', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -134,7 +134,7 @@ test('getUrlQuery params is some', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -188,7 +188,7 @@ test('getUrlQuery params is none', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -258,7 +258,7 @@ test('getUrlQuery params.key is null', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -315,7 +315,7 @@ test('getUrlQuery params.all is true', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -372,7 +372,7 @@ test('getUrlQuery params.key is not string or int', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -447,7 +447,7 @@ test('getUrlQuery params.key is some', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -79,7 +79,7 @@ test('getUser params is true', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -134,7 +134,7 @@ test('getUser params is some', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -188,7 +188,7 @@ test('getUser params is none', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -258,7 +258,7 @@ test('getUser params.key is null', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -315,7 +315,7 @@ test('getUser params.all is true', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -372,7 +372,7 @@ test('getUser params.key is not string or int', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -447,7 +447,7 @@ test('getUser params.key is some', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -85,7 +85,7 @@ test('Link with string pageId params', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -121,7 +121,7 @@ test('Link with object params', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -164,7 +164,7 @@ test('Link error', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -76,7 +76,7 @@ test('Login', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -75,7 +75,7 @@ test('Logout', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -107,7 +107,7 @@ test('Request call one request', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -170,7 +170,7 @@ test('Request call all requests', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -252,7 +252,7 @@ test('Request call array of requests', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -334,7 +334,7 @@ test('Request pass if params are none', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -373,7 +373,7 @@ test('Request call request error', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -31,7 +31,7 @@ const lowdefy = {
},
};
test('Reset one field', async () => {
test('Reset one field', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -65,7 +65,7 @@ test('Reset one field', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { textInput: 'init' },
@ -79,7 +79,7 @@ test('Reset one field', async () => {
expect(context.state).toEqual({ textInput: 'init' });
});
test('Reset on primitive array after adding item', async () => {
test('Reset on primitive array after adding item', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -128,7 +128,7 @@ test('Reset on primitive array after adding item', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: ['init'] },
@ -142,7 +142,7 @@ test('Reset on primitive array after adding item', async () => {
expect(context.state).toEqual({ list: ['init'] });
});
test('Reset on object array after removing item', async () => {
test('Reset on object array after removing item', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -192,7 +192,7 @@ test('Reset on object array after removing item', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: [{ textInput: 'init' }] },

View File

@ -166,7 +166,7 @@ test('RestValidation after required field', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
operators: lowdefy._internal.operators,

View File

@ -61,7 +61,7 @@ test('SetGlobal data to global', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -31,7 +31,7 @@ const lowdefy = {
},
};
test('SetState data to state', async () => {
test('SetState data to state', () => {
const rootBlock = {
id: 'block:root:root:0',
blockId: 'root',
@ -66,7 +66,7 @@ test('SetState data to state', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { textInput: 'init' },
@ -78,7 +78,7 @@ test('SetState data to state', async () => {
expect(context.state).toEqual({ textInput: 'init', x: [1, 2, 3] });
});
test('SetState field to state and update block value', async () => {
test('SetState field to state and update block value', () => {
const rootBlock = {
id: 'block:root:root:0',
blockId: 'root',
@ -113,7 +113,7 @@ test('SetState field to state and update block value', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { textInput: 'init' },
@ -128,7 +128,7 @@ test('SetState field to state and update block value', async () => {
expect(textInput.value).toEqual('new');
});
test('SetState field to state with incorrect type - NOTE SetState IS NOT TYPE SAFE', async () => {
test('SetState field to state with incorrect type - NOTE SetState IS NOT TYPE SAFE', () => {
const rootBlock = {
id: 'block:root:root:0',
blockId: 'root',
@ -163,7 +163,7 @@ test('SetState field to state with incorrect type - NOTE SetState IS NOT TYPE SA
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { textInput: 'init' },
@ -178,7 +178,7 @@ test('SetState field to state with incorrect type - NOTE SetState IS NOT TYPE SA
expect(textInput.value).toEqual(1);
});
test('SetState value on array and create new Blocks for array items', async () => {
test('SetState value on array and create new Blocks for array items', () => {
const rootBlock = {
id: 'block:root:root:0',
blockId: 'root',
@ -235,7 +235,7 @@ test('SetState value on array and create new Blocks for array items', async () =
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: [{ textInput: 'init' }] },

View File

@ -186,7 +186,7 @@ test('Validate required field', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
operators: lowdefy._internal.operators,
@ -331,7 +331,7 @@ test('Validate all fields', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
operators: lowdefy._internal.operators,
@ -538,7 +538,7 @@ test('Validate only one field', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
operators: lowdefy._internal.operators,
@ -709,7 +709,7 @@ test('Validate list of fields', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
operators: lowdefy._internal.operators,
@ -847,7 +847,7 @@ test('Invalid Validate params', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -939,7 +939,7 @@ test('Validate does not fail on warnings', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
operators: lowdefy._internal.operators,
@ -1036,7 +1036,7 @@ test('Validate on nested objects using params.regex string', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
operators: lowdefy._internal.operators,
@ -1152,7 +1152,7 @@ test('Validate on nested objects using params.regex array', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
operators: lowdefy._internal.operators,
@ -1285,7 +1285,7 @@ test('Validate on nested objects using params.regex array and blockIds', async (
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
operators: lowdefy._internal.operators,

View File

@ -55,7 +55,7 @@ const blockData = ({
visible,
});
async function getContext({ config, lowdefy, development = false }) {
function getContext({ config, lowdefy, development = false }) {
if (!config) {
throw new Error('A page must be provided to get context.');
}
@ -82,7 +82,6 @@ async function getContext({ config, lowdefy, development = false }) {
};
const _internal = ctx._internal;
_internal.parser = new WebParser({ context: ctx, operators: lowdefy._internal.operators });
await _internal.parser.init();
_internal.State = new State(ctx);
_internal.Actions = new Actions(ctx);
_internal.Requests = new Requests(ctx);
@ -94,10 +93,26 @@ async function getContext({ config, lowdefy, development = false }) {
_internal.update = () => {
_internal.RootBlocks.update();
};
await _internal.RootBlocks.map[ctx.id].triggerEvent({ name: 'onInit' });
_internal.update();
_internal.State.freezeState();
_internal.RootBlocks.map[ctx.id].triggerEvent({ name: 'onInitAsync' });
_internal.runOnInit = async (progress) => {
progress();
if (!_internal.onInitDone) {
await _internal.RootBlocks.areas.root.blocks[0].triggerEvent({
name: 'onInit',
progress,
});
_internal.State.freezeState();
_internal.onInitDone = true;
}
};
_internal.runOnInitAsync = async (progress) => {
if (_internal.onInitDone && !_internal.onInitAsyncDone) {
await _internal.RootBlocks.areas.root.blocks[0].triggerEvent({
name: 'onInitAsync',
progress,
});
_internal.onInitAsyncDone = true;
}
};
lowdefy.contexts[id] = ctx;
return ctx;
}

View File

@ -78,7 +78,7 @@ test('call a synchronous action', async () => {
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -117,7 +117,7 @@ test('call a asynchronous action', async () => {
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -156,7 +156,7 @@ test('call 2 actions', async () => {
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -202,7 +202,7 @@ test('operators are evaluated in params, skip and messages', async () => {
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -278,7 +278,7 @@ test('operators are evaluated in error messages after error', async () => {
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -326,7 +326,7 @@ test('action error in error messages from same action id', async () => {
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -382,7 +382,7 @@ test('action error in error parser', async () => {
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -435,7 +435,7 @@ test('error with messages undefined', async () => {
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -471,7 +471,7 @@ test('skip a action', async () => {
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -510,7 +510,7 @@ test('action throws a error', async () => {
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -561,7 +561,7 @@ test('actions after a error are not called throws a error', async () => {
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -616,7 +616,7 @@ test('Invalid action type', async () => {
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -666,7 +666,7 @@ test('Parser error in action', async () => {
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -722,7 +722,7 @@ test('Display default loading and success messages when value == true ', async (
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -767,7 +767,7 @@ test('Display custom loading and success messages when value is a string ', asyn
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -812,7 +812,7 @@ test('Do not display loading and success messages by default', async () => {
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -841,7 +841,7 @@ test('Display error message by default', async () => {
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -877,7 +877,7 @@ test('Display custom error message', async () => {
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -916,7 +916,7 @@ test('Do not display an error message if message === false', async () => {
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -947,7 +947,7 @@ test('Call catchActions when actions throws error', async () => {
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -1023,7 +1023,7 @@ test('Call catchActions when actions throws error and catchActions throws error'
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -1126,7 +1126,7 @@ test('call 2 actions, first with async: true', async () => {
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -1189,7 +1189,7 @@ test('call async: true with error', async () => {
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -1252,7 +1252,7 @@ test('call 2 actions, first with async: false', async () => {
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -1298,7 +1298,7 @@ test('call 2 actions, first with async: null', async () => {
category: 'container',
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -27,7 +27,7 @@ import testContext from '../testContext.js';
const pageId = 'one';
const lowdefy = { pageId };
test('set block to init', async () => {
test('set block to init', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -48,7 +48,7 @@ test('set block to init', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { textInput: 'init' },
@ -60,7 +60,7 @@ test('set block to init', async () => {
});
// can't use testContext
test('Blocks to init with no blocks passed', async () => {
test('Blocks to init with no blocks passed', () => {
const context = {
lowdefy: { pageId },
operators: [],
@ -70,7 +70,6 @@ test('Blocks to init with no blocks passed', async () => {
};
context.State = new State(context);
context.parser = new WebParser({ context, contexts: {} });
await context.parser.init();
context.RootBlocks = new Blocks({
context,
arrayIndices: [],
@ -81,7 +80,7 @@ test('Blocks to init with no blocks passed', async () => {
});
// can't use testContext
test('Blocks to init with arrayIndices not an array', async () => {
test('Blocks to init with arrayIndices not an array', () => {
const context = {
lowdefy: {
pageId,
@ -92,7 +91,6 @@ test('Blocks to init with arrayIndices not an array', async () => {
};
context.State = new State(context);
context.parser = new WebParser({ context, contexts: {} });
await context.parser.init();
const rootBlock = {
blockId: 'root',
meta: {
@ -124,7 +122,7 @@ test('Blocks to init with arrayIndices not an array', async () => {
});
// can't use testContext
test('Blocks to init with undefined arrayIndices', async () => {
test('Blocks to init with undefined arrayIndices', () => {
const context = {
lowdefy: {
pageId,
@ -135,7 +133,6 @@ test('Blocks to init with undefined arrayIndices', async () => {
};
context.State = new State(context);
context.parser = new WebParser({ context, contexts: {} });
await context.parser.init();
const rootBlock = {
blockId: 'root',
meta: {
@ -165,7 +162,7 @@ test('Blocks to init with undefined arrayIndices', async () => {
expect(context.RootBlocks).toBeDefined();
});
test('set block enforceType value no init', async () => {
test('set block enforceType value no init', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -186,7 +183,7 @@ test('set block enforceType value no init', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -195,7 +192,7 @@ test('set block enforceType value no init', async () => {
expect(context.state).toEqual({ selector: [] });
});
test('set block value to initValue in meta', async () => {
test('set block value to initValue in meta', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -219,7 +216,7 @@ test('set block value to initValue in meta', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -228,7 +225,7 @@ test('set block value to initValue in meta', async () => {
expect(context.state).toEqual({ object_one: { a: 1 } });
});
test('Reset to change blocks back to initState', async () => {
test('Reset to change blocks back to initState', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -249,7 +246,7 @@ test('Reset to change blocks back to initState', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { b: 'b' },
@ -269,7 +266,7 @@ test('Reset to change blocks back to initState', async () => {
expect(context.state).toEqual({ textInput: null, b: 'b' });
});
test('state should not have value if block is not visible', async () => {
test('state should not have value if block is not visible', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -291,7 +288,7 @@ test('state should not have value if block is not visible', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -300,7 +297,7 @@ test('state should not have value if block is not visible', async () => {
expect(context.state).toEqual({});
});
test('block should only not be visible when visible === false', async () => {
test('block should only not be visible when visible === false', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -438,7 +435,7 @@ test('block should only not be visible when visible === false', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: {
@ -475,7 +472,7 @@ test('block should only not be visible when visible === false', async () => {
});
});
test('block should only not be evaluated when visible === false', async () => {
test('block should only not be evaluated when visible === false', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -683,7 +680,7 @@ test('block should only not be evaluated when visible === false', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: {
@ -720,7 +717,7 @@ test('block should only not be evaluated when visible === false', async () => {
expect(context.RootBlocks.map.n.eval.properties).toEqual({ title: 'test' });
});
test('set value from block', async () => {
test('set value from block', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -741,7 +738,7 @@ test('set value from block', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -755,7 +752,7 @@ test('set value from block', async () => {
expect(context.state).toEqual({ swtch: true });
});
test('set value from block in nested object', async () => {
test('set value from block in nested object', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -776,7 +773,7 @@ test('set value from block in nested object', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -790,7 +787,7 @@ test('set value from block in nested object', async () => {
expect(context.state).toEqual({ a: { b: { c: 'Hello' } } });
});
test('set value from block with type enforceType', async () => {
test('set value from block with type enforceType', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -811,7 +808,7 @@ test('set value from block with type enforceType', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { textInput: 'a' },
@ -831,7 +828,7 @@ test('set value from block with type enforceType', async () => {
expect(context.state).toEqual({ textInput: null });
});
test('parse visible operator with setValue', async () => {
test('parse visible operator with setValue', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -862,7 +859,7 @@ test('parse visible operator with setValue', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { textA: 'show b', textB: 'b' },
@ -876,7 +873,7 @@ test('parse visible operator with setValue', async () => {
expect(context.state).toEqual({ textA: 'hide b' });
});
test('rec parse visible operator with setValue', async () => {
test('rec parse visible operator with setValue', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -916,7 +913,7 @@ test('rec parse visible operator with setValue', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { textB: 'b', textA: 'a', textC: 'c' },
@ -929,7 +926,7 @@ test('rec parse visible operator with setValue', async () => {
expect(context.state).toEqual({ textA: 'show b', textB: 'b', textC: 'c' });
});
test('non-input blocks visibility toggle', async () => {
test('non-input blocks visibility toggle', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -958,7 +955,7 @@ test('non-input blocks visibility toggle', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { swtch: true },
@ -974,7 +971,7 @@ test('non-input blocks visibility toggle', async () => {
expect(button.visibleEval.output).toEqual(true);
});
test('non-input blocks visibility toggle in array', async () => {
test('non-input blocks visibility toggle in array', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -1017,7 +1014,7 @@ test('non-input blocks visibility toggle in array', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: [{ swtch: true }, { swtch: false }] },
@ -1038,7 +1035,7 @@ test('non-input blocks visibility toggle in array', async () => {
expect(button1.visibleEval.output).toEqual(false);
});
test('no need to evaluate invisible blocks', async () => {
test('no need to evaluate invisible blocks', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -1070,7 +1067,7 @@ test('no need to evaluate invisible blocks', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { swtch: true },
@ -1090,7 +1087,7 @@ test('no need to evaluate invisible blocks', async () => {
});
// TODO: Check again
test('max recuse limit', async () => {
test('max recuse limit', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -1139,7 +1136,7 @@ test('max recuse limit', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { a: 'a', d: 'd', e: 'e' },

View File

@ -1,17 +1,17 @@
/*
Copyright 2020-2022 Lowdefy, Inc
Copyright 2020-2022 Lowdefy, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import testContext from '../testContext.js';
@ -19,7 +19,7 @@ import testContext from '../testContext.js';
const pageId = 'one';
const lowdefy = { pageId };
test('two areas in block', async () => {
test('two areas in block', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -52,7 +52,7 @@ test('two areas in block', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -69,7 +69,7 @@ test('two areas in block', async () => {
expect(context.state).toEqual({ swtch1: true, swtch2: true });
});
test('parse values across areas', async () => {
test('parse values across areas', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -126,7 +126,7 @@ test('parse values across areas', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -153,7 +153,7 @@ test('parse values across areas', async () => {
expect(context.state).toEqual({ field: true, hide1: true, hide2: false });
});
test('areas inside list', async () => {
test('areas inside list', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -200,7 +200,7 @@ test('areas inside list', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -1,19 +1,19 @@
/* eslint-disable dot-notation */
/*
Copyright 2020-2022 Lowdefy, Inc
Copyright 2020-2022 Lowdefy, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import testContext from '../testContext.js';
@ -46,7 +46,7 @@ const runTests = ({ times, results = [], fn }) => {
}
};
test(`parse nunjucks value 500 blocks`, async () => {
test(`parse nunjucks value 500 blocks`, () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -83,7 +83,7 @@ test(`parse nunjucks value 500 blocks`, async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -105,7 +105,7 @@ test(`parse nunjucks value 500 blocks`, async () => {
expect(Object.keys(context.state).length).toEqual(501);
});
test(`parse nunjucks value 100 blocks`, async () => {
test(`parse nunjucks value 100 blocks`, () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -142,7 +142,7 @@ test(`parse nunjucks value 100 blocks`, async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -164,7 +164,7 @@ test(`parse nunjucks value 100 blocks`, async () => {
expect(Object.keys(context.state).length).toEqual(101);
});
test(`parse state value 1000 blocks`, async () => {
test(`parse state value 1000 blocks`, () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -201,7 +201,7 @@ test(`parse state value 1000 blocks`, async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -255,7 +255,7 @@ test(`parse state value 1000 blocks`, async () => {
// })),
// ],}}
// };
// const context = await testContext({
// const context = testContext({
// rootContext,
// rootBlock,
// pageId,

View File

@ -1,17 +1,17 @@
/*
Copyright 2020-2022 Lowdefy, Inc
Copyright 2020-2022 Lowdefy, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import testContext from '../testContext.js';
@ -19,7 +19,7 @@ import testContext from '../testContext.js';
const pageId = 'one';
const lowdefy = { pageId };
test('container and set value from block', async () => {
test('container and set value from block', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -74,7 +74,7 @@ test('container and set value from block', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { textB: 'b' },
@ -90,7 +90,7 @@ test('container and set value from block', async () => {
expect(context.state).toEqual({ textA: 'Hello', textB: 'b' });
});
test('container blocks visibility toggle fields in state and propagate visibility to children', async () => {
test('container blocks visibility toggle fields in state and propagate visibility to children', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -142,7 +142,7 @@ test('container blocks visibility toggle fields in state and propagate visibilit
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { text: 'a', swtch1: true, swtch2: true },
@ -168,7 +168,7 @@ test('container blocks visibility toggle fields in state and propagate visibilit
expect(context.state).toEqual({ text: 'a', swtch1: true, swtch2: true });
});
test('container blocks visibility toggle fields in state with nested containers and propagate visibility to children', async () => {
test('container blocks visibility toggle fields in state with nested containers and propagate visibility to children', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -233,7 +233,7 @@ test('container blocks visibility toggle fields in state with nested containers
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { text: 'a', swtch1: true, swtch2: true },
@ -261,7 +261,7 @@ test('container blocks visibility toggle fields in state with nested containers
expect(context.state).toEqual({ text: 'a', swtch1: true, swtch2: true });
});
test('visibleParent. If container visible is null, child blocks should still be evaluated', async () => {
test('visibleParent. If container visible is null, child blocks should still be evaluated', () => {
const rootBlock = {
blockId: 'root',
type: 'Context',
@ -299,7 +299,7 @@ test('visibleParent. If container visible is null, child blocks should still be
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -1,19 +1,19 @@
/* eslint-disable dot-notation */
/*
Copyright 2020-2022 Lowdefy, Inc
Copyright 2020-2022 Lowdefy, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import testContext from '../testContext.js';
@ -21,7 +21,7 @@ import testContext from '../testContext.js';
const pageId = 'one';
const lowdefy = { pageId };
test('parse block visible', async () => {
test('parse block visible', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -43,7 +43,7 @@ test('parse block visible', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { key: 'value' },
@ -53,7 +53,7 @@ test('parse block visible', async () => {
expect(textInput.eval.visible).toEqual('value');
});
test('default value for visible', async () => {
test('default value for visible', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -74,7 +74,7 @@ test('default value for visible', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { key: 'value' },
@ -84,7 +84,7 @@ test('default value for visible', async () => {
expect(textInput.eval.visible).toEqual(true);
});
test('parse block required', async () => {
test('parse block required', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -106,7 +106,7 @@ test('parse block required', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { key: 'value' },
@ -116,7 +116,7 @@ test('parse block required', async () => {
expect(textInput.eval.required).toEqual('value');
});
test('default value for required', async () => {
test('default value for required', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -137,7 +137,7 @@ test('default value for required', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { key: 'value' },
@ -147,7 +147,7 @@ test('default value for required', async () => {
expect(textInput.eval.required).toEqual(false);
});
test('parse block properties', async () => {
test('parse block properties', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -169,7 +169,7 @@ test('parse block properties', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { key: 'value' },
@ -179,7 +179,7 @@ test('parse block properties', async () => {
expect(textInput.eval.properties).toEqual('value');
});
test('default value for properties', async () => {
test('default value for properties', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -200,7 +200,7 @@ test('default value for properties', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { key: 'value' },
@ -210,7 +210,7 @@ test('default value for properties', async () => {
expect(textInput.eval.properties).toEqual({});
});
test('parse block style', async () => {
test('parse block style', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -232,7 +232,7 @@ test('parse block style', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { key: 'value' },
@ -242,7 +242,7 @@ test('parse block style', async () => {
expect(textInput.eval.style).toEqual('value');
});
test('default value for style', async () => {
test('default value for style', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -263,7 +263,7 @@ test('default value for style', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { key: 'value' },
@ -273,7 +273,7 @@ test('default value for style', async () => {
expect(textInput.eval.style).toEqual({});
});
test('parse block layout', async () => {
test('parse block layout', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -295,7 +295,7 @@ test('parse block layout', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { key: 'value' },
@ -305,7 +305,7 @@ test('parse block layout', async () => {
expect(textInput.eval.layout).toEqual('value');
});
test('default value for layout', async () => {
test('default value for layout', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -326,7 +326,7 @@ test('default value for layout', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { key: 'value' },
@ -336,7 +336,7 @@ test('default value for layout', async () => {
expect(textInput.eval.layout).toEqual({});
});
test('parse block areas', async () => {
test('parse block areas', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -362,7 +362,7 @@ test('parse block areas', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { key: 'value' },
@ -375,7 +375,7 @@ test('parse block areas', async () => {
});
});
test('parse block areas, remove blocks array', async () => {
test('parse block areas, remove blocks array', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -411,7 +411,7 @@ test('parse block areas, remove blocks array', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { key: 'value' },
@ -424,7 +424,7 @@ test('parse block areas, remove blocks array', async () => {
});
});
test('default value for areas', async () => {
test('default value for areas', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -445,7 +445,7 @@ test('default value for areas', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { key: 'value' },
@ -453,3 +453,129 @@ test('default value for areas', async () => {
const { textInput } = context.RootBlocks.map;
expect(textInput.eval.areas).toEqual({});
});
test('parse block loading', () => {
const rootBlock = {
blockId: 'root',
meta: {
category: 'container',
},
areas: {
content: {
blocks: [
{
type: 'TextInput',
blockId: 'textInput',
meta: {
category: 'input',
valueType: 'string',
},
loading: { _state: 'key' },
},
],
},
},
};
const context = testContext({
lowdefy,
rootBlock,
initState: { key: false },
});
const { textInput } = context.RootBlocks.map;
expect(textInput.loading).toEqual({ _state: 'key' });
expect(textInput.eval.loading).toEqual(true);
});
test('default value for loading', () => {
const rootBlock = {
blockId: 'root',
meta: {
category: 'container',
},
areas: {
content: {
blocks: [
{
type: 'TextInput',
blockId: 'textInput',
meta: {
category: 'input',
valueType: 'string',
},
},
],
},
},
};
const context = testContext({
lowdefy,
rootBlock,
initState: { key: 'value' },
});
const { textInput } = context.RootBlocks.map;
expect(textInput.loading).toEqual({});
expect(textInput.eval.loading).toEqual(false);
});
test('parse block skeleton', () => {
const rootBlock = {
blockId: 'root',
meta: {
category: 'container',
},
areas: {
content: {
blocks: [
{
type: 'TextInput',
blockId: 'textInput',
meta: {
category: 'input',
valueType: 'string',
},
skeleton: { _state: 'key' },
},
],
},
},
};
const context = testContext({
lowdefy,
rootBlock,
initState: { key: false },
});
const { textInput } = context.RootBlocks.map;
expect(textInput.skeleton).toEqual({ _state: 'key' });
expect(textInput.eval.skeleton).toEqual(false);
});
test('default value for skeleton', () => {
const rootBlock = {
blockId: 'root',
meta: {
category: 'container',
},
areas: {
content: {
blocks: [
{
type: 'TextInput',
blockId: 'textInput',
meta: {
category: 'input',
valueType: 'string',
},
},
],
},
},
};
const context = testContext({
lowdefy,
rootBlock,
initState: { key: 'value' },
});
const { textInput } = context.RootBlocks.map;
expect(textInput.skeleton).toEqual({});
expect(textInput.eval.skeleton).toEqual(null);
});

View File

@ -1,17 +1,17 @@
/*
Copyright 2020-2022 Lowdefy, Inc
Copyright 2020-2022 Lowdefy, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import testContext from '../testContext.js';
@ -19,7 +19,7 @@ import testContext from '../testContext.js';
const pageId = 'one';
const lowdefy = { pageId };
test('set value to block field', async () => {
test('set value to block field', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -41,7 +41,7 @@ test('set value to block field', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -55,7 +55,7 @@ test('set value to block field', async () => {
expect(context.state).toEqual({ field: true });
});
test('array block with init, save to field', async () => {
test('array block with init, save to field', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -92,7 +92,7 @@ test('array block with init, save to field', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { field: [{ text: 'b' }] },
@ -100,7 +100,7 @@ test('array block with init, save to field', async () => {
expect(context.state).toEqual({ field: [{ text: 'b' }] });
});
test('two blocks with same field should have the same value', async () => {
test('two blocks with same field should have the same value', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -131,7 +131,7 @@ test('two blocks with same field should have the same value', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -151,7 +151,7 @@ test('two blocks with same field should have the same value', async () => {
expect(context.state).toEqual({ field: false });
});
test('two blocks with same field visibility and state', async () => {
test('two blocks with same field visibility and state', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -200,7 +200,7 @@ test('two blocks with same field visibility and state', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { field: 'field', swtch2: true, swtch1: true },

View File

@ -1,17 +1,17 @@
/*
Copyright 2020-2022 Lowdefy, Inc
Copyright 2020-2022 Lowdefy, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import testContext from '../testContext.js';
@ -19,7 +19,7 @@ import testContext from '../testContext.js';
const pageId = 'one';
const lowdefy = { pageId };
test('list block no init', async () => {
test('list block no init', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -54,7 +54,7 @@ test('list block no init', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -63,7 +63,7 @@ test('list block no init', async () => {
expect(context.state).toEqual({ list: [] });
});
test('list block with init', async () => {
test('list block with init', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -98,7 +98,7 @@ test('list block with init', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: [{ text: 'hello' }] },
@ -108,7 +108,7 @@ test('list block with init', async () => {
expect(context.state).toEqual({ list: [{ text: 'hello' }] });
});
test('list block init with non array', async () => {
test('list block init with non array', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -143,7 +143,7 @@ test('list block init with non array', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: 'hello' },
@ -151,7 +151,7 @@ test('list block init with non array', async () => {
expect(context.state).toEqual({ list: [] });
});
test('list block no init push item', async () => {
test('list block no init push item', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -186,7 +186,7 @@ test('list block no init push item', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -201,7 +201,7 @@ test('list block no init push item', async () => {
expect(context.state).toEqual({ list: [{ text: null }] });
});
test('list block with init move item up', async () => {
test('list block with init move item up', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -236,7 +236,7 @@ test('list block with init move item up', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: [0, 1, 2, 3, 4, 5] },
@ -249,7 +249,7 @@ test('list block with init move item up', async () => {
expect(context.state).toEqual({ list: [1, 0, 2, 3, 4, 5] });
});
test('list block with init move item down', async () => {
test('list block with init move item down', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -284,7 +284,7 @@ test('list block with init move item down', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: [0, 1, 2, 3, 4, 5] },
@ -297,7 +297,7 @@ test('list block with init move item down', async () => {
expect(context.state).toEqual({ list: [0, 2, 1, 3, 4, 5] });
});
test('list block no init unshift item to start', async () => {
test('list block no init unshift item to start', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -332,7 +332,7 @@ test('list block no init unshift item to start', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -369,7 +369,7 @@ test('list block no init unshift item to start', async () => {
expect(newText0.value).toEqual(null);
});
test('list block no init unshift item to start, block id not in array', async () => {
test('list block no init unshift item to start, block id not in array', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -404,7 +404,7 @@ test('list block no init unshift item to start, block id not in array', async ()
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -430,7 +430,7 @@ test('list block no init unshift item to start, block id not in array', async ()
expect(context.state).toEqual({ other: [null, 'first'] });
});
test('list block unshift item clear all previous values', async () => {
test('list block unshift item clear all previous values', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -487,7 +487,7 @@ test('list block unshift item clear all previous values', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: {
@ -535,7 +535,7 @@ test('list block unshift item clear all previous values', async () => {
});
});
test('list block with init push item', async () => {
test('list block with init push item', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -570,7 +570,7 @@ test('list block with init push item', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: [{ text: 'a' }] },
@ -581,7 +581,7 @@ test('list block with init push item', async () => {
expect(context.state).toEqual({ list: [{ text: 'a' }, { text: null }] });
});
test('list block with init including extra data and push item', async () => {
test('list block with init including extra data and push item', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -616,7 +616,7 @@ test('list block with init including extra data and push item', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: [{ b: 'b', c: 'c' }], d: 'd' },
@ -627,7 +627,7 @@ test('list block with init including extra data and push item', async () => {
expect(context.state).toEqual({ list: [{ b: 'b', c: 'c' }, { b: null }], d: 'd' });
});
test('list block no init push item, with enforced input type', async () => {
test('list block no init push item, with enforced input type', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -662,7 +662,7 @@ test('list block no init push item, with enforced input type', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -672,7 +672,7 @@ test('list block no init push item, with enforced input type', async () => {
expect(context.state).toEqual({ list: [{ text: null }] });
});
test('list block with rec visible in parent blocks', async () => {
test('list block with rec visible in parent blocks', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -730,7 +730,7 @@ test('list block with rec visible in parent blocks', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: [{ b: 'b', a: 'a' }], c: 'c' },
@ -741,7 +741,7 @@ test('list block with rec visible in parent blocks', async () => {
expect(context.state).toEqual({ list: [{ b: 'b', a: 'show b' }], c: 'c' });
});
test('list block with visible', async () => {
test('list block with visible', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -785,7 +785,7 @@ test('list block with visible', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: [{ a: 'a' }], swtch: true },
@ -799,7 +799,7 @@ test('list block with visible', async () => {
expect(context.state).toEqual({ list: [{ a: 'a' }], swtch: true });
});
test('toggle list object field visibility with index', async () => {
test('toggle list object field visibility with index', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -843,7 +843,7 @@ test('toggle list object field visibility with index', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: {
@ -867,7 +867,7 @@ test('toggle list object field visibility with index', async () => {
expect(context.state).toEqual({ list: [{ text: 'a1', swtch: true }, { swtch: false }] });
});
test('primitive list block no init', async () => {
test('primitive list block no init', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -916,14 +916,14 @@ test('primitive list block no init', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
expect(context.state).toEqual({ list: [] });
});
test('primitive list block with init', async () => {
test('primitive list block with init', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -958,7 +958,7 @@ test('primitive list block with init', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: [1, 2, 3] },
@ -968,7 +968,7 @@ test('primitive list block with init', async () => {
expect(context.state).toEqual({ list: [1, 2, 3] });
});
test('primitive list block with init, push item and setValue', async () => {
test('primitive list block with init, push item and setValue', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -1003,7 +1003,7 @@ test('primitive list block with init, push item and setValue', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: [1, 2, 3] },
@ -1017,7 +1017,7 @@ test('primitive list block with init, push item and setValue', async () => {
expect(context.state).toEqual({ list: [1, 2, 3, -1] });
});
test('primitive list block with init, push item and setValue', async () => {
test('primitive list block with init, push item and setValue', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -1052,7 +1052,7 @@ test('primitive list block with init, push item and setValue', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: [1, 2, 3] },
@ -1066,7 +1066,7 @@ test('primitive list block with init, push item and setValue', async () => {
expect(context.state).toEqual({ list: [1, 2, 3, -1] });
});
test('primitive list block with init and push item with enforced input type', async () => {
test('primitive list block with init and push item with enforced input type', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -1101,7 +1101,7 @@ test('primitive list block with init and push item with enforced input type', as
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: [true, true, true] },
@ -1112,7 +1112,7 @@ test('primitive list block with init and push item with enforced input type', as
expect(context.state).toEqual({ list: [true, true, true, false] });
});
test('list block with nested primitive array with init, push item enforced type on inputs and setValue', async () => {
test('list block with nested primitive array with init, push item enforced type on inputs and setValue', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -1169,7 +1169,7 @@ test('list block with nested primitive array with init, push item enforced type
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: [{ innerList: [true, true, true], text: 'text' }] },
@ -1201,7 +1201,7 @@ test('list block with nested primitive array with init, push item enforced type
});
});
test('list block with nested primitive array with init, push item and setValue', async () => {
test('list block with nested primitive array with init, push item and setValue', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -1258,7 +1258,7 @@ test('list block with nested primitive array with init, push item and setValue',
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: [{ innerList: [1, 2, 3], text: 'text' }] },
@ -1290,7 +1290,7 @@ test('list block with nested primitive array with init, push item and setValue',
});
});
test('list block with init remove item of first item and more than two values', async () => {
test('list block with init remove item of first item and more than two values', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -1325,7 +1325,7 @@ test('list block with init remove item of first item and more than two values',
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: [{ text: '0' }, { text: '1' }, { text: '2' }] },
@ -1341,7 +1341,7 @@ test('list block with init remove item of first item and more than two values',
expect(listSubblocksList.length).toEqual(2);
});
test('list block remove item, add item does not have previous item value ', async () => {
test('list block remove item, add item does not have previous item value ', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -1376,7 +1376,7 @@ test('list block remove item, add item does not have previous item value ', asyn
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: [{ text: '0' }] },
@ -1394,7 +1394,7 @@ test('list block remove item, add item does not have previous item value ', asyn
expect(listSubblocksList.length).toEqual(1);
});
test('list block with init remove item and set existing item values', async () => {
test('list block with init remove item and set existing item values', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -1429,7 +1429,7 @@ test('list block with init remove item and set existing item values', async () =
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: [{ text: '0' }, { text: '1' }, { text: '2' }] },
@ -1460,7 +1460,7 @@ test('list block with init remove item and set existing item values', async () =
expect(listSubblocksList.length).toEqual(3);
});
test('primitive list block with init remove item', async () => {
test('primitive list block with init remove item', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -1495,7 +1495,7 @@ test('primitive list block with init remove item', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { list: [0, 1, 2, 3, 4, 5, 6, 7] },
@ -1530,7 +1530,7 @@ test('primitive list block with init remove item', async () => {
expect(context.state).toEqual({ list: [0, 1, 2, 30, 50, 6, 7, null] });
});
test('nested list', async () => {
test('nested list', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -1637,7 +1637,7 @@ test('nested list', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: {

View File

@ -1,19 +1,19 @@
/* eslint-disable dot-notation */
/*
Copyright 2020-2022 Lowdefy, Inc
Copyright 2020-2022 Lowdefy, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import testContext from '../testContext.js';
@ -21,7 +21,7 @@ import testContext from '../testContext.js';
const pageId = 'one';
const lowdefy = { pageId };
test('all nested blocks present in map', async () => {
test('all nested blocks present in map', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -120,7 +120,7 @@ test('all nested blocks present in map', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: {
@ -150,7 +150,7 @@ test('all nested blocks present in map', async () => {
});
});
test('unshiftItem item in list updates map', async () => {
test('unshiftItem item in list updates map', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -185,7 +185,7 @@ test('unshiftItem item in list updates map', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: {
@ -214,7 +214,7 @@ test('unshiftItem item in list updates map', async () => {
expect(originalL1).toBe(newL2);
});
test('pushItem item in list updates map', async () => {
test('pushItem item in list updates map', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -249,7 +249,7 @@ test('pushItem item in list updates map', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: {
@ -268,7 +268,7 @@ test('pushItem item in list updates map', async () => {
expect(context.RootBlocks.map['list.1'].blockId).toEqual('list.1');
});
test('removeItem in list updates map', async () => {
test('removeItem in list updates map', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -303,7 +303,7 @@ test('removeItem in list updates map', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: {
@ -352,7 +352,7 @@ test('removeItem in list updates map', async () => {
expect(Object.keys(context.RootBlocks.map)).toEqual(['root', 'list']);
});
test('moveItemUp in list updates map', async () => {
test('moveItemUp in list updates map', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -387,7 +387,7 @@ test('moveItemUp in list updates map', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: {
@ -440,7 +440,7 @@ test('moveItemUp in list updates map', async () => {
expect(context.RootBlocks.map['list.3']).toBe(L3);
});
test('moveItemDown in list updates map', async () => {
test('moveItemDown in list updates map', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -475,7 +475,7 @@ test('moveItemDown in list updates map', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: {

View File

@ -1,17 +1,17 @@
/*
Copyright 2020-2022 Lowdefy, Inc
Copyright 2020-2022 Lowdefy, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import testContext from '../testContext.js';
@ -20,7 +20,7 @@ const pageId = 'one';
const lowdefy = { pageId };
test('registerMethod adds a method to RootBlocks.methods', async () => {
test('registerMethod adds a method to RootBlocks.methods', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -41,7 +41,7 @@ test('registerMethod adds a method to RootBlocks.methods', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -55,7 +55,7 @@ test('registerMethod adds a method to RootBlocks.methods', async () => {
expect(text.methods.fn()).toEqual('fn response');
});
test('registerMethod add multiple methods to RootBlocks.methods', async () => {
test('registerMethod add multiple methods to RootBlocks.methods', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -84,7 +84,7 @@ test('registerMethod add multiple methods to RootBlocks.methods', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -24,7 +24,7 @@ const lowdefy = { pageId };
console.log = () => {};
console.error = () => {};
test('parse validate on fields', async () => {
test('parse validate on fields', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -55,7 +55,7 @@ test('parse validate on fields', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { text: 'a' },
@ -87,7 +87,7 @@ test('parse validate on fields', async () => {
});
});
test('validate should fail if parser has errors', async () => {
test('validate should fail if parser has errors', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -114,7 +114,7 @@ test('validate should fail if parser has errors', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -129,7 +129,7 @@ test('validate should fail if parser has errors', async () => {
expect(text.validationEval.errors.length > 0).toBe(true);
});
test('validate, only test where parser failed should fail', async () => {
test('validate, only test where parser failed should fail', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -160,7 +160,7 @@ test('validate, only test where parser failed should fail', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -174,7 +174,7 @@ test('validate, only test where parser failed should fail', async () => {
});
});
test('parse validate, validate an object not an array', async () => {
test('parse validate, validate an object not an array', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -201,7 +201,7 @@ test('parse validate, validate an object not an array', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { text: 'a' },
@ -220,7 +220,7 @@ test('parse validate, validate an object not an array', async () => {
expect(text.eval.validation).toEqual({ errors: [], status: 'success', warnings: [] });
});
test('RootBlock.validate(match) to ignore errors where field not visible', async () => {
test('RootBlock.validate(match) to ignore errors where field not visible', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -279,7 +279,7 @@ test('RootBlock.validate(match) to ignore errors where field not visible', async
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -348,7 +348,7 @@ test('RootBlock.validate(match) to ignore errors where field not visible', async
]);
});
test('required on input to return validation error on RootBlock.validate(match)', async () => {
test('required on input to return validation error on RootBlock.validate(match)', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -370,7 +370,7 @@ test('required on input to return validation error on RootBlock.validate(match)'
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -395,7 +395,7 @@ test('required on input to return validation error on RootBlock.validate(match)'
]);
});
test('required on input to return validation error with priority over validation errors on RootBlock.validate(match)', async () => {
test('required on input to return validation error with priority over validation errors on RootBlock.validate(match)', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -424,7 +424,7 @@ test('required on input to return validation error with priority over validation
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -468,7 +468,7 @@ test('required on input to return validation error with priority over validation
]);
});
test('nested arrays with validate, and RootBlock.validate(match) returns all validation errors', async () => {
test('nested arrays with validate, and RootBlock.validate(match) returns all validation errors', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -560,7 +560,7 @@ test('nested arrays with validate, and RootBlock.validate(match) returns all val
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: {
@ -761,7 +761,7 @@ test('nested arrays with validate, and RootBlock.validate(match) returns all val
]);
});
test('validation warnings', async () => {
test('validation warnings', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -794,7 +794,7 @@ test('validation warnings', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { text: 'a' },
@ -830,7 +830,7 @@ test('validation warnings', async () => {
});
});
test('showValidation only on fields that matches for error', async () => {
test('showValidation only on fields that matches for error', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -871,7 +871,7 @@ test('showValidation only on fields that matches for error', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { text1: '3' },
@ -894,7 +894,7 @@ test('showValidation only on fields that matches for error', async () => {
expect(text2.eval.validation).toEqual({ errors: ["Not '2'"], status: null, warnings: [] });
});
test('showValidation only on fields that matches for warning', async () => {
test('showValidation only on fields that matches for warning', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -937,7 +937,7 @@ test('showValidation only on fields that matches for warning', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { text1: '3' },
@ -960,7 +960,7 @@ test('showValidation only on fields that matches for warning', async () => {
expect(text2.eval.validation).toEqual({ warnings: ["Not '2'"], status: null, errors: [] });
});
test('showValidation only on fields that matches for success', async () => {
test('showValidation only on fields that matches for success', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -1003,7 +1003,7 @@ test('showValidation only on fields that matches for success', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { text1: '1' },
@ -1026,7 +1026,7 @@ test('showValidation only on fields that matches for success', async () => {
expect(text2.eval.validation).toEqual({ warnings: [], status: null, errors: ["Not '2'"] });
});
test('drop showValidation on RootBlocks.reset()', async () => {
test('drop showValidation on RootBlocks.reset()', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -1069,7 +1069,7 @@ test('drop showValidation on RootBlocks.reset()', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { text1: '1' },
@ -1087,7 +1087,7 @@ test('drop showValidation on RootBlocks.reset()', async () => {
expect(text2.showValidation).toBe(false);
});
test('drop showValidation on RootBlocks.resetValidation()', async () => {
test('drop showValidation on RootBlocks.resetValidation()', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -1130,7 +1130,7 @@ test('drop showValidation on RootBlocks.resetValidation()', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { text1: '1' },

View File

@ -102,7 +102,7 @@ test('init Events', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -139,7 +139,7 @@ test('triggerEvent no event defined', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -183,7 +183,7 @@ test('triggerEvent x1', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -249,7 +249,7 @@ test('triggerEvent, 2 actions', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -290,7 +290,7 @@ test('triggerEvent error', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -351,7 +351,7 @@ test('registerEvent then triggerEvent x1', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -414,7 +414,7 @@ test('triggerEvent skip', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { textInput: 'init' },
@ -516,7 +516,7 @@ test('triggerEvent skip tests === true', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState: { textInput: 'init' },
@ -594,7 +594,7 @@ test('triggerEvent skip tests === true', async () => {
`);
});
test('Actions array defaults', async () => {
test('Actions array defaults', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -618,7 +618,7 @@ test('Actions array defaults', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -633,7 +633,7 @@ test('Actions array defaults', async () => {
});
});
test('Actions try catch array defaults', async () => {
test('Actions try catch array defaults', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -660,7 +660,7 @@ test('Actions try catch array defaults', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -670,7 +670,7 @@ test('Actions try catch array defaults', async () => {
});
});
test('Actions try catch arrays', async () => {
test('Actions try catch arrays', () => {
const rootBlock = {
blockId: 'root',
meta: {
@ -697,7 +697,7 @@ test('Actions try catch arrays', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -742,7 +742,7 @@ test('Actions try catch arrays and debounce.immediate == true (leading edge)', a
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -864,7 +864,7 @@ test('Actions try catch arrays and debounce.immediate == undefined (trailing edg
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -982,7 +982,7 @@ test('Actions try catch arrays and debounce.immediate == false default ms (trail
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -97,7 +97,7 @@ beforeEach(() => {
});
test('callRequest', async () => {
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -112,7 +112,7 @@ test('callRequest', async () => {
});
test('callRequest, payload operators are evaluated', async () => {
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
initState,
@ -136,7 +136,7 @@ test('callRequest, payload operators are evaluated', async () => {
});
test('callRequests all requests', async () => {
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -189,7 +189,7 @@ test('callRequests all requests', async () => {
});
test('callRequests', async () => {
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -218,7 +218,7 @@ test('callRequests', async () => {
});
test('callRequest error', async () => {
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -241,7 +241,7 @@ test('callRequest error', async () => {
});
test('callRequest request does not exist', async () => {
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -259,7 +259,7 @@ test('callRequest request does not exist', async () => {
test('update function should be called', async () => {
const updateFunction = jest.fn();
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -270,7 +270,7 @@ test('update function should be called', async () => {
test('update function should be called if error', async () => {
const updateFunction = jest.fn();
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -284,20 +284,16 @@ test('update function should be called if error', async () => {
expect(updateFunction).toHaveBeenCalledTimes(1);
});
test('fetch should set blocks loading and call query every time it is called', async () => {
const context = await testContext({
test('fetch should set call query every time it is called', async () => {
const context = testContext({
lowdefy,
rootBlock,
});
const setBlocksLoadingCacheFunction = jest.fn();
context.RootBlocks = {
setBlocksLoadingCache: setBlocksLoadingCacheFunction,
update: jest.fn(),
};
await context.Requests.callRequest({ requestId: 'req_one', onlyNew: true });
expect(setBlocksLoadingCacheFunction).toHaveBeenCalledTimes(1);
expect(mockCallRequest).toHaveBeenCalledTimes(1);
context.Requests.fetch({ requestId: 'req_one' });
expect(setBlocksLoadingCacheFunction).toHaveBeenCalledTimes(2);
expect(mockCallRequest).toHaveBeenCalledTimes(2);
});

View File

@ -51,7 +51,7 @@ test('memoize context', async () => {
expect(c1).toBe(c2);
});
test('create context', async () => {
test('create context', () => {
const lowdefy = {
client: { client: true },
contexts: {},
@ -72,7 +72,7 @@ test('create context', async () => {
type: 'container',
},
};
const context = await getContext({ page, lowdefy });
const context = getContext({ page, lowdefy });
expect(context.Actions).toBeDefined();
expect(context.Requests).toBeDefined();
expect(context.RootBlocks).toBeDefined();
@ -89,7 +89,7 @@ test('create context', async () => {
expect(context.update).toBeDefined();
});
test('create context, initialize input', async () => {
test('create context, initialize input', () => {
const lowdefy = {
client: { client: true },
contexts: {},
@ -110,11 +110,11 @@ test('create context, initialize input', async () => {
type: 'container',
},
};
const context = await getContext({ page, lowdefy });
const context = getContext({ page, lowdefy });
expect(context.lowdefy.inputs.pageId).toEqual({});
});
test('update memoized context', async () => {
test('update memoized context', () => {
const lowdefy = {
client,
contexts: {},
@ -130,8 +130,8 @@ test('update memoized context', async () => {
},
};
const mockUpdate = jest.fn();
const c1 = await getContext({ page, lowdefy });
const c1 = getContext({ page, lowdefy });
c1.update = mockUpdate;
await getContext({ page, lowdefy });
getContext({ page, lowdefy });
expect(mockUpdate.mock.calls.length).toBe(1);
});

View File

@ -1,47 +0,0 @@
/*
Copyright 2020-2022 Lowdefy, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import getFieldValues from '../src/getFieldValues.js';
test('single object', () => {
expect(getFieldValues('_req', { _req: 1 })).toEqual([1]);
});
test('multiple objects', () => {
expect(getFieldValues('_req', { _req: 1 }, { _req: 2 }, { _req: 1 }, { _req: 4 })).toEqual([
1, 2, 4,
]);
});
test('multiple arrays', () => {
expect(
getFieldValues('_req', [{ _req: 1 }], [{ _req: 2 }], [{ _req: 1 }], [{ _req: 4 }])
).toEqual([1, 2, 4]);
});
test('multiple mixed', () => {
expect(getFieldValues('_req', [{ _req: 1 }], { _req: 2 }, { _req: 1 }, [{ _req: 4 }])).toEqual([
1, 2, 4,
]);
});
test('get on object of operator', () => {
const data = {
a: '1',
defaultValue: { _request: 'a' },
};
expect(getFieldValues('defaultValue', data)).toEqual([{ _request: 'a' }]);
});

View File

@ -21,7 +21,7 @@ import Blocks from '../src/Blocks.js';
import Requests from '../src/Requests.js';
import State from '../src/State.js';
const testContext = async ({ lowdefy, operators, rootBlock, initState = {} }) => {
const testContext = ({ lowdefy, operators, rootBlock, initState = {} }) => {
const testLowdefy = {
inputs: { test: {} },
urlQuery: {},
@ -45,7 +45,6 @@ const testContext = async ({ lowdefy, operators, rootBlock, initState = {} }) =>
};
const _internal = ctx._internal;
_internal.parser = new WebParser({ context: ctx, contexts: {}, operators: operators || {} });
await _internal.parser.init();
_internal.State = new State(ctx);
_internal.Actions = new Actions(ctx);
_internal.Requests = new Requests(ctx);

View File

@ -95,7 +95,6 @@ const AutoBlock = ({ block, makeCssClass, highlightBorders }) => {
<Comp
blockId={block.id + randomId()}
content={content}
loading={block.loading}
makeCssClass={makeCssClass}
properties={block.properties}
/>
@ -104,7 +103,6 @@ const AutoBlock = ({ block, makeCssClass, highlightBorders }) => {
return (
<Comp
blockId={block.id + randomId()}
loading={block.loading}
makeCssClass={makeCssClass}
properties={block.properties}
/>
@ -115,7 +113,7 @@ const AutoBlock = ({ block, makeCssClass, highlightBorders }) => {
const BindAutoBlock = ({ block, state, makeCssClass, highlightBorders }) => {
return (
<ErrorBoundary>
<Loading id={`${block.id}-loading`} loading={block.loading} showLoading>
<Loading id={`${block.id}-loading`} showLoading>
<BlockLayout
id={`bl-${block.id}` + randomId()}
highlightBorders={highlightBorders}

View File

@ -26,16 +26,6 @@ class NodeParser {
this.parse = this.parse.bind(this);
}
async init() {
await Promise.all(
Object.values(this.operators).map(async (operator) => {
if (operator.init) {
await operator.init();
}
})
);
}
parse({ args, input, location, operatorPrefix = '_' }) {
const env = this.env;
const operators = this.operators;

View File

@ -45,36 +45,32 @@ const user = {
user: true,
};
test('parse input undefined', async () => {
test('parse input undefined', () => {
const parser = new NodeParser({ operators, payload });
await parser.init();
const res = parser.parse({});
expect(res.output).toEqual();
expect(res.errors).toEqual([]);
});
test('parse args not array', async () => {
test('parse args not array', () => {
const input = {};
const args = 'not an array';
const parser = new NodeParser({ operators, payload });
await parser.init();
expect(() => parser.parse({ args, input })).toThrow('Operator parser args must be an array.');
});
test('parse location not string', async () => {
test('parse location not string', () => {
const input = {};
const location = [];
const parser = new NodeParser({ operators, payload, secrets, user });
await parser.init();
expect(() => parser.parse({ args, input, location })).toThrow(
'Operator parser location must be a string.'
);
});
test('operator returns value', async () => {
test('operator returns value', () => {
const input = { a: { _test: { params: true } } };
const parser = new NodeParser({ operators, payload, secrets, user });
await parser.init();
const res = parser.parse({ args, input, location });
expect(res.output).toEqual({ a: 'test' });
expect(operators._test.mock.calls).toMatchInlineSnapshot(`
@ -149,45 +145,35 @@ test('operator returns value', async () => {
expect(res.errors).toEqual([]);
});
test('operator should be object with 1 key', async () => {
test('operator should be object with 1 key', () => {
const input = { a: { _test: { params: true }, x: 1 } };
const parser = new NodeParser({ operators, payload, secrets, user });
await parser.init();
const res = parser.parse({ args, input, location });
expect(res.output).toEqual(input);
expect(res.errors).toEqual([]);
});
test('operatorPrefix invalid', async () => {
test('operatorPrefix invalid', () => {
const input = { a: { _test: { params: true }, x: 1 } };
const operatorPrefix = 'invalid';
const parser = new NodeParser({ operators, payload, secrets, user });
await parser.init();
const res = parser.parse({ args, input, location, operatorPrefix });
expect(res.output).toEqual(input);
expect(res.errors).toEqual([]);
});
test('undefined operator', async () => {
test('undefined operator', () => {
const input = { a: { _id: { params: true } } };
const parser = new NodeParser({ operators, payload, secrets, user });
await parser.init();
const res = parser.parse({ args, input, location });
expect(res.output).toEqual(input);
expect(res.errors).toEqual([]);
});
test('operator errors', async () => {
test('operator errors', () => {
const input = { a: { _error: { params: true } } };
const parser = new NodeParser({ operators, payload, secrets, user });
await parser.init();
const res = parser.parse({ args, input, location });
expect(res.output).toEqual({ a: null });
expect(res.errors).toEqual([new Error('Test error.')]);
});
test('operator init', async () => {
const parser = new NodeParser({ operators, payload, secrets, user });
await parser.init();
expect(operators._init.init).toHaveBeenCalledTimes(1);
});

View File

@ -19,24 +19,10 @@ import { applyArrayIndices, serializer, type } from '@lowdefy/helpers';
class WebParser {
constructor({ context, operators }) {
this.context = context;
this.init = this.init.bind(this);
this.parse = this.parse.bind(this);
this.operators = operators;
}
async init() {
if (!type.isObject(this.context._internal.lowdefy)) {
throw new Error('context._internal.lowdefy must be an object.');
}
await Promise.all(
Object.values(this.operators).map(async (operator) => {
if (operator.init) {
await operator.init();
}
})
);
}
parse({ actions, args, arrayIndices, event, input, location, operatorPrefix = '_' }) {
const operators = this.operators;
const context = this.context;
@ -70,14 +56,15 @@ class WebParser {
actions,
args,
arrayIndices,
context: context,
context,
event,
input: inputs ? inputs[context.id] : {},
location: applyArrayIndices(arrayIndices, location),
lowdefyGlobal: lowdefyGlobal || {},
menus: menus || {},
methodName,
operators: operators,
operators,
operatorPrefix,
params: value[key],
requests: context.requests,
state: context.state,

View File

@ -55,59 +55,40 @@ const operators = {
operators._init.init = jest.fn();
test('parse input undefined', async () => {
test('parse input undefined', () => {
const parser = new WebParser({ context, operators });
await parser.init();
const res = parser.parse({});
expect(res.output).toEqual();
expect(res.errors).toEqual([]);
});
test('context._internal.lowdefy not object', async () => {
const context = {
_internal: {
lowdefy: 'not object',
},
eventLog: [{ eventLog: true }],
id: 'id',
requests: [{ requests: true }],
state: { state: true },
};
const parser = new WebParser({ context, operators });
await expect(() => parser.init()).rejects.toThrow('context._internal.lowdefy must be an object.');
});
test('parse args not array', async () => {
test('parse args not array', () => {
const input = {};
const args = 'not an array';
const parser = new WebParser({ context, operators });
await parser.init();
expect(() => parser.parse({ args, input })).toThrow('Operator parser args must be an array.');
});
test('parse event not object', async () => {
test('parse event not object', () => {
const input = {};
const event = 'not an array';
const parser = new WebParser({ context, operators });
await parser.init();
expect(() => parser.parse({ event, input })).toThrow('Operator parser event must be a object.');
});
test('parse location not string', async () => {
test('parse location not string', () => {
const input = {};
const location = [];
const parser = new WebParser({ context, operators });
await parser.init();
expect(() => parser.parse({ args, input, location })).toThrow(
'Operator parser location must be a string.'
);
});
test('operator returns value', async () => {
test('operator returns value', () => {
const input = { a: { _test: { params: true } } };
const location = 'location.$';
const parser = new WebParser({ context, operators });
await parser.init();
const res = parser.parse({ actions, args, arrayIndices, event, input, location });
expect(res.output).toEqual({ a: 'test' });
expect(operators._test.mock.calls).toMatchInlineSnapshot(`
@ -183,6 +164,7 @@ test('operator returns value', async () => {
},
],
"methodName": undefined,
"operatorPrefix": "_",
"operators": Object {
"_error": [MockFunction],
"_init": [MockFunction],
@ -237,7 +219,6 @@ test('operator returns value', async () => {
"state": true,
},
},
"init": [Function],
"operators": Object {
"_error": [MockFunction],
"_init": [MockFunction],
@ -274,7 +255,7 @@ test('operator returns value', async () => {
expect(res.errors).toEqual([]);
});
test('context._internal.lowdefy empty object', async () => {
test('context._internal.lowdefy empty object', () => {
const context = {
_internal: {
lowdefy: {},
@ -286,7 +267,6 @@ test('context._internal.lowdefy empty object', async () => {
};
const input = { a: { _test: { params: true } } };
const parser = new WebParser({ context, operators });
await parser.init();
const res = parser.parse({ actions, args, arrayIndices, event, input, location });
expect(res.output).toEqual({ a: 'test' });
expect(operators._test.mock.calls).toMatchInlineSnapshot(`
@ -338,6 +318,7 @@ test('context._internal.lowdefy empty object', async () => {
"lowdefyGlobal": Object {},
"menus": Object {},
"methodName": undefined,
"operatorPrefix": "_",
"operators": Object {
"_error": [MockFunction],
"_init": [MockFunction],
@ -374,7 +355,6 @@ test('context._internal.lowdefy empty object', async () => {
"state": true,
},
},
"init": [Function],
"operators": Object {
"_error": [MockFunction],
"_init": [MockFunction],
@ -407,45 +387,35 @@ test('context._internal.lowdefy empty object', async () => {
expect(res.errors).toEqual([]);
});
test('operator should be object with 1 key', async () => {
test('operator should be object with 1 key', () => {
const input = { a: { _test: { params: true }, x: 1 } };
const parser = new WebParser({ context, operators });
await parser.init();
const res = parser.parse({ actions, args, arrayIndices, event, input, location });
expect(res.output).toEqual(input);
expect(res.errors).toEqual([]);
});
test('operatorPrefix invalid', async () => {
test('operatorPrefix invalid', () => {
const input = { a: { _test: { params: true }, x: 1 } };
const operatorPrefix = 'invalid';
const parser = new WebParser({ context, operators });
await parser.init();
const res = parser.parse({ actions, args, arrayIndices, event, input, location, operatorPrefix });
expect(res.output).toEqual(input);
expect(res.errors).toEqual([]);
});
test('undefined operator', async () => {
test('undefined operator', () => {
const input = { a: { _id: { params: true } } };
const parser = new WebParser({ context, operators });
await parser.init();
const res = parser.parse({ actions, args, arrayIndices, event, input, location });
expect(res.output).toEqual(input);
expect(res.errors).toEqual([]);
});
test('operator errors', async () => {
test('operator errors', () => {
const input = { a: { _error: { params: true } } };
const parser = new WebParser({ context, operators });
await parser.init();
const res = parser.parse({ actions, args, arrayIndices, event, input, location });
expect(res.output).toEqual({ a: null });
expect(res.errors).toEqual([new Error('Test error.')]);
});
test('operator init', async () => {
const parser = new WebParser({ context, operators });
await parser.init();
expect(operators._init.init).toHaveBeenCalledTimes(1);
});

View File

@ -81,7 +81,7 @@ test('DisplayMessage params is not object', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -151,7 +151,7 @@ test('DisplayMessage params is null or undefined', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -209,7 +209,7 @@ test('DisplayMessage params.content is none', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -267,7 +267,7 @@ test('DisplayMessage params.content is ""', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -325,7 +325,7 @@ test('DisplayMessage params.content is falsy', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -86,7 +86,7 @@ test('action invocation', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -126,7 +126,7 @@ test('error params action invocation', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -102,7 +102,7 @@ test('ScrollTo with no params', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -163,7 +163,7 @@ test('ScrollTo with no blockId', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -205,7 +205,7 @@ test('ScrollTo with blockId', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -247,7 +247,7 @@ test('ScrollTo with blockId and options', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -290,7 +290,7 @@ test('ScrollTo with blockId, block not found', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -83,7 +83,7 @@ test('Throw no params', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -160,7 +160,7 @@ test('Throw params.throw true, no message or metaData', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -238,7 +238,7 @@ test('Throw params.throw true, message and no metaData', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -316,7 +316,7 @@ test('Throw params.throw true, message and metaData string', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -402,7 +402,7 @@ test('Throw params.throw true, message and metaData object', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -488,7 +488,7 @@ test('Throw params.throw false', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -544,7 +544,7 @@ test('Throw params.throw null', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -600,7 +600,7 @@ test('Throw params.throw should be a boolean.', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -84,7 +84,7 @@ test('Wait', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});
@ -133,7 +133,7 @@ test('Wait ms not a integer', async () => {
},
},
};
const context = await testContext({
const context = testContext({
lowdefy,
rootBlock,
});

View File

@ -17,7 +17,7 @@
import { Actions, Blocks, Requests, State } from '@lowdefy/engine';
import { WebParser } from '@lowdefy/operators';
const testContext = async ({ lowdefy, operators, rootBlock, initState = {} }) => {
const testContext = ({ lowdefy, operators, rootBlock, initState = {} }) => {
const testLowdefy = {
inputs: { test: {} },
urlQuery: {},
@ -41,7 +41,6 @@ const testContext = async ({ lowdefy, operators, rootBlock, initState = {} }) =>
};
const _internal = ctx._internal;
_internal.parser = new WebParser({ context: ctx, contexts: {}, operators: operators || {} });
await _internal.parser.init();
_internal.State = new State(ctx);
_internal.Actions = new Actions(ctx);
_internal.Requests = new Requests(ctx);

View File

@ -39,7 +39,6 @@ const AffixBlock = ({ blockId, content, methods, properties, rename }) => (
AffixBlock.defaultProps = blockDefaultProps;
AffixBlock.meta = {
category: 'container',
loading: false,
icons: [],
styles: ['blocks/Affix/style.less'],
};

View File

@ -1,6 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Mock render - default - value[0] - Affix 1`] = `
exports[`Mock render - default - value[0] - Affix 1`] = `mocked`;
exports[`Mock render - default - value[0] - Affix 2`] = `
Array [
Array [
Object {
@ -26,7 +28,9 @@ Array [
]
`;
exports[`Mock render - properties.offsetBottom - value[0] - Affix 1`] = `
exports[`Mock render - properties.offsetBottom - value[0] - Affix 1`] = `mocked`;
exports[`Mock render - properties.offsetBottom - value[0] - Affix 2`] = `
Array [
Array [
Object {
@ -52,7 +56,9 @@ Array [
]
`;
exports[`Mock render - properties.offsetTop - value[0] - Affix 1`] = `
exports[`Mock render - properties.offsetTop - value[0] - Affix 1`] = `mocked`;
exports[`Mock render - properties.offsetTop - value[0] - Affix 2`] = `
Array [
Array [
Object {
@ -78,7 +84,9 @@ Array [
]
`;
exports[`Mock render - properties.style - value[0] - Affix 1`] = `
exports[`Mock render - properties.style - value[0] - Affix 1`] = `mocked`;
exports[`Mock render - properties.style - value[0] - Affix 2`] = `
Array [
Array [
Object {

View File

@ -76,6 +76,82 @@ exports[`Render properties.style - value[0] 1`] = `
</div>
`;
exports[`Render required = true default - value[0] 1`] = `
<div
class="emotion-0"
id="default"
>
<div
class=""
>
<div
data-testid="area-content"
style="border: 1px solid red; padding: 10px;"
>
content
</div>
</div>
</div>
`;
exports[`Render required = true properties.offsetBottom - value[0] 1`] = `
<div
class="emotion-0"
id="properties.offsetBottom"
>
<div
class=""
>
<div
data-testid="area-content"
style="border: 1px solid red; padding: 10px;"
>
content
</div>
</div>
</div>
`;
exports[`Render required = true properties.offsetTop - value[0] 1`] = `
<div
class="emotion-0"
id="properties.offsetTop"
>
<div
class=""
>
<div
data-testid="area-content"
style="border: 1px solid red; padding: 10px;"
>
content
</div>
</div>
</div>
`;
exports[`Render required = true properties.style - value[0] 1`] = `
.emotion-0 {
border: 5px solid blue;
}
<div
class="emotion-0"
id="properties.style"
>
<div
class=""
>
<div
data-testid="area-content"
style="border: 1px solid red; padding: 10px;"
>
content
</div>
</div>
</div>
`;
exports[`Test Schema default 1`] = `true`;
exports[`Test Schema default 2`] = `null`;

View File

@ -53,12 +53,6 @@ const AlertBlock = ({ blockId, content, events, components: { Icon }, methods, p
AlertBlock.defaultProps = blockDefaultProps;
AlertBlock.meta = {
category: 'container',
loading: {
type: 'Skeleton',
properties: {
height: 40,
},
},
icons: [],
styles: ['blocks/Alert/style.less'],
};

View File

@ -1,6 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Mock render - areas.action and properties.description - value[0] - Alert 1`] = `
exports[`Mock render - areas.action and properties.description - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - areas.action and properties.description - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -51,7 +53,9 @@ Array [
]
`;
exports[`Mock render - areas.action and properties.message - value[0] - Alert 1`] = `
exports[`Mock render - areas.action and properties.message - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - areas.action and properties.message - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -92,7 +96,9 @@ Array [
]
`;
exports[`Mock render - default - value[0] - Alert 1`] = `
exports[`Mock render - default - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - default - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -119,7 +125,9 @@ Array [
]
`;
exports[`Mock render - properties.closable: true - value[0] - Alert 1`] = `
exports[`Mock render - properties.closable: true - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - properties.closable: true - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -150,7 +158,9 @@ Array [
]
`;
exports[`Mock render - properties.closeText: Close Text - value[0] - Alert 1`] = `
exports[`Mock render - properties.closeText: Close Text - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - properties.closeText: Close Text - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -181,7 +191,9 @@ Array [
]
`;
exports[`Mock render - properties.icon object - value[0] - Alert 1`] = `
exports[`Mock render - properties.icon object - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - properties.icon object - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -191,7 +203,7 @@ Array [
"closable": undefined,
"closeText": undefined,
"description": undefined,
"icon": <IconComp1
"icon": <AntIcon
basePath=""
blockId="properties.icon object_icon"
components={Object {}}
@ -210,7 +222,7 @@ Array [
properties={
Object {
"color": "red",
"name": "SettingOutlined",
"name": "AiOutlineSetting",
"spin": true,
}
}
@ -245,7 +257,9 @@ Array [
]
`;
exports[`Mock render - properties.icon string - value[0] - Alert 1`] = `
exports[`Mock render - properties.icon string - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - properties.icon string - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -255,7 +269,7 @@ Array [
"closable": undefined,
"closeText": undefined,
"description": undefined,
"icon": <IconComp1
"icon": <AntIcon
basePath=""
blockId="properties.icon string_icon"
components={Object {}}
@ -271,7 +285,7 @@ Array [
"triggerEvent": [Function],
}
}
properties="CheckCircleOutlined"
properties="AiOutlineCheckCircle"
required={false}
user={Object {}}
validation={
@ -303,7 +317,9 @@ Array [
]
`;
exports[`Mock render - properties.message - value[0] - Alert 1`] = `
exports[`Mock render - properties.message - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - properties.message - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -334,7 +350,9 @@ Array [
]
`;
exports[`Mock render - properties.type: error - value[0] - Alert 1`] = `
exports[`Mock render - properties.type: error - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - properties.type: error - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -365,7 +383,9 @@ Array [
]
`;
exports[`Mock render - properties.type: error banner: true - value[0] - Alert 1`] = `
exports[`Mock render - properties.type: error banner: true - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - properties.type: error banner: true - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -396,7 +416,9 @@ Array [
]
`;
exports[`Mock render - properties.type: error showIcon: false - value[0] - Alert 1`] = `
exports[`Mock render - properties.type: error showIcon: false - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - properties.type: error showIcon: false - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -427,7 +449,9 @@ Array [
]
`;
exports[`Mock render - properties.type: info - value[0] - Alert 1`] = `
exports[`Mock render - properties.type: info - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - properties.type: info - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -458,7 +482,9 @@ Array [
]
`;
exports[`Mock render - properties.type: info banner: true - value[0] - Alert 1`] = `
exports[`Mock render - properties.type: info banner: true - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - properties.type: info banner: true - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -489,7 +515,9 @@ Array [
]
`;
exports[`Mock render - properties.type: info showIcon: false - value[0] - Alert 1`] = `
exports[`Mock render - properties.type: info showIcon: false - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - properties.type: info showIcon: false - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -520,7 +548,9 @@ Array [
]
`;
exports[`Mock render - properties.type: success - value[0] - Alert 1`] = `
exports[`Mock render - properties.type: success - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - properties.type: success - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -551,7 +581,9 @@ Array [
]
`;
exports[`Mock render - properties.type: success banner: true - value[0] - Alert 1`] = `
exports[`Mock render - properties.type: success banner: true - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - properties.type: success banner: true - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -582,7 +614,9 @@ Array [
]
`;
exports[`Mock render - properties.type: success showIcon: false - value[0] - Alert 1`] = `
exports[`Mock render - properties.type: success showIcon: false - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - properties.type: success showIcon: false - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -613,7 +647,9 @@ Array [
]
`;
exports[`Mock render - properties.type: warning - value[0] - Alert 1`] = `
exports[`Mock render - properties.type: warning - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - properties.type: warning - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -644,7 +680,9 @@ Array [
]
`;
exports[`Mock render - properties.type: warning banner: true - value[0] - Alert 1`] = `
exports[`Mock render - properties.type: warning banner: true - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - properties.type: warning banner: true - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -675,7 +713,9 @@ Array [
]
`;
exports[`Mock render - properties.type: warning showIcon: false - value[0] - Alert 1`] = `
exports[`Mock render - properties.type: warning showIcon: false - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - properties.type: warning showIcon: false - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -706,7 +746,9 @@ Array [
]
`;
exports[`Mock render - with description only - value[0] - Alert 1`] = `
exports[`Mock render - with description only - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - with description only - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -743,7 +785,9 @@ Array [
]
`;
exports[`Mock render - with description only and icon false - value[0] - Alert 1`] = `
exports[`Mock render - with description only and icon false - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - with description only and icon false - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -780,7 +824,9 @@ Array [
]
`;
exports[`Mock render - with description properties.closable: true - value[0] - Alert 1`] = `
exports[`Mock render - with description properties.closable: true - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - with description properties.closable: true - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -821,7 +867,9 @@ Array [
]
`;
exports[`Mock render - with description properties.closeText: Close Text - value[0] - Alert 1`] = `
exports[`Mock render - with description properties.closeText: Close Text - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - with description properties.closeText: Close Text - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -862,7 +910,9 @@ Array [
]
`;
exports[`Mock render - with description properties.icon object - value[0] - Alert 1`] = `
exports[`Mock render - with description properties.icon object - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - with description properties.icon object - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -882,7 +932,7 @@ Array [
}
}
/>,
"icon": <IconComp1
"icon": <AntIcon
basePath=""
blockId="with description properties.icon object_icon"
components={Object {}}
@ -901,7 +951,7 @@ Array [
properties={
Object {
"color": "red",
"name": "SettingOutlined",
"name": "AiOutlineSetting",
"spin": true,
}
}
@ -936,7 +986,9 @@ Array [
]
`;
exports[`Mock render - with description properties.icon string - value[0] - Alert 1`] = `
exports[`Mock render - with description properties.icon string - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - with description properties.icon string - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -956,7 +1008,7 @@ Array [
}
}
/>,
"icon": <IconComp1
"icon": <AntIcon
basePath=""
blockId="with description properties.icon string_icon"
components={Object {}}
@ -972,7 +1024,7 @@ Array [
"triggerEvent": [Function],
}
}
properties="CheckCircleOutlined"
properties="AiOutlineCheckCircle"
required={false}
user={Object {}}
validation={
@ -1004,7 +1056,9 @@ Array [
]
`;
exports[`Mock render - with description properties.message - value[0] - Alert 1`] = `
exports[`Mock render - with description properties.message - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - with description properties.message - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -1045,7 +1099,9 @@ Array [
]
`;
exports[`Mock render - with description properties.type: error - value[0] - Alert 1`] = `
exports[`Mock render - with description properties.type: error - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - with description properties.type: error - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -1086,7 +1142,9 @@ Array [
]
`;
exports[`Mock render - with description properties.type: error banner: true - value[0] - Alert 1`] = `
exports[`Mock render - with description properties.type: error banner: true - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - with description properties.type: error banner: true - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -1127,7 +1185,9 @@ Array [
]
`;
exports[`Mock render - with description properties.type: error showIcon: false - value[0] - Alert 1`] = `
exports[`Mock render - with description properties.type: error showIcon: false - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - with description properties.type: error showIcon: false - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -1168,7 +1228,9 @@ Array [
]
`;
exports[`Mock render - with description properties.type: info - value[0] - Alert 1`] = `
exports[`Mock render - with description properties.type: info - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - with description properties.type: info - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -1209,7 +1271,9 @@ Array [
]
`;
exports[`Mock render - with description properties.type: info banner: true - value[0] - Alert 1`] = `
exports[`Mock render - with description properties.type: info banner: true - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - with description properties.type: info banner: true - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -1250,7 +1314,9 @@ Array [
]
`;
exports[`Mock render - with description properties.type: info showIcon: false - value[0] - Alert 1`] = `
exports[`Mock render - with description properties.type: info showIcon: false - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - with description properties.type: info showIcon: false - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -1291,7 +1357,9 @@ Array [
]
`;
exports[`Mock render - with description properties.type: success - value[0] - Alert 1`] = `
exports[`Mock render - with description properties.type: success - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - with description properties.type: success - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -1332,7 +1400,9 @@ Array [
]
`;
exports[`Mock render - with description properties.type: success banner: true - value[0] - Alert 1`] = `
exports[`Mock render - with description properties.type: success banner: true - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - with description properties.type: success banner: true - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -1373,7 +1443,9 @@ Array [
]
`;
exports[`Mock render - with description properties.type: success showIcon: false - value[0] - Alert 1`] = `
exports[`Mock render - with description properties.type: success showIcon: false - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - with description properties.type: success showIcon: false - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -1414,7 +1486,9 @@ Array [
]
`;
exports[`Mock render - with description properties.type: warning - value[0] - Alert 1`] = `
exports[`Mock render - with description properties.type: warning - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - with description properties.type: warning - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -1455,7 +1529,9 @@ Array [
]
`;
exports[`Mock render - with description properties.type: warning banner: true - value[0] - Alert 1`] = `
exports[`Mock render - with description properties.type: warning banner: true - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - with description properties.type: warning banner: true - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -1496,7 +1572,9 @@ Array [
]
`;
exports[`Mock render - with description properties.type: warning showIcon: false - value[0] - Alert 1`] = `
exports[`Mock render - with description properties.type: warning showIcon: false - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - with description properties.type: warning showIcon: false - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -1537,7 +1615,9 @@ Array [
]
`;
exports[`Mock render - with description uses html - value[0] - Alert 1`] = `
exports[`Mock render - with description uses html - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - with description uses html - value[0] - Alert 2`] = `
Array [
Array [
Object {
@ -1576,7 +1656,9 @@ Array [
]
`;
exports[`Mock render - with message uses html - value[0] - Alert 1`] = `
exports[`Mock render - with message uses html - value[0] - Alert 1`] = `mocked`;
exports[`Mock render - with message uses html - value[0] - Alert 2`] = `
Array [
Array [
Object {

View File

@ -44,7 +44,6 @@ const AutoCompleteInput = ({
properties={{ title: properties.title, size: properties.size, ...properties.label }}
validation={validation}
required={required}
loading={loading}
content={{
content: () => (
<AutoComplete
@ -54,7 +53,7 @@ const AutoCompleteInput = ({
bordered={properties.bordered}
className={methods.makeCssClass(properties.inputStyle)}
defaultOpen={properties.defaultOpen}
disabled={properties.disabled}
disabled={properties.disabled || loading}
placeholder={properties.placeholder || 'Type or select item'}
allowClear={properties.allowClear !== false}
size={properties.size}
@ -114,9 +113,6 @@ AutoCompleteInput.defaultProps = blockDefaultProps;
AutoCompleteInput.meta = {
valueType: 'string',
category: 'input',
loading: {
type: 'SkeletonInput',
},
icons: [...Label.meta.icons],
styles: ['blocks/AutoComplete/style.less'],
};

Some files were not shown because too many files have changed in this diff Show More