@lowdefy/blocks-antd 4.0.0-rc.0 → 4.0.0-rc.2
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 -1
- package/dist/blocks/Affix/style.less +1 -1
- package/dist/blocks/Alert/Alert.js +16 -16
- package/dist/blocks/Alert/style.less +1 -1
- package/dist/blocks/AutoComplete/AutoComplete.js +2 -2
- package/dist/blocks/AutoComplete/style.less +1 -1
- package/dist/blocks/Avatar/Avatar.js +2 -2
- package/dist/blocks/Avatar/style.less +1 -1
- package/dist/blocks/Badge/Badge.js +1 -1
- package/dist/blocks/Badge/style.less +1 -1
- package/dist/blocks/Breadcrumb/Breadcrumb.js +18 -18
- package/dist/blocks/Breadcrumb/style.less +1 -1
- package/dist/blocks/Button/Button.js +3 -3
- package/dist/blocks/Button/style.less +1 -1
- package/dist/blocks/ButtonSelector/ButtonSelector.js +3 -3
- package/dist/blocks/ButtonSelector/style.less +1 -1
- package/dist/blocks/Card/Card.js +2 -2
- package/dist/blocks/Card/style.less +1 -1
- package/dist/blocks/CheckboxSelector/CheckboxSelector.js +3 -3
- package/dist/blocks/CheckboxSelector/style.less +1 -1
- package/dist/blocks/CheckboxSwitch/CheckboxSwitch.js +3 -3
- package/dist/blocks/CheckboxSwitch/style.less +1 -1
- package/dist/blocks/Collapse/Collapse.js +16 -16
- package/dist/blocks/Collapse/style.less +1 -1
- package/dist/blocks/Comment/Comment.js +1 -1
- package/dist/blocks/Comment/style.less +1 -1
- package/dist/blocks/ConfirmModal/ConfirmModal.js +1 -1
- package/dist/blocks/ConfirmModal/style.less +1 -1
- package/dist/blocks/Content/Content.js +1 -1
- package/dist/blocks/Content/style.less +1 -1
- package/dist/blocks/ControlledList/ControlledList.js +3 -3
- package/dist/blocks/ControlledList/style.less +1 -1
- package/dist/blocks/DateRangeSelector/DateRangeSelector.js +3 -3
- package/dist/blocks/DateRangeSelector/style.less +1 -1
- package/dist/blocks/DateSelector/DateSelector.js +2 -2
- package/dist/blocks/DateSelector/style.less +1 -1
- package/dist/blocks/DateTimeSelector/DateTimeSelector.js +2 -2
- package/dist/blocks/DateTimeSelector/style.less +1 -1
- package/dist/blocks/Descriptions/Descriptions.js +7 -7
- package/dist/blocks/Descriptions/style.less +1 -1
- package/dist/blocks/Divider/Divider.js +1 -1
- package/dist/blocks/Divider/style.less +1 -1
- package/dist/blocks/Drawer/Drawer.js +1 -1
- package/dist/blocks/Drawer/style.less +1 -1
- package/dist/blocks/Footer/Footer.js +1 -1
- package/dist/blocks/Footer/style.less +1 -1
- package/dist/blocks/Header/Header.js +2 -2
- package/dist/blocks/Header/style.less +1 -1
- package/dist/blocks/Label/Label.js +17 -17
- package/dist/blocks/Label/getLabelCol.js +1 -1
- package/dist/blocks/Label/getWrapperCol.js +1 -1
- package/dist/blocks/Label/labelLogic.js +5 -5
- package/dist/blocks/Label/style.less +1 -1
- package/dist/blocks/Layout/Layout.js +1 -1
- package/dist/blocks/Layout/style.less +1 -1
- package/dist/blocks/Menu/Menu.js +28 -28
- package/dist/blocks/Menu/style.less +1 -1
- package/dist/blocks/Message/Message.js +1 -1
- package/dist/blocks/Message/style.less +1 -1
- package/dist/blocks/MobileMenu/MobileMenu.js +3 -3
- package/dist/blocks/MobileMenu/style.less +1 -1
- package/dist/blocks/Modal/Modal.js +16 -16
- package/dist/blocks/Modal/style.less +1 -1
- package/dist/blocks/MonthSelector/MonthSelector.js +2 -2
- package/dist/blocks/MonthSelector/style.less +1 -1
- package/dist/blocks/MultipleSelector/MultipleSelector.js +3 -3
- package/dist/blocks/MultipleSelector/style.less +1 -1
- package/dist/blocks/Notification/Notification.js +1 -1
- package/dist/blocks/Notification/style.less +1 -1
- package/dist/blocks/NumberInput/NumberInput.js +2 -2
- package/dist/blocks/NumberInput/style.less +1 -1
- package/dist/blocks/PageHCF/PageHCF.js +1 -1
- package/dist/blocks/PageHCF/style.less +1 -1
- package/dist/blocks/PageHCSF/PageHCSF.js +1 -1
- package/dist/blocks/PageHCSF/style.less +1 -1
- package/dist/blocks/PageHSCF/PageHSCF.js +1 -1
- package/dist/blocks/PageHSCF/style.less +1 -1
- package/dist/blocks/PageHeaderMenu/PageHeaderMenu.js +7 -7
- package/dist/blocks/PageHeaderMenu/style.less +1 -1
- package/dist/blocks/PageSHCF/PageSHCF.js +1 -1
- package/dist/blocks/PageSHCF/style.less +1 -1
- package/dist/blocks/PageSiderMenu/PageSiderMenu.js +7 -7
- package/dist/blocks/PageSiderMenu/style.less +1 -1
- package/dist/blocks/Pagination/Pagination.js +1 -1
- package/dist/blocks/Pagination/style.less +1 -1
- package/dist/blocks/Paragraph/Paragraph.js +2 -2
- package/dist/blocks/Paragraph/style.less +1 -1
- package/dist/blocks/ParagraphInput/ParagraphInput.js +3 -3
- package/dist/blocks/ParagraphInput/style.less +1 -1
- package/dist/blocks/PasswordInput/PasswordInput.js +2 -2
- package/dist/blocks/PasswordInput/style.less +1 -1
- package/dist/blocks/Progress/Progress.js +1 -1
- package/dist/blocks/Progress/style.less +1 -1
- package/dist/blocks/RadioSelector/RadioSelector.js +3 -3
- package/dist/blocks/RadioSelector/style.less +1 -1
- package/dist/blocks/RatingSlider/RatingSlider.js +7 -7
- package/dist/blocks/RatingSlider/style.less +1 -1
- package/dist/blocks/Result/Result.js +1 -1
- package/dist/blocks/Result/style.less +1 -1
- package/dist/blocks/Selector/Selector.js +3 -3
- package/dist/blocks/Selector/style.less +1 -1
- package/dist/blocks/Sider/Sider.js +1 -1
- package/dist/blocks/Sider/style.less +1 -1
- package/dist/blocks/Statistic/Statistic.js +1 -1
- package/dist/blocks/Statistic/style.less +1 -1
- package/dist/blocks/Switch/Switch.js +3 -3
- package/dist/blocks/Switch/style.less +1 -1
- package/dist/blocks/Tabs/Tabs.js +16 -16
- package/dist/blocks/Tabs/style.less +1 -1
- package/dist/blocks/TextArea/TextArea.js +2 -2
- package/dist/blocks/TextArea/style.less +1 -1
- package/dist/blocks/TextInput/TextInput.js +2 -2
- package/dist/blocks/TextInput/style.less +1 -1
- package/dist/blocks/TimelineList/TimelineList.js +16 -16
- package/dist/blocks/TimelineList/style.less +1 -1
- package/dist/blocks/Title/Title.js +3 -3
- package/dist/blocks/Title/style.less +1 -1
- package/dist/blocks/TitleInput/TitleInput.js +4 -4
- package/dist/blocks/TitleInput/style.less +1 -1
- package/dist/blocks/Tooltip/Tooltip.js +1 -1
- package/dist/blocks/Tooltip/style.less +1 -1
- package/dist/blocks/WeekSelector/WeekSelector.js +2 -2
- package/dist/blocks/WeekSelector/style.less +1 -1
- package/dist/blocks.js +1 -1
- package/dist/color.js +1 -1
- package/dist/disabledDate.js +1 -1
- package/dist/getUniqueValues.js +1 -1
- package/dist/getValueIndex.js +1 -1
- package/dist/style.less +1 -1
- package/dist/types.js +1 -1
- package/dist/useRunAfterUpdate.js +1 -1
- package/dist/validationExamples.js +2 -2
- package/package.json +20 -21
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -22,7 +22,7 @@ const HeaderBlock = ({ blockId , content , methods , properties })=>/*#__PURE__
|
|
|
22
22
|
{
|
|
23
23
|
backgroundColor: properties.theme === 'light' && '#fff'
|
|
24
24
|
},
|
|
25
|
-
properties.style
|
|
25
|
+
properties.style
|
|
26
26
|
])} hide-on-print`
|
|
27
27
|
}, content.content && content.content());
|
|
28
28
|
HeaderBlock.defaultProps = blockDefaultProps;
|
|
@@ -1,19 +1,5 @@
|
|
|
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
|
-
}
|
|
15
1
|
/*
|
|
16
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
17
3
|
|
|
18
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
19
5
|
you may not use this file except in compliance with the License.
|
|
@@ -28,6 +14,20 @@ function _extends() {
|
|
|
28
14
|
limitations under the License.
|
|
29
15
|
*/ // Derived from https://github.com/ant-design/ant-design/blob/master/components/form/FormItemLabel.tsx
|
|
30
16
|
// MIT Copyright (c) 2015-present Ant UED, https://xtech.antfin.com/ - 2020-09-08
|
|
17
|
+
function _extends() {
|
|
18
|
+
_extends = Object.assign || function(target) {
|
|
19
|
+
for(var i = 1; i < arguments.length; i++){
|
|
20
|
+
var source = arguments[i];
|
|
21
|
+
for(var key in source){
|
|
22
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
23
|
+
target[key] = source[key];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
};
|
|
29
|
+
return _extends.apply(this, arguments);
|
|
30
|
+
}
|
|
31
31
|
import React from 'react';
|
|
32
32
|
import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
33
33
|
import { Col, Row } from 'antd';
|
|
@@ -39,8 +39,8 @@ const validationKeyMap = {
|
|
|
39
39
|
warning: 'warnings'
|
|
40
40
|
};
|
|
41
41
|
let iconMap;
|
|
42
|
-
const Label = ({ blockId , components: { Icon } , content , methods , properties , required , validation
|
|
43
|
-
const { extraClassName , feedbackClassName , iconClassName , label , labelClassName , labelCol , labelColClassName , rowClassName , showExtra , showFeedback , wrapperCol
|
|
42
|
+
const Label = ({ blockId , components: { Icon } , content , methods , properties , required , validation })=>{
|
|
43
|
+
const { extraClassName , feedbackClassName , iconClassName , label , labelClassName , labelCol , labelColClassName , rowClassName , showExtra , showFeedback , wrapperCol } = labelLogic({
|
|
44
44
|
blockId,
|
|
45
45
|
content,
|
|
46
46
|
methods,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -19,7 +19,7 @@ import getLabelCol from './getLabelCol.js';
|
|
|
19
19
|
const labelLogic = ({ blockId , content , methods , properties ={} , required =false , validation ={
|
|
20
20
|
messages: [],
|
|
21
21
|
status: null
|
|
22
|
-
}
|
|
22
|
+
} })=>{
|
|
23
23
|
const wrapperCol = getWrapperCol(properties, properties.inline);
|
|
24
24
|
const labelCol = getLabelCol(properties, properties.inline);
|
|
25
25
|
// render label priority order: content.label area -> properties.title -> blockId and do not render an empty label
|
|
@@ -54,7 +54,7 @@ const labelLogic = ({ blockId , content , methods , properties ={} , required =f
|
|
|
54
54
|
height: 'fit-content !important',
|
|
55
55
|
minHeight: properties.inline && (properties.size === 'large' ? 40 : properties.size === 'small' ? 24 : 32)
|
|
56
56
|
},
|
|
57
|
-
properties.style
|
|
57
|
+
properties.style
|
|
58
58
|
])]: true
|
|
59
59
|
});
|
|
60
60
|
const extraClassName = classNames({
|
|
@@ -64,7 +64,7 @@ const labelLogic = ({ blockId , content , methods , properties ={} , required =f
|
|
|
64
64
|
{
|
|
65
65
|
marginTop: properties.size === 'small' ? -4 : 0
|
|
66
66
|
},
|
|
67
|
-
properties.extraStyle
|
|
67
|
+
properties.extraStyle
|
|
68
68
|
])]: true
|
|
69
69
|
});
|
|
70
70
|
const feedbackClassName = classNames({
|
|
@@ -76,7 +76,7 @@ const labelLogic = ({ blockId , content , methods , properties ={} , required =f
|
|
|
76
76
|
{
|
|
77
77
|
marginTop: properties.size === 'small' ? -4 : 0
|
|
78
78
|
},
|
|
79
|
-
properties.feedbackStyle
|
|
79
|
+
properties.feedbackStyle
|
|
80
80
|
])]: true
|
|
81
81
|
});
|
|
82
82
|
const iconClassName = classNames({
|
package/dist/blocks/Menu/Menu.js
CHANGED
|
@@ -1,19 +1,5 @@
|
|
|
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
|
-
}
|
|
15
1
|
/*
|
|
16
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
17
3
|
|
|
18
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
19
5
|
you may not use this file except in compliance with the License.
|
|
@@ -26,18 +12,32 @@ function _extends() {
|
|
|
26
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
27
13
|
See the License for the specific language governing permissions and
|
|
28
14
|
limitations under the License.
|
|
29
|
-
*/
|
|
15
|
+
*/ function _extends() {
|
|
16
|
+
_extends = Object.assign || function(target) {
|
|
17
|
+
for(var i = 1; i < arguments.length; i++){
|
|
18
|
+
var source = arguments[i];
|
|
19
|
+
for(var key in source){
|
|
20
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
21
|
+
target[key] = source[key];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return target;
|
|
26
|
+
};
|
|
27
|
+
return _extends.apply(this, arguments);
|
|
28
|
+
}
|
|
29
|
+
import React from 'react';
|
|
30
30
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
31
31
|
import { Menu } from 'antd';
|
|
32
32
|
import { type, get } from '@lowdefy/helpers';
|
|
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 =
|
|
36
|
+
const menu = menus.find((item)=>item.menuId === menuId) ?? menus[0] ?? {};
|
|
37
37
|
return menu.links ?? [];
|
|
38
38
|
};
|
|
39
|
-
const getTitle = ({ id , properties , pageId , url })=>(
|
|
40
|
-
const MenuComp = ({ blockId , components: { Icon , Link } , events , menus , methods , pageId , properties , rename
|
|
39
|
+
const getTitle = ({ id , properties , pageId , url })=>(properties && properties.title) ?? pageId ?? url ?? id;
|
|
40
|
+
const MenuComp = ({ blockId , components: { Icon , Link } , events , menus , methods , pageId , properties , rename })=>{
|
|
41
41
|
const styles = {
|
|
42
42
|
lineHeight: '64px',
|
|
43
43
|
width: '100%',
|
|
@@ -65,13 +65,13 @@ const MenuComp = ({ blockId , components: { Icon , Link } , events , menus , me
|
|
|
65
65
|
styles,
|
|
66
66
|
properties.style
|
|
67
67
|
]),
|
|
68
|
-
defaultOpenKeys:
|
|
69
|
-
(menu.find((
|
|
68
|
+
defaultOpenKeys: properties.defaultOpenKeys ?? (properties.mode === 'inline' && properties.collapsed !== true && [
|
|
69
|
+
(menu.find((link)=>(link.links || []).map((subLink)=>subLink.links ? subLink.links.map((subSubLink)=>subSubLink.pageId) : [
|
|
70
70
|
subLink.pageId
|
|
71
71
|
]).flat().some((link)=>(properties.selectedKeys ?? [
|
|
72
72
|
pageId
|
|
73
|
-
]).indexOf(link) !== -1)) ?? {}).id
|
|
74
|
-
])
|
|
73
|
+
]).indexOf(link) !== -1)) ?? {}).id
|
|
74
|
+
]) ?? [],
|
|
75
75
|
selectedKeys: properties.selectedKeys ?? [
|
|
76
76
|
pageId
|
|
77
77
|
],
|
|
@@ -115,7 +115,7 @@ const MenuComp = ({ blockId , components: { Icon , Link } , events , menus , me
|
|
|
115
115
|
return /*#__PURE__*/ React.createElement(Menu.SubMenu, {
|
|
116
116
|
key: link.pageId ?? link.id,
|
|
117
117
|
title: /*#__PURE__*/ React.createElement(Link, _extends({
|
|
118
|
-
id:
|
|
118
|
+
id: link.pageId ?? link.id ?? i,
|
|
119
119
|
className: methods.makeCssClass(link.style, true)
|
|
120
120
|
}, link), getTitle(link)),
|
|
121
121
|
icon: link.properties && link.properties.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
@@ -139,7 +139,7 @@ const MenuComp = ({ blockId , components: { Icon , Link } , events , menus , me
|
|
|
139
139
|
return /*#__PURE__*/ React.createElement(Menu.ItemGroup, {
|
|
140
140
|
key: subLink.pageId ?? subLink.id,
|
|
141
141
|
title: /*#__PURE__*/ React.createElement(Link, _extends({
|
|
142
|
-
id:
|
|
142
|
+
id: subLink.pageId ?? subLink.id ?? j,
|
|
143
143
|
className: methods.makeCssClass(subLink.style, true)
|
|
144
144
|
}, subLink), getTitle(subLink))
|
|
145
145
|
}, subLink.links.map((subLinkGroup, k)=>{
|
|
@@ -161,7 +161,7 @@ const MenuComp = ({ blockId , components: { Icon , Link } , events , menus , me
|
|
|
161
161
|
properties: subLinkGroup.properties.icon
|
|
162
162
|
})
|
|
163
163
|
}, /*#__PURE__*/ React.createElement(Link, _extends({
|
|
164
|
-
id:
|
|
164
|
+
id: subLinkGroup.pageId ?? subLinkGroup.id ?? k,
|
|
165
165
|
className: methods.makeCssClass(subLinkGroup.style, true)
|
|
166
166
|
}, subLinkGroup), getTitle(subLinkGroup)));
|
|
167
167
|
}));
|
|
@@ -176,7 +176,7 @@ const MenuComp = ({ blockId , components: { Icon , Link } , events , menus , me
|
|
|
176
176
|
properties: subLink.properties.icon
|
|
177
177
|
})
|
|
178
178
|
}, /*#__PURE__*/ React.createElement(Link, _extends({
|
|
179
|
-
id:
|
|
179
|
+
id: subLink.pageId ?? subLink.id ?? j,
|
|
180
180
|
className: methods.makeCssClass(subLink.style, true)
|
|
181
181
|
}, subLink), getTitle(subLink)));
|
|
182
182
|
}
|
|
@@ -192,7 +192,7 @@ const MenuComp = ({ blockId , components: { Icon , Link } , events , menus , me
|
|
|
192
192
|
properties: link.properties.icon
|
|
193
193
|
})
|
|
194
194
|
}, /*#__PURE__*/ React.createElement(Link, _extends({
|
|
195
|
-
id:
|
|
195
|
+
id: link.pageId ?? link.id ?? i,
|
|
196
196
|
className: methods.makeCssClass(link.style, true)
|
|
197
197
|
}, link), getTitle(link)));
|
|
198
198
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -18,7 +18,7 @@ import { mergeObjects, get } from '@lowdefy/helpers';
|
|
|
18
18
|
import Button from '../Button/Button.js';
|
|
19
19
|
import Drawer from '../Drawer/Drawer.js';
|
|
20
20
|
import Menu from '../Menu/Menu.js';
|
|
21
|
-
const MobileMenu = ({ basePath , blockId , components , events , methods , menus , pageId , properties , rename
|
|
21
|
+
const MobileMenu = ({ basePath , blockId , components , events , methods , menus , pageId , properties , rename })=>{
|
|
22
22
|
const [openState, setOpen] = useState(false);
|
|
23
23
|
useEffect(()=>{
|
|
24
24
|
methods.registerMethod(get(rename, 'methods.toggleOpen', {
|
|
@@ -70,7 +70,7 @@ const MobileMenu = ({ basePath , blockId , components , events , methods , menus
|
|
|
70
70
|
padding: '3.1em 0 0 0'
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
|
-
properties.drawer
|
|
73
|
+
properties.drawer
|
|
74
74
|
]),
|
|
75
75
|
rename: {
|
|
76
76
|
events: {
|
|
@@ -1,19 +1,5 @@
|
|
|
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
|
-
}
|
|
15
1
|
/*
|
|
16
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
17
3
|
|
|
18
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
19
5
|
you may not use this file except in compliance with the License.
|
|
@@ -26,7 +12,21 @@ function _extends() {
|
|
|
26
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
27
13
|
See the License for the specific language governing permissions and
|
|
28
14
|
limitations under the License.
|
|
29
|
-
*/
|
|
15
|
+
*/ function _extends() {
|
|
16
|
+
_extends = Object.assign || function(target) {
|
|
17
|
+
for(var i = 1; i < arguments.length; i++){
|
|
18
|
+
var source = arguments[i];
|
|
19
|
+
for(var key in source){
|
|
20
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
21
|
+
target[key] = source[key];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return target;
|
|
26
|
+
};
|
|
27
|
+
return _extends.apply(this, arguments);
|
|
28
|
+
}
|
|
29
|
+
import React, { useState, useEffect } from 'react';
|
|
30
30
|
import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
31
31
|
import { get } from '@lowdefy/helpers';
|
|
32
32
|
import { Modal } from 'antd';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -20,7 +20,7 @@ import { type } from '@lowdefy/helpers';
|
|
|
20
20
|
import Label from '../Label/Label.js';
|
|
21
21
|
import disabledDate from '../../disabledDate.js';
|
|
22
22
|
const MonthPicker = DatePicker.MonthPicker;
|
|
23
|
-
const MonthSelector = ({ blockId , components: { Icon } , events , loading , methods , properties , required , validation , value
|
|
23
|
+
const MonthSelector = ({ blockId , components: { Icon } , events , loading , methods , properties , required , validation , value })=>{
|
|
24
24
|
return /*#__PURE__*/ React.createElement(Label, {
|
|
25
25
|
blockId: blockId,
|
|
26
26
|
components: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -20,7 +20,7 @@ import getUniqueValues from '../../getUniqueValues.js';
|
|
|
20
20
|
import getValueIndex from '../../getValueIndex.js';
|
|
21
21
|
import Label from '../Label/Label.js';
|
|
22
22
|
const Option = Select.Option;
|
|
23
|
-
const MultipleSelector = ({ blockId , components: { Icon } , events , loading , methods , properties , required , validation , value
|
|
23
|
+
const MultipleSelector = ({ blockId , components: { Icon } , events , loading , methods , properties , required , validation , value })=>{
|
|
24
24
|
const [fetchState, setFetch] = useState(false);
|
|
25
25
|
const uniqueValueOptions = getUniqueValues(properties.options || []);
|
|
26
26
|
return /*#__PURE__*/ React.createElement(Label, {
|
|
@@ -65,7 +65,7 @@ const MultipleSelector = ({ blockId , components: { Icon } , events , loading ,
|
|
|
65
65
|
}),
|
|
66
66
|
size: properties.size,
|
|
67
67
|
status: validation.status,
|
|
68
|
-
value: getValueIndex(
|
|
68
|
+
value: getValueIndex(value, uniqueValueOptions, true),
|
|
69
69
|
suffixIcon: properties.suffixIcon && /*#__PURE__*/ React.createElement(Icon, {
|
|
70
70
|
blockId: `${blockId}_suffixIcon`,
|
|
71
71
|
events: events,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
17
17
|
import { InputNumber } from 'antd';
|
|
18
18
|
import Label from '../Label/Label.js';
|
|
19
|
-
const NumberInput = ({ blockId , events , components , loading , methods , properties , required , validation , value
|
|
19
|
+
const NumberInput = ({ blockId , events , components , loading , methods , properties , required , validation , value })=>{
|
|
20
20
|
return /*#__PURE__*/ React.createElement(Label, {
|
|
21
21
|
blockId: blockId,
|
|
22
22
|
components: components,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -22,7 +22,7 @@ import Header from '../Header/Header.js';
|
|
|
22
22
|
import Layout from '../Layout/Layout.js';
|
|
23
23
|
import Menu from '../Menu/Menu.js';
|
|
24
24
|
import MobileMenu from '../MobileMenu/MobileMenu.js';
|
|
25
|
-
const PageHeaderMenu = ({ basePath , blockId , components: { Icon , Link } , content , events , menus , methods , pageId , properties
|
|
25
|
+
const PageHeaderMenu = ({ basePath , blockId , components: { Icon , Link } , content , events , menus , methods , pageId , properties })=>{
|
|
26
26
|
const styles = {
|
|
27
27
|
layout: {
|
|
28
28
|
minHeight: '100vh'
|
|
@@ -165,7 +165,7 @@ const PageHeaderMenu = ({ basePath , blockId , components: { Icon , Link } , co
|
|
|
165
165
|
{
|
|
166
166
|
style: styles.header
|
|
167
167
|
},
|
|
168
|
-
properties.header
|
|
168
|
+
properties.header
|
|
169
169
|
]),
|
|
170
170
|
content: {
|
|
171
171
|
// TODO: use next/image
|
|
@@ -175,7 +175,7 @@ const PageHeaderMenu = ({ basePath , blockId , components: { Icon , Link } , co
|
|
|
175
175
|
media: `(min-width:${properties.logo?.breakpoint ?? 577}px)`,
|
|
176
176
|
srcSet: properties.logo?.src ?? `${basePath}/logo-${properties.header?.theme ?? 'dark'}-theme.png`
|
|
177
177
|
}), /*#__PURE__*/ React.createElement("img", {
|
|
178
|
-
src:
|
|
178
|
+
src: properties.logo?.srcMobile ?? properties.logo?.src ?? `${basePath}/logo-square-${properties.header?.theme ?? 'dark'}-theme.png`,
|
|
179
179
|
alt: properties.logo?.alt ?? 'Lowdefy',
|
|
180
180
|
className: methods.makeCssClass([
|
|
181
181
|
styles.logo,
|
|
@@ -206,14 +206,14 @@ const PageHeaderMenu = ({ basePath , blockId , components: { Icon , Link } , co
|
|
|
206
206
|
theme: get(properties, 'header.theme') ?? 'dark'
|
|
207
207
|
},
|
|
208
208
|
properties.menu,
|
|
209
|
-
properties.menuLg
|
|
209
|
+
properties.menuLg
|
|
210
210
|
])
|
|
211
211
|
})), content.header && content.header(mergeObjects([
|
|
212
212
|
{
|
|
213
213
|
width: 'auto',
|
|
214
214
|
flex: '0 1 auto'
|
|
215
215
|
},
|
|
216
|
-
properties.header?.contentStyle
|
|
216
|
+
properties.header?.contentStyle
|
|
217
217
|
])), /*#__PURE__*/ React.createElement("div", {
|
|
218
218
|
className: methods.makeCssClass([
|
|
219
219
|
styles.mobile,
|
|
@@ -263,7 +263,7 @@ const PageHeaderMenu = ({ basePath , blockId , components: { Icon , Link } , co
|
|
|
263
263
|
{
|
|
264
264
|
style: styles.breadcrumb
|
|
265
265
|
},
|
|
266
|
-
properties.breadcrumb
|
|
266
|
+
properties.breadcrumb
|
|
267
267
|
]),
|
|
268
268
|
rename: {
|
|
269
269
|
events: {
|