@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, jsxs as _jsxs } 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.
|
|
@@ -43,97 +42,96 @@ const ControlledListBlock = ({ blockId , components: { Icon , Link } , events ,
|
|
|
43
42
|
width: '100%'
|
|
44
43
|
}
|
|
45
44
|
};
|
|
46
|
-
return(/*#__PURE__*/
|
|
45
|
+
return(/*#__PURE__*/ React.createElement(List, {
|
|
47
46
|
id: blockId,
|
|
48
47
|
size: properties.size,
|
|
49
|
-
header: (properties.title || properties.addToFront && !properties.hideAddButton) && /*#__PURE__*/
|
|
48
|
+
header: (properties.title || properties.addToFront && !properties.hideAddButton) && /*#__PURE__*/ React.createElement("div", {
|
|
50
49
|
className: methods.makeCssClass([
|
|
51
50
|
styles.header,
|
|
52
51
|
properties.headerStyle
|
|
53
|
-
])
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
onClick: ()=>methods.unshiftItem()
|
|
75
|
-
})
|
|
76
|
-
]
|
|
77
|
-
}),
|
|
78
|
-
footer: !properties.addToFront && !properties.hideAddButton && /*#__PURE__*/ _jsxs("div", {
|
|
52
|
+
])
|
|
53
|
+
}, properties.title ? /*#__PURE__*/ React.createElement(Typography.Text, {
|
|
54
|
+
strong: true
|
|
55
|
+
}, properties.title) : /*#__PURE__*/ React.createElement("br", null), properties.addToFront && !properties.hideAddButton && /*#__PURE__*/ React.createElement(Button, {
|
|
56
|
+
blockId: `${blockId}_add_button`,
|
|
57
|
+
components: {
|
|
58
|
+
Icon,
|
|
59
|
+
Link
|
|
60
|
+
},
|
|
61
|
+
events: events,
|
|
62
|
+
properties: {
|
|
63
|
+
icon: 'AiOutlinePlus',
|
|
64
|
+
size: properties.size,
|
|
65
|
+
title: get(properties, 'addItemButton.title ') || 'Add Item',
|
|
66
|
+
type: 'default',
|
|
67
|
+
...properties.addItemButton
|
|
68
|
+
},
|
|
69
|
+
onClick: ()=>methods.unshiftItem()
|
|
70
|
+
})),
|
|
71
|
+
footer: !properties.addToFront && !properties.hideAddButton && /*#__PURE__*/ React.createElement("div", {
|
|
79
72
|
className: methods.makeCssClass([
|
|
80
73
|
styles.footer,
|
|
81
74
|
properties.footerStyle
|
|
82
|
-
])
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
},
|
|
100
|
-
onClick: ()=>methods.pushItem()
|
|
101
|
-
})
|
|
102
|
-
]
|
|
103
|
-
}),
|
|
75
|
+
])
|
|
76
|
+
}, /*#__PURE__*/ React.createElement("br", null), /*#__PURE__*/ React.createElement(Button, {
|
|
77
|
+
blockId: `${blockId}_add_button`,
|
|
78
|
+
components: {
|
|
79
|
+
Icon,
|
|
80
|
+
Link
|
|
81
|
+
},
|
|
82
|
+
events: events,
|
|
83
|
+
properties: {
|
|
84
|
+
icon: 'AiOutlinePlus',
|
|
85
|
+
size: properties.size,
|
|
86
|
+
title: get(properties, 'addItemButton.title ') || 'Add Item',
|
|
87
|
+
type: 'dashed',
|
|
88
|
+
...properties.addItemButton
|
|
89
|
+
},
|
|
90
|
+
onClick: ()=>methods.pushItem()
|
|
91
|
+
})),
|
|
104
92
|
bordered: true,
|
|
105
93
|
locale: {
|
|
106
94
|
emptyText: properties.noDataTitle || 'No Items'
|
|
107
95
|
},
|
|
108
96
|
dataSource: list,
|
|
109
|
-
renderItem: (item, i)=>/*#__PURE__*/
|
|
97
|
+
renderItem: (item, i)=>/*#__PURE__*/ React.createElement(List.Item, {
|
|
98
|
+
key: `${blockId}_${i}`,
|
|
110
99
|
className: methods.makeCssClass([
|
|
111
100
|
styles.item,
|
|
112
101
|
properties.itemStyle
|
|
113
102
|
]),
|
|
114
103
|
extra: !properties.hideRemoveButton && [
|
|
115
104
|
// eslint-disable-next-line react/jsx-key
|
|
116
|
-
/*#__PURE__*/
|
|
105
|
+
/*#__PURE__*/ React.createElement(Icon, {
|
|
117
106
|
blockId: `${blockId}_${i}_remove_icon`,
|
|
118
107
|
events: events,
|
|
119
108
|
properties: {
|
|
120
|
-
name: '
|
|
109
|
+
name: 'AiOutlineMinusCircle',
|
|
121
110
|
...properties.removeItemIcon,
|
|
122
111
|
style: {
|
|
123
|
-
paddingLeft: properties.size === 'small' ?
|
|
112
|
+
paddingLeft: properties.size === 'small' ? 2 : properties.size === 'large' ? 6 : 4,
|
|
124
113
|
fontSize: properties.size === 'small' ? 16 : properties.size === 'large' ? 20 : 18,
|
|
125
|
-
...properties.removeItemIcon && properties.removeItemIcon.style ? properties.removeItemIcon.style : {
|
|
126
|
-
}
|
|
114
|
+
...properties.removeItemIcon && properties.removeItemIcon.style ? properties.removeItemIcon.style : {}
|
|
127
115
|
}
|
|
128
116
|
},
|
|
129
117
|
onClick: ()=>methods.removeItem(i)
|
|
130
118
|
}),
|
|
131
|
-
]
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}, `${blockId}_${i}`)
|
|
119
|
+
]
|
|
120
|
+
}, item.content && item.content({
|
|
121
|
+
width: '100%'
|
|
122
|
+
}))
|
|
136
123
|
}));
|
|
137
124
|
};
|
|
138
125
|
ControlledListBlock.defaultProps = blockDefaultProps;
|
|
126
|
+
ControlledListBlock.meta = {
|
|
127
|
+
valueType: 'array',
|
|
128
|
+
category: 'list',
|
|
129
|
+
icons: [
|
|
130
|
+
'AiOutlinePlus',
|
|
131
|
+
'AiOutlineMinusCircle'
|
|
132
|
+
],
|
|
133
|
+
styles: [
|
|
134
|
+
'blocks/ControlledList/style.less'
|
|
135
|
+
]
|
|
136
|
+
};
|
|
139
137
|
export default ControlledListBlock;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } 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.
|
|
@@ -29,7 +28,7 @@ const rangeValue = (value, format)=>{
|
|
|
29
28
|
return null;
|
|
30
29
|
};
|
|
31
30
|
const DateRangeSelector = ({ blockId , components: { Icon } , events , loading , methods , properties , required , validation , value , })=>{
|
|
32
|
-
return(/*#__PURE__*/
|
|
31
|
+
return(/*#__PURE__*/ React.createElement(Label, {
|
|
33
32
|
blockId: blockId,
|
|
34
33
|
components: {
|
|
35
34
|
Icon
|
|
@@ -42,59 +41,65 @@ const DateRangeSelector = ({ blockId , components: { Icon } , events , loading
|
|
|
42
41
|
},
|
|
43
42
|
validation: validation,
|
|
44
43
|
required: required,
|
|
45
|
-
loading: loading,
|
|
46
44
|
content: {
|
|
47
|
-
content: ()=>/*#__PURE__*/
|
|
45
|
+
content: ()=>/*#__PURE__*/ React.createElement("div", {
|
|
48
46
|
className: methods.makeCssClass({
|
|
49
47
|
width: '100%'
|
|
48
|
+
})
|
|
49
|
+
}, /*#__PURE__*/ React.createElement("div", {
|
|
50
|
+
id: `${blockId}_popup`
|
|
51
|
+
}), /*#__PURE__*/ React.createElement(RangePicker, {
|
|
52
|
+
id: `${blockId}_input`,
|
|
53
|
+
allowClear: properties.allowClear !== false,
|
|
54
|
+
autoFocus: properties.autoFocus,
|
|
55
|
+
bordered: properties.bordered,
|
|
56
|
+
className: methods.makeCssClass([
|
|
57
|
+
{
|
|
58
|
+
width: '100%'
|
|
59
|
+
},
|
|
60
|
+
properties.inputStyle
|
|
61
|
+
]),
|
|
62
|
+
disabled: properties.disabled || loading,
|
|
63
|
+
disabledDate: disabledDate(properties.disabledDates),
|
|
64
|
+
format: properties.format || 'YYYY-MM-DD',
|
|
65
|
+
getPopupContainer: ()=>document.getElementById(`${blockId}_popup`)
|
|
66
|
+
,
|
|
67
|
+
separator: properties.separator || '~',
|
|
68
|
+
size: properties.size,
|
|
69
|
+
placeholder: type.isArray(properties.placeholder) && [
|
|
70
|
+
properties.placeholder[0] || 'Start Date',
|
|
71
|
+
properties.placeholder[1] || 'End Date',
|
|
72
|
+
] || [
|
|
73
|
+
'Start Date',
|
|
74
|
+
'End Date'
|
|
75
|
+
],
|
|
76
|
+
suffixIcon: properties.suffixIcon && /*#__PURE__*/ React.createElement(Icon, {
|
|
77
|
+
blockId: `${blockId}_suffixIcon`,
|
|
78
|
+
events: events,
|
|
79
|
+
properties: properties.suffixIcon || 'AiOutlineCalendar'
|
|
50
80
|
}),
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
className: methods.makeCssClass([
|
|
61
|
-
{
|
|
62
|
-
width: '100%'
|
|
63
|
-
},
|
|
64
|
-
properties.inputStyle
|
|
65
|
-
]),
|
|
66
|
-
disabled: properties.disabled,
|
|
67
|
-
disabledDate: disabledDate(properties.disabledDates),
|
|
68
|
-
format: properties.format || 'YYYY-MM-DD',
|
|
69
|
-
getPopupContainer: ()=>document.getElementById(`${blockId}_popup`)
|
|
70
|
-
,
|
|
71
|
-
separator: properties.separator || '~',
|
|
72
|
-
size: properties.size,
|
|
73
|
-
placeholder: type.isArray(properties.placeholder) && [
|
|
74
|
-
properties.placeholder[0] || 'Start Date',
|
|
75
|
-
properties.placeholder[1] || 'End Date',
|
|
76
|
-
] || [
|
|
77
|
-
'Start Date',
|
|
78
|
-
'End Date'
|
|
79
|
-
],
|
|
80
|
-
suffixIcon: properties.suffixIcon && /*#__PURE__*/ _jsx(Icon, {
|
|
81
|
-
blockId: `${blockId}_suffixIcon`,
|
|
82
|
-
events: events,
|
|
83
|
-
properties: properties.suffixIcon || 'CalendarOutlined'
|
|
84
|
-
}),
|
|
85
|
-
onChange: (newVal)=>{
|
|
86
|
-
methods.setValue(!newVal ? null : newVal.map((val)=>moment.utc(val.add(val.utcOffset(), 'minutes')).startOf('day').toDate()
|
|
87
|
-
));
|
|
88
|
-
methods.triggerEvent({
|
|
89
|
-
name: 'onChange'
|
|
90
|
-
});
|
|
91
|
-
},
|
|
92
|
-
value: rangeValue(value)
|
|
93
|
-
})
|
|
94
|
-
]
|
|
95
|
-
})
|
|
81
|
+
onChange: (newVal)=>{
|
|
82
|
+
methods.setValue(!newVal ? null : newVal.map((val)=>moment.utc(val.add(val.utcOffset(), 'minutes')).startOf('day').toDate()
|
|
83
|
+
));
|
|
84
|
+
methods.triggerEvent({
|
|
85
|
+
name: 'onChange'
|
|
86
|
+
});
|
|
87
|
+
},
|
|
88
|
+
value: rangeValue(value)
|
|
89
|
+
}))
|
|
96
90
|
}
|
|
97
91
|
}));
|
|
98
92
|
};
|
|
99
93
|
DateRangeSelector.defaultProps = blockDefaultProps;
|
|
94
|
+
DateRangeSelector.meta = {
|
|
95
|
+
valueType: 'array',
|
|
96
|
+
category: 'input',
|
|
97
|
+
icons: [
|
|
98
|
+
...Label.meta.icons,
|
|
99
|
+
'AiOutlineCalendar'
|
|
100
|
+
],
|
|
101
|
+
styles: [
|
|
102
|
+
'blocks/DateRangeSelector/style.less'
|
|
103
|
+
]
|
|
104
|
+
};
|
|
100
105
|
export default DateRangeSelector;
|
|
@@ -196,8 +196,8 @@
|
|
|
196
196
|
},
|
|
197
197
|
"suffixIcon": {
|
|
198
198
|
"type": ["string", "object"],
|
|
199
|
-
"default": "
|
|
200
|
-
"description": "Name of an
|
|
199
|
+
"default": "AiOutlineCalendar",
|
|
200
|
+
"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 icon on right-hand side of the date picker.",
|
|
201
201
|
"docs": {
|
|
202
202
|
"displayType": "icon"
|
|
203
203
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } 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.
|
|
@@ -20,8 +19,8 @@ import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
|
20
19
|
import { DatePicker } from 'antd';
|
|
21
20
|
import Label from '../Label/Label.js';
|
|
22
21
|
import disabledDate from '../../disabledDate.js';
|
|
23
|
-
const DateSelector = ({ blockId ,
|
|
24
|
-
return(/*#__PURE__*/
|
|
22
|
+
const DateSelector = ({ blockId , components: { Icon } , events , loading , methods , properties , required , validation , value , })=>{
|
|
23
|
+
return(/*#__PURE__*/ React.createElement(Label, {
|
|
25
24
|
blockId: blockId,
|
|
26
25
|
components: {
|
|
27
26
|
Icon
|
|
@@ -34,52 +33,58 @@ const DateSelector = ({ blockId , events , loading , components: { Icon } , met
|
|
|
34
33
|
},
|
|
35
34
|
validation: validation,
|
|
36
35
|
required: required,
|
|
37
|
-
loading: loading,
|
|
38
36
|
content: {
|
|
39
|
-
content: ()=>/*#__PURE__*/
|
|
37
|
+
content: ()=>/*#__PURE__*/ React.createElement("div", {
|
|
40
38
|
className: methods.makeCssClass({
|
|
41
39
|
width: '100%'
|
|
40
|
+
})
|
|
41
|
+
}, /*#__PURE__*/ React.createElement("div", {
|
|
42
|
+
id: `${blockId}_popup`
|
|
43
|
+
}), /*#__PURE__*/ React.createElement(DatePicker, {
|
|
44
|
+
id: `${blockId}_input`,
|
|
45
|
+
allowClear: properties.allowClear !== false,
|
|
46
|
+
autoFocus: properties.autoFocus,
|
|
47
|
+
bordered: properties.bordered,
|
|
48
|
+
className: methods.makeCssClass([
|
|
49
|
+
{
|
|
50
|
+
width: '100%'
|
|
51
|
+
},
|
|
52
|
+
properties.inputStyle
|
|
53
|
+
]),
|
|
54
|
+
disabled: properties.disabled || loading,
|
|
55
|
+
format: properties.format || 'YYYY-MM-DD',
|
|
56
|
+
getPopupContainer: ()=>document.getElementById(`${blockId}_popup`)
|
|
57
|
+
,
|
|
58
|
+
placeholder: properties.placeholder || 'Select Date',
|
|
59
|
+
showToday: properties.showToday,
|
|
60
|
+
size: properties.size,
|
|
61
|
+
suffixIcon: properties.suffixIcon && /*#__PURE__*/ React.createElement(Icon, {
|
|
62
|
+
blockId: `${blockId}_suffixIcon`,
|
|
63
|
+
events: events,
|
|
64
|
+
properties: properties.suffixIcon || 'AiOutlineCalendar'
|
|
42
65
|
}),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
className: methods.makeCssClass([
|
|
53
|
-
{
|
|
54
|
-
width: '100%'
|
|
55
|
-
},
|
|
56
|
-
properties.inputStyle
|
|
57
|
-
]),
|
|
58
|
-
disabled: properties.disabled,
|
|
59
|
-
format: properties.format || 'YYYY-MM-DD',
|
|
60
|
-
getPopupContainer: ()=>document.getElementById(`${blockId}_popup`)
|
|
61
|
-
,
|
|
62
|
-
placeholder: properties.placeholder || 'Select Date',
|
|
63
|
-
showToday: properties.showToday,
|
|
64
|
-
size: properties.size,
|
|
65
|
-
suffixIcon: properties.suffixIcon && /*#__PURE__*/ _jsx(Icon, {
|
|
66
|
-
blockId: `${blockId}_suffixIcon`,
|
|
67
|
-
events: events,
|
|
68
|
-
properties: properties.suffixIcon || 'CalendarOutlined'
|
|
69
|
-
}),
|
|
70
|
-
disabledDate: disabledDate(properties.disabledDates),
|
|
71
|
-
onChange: (newVal)=>{
|
|
72
|
-
methods.setValue(!newVal ? null : moment.utc(newVal.add(newVal.utcOffset(), 'minutes')).startOf('day').toDate());
|
|
73
|
-
methods.triggerEvent({
|
|
74
|
-
name: 'onChange'
|
|
75
|
-
});
|
|
76
|
-
},
|
|
77
|
-
value: type.isDate(value) ? moment.utc(value).startOf('day') : null
|
|
78
|
-
})
|
|
79
|
-
]
|
|
80
|
-
})
|
|
66
|
+
disabledDate: disabledDate(properties.disabledDates),
|
|
67
|
+
onChange: (newVal)=>{
|
|
68
|
+
methods.setValue(!newVal ? null : moment.utc(newVal.add(newVal.utcOffset(), 'minutes')).startOf('day').toDate());
|
|
69
|
+
methods.triggerEvent({
|
|
70
|
+
name: 'onChange'
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
value: type.isDate(value) ? moment.utc(value).startOf('day') : null
|
|
74
|
+
}))
|
|
81
75
|
}
|
|
82
76
|
}));
|
|
83
77
|
};
|
|
84
78
|
DateSelector.defaultProps = blockDefaultProps;
|
|
79
|
+
DateSelector.meta = {
|
|
80
|
+
valueType: 'date',
|
|
81
|
+
category: 'input',
|
|
82
|
+
icons: [
|
|
83
|
+
...Label.meta.icons,
|
|
84
|
+
'AiOutlineCalendar'
|
|
85
|
+
],
|
|
86
|
+
styles: [
|
|
87
|
+
'blocks/DateSelector/style.less'
|
|
88
|
+
]
|
|
89
|
+
};
|
|
85
90
|
export default DateSelector;
|
|
@@ -158,8 +158,8 @@
|
|
|
158
158
|
},
|
|
159
159
|
"suffixIcon": {
|
|
160
160
|
"type": ["string", "object"],
|
|
161
|
-
"default": "
|
|
162
|
-
"description": "Name of an
|
|
161
|
+
"default": "AiOutlineCalendar",
|
|
162
|
+
"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 icon on right-hand side of the date picker.",
|
|
163
163
|
"docs": {
|
|
164
164
|
"displayType": "icon"
|
|
165
165
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } 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.
|
|
@@ -20,9 +19,9 @@ import { type } from '@lowdefy/helpers';
|
|
|
20
19
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
21
20
|
import Label from '../Label/Label.js';
|
|
22
21
|
import disabledDate from '../../disabledDate.js';
|
|
23
|
-
const DateTimeSelector = ({ blockId ,
|
|
22
|
+
const DateTimeSelector = ({ blockId , components: { Icon } , events , loading , methods , properties , required , validation , value , })=>{
|
|
24
23
|
const timeUnit = !type.isString(properties.timeFormat) ? 'minute' : properties.timeFormat === 'HH:mm:ss' ? 'second' : properties.timeFormat === 'HH' ? 'hour' : 'minute';
|
|
25
|
-
return(/*#__PURE__*/
|
|
24
|
+
return(/*#__PURE__*/ React.createElement(Label, {
|
|
26
25
|
blockId: blockId,
|
|
27
26
|
components: {
|
|
28
27
|
Icon
|
|
@@ -35,59 +34,65 @@ const DateTimeSelector = ({ blockId , events , loading , components: { Icon } ,
|
|
|
35
34
|
},
|
|
36
35
|
validation: validation,
|
|
37
36
|
required: required,
|
|
38
|
-
loading: loading,
|
|
39
37
|
content: {
|
|
40
|
-
content: ()=>/*#__PURE__*/
|
|
38
|
+
content: ()=>/*#__PURE__*/ React.createElement("div", {
|
|
41
39
|
className: methods.makeCssClass({
|
|
42
40
|
width: '100%'
|
|
41
|
+
})
|
|
42
|
+
}, /*#__PURE__*/ React.createElement("div", {
|
|
43
|
+
id: `${blockId}_popup`
|
|
44
|
+
}), /*#__PURE__*/ React.createElement(DatePicker, {
|
|
45
|
+
id: `${blockId}_input`,
|
|
46
|
+
allowClear: properties.allowClear !== false,
|
|
47
|
+
autoFocus: properties.autoFocus,
|
|
48
|
+
bordered: properties.bordered,
|
|
49
|
+
className: methods.makeCssClass([
|
|
50
|
+
{
|
|
51
|
+
width: '100%'
|
|
52
|
+
},
|
|
53
|
+
properties.inputStyle
|
|
54
|
+
]),
|
|
55
|
+
disabled: properties.disabled || loading,
|
|
56
|
+
disabledDate: disabledDate(properties.disabledDates),
|
|
57
|
+
format: properties.format || 'YYYY-MM-DD HH:mm',
|
|
58
|
+
getPopupContainer: ()=>document.getElementById(`${blockId}_popup`)
|
|
59
|
+
,
|
|
60
|
+
placeholder: properties.placeholder || 'Select Date & Time',
|
|
61
|
+
showNow: properties.showNow,
|
|
62
|
+
showToday: properties.showToday,
|
|
63
|
+
size: properties.size,
|
|
64
|
+
suffixIcon: properties.suffixIcon && /*#__PURE__*/ React.createElement(Icon, {
|
|
65
|
+
blockId: `${blockId}_suffixIcon`,
|
|
66
|
+
events: events,
|
|
67
|
+
properties: properties.suffixIcon || 'AiOutlineCalendar'
|
|
43
68
|
}),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
]),
|
|
59
|
-
disabled: properties.disabled,
|
|
60
|
-
disabledDate: disabledDate(properties.disabledDates),
|
|
61
|
-
format: properties.format || 'YYYY-MM-DD HH:mm',
|
|
62
|
-
getPopupContainer: ()=>document.getElementById(`${blockId}_popup`)
|
|
63
|
-
,
|
|
64
|
-
placeholder: properties.placeholder || 'Select Date & Time',
|
|
65
|
-
showNow: properties.showNow,
|
|
66
|
-
showToday: properties.showToday,
|
|
67
|
-
size: properties.size,
|
|
68
|
-
suffixIcon: properties.suffixIcon && /*#__PURE__*/ _jsx(Icon, {
|
|
69
|
-
blockId: `${blockId}_suffixIcon`,
|
|
70
|
-
events: events,
|
|
71
|
-
properties: properties.suffixIcon || 'CalendarOutlined'
|
|
72
|
-
}),
|
|
73
|
-
showTime: {
|
|
74
|
-
format: properties.timeFormat || 'HH:mm',
|
|
75
|
-
hourStep: properties.hourStep || 1,
|
|
76
|
-
minuteStep: properties.minuteStep || 5,
|
|
77
|
-
secondStep: properties.secondStep || 30
|
|
78
|
-
},
|
|
79
|
-
onChange: (newVal)=>{
|
|
80
|
-
methods.setValue(!newVal ? null : moment.utc(newVal.add(properties.selectUTC ? newVal.utcOffset() : 0, 'minutes')).startOf(timeUnit).toDate());
|
|
81
|
-
methods.triggerEvent({
|
|
82
|
-
name: 'onChange'
|
|
83
|
-
});
|
|
84
|
-
},
|
|
85
|
-
value: !type.isDate(value) ? null : properties.selectUTC ? moment.utc(value) : moment(value)
|
|
86
|
-
})
|
|
87
|
-
]
|
|
88
|
-
})
|
|
69
|
+
showTime: {
|
|
70
|
+
format: properties.timeFormat || 'HH:mm',
|
|
71
|
+
hourStep: properties.hourStep || 1,
|
|
72
|
+
minuteStep: properties.minuteStep || 5,
|
|
73
|
+
secondStep: properties.secondStep || 30
|
|
74
|
+
},
|
|
75
|
+
onChange: (newVal)=>{
|
|
76
|
+
methods.setValue(!newVal ? null : moment.utc(newVal.add(properties.selectUTC ? newVal.utcOffset() : 0, 'minutes')).startOf(timeUnit).toDate());
|
|
77
|
+
methods.triggerEvent({
|
|
78
|
+
name: 'onChange'
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
value: !type.isDate(value) ? null : properties.selectUTC ? moment.utc(value) : moment(value)
|
|
82
|
+
}))
|
|
89
83
|
}
|
|
90
84
|
}));
|
|
91
85
|
};
|
|
92
86
|
DateTimeSelector.defaultProps = blockDefaultProps;
|
|
87
|
+
DateTimeSelector.meta = {
|
|
88
|
+
valueType: 'date',
|
|
89
|
+
category: 'input',
|
|
90
|
+
icons: [
|
|
91
|
+
...Label.meta.icons,
|
|
92
|
+
'AiOutlineCalendar'
|
|
93
|
+
],
|
|
94
|
+
styles: [
|
|
95
|
+
'blocks/DateTimeSelector/style.less'
|
|
96
|
+
]
|
|
97
|
+
};
|
|
93
98
|
export default DateTimeSelector;
|
|
@@ -185,8 +185,8 @@
|
|
|
185
185
|
},
|
|
186
186
|
"suffixIcon": {
|
|
187
187
|
"type": ["string", "object"],
|
|
188
|
-
"default": "
|
|
189
|
-
"description": "Name of an
|
|
188
|
+
"default": "AiOutlineCalendar",
|
|
189
|
+
"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 icon on right-hand side of the date picker.",
|
|
190
190
|
"docs": {
|
|
191
191
|
"displayType": "icon"
|
|
192
192
|
}
|