@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, Fragment as _Fragment } 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.
|
|
@@ -39,92 +38,93 @@ const MobileMenu = ({ basePath , blockId , components , events , methods , menus
|
|
|
39
38
|
setOpen(open);
|
|
40
39
|
});
|
|
41
40
|
});
|
|
42
|
-
return(/*#__PURE__*/
|
|
43
|
-
id: blockId
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
41
|
+
return(/*#__PURE__*/ React.createElement("div", {
|
|
42
|
+
id: blockId
|
|
43
|
+
}, /*#__PURE__*/ React.createElement(Button, {
|
|
44
|
+
blockId: `${blockId}_button`,
|
|
45
|
+
components: components,
|
|
46
|
+
events: events,
|
|
47
|
+
properties: {
|
|
48
|
+
hideTitle: true,
|
|
49
|
+
type: 'primary',
|
|
50
|
+
icon: {
|
|
51
|
+
name: openState ? 'AiOutlineMenuUnfold' : 'AiOutlineMenuFold'
|
|
52
|
+
},
|
|
53
|
+
...properties.toggleMenuButton || {}
|
|
54
|
+
},
|
|
55
|
+
methods: methods,
|
|
56
|
+
onClick: ()=>methods[get(rename, 'methods.toggleOpen', {
|
|
57
|
+
default: 'toggleOpen'
|
|
58
|
+
})]()
|
|
59
|
+
,
|
|
60
|
+
rename: {
|
|
61
|
+
events: {
|
|
62
|
+
onClick: 'onToggleDrawer'
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}), /*#__PURE__*/ React.createElement(Drawer, {
|
|
66
|
+
blockId: `${blockId}_drawer`,
|
|
67
|
+
components: components,
|
|
68
|
+
properties: mergeObjects([
|
|
69
|
+
{
|
|
70
|
+
bodyStyle: {
|
|
71
|
+
padding: '3.1em 0 0 0'
|
|
67
72
|
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
},
|
|
74
|
+
properties.drawer,
|
|
75
|
+
]),
|
|
76
|
+
rename: {
|
|
77
|
+
events: {
|
|
78
|
+
onToggle: 'onToggleDrawer'
|
|
79
|
+
},
|
|
80
|
+
methods: {
|
|
81
|
+
setOpen: '_setOpen',
|
|
82
|
+
toggleOpen: '_toggleOpen'
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
methods: methods,
|
|
86
|
+
onClose: ()=>methods[get(rename, 'methods.toggleOpen', {
|
|
87
|
+
default: 'toggleOpen'
|
|
88
|
+
})]()
|
|
89
|
+
,
|
|
90
|
+
content: {
|
|
91
|
+
content: ()=>/*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Menu, {
|
|
92
|
+
basePath: basePath,
|
|
93
|
+
components: components,
|
|
94
|
+
blockId: `${blockId}_menu`,
|
|
95
|
+
methods: methods,
|
|
96
|
+
events: events,
|
|
97
|
+
menus: menus,
|
|
98
|
+
pageId: pageId,
|
|
99
|
+
properties: {
|
|
100
|
+
collapsed: false,
|
|
101
|
+
theme: 'light',
|
|
102
|
+
...mergeObjects(properties, {
|
|
103
|
+
style: {
|
|
104
|
+
marginTop: 24
|
|
105
|
+
}
|
|
106
|
+
}) || {},
|
|
107
|
+
mode: 'inline'
|
|
78
108
|
},
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
},
|
|
85
|
-
methods: {
|
|
86
|
-
setOpen: '_setOpen',
|
|
87
|
-
toggleOpen: '_toggleOpen'
|
|
109
|
+
rename: {
|
|
110
|
+
events: {
|
|
111
|
+
onClick: 'onMenuItemClick',
|
|
112
|
+
onSelect: 'onMenuItemSelect'
|
|
113
|
+
}
|
|
88
114
|
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
default: 'toggleOpen'
|
|
93
|
-
})]()
|
|
94
|
-
,
|
|
95
|
-
content: {
|
|
96
|
-
content: ()=>/*#__PURE__*/ _jsx(_Fragment, {
|
|
97
|
-
children: /*#__PURE__*/ _jsx(Menu, {
|
|
98
|
-
basePath: basePath,
|
|
99
|
-
components: components,
|
|
100
|
-
blockId: `${blockId}_menu`,
|
|
101
|
-
methods: methods,
|
|
102
|
-
events: events,
|
|
103
|
-
menus: menus,
|
|
104
|
-
pageId: pageId,
|
|
105
|
-
properties: {
|
|
106
|
-
collapsed: false,
|
|
107
|
-
theme: 'light',
|
|
108
|
-
...mergeObjects(properties, {
|
|
109
|
-
style: {
|
|
110
|
-
marginTop: 24
|
|
111
|
-
}
|
|
112
|
-
}) || {
|
|
113
|
-
},
|
|
114
|
-
mode: 'inline'
|
|
115
|
-
},
|
|
116
|
-
rename: {
|
|
117
|
-
events: {
|
|
118
|
-
onClick: 'onMenuItemClick',
|
|
119
|
-
onSelect: 'onMenuItemSelect'
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
})
|
|
123
|
-
})
|
|
124
|
-
}
|
|
125
|
-
})
|
|
126
|
-
]
|
|
127
|
-
}));
|
|
115
|
+
}))
|
|
116
|
+
}
|
|
117
|
+
})));
|
|
128
118
|
};
|
|
129
119
|
MobileMenu.defaultProps = blockDefaultProps;
|
|
120
|
+
MobileMenu.meta = {
|
|
121
|
+
category: 'display',
|
|
122
|
+
icons: [
|
|
123
|
+
'AiOutlineMenuUnfold',
|
|
124
|
+
'AiOutlineMenuFold'
|
|
125
|
+
],
|
|
126
|
+
styles: [
|
|
127
|
+
'blocks/MobileMenu/style.less'
|
|
128
|
+
]
|
|
129
|
+
};
|
|
130
130
|
export default MobileMenu;
|
|
@@ -18,24 +18,10 @@
|
|
|
18
18
|
"displayType": "yaml"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
-
"backgroundColor": {
|
|
22
|
-
"type": "string",
|
|
23
|
-
"description": "Menu background color.",
|
|
24
|
-
"docs": {
|
|
25
|
-
"displayType": "color"
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
21
|
"menuId": {
|
|
29
22
|
"type": "string",
|
|
30
23
|
"description": "App menu id used to get menu links."
|
|
31
24
|
},
|
|
32
|
-
"selectedColor": {
|
|
33
|
-
"type": "string",
|
|
34
|
-
"description": "Menu primary selected color.",
|
|
35
|
-
"docs": {
|
|
36
|
-
"displayType": "color"
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
25
|
"selectedKeys": {
|
|
40
26
|
"type": "array",
|
|
41
27
|
"description": "Array with the keys of currently selected menu items.",
|
|
@@ -95,7 +81,7 @@
|
|
|
95
81
|
},
|
|
96
82
|
"icon": {
|
|
97
83
|
"type": ["string", "object"],
|
|
98
|
-
"description": "Name of an
|
|
84
|
+
"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 menu item.",
|
|
99
85
|
"docs": {
|
|
100
86
|
"displayType": "icon"
|
|
101
87
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
1
|
/*
|
|
3
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
4
3
|
|
|
5
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
5
|
you may not use this file except in compliance with the License.
|
|
@@ -17,6 +16,20 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
17
16
|
import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
18
17
|
import { get } from '@lowdefy/helpers';
|
|
19
18
|
import { Modal } from 'antd';
|
|
19
|
+
function _extends() {
|
|
20
|
+
_extends = Object.assign || function(target) {
|
|
21
|
+
for(var i = 1; i < arguments.length; i++){
|
|
22
|
+
var source = arguments[i];
|
|
23
|
+
for(var key in source){
|
|
24
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
25
|
+
target[key] = source[key];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return target;
|
|
30
|
+
};
|
|
31
|
+
return _extends.apply(this, arguments);
|
|
32
|
+
}
|
|
20
33
|
const triggerSetOpen = ({ methods , setOpen , state })=>{
|
|
21
34
|
if (!state) {
|
|
22
35
|
methods.triggerEvent({
|
|
@@ -46,72 +59,75 @@ const ModalBlock = ({ blockId , content , events , methods , properties })=>{
|
|
|
46
59
|
})
|
|
47
60
|
);
|
|
48
61
|
});
|
|
49
|
-
const extraProps = {
|
|
50
|
-
};
|
|
62
|
+
const extraProps = {};
|
|
51
63
|
if (content.footer) {
|
|
52
64
|
extraProps.footer = content.footer();
|
|
53
65
|
}
|
|
54
66
|
if (properties.footer === false) {
|
|
55
67
|
extraProps.footer = null;
|
|
56
68
|
}
|
|
57
|
-
return(/*#__PURE__*/
|
|
58
|
-
id: blockId
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
69
|
+
return(/*#__PURE__*/ React.createElement("div", {
|
|
70
|
+
id: blockId
|
|
71
|
+
}, /*#__PURE__*/ React.createElement(Modal, _extends({
|
|
72
|
+
id: `${blockId}_modal`,
|
|
73
|
+
afterClose: ()=>methods.triggerEvent({
|
|
74
|
+
name: 'afterClose'
|
|
75
|
+
})
|
|
76
|
+
,
|
|
77
|
+
bodyStyle: methods.makeCssClass(properties.bodyStyle, true),
|
|
78
|
+
cancelButtonProps: properties.cancelButtonProps,
|
|
79
|
+
cancelText: properties.cancelText || 'Cancel',
|
|
80
|
+
centered: !!properties.centered,
|
|
81
|
+
closable: properties.closable !== undefined ? properties.closable : true,
|
|
82
|
+
confirmLoading: get(events, 'onOk.loading'),
|
|
83
|
+
mask: properties.mask !== undefined ? properties.mask : true,
|
|
84
|
+
maskClosable: properties.maskClosable !== undefined ? properties.maskClosable : true,
|
|
85
|
+
maskStyle: methods.makeCssClass(properties.maskStyle, true),
|
|
86
|
+
okButtonProps: properties.okButtonProps,
|
|
87
|
+
okText: properties.okText || 'Ok',
|
|
88
|
+
okType: properties.okButtonType || 'primary',
|
|
89
|
+
title: renderHtml({
|
|
90
|
+
html: properties.title,
|
|
91
|
+
methods
|
|
92
|
+
}),
|
|
93
|
+
visible: openState,
|
|
94
|
+
width: properties.width,
|
|
95
|
+
wrapClassName: methods.makeCssClass(properties.wrapperStyle),
|
|
96
|
+
zIndex: properties.zIndex,
|
|
97
|
+
onOk: async ()=>{
|
|
98
|
+
const response = await methods.triggerEvent({
|
|
99
|
+
name: 'onOk'
|
|
100
|
+
});
|
|
101
|
+
if (response.success === false) return;
|
|
102
|
+
if (response.bounced !== true) {
|
|
103
|
+
triggerSetOpen({
|
|
104
|
+
state: false,
|
|
105
|
+
setOpen,
|
|
106
|
+
methods
|
|
88
107
|
});
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
onCancel: async ()=>{
|
|
111
|
+
const response = await methods.triggerEvent({
|
|
112
|
+
name: 'onCancel'
|
|
113
|
+
});
|
|
114
|
+
if (response.success === false) return;
|
|
115
|
+
if (response.bounced !== true) {
|
|
116
|
+
triggerSetOpen({
|
|
117
|
+
state: false,
|
|
118
|
+
setOpen,
|
|
119
|
+
methods
|
|
101
120
|
});
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
state: false,
|
|
106
|
-
setOpen,
|
|
107
|
-
methods
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
...extraProps,
|
|
112
|
-
children: content.content && content.content()
|
|
113
|
-
})
|
|
114
|
-
}));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}, extraProps), content.content && content.content())));
|
|
115
124
|
};
|
|
116
125
|
ModalBlock.defaultProps = blockDefaultProps;
|
|
126
|
+
ModalBlock.meta = {
|
|
127
|
+
category: 'container',
|
|
128
|
+
icons: [],
|
|
129
|
+
styles: [
|
|
130
|
+
'blocks/Modal/style.less'
|
|
131
|
+
]
|
|
132
|
+
};
|
|
117
133
|
export default ModalBlock;
|
|
@@ -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.
|
|
@@ -22,13 +21,12 @@ import Label from '../Label/Label.js';
|
|
|
22
21
|
import disabledDate from '../../disabledDate.js';
|
|
23
22
|
const MonthPicker = DatePicker.MonthPicker;
|
|
24
23
|
const MonthSelector = ({ blockId , components: { Icon } , events , loading , methods , properties , required , validation , value , })=>{
|
|
25
|
-
return(/*#__PURE__*/
|
|
24
|
+
return(/*#__PURE__*/ React.createElement(Label, {
|
|
26
25
|
blockId: blockId,
|
|
27
26
|
components: {
|
|
28
27
|
Icon
|
|
29
28
|
},
|
|
30
29
|
events: events,
|
|
31
|
-
loading: loading,
|
|
32
30
|
properties: {
|
|
33
31
|
title: properties.title,
|
|
34
32
|
size: properties.size,
|
|
@@ -37,49 +35,56 @@ const MonthSelector = ({ blockId , components: { Icon } , events , loading , me
|
|
|
37
35
|
required: required,
|
|
38
36
|
validation: validation,
|
|
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(MonthPicker, {
|
|
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',
|
|
58
|
+
getPopupContainer: ()=>document.getElementById(`${blockId}_popup`)
|
|
59
|
+
,
|
|
60
|
+
placeholder: properties.placeholder || 'Select Month',
|
|
61
|
+
size: properties.size,
|
|
62
|
+
value: type.isDate(value) ? moment.utc(value).startOf('month') : null,
|
|
63
|
+
suffixIcon: properties.suffixIcon && /*#__PURE__*/ React.createElement(Icon, {
|
|
64
|
+
blockId: `${blockId}_suffixIcon`,
|
|
65
|
+
events: events,
|
|
66
|
+
properties: properties.suffixIcon || 'AiOutlineCalendar'
|
|
43
67
|
}),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
autoFocus: properties.autoFocus,
|
|
52
|
-
bordered: properties.bordered,
|
|
53
|
-
className: methods.makeCssClass([
|
|
54
|
-
{
|
|
55
|
-
width: '100%'
|
|
56
|
-
},
|
|
57
|
-
properties.inputStyle
|
|
58
|
-
]),
|
|
59
|
-
disabled: properties.disabled,
|
|
60
|
-
disabledDate: disabledDate(properties.disabledDates),
|
|
61
|
-
format: properties.format || 'YYYY-MM',
|
|
62
|
-
getPopupContainer: ()=>document.getElementById(`${blockId}_popup`)
|
|
63
|
-
,
|
|
64
|
-
placeholder: properties.placeholder || 'Select Month',
|
|
65
|
-
size: properties.size,
|
|
66
|
-
value: type.isDate(value) ? moment.utc(value).startOf('month') : null,
|
|
67
|
-
suffixIcon: properties.suffixIcon && /*#__PURE__*/ _jsx(Icon, {
|
|
68
|
-
blockId: `${blockId}_suffixIcon`,
|
|
69
|
-
events: events,
|
|
70
|
-
properties: properties.suffixIcon || 'CalendarOutlined'
|
|
71
|
-
}),
|
|
72
|
-
onChange: (newVal)=>{
|
|
73
|
-
methods.setValue(!newVal ? null : moment.utc(newVal.add(newVal.utcOffset(), 'minutes')).startOf('month').toDate());
|
|
74
|
-
methods.triggerEvent({
|
|
75
|
-
name: 'onChange'
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
})
|
|
79
|
-
]
|
|
80
|
-
})
|
|
68
|
+
onChange: (newVal)=>{
|
|
69
|
+
methods.setValue(!newVal ? null : moment.utc(newVal.add(newVal.utcOffset(), 'minutes')).startOf('month').toDate());
|
|
70
|
+
methods.triggerEvent({
|
|
71
|
+
name: 'onChange'
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}))
|
|
81
75
|
}
|
|
82
76
|
}));
|
|
83
77
|
};
|
|
84
78
|
MonthSelector.defaultProps = blockDefaultProps;
|
|
79
|
+
MonthSelector.meta = {
|
|
80
|
+
valueType: 'date',
|
|
81
|
+
category: 'input',
|
|
82
|
+
icons: [
|
|
83
|
+
...Label.meta.icons,
|
|
84
|
+
'AiOutlineCalendar'
|
|
85
|
+
],
|
|
86
|
+
styles: [
|
|
87
|
+
'blocks/MonthSelector/style.less'
|
|
88
|
+
]
|
|
89
|
+
};
|
|
85
90
|
export default MonthSelector;
|
|
@@ -99,8 +99,8 @@
|
|
|
99
99
|
},
|
|
100
100
|
"suffixIcon": {
|
|
101
101
|
"type": ["string", "object"],
|
|
102
|
-
"default": "
|
|
103
|
-
"description": "Name of an
|
|
102
|
+
"default": "AiOutlineCalendar",
|
|
103
|
+
"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.",
|
|
104
104
|
"docs": {
|
|
105
105
|
"displayType": "icon"
|
|
106
106
|
}
|