@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
|
@@ -24,8 +24,7 @@ const HeaderBlock = ({ blockId , content , methods , properties })=>/*#__PURE__
|
|
|
24
24
|
},
|
|
25
25
|
properties.style,
|
|
26
26
|
])} hide-on-print`
|
|
27
|
-
}, content.content && content.content())
|
|
28
|
-
;
|
|
27
|
+
}, content.content && content.content());
|
|
29
28
|
HeaderBlock.defaultProps = blockDefaultProps;
|
|
30
29
|
HeaderBlock.meta = {
|
|
31
30
|
category: 'container',
|
|
@@ -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
|
|
|
@@ -20,20 +34,6 @@ import { Col, Row } from 'antd';
|
|
|
20
34
|
import classNames from 'classnames';
|
|
21
35
|
import CSSMotion from 'rc-motion';
|
|
22
36
|
import labelLogic from './labelLogic.js';
|
|
23
|
-
function _extends() {
|
|
24
|
-
_extends = Object.assign || function(target) {
|
|
25
|
-
for(var i = 1; i < arguments.length; i++){
|
|
26
|
-
var source = arguments[i];
|
|
27
|
-
for(var key in source){
|
|
28
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
29
|
-
target[key] = source[key];
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return target;
|
|
34
|
-
};
|
|
35
|
-
return _extends.apply(this, arguments);
|
|
36
|
-
}
|
|
37
37
|
const validationKeyMap = {
|
|
38
38
|
error: 'errors',
|
|
39
39
|
warning: 'warnings'
|
|
@@ -52,16 +52,13 @@ const Label = ({ blockId , components: { Icon } , content , methods , propertie
|
|
|
52
52
|
iconMap = {
|
|
53
53
|
error: ()=>/*#__PURE__*/ React.createElement(Icon, {
|
|
54
54
|
properties: "AiFillCloseCircle"
|
|
55
|
-
})
|
|
56
|
-
,
|
|
55
|
+
}),
|
|
57
56
|
success: ()=>/*#__PURE__*/ React.createElement(Icon, {
|
|
58
57
|
properties: "AiFillCheckCircle"
|
|
59
|
-
})
|
|
60
|
-
,
|
|
58
|
+
}),
|
|
61
59
|
validating: ()=>/*#__PURE__*/ React.createElement(Icon, {
|
|
62
60
|
properties: "AiOutlineLoading"
|
|
63
|
-
})
|
|
64
|
-
,
|
|
61
|
+
}),
|
|
65
62
|
warning: ()=>/*#__PURE__*/ React.createElement(Icon, {
|
|
66
63
|
properties: "AiFillExclamationCircle"
|
|
67
64
|
})
|
|
@@ -71,7 +68,7 @@ const Label = ({ blockId , components: { Icon } , content , methods , propertie
|
|
|
71
68
|
const icon = validation.status && IconNode ? /*#__PURE__*/ React.createElement("span", {
|
|
72
69
|
className: "ant-form-item-children-icon"
|
|
73
70
|
}, /*#__PURE__*/ React.createElement(IconNode, null)) : null;
|
|
74
|
-
return
|
|
71
|
+
return /*#__PURE__*/ React.createElement(Row, {
|
|
75
72
|
id: blockId,
|
|
76
73
|
className: rowClassName
|
|
77
74
|
}, label && /*#__PURE__*/ React.createElement(Col, _extends({}, labelCol, {
|
|
@@ -96,13 +93,12 @@ const Label = ({ blockId , components: { Icon } , content , methods , propertie
|
|
|
96
93
|
removeOnLeave: true
|
|
97
94
|
}, ({ className: motionClassName })=>/*#__PURE__*/ React.createElement("div", {
|
|
98
95
|
className: classNames(feedbackClassName, motionClassName)
|
|
99
|
-
}, validation[validationKeyMap[validation.status]] && validation[validationKeyMap[validation.status]].length > 0 && validation[validationKeyMap[validation.status]][0])
|
|
100
|
-
), showExtra && /*#__PURE__*/ React.createElement("div", {
|
|
96
|
+
}, validation[validationKeyMap[validation.status]] && validation[validationKeyMap[validation.status]].length > 0 && validation[validationKeyMap[validation.status]][0])), showExtra && /*#__PURE__*/ React.createElement("div", {
|
|
101
97
|
className: extraClassName
|
|
102
98
|
}, renderHtml({
|
|
103
99
|
html: properties.extra,
|
|
104
100
|
methods
|
|
105
|
-
}))))
|
|
101
|
+
}))));
|
|
106
102
|
};
|
|
107
103
|
Label.defaultProps = blockDefaultProps;
|
|
108
104
|
Label.meta = {
|
|
@@ -18,8 +18,7 @@ import { Layout } from 'antd';
|
|
|
18
18
|
const LayoutBlock = ({ blockId , content , properties , methods })=>/*#__PURE__*/ React.createElement(Layout, {
|
|
19
19
|
id: blockId,
|
|
20
20
|
className: methods.makeCssClass(properties.style)
|
|
21
|
-
}, content.content && content.content())
|
|
22
|
-
;
|
|
21
|
+
}, content.content && content.content());
|
|
23
22
|
LayoutBlock.defaultProps = blockDefaultProps;
|
|
24
23
|
LayoutBlock.meta = {
|
|
25
24
|
category: 'container',
|
package/dist/blocks/Menu/Menu.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
|
|
|
@@ -16,29 +30,13 @@
|
|
|
16
30
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
17
31
|
import { Menu } from 'antd';
|
|
18
32
|
import { type, get } 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
|
const getDefaultMenu = (menus, menuId = 'default', links)=>{
|
|
34
34
|
if (type.isArray(links)) return links;
|
|
35
35
|
if (!type.isArray(menus)) return [];
|
|
36
|
-
const menu = menus.find((item)=>item.menuId === menuId
|
|
37
|
-
) || menus[0] || {};
|
|
36
|
+
const menu = menus.find((item)=>item.menuId === menuId) || menus[0] || {};
|
|
38
37
|
return menu.links || [];
|
|
39
38
|
};
|
|
40
|
-
const getTitle = ({ id , properties , pageId , url })=>properties && properties.title || pageId || url || id
|
|
41
|
-
;
|
|
39
|
+
const getTitle = ({ id , properties , pageId , url })=>properties && properties.title || pageId || url || id;
|
|
42
40
|
const MenuComp = ({ blockId , components: { Icon , Link } , events , menus , methods , pageId , properties , rename , })=>{
|
|
43
41
|
const styles = {
|
|
44
42
|
lineHeight: '64px',
|
|
@@ -52,7 +50,7 @@ const MenuComp = ({ blockId , components: { Icon , Link } , events , menus , me
|
|
|
52
50
|
}
|
|
53
51
|
const menu = getDefaultMenu(menus, properties.menuId, properties.links);
|
|
54
52
|
const theme = properties.theme || 'dark';
|
|
55
|
-
return
|
|
53
|
+
return /*#__PURE__*/ React.createElement(Menu, _extends({
|
|
56
54
|
id: blockId,
|
|
57
55
|
expandIcon: properties.expandIcon && /*#__PURE__*/ React.createElement(Icon, {
|
|
58
56
|
blockId: `${blockId}_expandIcon`,
|
|
@@ -68,15 +66,11 @@ const MenuComp = ({ blockId , components: { Icon , Link } , events , menus , me
|
|
|
68
66
|
properties.style
|
|
69
67
|
]),
|
|
70
68
|
defaultOpenKeys: properties.defaultOpenKeys || properties.mode === 'inline' && properties.collapsed !== true && [
|
|
71
|
-
(menu.find((link1)=>(link1.links || []).map((subLink)=>subLink.links ? subLink.links.map((subSubLink)=>subSubLink.pageId
|
|
72
|
-
) : [
|
|
69
|
+
(menu.find((link1)=>(link1.links || []).map((subLink)=>subLink.links ? subLink.links.map((subSubLink)=>subSubLink.pageId) : [
|
|
73
70
|
subLink.pageId
|
|
74
|
-
]
|
|
75
|
-
).flat().some((link)=>(properties.selectedKeys || [
|
|
71
|
+
]).flat().some((link)=>(properties.selectedKeys || [
|
|
76
72
|
pageId
|
|
77
|
-
]).indexOf(link) !== -1
|
|
78
|
-
)
|
|
79
|
-
) || {}).id,
|
|
73
|
+
]).indexOf(link) !== -1)) || {}).id,
|
|
80
74
|
] || [],
|
|
81
75
|
selectedKeys: properties.selectedKeys || [
|
|
82
76
|
pageId
|
|
@@ -90,8 +84,7 @@ const MenuComp = ({ blockId , components: { Icon , Link } , events , menus , me
|
|
|
90
84
|
event: {
|
|
91
85
|
key: item.key
|
|
92
86
|
}
|
|
93
|
-
})
|
|
94
|
-
,
|
|
87
|
+
}),
|
|
95
88
|
onClick: (item)=>methods.triggerEvent({
|
|
96
89
|
name: get(rename, 'events.onClick', {
|
|
97
90
|
default: 'onClick'
|
|
@@ -99,8 +92,7 @@ const MenuComp = ({ blockId , components: { Icon , Link } , events , menus , me
|
|
|
99
92
|
event: {
|
|
100
93
|
key: item.key
|
|
101
94
|
}
|
|
102
|
-
})
|
|
103
|
-
,
|
|
95
|
+
}),
|
|
104
96
|
onOpenChange: (openKeys)=>methods.triggerEvent({
|
|
105
97
|
name: get(rename, 'events.onToggleMenuGroup', {
|
|
106
98
|
default: 'onToggleMenuGroup'
|
|
@@ -112,15 +104,15 @@ const MenuComp = ({ blockId , components: { Icon , Link } , events , menus , me
|
|
|
112
104
|
}, exProps), menu.map((link, i)=>{
|
|
113
105
|
switch(link.type){
|
|
114
106
|
case 'MenuDivider':
|
|
115
|
-
return
|
|
107
|
+
return /*#__PURE__*/ React.createElement(Menu.Divider, {
|
|
116
108
|
key: `${link.id}_${i}`,
|
|
117
109
|
className: methods.makeCssClass([
|
|
118
110
|
link.style
|
|
119
111
|
]),
|
|
120
112
|
dashed: link.properties && link.properties.dashed
|
|
121
|
-
})
|
|
113
|
+
});
|
|
122
114
|
case 'MenuGroup':
|
|
123
|
-
return
|
|
115
|
+
return /*#__PURE__*/ React.createElement(Menu.SubMenu, {
|
|
124
116
|
key: `${link.pageId || link.id}_${i}`,
|
|
125
117
|
title: /*#__PURE__*/ React.createElement(Link, _extends({
|
|
126
118
|
id: link.pageId || link.id || i,
|
|
@@ -136,15 +128,15 @@ const MenuComp = ({ blockId , components: { Icon , Link } , events , menus , me
|
|
|
136
128
|
}).map((subLink, j)=>{
|
|
137
129
|
switch(subLink.type){
|
|
138
130
|
case 'MenuDivider':
|
|
139
|
-
return
|
|
131
|
+
return /*#__PURE__*/ React.createElement(Menu.Divider, {
|
|
140
132
|
key: `${subLink.id || i}_${j}`,
|
|
141
133
|
className: methods.makeCssClass([
|
|
142
134
|
subLink.style
|
|
143
135
|
]),
|
|
144
136
|
dashed: subLink.properties && subLink.properties.dashed
|
|
145
|
-
})
|
|
137
|
+
});
|
|
146
138
|
case 'MenuGroup':
|
|
147
|
-
return
|
|
139
|
+
return /*#__PURE__*/ React.createElement(Menu.ItemGroup, {
|
|
148
140
|
key: `${subLink.pageId || subLink.id}_${j}`,
|
|
149
141
|
title: /*#__PURE__*/ React.createElement(Link, _extends({
|
|
150
142
|
id: subLink.pageId || subLink.id || j,
|
|
@@ -152,15 +144,15 @@ const MenuComp = ({ blockId , components: { Icon , Link } , events , menus , me
|
|
|
152
144
|
}, subLink), getTitle(subLink))
|
|
153
145
|
}, subLink.links.map((subLinkGroup, k)=>{
|
|
154
146
|
if (subLinkGroup.type === 'MenuDivider') {
|
|
155
|
-
return
|
|
147
|
+
return /*#__PURE__*/ React.createElement(Menu.Divider, {
|
|
156
148
|
key: `${subLink.id}_${k}`,
|
|
157
149
|
className: methods.makeCssClass([
|
|
158
150
|
subLink.style
|
|
159
151
|
]),
|
|
160
152
|
dashed: subLink.properties && subLink.properties.dashed
|
|
161
|
-
})
|
|
153
|
+
});
|
|
162
154
|
}
|
|
163
|
-
return
|
|
155
|
+
return /*#__PURE__*/ React.createElement(Menu.Item, {
|
|
164
156
|
key: `${subLinkGroup.pageId || subLinkGroup.id}_${k}`,
|
|
165
157
|
danger: get(subLinkGroup, 'properties.danger'),
|
|
166
158
|
icon: subLinkGroup.properties && subLinkGroup.properties.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
@@ -171,11 +163,11 @@ const MenuComp = ({ blockId , components: { Icon , Link } , events , menus , me
|
|
|
171
163
|
}, /*#__PURE__*/ React.createElement(Link, _extends({
|
|
172
164
|
id: subLinkGroup.pageId || subLinkGroup.id || k,
|
|
173
165
|
className: methods.makeCssClass(subLinkGroup.style, true)
|
|
174
|
-
}, subLinkGroup), getTitle(subLinkGroup)))
|
|
175
|
-
}))
|
|
166
|
+
}, subLinkGroup), getTitle(subLinkGroup)));
|
|
167
|
+
}));
|
|
176
168
|
case 'MenuLink':
|
|
177
169
|
default:
|
|
178
|
-
return
|
|
170
|
+
return /*#__PURE__*/ React.createElement(Menu.Item, {
|
|
179
171
|
key: `${subLink.pageId || subLink.id}_${j}`,
|
|
180
172
|
danger: get(subLink, 'properties.danger'),
|
|
181
173
|
icon: subLink.properties && subLink.properties.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
@@ -186,12 +178,12 @@ const MenuComp = ({ blockId , components: { Icon , Link } , events , menus , me
|
|
|
186
178
|
}, /*#__PURE__*/ React.createElement(Link, _extends({
|
|
187
179
|
id: subLink.pageId || subLink.id || j,
|
|
188
180
|
className: methods.makeCssClass(subLink.style, true)
|
|
189
|
-
}, subLink), getTitle(subLink)))
|
|
181
|
+
}, subLink), getTitle(subLink)));
|
|
190
182
|
}
|
|
191
|
-
}))
|
|
183
|
+
}));
|
|
192
184
|
case 'MenuLink':
|
|
193
185
|
default:
|
|
194
|
-
return
|
|
186
|
+
return /*#__PURE__*/ React.createElement(Menu.Item, {
|
|
195
187
|
key: `${link.pageId || link.id}_${i}`,
|
|
196
188
|
danger: get(link, 'properties.danger'),
|
|
197
189
|
icon: link.properties && link.properties.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
@@ -202,9 +194,9 @@ const MenuComp = ({ blockId , components: { Icon , Link } , events , menus , me
|
|
|
202
194
|
}, /*#__PURE__*/ React.createElement(Link, _extends({
|
|
203
195
|
id: link.pageId || link.id || i,
|
|
204
196
|
className: methods.makeCssClass(link.style, true)
|
|
205
|
-
}, link), getTitle(link)))
|
|
197
|
+
}, link), getTitle(link)));
|
|
206
198
|
}
|
|
207
|
-
}))
|
|
199
|
+
}));
|
|
208
200
|
};
|
|
209
201
|
MenuComp.defaultProps = blockDefaultProps;
|
|
210
202
|
MenuComp.meta = {
|
|
@@ -28,8 +28,7 @@ const MessageBlock = ({ blockId , components: { Icon } , events , methods , pro
|
|
|
28
28
|
duration: type.isNone(args.duration) ? properties.duration : args.duration,
|
|
29
29
|
onClose: ()=>methods.triggerEvent({
|
|
30
30
|
name: 'onClose'
|
|
31
|
-
})
|
|
32
|
-
,
|
|
31
|
+
}),
|
|
33
32
|
icon: (args.icon || properties.icon) && /*#__PURE__*/ React.createElement(Icon, {
|
|
34
33
|
blockId: `${blockId}_icon`,
|
|
35
34
|
events: events,
|
|
@@ -39,9 +38,9 @@ const MessageBlock = ({ blockId , components: { Icon } , events , methods , pro
|
|
|
39
38
|
});
|
|
40
39
|
});
|
|
41
40
|
});
|
|
42
|
-
return
|
|
41
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
43
42
|
id: blockId
|
|
44
|
-
})
|
|
43
|
+
});
|
|
45
44
|
};
|
|
46
45
|
MessageBlock.defaultProps = blockDefaultProps;
|
|
47
46
|
MessageBlock.meta = {
|
|
@@ -38,7 +38,7 @@ const MobileMenu = ({ basePath , blockId , components , events , methods , menus
|
|
|
38
38
|
setOpen(open);
|
|
39
39
|
});
|
|
40
40
|
});
|
|
41
|
-
return
|
|
41
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
42
42
|
id: blockId
|
|
43
43
|
}, /*#__PURE__*/ React.createElement(Button, {
|
|
44
44
|
blockId: `${blockId}_button`,
|
|
@@ -55,8 +55,7 @@ const MobileMenu = ({ basePath , blockId , components , events , methods , menus
|
|
|
55
55
|
methods: methods,
|
|
56
56
|
onClick: ()=>methods[get(rename, 'methods.toggleOpen', {
|
|
57
57
|
default: 'toggleOpen'
|
|
58
|
-
})]()
|
|
59
|
-
,
|
|
58
|
+
})](),
|
|
60
59
|
rename: {
|
|
61
60
|
events: {
|
|
62
61
|
onClick: 'onToggleDrawer'
|
|
@@ -85,8 +84,7 @@ const MobileMenu = ({ basePath , blockId , components , events , methods , menus
|
|
|
85
84
|
methods: methods,
|
|
86
85
|
onClose: ()=>methods[get(rename, 'methods.toggleOpen', {
|
|
87
86
|
default: 'toggleOpen'
|
|
88
|
-
})]()
|
|
89
|
-
,
|
|
87
|
+
})](),
|
|
90
88
|
content: {
|
|
91
89
|
content: ()=>/*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Menu, {
|
|
92
90
|
basePath: basePath,
|
|
@@ -114,7 +112,7 @@ const MobileMenu = ({ basePath , blockId , components , events , methods , menus
|
|
|
114
112
|
}
|
|
115
113
|
}))
|
|
116
114
|
}
|
|
117
|
-
}))
|
|
115
|
+
}));
|
|
118
116
|
};
|
|
119
117
|
MobileMenu.defaultProps = blockDefaultProps;
|
|
120
118
|
MobileMenu.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 { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
17
31
|
import { get } from '@lowdefy/helpers';
|
|
18
32
|
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
|
-
}
|
|
33
33
|
const triggerSetOpen = ({ methods , setOpen , state })=>{
|
|
34
34
|
if (!state) {
|
|
35
35
|
methods.triggerEvent({
|
|
@@ -50,14 +50,12 @@ const ModalBlock = ({ blockId , content , events , methods , properties })=>{
|
|
|
50
50
|
state: !openState,
|
|
51
51
|
setOpen,
|
|
52
52
|
methods
|
|
53
|
-
})
|
|
54
|
-
);
|
|
53
|
+
}));
|
|
55
54
|
methods.registerMethod('setOpen', ({ open })=>triggerSetOpen({
|
|
56
55
|
state: !!open,
|
|
57
56
|
setOpen,
|
|
58
57
|
methods
|
|
59
|
-
})
|
|
60
|
-
);
|
|
58
|
+
}));
|
|
61
59
|
});
|
|
62
60
|
const extraProps = {};
|
|
63
61
|
if (content.footer) {
|
|
@@ -66,14 +64,13 @@ const ModalBlock = ({ blockId , content , events , methods , properties })=>{
|
|
|
66
64
|
if (properties.footer === false) {
|
|
67
65
|
extraProps.footer = null;
|
|
68
66
|
}
|
|
69
|
-
return
|
|
67
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
70
68
|
id: blockId
|
|
71
69
|
}, /*#__PURE__*/ React.createElement(Modal, _extends({
|
|
72
70
|
id: `${blockId}_modal`,
|
|
73
71
|
afterClose: ()=>methods.triggerEvent({
|
|
74
72
|
name: 'afterClose'
|
|
75
|
-
})
|
|
76
|
-
,
|
|
73
|
+
}),
|
|
77
74
|
bodyStyle: methods.makeCssClass(properties.bodyStyle, true),
|
|
78
75
|
cancelButtonProps: properties.cancelButtonProps,
|
|
79
76
|
cancelText: properties.cancelText || 'Cancel',
|
|
@@ -120,7 +117,7 @@ const ModalBlock = ({ blockId , content , events , methods , properties })=>{
|
|
|
120
117
|
});
|
|
121
118
|
}
|
|
122
119
|
}
|
|
123
|
-
}, extraProps), content.content && content.content()))
|
|
120
|
+
}, extraProps), content.content && content.content()));
|
|
124
121
|
};
|
|
125
122
|
ModalBlock.defaultProps = blockDefaultProps;
|
|
126
123
|
ModalBlock.meta = {
|
|
@@ -21,7 +21,7 @@ import Label from '../Label/Label.js';
|
|
|
21
21
|
import disabledDate from '../../disabledDate.js';
|
|
22
22
|
const MonthPicker = DatePicker.MonthPicker;
|
|
23
23
|
const MonthSelector = ({ blockId , components: { Icon } , 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
|
|
@@ -55,8 +55,7 @@ const MonthSelector = ({ blockId , components: { Icon } , events , loading , me
|
|
|
55
55
|
disabled: properties.disabled || loading,
|
|
56
56
|
disabledDate: disabledDate(properties.disabledDates),
|
|
57
57
|
format: properties.format || 'YYYY-MM',
|
|
58
|
-
getPopupContainer: ()=>document.getElementById(`${blockId}_popup`)
|
|
59
|
-
,
|
|
58
|
+
getPopupContainer: ()=>document.getElementById(`${blockId}_popup`),
|
|
60
59
|
placeholder: properties.placeholder || 'Select Month',
|
|
61
60
|
size: properties.size,
|
|
62
61
|
value: type.isDate(value) ? moment.utc(value).startOf('month') : null,
|
|
@@ -73,7 +72,7 @@ const MonthSelector = ({ blockId , components: { Icon } , events , loading , me
|
|
|
73
72
|
}
|
|
74
73
|
}))
|
|
75
74
|
}
|
|
76
|
-
})
|
|
75
|
+
});
|
|
77
76
|
};
|
|
78
77
|
MonthSelector.defaultProps = blockDefaultProps;
|
|
79
78
|
MonthSelector.meta = {
|
|
@@ -23,7 +23,7 @@ const Option = Select.Option;
|
|
|
23
23
|
const MultipleSelector = ({ blockId , components: { Icon } , 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
|
|
@@ -54,8 +54,7 @@ const MultipleSelector = ({ blockId , components: { Icon } , events , loading ,
|
|
|
54
54
|
properties.inputStyle
|
|
55
55
|
]),
|
|
56
56
|
disabled: properties.disabled || loading,
|
|
57
|
-
getPopupContainer: ()=>document.getElementById(`${blockId}_popup`)
|
|
58
|
-
,
|
|
57
|
+
getPopupContainer: ()=>document.getElementById(`${blockId}_popup`),
|
|
59
58
|
mode: "multiple",
|
|
60
59
|
notFoundContent: fetchState ? 'Loading' : 'Not found',
|
|
61
60
|
placeholder: get(properties, 'placeholder', {
|
|
@@ -81,8 +80,7 @@ const MultipleSelector = ({ blockId , components: { Icon } , events , loading ,
|
|
|
81
80
|
events: events,
|
|
82
81
|
properties: properties.selectedIcon
|
|
83
82
|
}),
|
|
84
|
-
filterOption: (input, option)=>(option.filterstring || option.children.props.html || '').toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
85
|
-
,
|
|
83
|
+
filterOption: (input, option)=>(option.filterstring || option.children.props.html || '').toLowerCase().indexOf(input.toLowerCase()) >= 0,
|
|
86
84
|
onChange: (newVal)=>{
|
|
87
85
|
const val = [];
|
|
88
86
|
newVal.forEach((nv)=>{
|
|
@@ -129,10 +127,9 @@ const MultipleSelector = ({ blockId , components: { Icon } , events , loading ,
|
|
|
129
127
|
}) : renderHtml({
|
|
130
128
|
html: opt.label,
|
|
131
129
|
methods
|
|
132
|
-
}))
|
|
133
|
-
)))
|
|
130
|
+
})))))
|
|
134
131
|
}
|
|
135
|
-
})
|
|
132
|
+
});
|
|
136
133
|
};
|
|
137
134
|
MultipleSelector.defaultProps = blockDefaultProps;
|
|
138
135
|
MultipleSelector.meta = {
|
|
@@ -35,12 +35,10 @@ const NotificationBlock = ({ blockId , components: { Icon } , events , methods
|
|
|
35
35
|
}),
|
|
36
36
|
onClick: ()=>methods.triggerEvent({
|
|
37
37
|
name: 'onClick'
|
|
38
|
-
})
|
|
39
|
-
,
|
|
38
|
+
}),
|
|
40
39
|
onClose: ()=>methods.triggerEvent({
|
|
41
40
|
name: 'onClose'
|
|
42
|
-
})
|
|
43
|
-
,
|
|
41
|
+
}),
|
|
44
42
|
placement: properties.placement,
|
|
45
43
|
top: properties.top,
|
|
46
44
|
icon: properties.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
@@ -64,9 +62,9 @@ const NotificationBlock = ({ blockId , components: { Icon } , events , methods
|
|
|
64
62
|
});
|
|
65
63
|
});
|
|
66
64
|
});
|
|
67
|
-
return
|
|
65
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
68
66
|
id: blockId
|
|
69
|
-
})
|
|
67
|
+
});
|
|
70
68
|
};
|
|
71
69
|
NotificationBlock.defaultProps = blockDefaultProps;
|
|
72
70
|
NotificationBlock.meta = {
|
|
@@ -17,7 +17,7 @@ import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
|
17
17
|
import { InputNumber } from 'antd';
|
|
18
18
|
import Label from '../Label/Label.js';
|
|
19
19
|
const NumberInput = ({ blockId , events , components , loading , methods , properties , required , validation , value , })=>{
|
|
20
|
-
return
|
|
20
|
+
return /*#__PURE__*/ React.createElement(Label, {
|
|
21
21
|
blockId: blockId,
|
|
22
22
|
components: components,
|
|
23
23
|
events: events,
|
|
@@ -65,7 +65,7 @@ const NumberInput = ({ blockId , events , components , loading , methods , prope
|
|
|
65
65
|
value: value
|
|
66
66
|
})
|
|
67
67
|
}
|
|
68
|
-
})
|
|
68
|
+
});
|
|
69
69
|
};
|
|
70
70
|
NumberInput.defaultProps = blockDefaultProps;
|
|
71
71
|
NumberInput.meta = {
|
|
@@ -116,7 +116,7 @@ const PageHeaderMenu = ({ basePath , blockId , components: { Icon , Link } , co
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
|
-
return
|
|
119
|
+
return /*#__PURE__*/ React.createElement(Layout, {
|
|
120
120
|
blockId: blockId,
|
|
121
121
|
events: events,
|
|
122
122
|
properties: {
|
|
@@ -275,7 +275,7 @@ const PageHeaderMenu = ({ basePath , blockId , components: { Icon , Link } , co
|
|
|
275
275
|
}
|
|
276
276
|
}))
|
|
277
277
|
}
|
|
278
|
-
})
|
|
278
|
+
});
|
|
279
279
|
};
|
|
280
280
|
PageHeaderMenu.defaultProps = blockDefaultProps;
|
|
281
281
|
PageHeaderMenu.meta = {
|
|
@@ -122,7 +122,7 @@ const PageSiderMenu = ({ basePath , blockId , components: { Icon , Link } , eve
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
};
|
|
125
|
-
return
|
|
125
|
+
return /*#__PURE__*/ React.createElement(Layout, {
|
|
126
126
|
blockId: blockId,
|
|
127
127
|
components: {
|
|
128
128
|
Icon,
|
|
@@ -324,8 +324,7 @@ const PageSiderMenu = ({ basePath , blockId , components: { Icon , Link } , eve
|
|
|
324
324
|
...properties.toggleSiderButton || {}
|
|
325
325
|
},
|
|
326
326
|
methods: methods,
|
|
327
|
-
onClick: ()=>methods.toggleSiderOpen()
|
|
328
|
-
,
|
|
327
|
+
onClick: ()=>methods.toggleSiderOpen(),
|
|
329
328
|
rename: {
|
|
330
329
|
events: {
|
|
331
330
|
onClick: 'onToggleSider'
|
|
@@ -390,7 +389,7 @@ const PageSiderMenu = ({ basePath , blockId , components: { Icon , Link } , eve
|
|
|
390
389
|
}
|
|
391
390
|
}))
|
|
392
391
|
}
|
|
393
|
-
})
|
|
392
|
+
});
|
|
394
393
|
};
|
|
395
394
|
PageSiderMenu.defaultProps = blockDefaultProps;
|
|
396
395
|
PageSiderMenu.meta = {
|