@lowdefy/blocks-antd 4.0.0-alpha.9 → 4.0.0-rc.1
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 +2 -3
- package/dist/blocks/Affix/style.less +1 -1
- package/dist/blocks/Alert/Alert.js +10 -12
- package/dist/blocks/Alert/style.less +1 -1
- package/dist/blocks/AutoComplete/AutoComplete.js +17 -39
- package/dist/blocks/AutoComplete/schema.json +5 -46
- package/dist/blocks/AutoComplete/style.less +1 -1
- package/dist/blocks/Avatar/Avatar.js +4 -6
- package/dist/blocks/Avatar/style.less +1 -1
- package/dist/blocks/Badge/Badge.js +2 -3
- package/dist/blocks/Badge/style.less +1 -1
- package/dist/blocks/Breadcrumb/Breadcrumb.js +13 -16
- package/dist/blocks/Breadcrumb/style.less +1 -1
- package/dist/blocks/Button/Button.js +6 -7
- package/dist/blocks/Button/style.less +1 -1
- package/dist/blocks/ButtonSelector/ButtonSelector.js +6 -7
- package/dist/blocks/ButtonSelector/style.less +1 -1
- package/dist/blocks/Card/Card.js +4 -6
- package/dist/blocks/Card/style.less +1 -1
- package/dist/blocks/CheckboxSelector/CheckboxSelector.js +6 -7
- package/dist/blocks/CheckboxSelector/style.less +1 -1
- package/dist/blocks/CheckboxSwitch/CheckboxSwitch.js +5 -5
- package/dist/blocks/CheckboxSwitch/style.less +1 -1
- package/dist/blocks/Collapse/Collapse.js +11 -15
- package/dist/blocks/Collapse/style.less +1 -1
- package/dist/blocks/Comment/Comment.js +3 -3
- package/dist/blocks/Comment/style.less +1 -1
- package/dist/blocks/ConfirmModal/ConfirmModal.js +3 -3
- package/dist/blocks/ConfirmModal/style.less +1 -1
- package/dist/blocks/Content/Content.js +2 -3
- package/dist/blocks/Content/style.less +1 -1
- package/dist/blocks/ControlledList/ControlledList.js +5 -5
- package/dist/blocks/ControlledList/style.less +1 -1
- package/dist/blocks/DateRangeSelector/DateRangeSelector.js +11 -14
- package/dist/blocks/DateRangeSelector/style.less +1 -1
- package/dist/blocks/DateSelector/DateSelector.js +7 -7
- package/dist/blocks/DateSelector/style.less +1 -1
- package/dist/blocks/DateTimeSelector/DateTimeSelector.js +10 -8
- package/dist/blocks/DateTimeSelector/style.less +1 -1
- package/dist/blocks/Descriptions/Descriptions.js +13 -15
- package/dist/blocks/Descriptions/style.less +1 -1
- package/dist/blocks/Divider/Divider.js +2 -3
- package/dist/blocks/Divider/style.less +1 -1
- package/dist/blocks/Drawer/Drawer.js +5 -7
- package/dist/blocks/Drawer/style.less +1 -1
- package/dist/blocks/Footer/Footer.js +2 -3
- package/dist/blocks/Footer/style.less +1 -1
- package/dist/blocks/Header/Header.js +3 -4
- package/dist/blocks/Header/style.less +1 -1
- package/dist/blocks/Label/Label.js +23 -27
- package/dist/blocks/Label/getLabelCol.js +1 -1
- package/dist/blocks/Label/getWrapperCol.js +1 -1
- package/dist/blocks/Label/labelLogic.js +15 -15
- package/dist/blocks/Label/style.less +5 -1
- package/dist/blocks/Layout/Layout.js +2 -3
- package/dist/blocks/Layout/style.less +1 -1
- package/dist/blocks/Menu/Menu.js +49 -57
- package/dist/blocks/Menu/style.less +1 -1
- package/dist/blocks/Message/Message.js +4 -5
- package/dist/blocks/Message/style.less +1 -1
- package/dist/blocks/MobileMenu/MobileMenu.js +7 -9
- package/dist/blocks/MobileMenu/style.less +1 -1
- package/dist/blocks/Modal/Modal.js +11 -14
- package/dist/blocks/Modal/style.less +1 -1
- package/dist/blocks/MonthSelector/MonthSelector.js +7 -7
- package/dist/blocks/MonthSelector/style.less +1 -1
- package/dist/blocks/MultipleSelector/MultipleSelector.js +9 -11
- package/dist/blocks/MultipleSelector/style.less +1 -1
- package/dist/blocks/Notification/Notification.js +5 -7
- package/dist/blocks/Notification/style.less +1 -1
- package/dist/blocks/NumberInput/NumberInput.js +6 -4
- package/dist/blocks/NumberInput/schema.json +7 -0
- package/dist/blocks/NumberInput/style.less +1 -1
- package/dist/blocks/PageHCF/PageHCF.js +2 -3
- package/dist/blocks/PageHCF/style.less +1 -1
- package/dist/blocks/PageHCSF/PageHCSF.js +2 -3
- package/dist/blocks/PageHCSF/style.less +1 -1
- package/dist/blocks/PageHSCF/PageHSCF.js +2 -3
- package/dist/blocks/PageHSCF/style.less +1 -1
- package/dist/blocks/PageHeaderMenu/PageHeaderMenu.js +47 -35
- package/dist/blocks/PageHeaderMenu/schema.json +5 -5
- package/dist/blocks/PageHeaderMenu/style.less +1 -1
- package/dist/blocks/PageSHCF/PageSHCF.js +2 -3
- package/dist/blocks/PageSHCF/style.less +1 -1
- package/dist/blocks/PageSiderMenu/PageSiderMenu.js +45 -43
- package/dist/blocks/PageSiderMenu/schema.json +5 -5
- package/dist/blocks/PageSiderMenu/style.less +1 -1
- package/dist/blocks/Pagination/Pagination.js +4 -5
- package/dist/blocks/Pagination/style.less +1 -1
- package/dist/blocks/Paragraph/Paragraph.js +3 -4
- package/dist/blocks/Paragraph/style.less +2 -1
- package/dist/blocks/ParagraphInput/ParagraphInput.js +5 -5
- package/dist/blocks/ParagraphInput/style.less +1 -1
- package/dist/blocks/PasswordInput/PasswordInput.js +7 -6
- package/dist/blocks/PasswordInput/style.less +1 -1
- package/dist/blocks/Progress/Progress.js +2 -3
- package/dist/blocks/Progress/style.less +1 -1
- package/dist/blocks/RadioSelector/RadioSelector.js +9 -10
- package/dist/blocks/RadioSelector/style.less +1 -1
- package/dist/blocks/RatingSlider/RatingSlider.js +11 -13
- package/dist/blocks/RatingSlider/style.less +1 -1
- package/dist/blocks/Result/Result.js +2 -3
- package/dist/blocks/Result/style.less +1 -1
- package/dist/blocks/Selector/Selector.js +9 -11
- package/dist/blocks/Selector/style.less +1 -1
- package/dist/blocks/Sider/Sider.js +5 -7
- package/dist/blocks/Sider/style.less +1 -1
- package/dist/blocks/Statistic/Statistic.js +2 -3
- package/dist/blocks/Statistic/style.less +1 -1
- package/dist/blocks/Switch/Switch.js +5 -5
- package/dist/blocks/Switch/style.less +1 -1
- package/dist/blocks/Tabs/Tabs.js +11 -16
- package/dist/blocks/Tabs/style.less +1 -1
- package/dist/blocks/TextArea/TextArea.js +6 -6
- package/dist/blocks/TextArea/style.less +1 -1
- package/dist/blocks/TextInput/TextInput.js +9 -8
- package/dist/blocks/TextInput/style.less +1 -1
- package/dist/blocks/TimelineList/TimelineList.js +10 -10
- package/dist/blocks/TimelineList/style.less +1 -1
- package/dist/blocks/Title/Title.js +5 -5
- package/dist/blocks/Title/style.less +2 -1
- package/dist/blocks/TitleInput/TitleInput.js +6 -6
- package/dist/blocks/TitleInput/style.less +1 -1
- package/dist/blocks/Tooltip/Tooltip.js +2 -3
- package/dist/blocks/Tooltip/style.less +1 -1
- package/dist/blocks/WeekSelector/WeekSelector.js +7 -7
- package/dist/blocks/WeekSelector/style.less +1 -1
- package/dist/blocks.js +1 -1
- package/dist/color.js +1 -1
- package/dist/disabledDate.js +4 -7
- package/dist/getUniqueValues.js +1 -1
- package/dist/getValueIndex.js +1 -1
- package/dist/style.less +1 -1
- package/dist/types.js +1 -1
- package/dist/useRunAfterUpdate.js +1 -1
- package/dist/validationExamples.js +2 -2
- package/package.json +28 -29
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -31,8 +31,7 @@ const AffixBlock = ({ blockId , content , methods , properties , rename })=>/*#
|
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
}, content.content && content.content())
|
|
35
|
-
;
|
|
34
|
+
}, content.content && content.content());
|
|
36
35
|
AffixBlock.defaultProps = blockDefaultProps;
|
|
37
36
|
AffixBlock.meta = {
|
|
38
37
|
category: 'container',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -12,11 +12,7 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { Alert } from 'antd';
|
|
17
|
-
import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
18
|
-
import { type } from '@lowdefy/helpers';
|
|
19
|
-
function _extends() {
|
|
15
|
+
*/ function _extends() {
|
|
20
16
|
_extends = Object.assign || function(target) {
|
|
21
17
|
for(var i = 1; i < arguments.length; i++){
|
|
22
18
|
var source = arguments[i];
|
|
@@ -30,6 +26,10 @@ function _extends() {
|
|
|
30
26
|
};
|
|
31
27
|
return _extends.apply(this, arguments);
|
|
32
28
|
}
|
|
29
|
+
import React from 'react';
|
|
30
|
+
import { Alert } from 'antd';
|
|
31
|
+
import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
32
|
+
import { type } from '@lowdefy/helpers';
|
|
33
33
|
const AlertBlock = ({ blockId , content , events , components: { Icon } , methods , properties })=>{
|
|
34
34
|
const additionalProps = {};
|
|
35
35
|
if (properties.icon) {
|
|
@@ -39,12 +39,11 @@ const AlertBlock = ({ blockId , content , events , components: { Icon } , metho
|
|
|
39
39
|
properties: properties.icon
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
return
|
|
42
|
+
return /*#__PURE__*/ React.createElement(Alert, _extends({
|
|
43
43
|
action: content.action && content.action(),
|
|
44
44
|
afterClose: ()=>methods.triggerEvent({
|
|
45
45
|
name: 'afterClose'
|
|
46
|
-
})
|
|
47
|
-
,
|
|
46
|
+
}),
|
|
48
47
|
banner: properties.banner,
|
|
49
48
|
closable: properties.closable,
|
|
50
49
|
closeText: properties.closeText,
|
|
@@ -63,11 +62,10 @@ const AlertBlock = ({ blockId , content , events , components: { Icon } , metho
|
|
|
63
62
|
}),
|
|
64
63
|
onClose: ()=>methods.triggerEvent({
|
|
65
64
|
name: 'onClose'
|
|
66
|
-
})
|
|
67
|
-
,
|
|
65
|
+
}),
|
|
68
66
|
showIcon: properties.showIcon === false ? false : true,
|
|
69
67
|
type: properties.type
|
|
70
|
-
}, additionalProps))
|
|
68
|
+
}, additionalProps));
|
|
71
69
|
};
|
|
72
70
|
AlertBlock.defaultProps = blockDefaultProps;
|
|
73
71
|
AlertBlock.meta = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -14,14 +14,12 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import React from 'react';
|
|
16
16
|
import { AutoComplete } from 'antd';
|
|
17
|
-
import { blockDefaultProps
|
|
17
|
+
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
18
18
|
import { type } from '@lowdefy/helpers';
|
|
19
19
|
import Label from '../Label/Label.js';
|
|
20
|
-
import getUniqueValues from '../../getUniqueValues.js';
|
|
21
20
|
const Option = AutoComplete.Option;
|
|
22
|
-
const AutoCompleteInput = ({ blockId , components , events , loading , methods , properties , required , validation , value
|
|
23
|
-
|
|
24
|
-
return(/*#__PURE__*/ React.createElement(Label, {
|
|
21
|
+
const AutoCompleteInput = ({ blockId , components , events , loading , methods , properties , required , validation , value })=>{
|
|
22
|
+
return /*#__PURE__*/ React.createElement(Label, {
|
|
25
23
|
blockId: blockId,
|
|
26
24
|
components: components,
|
|
27
25
|
events: events,
|
|
@@ -38,20 +36,20 @@ const AutoCompleteInput = ({ blockId , components , events , loading , methods ,
|
|
|
38
36
|
autoFocus: properties.autoFocus,
|
|
39
37
|
backfill: properties.backfill,
|
|
40
38
|
bordered: properties.bordered,
|
|
41
|
-
className: methods.makeCssClass(
|
|
39
|
+
className: methods.makeCssClass([
|
|
40
|
+
{
|
|
41
|
+
width: '100%'
|
|
42
|
+
},
|
|
43
|
+
properties.inputStyle
|
|
44
|
+
]),
|
|
42
45
|
defaultOpen: properties.defaultOpen,
|
|
43
46
|
disabled: properties.disabled || loading,
|
|
44
47
|
placeholder: properties.placeholder || 'Type or select item',
|
|
45
48
|
allowClear: properties.allowClear !== false,
|
|
46
49
|
size: properties.size,
|
|
47
|
-
filterOption: (input, option)
|
|
48
|
-
,
|
|
50
|
+
filterOption: (input, option)=>`${option.value}`.toLowerCase().indexOf(input.toLowerCase()) >= 0,
|
|
49
51
|
onChange: (newVal)=>{
|
|
50
|
-
|
|
51
|
-
if (type.isNone(val)) {
|
|
52
|
-
val = newVal;
|
|
53
|
-
}
|
|
54
|
-
methods.setValue(val);
|
|
52
|
+
methods.setValue(newVal);
|
|
55
53
|
methods.triggerEvent({
|
|
56
54
|
name: 'onChange'
|
|
57
55
|
});
|
|
@@ -64,35 +62,15 @@ const AutoCompleteInput = ({ blockId , components , events , loading , methods ,
|
|
|
64
62
|
}
|
|
65
63
|
});
|
|
66
64
|
},
|
|
67
|
-
value: type.isNone(value) ? undefined : value
|
|
68
|
-
}, (properties.options || []).map((opt, i)
|
|
65
|
+
value: type.isNone(value) ? undefined : `${value}`
|
|
66
|
+
}, (properties.options || []).map((opt, i)=>/*#__PURE__*/ React.createElement(Option, {
|
|
69
67
|
className: methods.makeCssClass(properties.optionsStyle),
|
|
70
68
|
id: `${blockId}_${i}`,
|
|
71
69
|
key: i,
|
|
72
|
-
value: `${
|
|
73
|
-
},
|
|
74
|
-
html: `${opt}`,
|
|
75
|
-
methods
|
|
76
|
-
})) : /*#__PURE__*/ React.createElement(Option, {
|
|
77
|
-
className: methods.makeCssClass([
|
|
78
|
-
properties.optionsStyle,
|
|
79
|
-
opt.style
|
|
80
|
-
]),
|
|
81
|
-
disabled: opt.disabled,
|
|
82
|
-
filterstring: opt.filterString,
|
|
83
|
-
id: `${blockId}_${i}`,
|
|
84
|
-
key: i,
|
|
85
|
-
value: `${i}`
|
|
86
|
-
}, type.isNone(opt.label) ? renderHtml({
|
|
87
|
-
html: `${opt.value}`,
|
|
88
|
-
methods
|
|
89
|
-
}) : renderHtml({
|
|
90
|
-
html: opt.label,
|
|
91
|
-
methods
|
|
92
|
-
}))
|
|
93
|
-
))
|
|
70
|
+
value: `${opt}`
|
|
71
|
+
}, `${opt}`)))
|
|
94
72
|
}
|
|
95
|
-
})
|
|
73
|
+
});
|
|
96
74
|
};
|
|
97
75
|
AutoCompleteInput.defaultProps = blockDefaultProps;
|
|
98
76
|
AutoCompleteInput.meta = {
|
|
@@ -101,52 +101,11 @@
|
|
|
101
101
|
},
|
|
102
102
|
"options": {
|
|
103
103
|
"default": [],
|
|
104
|
-
"
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
"type": "string"
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"type": "array",
|
|
114
|
-
"description": "Options can either be an array of string values, on an array of label, value pairs.",
|
|
115
|
-
"items": {
|
|
116
|
-
"type": "object",
|
|
117
|
-
"required": ["value"],
|
|
118
|
-
"properties": {
|
|
119
|
-
"label": {
|
|
120
|
-
"type": "string",
|
|
121
|
-
"description": "Value label shown to user - supports html."
|
|
122
|
-
},
|
|
123
|
-
"value": {
|
|
124
|
-
"description": "Value selected. Can be of any type.",
|
|
125
|
-
"type": "string",
|
|
126
|
-
"docs": {
|
|
127
|
-
"displayType": "yaml"
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
"disabled": {
|
|
131
|
-
"type": "boolean",
|
|
132
|
-
"default": false,
|
|
133
|
-
"description": "Disable the option if true."
|
|
134
|
-
},
|
|
135
|
-
"filterString": {
|
|
136
|
-
"type": "string",
|
|
137
|
-
"description": "String to match against when filtering selector options during. If no filterString is provided the filter method matches against options.label."
|
|
138
|
-
},
|
|
139
|
-
"style": {
|
|
140
|
-
"type": "object",
|
|
141
|
-
"description": "Css style to applied to option.",
|
|
142
|
-
"docs": {
|
|
143
|
-
"displayType": "yaml"
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
]
|
|
104
|
+
"type": "array",
|
|
105
|
+
"description": "Options can either be an array of string values.",
|
|
106
|
+
"items": {
|
|
107
|
+
"type": "string"
|
|
108
|
+
}
|
|
150
109
|
},
|
|
151
110
|
"optionsStyle": {
|
|
152
111
|
"type": "object",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -24,22 +24,20 @@ const AvatarBlock = ({ blockId , events , components: { Icon } , methods , prop
|
|
|
24
24
|
src: properties.src,
|
|
25
25
|
onClick: ()=>methods.triggerEvent({
|
|
26
26
|
name: 'onClick'
|
|
27
|
-
})
|
|
28
|
-
,
|
|
27
|
+
}),
|
|
29
28
|
className: methods.makeCssClass([
|
|
30
29
|
{
|
|
31
30
|
backgroundColor: !properties.src && properties.color,
|
|
32
31
|
cursor: events.onClick && 'pointer'
|
|
33
32
|
},
|
|
34
|
-
properties.style
|
|
33
|
+
properties.style
|
|
35
34
|
]),
|
|
36
35
|
icon: properties.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
37
36
|
blockId: `${blockId}_icon`,
|
|
38
37
|
events: events,
|
|
39
38
|
properties: properties.icon
|
|
40
39
|
})
|
|
41
|
-
}, properties.content)
|
|
42
|
-
;
|
|
40
|
+
}, properties.content);
|
|
43
41
|
AvatarBlock.defaultProps = blockDefaultProps;
|
|
44
42
|
AvatarBlock.meta = {
|
|
45
43
|
category: 'display',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -32,8 +32,7 @@ const BadgeBlock = ({ blockId , events , content , components: { Icon } , prope
|
|
|
32
32
|
events: events,
|
|
33
33
|
properties: properties.icon
|
|
34
34
|
}) || properties.count
|
|
35
|
-
}, content.content && content.content())
|
|
36
|
-
;
|
|
35
|
+
}, content.content && content.content());
|
|
37
36
|
BadgeBlock.defaultProps = blockDefaultProps;
|
|
38
37
|
BadgeBlock.meta = {
|
|
39
38
|
category: 'container',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -12,11 +12,7 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { type, get } from '@lowdefy/helpers';
|
|
17
|
-
import { Breadcrumb } from 'antd';
|
|
18
|
-
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
19
|
-
function _extends() {
|
|
15
|
+
*/ function _extends() {
|
|
20
16
|
_extends = Object.assign || function(target) {
|
|
21
17
|
for(var i = 1; i < arguments.length; i++){
|
|
22
18
|
var source = arguments[i];
|
|
@@ -30,11 +26,15 @@ function _extends() {
|
|
|
30
26
|
};
|
|
31
27
|
return _extends.apply(this, arguments);
|
|
32
28
|
}
|
|
33
|
-
|
|
29
|
+
import React from 'react';
|
|
30
|
+
import { type, get } from '@lowdefy/helpers';
|
|
31
|
+
import { Breadcrumb } from 'antd';
|
|
32
|
+
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
33
|
+
const BreadcrumbBlock = ({ blockId , events , components: { Icon , Link } , methods , properties , rename })=>{
|
|
34
34
|
const onClickActionName = get(rename, 'events.onClick', {
|
|
35
35
|
default: 'onClick'
|
|
36
36
|
});
|
|
37
|
-
return
|
|
37
|
+
return /*#__PURE__*/ React.createElement(Breadcrumb, {
|
|
38
38
|
id: blockId,
|
|
39
39
|
separator: properties.separator,
|
|
40
40
|
className: methods.makeCssClass(properties.style)
|
|
@@ -46,30 +46,27 @@ const BreadcrumbBlock = ({ blockId , events , components: { Icon , Link } , met
|
|
|
46
46
|
link,
|
|
47
47
|
index
|
|
48
48
|
}
|
|
49
|
-
})
|
|
50
|
-
)
|
|
49
|
+
}))
|
|
51
50
|
}, /*#__PURE__*/ React.createElement(Link, _extends({
|
|
52
51
|
id: `${blockId}_${index}`,
|
|
53
52
|
className: methods.makeCssClass([
|
|
54
53
|
{
|
|
55
54
|
cursor: events[onClickActionName] && 'pointer'
|
|
56
55
|
},
|
|
57
|
-
link.style
|
|
56
|
+
link.style
|
|
58
57
|
])
|
|
59
|
-
}, link), (
|
|
58
|
+
}, link), ()=>/*#__PURE__*/ React.createElement(React.Fragment, null, link.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
60
59
|
blockId: `${blockId}_${index}_icon`,
|
|
61
60
|
events: events,
|
|
62
61
|
properties: {
|
|
63
62
|
name: type.isString(link.icon) && link.icon,
|
|
64
63
|
...type.isObject(link.icon) ? link.icon : {},
|
|
65
64
|
style: {
|
|
66
|
-
|
|
65
|
+
marginRight: 8,
|
|
67
66
|
...link.icon.style || {}
|
|
68
67
|
}
|
|
69
68
|
}
|
|
70
|
-
}), type.isString(link) ? link : link.label
|
|
71
|
-
))
|
|
72
|
-
)));
|
|
69
|
+
}), type.isString(link) ? link : link.label)))));
|
|
73
70
|
};
|
|
74
71
|
BreadcrumbBlock.defaultProps = blockDefaultProps;
|
|
75
72
|
BreadcrumbBlock.meta = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -17,11 +17,11 @@ import { Button } from 'antd';
|
|
|
17
17
|
import { get, type } from '@lowdefy/helpers';
|
|
18
18
|
import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
19
19
|
import color from '../../color.js';
|
|
20
|
-
const ButtonBlock = ({ blockId , components: { Icon } , events , loading , methods , onClick , properties , rename
|
|
20
|
+
const ButtonBlock = ({ blockId , components: { Icon } , events , loading , methods , onClick , properties , rename })=>{
|
|
21
21
|
const onClickActionName = get(rename, 'events.onClick', {
|
|
22
22
|
default: 'onClick'
|
|
23
23
|
});
|
|
24
|
-
return
|
|
24
|
+
return /*#__PURE__*/ React.createElement(Button, {
|
|
25
25
|
block: properties.block,
|
|
26
26
|
className: methods.makeCssClass([
|
|
27
27
|
{
|
|
@@ -40,7 +40,7 @@ const ButtonBlock = ({ blockId , components: { Icon } , events , loading , meth
|
|
|
40
40
|
borderColor: properties.color
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
-
properties.style
|
|
43
|
+
properties.style
|
|
44
44
|
]),
|
|
45
45
|
disabled: properties.disabled || get(events, `${onClickActionName}.loading`) || loading,
|
|
46
46
|
ghost: properties.ghost,
|
|
@@ -60,12 +60,11 @@ const ButtonBlock = ({ blockId , components: { Icon } , events , loading , meth
|
|
|
60
60
|
}),
|
|
61
61
|
onClick: onClick || (()=>methods.triggerEvent({
|
|
62
62
|
name: onClickActionName
|
|
63
|
-
})
|
|
64
|
-
)
|
|
63
|
+
}))
|
|
65
64
|
}, !properties.hideTitle && renderHtml({
|
|
66
65
|
html: type.isNone(properties.title) ? blockId : properties.title,
|
|
67
66
|
methods
|
|
68
|
-
}))
|
|
67
|
+
}));
|
|
69
68
|
};
|
|
70
69
|
ButtonBlock.defaultProps = blockDefaultProps;
|
|
71
70
|
ButtonBlock.meta = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -19,9 +19,9 @@ import { type } from '@lowdefy/helpers';
|
|
|
19
19
|
import Label from '../Label/Label.js';
|
|
20
20
|
import getValueIndex from '../../getValueIndex.js';
|
|
21
21
|
import getUniqueValues from '../../getUniqueValues.js';
|
|
22
|
-
const ButtonSelector = ({ blockId , components , events , loading , properties , required , validation , value , methods
|
|
22
|
+
const ButtonSelector = ({ blockId , components , events , loading , properties , required , validation , value , methods })=>{
|
|
23
23
|
const uniqueValueOptions = getUniqueValues(properties.options || []);
|
|
24
|
-
return
|
|
24
|
+
return /*#__PURE__*/ React.createElement(Label, {
|
|
25
25
|
blockId: blockId,
|
|
26
26
|
components: components,
|
|
27
27
|
events: events,
|
|
@@ -42,7 +42,7 @@ const ButtonSelector = ({ blockId , components , events , loading , properties ,
|
|
|
42
42
|
borderColor: `${properties.color} !important`
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
|
-
properties.inputStyle
|
|
45
|
+
properties.inputStyle
|
|
46
46
|
]),
|
|
47
47
|
disabled: properties.disabled || loading,
|
|
48
48
|
size: properties.size,
|
|
@@ -73,10 +73,9 @@ const ButtonSelector = ({ blockId , components , events , loading , properties ,
|
|
|
73
73
|
}) : renderHtml({
|
|
74
74
|
html: opt.label,
|
|
75
75
|
methods
|
|
76
|
-
}))
|
|
77
|
-
))
|
|
76
|
+
}))))
|
|
78
77
|
}
|
|
79
|
-
})
|
|
78
|
+
});
|
|
80
79
|
};
|
|
81
80
|
ButtonSelector.defaultProps = blockDefaultProps;
|
|
82
81
|
ButtonSelector.meta = {
|
package/dist/blocks/Card/Card.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -30,17 +30,15 @@ const CardBlock = ({ blockId , content , properties , methods , events })=>/*#_
|
|
|
30
30
|
type: properties.inner ? 'inner' : null,
|
|
31
31
|
onClick: ()=>methods.triggerEvent({
|
|
32
32
|
name: 'onClick'
|
|
33
|
-
})
|
|
34
|
-
,
|
|
33
|
+
}),
|
|
35
34
|
className: methods.makeCssClass([
|
|
36
35
|
{
|
|
37
36
|
outline: 'none',
|
|
38
37
|
cursor: events.onClick && 'pointer'
|
|
39
38
|
},
|
|
40
|
-
properties.style
|
|
39
|
+
properties.style
|
|
41
40
|
])
|
|
42
|
-
}, content.content && content.content())
|
|
43
|
-
;
|
|
41
|
+
}, content.content && content.content());
|
|
44
42
|
CardBlock.defaultProps = blockDefaultProps;
|
|
45
43
|
CardBlock.meta = {
|
|
46
44
|
category: 'container',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -19,9 +19,9 @@ import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
|
19
19
|
import Label from '../Label/Label.js';
|
|
20
20
|
import getValueIndex from '../../getValueIndex.js';
|
|
21
21
|
import getUniqueValues from '../../getUniqueValues.js';
|
|
22
|
-
const CheckboxSelector = ({ blockId , components , events , loading , properties , required , validation , value , methods
|
|
22
|
+
const CheckboxSelector = ({ blockId , components , events , loading , properties , required , validation , value , methods })=>{
|
|
23
23
|
const uniqueValueOptions = getUniqueValues(properties.options || []);
|
|
24
|
-
return
|
|
24
|
+
return /*#__PURE__*/ React.createElement(Label, {
|
|
25
25
|
blockId: blockId,
|
|
26
26
|
components: components,
|
|
27
27
|
events: events,
|
|
@@ -42,7 +42,7 @@ const CheckboxSelector = ({ blockId , components , events , loading , properties
|
|
|
42
42
|
borderColor: `${properties.color} !important`
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
|
-
properties.inputStyle
|
|
45
|
+
properties.inputStyle
|
|
46
46
|
]),
|
|
47
47
|
disabled: properties.disabled || loading,
|
|
48
48
|
onChange: (newVal)=>{
|
|
@@ -79,10 +79,9 @@ const CheckboxSelector = ({ blockId , components , events , loading , properties
|
|
|
79
79
|
}) : renderHtml({
|
|
80
80
|
html: opt.label,
|
|
81
81
|
methods
|
|
82
|
-
}))
|
|
83
|
-
)))
|
|
82
|
+
})))))
|
|
84
83
|
}
|
|
85
|
-
})
|
|
84
|
+
});
|
|
86
85
|
};
|
|
87
86
|
CheckboxSelector.defaultProps = blockDefaultProps;
|
|
88
87
|
CheckboxSelector.meta = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
import { Checkbox, Space } from 'antd';
|
|
17
17
|
import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
18
18
|
import Label from '../Label/Label.js';
|
|
19
|
-
const CheckboxSwitch = ({ blockId , components , events , loading , properties , required , validation , value , methods
|
|
20
|
-
return
|
|
19
|
+
const CheckboxSwitch = ({ blockId , components , events , loading , properties , required , validation , value , methods })=>{
|
|
20
|
+
return /*#__PURE__*/ React.createElement(Label, {
|
|
21
21
|
blockId: blockId,
|
|
22
22
|
components: components,
|
|
23
23
|
events: events,
|
|
@@ -43,7 +43,7 @@ const CheckboxSwitch = ({ blockId , components , events , loading , properties ,
|
|
|
43
43
|
properties.description && {
|
|
44
44
|
marginRight: '30px'
|
|
45
45
|
},
|
|
46
|
-
properties.inputStyle
|
|
46
|
+
properties.inputStyle
|
|
47
47
|
]),
|
|
48
48
|
onChange: (e)=>{
|
|
49
49
|
methods.setValue(e.target.checked);
|
|
@@ -58,7 +58,7 @@ const CheckboxSwitch = ({ blockId , components , events , loading , properties ,
|
|
|
58
58
|
methods
|
|
59
59
|
})))
|
|
60
60
|
}
|
|
61
|
-
})
|
|
61
|
+
});
|
|
62
62
|
};
|
|
63
63
|
CheckboxSwitch.defaultProps = blockDefaultProps;
|
|
64
64
|
CheckboxSwitch.meta = {
|