@lowdefy/blocks-antd 4.0.0-alpha.12 → 4.0.0-alpha.13
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 +1 -2
- package/dist/blocks/Alert/Alert.js +18 -20
- package/dist/blocks/AutoComplete/AutoComplete.js +4 -6
- package/dist/blocks/Avatar/Avatar.js +2 -4
- package/dist/blocks/Badge/Badge.js +1 -2
- package/dist/blocks/Breadcrumb/Breadcrumb.js +17 -20
- package/dist/blocks/Button/Button.js +3 -4
- package/dist/blocks/ButtonSelector/ButtonSelector.js +3 -4
- package/dist/blocks/Card/Card.js +2 -4
- package/dist/blocks/CheckboxSelector/CheckboxSelector.js +3 -4
- package/dist/blocks/CheckboxSwitch/CheckboxSwitch.js +2 -2
- package/dist/blocks/Collapse/Collapse.js +19 -23
- package/dist/blocks/Comment/Comment.js +2 -2
- package/dist/blocks/ConfirmModal/ConfirmModal.js +2 -2
- package/dist/blocks/Content/Content.js +1 -2
- package/dist/blocks/ControlledList/ControlledList.js +2 -2
- package/dist/blocks/DateRangeSelector/DateRangeSelector.js +6 -10
- package/dist/blocks/DateSelector/DateSelector.js +3 -4
- package/dist/blocks/DateTimeSelector/DateTimeSelector.js +3 -4
- package/dist/blocks/Descriptions/Descriptions.js +6 -8
- package/dist/blocks/Divider/Divider.js +1 -2
- package/dist/blocks/Drawer/Drawer.js +4 -6
- package/dist/blocks/Footer/Footer.js +1 -2
- package/dist/blocks/Header/Header.js +1 -2
- package/dist/blocks/Label/Label.js +20 -24
- package/dist/blocks/Layout/Layout.js +1 -2
- package/dist/blocks/Menu/Menu.js +39 -47
- package/dist/blocks/Message/Message.js +3 -4
- package/dist/blocks/MobileMenu/MobileMenu.js +4 -6
- package/dist/blocks/Modal/Modal.js +19 -22
- package/dist/blocks/MonthSelector/MonthSelector.js +3 -4
- package/dist/blocks/MultipleSelector/MultipleSelector.js +5 -8
- package/dist/blocks/Notification/Notification.js +4 -6
- package/dist/blocks/NumberInput/NumberInput.js +2 -2
- package/dist/blocks/PageHCF/PageHCF.js +1 -2
- package/dist/blocks/PageHCSF/PageHCSF.js +1 -2
- package/dist/blocks/PageHSCF/PageHSCF.js +1 -2
- package/dist/blocks/PageHeaderMenu/PageHeaderMenu.js +2 -2
- package/dist/blocks/PageSHCF/PageSHCF.js +1 -2
- package/dist/blocks/PageSiderMenu/PageSiderMenu.js +3 -4
- package/dist/blocks/Pagination/Pagination.js +3 -4
- package/dist/blocks/Paragraph/Paragraph.js +1 -2
- package/dist/blocks/ParagraphInput/ParagraphInput.js +2 -2
- package/dist/blocks/PasswordInput/PasswordInput.js +4 -4
- package/dist/blocks/Progress/Progress.js +1 -2
- package/dist/blocks/RadioSelector/RadioSelector.js +3 -4
- package/dist/blocks/RatingSlider/RatingSlider.js +4 -6
- package/dist/blocks/Result/Result.js +1 -2
- package/dist/blocks/Selector/Selector.js +5 -8
- package/dist/blocks/Sider/Sider.js +4 -6
- package/dist/blocks/Statistic/Statistic.js +1 -2
- package/dist/blocks/Switch/Switch.js +2 -2
- package/dist/blocks/Tabs/Tabs.js +20 -25
- package/dist/blocks/TextArea/TextArea.js +4 -4
- package/dist/blocks/TextInput/TextInput.js +4 -4
- package/dist/blocks/TimelineList/TimelineList.js +18 -18
- package/dist/blocks/Title/Title.js +2 -2
- package/dist/blocks/TitleInput/TitleInput.js +2 -2
- package/dist/blocks/Tooltip/Tooltip.js +1 -2
- package/dist/blocks/WeekSelector/WeekSelector.js +3 -4
- package/dist/disabledDate.js +3 -6
- package/package.json +21 -20
|
@@ -39,8 +39,7 @@ const createChangeHandler = ({ eventName , methods })=>(current, pageSize)=>{
|
|
|
39
39
|
skip: current * pageSize
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
}
|
|
43
|
-
;
|
|
42
|
+
};
|
|
44
43
|
const PaginationBlock = ({ blockId , loading , methods , properties , value })=>{
|
|
45
44
|
const showTotal = type.isFunction(properties.showTotal) ? properties.showTotal : (total, range)=>{
|
|
46
45
|
if (type.isString(properties.showTotal)) {
|
|
@@ -51,7 +50,7 @@ const PaginationBlock = ({ blockId , loading , methods , properties , value })=
|
|
|
51
50
|
}
|
|
52
51
|
return `${range[0]}-${range[1]} of ${total} items`;
|
|
53
52
|
};
|
|
54
|
-
return
|
|
53
|
+
return /*#__PURE__*/ React.createElement(Pagination, {
|
|
55
54
|
id: blockId,
|
|
56
55
|
disabled: properties.disabled || loading,
|
|
57
56
|
hideOnSinglePage: properties.hideOnSinglePage,
|
|
@@ -80,7 +79,7 @@ const PaginationBlock = ({ blockId , loading , methods , properties , value })=
|
|
|
80
79
|
size: properties.size,
|
|
81
80
|
total: properties.total !== undefined ? properties.total : 100,
|
|
82
81
|
current: type.isNone(value) || !type.isObject(value) || !type.isNumber(value.current) ? 1 : value.current
|
|
83
|
-
})
|
|
82
|
+
});
|
|
84
83
|
};
|
|
85
84
|
PaginationBlock.defaultProps = blockDefaultProps;
|
|
86
85
|
PaginationBlock.meta = {
|
|
@@ -90,8 +90,7 @@ const ParagraphBlock = ({ blockId , components: { Icon } , events , methods , p
|
|
|
90
90
|
}, renderHtml({
|
|
91
91
|
html: properties.content,
|
|
92
92
|
methods
|
|
93
|
-
}))
|
|
94
|
-
;
|
|
93
|
+
}));
|
|
95
94
|
ParagraphBlock.defaultProps = blockDefaultProps;
|
|
96
95
|
ParagraphBlock.meta = {
|
|
97
96
|
category: 'display',
|
|
@@ -37,7 +37,7 @@ const ParagraphInput = ({ blockId , components: { Icon } , events , loading , m
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
-
return
|
|
40
|
+
return /*#__PURE__*/ React.createElement(Paragraph, {
|
|
41
41
|
id: blockId,
|
|
42
42
|
className: methods.makeCssClass(properties.style),
|
|
43
43
|
code: properties.code,
|
|
@@ -111,7 +111,7 @@ const ParagraphInput = ({ blockId , components: { Icon } , events , loading , m
|
|
|
111
111
|
strong: properties.strong,
|
|
112
112
|
type: properties.type,
|
|
113
113
|
underline: properties.underline
|
|
114
|
-
}, !type.isNone(value) ? value.toString() : '')
|
|
114
|
+
}, !type.isNone(value) ? value.toString() : '');
|
|
115
115
|
};
|
|
116
116
|
ParagraphInput.defaultProps = blockDefaultProps;
|
|
117
117
|
ParagraphInput.meta = {
|
|
@@ -18,7 +18,7 @@ import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
|
18
18
|
import Label from '../Label/Label.js';
|
|
19
19
|
import useRunAfterUpdate from '../../useRunAfterUpdate.js';
|
|
20
20
|
const PasswordInput = ({ blockId , components , events , loading , methods , properties , required , validation , value , })=>{
|
|
21
|
-
return
|
|
21
|
+
return /*#__PURE__*/ React.createElement(Label, {
|
|
22
22
|
blockId: blockId,
|
|
23
23
|
components: components,
|
|
24
24
|
events: events,
|
|
@@ -32,7 +32,7 @@ const PasswordInput = ({ blockId , components , events , loading , methods , pro
|
|
|
32
32
|
content: {
|
|
33
33
|
content: ()=>{
|
|
34
34
|
const runAfterUpdate = useRunAfterUpdate();
|
|
35
|
-
return
|
|
35
|
+
return /*#__PURE__*/ React.createElement(Input.Password, {
|
|
36
36
|
id: `${blockId}_input`,
|
|
37
37
|
bordered: properties.bordered,
|
|
38
38
|
className: methods.makeCssClass(properties.inputStyle),
|
|
@@ -58,10 +58,10 @@ const PasswordInput = ({ blockId , components , events , loading , methods , pro
|
|
|
58
58
|
value: value,
|
|
59
59
|
size: properties.size,
|
|
60
60
|
visibilityToggle: properties.visibilityToggle
|
|
61
|
-
})
|
|
61
|
+
});
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
})
|
|
64
|
+
});
|
|
65
65
|
};
|
|
66
66
|
PasswordInput.defaultProps = blockDefaultProps;
|
|
67
67
|
PasswordInput.meta = {
|
|
@@ -30,8 +30,7 @@ const ProgressBlock = ({ blockId , properties })=>/*#__PURE__*/ React.createEle
|
|
|
30
30
|
trailColor: properties.trailColor,
|
|
31
31
|
type: properties.type,
|
|
32
32
|
width: properties.width
|
|
33
|
-
})
|
|
34
|
-
;
|
|
33
|
+
});
|
|
35
34
|
ProgressBlock.defaultProps = blockDefaultProps;
|
|
36
35
|
ProgressBlock.meta = {
|
|
37
36
|
category: 'display',
|
|
@@ -22,7 +22,7 @@ import getUniqueValues from '../../getUniqueValues.js';
|
|
|
22
22
|
const RadioGroup = Radio.Group;
|
|
23
23
|
const RadioSelector = ({ blockId , components , events , loading , properties , required , validation , value , methods , })=>{
|
|
24
24
|
const uniqueValueOptions = getUniqueValues(properties.options || []);
|
|
25
|
-
return
|
|
25
|
+
return /*#__PURE__*/ React.createElement(Label, {
|
|
26
26
|
blockId: blockId,
|
|
27
27
|
components: components,
|
|
28
28
|
events: events,
|
|
@@ -78,10 +78,9 @@ const RadioSelector = ({ blockId , components , events , loading , properties ,
|
|
|
78
78
|
}) : renderHtml({
|
|
79
79
|
html: opt.label,
|
|
80
80
|
methods
|
|
81
|
-
}))
|
|
82
|
-
)))
|
|
81
|
+
})))))
|
|
83
82
|
}
|
|
84
|
-
})
|
|
83
|
+
});
|
|
85
84
|
};
|
|
86
85
|
RadioSelector.defaultProps = blockDefaultProps;
|
|
87
86
|
RadioSelector.meta = {
|
|
@@ -82,12 +82,11 @@ const RatingSlider = ({ blockId , components: { Icon , Link } , events , loadin
|
|
|
82
82
|
default: 10
|
|
83
83
|
}),
|
|
84
84
|
properties.min || 0
|
|
85
|
-
].sort((a, b)=>a - b
|
|
86
|
-
);
|
|
85
|
+
].sort((a, b)=>a - b);
|
|
87
86
|
// round to fix floating point error
|
|
88
87
|
const minMin = parseFloat((minMax[0] - (properties.step || 1)).toPrecision(8));
|
|
89
88
|
const validationColor = validation.status === 'error' ? '#ff4d4f' : validation.status === 'warning' ? '#faad14' : null;
|
|
90
|
-
return
|
|
89
|
+
return /*#__PURE__*/ React.createElement(Label, {
|
|
91
90
|
blockId: blockId,
|
|
92
91
|
components: {
|
|
93
92
|
Icon,
|
|
@@ -191,8 +190,7 @@ const RatingSlider = ({ blockId , components: { Icon , Link } , events , loadin
|
|
|
191
190
|
default: true
|
|
192
191
|
}),
|
|
193
192
|
tooltipVisible: value === null || properties.tooltipVisible === 'never' ? false : properties.tooltipVisible === 'always' ? true : undefined,
|
|
194
|
-
tipFormatter: (val)=>`${val}
|
|
195
|
-
,
|
|
193
|
+
tipFormatter: (val)=>`${val}`,
|
|
196
194
|
marks: properties.marks || (get(properties, 'showMarks', {
|
|
197
195
|
default: true
|
|
198
196
|
}) ? includeMarks(minMax, minMin, properties.step || 1) : undefined),
|
|
@@ -224,7 +222,7 @@ const RatingSlider = ({ blockId , components: { Icon , Link } , events , loadin
|
|
|
224
222
|
])
|
|
225
223
|
}))
|
|
226
224
|
}
|
|
227
|
-
})
|
|
225
|
+
});
|
|
228
226
|
};
|
|
229
227
|
RatingSlider.defaultProps = blockDefaultProps;
|
|
230
228
|
RatingSlider.meta = {
|
|
@@ -36,8 +36,7 @@ const ResultBlock = ({ blockId , components: { Icon } , events , content , meth
|
|
|
36
36
|
})
|
|
37
37
|
}, content.content && content.content({
|
|
38
38
|
justifyContent: 'center'
|
|
39
|
-
}))
|
|
40
|
-
;
|
|
39
|
+
}));
|
|
41
40
|
ResultBlock.defaultProps = blockDefaultProps;
|
|
42
41
|
ResultBlock.meta = {
|
|
43
42
|
category: 'container',
|
|
@@ -23,7 +23,7 @@ const Option = Select.Option;
|
|
|
23
23
|
const Selector = ({ blockId , components: { Icon , Link } , events , loading , methods , properties , required , validation , value: value1 , })=>{
|
|
24
24
|
const [fetchState, setFetch] = useState(false);
|
|
25
25
|
const uniqueValueOptions = getUniqueValues(properties.options || []);
|
|
26
|
-
return
|
|
26
|
+
return /*#__PURE__*/ React.createElement(Label, {
|
|
27
27
|
blockId: blockId,
|
|
28
28
|
components: {
|
|
29
29
|
Icon,
|
|
@@ -55,8 +55,7 @@ const Selector = ({ blockId , components: { Icon , Link } , events , loading ,
|
|
|
55
55
|
]),
|
|
56
56
|
mode: "single",
|
|
57
57
|
autoFocus: properties.autoFocus,
|
|
58
|
-
getPopupContainer: ()=>document.getElementById(`${blockId}_popup`)
|
|
59
|
-
,
|
|
58
|
+
getPopupContainer: ()=>document.getElementById(`${blockId}_popup`),
|
|
60
59
|
disabled: properties.disabled || loading,
|
|
61
60
|
placeholder: get(properties, 'placeholder', {
|
|
62
61
|
default: 'Select item'
|
|
@@ -77,8 +76,7 @@ const Selector = ({ blockId , components: { Icon , Link } , events , loading ,
|
|
|
77
76
|
default: true
|
|
78
77
|
}),
|
|
79
78
|
size: properties.size,
|
|
80
|
-
filterOption: (input, option)=>(option.filterstring || option.children.props.html || '').toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
81
|
-
,
|
|
79
|
+
filterOption: (input, option)=>(option.filterstring || option.children.props.html || '').toLowerCase().indexOf(input.toLowerCase()) >= 0,
|
|
82
80
|
notFoundContent: fetchState ? 'Loading' : 'Not found',
|
|
83
81
|
onChange: (newVal)=>{
|
|
84
82
|
methods.setValue(type.isPrimitive(uniqueValueOptions[newVal]) ? uniqueValueOptions[newVal] : uniqueValueOptions[newVal].value);
|
|
@@ -123,10 +121,9 @@ const Selector = ({ blockId , components: { Icon , Link } , events , loading ,
|
|
|
123
121
|
}) : renderHtml({
|
|
124
122
|
html: opt.label,
|
|
125
123
|
methods
|
|
126
|
-
}))
|
|
127
|
-
)))
|
|
124
|
+
})))))
|
|
128
125
|
}
|
|
129
|
-
})
|
|
126
|
+
});
|
|
130
127
|
};
|
|
131
128
|
Selector.defaultProps = blockDefaultProps;
|
|
132
129
|
Selector.meta = {
|
|
@@ -44,8 +44,7 @@ const SiderBlock = ({ blockId , properties , content , methods , rename })=>{
|
|
|
44
44
|
setOpen,
|
|
45
45
|
methods,
|
|
46
46
|
rename
|
|
47
|
-
})
|
|
48
|
-
);
|
|
47
|
+
}));
|
|
49
48
|
methods.registerMethod(get(rename, 'methods.setOpen', {
|
|
50
49
|
default: 'setOpen'
|
|
51
50
|
}), async ({ open })=>await triggerSetOpen({
|
|
@@ -53,10 +52,9 @@ const SiderBlock = ({ blockId , properties , content , methods , rename })=>{
|
|
|
53
52
|
setOpen,
|
|
54
53
|
methods,
|
|
55
54
|
rename
|
|
56
|
-
})
|
|
57
|
-
);
|
|
55
|
+
}));
|
|
58
56
|
});
|
|
59
|
-
return
|
|
57
|
+
return /*#__PURE__*/ React.createElement(Sider, {
|
|
60
58
|
id: blockId,
|
|
61
59
|
className: `${methods.makeCssClass([
|
|
62
60
|
{
|
|
@@ -74,7 +72,7 @@ const SiderBlock = ({ blockId , properties , content , methods , rename })=>{
|
|
|
74
72
|
onBreakpoint: ()=>methods.triggerEvent({
|
|
75
73
|
name: 'onBreakpoint'
|
|
76
74
|
})
|
|
77
|
-
}, content.content && content.content())
|
|
75
|
+
}, content.content && content.content());
|
|
78
76
|
};
|
|
79
77
|
SiderBlock.defaultProps = blockDefaultProps;
|
|
80
78
|
SiderBlock.meta = {
|
|
@@ -39,8 +39,7 @@ const StatisticBlock = ({ blockId , components: { Icon } , events , properties
|
|
|
39
39
|
events: events,
|
|
40
40
|
properties: properties.suffixIcon
|
|
41
41
|
}) : properties.suffix || ''
|
|
42
|
-
})
|
|
43
|
-
;
|
|
42
|
+
});
|
|
44
43
|
StatisticBlock.defaultProps = blockDefaultProps;
|
|
45
44
|
StatisticBlock.meta = {
|
|
46
45
|
category: 'display',
|
|
@@ -30,7 +30,7 @@ const SwitchBlock = ({ blockId , components: { Icon , Link } , events , loading
|
|
|
30
30
|
name: propertiesIconUnchecked
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
return
|
|
33
|
+
return /*#__PURE__*/ React.createElement(Label, {
|
|
34
34
|
blockId: blockId,
|
|
35
35
|
components: {
|
|
36
36
|
Icon,
|
|
@@ -83,7 +83,7 @@ const SwitchBlock = ({ blockId , components: { Icon , Link } , events , loading
|
|
|
83
83
|
}
|
|
84
84
|
})
|
|
85
85
|
}
|
|
86
|
-
})
|
|
86
|
+
});
|
|
87
87
|
};
|
|
88
88
|
SwitchBlock.defaultProps = blockDefaultProps;
|
|
89
89
|
SwitchBlock.meta = {
|
package/dist/blocks/Tabs/Tabs.js
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
function _extends() {
|
|
2
|
+
_extends = Object.assign || function(target) {
|
|
3
|
+
for(var i = 1; i < arguments.length; i++){
|
|
4
|
+
var source = arguments[i];
|
|
5
|
+
for(var key in source){
|
|
6
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
7
|
+
target[key] = source[key];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return target;
|
|
12
|
+
};
|
|
13
|
+
return _extends.apply(this, arguments);
|
|
14
|
+
}
|
|
1
15
|
/*
|
|
2
16
|
Copyright 2020-2022 Lowdefy, Inc
|
|
3
17
|
|
|
@@ -15,32 +29,16 @@
|
|
|
15
29
|
*/ import React from 'react';
|
|
16
30
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
17
31
|
import { Tabs } from 'antd';
|
|
18
|
-
function _extends() {
|
|
19
|
-
_extends = Object.assign || function(target) {
|
|
20
|
-
for(var i = 1; i < arguments.length; i++){
|
|
21
|
-
var source = arguments[i];
|
|
22
|
-
for(var key in source){
|
|
23
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
24
|
-
target[key] = source[key];
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return target;
|
|
29
|
-
};
|
|
30
|
-
return _extends.apply(this, arguments);
|
|
31
|
-
}
|
|
32
32
|
const getTabs = ({ content , properties })=>{
|
|
33
33
|
let tabs = properties.tabs;
|
|
34
34
|
if (!tabs) {
|
|
35
35
|
tabs = Object.keys(content).sort().map((key)=>({
|
|
36
36
|
key,
|
|
37
37
|
title: key
|
|
38
|
-
})
|
|
39
|
-
);
|
|
38
|
+
}));
|
|
40
39
|
}
|
|
41
40
|
// remove extraAreaKey key area from tabs
|
|
42
|
-
return tabs.filter((tab)=>tab.key !== properties.extraAreaKey
|
|
43
|
-
);
|
|
41
|
+
return tabs.filter((tab)=>tab.key !== properties.extraAreaKey);
|
|
44
42
|
};
|
|
45
43
|
const getAdditionalProps = ({ content , properties })=>{
|
|
46
44
|
const additionalProps = {};
|
|
@@ -61,7 +59,7 @@ const TabsBlock = ({ blockId , components: { Icon } , events , content , method
|
|
|
61
59
|
content,
|
|
62
60
|
properties
|
|
63
61
|
});
|
|
64
|
-
return
|
|
62
|
+
return /*#__PURE__*/ React.createElement(Tabs, _extends({
|
|
65
63
|
animated: properties.animated !== undefined ? properties.animated : true,
|
|
66
64
|
defaultActiveKey: properties.defaultActiveKey || tabs[0].key,
|
|
67
65
|
id: blockId,
|
|
@@ -70,8 +68,7 @@ const TabsBlock = ({ blockId , components: { Icon } , events , content , method
|
|
|
70
68
|
event: {
|
|
71
69
|
activeKey
|
|
72
70
|
}
|
|
73
|
-
})
|
|
74
|
-
,
|
|
71
|
+
}),
|
|
75
72
|
size: properties.size || 'default',
|
|
76
73
|
tabBarStyle: methods.makeCssClass(properties.tabBarStyle, true),
|
|
77
74
|
tabPosition: properties.tabPosition || 'top',
|
|
@@ -81,8 +78,7 @@ const TabsBlock = ({ blockId , components: { Icon } , events , content , method
|
|
|
81
78
|
event: {
|
|
82
79
|
direction
|
|
83
80
|
}
|
|
84
|
-
})
|
|
85
|
-
,
|
|
81
|
+
}),
|
|
86
82
|
onTabClick: (key)=>methods.triggerEvent({
|
|
87
83
|
name: 'onTabClick',
|
|
88
84
|
event: {
|
|
@@ -99,8 +95,7 @@ const TabsBlock = ({ blockId , components: { Icon } , events , content , method
|
|
|
99
95
|
events: events,
|
|
100
96
|
properties: tab.icon
|
|
101
97
|
}), tab.title || tab.key)
|
|
102
|
-
}, content[tab.key] && content[tab.key]())
|
|
103
|
-
)));
|
|
98
|
+
}, content[tab.key] && content[tab.key]())));
|
|
104
99
|
};
|
|
105
100
|
TabsBlock.defaultProps = blockDefaultProps;
|
|
106
101
|
TabsBlock.meta = {
|
|
@@ -20,7 +20,7 @@ import Label from '../Label/Label.js';
|
|
|
20
20
|
import useRunAfterUpdate from '../../useRunAfterUpdate.js';
|
|
21
21
|
const TextAreaComp = Input.TextArea;
|
|
22
22
|
const TextAreaBlock = ({ blockId , components , events , loading , properties , required , validation , value , methods , })=>{
|
|
23
|
-
return
|
|
23
|
+
return /*#__PURE__*/ React.createElement(Label, {
|
|
24
24
|
blockId: blockId,
|
|
25
25
|
components: components,
|
|
26
26
|
events: events,
|
|
@@ -34,7 +34,7 @@ const TextAreaBlock = ({ blockId , components , events , loading , properties ,
|
|
|
34
34
|
content: {
|
|
35
35
|
content: ()=>{
|
|
36
36
|
const runAfterUpdate = useRunAfterUpdate();
|
|
37
|
-
return
|
|
37
|
+
return /*#__PURE__*/ React.createElement(TextAreaComp, {
|
|
38
38
|
id: `${blockId}_input`,
|
|
39
39
|
allowClear: properties.allowClear,
|
|
40
40
|
autoFocus: properties.autoFocus,
|
|
@@ -68,10 +68,10 @@ const TextAreaBlock = ({ blockId , components , events , loading , properties ,
|
|
|
68
68
|
name: 'onPressEnter'
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
-
})
|
|
71
|
+
});
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
})
|
|
74
|
+
});
|
|
75
75
|
};
|
|
76
76
|
TextAreaBlock.defaultProps = blockDefaultProps;
|
|
77
77
|
TextAreaBlock.meta = {
|
|
@@ -18,7 +18,7 @@ import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
|
18
18
|
import Label from '../Label/Label.js';
|
|
19
19
|
import useRunAfterUpdate from '../../useRunAfterUpdate.js';
|
|
20
20
|
const TextInput = ({ blockId , components: { Icon , Link } , events , loading , methods , properties , required , validation , value , })=>{
|
|
21
|
-
return
|
|
21
|
+
return /*#__PURE__*/ React.createElement(Label, {
|
|
22
22
|
blockId: blockId,
|
|
23
23
|
components: {
|
|
24
24
|
Icon,
|
|
@@ -35,7 +35,7 @@ const TextInput = ({ blockId , components: { Icon , Link } , events , loading ,
|
|
|
35
35
|
content: {
|
|
36
36
|
content: ()=>{
|
|
37
37
|
const runAfterUpdate = useRunAfterUpdate();
|
|
38
|
-
return
|
|
38
|
+
return /*#__PURE__*/ React.createElement(Input, {
|
|
39
39
|
id: `${blockId}_input`,
|
|
40
40
|
allowClear: properties.allowClear,
|
|
41
41
|
autoFocus: properties.autoFocus,
|
|
@@ -72,10 +72,10 @@ const TextInput = ({ blockId , components: { Icon , Link } , events , loading ,
|
|
|
72
72
|
events: events,
|
|
73
73
|
properties: properties.suffixIcon
|
|
74
74
|
})
|
|
75
|
-
})
|
|
75
|
+
});
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
})
|
|
78
|
+
});
|
|
79
79
|
};
|
|
80
80
|
TextInput.defaultProps = blockDefaultProps;
|
|
81
81
|
TextInput.meta = {
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
function _extends() {
|
|
2
|
+
_extends = Object.assign || function(target) {
|
|
3
|
+
for(var i = 1; i < arguments.length; i++){
|
|
4
|
+
var source = arguments[i];
|
|
5
|
+
for(var key in source){
|
|
6
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
7
|
+
target[key] = source[key];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return target;
|
|
12
|
+
};
|
|
13
|
+
return _extends.apply(this, arguments);
|
|
14
|
+
}
|
|
1
15
|
/*
|
|
2
16
|
Copyright 2020-2022 Lowdefy, Inc
|
|
3
17
|
|
|
@@ -16,20 +30,6 @@
|
|
|
16
30
|
import { Timeline } from 'antd';
|
|
17
31
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
18
32
|
import { get, mergeObjects, serializer, 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
|
-
}
|
|
33
33
|
// TODO: need to pass value to list blocks to render item level settings.
|
|
34
34
|
const TimelineList = ({ blockId , components: { Icon } , events , list , methods , properties })=>{
|
|
35
35
|
// Temporary fix until list blocks get value from state
|
|
@@ -38,7 +38,7 @@ const TimelineList = ({ blockId , components: { Icon } , events , list , method
|
|
|
38
38
|
if (properties.mode) {
|
|
39
39
|
other.mode = properties.mode;
|
|
40
40
|
}
|
|
41
|
-
return
|
|
41
|
+
return /*#__PURE__*/ React.createElement(Timeline, _extends({
|
|
42
42
|
id: blockId,
|
|
43
43
|
className: methods.makeCssClass([
|
|
44
44
|
{
|
|
@@ -72,7 +72,7 @@ const TimelineList = ({ blockId , components: { Icon } , events , list , method
|
|
|
72
72
|
style = {};
|
|
73
73
|
}
|
|
74
74
|
const color = get(value, `${i}.${properties.colorField || 'color'}`);
|
|
75
|
-
return
|
|
75
|
+
return /*#__PURE__*/ React.createElement(Timeline.Item, {
|
|
76
76
|
key: `${blockId}_${i}`,
|
|
77
77
|
color: color,
|
|
78
78
|
position: get(value, `${i}.${properties.positionField || 'position'}`),
|
|
@@ -88,8 +88,8 @@ const TimelineList = ({ blockId , components: { Icon } , events , list , method
|
|
|
88
88
|
icon
|
|
89
89
|
])
|
|
90
90
|
})
|
|
91
|
-
}, child.content && child.content())
|
|
92
|
-
}))
|
|
91
|
+
}, child.content && child.content());
|
|
92
|
+
}));
|
|
93
93
|
};
|
|
94
94
|
TimelineList.defaultProps = blockDefaultProps;
|
|
95
95
|
TimelineList.meta = {
|
|
@@ -18,7 +18,7 @@ import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
|
18
18
|
import { type } from '@lowdefy/helpers';
|
|
19
19
|
const Title = Typography.Title;
|
|
20
20
|
const TitleBlock = ({ blockId , components: { Icon } , events , properties , methods })=>{
|
|
21
|
-
return
|
|
21
|
+
return /*#__PURE__*/ React.createElement(Title, {
|
|
22
22
|
id: blockId,
|
|
23
23
|
className: methods.makeCssClass([
|
|
24
24
|
properties.color && {
|
|
@@ -96,7 +96,7 @@ const TitleBlock = ({ blockId , components: { Icon } , events , properties , me
|
|
|
96
96
|
}, renderHtml({
|
|
97
97
|
html: properties.content,
|
|
98
98
|
methods
|
|
99
|
-
}))
|
|
99
|
+
}));
|
|
100
100
|
};
|
|
101
101
|
TitleBlock.defaultProps = blockDefaultProps;
|
|
102
102
|
TitleBlock.meta = {
|
|
@@ -37,7 +37,7 @@ const TitleInput = ({ blockId , components: { Icon } , events , loading , metho
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
-
return
|
|
40
|
+
return /*#__PURE__*/ React.createElement(Title, {
|
|
41
41
|
id: blockId,
|
|
42
42
|
code: properties.code,
|
|
43
43
|
italic: properties.italic,
|
|
@@ -108,7 +108,7 @@ const TitleInput = ({ blockId , components: { Icon } , events , loading , metho
|
|
|
108
108
|
autoSize: properties.editable.autoSize,
|
|
109
109
|
...editableEvents
|
|
110
110
|
} : properties.editable !== false && editableEvents
|
|
111
|
-
}, !type.isNone(value) ? value.toString() : '')
|
|
111
|
+
}, !type.isNone(value) ? value.toString() : '');
|
|
112
112
|
};
|
|
113
113
|
TitleInput.defaultProps = blockDefaultProps;
|
|
114
114
|
TitleInput.meta = {
|
|
@@ -36,8 +36,7 @@ const TooltipBlock = ({ blockId , content , properties , methods })=>/*#__PURE_
|
|
|
36
36
|
name: 'onVisibleChange'
|
|
37
37
|
})
|
|
38
38
|
}, content.content && content.content(), '' // required by antd to wrap element in span tag.
|
|
39
|
-
)
|
|
40
|
-
;
|
|
39
|
+
);
|
|
41
40
|
TooltipBlock.defaultProps = blockDefaultProps;
|
|
42
41
|
TooltipBlock.meta = {
|
|
43
42
|
category: 'container',
|
|
@@ -21,7 +21,7 @@ import disabledDate from '../../disabledDate.js';
|
|
|
21
21
|
import Label from '../Label/Label.js';
|
|
22
22
|
const WeekPicker = DatePicker.WeekPicker;
|
|
23
23
|
const WeekSelector = ({ blockId , components: { Icon , Link } , events , loading , methods , properties , required , validation , value , })=>{
|
|
24
|
-
return
|
|
24
|
+
return /*#__PURE__*/ React.createElement(Label, {
|
|
25
25
|
blockId: blockId,
|
|
26
26
|
components: {
|
|
27
27
|
Icon,
|
|
@@ -56,8 +56,7 @@ const WeekSelector = ({ blockId , components: { Icon , Link } , events , loadin
|
|
|
56
56
|
disabled: properties.disabled || loading,
|
|
57
57
|
disabledDate: disabledDate(properties.disabledDates),
|
|
58
58
|
format: properties.format || 'YYYY-wo',
|
|
59
|
-
getPopupContainer: ()=>document.getElementById(`${blockId}_popup`)
|
|
60
|
-
,
|
|
59
|
+
getPopupContainer: ()=>document.getElementById(`${blockId}_popup`),
|
|
61
60
|
placeholder: properties.placeholder || 'Select Week',
|
|
62
61
|
size: properties.size,
|
|
63
62
|
suffixIcon: properties.suffixIcon && /*#__PURE__*/ React.createElement(Icon, {
|
|
@@ -74,7 +73,7 @@ const WeekSelector = ({ blockId , components: { Icon , Link } , events , loadin
|
|
|
74
73
|
value: value && type.isDate(value) ? moment.utc(value).startOf('week') : null
|
|
75
74
|
}))
|
|
76
75
|
}
|
|
77
|
-
})
|
|
76
|
+
});
|
|
78
77
|
};
|
|
79
78
|
WeekSelector.defaultProps = blockDefaultProps;
|
|
80
79
|
WeekSelector.meta = {
|
package/dist/disabledDate.js
CHANGED
|
@@ -17,8 +17,7 @@ import { type } from '@lowdefy/helpers';
|
|
|
17
17
|
const disabledDate = (disabledDates = {})=>{
|
|
18
18
|
const min = type.isNone(disabledDates.min) ? undefined : moment(disabledDates.min).utc().startOf('day');
|
|
19
19
|
const max = type.isNone(disabledDates.max) ? undefined : moment(disabledDates.max).utc().endOf('day');
|
|
20
|
-
const dates = (disabledDates.dates || []).map((date)=>moment(date).utc().startOf('day')
|
|
21
|
-
);
|
|
20
|
+
const dates = (disabledDates.dates || []).map((date)=>moment(date).utc().startOf('day'));
|
|
22
21
|
const ranges = (disabledDates.ranges || []).map((range)=>{
|
|
23
22
|
if (type.isArray(range) && range.length === 2) {
|
|
24
23
|
return [
|
|
@@ -27,14 +26,12 @@ const disabledDate = (disabledDates = {})=>{
|
|
|
27
26
|
];
|
|
28
27
|
}
|
|
29
28
|
return null;
|
|
30
|
-
}).filter((range)=>range !== null
|
|
31
|
-
);
|
|
29
|
+
}).filter((range)=>range !== null);
|
|
32
30
|
return (currentDate)=>{
|
|
33
31
|
const utcCurrentData = currentDate.clone().utc();
|
|
34
32
|
if (min && utcCurrentData.isBefore(min)) return true;
|
|
35
33
|
if (max && utcCurrentData.isAfter(max)) return true;
|
|
36
|
-
let match = dates.find((date)=>date.isSame(utcCurrentData.startOf('day'))
|
|
37
|
-
);
|
|
34
|
+
let match = dates.find((date)=>date.isSame(utcCurrentData.startOf('day')));
|
|
38
35
|
if (match) return true;
|
|
39
36
|
ranges.forEach((range)=>{
|
|
40
37
|
if (utcCurrentData.startOf('day').isSameOrAfter(range[0]) && utcCurrentData.endOf('day').isSameOrBefore(range[1])) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/blocks-antd",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.13",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Lowdefy Ant Design Blocks",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -52,33 +52,34 @@
|
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@ant-design/icons": "4.7.0",
|
|
55
|
-
"@lowdefy/block-utils": "4.0.0-alpha.
|
|
56
|
-
"@lowdefy/helpers": "4.0.0-alpha.
|
|
57
|
-
"antd": "4.
|
|
55
|
+
"@lowdefy/block-utils": "4.0.0-alpha.13",
|
|
56
|
+
"@lowdefy/helpers": "4.0.0-alpha.13",
|
|
57
|
+
"antd": "4.20.7",
|
|
58
58
|
"classnames": "2.3.1",
|
|
59
59
|
"moment": "2.29.3",
|
|
60
|
-
"rc-motion": "2.
|
|
61
|
-
"react": "
|
|
62
|
-
"react-dom": "
|
|
60
|
+
"rc-motion": "2.6.0",
|
|
61
|
+
"react": "18.1.0",
|
|
62
|
+
"react-dom": "18.1.0",
|
|
63
63
|
"tinycolor2": "1.4.2"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@emotion/jest": "11.
|
|
67
|
-
"@lowdefy/block-dev": "4.0.0-alpha.
|
|
68
|
-
"@lowdefy/
|
|
69
|
-
"@
|
|
70
|
-
"@swc/
|
|
71
|
-
"@swc/
|
|
72
|
-
"@
|
|
73
|
-
"@testing-library/
|
|
74
|
-
"@testing-library/
|
|
66
|
+
"@emotion/jest": "11.9.1",
|
|
67
|
+
"@lowdefy/block-dev": "4.0.0-alpha.13",
|
|
68
|
+
"@lowdefy/jest-yaml-transform": "4.0.0-alpha.13",
|
|
69
|
+
"@lowdefy/node-utils": "4.0.0-alpha.13",
|
|
70
|
+
"@swc/cli": "0.1.57",
|
|
71
|
+
"@swc/core": "1.2.194",
|
|
72
|
+
"@swc/jest": "0.2.21",
|
|
73
|
+
"@testing-library/dom": "8.13.0",
|
|
74
|
+
"@testing-library/react": "13.3.0",
|
|
75
|
+
"@testing-library/user-event": "14.2.0",
|
|
75
76
|
"copyfiles": "2.4.1",
|
|
76
|
-
"jest": "
|
|
77
|
-
"jest-
|
|
78
|
-
"jest-
|
|
77
|
+
"jest": "28.1.0",
|
|
78
|
+
"jest-environment-jsdom": "28.1.0",
|
|
79
|
+
"jest-serializer-html": "7.1.0"
|
|
79
80
|
},
|
|
80
81
|
"publishConfig": {
|
|
81
82
|
"access": "public"
|
|
82
83
|
},
|
|
83
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "e99b4b6c1f59804982fc148c0fe39dcf13b35d77"
|
|
84
85
|
}
|