@lowdefy/blocks-antd 4.0.0-alpha.7 → 4.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocks/Affix/Affix.js +3 -5
- package/dist/blocks/Alert/Alert.js +19 -7
- package/dist/blocks/AutoComplete/AutoComplete.js +29 -31
- package/dist/blocks/Avatar/Avatar.js +4 -6
- package/dist/blocks/Badge/Badge.js +4 -6
- package/dist/blocks/Breadcrumb/Breadcrumb.js +47 -41
- package/dist/blocks/Button/Button.js +7 -9
- package/dist/blocks/ButtonSelector/ButtonSelector.js +24 -26
- package/dist/blocks/Card/Card.js +3 -5
- package/dist/blocks/CheckboxSelector/CheckboxSelector.js +28 -31
- package/dist/blocks/CheckboxSwitch/CheckboxSwitch.js +9 -12
- package/dist/blocks/Collapse/Collapse.js +29 -18
- package/dist/blocks/Comment/Comment.js +4 -6
- package/dist/blocks/ConfirmModal/ConfirmModal.js +2 -3
- package/dist/blocks/Content/Content.js +3 -5
- package/dist/blocks/ControlledList/ControlledList.js +46 -56
- package/dist/blocks/DateRangeSelector/DateRangeSelector.js +45 -49
- package/dist/blocks/DateRangeSelector/schema.json +1 -1
- package/dist/blocks/DateSelector/DateSelector.js +38 -42
- package/dist/blocks/DateSelector/schema.json +1 -1
- package/dist/blocks/DateTimeSelector/DateTimeSelector.js +45 -49
- package/dist/blocks/DateTimeSelector/schema.json +1 -1
- package/dist/blocks/Descriptions/Descriptions.js +34 -36
- package/dist/blocks/Divider/Divider.js +6 -8
- package/dist/blocks/Drawer/Drawer.js +3 -5
- package/dist/blocks/Footer/Footer.js +3 -5
- package/dist/blocks/Header/Header.js +3 -5
- package/dist/blocks/Label/Label.js +52 -60
- package/dist/blocks/Layout/Layout.js +3 -5
- package/dist/blocks/Menu/Menu.js +127 -124
- package/dist/blocks/Message/Message.js +2 -3
- package/dist/blocks/MobileMenu/MobileMenu.js +75 -82
- package/dist/blocks/Modal/Modal.js +67 -57
- package/dist/blocks/MonthSelector/MonthSelector.js +37 -41
- package/dist/blocks/MonthSelector/schema.json +1 -1
- package/dist/blocks/MultipleSelector/MultipleSelector.js +93 -99
- package/dist/blocks/MultipleSelector/schema.json +3 -3
- package/dist/blocks/Notification/Notification.js +4 -5
- package/dist/blocks/NumberInput/NumberInput.js +2 -3
- package/dist/blocks/PageHCF/PageHCF.js +26 -33
- package/dist/blocks/PageHCSF/PageHCSF.js +53 -65
- package/dist/blocks/PageHSCF/PageHSCF.js +53 -65
- package/dist/blocks/PageHeaderMenu/PageHeaderMenu.js +141 -166
- package/dist/blocks/PageSHCF/PageSHCF.js +52 -64
- package/dist/blocks/PageSiderMenu/PageSiderMenu.js +245 -280
- package/dist/blocks/Pagination/Pagination.js +1 -2
- package/dist/blocks/Paragraph/Paragraph.js +13 -13
- package/dist/blocks/ParagraphInput/ParagraphInput.js +11 -11
- package/dist/blocks/PasswordInput/PasswordInput.js +2 -3
- package/dist/blocks/Progress/Progress.js +1 -2
- package/dist/blocks/RadioSelector/RadioSelector.js +28 -31
- package/dist/blocks/RatingSlider/RatingSlider.js +115 -122
- package/dist/blocks/RatingSlider/schema.json +2 -2
- package/dist/blocks/Result/Result.js +5 -7
- package/dist/blocks/Selector/Selector.js +85 -91
- package/dist/blocks/Selector/schema.json +2 -2
- package/dist/blocks/Sider/Sider.js +2 -5
- package/dist/blocks/Statistic/Statistic.js +3 -4
- package/dist/blocks/Switch/Switch.js +9 -12
- package/dist/blocks/Switch/schema.json +2 -2
- package/dist/blocks/Tabs/Tabs.js +27 -21
- package/dist/blocks/TextArea/TextArea.js +2 -3
- package/dist/blocks/TextInput/TextInput.js +4 -5
- package/dist/blocks/TimelineList/TimelineList.js +47 -36
- package/dist/blocks/Title/Title.js +13 -13
- package/dist/blocks/TitleInput/TitleInput.js +11 -11
- package/dist/blocks/Tooltip/Tooltip.js +3 -8
- package/dist/blocks/WeekSelector/WeekSelector.js +37 -41
- package/dist/blocks/WeekSelector/schema.json +1 -1
- package/package.json +9 -9
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
/*
|
|
3
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
4
3
|
|
|
@@ -17,7 +16,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
17
16
|
import { Affix } from 'antd';
|
|
18
17
|
import { get } from '@lowdefy/helpers';
|
|
19
18
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
20
|
-
const AffixBlock = ({ blockId , content , methods , properties , rename })=>/*#__PURE__*/
|
|
19
|
+
const AffixBlock = ({ blockId , content , methods , properties , rename })=>/*#__PURE__*/ React.createElement(Affix, {
|
|
21
20
|
id: blockId,
|
|
22
21
|
className: methods.makeCssClass(properties.style),
|
|
23
22
|
offsetBottom: properties.offsetBottom,
|
|
@@ -31,9 +30,8 @@ const AffixBlock = ({ blockId , content , methods , properties , rename })=>/*#
|
|
|
31
30
|
affixed
|
|
32
31
|
}
|
|
33
32
|
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
})
|
|
33
|
+
}
|
|
34
|
+
}, content.content && content.content())
|
|
37
35
|
;
|
|
38
36
|
AffixBlock.defaultProps = blockDefaultProps;
|
|
39
37
|
AffixBlock.meta = {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
/*
|
|
3
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
4
3
|
|
|
@@ -17,16 +16,30 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
17
16
|
import { Alert } from 'antd';
|
|
18
17
|
import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
19
18
|
import { type } from '@lowdefy/helpers';
|
|
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 AlertBlock = ({ blockId , content , events , components: { Icon } , methods , properties })=>{
|
|
21
34
|
const additionalProps = {};
|
|
22
35
|
if (properties.icon) {
|
|
23
|
-
additionalProps.icon = /*#__PURE__*/
|
|
36
|
+
additionalProps.icon = /*#__PURE__*/ React.createElement(Icon, {
|
|
24
37
|
blockId: `${blockId}_icon`,
|
|
25
38
|
events: events,
|
|
26
39
|
properties: properties.icon
|
|
27
40
|
});
|
|
28
41
|
}
|
|
29
|
-
return(/*#__PURE__*/
|
|
42
|
+
return(/*#__PURE__*/ React.createElement(Alert, _extends({
|
|
30
43
|
action: content.action && content.action(),
|
|
31
44
|
afterClose: ()=>methods.triggerEvent({
|
|
32
45
|
name: 'afterClose'
|
|
@@ -40,7 +53,7 @@ const AlertBlock = ({ blockId , content , events , components: { Icon } , metho
|
|
|
40
53
|
methods
|
|
41
54
|
}),
|
|
42
55
|
id: blockId,
|
|
43
|
-
message: type.isNone(properties.message) ? /*#__PURE__*/
|
|
56
|
+
message: type.isNone(properties.message) ? /*#__PURE__*/ React.createElement("div", {
|
|
44
57
|
style: {
|
|
45
58
|
marginBottom: -4
|
|
46
59
|
}
|
|
@@ -53,9 +66,8 @@ const AlertBlock = ({ blockId , content , events , components: { Icon } , metho
|
|
|
53
66
|
})
|
|
54
67
|
,
|
|
55
68
|
showIcon: properties.showIcon === false ? false : true,
|
|
56
|
-
type: properties.type
|
|
57
|
-
|
|
58
|
-
}));
|
|
69
|
+
type: properties.type
|
|
70
|
+
}, additionalProps)));
|
|
59
71
|
};
|
|
60
72
|
AlertBlock.defaultProps = blockDefaultProps;
|
|
61
73
|
AlertBlock.meta = {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
/*
|
|
3
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
4
3
|
|
|
@@ -22,7 +21,7 @@ import getUniqueValues from '../../getUniqueValues.js';
|
|
|
22
21
|
const Option = AutoComplete.Option;
|
|
23
22
|
const AutoCompleteInput = ({ blockId , components , events , loading , methods , properties , required , validation , value , })=>{
|
|
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,
|
|
@@ -35,7 +34,7 @@ const AutoCompleteInput = ({ blockId , components , events , loading , methods ,
|
|
|
35
34
|
required: required,
|
|
36
35
|
loading: loading,
|
|
37
36
|
content: {
|
|
38
|
-
content: ()=>/*#__PURE__*/
|
|
37
|
+
content: ()=>/*#__PURE__*/ React.createElement(AutoComplete, {
|
|
39
38
|
id: `${blockId}_input`,
|
|
40
39
|
autoFocus: properties.autoFocus,
|
|
41
40
|
backfill: properties.backfill,
|
|
@@ -66,34 +65,33 @@ const AutoCompleteInput = ({ blockId , components , events , loading , methods ,
|
|
|
66
65
|
}
|
|
67
66
|
});
|
|
68
67
|
},
|
|
69
|
-
value: type.isNone(value) ? undefined : value
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
})
|
|
68
|
+
value: type.isNone(value) ? undefined : value
|
|
69
|
+
}, (properties.options || []).map((opt, i)=>type.isPrimitive(opt) ? /*#__PURE__*/ React.createElement(Option, {
|
|
70
|
+
className: methods.makeCssClass(properties.optionsStyle),
|
|
71
|
+
id: `${blockId}_${i}`,
|
|
72
|
+
key: i,
|
|
73
|
+
value: `${i}`
|
|
74
|
+
}, renderHtml({
|
|
75
|
+
html: `${opt}`,
|
|
76
|
+
methods
|
|
77
|
+
})) : /*#__PURE__*/ React.createElement(Option, {
|
|
78
|
+
className: methods.makeCssClass([
|
|
79
|
+
properties.optionsStyle,
|
|
80
|
+
opt.style
|
|
81
|
+
]),
|
|
82
|
+
disabled: opt.disabled,
|
|
83
|
+
filterstring: opt.filterString,
|
|
84
|
+
id: `${blockId}_${i}`,
|
|
85
|
+
key: i,
|
|
86
|
+
value: `${i}`
|
|
87
|
+
}, type.isNone(opt.label) ? renderHtml({
|
|
88
|
+
html: `${opt.value}`,
|
|
89
|
+
methods
|
|
90
|
+
}) : renderHtml({
|
|
91
|
+
html: opt.label,
|
|
92
|
+
methods
|
|
93
|
+
}))
|
|
94
|
+
))
|
|
97
95
|
}
|
|
98
96
|
}));
|
|
99
97
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
/*
|
|
3
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
4
3
|
|
|
@@ -16,7 +15,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
16
15
|
*/ import React from 'react';
|
|
17
16
|
import { Avatar } from 'antd';
|
|
18
17
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
19
|
-
const AvatarBlock = ({ blockId , events , components: { Icon } , methods , properties })=>/*#__PURE__*/
|
|
18
|
+
const AvatarBlock = ({ blockId , events , components: { Icon } , methods , properties })=>/*#__PURE__*/ React.createElement(Avatar, {
|
|
20
19
|
id: blockId,
|
|
21
20
|
alt: properties.alt,
|
|
22
21
|
gap: properties.gap,
|
|
@@ -34,13 +33,12 @@ const AvatarBlock = ({ blockId , events , components: { Icon } , methods , prop
|
|
|
34
33
|
},
|
|
35
34
|
properties.style,
|
|
36
35
|
]),
|
|
37
|
-
icon: properties.icon && /*#__PURE__*/
|
|
36
|
+
icon: properties.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
38
37
|
blockId: `${blockId}_icon`,
|
|
39
38
|
events: events,
|
|
40
39
|
properties: properties.icon
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
})
|
|
40
|
+
})
|
|
41
|
+
}, properties.content)
|
|
44
42
|
;
|
|
45
43
|
AvatarBlock.defaultProps = blockDefaultProps;
|
|
46
44
|
AvatarBlock.meta = {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
/*
|
|
3
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
4
3
|
|
|
@@ -17,7 +16,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
17
16
|
import { type } from '@lowdefy/helpers';
|
|
18
17
|
import { Badge } from 'antd';
|
|
19
18
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
20
|
-
const BadgeBlock = ({ blockId , events , content , components: { Icon } , properties })=>/*#__PURE__*/
|
|
19
|
+
const BadgeBlock = ({ blockId , events , content , components: { Icon } , properties })=>/*#__PURE__*/ React.createElement(Badge, {
|
|
21
20
|
id: blockId,
|
|
22
21
|
color: properties.color,
|
|
23
22
|
dot: properties.dot,
|
|
@@ -28,13 +27,12 @@ const BadgeBlock = ({ blockId , events , content , components: { Icon } , prope
|
|
|
28
27
|
status: properties.status,
|
|
29
28
|
text: properties.text,
|
|
30
29
|
title: properties.title,
|
|
31
|
-
count: properties.icon && /*#__PURE__*/
|
|
30
|
+
count: properties.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
32
31
|
blockId: `${blockId}_icon`,
|
|
33
32
|
events: events,
|
|
34
33
|
properties: properties.icon
|
|
35
|
-
}) || properties.count
|
|
36
|
-
|
|
37
|
-
})
|
|
34
|
+
}) || properties.count
|
|
35
|
+
}, content.content && content.content())
|
|
38
36
|
;
|
|
39
37
|
BadgeBlock.defaultProps = blockDefaultProps;
|
|
40
38
|
BadgeBlock.meta = {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
1
|
/*
|
|
3
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
4
3
|
|
|
@@ -17,53 +16,60 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
17
16
|
import { type, get } from '@lowdefy/helpers';
|
|
18
17
|
import { Breadcrumb } from 'antd';
|
|
19
18
|
import { blockDefaultProps } 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 BreadcrumbBlock = ({ blockId , events , components: { Icon , Link } , methods , properties , rename , })=>{
|
|
21
34
|
const onClickActionName = get(rename, 'events.onClick', {
|
|
22
35
|
default: 'onClick'
|
|
23
36
|
});
|
|
24
|
-
return(/*#__PURE__*/
|
|
37
|
+
return(/*#__PURE__*/ React.createElement(Breadcrumb, {
|
|
25
38
|
id: blockId,
|
|
26
39
|
separator: properties.separator,
|
|
27
|
-
className: methods.makeCssClass(properties.style)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
),
|
|
37
|
-
children: /*#__PURE__*/ _jsx(Link, {
|
|
38
|
-
id: `${blockId}_${index}`,
|
|
39
|
-
className: methods.makeCssClass([
|
|
40
|
-
{
|
|
41
|
-
cursor: events[onClickActionName] && 'pointer'
|
|
42
|
-
},
|
|
43
|
-
link.style,
|
|
44
|
-
]),
|
|
45
|
-
...link,
|
|
46
|
-
children: (defaultTitle)=>/*#__PURE__*/ _jsxs(_Fragment, {
|
|
47
|
-
children: [
|
|
48
|
-
link.icon && /*#__PURE__*/ _jsx(Icon, {
|
|
49
|
-
blockId: `${blockId}_${index}_icon`,
|
|
50
|
-
events: events,
|
|
51
|
-
properties: {
|
|
52
|
-
name: type.isString(link.icon) && link.icon,
|
|
53
|
-
...type.isObject(link.icon) ? link.icon : {},
|
|
54
|
-
style: {
|
|
55
|
-
paddingRight: 8,
|
|
56
|
-
...link.icon.style || {}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}),
|
|
60
|
-
type.isString(link) ? link : link.label || defaultTitle
|
|
61
|
-
]
|
|
62
|
-
})
|
|
40
|
+
className: methods.makeCssClass(properties.style)
|
|
41
|
+
}, (properties.list || []).map((link, index)=>/*#__PURE__*/ React.createElement(Breadcrumb.Item, {
|
|
42
|
+
key: index,
|
|
43
|
+
onClick: events[onClickActionName] && (()=>methods.triggerEvent({
|
|
44
|
+
name: onClickActionName,
|
|
45
|
+
event: {
|
|
46
|
+
link,
|
|
47
|
+
index
|
|
48
|
+
}
|
|
63
49
|
})
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
50
|
+
)
|
|
51
|
+
}, /*#__PURE__*/ React.createElement(Link, _extends({
|
|
52
|
+
id: `${blockId}_${index}`,
|
|
53
|
+
className: methods.makeCssClass([
|
|
54
|
+
{
|
|
55
|
+
cursor: events[onClickActionName] && 'pointer'
|
|
56
|
+
},
|
|
57
|
+
link.style,
|
|
58
|
+
])
|
|
59
|
+
}, link), (defaultTitle)=>/*#__PURE__*/ React.createElement(React.Fragment, null, link.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
60
|
+
blockId: `${blockId}_${index}_icon`,
|
|
61
|
+
events: events,
|
|
62
|
+
properties: {
|
|
63
|
+
name: type.isString(link.icon) && link.icon,
|
|
64
|
+
...type.isObject(link.icon) ? link.icon : {},
|
|
65
|
+
style: {
|
|
66
|
+
paddingRight: 8,
|
|
67
|
+
...link.icon.style || {}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}), type.isString(link) ? link : link.label || defaultTitle)
|
|
71
|
+
))
|
|
72
|
+
)));
|
|
67
73
|
};
|
|
68
74
|
BreadcrumbBlock.defaultProps = blockDefaultProps;
|
|
69
75
|
BreadcrumbBlock.meta = {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
/*
|
|
3
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
4
3
|
|
|
@@ -22,7 +21,7 @@ const ButtonBlock = ({ blockId , events , loading , components: { Icon } , meth
|
|
|
22
21
|
const onClickActionName = get(rename, 'events.onClick', {
|
|
23
22
|
default: 'onClick'
|
|
24
23
|
});
|
|
25
|
-
return(/*#__PURE__*/
|
|
24
|
+
return(/*#__PURE__*/ React.createElement(Button, {
|
|
26
25
|
block: properties.block,
|
|
27
26
|
className: methods.makeCssClass([
|
|
28
27
|
{
|
|
@@ -50,7 +49,7 @@ const ButtonBlock = ({ blockId , events , loading , components: { Icon } , meth
|
|
|
50
49
|
type: get(properties, 'type', {
|
|
51
50
|
default: 'primary'
|
|
52
51
|
}),
|
|
53
|
-
icon: properties.icon && /*#__PURE__*/
|
|
52
|
+
icon: properties.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
54
53
|
blockId: `${blockId}_icon`,
|
|
55
54
|
events: events,
|
|
56
55
|
properties: properties.icon
|
|
@@ -58,12 +57,11 @@ const ButtonBlock = ({ blockId , events , loading , components: { Icon } , meth
|
|
|
58
57
|
onClick: onClick || (()=>methods.triggerEvent({
|
|
59
58
|
name: onClickActionName
|
|
60
59
|
})
|
|
61
|
-
)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}));
|
|
60
|
+
)
|
|
61
|
+
}, !properties.hideTitle && renderHtml({
|
|
62
|
+
html: type.isNone(properties.title) ? blockId : properties.title,
|
|
63
|
+
methods
|
|
64
|
+
})));
|
|
67
65
|
};
|
|
68
66
|
ButtonBlock.defaultProps = blockDefaultProps;
|
|
69
67
|
ButtonBlock.meta = {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
/*
|
|
3
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
4
3
|
|
|
@@ -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,
|
|
@@ -35,7 +34,7 @@ const ButtonSelector = ({ blockId , components , events , loading , properties ,
|
|
|
35
34
|
required: required,
|
|
36
35
|
loading: loading,
|
|
37
36
|
content: {
|
|
38
|
-
content: ()=>/*#__PURE__*/
|
|
37
|
+
content: ()=>/*#__PURE__*/ React.createElement(Radio.Group, {
|
|
39
38
|
id: `${blockId}_input`,
|
|
40
39
|
className: methods.makeCssClass([
|
|
41
40
|
properties.color && {
|
|
@@ -55,29 +54,28 @@ const ButtonSelector = ({ blockId , components , events , loading , properties ,
|
|
|
55
54
|
name: 'onChange'
|
|
56
55
|
});
|
|
57
56
|
},
|
|
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
|
-
})
|
|
57
|
+
value: type.isNone(value) ? undefined : getValueIndex(value, properties.options || [])
|
|
58
|
+
}, uniqueValueOptions.map((opt, i)=>type.isPrimitive(opt) ? /*#__PURE__*/ React.createElement(Radio.Button, {
|
|
59
|
+
id: `${blockId}_${i}`,
|
|
60
|
+
key: i,
|
|
61
|
+
value: `${i}`
|
|
62
|
+
}, renderHtml({
|
|
63
|
+
html: `${opt}`,
|
|
64
|
+
methods
|
|
65
|
+
})) : /*#__PURE__*/ React.createElement(Radio.Button, {
|
|
66
|
+
id: `${blockId}_${i}`,
|
|
67
|
+
key: i,
|
|
68
|
+
value: `${i}`,
|
|
69
|
+
disabled: opt.disabled,
|
|
70
|
+
className: methods.makeCssClass(opt.style)
|
|
71
|
+
}, type.isNone(opt.label) ? renderHtml({
|
|
72
|
+
html: `${opt.value}`,
|
|
73
|
+
methods
|
|
74
|
+
}) : renderHtml({
|
|
75
|
+
html: opt.label,
|
|
76
|
+
methods
|
|
77
|
+
}))
|
|
78
|
+
))
|
|
81
79
|
}
|
|
82
80
|
}));
|
|
83
81
|
};
|
package/dist/blocks/Card/Card.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
/*
|
|
3
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
4
3
|
|
|
@@ -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,8 @@ 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;
|
|
47
45
|
CardBlock.meta = {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
/*
|
|
3
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
4
3
|
|
|
@@ -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,
|
|
@@ -35,7 +34,7 @@ const CheckboxSelector = ({ blockId , components , events , loading , properties
|
|
|
35
34
|
required: required,
|
|
36
35
|
loading: loading,
|
|
37
36
|
content: {
|
|
38
|
-
content: ()=>/*#__PURE__*/
|
|
37
|
+
content: ()=>/*#__PURE__*/ React.createElement(Checkbox.Group, {
|
|
39
38
|
id: `${blockId}_input`,
|
|
40
39
|
className: methods.makeCssClass([
|
|
41
40
|
properties.color && {
|
|
@@ -57,34 +56,32 @@ const CheckboxSelector = ({ blockId , components , events , loading , properties
|
|
|
57
56
|
name: 'onChange'
|
|
58
57
|
});
|
|
59
58
|
},
|
|
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
|
-
})
|
|
59
|
+
value: getValueIndex(value, uniqueValueOptions, true)
|
|
60
|
+
}, /*#__PURE__*/ React.createElement(Space, {
|
|
61
|
+
direction: properties.direction,
|
|
62
|
+
wrap: type.isNone(properties.wrap) ? true : properties.wrap,
|
|
63
|
+
align: type.isNone(properties.align) ? 'start' : properties.align
|
|
64
|
+
}, uniqueValueOptions.map((opt, i)=>type.isPrimitive(opt) ? /*#__PURE__*/ React.createElement(Checkbox, {
|
|
65
|
+
id: `${blockId}_${i}`,
|
|
66
|
+
key: i,
|
|
67
|
+
value: `${i}`
|
|
68
|
+
}, renderHtml({
|
|
69
|
+
html: `${opt}`,
|
|
70
|
+
methods
|
|
71
|
+
})) : /*#__PURE__*/ React.createElement(Checkbox, {
|
|
72
|
+
id: `${blockId}_${i}`,
|
|
73
|
+
key: i,
|
|
74
|
+
value: `${i}`,
|
|
75
|
+
disabled: opt.disabled,
|
|
76
|
+
className: methods.makeCssClass(opt.style)
|
|
77
|
+
}, type.isNone(opt.label) ? renderHtml({
|
|
78
|
+
html: `${opt.value}`,
|
|
79
|
+
methods
|
|
80
|
+
}) : renderHtml({
|
|
81
|
+
html: opt.label,
|
|
82
|
+
methods
|
|
83
|
+
}))
|
|
84
|
+
)))
|
|
88
85
|
}
|
|
89
86
|
}));
|
|
90
87
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
/*
|
|
3
2
|
Copyright 2020-2021 Lowdefy, Inc
|
|
4
3
|
|
|
@@ -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,
|
|
@@ -31,7 +30,7 @@ const CheckboxSwitch = ({ blockId , components , events , loading , properties ,
|
|
|
31
30
|
required: required,
|
|
32
31
|
loading: loading,
|
|
33
32
|
content: {
|
|
34
|
-
content: ()=>/*#__PURE__*/
|
|
33
|
+
content: ()=>/*#__PURE__*/ React.createElement(Checkbox, {
|
|
35
34
|
id: `${blockId}_input`,
|
|
36
35
|
checked: value,
|
|
37
36
|
disabled: properties.disabled,
|
|
@@ -52,15 +51,13 @@ const CheckboxSwitch = ({ blockId , components , events , loading , properties ,
|
|
|
52
51
|
methods.triggerEvent({
|
|
53
52
|
name: 'onChange'
|
|
54
53
|
});
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
})
|
|
63
|
-
})
|
|
54
|
+
}
|
|
55
|
+
}, /*#__PURE__*/ React.createElement(Space, {
|
|
56
|
+
wrap: true
|
|
57
|
+
}, renderHtml({
|
|
58
|
+
html: properties.description,
|
|
59
|
+
methods
|
|
60
|
+
})))
|
|
64
61
|
}
|
|
65
62
|
}));
|
|
66
63
|
};
|