@lowdefy/blocks-antd 4.0.0-alpha.9 → 4.0.0-rc.1
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 +2 -3
- package/dist/blocks/Affix/style.less +1 -1
- package/dist/blocks/Alert/Alert.js +10 -12
- package/dist/blocks/Alert/style.less +1 -1
- package/dist/blocks/AutoComplete/AutoComplete.js +17 -39
- package/dist/blocks/AutoComplete/schema.json +5 -46
- package/dist/blocks/AutoComplete/style.less +1 -1
- package/dist/blocks/Avatar/Avatar.js +4 -6
- package/dist/blocks/Avatar/style.less +1 -1
- package/dist/blocks/Badge/Badge.js +2 -3
- package/dist/blocks/Badge/style.less +1 -1
- package/dist/blocks/Breadcrumb/Breadcrumb.js +13 -16
- package/dist/blocks/Breadcrumb/style.less +1 -1
- package/dist/blocks/Button/Button.js +6 -7
- package/dist/blocks/Button/style.less +1 -1
- package/dist/blocks/ButtonSelector/ButtonSelector.js +6 -7
- package/dist/blocks/ButtonSelector/style.less +1 -1
- package/dist/blocks/Card/Card.js +4 -6
- package/dist/blocks/Card/style.less +1 -1
- package/dist/blocks/CheckboxSelector/CheckboxSelector.js +6 -7
- package/dist/blocks/CheckboxSelector/style.less +1 -1
- package/dist/blocks/CheckboxSwitch/CheckboxSwitch.js +5 -5
- package/dist/blocks/CheckboxSwitch/style.less +1 -1
- package/dist/blocks/Collapse/Collapse.js +11 -15
- package/dist/blocks/Collapse/style.less +1 -1
- package/dist/blocks/Comment/Comment.js +3 -3
- package/dist/blocks/Comment/style.less +1 -1
- package/dist/blocks/ConfirmModal/ConfirmModal.js +3 -3
- package/dist/blocks/ConfirmModal/style.less +1 -1
- package/dist/blocks/Content/Content.js +2 -3
- package/dist/blocks/Content/style.less +1 -1
- package/dist/blocks/ControlledList/ControlledList.js +5 -5
- package/dist/blocks/ControlledList/style.less +1 -1
- package/dist/blocks/DateRangeSelector/DateRangeSelector.js +11 -14
- package/dist/blocks/DateRangeSelector/style.less +1 -1
- package/dist/blocks/DateSelector/DateSelector.js +7 -7
- package/dist/blocks/DateSelector/style.less +1 -1
- package/dist/blocks/DateTimeSelector/DateTimeSelector.js +10 -8
- package/dist/blocks/DateTimeSelector/style.less +1 -1
- package/dist/blocks/Descriptions/Descriptions.js +13 -15
- package/dist/blocks/Descriptions/style.less +1 -1
- package/dist/blocks/Divider/Divider.js +2 -3
- package/dist/blocks/Divider/style.less +1 -1
- package/dist/blocks/Drawer/Drawer.js +5 -7
- package/dist/blocks/Drawer/style.less +1 -1
- package/dist/blocks/Footer/Footer.js +2 -3
- package/dist/blocks/Footer/style.less +1 -1
- package/dist/blocks/Header/Header.js +3 -4
- package/dist/blocks/Header/style.less +1 -1
- package/dist/blocks/Label/Label.js +23 -27
- package/dist/blocks/Label/getLabelCol.js +1 -1
- package/dist/blocks/Label/getWrapperCol.js +1 -1
- package/dist/blocks/Label/labelLogic.js +15 -15
- package/dist/blocks/Label/style.less +5 -1
- package/dist/blocks/Layout/Layout.js +2 -3
- package/dist/blocks/Layout/style.less +1 -1
- package/dist/blocks/Menu/Menu.js +49 -57
- package/dist/blocks/Menu/style.less +1 -1
- package/dist/blocks/Message/Message.js +4 -5
- package/dist/blocks/Message/style.less +1 -1
- package/dist/blocks/MobileMenu/MobileMenu.js +7 -9
- package/dist/blocks/MobileMenu/style.less +1 -1
- package/dist/blocks/Modal/Modal.js +11 -14
- package/dist/blocks/Modal/style.less +1 -1
- package/dist/blocks/MonthSelector/MonthSelector.js +7 -7
- package/dist/blocks/MonthSelector/style.less +1 -1
- package/dist/blocks/MultipleSelector/MultipleSelector.js +9 -11
- package/dist/blocks/MultipleSelector/style.less +1 -1
- package/dist/blocks/Notification/Notification.js +5 -7
- package/dist/blocks/Notification/style.less +1 -1
- package/dist/blocks/NumberInput/NumberInput.js +6 -4
- package/dist/blocks/NumberInput/schema.json +7 -0
- package/dist/blocks/NumberInput/style.less +1 -1
- package/dist/blocks/PageHCF/PageHCF.js +2 -3
- package/dist/blocks/PageHCF/style.less +1 -1
- package/dist/blocks/PageHCSF/PageHCSF.js +2 -3
- package/dist/blocks/PageHCSF/style.less +1 -1
- package/dist/blocks/PageHSCF/PageHSCF.js +2 -3
- package/dist/blocks/PageHSCF/style.less +1 -1
- package/dist/blocks/PageHeaderMenu/PageHeaderMenu.js +47 -35
- package/dist/blocks/PageHeaderMenu/schema.json +5 -5
- package/dist/blocks/PageHeaderMenu/style.less +1 -1
- package/dist/blocks/PageSHCF/PageSHCF.js +2 -3
- package/dist/blocks/PageSHCF/style.less +1 -1
- package/dist/blocks/PageSiderMenu/PageSiderMenu.js +45 -43
- package/dist/blocks/PageSiderMenu/schema.json +5 -5
- package/dist/blocks/PageSiderMenu/style.less +1 -1
- package/dist/blocks/Pagination/Pagination.js +4 -5
- package/dist/blocks/Pagination/style.less +1 -1
- package/dist/blocks/Paragraph/Paragraph.js +3 -4
- package/dist/blocks/Paragraph/style.less +2 -1
- package/dist/blocks/ParagraphInput/ParagraphInput.js +5 -5
- package/dist/blocks/ParagraphInput/style.less +1 -1
- package/dist/blocks/PasswordInput/PasswordInput.js +7 -6
- package/dist/blocks/PasswordInput/style.less +1 -1
- package/dist/blocks/Progress/Progress.js +2 -3
- package/dist/blocks/Progress/style.less +1 -1
- package/dist/blocks/RadioSelector/RadioSelector.js +9 -10
- package/dist/blocks/RadioSelector/style.less +1 -1
- package/dist/blocks/RatingSlider/RatingSlider.js +11 -13
- package/dist/blocks/RatingSlider/style.less +1 -1
- package/dist/blocks/Result/Result.js +2 -3
- package/dist/blocks/Result/style.less +1 -1
- package/dist/blocks/Selector/Selector.js +9 -11
- package/dist/blocks/Selector/style.less +1 -1
- package/dist/blocks/Sider/Sider.js +5 -7
- package/dist/blocks/Sider/style.less +1 -1
- package/dist/blocks/Statistic/Statistic.js +2 -3
- package/dist/blocks/Statistic/style.less +1 -1
- package/dist/blocks/Switch/Switch.js +5 -5
- package/dist/blocks/Switch/style.less +1 -1
- package/dist/blocks/Tabs/Tabs.js +11 -16
- package/dist/blocks/Tabs/style.less +1 -1
- package/dist/blocks/TextArea/TextArea.js +6 -6
- package/dist/blocks/TextArea/style.less +1 -1
- package/dist/blocks/TextInput/TextInput.js +9 -8
- package/dist/blocks/TextInput/style.less +1 -1
- package/dist/blocks/TimelineList/TimelineList.js +10 -10
- package/dist/blocks/TimelineList/style.less +1 -1
- package/dist/blocks/Title/Title.js +5 -5
- package/dist/blocks/Title/style.less +2 -1
- package/dist/blocks/TitleInput/TitleInput.js +6 -6
- package/dist/blocks/TitleInput/style.less +1 -1
- package/dist/blocks/Tooltip/Tooltip.js +2 -3
- package/dist/blocks/Tooltip/style.less +1 -1
- package/dist/blocks/WeekSelector/WeekSelector.js +7 -7
- package/dist/blocks/WeekSelector/style.less +1 -1
- package/dist/blocks.js +1 -1
- package/dist/color.js +1 -1
- package/dist/disabledDate.js +4 -7
- 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 +28 -29
|
@@ -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,8 +20,8 @@ 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
|
|
24
|
-
return
|
|
23
|
+
const MonthSelector = ({ blockId , components: { Icon } , events , loading , methods , properties , required , validation , value })=>{
|
|
24
|
+
return /*#__PURE__*/ React.createElement(Label, {
|
|
25
25
|
blockId: blockId,
|
|
26
26
|
components: {
|
|
27
27
|
Icon
|
|
@@ -55,12 +55,12 @@ 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,
|
|
61
|
+
status: validation.status,
|
|
62
62
|
value: type.isDate(value) ? moment.utc(value).startOf('month') : null,
|
|
63
|
-
suffixIcon:
|
|
63
|
+
suffixIcon: /*#__PURE__*/ React.createElement(Icon, {
|
|
64
64
|
blockId: `${blockId}_suffixIcon`,
|
|
65
65
|
events: events,
|
|
66
66
|
properties: properties.suffixIcon || 'AiOutlineCalendar'
|
|
@@ -73,7 +73,7 @@ const MonthSelector = ({ blockId , components: { Icon } , events , loading , me
|
|
|
73
73
|
}
|
|
74
74
|
}))
|
|
75
75
|
}
|
|
76
|
-
})
|
|
76
|
+
});
|
|
77
77
|
};
|
|
78
78
|
MonthSelector.defaultProps = blockDefaultProps;
|
|
79
79
|
MonthSelector.meta = {
|
|
@@ -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,10 +20,10 @@ 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
|
-
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', {
|
|
@@ -65,7 +64,8 @@ const MultipleSelector = ({ blockId , components: { Icon } , events , loading ,
|
|
|
65
64
|
default: true
|
|
66
65
|
}),
|
|
67
66
|
size: properties.size,
|
|
68
|
-
|
|
67
|
+
status: validation.status,
|
|
68
|
+
value: getValueIndex(value, uniqueValueOptions, true),
|
|
69
69
|
suffixIcon: properties.suffixIcon && /*#__PURE__*/ React.createElement(Icon, {
|
|
70
70
|
blockId: `${blockId}_suffixIcon`,
|
|
71
71
|
events: events,
|
|
@@ -81,8 +81,7 @@ const MultipleSelector = ({ blockId , components: { Icon } , events , loading ,
|
|
|
81
81
|
events: events,
|
|
82
82
|
properties: properties.selectedIcon
|
|
83
83
|
}),
|
|
84
|
-
filterOption: (input, option)=>(option.filterstring || option.children.props.html || '').toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
85
|
-
,
|
|
84
|
+
filterOption: (input, option)=>(option.filterstring || option.children.props.html || '').toLowerCase().indexOf(input.toLowerCase()) >= 0,
|
|
86
85
|
onChange: (newVal)=>{
|
|
87
86
|
const val = [];
|
|
88
87
|
newVal.forEach((nv)=>{
|
|
@@ -129,10 +128,9 @@ const MultipleSelector = ({ blockId , components: { Icon } , events , loading ,
|
|
|
129
128
|
}) : renderHtml({
|
|
130
129
|
html: opt.label,
|
|
131
130
|
methods
|
|
132
|
-
}))
|
|
133
|
-
)))
|
|
131
|
+
})))))
|
|
134
132
|
}
|
|
135
|
-
})
|
|
133
|
+
});
|
|
136
134
|
};
|
|
137
135
|
MultipleSelector.defaultProps = blockDefaultProps;
|
|
138
136
|
MultipleSelector.meta = {
|
|
@@ -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.
|
|
@@ -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 = {
|
|
@@ -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,8 +16,8 @@
|
|
|
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
|
|
20
|
-
return
|
|
19
|
+
const NumberInput = ({ blockId , events , components , loading , methods , properties , required , validation , value })=>{
|
|
20
|
+
return /*#__PURE__*/ React.createElement(Label, {
|
|
21
21
|
blockId: blockId,
|
|
22
22
|
components: components,
|
|
23
23
|
events: events,
|
|
@@ -47,9 +47,11 @@ const NumberInput = ({ blockId , events , components , loading , methods , prope
|
|
|
47
47
|
keyboard: properties.keyboard,
|
|
48
48
|
max: properties.max,
|
|
49
49
|
min: properties.min,
|
|
50
|
+
parser: properties.parser,
|
|
50
51
|
placeholder: properties.placeholder,
|
|
51
52
|
precision: properties.precision,
|
|
52
53
|
size: properties.size,
|
|
54
|
+
status: validation.status,
|
|
53
55
|
step: properties.step,
|
|
54
56
|
onChange: (newVal)=>{
|
|
55
57
|
methods.setValue(newVal);
|
|
@@ -65,7 +67,7 @@ const NumberInput = ({ blockId , events , components , loading , methods , prope
|
|
|
65
67
|
value: value
|
|
66
68
|
})
|
|
67
69
|
}
|
|
68
|
-
})
|
|
70
|
+
});
|
|
69
71
|
};
|
|
70
72
|
NumberInput.defaultProps = blockDefaultProps;
|
|
71
73
|
NumberInput.meta = {
|
|
@@ -110,6 +110,13 @@
|
|
|
110
110
|
"type": "number",
|
|
111
111
|
"description": "Maximum value allowed by the block."
|
|
112
112
|
},
|
|
113
|
+
"parser": {
|
|
114
|
+
"type": "object",
|
|
115
|
+
"description": "A function specifying the value extracted from the formatter.",
|
|
116
|
+
"docs": {
|
|
117
|
+
"displayType": "yaml"
|
|
118
|
+
}
|
|
119
|
+
},
|
|
113
120
|
"placeholder": {
|
|
114
121
|
"type": "string",
|
|
115
122
|
"description": "Placeholder text inside the block to show message before user types input."
|
|
@@ -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.
|
|
@@ -58,8 +58,7 @@ const PageHCF = ({ blockId , components , content , events , properties })=>/*#
|
|
|
58
58
|
}
|
|
59
59
|
}))
|
|
60
60
|
}
|
|
61
|
-
})
|
|
62
|
-
;
|
|
61
|
+
});
|
|
63
62
|
PageHCF.defaultProps = blockDefaultProps;
|
|
64
63
|
PageHCF.meta = {
|
|
65
64
|
category: 'container',
|
|
@@ -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.
|
|
@@ -86,8 +86,7 @@ const PageHCSF = ({ blockId , components , content , events , methods , properti
|
|
|
86
86
|
}
|
|
87
87
|
}))
|
|
88
88
|
}
|
|
89
|
-
})
|
|
90
|
-
;
|
|
89
|
+
});
|
|
91
90
|
PageHCSF.defaultProps = blockDefaultProps;
|
|
92
91
|
PageHCSF.meta = {
|
|
93
92
|
category: 'container',
|
|
@@ -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.
|
|
@@ -86,8 +86,7 @@ const PageHSCF = ({ blockId , components , content , events , methods , properti
|
|
|
86
86
|
}
|
|
87
87
|
}))
|
|
88
88
|
}
|
|
89
|
-
})
|
|
90
|
-
;
|
|
89
|
+
});
|
|
91
90
|
PageHSCF.defaultProps = blockDefaultProps;
|
|
92
91
|
PageHSCF.meta = {
|
|
93
92
|
category: 'container',
|
|
@@ -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'
|
|
@@ -31,6 +31,9 @@ const PageHeaderMenu = ({ basePath , blockId , components: { Icon , Link } , co
|
|
|
31
31
|
display: 'flex',
|
|
32
32
|
alignItems: 'center',
|
|
33
33
|
padding: '0 46px',
|
|
34
|
+
xs: {
|
|
35
|
+
padding: '0 10px'
|
|
36
|
+
},
|
|
34
37
|
sm: {
|
|
35
38
|
padding: '0 15px'
|
|
36
39
|
},
|
|
@@ -50,8 +53,14 @@ const PageHeaderMenu = ({ basePath , blockId , components: { Icon , Link } , co
|
|
|
50
53
|
logo: {
|
|
51
54
|
margin: '0px 30px',
|
|
52
55
|
flex: '0 1 auto',
|
|
56
|
+
width: 130,
|
|
57
|
+
xs: {
|
|
58
|
+
margin: '0 5px',
|
|
59
|
+
width: 40
|
|
60
|
+
},
|
|
53
61
|
sm: {
|
|
54
|
-
margin: '0 10px'
|
|
62
|
+
margin: '0 10px',
|
|
63
|
+
width: 130
|
|
55
64
|
},
|
|
56
65
|
md: {
|
|
57
66
|
margin: '0 15px'
|
|
@@ -59,6 +68,9 @@ const PageHeaderMenu = ({ basePath , blockId , components: { Icon , Link } , co
|
|
|
59
68
|
},
|
|
60
69
|
lgMenu: {
|
|
61
70
|
flex: '1 1 auto',
|
|
71
|
+
xs: {
|
|
72
|
+
display: 'none'
|
|
73
|
+
},
|
|
62
74
|
sm: {
|
|
63
75
|
display: 'none'
|
|
64
76
|
},
|
|
@@ -72,6 +84,9 @@ const PageHeaderMenu = ({ basePath , blockId , components: { Icon , Link } , co
|
|
|
72
84
|
mdMenu: {
|
|
73
85
|
flex: '0 1 auto',
|
|
74
86
|
paddingLeft: '1rem',
|
|
87
|
+
xs: {
|
|
88
|
+
display: 'flex'
|
|
89
|
+
},
|
|
75
90
|
sm: {
|
|
76
91
|
display: 'flex'
|
|
77
92
|
},
|
|
@@ -96,6 +111,9 @@ const PageHeaderMenu = ({ basePath , blockId , components: { Icon , Link } , co
|
|
|
96
111
|
},
|
|
97
112
|
body: {
|
|
98
113
|
padding: '0 40px 40px 40px',
|
|
114
|
+
xs: {
|
|
115
|
+
padding: '0 5px 5px 5px'
|
|
116
|
+
},
|
|
99
117
|
sm: {
|
|
100
118
|
padding: '0 10px 10px 10px'
|
|
101
119
|
},
|
|
@@ -106,8 +124,14 @@ const PageHeaderMenu = ({ basePath , blockId , components: { Icon , Link } , co
|
|
|
106
124
|
padding: '0 40px 40px 40px'
|
|
107
125
|
}
|
|
108
126
|
},
|
|
127
|
+
breadcrumb: {
|
|
128
|
+
margin: '16px 0'
|
|
129
|
+
},
|
|
109
130
|
noBreadcrumb: {
|
|
110
131
|
padding: '20px 0',
|
|
132
|
+
xs: {
|
|
133
|
+
padding: '5px 0'
|
|
134
|
+
},
|
|
111
135
|
sm: {
|
|
112
136
|
padding: '5px 0'
|
|
113
137
|
},
|
|
@@ -116,14 +140,12 @@ const PageHeaderMenu = ({ basePath , blockId , components: { Icon , Link } , co
|
|
|
116
140
|
}
|
|
117
141
|
}
|
|
118
142
|
};
|
|
119
|
-
return
|
|
143
|
+
return /*#__PURE__*/ React.createElement(Layout, {
|
|
120
144
|
blockId: blockId,
|
|
121
145
|
events: events,
|
|
122
146
|
properties: {
|
|
123
147
|
style: mergeObjects([
|
|
124
|
-
|
|
125
|
-
minHeight: '100vh'
|
|
126
|
-
},
|
|
148
|
+
styles.layout,
|
|
127
149
|
properties.style
|
|
128
150
|
])
|
|
129
151
|
},
|
|
@@ -143,31 +165,23 @@ const PageHeaderMenu = ({ basePath , blockId , components: { Icon , Link } , co
|
|
|
143
165
|
{
|
|
144
166
|
style: styles.header
|
|
145
167
|
},
|
|
146
|
-
properties.header
|
|
168
|
+
properties.header
|
|
147
169
|
]),
|
|
148
170
|
content: {
|
|
149
171
|
// TODO: use next/image
|
|
150
172
|
content: ()=>/*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Link, {
|
|
151
173
|
home: true
|
|
152
|
-
}, /*#__PURE__*/ React.createElement("
|
|
153
|
-
|
|
154
|
-
srcSet: properties.logo
|
|
155
|
-
|
|
156
|
-
|
|
174
|
+
}, /*#__PURE__*/ React.createElement("picture", null, /*#__PURE__*/ React.createElement("source", {
|
|
175
|
+
media: `(min-width:${properties.logo?.breakpoint ?? 577}px)`,
|
|
176
|
+
srcSet: properties.logo?.src ?? `${basePath}/logo-${properties.header?.theme ?? 'dark'}-theme.png`
|
|
177
|
+
}), /*#__PURE__*/ React.createElement("img", {
|
|
178
|
+
src: properties.logo?.srcMobile ?? properties.logo?.src ?? `${basePath}/logo-square-${properties.header?.theme ?? 'dark'}-theme.png`,
|
|
179
|
+
alt: properties.logo?.alt ?? 'Lowdefy',
|
|
157
180
|
className: methods.makeCssClass([
|
|
158
|
-
{
|
|
159
|
-
width: 130,
|
|
160
|
-
sm: {
|
|
161
|
-
width: properties.logo && properties.logo.src && !properties.logo.srcSet ? 130 : 40
|
|
162
|
-
},
|
|
163
|
-
md: {
|
|
164
|
-
width: 130
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
181
|
styles.logo,
|
|
168
|
-
properties.logo
|
|
182
|
+
properties.logo?.style
|
|
169
183
|
])
|
|
170
|
-
})), /*#__PURE__*/ React.createElement("div", {
|
|
184
|
+
}))), /*#__PURE__*/ React.createElement("div", {
|
|
171
185
|
className: methods.makeCssClass(styles.headerContent)
|
|
172
186
|
}, /*#__PURE__*/ React.createElement("div", {
|
|
173
187
|
className: methods.makeCssClass([
|
|
@@ -189,17 +203,17 @@ const PageHeaderMenu = ({ basePath , blockId , components: { Icon , Link } , co
|
|
|
189
203
|
{
|
|
190
204
|
mode: 'horizontal',
|
|
191
205
|
collapsed: false,
|
|
192
|
-
theme: get(properties, 'header.theme')
|
|
206
|
+
theme: get(properties, 'header.theme') ?? 'dark'
|
|
193
207
|
},
|
|
194
208
|
properties.menu,
|
|
195
|
-
properties.menuLg
|
|
209
|
+
properties.menuLg
|
|
196
210
|
])
|
|
197
211
|
})), content.header && content.header(mergeObjects([
|
|
198
212
|
{
|
|
199
213
|
width: 'auto',
|
|
200
214
|
flex: '0 1 auto'
|
|
201
215
|
},
|
|
202
|
-
properties.header
|
|
216
|
+
properties.header?.contentStyle
|
|
203
217
|
])), /*#__PURE__*/ React.createElement("div", {
|
|
204
218
|
className: methods.makeCssClass([
|
|
205
219
|
styles.mobile,
|
|
@@ -230,10 +244,10 @@ const PageHeaderMenu = ({ basePath , blockId , components: { Icon , Link } , co
|
|
|
230
244
|
},
|
|
231
245
|
events: events,
|
|
232
246
|
properties: mergeObjects([
|
|
233
|
-
properties.content,
|
|
234
247
|
{
|
|
235
248
|
style: styles.body
|
|
236
|
-
}
|
|
249
|
+
},
|
|
250
|
+
properties.content
|
|
237
251
|
]),
|
|
238
252
|
content: {
|
|
239
253
|
content: ()=>/*#__PURE__*/ React.createElement(React.Fragment, null, !type.isNone(properties.breadcrumb) ? /*#__PURE__*/ React.createElement(Breadcrumb, {
|
|
@@ -246,12 +260,10 @@ const PageHeaderMenu = ({ basePath , blockId , components: { Icon , Link } , co
|
|
|
246
260
|
events: events,
|
|
247
261
|
methods: methods,
|
|
248
262
|
properties: mergeObjects([
|
|
249
|
-
properties.breadcrumb,
|
|
250
263
|
{
|
|
251
|
-
style:
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
},
|
|
264
|
+
style: styles.breadcrumb
|
|
265
|
+
},
|
|
266
|
+
properties.breadcrumb
|
|
255
267
|
]),
|
|
256
268
|
rename: {
|
|
257
269
|
events: {
|
|
@@ -275,7 +287,7 @@ const PageHeaderMenu = ({ basePath , blockId , components: { Icon , Link } , co
|
|
|
275
287
|
}
|
|
276
288
|
}))
|
|
277
289
|
}
|
|
278
|
-
})
|
|
290
|
+
});
|
|
279
291
|
};
|
|
280
292
|
PageHeaderMenu.defaultProps = blockDefaultProps;
|
|
281
293
|
PageHeaderMenu.meta = {
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
"type": "string",
|
|
14
14
|
"description": "Header logo source url."
|
|
15
15
|
},
|
|
16
|
-
"
|
|
16
|
+
"srcMobile": {
|
|
17
17
|
"type": "string",
|
|
18
|
-
"description": "Header logo
|
|
18
|
+
"description": "Header logo img element for mobile."
|
|
19
19
|
},
|
|
20
|
-
"
|
|
21
|
-
"type": "
|
|
22
|
-
"description": "Header logo
|
|
20
|
+
"breakpoint": {
|
|
21
|
+
"type": "number",
|
|
22
|
+
"description": "Header logo breakpoint for switching between mobile and desktop logo."
|
|
23
23
|
},
|
|
24
24
|
"alt": {
|
|
25
25
|
"type": "string",
|
|
@@ -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.
|
|
@@ -86,8 +86,7 @@ const PageSHCF = ({ blockId , components , events , content , properties , metho
|
|
|
86
86
|
}
|
|
87
87
|
}))
|
|
88
88
|
}
|
|
89
|
-
})
|
|
90
|
-
;
|
|
89
|
+
});
|
|
91
90
|
PageSHCF.defaultProps = blockDefaultProps;
|
|
92
91
|
PageSHCF.meta = {
|
|
93
92
|
category: 'container',
|