@lowdefy/blocks-antd 4.0.0-alpha.1 → 4.0.0-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocks/Affix/Affix.js +11 -6
- package/dist/blocks/Affix/style.less +1 -1
- package/dist/blocks/Alert/Alert.js +28 -10
- package/dist/blocks/Alert/style.less +1 -1
- package/dist/blocks/AutoComplete/AutoComplete.js +41 -34
- package/dist/blocks/AutoComplete/style.less +1 -1
- package/dist/blocks/Avatar/Avatar.js +12 -7
- package/dist/blocks/Avatar/schema.json +1 -1
- package/dist/blocks/Avatar/style.less +1 -1
- package/dist/blocks/Badge/Badge.js +12 -7
- package/dist/blocks/Badge/schema.json +1 -1
- package/dist/blocks/Badge/style.less +1 -1
- package/dist/blocks/Breadcrumb/Breadcrumb.js +56 -64
- package/dist/blocks/Breadcrumb/schema.json +1 -1
- package/dist/blocks/Breadcrumb/style.less +1 -1
- package/dist/blocks/Button/Button.js +22 -13
- package/dist/blocks/Button/schema.json +1 -1
- package/dist/blocks/Button/style.less +1 -1
- package/dist/blocks/ButtonSelector/ButtonSelector.js +36 -29
- package/dist/blocks/ButtonSelector/style.less +1 -1
- package/dist/blocks/Card/Card.js +11 -6
- package/dist/blocks/Card/style.less +1 -1
- package/dist/blocks/CheckboxSelector/CheckboxSelector.js +40 -34
- package/dist/blocks/CheckboxSelector/style.less +1 -1
- package/dist/blocks/CheckboxSwitch/CheckboxSwitch.js +21 -15
- package/dist/blocks/CheckboxSwitch/style.less +1 -1
- package/dist/blocks/Collapse/Collapse.js +38 -21
- package/dist/blocks/Collapse/schema.json +1 -1
- package/dist/blocks/Collapse/style.less +1 -1
- package/dist/blocks/Comment/Comment.js +13 -9
- package/dist/blocks/Comment/style.less +1 -1
- package/dist/blocks/ConfirmModal/ConfirmModal.js +28 -10
- package/dist/blocks/ConfirmModal/schema.json +1 -1
- package/dist/blocks/ConfirmModal/style.less +1 -1
- package/dist/blocks/Content/Content.js +11 -6
- package/dist/blocks/Content/style.less +1 -1
- package/dist/blocks/ControlledList/ControlledList.js +61 -63
- package/dist/blocks/ControlledList/style.less +1 -1
- package/dist/blocks/DateRangeSelector/DateRangeSelector.js +55 -50
- package/dist/blocks/DateRangeSelector/schema.json +2 -2
- package/dist/blocks/DateRangeSelector/style.less +1 -1
- package/dist/blocks/DateSelector/DateSelector.js +49 -44
- package/dist/blocks/DateSelector/schema.json +2 -2
- package/dist/blocks/DateSelector/style.less +1 -1
- package/dist/blocks/DateTimeSelector/DateTimeSelector.js +56 -51
- package/dist/blocks/DateTimeSelector/schema.json +2 -2
- package/dist/blocks/DateTimeSelector/style.less +1 -1
- package/dist/blocks/Descriptions/Descriptions.js +42 -38
- package/dist/blocks/Descriptions/style.less +1 -1
- package/dist/blocks/Divider/Divider.js +14 -9
- package/dist/blocks/Divider/style.less +1 -1
- package/dist/blocks/Drawer/Drawer.js +11 -6
- package/dist/blocks/Drawer/style.less +1 -1
- package/dist/blocks/Footer/Footer.js +11 -6
- package/dist/blocks/Footer/style.less +1 -1
- package/dist/blocks/Header/Header.js +11 -9
- package/dist/blocks/Header/schema.json +0 -4
- package/dist/blocks/Header/style.less +1 -1
- package/dist/blocks/Label/Label.js +70 -67
- package/dist/blocks/Label/getLabelCol.js +1 -1
- package/dist/blocks/Label/getWrapperCol.js +1 -1
- package/dist/blocks/Label/labelLogic.js +2 -3
- package/dist/blocks/Label/style.less +1 -1
- package/dist/blocks/Layout/Layout.js +11 -6
- package/dist/blocks/Layout/style.less +1 -1
- package/dist/blocks/Menu/Menu.js +123 -218
- package/dist/blocks/Menu/schema.json +1 -15
- package/dist/blocks/Menu/style.less +1 -1
- package/dist/blocks/Message/Message.js +11 -6
- package/dist/blocks/Message/schema.json +1 -1
- package/dist/blocks/Message/style.less +1 -1
- package/dist/blocks/MobileMenu/MobileMenu.js +85 -85
- package/dist/blocks/MobileMenu/schema.json +1 -15
- package/dist/blocks/MobileMenu/style.less +1 -1
- package/dist/blocks/Modal/Modal.js +76 -60
- package/dist/blocks/Modal/style.less +1 -1
- package/dist/blocks/MonthSelector/MonthSelector.js +47 -42
- package/dist/blocks/MonthSelector/schema.json +2 -2
- package/dist/blocks/MonthSelector/style.less +1 -1
- package/dist/blocks/MultipleSelector/MultipleSelector.js +104 -99
- package/dist/blocks/MultipleSelector/schema.json +6 -6
- package/dist/blocks/MultipleSelector/style.less +1 -1
- package/dist/blocks/Notification/Notification.js +13 -8
- package/dist/blocks/Notification/schema.json +2 -2
- package/dist/blocks/Notification/style.less +1 -1
- package/dist/blocks/NumberInput/NumberInput.js +14 -6
- package/dist/blocks/NumberInput/style.less +1 -1
- package/dist/blocks/PageHCF/PageHCF.js +34 -34
- package/dist/blocks/PageHCF/schema.json +0 -29
- package/dist/blocks/PageHCF/style.less +1 -1
- package/dist/blocks/PageHCSF/PageHCSF.js +61 -66
- package/dist/blocks/PageHCSF/schema.json +0 -30
- package/dist/blocks/PageHCSF/style.less +1 -1
- package/dist/blocks/PageHSCF/PageHSCF.js +61 -66
- package/dist/blocks/PageHSCF/schema.json +0 -30
- package/dist/blocks/PageHSCF/style.less +1 -1
- package/dist/blocks/PageHeaderMenu/PageHeaderMenu.js +151 -167
- package/dist/blocks/PageHeaderMenu/schema.json +1 -24
- package/dist/blocks/PageHeaderMenu/style.less +1 -1
- package/dist/blocks/PageSHCF/PageSHCF.js +60 -65
- package/dist/blocks/PageSHCF/schema.json +0 -30
- package/dist/blocks/PageSHCF/style.less +1 -1
- package/dist/blocks/PageSiderMenu/PageSiderMenu.js +258 -285
- package/dist/blocks/PageSiderMenu/schema.json +1 -31
- package/dist/blocks/PageSiderMenu/style.less +1 -1
- package/dist/blocks/Pagination/Pagination.js +17 -5
- package/dist/blocks/Pagination/style.less +1 -1
- package/dist/blocks/Paragraph/Paragraph.js +21 -14
- package/dist/blocks/Paragraph/style.less +1 -1
- package/dist/blocks/ParagraphInput/ParagraphInput.js +22 -14
- package/dist/blocks/ParagraphInput/style.less +1 -1
- package/dist/blocks/PasswordInput/PasswordInput.js +14 -6
- package/dist/blocks/PasswordInput/style.less +1 -1
- package/dist/blocks/Progress/Progress.js +9 -3
- package/dist/blocks/Progress/style.less +1 -1
- package/dist/blocks/RadioSelector/RadioSelector.js +40 -34
- package/dist/blocks/RadioSelector/style.less +1 -1
- package/dist/blocks/RatingSlider/RatingSlider.js +127 -126
- package/dist/blocks/RatingSlider/schema.json +4 -4
- package/dist/blocks/RatingSlider/style.less +1 -1
- package/dist/blocks/Result/Result.js +13 -8
- package/dist/blocks/Result/schema.json +1 -1
- package/dist/blocks/Result/style.less +1 -1
- package/dist/blocks/Selector/Selector.js +96 -91
- package/dist/blocks/Selector/schema.json +4 -4
- package/dist/blocks/Selector/style.less +1 -1
- package/dist/blocks/Sider/Sider.js +12 -9
- package/dist/blocks/Sider/schema.json +0 -7
- package/dist/blocks/Sider/style.less +1 -1
- package/dist/blocks/Statistic/Statistic.js +11 -5
- package/dist/blocks/Statistic/schema.json +2 -2
- package/dist/blocks/Statistic/style.less +1 -1
- package/dist/blocks/Switch/Switch.js +22 -19
- package/dist/blocks/Switch/schema.json +4 -4
- package/dist/blocks/Switch/style.less +1 -1
- package/dist/blocks/Tabs/Tabs.js +36 -24
- package/dist/blocks/Tabs/schema.json +1 -1
- package/dist/blocks/Tabs/style.less +1 -1
- package/dist/blocks/TextArea/TextArea.js +14 -6
- package/dist/blocks/TextArea/style.less +1 -1
- package/dist/blocks/TextInput/TextInput.js +16 -8
- package/dist/blocks/TextInput/schema.json +2 -2
- package/dist/blocks/TextInput/style.less +1 -1
- package/dist/blocks/TimelineList/TimelineList.js +56 -40
- package/dist/blocks/TimelineList/schema.json +4 -1
- package/dist/blocks/TimelineList/style.less +1 -1
- package/dist/blocks/Title/Title.js +21 -14
- package/dist/blocks/Title/style.less +1 -1
- package/dist/blocks/TitleInput/TitleInput.js +22 -14
- package/dist/blocks/TitleInput/style.less +1 -1
- package/dist/blocks/Tooltip/Tooltip.js +11 -9
- package/dist/blocks/Tooltip/style.less +1 -1
- package/dist/blocks/WeekSelector/WeekSelector.js +47 -42
- package/dist/blocks/WeekSelector/schema.json +2 -2
- package/dist/blocks/WeekSelector/style.less +1 -1
- package/dist/blocks.js +74 -0
- package/dist/color.js +1 -1
- package/dist/disabledDate.js +2 -3
- package/dist/getUniqueValues.js +1 -1
- package/dist/getValueIndex.js +1 -1
- package/dist/style.less +1 -1
- package/dist/{blocks/Alert/index.js → types.js} +16 -19
- package/dist/useRunAfterUpdate.js +1 -1
- package/dist/validationExamples.js +1 -1
- package/package.json +27 -23
- package/dist/blocks/Affix/index.js +0 -26
- package/dist/blocks/AutoComplete/index.js +0 -33
- package/dist/blocks/Avatar/index.js +0 -28
- package/dist/blocks/Badge/index.js +0 -26
- package/dist/blocks/Breadcrumb/index.js +0 -31
- package/dist/blocks/Button/index.js +0 -28
- package/dist/blocks/ButtonSelector/index.js +0 -33
- package/dist/blocks/Card/index.js +0 -31
- package/dist/blocks/CheckboxSelector/index.js +0 -33
- package/dist/blocks/CheckboxSwitch/index.js +0 -36
- package/dist/blocks/Collapse/index.js +0 -31
- package/dist/blocks/Comment/index.js +0 -28
- package/dist/blocks/ConfirmModal/index.js +0 -59
- package/dist/blocks/Content/index.js +0 -26
- package/dist/blocks/ControlledList/index.js +0 -36
- package/dist/blocks/DateRangeSelector/index.js +0 -33
- package/dist/blocks/DateSelector/index.js +0 -33
- package/dist/blocks/DateTimeSelector/index.js +0 -33
- package/dist/blocks/Descriptions/index.js +0 -31
- package/dist/blocks/Divider/index.js +0 -31
- package/dist/blocks/Drawer/index.js +0 -41
- package/dist/blocks/Footer/index.js +0 -26
- package/dist/blocks/Header/index.js +0 -26
- package/dist/blocks/Label/index.js +0 -32
- package/dist/blocks/Layout/index.js +0 -31
- package/dist/blocks/Menu/index.js +0 -26
- package/dist/blocks/Message/index.js +0 -53
- package/dist/blocks/MobileMenu/index.js +0 -41
- package/dist/blocks/Modal/index.js +0 -41
- package/dist/blocks/MonthSelector/index.js +0 -33
- package/dist/blocks/MultipleSelector/index.js +0 -33
- package/dist/blocks/Notification/index.js +0 -59
- package/dist/blocks/NumberInput/index.js +0 -33
- package/dist/blocks/PageHCF/index.js +0 -31
- package/dist/blocks/PageHCSF/index.js +0 -46
- package/dist/blocks/PageHSCF/index.js +0 -46
- package/dist/blocks/PageHeaderMenu/index.js +0 -46
- package/dist/blocks/PageSHCF/index.js +0 -46
- package/dist/blocks/PageSiderMenu/index.js +0 -57
- package/dist/blocks/Pagination/index.js +0 -37
- package/dist/blocks/Paragraph/index.js +0 -28
- package/dist/blocks/ParagraphInput/index.js +0 -36
- package/dist/blocks/PasswordInput/index.js +0 -33
- package/dist/blocks/Progress/index.js +0 -31
- package/dist/blocks/RadioSelector/index.js +0 -33
- package/dist/blocks/RatingSlider/index.js +0 -33
- package/dist/blocks/Result/index.js +0 -31
- package/dist/blocks/S3UploadButton/S3UploadButton.js +0 -171
- package/dist/blocks/S3UploadButton/index.js +0 -29
- package/dist/blocks/S3UploadButton/schema.json +0 -83
- package/dist/blocks/S3UploadButton/style.less +0 -18
- package/dist/blocks/Selector/index.js +0 -33
- package/dist/blocks/Sider/index.js +0 -41
- package/dist/blocks/Statistic/index.js +0 -31
- package/dist/blocks/Switch/index.js +0 -33
- package/dist/blocks/Tabs/index.js +0 -31
- package/dist/blocks/TextArea/index.js +0 -33
- package/dist/blocks/TextInput/index.js +0 -33
- package/dist/blocks/TimelineList/index.js +0 -31
- package/dist/blocks/Title/index.js +0 -31
- package/dist/blocks/TitleInput/index.js +0 -39
- package/dist/blocks/Tooltip/index.js +0 -31
- package/dist/blocks/WeekSelector/index.js +0 -33
- package/dist/index.js +0 -152
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
/*
|
|
3
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
4
3
|
|
|
5
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
5
|
you may not use this file except in compliance with the License.
|
|
@@ -22,7 +21,7 @@ import getValueIndex from '../../getValueIndex.js';
|
|
|
22
21
|
import getUniqueValues from '../../getUniqueValues.js';
|
|
23
22
|
const ButtonSelector = ({ blockId , components , events , loading , properties , required , validation , value , methods , })=>{
|
|
24
23
|
const uniqueValueOptions = getUniqueValues(properties.options || []);
|
|
25
|
-
return(/*#__PURE__*/
|
|
24
|
+
return(/*#__PURE__*/ React.createElement(Label, {
|
|
26
25
|
blockId: blockId,
|
|
27
26
|
components: components,
|
|
28
27
|
events: events,
|
|
@@ -33,9 +32,8 @@ const ButtonSelector = ({ blockId , components , events , loading , properties ,
|
|
|
33
32
|
},
|
|
34
33
|
validation: validation,
|
|
35
34
|
required: required,
|
|
36
|
-
loading: loading,
|
|
37
35
|
content: {
|
|
38
|
-
content: ()=>/*#__PURE__*/
|
|
36
|
+
content: ()=>/*#__PURE__*/ React.createElement(Radio.Group, {
|
|
39
37
|
id: `${blockId}_input`,
|
|
40
38
|
className: methods.makeCssClass([
|
|
41
39
|
properties.color && {
|
|
@@ -46,7 +44,7 @@ const ButtonSelector = ({ blockId , components , events , loading , properties ,
|
|
|
46
44
|
},
|
|
47
45
|
properties.inputStyle,
|
|
48
46
|
]),
|
|
49
|
-
disabled: properties.disabled,
|
|
47
|
+
disabled: properties.disabled || loading,
|
|
50
48
|
size: properties.size,
|
|
51
49
|
buttonStyle: properties.buttonStyle ? properties.buttonStyle : 'solid',
|
|
52
50
|
onChange: (event)=>{
|
|
@@ -55,31 +53,40 @@ const ButtonSelector = ({ blockId , components , events , loading , properties ,
|
|
|
55
53
|
name: 'onChange'
|
|
56
54
|
});
|
|
57
55
|
},
|
|
58
|
-
value: type.isNone(value) ? undefined : getValueIndex(value, properties.options || [])
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
})
|
|
56
|
+
value: type.isNone(value) ? undefined : getValueIndex(value, properties.options || [])
|
|
57
|
+
}, uniqueValueOptions.map((opt, i)=>type.isPrimitive(opt) ? /*#__PURE__*/ React.createElement(Radio.Button, {
|
|
58
|
+
id: `${blockId}_${i}`,
|
|
59
|
+
key: i,
|
|
60
|
+
value: `${i}`
|
|
61
|
+
}, renderHtml({
|
|
62
|
+
html: `${opt}`,
|
|
63
|
+
methods
|
|
64
|
+
})) : /*#__PURE__*/ React.createElement(Radio.Button, {
|
|
65
|
+
id: `${blockId}_${i}`,
|
|
66
|
+
key: i,
|
|
67
|
+
value: `${i}`,
|
|
68
|
+
disabled: opt.disabled,
|
|
69
|
+
className: methods.makeCssClass(opt.style)
|
|
70
|
+
}, type.isNone(opt.label) ? renderHtml({
|
|
71
|
+
html: `${opt.value}`,
|
|
72
|
+
methods
|
|
73
|
+
}) : renderHtml({
|
|
74
|
+
html: opt.label,
|
|
75
|
+
methods
|
|
76
|
+
}))
|
|
77
|
+
))
|
|
81
78
|
}
|
|
82
79
|
}));
|
|
83
80
|
};
|
|
84
81
|
ButtonSelector.defaultProps = blockDefaultProps;
|
|
82
|
+
ButtonSelector.meta = {
|
|
83
|
+
valueType: 'any',
|
|
84
|
+
category: 'input',
|
|
85
|
+
icons: [
|
|
86
|
+
...Label.meta.icons
|
|
87
|
+
],
|
|
88
|
+
styles: [
|
|
89
|
+
'blocks/ButtonSelector/style.less'
|
|
90
|
+
]
|
|
91
|
+
};
|
|
85
92
|
export default ButtonSelector;
|
package/dist/blocks/Card/Card.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
/*
|
|
3
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
4
3
|
|
|
5
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
5
|
you may not use this file except in compliance with the License.
|
|
@@ -16,7 +15,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
16
15
|
*/ import React from 'react';
|
|
17
16
|
import { Card } from 'antd';
|
|
18
17
|
import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
19
|
-
const CardBlock = ({ blockId , content , properties , methods , events })=>/*#__PURE__*/
|
|
18
|
+
const CardBlock = ({ blockId , content , properties , methods , events })=>/*#__PURE__*/ React.createElement(Card, {
|
|
20
19
|
id: blockId,
|
|
21
20
|
title: content.title ? content.title() : renderHtml({
|
|
22
21
|
html: properties.title,
|
|
@@ -39,9 +38,15 @@ const CardBlock = ({ blockId , content , properties , methods , events })=>/*#_
|
|
|
39
38
|
cursor: events.onClick && 'pointer'
|
|
40
39
|
},
|
|
41
40
|
properties.style,
|
|
42
|
-
])
|
|
43
|
-
|
|
44
|
-
})
|
|
41
|
+
])
|
|
42
|
+
}, content.content && content.content())
|
|
45
43
|
;
|
|
46
44
|
CardBlock.defaultProps = blockDefaultProps;
|
|
45
|
+
CardBlock.meta = {
|
|
46
|
+
category: 'container',
|
|
47
|
+
icons: [],
|
|
48
|
+
styles: [
|
|
49
|
+
'blocks/Card/style.less'
|
|
50
|
+
]
|
|
51
|
+
};
|
|
47
52
|
export default CardBlock;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
/*
|
|
3
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
4
3
|
|
|
5
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
5
|
you may not use this file except in compliance with the License.
|
|
@@ -22,7 +21,7 @@ import getValueIndex from '../../getValueIndex.js';
|
|
|
22
21
|
import getUniqueValues from '../../getUniqueValues.js';
|
|
23
22
|
const CheckboxSelector = ({ blockId , components , events , loading , properties , required , validation , value , methods , })=>{
|
|
24
23
|
const uniqueValueOptions = getUniqueValues(properties.options || []);
|
|
25
|
-
return(/*#__PURE__*/
|
|
24
|
+
return(/*#__PURE__*/ React.createElement(Label, {
|
|
26
25
|
blockId: blockId,
|
|
27
26
|
components: components,
|
|
28
27
|
events: events,
|
|
@@ -33,9 +32,8 @@ const CheckboxSelector = ({ blockId , components , events , loading , properties
|
|
|
33
32
|
},
|
|
34
33
|
validation: validation,
|
|
35
34
|
required: required,
|
|
36
|
-
loading: loading,
|
|
37
35
|
content: {
|
|
38
|
-
content: ()=>/*#__PURE__*/
|
|
36
|
+
content: ()=>/*#__PURE__*/ React.createElement(Checkbox.Group, {
|
|
39
37
|
id: `${blockId}_input`,
|
|
40
38
|
className: methods.makeCssClass([
|
|
41
39
|
properties.color && {
|
|
@@ -46,7 +44,7 @@ const CheckboxSelector = ({ blockId , components , events , loading , properties
|
|
|
46
44
|
},
|
|
47
45
|
properties.inputStyle,
|
|
48
46
|
]),
|
|
49
|
-
disabled: properties.disabled,
|
|
47
|
+
disabled: properties.disabled || loading,
|
|
50
48
|
onChange: (newVal)=>{
|
|
51
49
|
const val = [];
|
|
52
50
|
newVal.forEach((nv)=>{
|
|
@@ -57,36 +55,44 @@ const CheckboxSelector = ({ blockId , components , events , loading , properties
|
|
|
57
55
|
name: 'onChange'
|
|
58
56
|
});
|
|
59
57
|
},
|
|
60
|
-
value: getValueIndex(value, uniqueValueOptions, true)
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
})
|
|
87
|
-
})
|
|
58
|
+
value: getValueIndex(value, uniqueValueOptions, true)
|
|
59
|
+
}, /*#__PURE__*/ React.createElement(Space, {
|
|
60
|
+
direction: properties.direction,
|
|
61
|
+
wrap: type.isNone(properties.wrap) ? true : properties.wrap,
|
|
62
|
+
align: type.isNone(properties.align) ? 'start' : properties.align
|
|
63
|
+
}, uniqueValueOptions.map((opt, i)=>type.isPrimitive(opt) ? /*#__PURE__*/ React.createElement(Checkbox, {
|
|
64
|
+
id: `${blockId}_${i}`,
|
|
65
|
+
key: i,
|
|
66
|
+
value: `${i}`
|
|
67
|
+
}, renderHtml({
|
|
68
|
+
html: `${opt}`,
|
|
69
|
+
methods
|
|
70
|
+
})) : /*#__PURE__*/ React.createElement(Checkbox, {
|
|
71
|
+
id: `${blockId}_${i}`,
|
|
72
|
+
key: i,
|
|
73
|
+
value: `${i}`,
|
|
74
|
+
disabled: opt.disabled,
|
|
75
|
+
className: methods.makeCssClass(opt.style)
|
|
76
|
+
}, type.isNone(opt.label) ? renderHtml({
|
|
77
|
+
html: `${opt.value}`,
|
|
78
|
+
methods
|
|
79
|
+
}) : renderHtml({
|
|
80
|
+
html: opt.label,
|
|
81
|
+
methods
|
|
82
|
+
}))
|
|
83
|
+
)))
|
|
88
84
|
}
|
|
89
85
|
}));
|
|
90
86
|
};
|
|
91
87
|
CheckboxSelector.defaultProps = blockDefaultProps;
|
|
88
|
+
CheckboxSelector.meta = {
|
|
89
|
+
valueType: 'array',
|
|
90
|
+
category: 'input',
|
|
91
|
+
icons: [
|
|
92
|
+
...Label.meta.icons
|
|
93
|
+
],
|
|
94
|
+
styles: [
|
|
95
|
+
'blocks/CheckboxSelector/style.less'
|
|
96
|
+
]
|
|
97
|
+
};
|
|
92
98
|
export default CheckboxSelector;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
/*
|
|
3
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
4
3
|
|
|
5
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
5
|
you may not use this file except in compliance with the License.
|
|
@@ -18,7 +17,7 @@ import { Checkbox, Space } from 'antd';
|
|
|
18
17
|
import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
19
18
|
import Label from '../Label/Label.js';
|
|
20
19
|
const CheckboxSwitch = ({ blockId , components , events , loading , properties , required , validation , value , methods , })=>{
|
|
21
|
-
return(/*#__PURE__*/
|
|
20
|
+
return(/*#__PURE__*/ React.createElement(Label, {
|
|
22
21
|
blockId: blockId,
|
|
23
22
|
components: components,
|
|
24
23
|
events: events,
|
|
@@ -29,12 +28,11 @@ const CheckboxSwitch = ({ blockId , components , events , loading , properties ,
|
|
|
29
28
|
},
|
|
30
29
|
validation: validation,
|
|
31
30
|
required: required,
|
|
32
|
-
loading: loading,
|
|
33
31
|
content: {
|
|
34
|
-
content: ()=>/*#__PURE__*/
|
|
32
|
+
content: ()=>/*#__PURE__*/ React.createElement(Checkbox, {
|
|
35
33
|
id: `${blockId}_input`,
|
|
36
34
|
checked: value,
|
|
37
|
-
disabled: properties.disabled,
|
|
35
|
+
disabled: properties.disabled || loading,
|
|
38
36
|
className: methods.makeCssClass([
|
|
39
37
|
properties.color && {
|
|
40
38
|
'& > span.ant-checkbox-checked:not(.ant-checkbox-disabled) > span': {
|
|
@@ -52,17 +50,25 @@ const CheckboxSwitch = ({ blockId , components , events , loading , properties ,
|
|
|
52
50
|
methods.triggerEvent({
|
|
53
51
|
name: 'onChange'
|
|
54
52
|
});
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
})
|
|
63
|
-
})
|
|
53
|
+
}
|
|
54
|
+
}, /*#__PURE__*/ React.createElement(Space, {
|
|
55
|
+
wrap: true
|
|
56
|
+
}, renderHtml({
|
|
57
|
+
html: properties.description,
|
|
58
|
+
methods
|
|
59
|
+
})))
|
|
64
60
|
}
|
|
65
61
|
}));
|
|
66
62
|
};
|
|
67
63
|
CheckboxSwitch.defaultProps = blockDefaultProps;
|
|
64
|
+
CheckboxSwitch.meta = {
|
|
65
|
+
valueType: 'boolean',
|
|
66
|
+
category: 'input',
|
|
67
|
+
icons: [
|
|
68
|
+
...Label.meta.icons
|
|
69
|
+
],
|
|
70
|
+
styles: [
|
|
71
|
+
'blocks/CheckboxSwitch/style.less'
|
|
72
|
+
]
|
|
73
|
+
};
|
|
68
74
|
export default CheckboxSwitch;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
/*
|
|
3
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
4
3
|
|
|
5
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
5
|
you may not use this file except in compliance with the License.
|
|
@@ -17,14 +16,27 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
17
16
|
import { Collapse } from 'antd';
|
|
18
17
|
import { serializer, type } from '@lowdefy/helpers';
|
|
19
18
|
import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
19
|
+
function _extends() {
|
|
20
|
+
_extends = Object.assign || function(target) {
|
|
21
|
+
for(var i = 1; i < arguments.length; i++){
|
|
22
|
+
var source = arguments[i];
|
|
23
|
+
for(var key in source){
|
|
24
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
25
|
+
target[key] = source[key];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return target;
|
|
30
|
+
};
|
|
31
|
+
return _extends.apply(this, arguments);
|
|
32
|
+
}
|
|
20
33
|
const CollapseBlock = ({ blockId , events , content , components: { Icon } , methods , properties })=>{
|
|
21
34
|
const panels = properties.panels || Object.keys(content).sort().map((key)=>({
|
|
22
35
|
key,
|
|
23
36
|
title: key
|
|
24
37
|
})
|
|
25
38
|
);
|
|
26
|
-
const additionalProps = {
|
|
27
|
-
};
|
|
39
|
+
const additionalProps = {};
|
|
28
40
|
if (properties.activeKey) {
|
|
29
41
|
additionalProps.activeKey = properties.activeKey;
|
|
30
42
|
}
|
|
@@ -34,7 +46,7 @@ const CollapseBlock = ({ blockId , events , content , components: { Icon } , me
|
|
|
34
46
|
name: propertiesIconExpand
|
|
35
47
|
};
|
|
36
48
|
}
|
|
37
|
-
return(/*#__PURE__*/
|
|
49
|
+
return(/*#__PURE__*/ React.createElement(Collapse, _extends({
|
|
38
50
|
id: blockId,
|
|
39
51
|
defaultActiveKey: properties.defaultActiveKey || panels[0].key,
|
|
40
52
|
bordered: properties.bordered,
|
|
@@ -46,7 +58,7 @@ const CollapseBlock = ({ blockId , events , content , components: { Icon } , me
|
|
|
46
58
|
}
|
|
47
59
|
})
|
|
48
60
|
,
|
|
49
|
-
expandIcon: propertiesIconExpand && (({ isActive })=>/*#__PURE__*/
|
|
61
|
+
expandIcon: propertiesIconExpand && (({ isActive })=>/*#__PURE__*/ React.createElement(Icon, {
|
|
50
62
|
blockId: `${blockId}_expandIcon`,
|
|
51
63
|
events: events,
|
|
52
64
|
properties: {
|
|
@@ -56,21 +68,26 @@ const CollapseBlock = ({ blockId , events , content , components: { Icon } , me
|
|
|
56
68
|
})
|
|
57
69
|
),
|
|
58
70
|
expandIconPosition: properties.expandIconPosition,
|
|
59
|
-
destroyInactivePanel: properties.destroyInactivePanel
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
)
|
|
73
|
-
}));
|
|
71
|
+
destroyInactivePanel: properties.destroyInactivePanel
|
|
72
|
+
}, additionalProps), panels.map((panel)=>/*#__PURE__*/ React.createElement(Collapse.Panel, {
|
|
73
|
+
extra: content[panel.extraKey] && content[panel.extraKey](),
|
|
74
|
+
collapsible: panel.disabled && 'disabled',
|
|
75
|
+
forceRender: properties.forceRender,
|
|
76
|
+
header: renderHtml({
|
|
77
|
+
html: panel.title,
|
|
78
|
+
methods
|
|
79
|
+
}),
|
|
80
|
+
key: panel.key,
|
|
81
|
+
showArrow: properties.showArrow
|
|
82
|
+
}, content[panel.key] && content[panel.key]())
|
|
83
|
+
)));
|
|
74
84
|
};
|
|
75
85
|
CollapseBlock.defaultProps = blockDefaultProps;
|
|
86
|
+
CollapseBlock.meta = {
|
|
87
|
+
category: 'container',
|
|
88
|
+
icons: [],
|
|
89
|
+
styles: [
|
|
90
|
+
'blocks/Collapse/style.less'
|
|
91
|
+
]
|
|
92
|
+
};
|
|
76
93
|
export default CollapseBlock;
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"expandIcon": {
|
|
31
31
|
"type": ["string", "object"],
|
|
32
|
-
"description": "Name of an
|
|
32
|
+
"description": "Name of an React-Icon (See <a href='https://react-icons.github.io/react-icons/'>all icons</a>) or properties of an Icon block for expand icon on the right of selector.",
|
|
33
33
|
"docs": {
|
|
34
34
|
"displayType": "icon"
|
|
35
35
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
/*
|
|
3
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
4
3
|
|
|
5
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
5
|
you may not use this file except in compliance with the License.
|
|
@@ -19,8 +18,7 @@ import { type } from '@lowdefy/helpers';
|
|
|
19
18
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
20
19
|
import Avatar from '../Avatar/Avatar.js';
|
|
21
20
|
const CommentBlock = ({ blockId , components , content , properties , methods })=>{
|
|
22
|
-
let avatar = {
|
|
23
|
-
};
|
|
21
|
+
let avatar = {};
|
|
24
22
|
if (type.isObject(properties.avatar)) {
|
|
25
23
|
avatar = properties.avatar;
|
|
26
24
|
} else if (type.isString(properties.avatar)) {
|
|
@@ -32,7 +30,7 @@ const CommentBlock = ({ blockId , components , content , properties , methods }
|
|
|
32
30
|
content: properties.author.substring(0, 2)
|
|
33
31
|
};
|
|
34
32
|
}
|
|
35
|
-
return(/*#__PURE__*/
|
|
33
|
+
return(/*#__PURE__*/ React.createElement(Comment, {
|
|
36
34
|
id: blockId,
|
|
37
35
|
actions: [
|
|
38
36
|
content.actions && content.actions()
|
|
@@ -40,13 +38,19 @@ const CommentBlock = ({ blockId , components , content , properties , methods }
|
|
|
40
38
|
author: properties.author || content.author && content.author(),
|
|
41
39
|
content: properties.content || content.content && content.content(),
|
|
42
40
|
datetime: properties.datetime,
|
|
43
|
-
avatar: /*#__PURE__*/
|
|
41
|
+
avatar: /*#__PURE__*/ React.createElement(Avatar, {
|
|
44
42
|
components: components,
|
|
45
43
|
properties: avatar,
|
|
46
44
|
methods: methods
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
}));
|
|
45
|
+
})
|
|
46
|
+
}, content.children && content.children()));
|
|
50
47
|
};
|
|
51
48
|
CommentBlock.defaultProps = blockDefaultProps;
|
|
49
|
+
CommentBlock.meta = {
|
|
50
|
+
category: 'container',
|
|
51
|
+
icons: [],
|
|
52
|
+
styles: [
|
|
53
|
+
'blocks/Comment/style.less'
|
|
54
|
+
]
|
|
55
|
+
};
|
|
52
56
|
export default CommentBlock;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
/*
|
|
3
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
4
3
|
|
|
5
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
5
|
you may not use this file except in compliance with the License.
|
|
@@ -18,12 +17,10 @@ import { Modal } from 'antd';
|
|
|
18
17
|
import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
19
18
|
const ConfirmModal = ({ blockId , events , content , components: { Icon } , methods , properties })=>{
|
|
20
19
|
useEffect(()=>{
|
|
21
|
-
methods.registerMethod('open', (args = {
|
|
22
|
-
|
|
23
|
-
const additionalProps = {
|
|
24
|
-
};
|
|
20
|
+
methods.registerMethod('open', (args = {})=>{
|
|
21
|
+
const additionalProps = {};
|
|
25
22
|
if (properties.icon) {
|
|
26
|
-
additionalProps.icon = /*#__PURE__*/
|
|
23
|
+
additionalProps.icon = /*#__PURE__*/ React.createElement(Icon, {
|
|
27
24
|
blockId: `${blockId}_icon`,
|
|
28
25
|
events: events,
|
|
29
26
|
properties: properties.icon
|
|
@@ -46,8 +43,22 @@ const ConfirmModal = ({ blockId , events , content , components: { Icon } , met
|
|
|
46
43
|
className: methods.makeCssClass(properties.modalStyle),
|
|
47
44
|
closable: properties.closable,
|
|
48
45
|
okText: properties.okText || 'Ok',
|
|
49
|
-
okButtonProps: properties.okButton
|
|
50
|
-
|
|
46
|
+
okButtonProps: properties.okButton && properties.okButton.icon ? {
|
|
47
|
+
...properties.okButton,
|
|
48
|
+
icon: properties.okButton.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
49
|
+
blockId: `${blockId}_ok_icon`,
|
|
50
|
+
events: events,
|
|
51
|
+
properties: properties.okButton.icon
|
|
52
|
+
})
|
|
53
|
+
} : properties.okButton,
|
|
54
|
+
cancelButtonProps: properties.cancelButton && properties.cancelButton.icon ? {
|
|
55
|
+
...properties.cancelButton,
|
|
56
|
+
icon: properties.cancelButton.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
57
|
+
blockId: `${blockId}_ok_icon`,
|
|
58
|
+
events: events,
|
|
59
|
+
properties: properties.cancelButton.icon
|
|
60
|
+
})
|
|
61
|
+
} : properties.cancelButton,
|
|
51
62
|
cancelText: properties.cancelText || 'Cancel',
|
|
52
63
|
centered: properties.centered || false,
|
|
53
64
|
mask: properties.mask !== undefined ? properties.mask : true,
|
|
@@ -70,9 +81,16 @@ const ConfirmModal = ({ blockId , events , content , components: { Icon } , met
|
|
|
70
81
|
});
|
|
71
82
|
});
|
|
72
83
|
});
|
|
73
|
-
return(/*#__PURE__*/
|
|
84
|
+
return(/*#__PURE__*/ React.createElement("div", {
|
|
74
85
|
id: blockId
|
|
75
86
|
}));
|
|
76
87
|
};
|
|
77
88
|
ConfirmModal.defaultProps = blockDefaultProps;
|
|
89
|
+
ConfirmModal.meta = {
|
|
90
|
+
category: 'container',
|
|
91
|
+
icons: [],
|
|
92
|
+
styles: [
|
|
93
|
+
'blocks/ConfirmModal/style.less'
|
|
94
|
+
]
|
|
95
|
+
};
|
|
78
96
|
export default ConfirmModal;
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"icon": {
|
|
32
32
|
"type": ["string", "object"],
|
|
33
|
-
"description": "Name of an
|
|
33
|
+
"description": "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 customize modal icon.",
|
|
34
34
|
"docs": {
|
|
35
35
|
"displayType": "icon"
|
|
36
36
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
/*
|
|
3
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
4
3
|
|
|
5
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
5
|
you may not use this file except in compliance with the License.
|
|
@@ -17,11 +16,17 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
17
16
|
import { Layout } from 'antd';
|
|
18
17
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
19
18
|
const Content = Layout.Content;
|
|
20
|
-
const ContentBlock = ({ blockId , content , methods , properties })=>/*#__PURE__*/
|
|
19
|
+
const ContentBlock = ({ blockId , content , methods , properties })=>/*#__PURE__*/ React.createElement(Content, {
|
|
21
20
|
id: blockId,
|
|
22
|
-
className: methods.makeCssClass(properties.style)
|
|
23
|
-
|
|
24
|
-
})
|
|
21
|
+
className: methods.makeCssClass(properties.style)
|
|
22
|
+
}, content.content && content.content())
|
|
25
23
|
;
|
|
26
24
|
ContentBlock.defaultProps = blockDefaultProps;
|
|
25
|
+
ContentBlock.meta = {
|
|
26
|
+
category: 'container',
|
|
27
|
+
icons: [],
|
|
28
|
+
styles: [
|
|
29
|
+
'blocks/Content/style.less'
|
|
30
|
+
]
|
|
31
|
+
};
|
|
27
32
|
export default ContentBlock;
|