@lowdefy/blocks-antd 4.0.0-alpha.6 → 4.0.0-alpha.9
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 +4 -7
- package/dist/blocks/Affix/style.less +1 -1
- package/dist/blocks/Alert/Alert.js +20 -14
- package/dist/blocks/Alert/style.less +1 -1
- package/dist/blocks/AutoComplete/AutoComplete.js +31 -37
- package/dist/blocks/AutoComplete/style.less +1 -1
- package/dist/blocks/Avatar/Avatar.js +5 -10
- package/dist/blocks/Avatar/schema.json +1 -1
- package/dist/blocks/Avatar/style.less +1 -1
- package/dist/blocks/Badge/Badge.js +5 -8
- package/dist/blocks/Badge/schema.json +1 -1
- package/dist/blocks/Badge/style.less +1 -1
- package/dist/blocks/Breadcrumb/Breadcrumb.js +49 -68
- package/dist/blocks/Breadcrumb/schema.json +1 -1
- package/dist/blocks/Breadcrumb/style.less +1 -1
- package/dist/blocks/Button/Button.js +15 -16
- package/dist/blocks/Button/schema.json +1 -1
- package/dist/blocks/Button/style.less +1 -1
- package/dist/blocks/ButtonSelector/ButtonSelector.js +26 -32
- package/dist/blocks/ButtonSelector/style.less +1 -1
- package/dist/blocks/Card/Card.js +4 -12
- package/dist/blocks/Card/style.less +1 -1
- package/dist/blocks/CheckboxSelector/CheckboxSelector.js +30 -37
- package/dist/blocks/CheckboxSelector/style.less +1 -1
- package/dist/blocks/CheckboxSwitch/CheckboxSwitch.js +11 -18
- package/dist/blocks/CheckboxSwitch/style.less +1 -1
- package/dist/blocks/Collapse/Collapse.js +30 -25
- package/dist/blocks/Collapse/schema.json +1 -1
- package/dist/blocks/Collapse/style.less +1 -1
- package/dist/blocks/Comment/Comment.js +5 -10
- package/dist/blocks/Comment/style.less +1 -1
- package/dist/blocks/ConfirmModal/ConfirmModal.js +19 -7
- package/dist/blocks/ConfirmModal/schema.json +1 -1
- package/dist/blocks/ConfirmModal/style.less +1 -1
- package/dist/blocks/Content/Content.js +4 -7
- package/dist/blocks/Content/style.less +1 -1
- package/dist/blocks/ControlledList/ControlledList.js +48 -64
- package/dist/blocks/ControlledList/style.less +1 -1
- package/dist/blocks/DateRangeSelector/DateRangeSelector.js +46 -54
- package/dist/blocks/DateRangeSelector/schema.json +2 -2
- package/dist/blocks/DateRangeSelector/style.less +1 -1
- package/dist/blocks/DateSelector/DateSelector.js +40 -48
- package/dist/blocks/DateSelector/schema.json +2 -2
- package/dist/blocks/DateSelector/style.less +1 -1
- package/dist/blocks/DateTimeSelector/DateTimeSelector.js +47 -55
- package/dist/blocks/DateTimeSelector/schema.json +2 -2
- package/dist/blocks/DateTimeSelector/style.less +1 -1
- package/dist/blocks/Descriptions/Descriptions.js +35 -43
- package/dist/blocks/Descriptions/style.less +1 -1
- package/dist/blocks/Divider/Divider.js +7 -15
- package/dist/blocks/Divider/style.less +1 -1
- package/dist/blocks/Drawer/Drawer.js +4 -7
- package/dist/blocks/Drawer/style.less +1 -1
- package/dist/blocks/Footer/Footer.js +4 -7
- package/dist/blocks/Footer/style.less +1 -1
- package/dist/blocks/Header/Header.js +4 -10
- package/dist/blocks/Header/schema.json +0 -4
- package/dist/blocks/Header/style.less +1 -1
- package/dist/blocks/Label/Label.js +53 -64
- package/dist/blocks/Label/getLabelCol.js +1 -1
- package/dist/blocks/Label/getWrapperCol.js +1 -1
- package/dist/blocks/Label/labelLogic.js +1 -1
- package/dist/blocks/Label/style.less +1 -1
- package/dist/blocks/Layout/Layout.js +4 -12
- package/dist/blocks/Layout/style.less +1 -1
- package/dist/blocks/Menu/Menu.js +113 -213
- package/dist/blocks/Menu/schema.json +1 -15
- package/dist/blocks/Menu/style.less +1 -1
- package/dist/blocks/Message/Message.js +3 -5
- package/dist/blocks/Message/schema.json +1 -1
- package/dist/blocks/Message/style.less +1 -1
- package/dist/blocks/MobileMenu/MobileMenu.js +75 -84
- package/dist/blocks/MobileMenu/schema.json +1 -15
- package/dist/blocks/MobileMenu/style.less +1 -1
- package/dist/blocks/Modal/Modal.js +68 -59
- package/dist/blocks/Modal/style.less +1 -1
- package/dist/blocks/MonthSelector/MonthSelector.js +38 -46
- package/dist/blocks/MonthSelector/schema.json +2 -2
- package/dist/blocks/MonthSelector/style.less +1 -1
- package/dist/blocks/MultipleSelector/MultipleSelector.js +94 -104
- package/dist/blocks/MultipleSelector/schema.json +6 -6
- package/dist/blocks/MultipleSelector/style.less +1 -1
- package/dist/blocks/Notification/Notification.js +5 -7
- package/dist/blocks/Notification/schema.json +2 -2
- package/dist/blocks/Notification/style.less +1 -1
- package/dist/blocks/NumberInput/NumberInput.js +4 -9
- package/dist/blocks/NumberInput/style.less +1 -1
- package/dist/blocks/PageHCF/PageHCF.js +27 -40
- package/dist/blocks/PageHCF/schema.json +0 -29
- package/dist/blocks/PageHCF/style.less +1 -1
- package/dist/blocks/PageHCSF/PageHCSF.js +54 -72
- package/dist/blocks/PageHCSF/schema.json +0 -30
- package/dist/blocks/PageHCSF/style.less +1 -1
- package/dist/blocks/PageHSCF/PageHSCF.js +54 -72
- package/dist/blocks/PageHSCF/schema.json +0 -30
- package/dist/blocks/PageHSCF/style.less +1 -1
- package/dist/blocks/PageHeaderMenu/PageHeaderMenu.js +142 -175
- package/dist/blocks/PageHeaderMenu/schema.json +1 -24
- package/dist/blocks/PageHeaderMenu/style.less +1 -1
- package/dist/blocks/PageSHCF/PageSHCF.js +53 -71
- package/dist/blocks/PageSHCF/schema.json +0 -30
- package/dist/blocks/PageSHCF/style.less +1 -1
- package/dist/blocks/PageSiderMenu/PageSiderMenu.js +245 -289
- package/dist/blocks/PageSiderMenu/schema.json +1 -31
- package/dist/blocks/PageSiderMenu/style.less +1 -1
- package/dist/blocks/Pagination/Pagination.js +4 -11
- package/dist/blocks/Pagination/style.less +1 -1
- package/dist/blocks/Paragraph/Paragraph.js +14 -17
- package/dist/blocks/Paragraph/style.less +1 -1
- package/dist/blocks/ParagraphInput/ParagraphInput.js +14 -17
- package/dist/blocks/ParagraphInput/style.less +1 -1
- package/dist/blocks/PasswordInput/PasswordInput.js +4 -9
- package/dist/blocks/PasswordInput/style.less +1 -1
- package/dist/blocks/Progress/Progress.js +2 -9
- package/dist/blocks/Progress/style.less +1 -1
- package/dist/blocks/RadioSelector/RadioSelector.js +30 -37
- package/dist/blocks/RadioSelector/style.less +1 -1
- package/dist/blocks/RatingSlider/RatingSlider.js +117 -127
- package/dist/blocks/RatingSlider/schema.json +4 -4
- package/dist/blocks/RatingSlider/style.less +1 -1
- package/dist/blocks/Result/Result.js +6 -14
- package/dist/blocks/Result/schema.json +1 -1
- package/dist/blocks/Result/style.less +1 -1
- package/dist/blocks/Selector/Selector.js +86 -96
- package/dist/blocks/Selector/schema.json +4 -4
- package/dist/blocks/Selector/style.less +1 -1
- package/dist/blocks/Sider/Sider.js +5 -10
- package/dist/blocks/Sider/schema.json +0 -7
- package/dist/blocks/Sider/style.less +1 -1
- package/dist/blocks/Statistic/Statistic.js +4 -11
- package/dist/blocks/Statistic/schema.json +2 -2
- package/dist/blocks/Statistic/style.less +1 -1
- package/dist/blocks/Switch/Switch.js +11 -19
- package/dist/blocks/Switch/schema.json +4 -4
- package/dist/blocks/Switch/style.less +1 -1
- package/dist/blocks/Tabs/Tabs.js +28 -28
- package/dist/blocks/Tabs/schema.json +1 -1
- package/dist/blocks/Tabs/style.less +1 -1
- package/dist/blocks/TextArea/TextArea.js +4 -9
- package/dist/blocks/TextArea/style.less +1 -1
- package/dist/blocks/TextInput/TextInput.js +6 -11
- package/dist/blocks/TextInput/schema.json +2 -2
- package/dist/blocks/TextInput/style.less +1 -1
- package/dist/blocks/TimelineList/TimelineList.js +48 -43
- package/dist/blocks/TimelineList/schema.json +4 -1
- package/dist/blocks/TimelineList/style.less +1 -1
- package/dist/blocks/Title/Title.js +14 -20
- package/dist/blocks/Title/style.less +1 -1
- package/dist/blocks/TitleInput/TitleInput.js +14 -20
- package/dist/blocks/TitleInput/style.less +1 -1
- package/dist/blocks/Tooltip/Tooltip.js +4 -15
- package/dist/blocks/Tooltip/style.less +1 -1
- package/dist/blocks/WeekSelector/WeekSelector.js +38 -46
- package/dist/blocks/WeekSelector/schema.json +2 -2
- package/dist/blocks/WeekSelector/style.less +1 -1
- package/dist/blocks.js +1 -2
- 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 +1 -1
- package/package.json +16 -17
- package/dist/blocks/S3UploadButton/S3UploadButton.js +0 -183
- package/dist/blocks/S3UploadButton/schema.json +0 -83
- package/dist/blocks/S3UploadButton/style.less +0 -18
|
@@ -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,7 +16,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
17
16
|
import { Affix } from 'antd';
|
|
18
17
|
import { get } from '@lowdefy/helpers';
|
|
19
18
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
20
|
-
const AffixBlock = ({ blockId , content , methods , properties , rename })=>/*#__PURE__*/
|
|
19
|
+
const AffixBlock = ({ blockId , content , methods , properties , rename })=>/*#__PURE__*/ React.createElement(Affix, {
|
|
21
20
|
id: blockId,
|
|
22
21
|
className: methods.makeCssClass(properties.style),
|
|
23
22
|
offsetBottom: properties.offsetBottom,
|
|
@@ -31,14 +30,12 @@ const AffixBlock = ({ blockId , content , methods , properties , rename })=>/*#
|
|
|
31
30
|
affixed
|
|
32
31
|
}
|
|
33
32
|
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
})
|
|
33
|
+
}
|
|
34
|
+
}, content.content && content.content())
|
|
37
35
|
;
|
|
38
36
|
AffixBlock.defaultProps = blockDefaultProps;
|
|
39
37
|
AffixBlock.meta = {
|
|
40
38
|
category: 'container',
|
|
41
|
-
loading: false,
|
|
42
39
|
icons: [],
|
|
43
40
|
styles: [
|
|
44
41
|
'blocks/Affix/style.less'
|
|
@@ -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,16 +16,30 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
17
16
|
import { Alert } from 'antd';
|
|
18
17
|
import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
19
18
|
import { type } 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
|
+
}
|
|
20
33
|
const AlertBlock = ({ blockId , content , events , components: { Icon } , methods , properties })=>{
|
|
21
34
|
const additionalProps = {};
|
|
22
35
|
if (properties.icon) {
|
|
23
|
-
additionalProps.icon = /*#__PURE__*/
|
|
36
|
+
additionalProps.icon = /*#__PURE__*/ React.createElement(Icon, {
|
|
24
37
|
blockId: `${blockId}_icon`,
|
|
25
38
|
events: events,
|
|
26
39
|
properties: properties.icon
|
|
27
40
|
});
|
|
28
41
|
}
|
|
29
|
-
return(/*#__PURE__*/
|
|
42
|
+
return(/*#__PURE__*/ React.createElement(Alert, _extends({
|
|
30
43
|
action: content.action && content.action(),
|
|
31
44
|
afterClose: ()=>methods.triggerEvent({
|
|
32
45
|
name: 'afterClose'
|
|
@@ -40,7 +53,7 @@ const AlertBlock = ({ blockId , content , events , components: { Icon } , metho
|
|
|
40
53
|
methods
|
|
41
54
|
}),
|
|
42
55
|
id: blockId,
|
|
43
|
-
message: type.isNone(properties.message) ? /*#__PURE__*/
|
|
56
|
+
message: type.isNone(properties.message) ? /*#__PURE__*/ React.createElement("div", {
|
|
44
57
|
style: {
|
|
45
58
|
marginBottom: -4
|
|
46
59
|
}
|
|
@@ -53,19 +66,12 @@ const AlertBlock = ({ blockId , content , events , components: { Icon } , metho
|
|
|
53
66
|
})
|
|
54
67
|
,
|
|
55
68
|
showIcon: properties.showIcon === false ? false : true,
|
|
56
|
-
type: properties.type
|
|
57
|
-
|
|
58
|
-
}));
|
|
69
|
+
type: properties.type
|
|
70
|
+
}, additionalProps)));
|
|
59
71
|
};
|
|
60
72
|
AlertBlock.defaultProps = blockDefaultProps;
|
|
61
73
|
AlertBlock.meta = {
|
|
62
74
|
category: 'container',
|
|
63
|
-
loading: {
|
|
64
|
-
type: 'Skeleton',
|
|
65
|
-
properties: {
|
|
66
|
-
height: 40
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
75
|
icons: [],
|
|
70
76
|
styles: [
|
|
71
77
|
'blocks/Alert/style.less'
|
|
@@ -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.
|
|
@@ -22,7 +21,7 @@ import getUniqueValues from '../../getUniqueValues.js';
|
|
|
22
21
|
const Option = AutoComplete.Option;
|
|
23
22
|
const AutoCompleteInput = ({ blockId , components , events , loading , methods , properties , required , validation , value , })=>{
|
|
24
23
|
const uniqueValueOptions = getUniqueValues(properties.options || []);
|
|
25
|
-
return(/*#__PURE__*/
|
|
24
|
+
return(/*#__PURE__*/ React.createElement(Label, {
|
|
26
25
|
blockId: blockId,
|
|
27
26
|
components: components,
|
|
28
27
|
events: events,
|
|
@@ -33,16 +32,15 @@ const AutoCompleteInput = ({ blockId , components , events , loading , methods ,
|
|
|
33
32
|
},
|
|
34
33
|
validation: validation,
|
|
35
34
|
required: required,
|
|
36
|
-
loading: loading,
|
|
37
35
|
content: {
|
|
38
|
-
content: ()=>/*#__PURE__*/
|
|
36
|
+
content: ()=>/*#__PURE__*/ React.createElement(AutoComplete, {
|
|
39
37
|
id: `${blockId}_input`,
|
|
40
38
|
autoFocus: properties.autoFocus,
|
|
41
39
|
backfill: properties.backfill,
|
|
42
40
|
bordered: properties.bordered,
|
|
43
41
|
className: methods.makeCssClass(properties.inputStyle),
|
|
44
42
|
defaultOpen: properties.defaultOpen,
|
|
45
|
-
disabled: properties.disabled,
|
|
43
|
+
disabled: properties.disabled || loading,
|
|
46
44
|
placeholder: properties.placeholder || 'Type or select item',
|
|
47
45
|
allowClear: properties.allowClear !== false,
|
|
48
46
|
size: properties.size,
|
|
@@ -66,34 +64,33 @@ const AutoCompleteInput = ({ blockId , components , events , loading , methods ,
|
|
|
66
64
|
}
|
|
67
65
|
});
|
|
68
66
|
},
|
|
69
|
-
value: type.isNone(value) ? undefined : value
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
})
|
|
67
|
+
value: type.isNone(value) ? undefined : value
|
|
68
|
+
}, (properties.options || []).map((opt, i)=>type.isPrimitive(opt) ? /*#__PURE__*/ React.createElement(Option, {
|
|
69
|
+
className: methods.makeCssClass(properties.optionsStyle),
|
|
70
|
+
id: `${blockId}_${i}`,
|
|
71
|
+
key: i,
|
|
72
|
+
value: `${i}`
|
|
73
|
+
}, renderHtml({
|
|
74
|
+
html: `${opt}`,
|
|
75
|
+
methods
|
|
76
|
+
})) : /*#__PURE__*/ React.createElement(Option, {
|
|
77
|
+
className: methods.makeCssClass([
|
|
78
|
+
properties.optionsStyle,
|
|
79
|
+
opt.style
|
|
80
|
+
]),
|
|
81
|
+
disabled: opt.disabled,
|
|
82
|
+
filterstring: opt.filterString,
|
|
83
|
+
id: `${blockId}_${i}`,
|
|
84
|
+
key: i,
|
|
85
|
+
value: `${i}`
|
|
86
|
+
}, type.isNone(opt.label) ? renderHtml({
|
|
87
|
+
html: `${opt.value}`,
|
|
88
|
+
methods
|
|
89
|
+
}) : renderHtml({
|
|
90
|
+
html: opt.label,
|
|
91
|
+
methods
|
|
92
|
+
}))
|
|
93
|
+
))
|
|
97
94
|
}
|
|
98
95
|
}));
|
|
99
96
|
};
|
|
@@ -101,9 +98,6 @@ AutoCompleteInput.defaultProps = blockDefaultProps;
|
|
|
101
98
|
AutoCompleteInput.meta = {
|
|
102
99
|
valueType: 'string',
|
|
103
100
|
category: 'input',
|
|
104
|
-
loading: {
|
|
105
|
-
type: 'SkeletonInput'
|
|
106
|
-
},
|
|
107
101
|
icons: [
|
|
108
102
|
...Label.meta.icons
|
|
109
103
|
],
|
|
@@ -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.
|
|
@@ -16,7 +15,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
16
15
|
*/ import React from 'react';
|
|
17
16
|
import { Avatar } from 'antd';
|
|
18
17
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
19
|
-
const AvatarBlock = ({ blockId , events , components: { Icon } , methods , properties })=>/*#__PURE__*/
|
|
18
|
+
const AvatarBlock = ({ blockId , events , components: { Icon } , methods , properties })=>/*#__PURE__*/ React.createElement(Avatar, {
|
|
20
19
|
id: blockId,
|
|
21
20
|
alt: properties.alt,
|
|
22
21
|
gap: properties.gap,
|
|
@@ -34,20 +33,16 @@ const AvatarBlock = ({ blockId , events , components: { Icon } , methods , prop
|
|
|
34
33
|
},
|
|
35
34
|
properties.style,
|
|
36
35
|
]),
|
|
37
|
-
icon: properties.icon && /*#__PURE__*/
|
|
36
|
+
icon: properties.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
38
37
|
blockId: `${blockId}_icon`,
|
|
39
38
|
events: events,
|
|
40
39
|
properties: properties.icon
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
})
|
|
40
|
+
})
|
|
41
|
+
}, properties.content)
|
|
44
42
|
;
|
|
45
43
|
AvatarBlock.defaultProps = blockDefaultProps;
|
|
46
44
|
AvatarBlock.meta = {
|
|
47
45
|
category: 'display',
|
|
48
|
-
loading: {
|
|
49
|
-
type: 'SkeletonAvatar'
|
|
50
|
-
},
|
|
51
46
|
icons: [],
|
|
52
47
|
styles: [
|
|
53
48
|
'blocks/Avatar/style.less'
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"icon": {
|
|
27
27
|
"type": ["string", "object"],
|
|
28
|
-
"description": "Name of an
|
|
28
|
+
"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 use an icon in avatar.",
|
|
29
29
|
"docs": {
|
|
30
30
|
"displayType": "icon"
|
|
31
31
|
}
|
|
@@ -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,7 +16,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
17
16
|
import { type } from '@lowdefy/helpers';
|
|
18
17
|
import { Badge } from 'antd';
|
|
19
18
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
20
|
-
const BadgeBlock = ({ blockId , events , content , components: { Icon } , properties })=>/*#__PURE__*/
|
|
19
|
+
const BadgeBlock = ({ blockId , events , content , components: { Icon } , properties })=>/*#__PURE__*/ React.createElement(Badge, {
|
|
21
20
|
id: blockId,
|
|
22
21
|
color: properties.color,
|
|
23
22
|
dot: properties.dot,
|
|
@@ -28,18 +27,16 @@ const BadgeBlock = ({ blockId , events , content , components: { Icon } , prope
|
|
|
28
27
|
status: properties.status,
|
|
29
28
|
text: properties.text,
|
|
30
29
|
title: properties.title,
|
|
31
|
-
count: properties.icon && /*#__PURE__*/
|
|
30
|
+
count: properties.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
32
31
|
blockId: `${blockId}_icon`,
|
|
33
32
|
events: events,
|
|
34
33
|
properties: properties.icon
|
|
35
|
-
}) || properties.count
|
|
36
|
-
|
|
37
|
-
})
|
|
34
|
+
}) || properties.count
|
|
35
|
+
}, content.content && content.content())
|
|
38
36
|
;
|
|
39
37
|
BadgeBlock.defaultProps = blockDefaultProps;
|
|
40
38
|
BadgeBlock.meta = {
|
|
41
39
|
category: 'container',
|
|
42
|
-
loading: false,
|
|
43
40
|
icons: [],
|
|
44
41
|
styles: [
|
|
45
42
|
'blocks/Badge/style.less'
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"icon": {
|
|
33
33
|
"type": ["string", "object"],
|
|
34
|
-
"description": "Name of an
|
|
34
|
+
"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 use an icon in badge.",
|
|
35
35
|
"docs": {
|
|
36
36
|
"displayType": "icon"
|
|
37
37
|
}
|
|
@@ -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.
|
|
@@ -17,82 +16,64 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
17
16
|
import { type, get } from '@lowdefy/helpers';
|
|
18
17
|
import { Breadcrumb } from 'antd';
|
|
19
18
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return(/*#__PURE__*/ _jsx("span", {
|
|
36
|
-
className: className,
|
|
37
|
-
children: children
|
|
38
|
-
}));
|
|
39
|
-
};
|
|
40
|
-
const BreadcrumbBlock = ({ basePath , blockId , events , components: { Icon , Link } , methods , properties , rename , })=>{
|
|
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
|
+
const BreadcrumbBlock = ({ blockId , events , components: { Icon , Link } , methods , properties , rename , })=>{
|
|
41
34
|
const onClickActionName = get(rename, 'events.onClick', {
|
|
42
35
|
default: 'onClick'
|
|
43
36
|
});
|
|
44
|
-
return(/*#__PURE__*/
|
|
37
|
+
return(/*#__PURE__*/ React.createElement(Breadcrumb, {
|
|
45
38
|
id: blockId,
|
|
46
39
|
separator: properties.separator,
|
|
47
|
-
className: methods.makeCssClass(properties.style)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
),
|
|
57
|
-
children: /*#__PURE__*/ _jsxs(ItemLink, {
|
|
58
|
-
basePath: basePath,
|
|
59
|
-
className: methods.makeCssClass([
|
|
60
|
-
{
|
|
61
|
-
cursor: events[onClickActionName] && 'pointer'
|
|
62
|
-
},
|
|
63
|
-
link.style,
|
|
64
|
-
]),
|
|
65
|
-
link: link,
|
|
66
|
-
Link: Link,
|
|
67
|
-
children: [
|
|
68
|
-
link.icon && /*#__PURE__*/ _jsx(Icon, {
|
|
69
|
-
blockId: `${blockId}_${index}_icon`,
|
|
70
|
-
events: events,
|
|
71
|
-
properties: {
|
|
72
|
-
name: type.isString(link.icon) && link.icon,
|
|
73
|
-
...type.isObject(link.icon) ? link.icon : {},
|
|
74
|
-
style: {
|
|
75
|
-
paddingRight: 8,
|
|
76
|
-
...link.icon.style || {}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}),
|
|
80
|
-
type.isString(link) ? link : link.label || link.pageId || link.url || `Link ${index}`
|
|
81
|
-
]
|
|
40
|
+
className: methods.makeCssClass(properties.style)
|
|
41
|
+
}, (properties.list || []).map((link, index)=>/*#__PURE__*/ React.createElement(Breadcrumb.Item, {
|
|
42
|
+
key: index,
|
|
43
|
+
onClick: events[onClickActionName] && (()=>methods.triggerEvent({
|
|
44
|
+
name: onClickActionName,
|
|
45
|
+
event: {
|
|
46
|
+
link,
|
|
47
|
+
index
|
|
48
|
+
}
|
|
82
49
|
})
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
50
|
+
)
|
|
51
|
+
}, /*#__PURE__*/ React.createElement(Link, _extends({
|
|
52
|
+
id: `${blockId}_${index}`,
|
|
53
|
+
className: methods.makeCssClass([
|
|
54
|
+
{
|
|
55
|
+
cursor: events[onClickActionName] && 'pointer'
|
|
56
|
+
},
|
|
57
|
+
link.style,
|
|
58
|
+
])
|
|
59
|
+
}, link), (defaultTitle)=>/*#__PURE__*/ React.createElement(React.Fragment, null, link.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
60
|
+
blockId: `${blockId}_${index}_icon`,
|
|
61
|
+
events: events,
|
|
62
|
+
properties: {
|
|
63
|
+
name: type.isString(link.icon) && link.icon,
|
|
64
|
+
...type.isObject(link.icon) ? link.icon : {},
|
|
65
|
+
style: {
|
|
66
|
+
paddingRight: 8,
|
|
67
|
+
...link.icon.style || {}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}), type.isString(link) ? link : link.label || defaultTitle)
|
|
71
|
+
))
|
|
72
|
+
)));
|
|
86
73
|
};
|
|
87
74
|
BreadcrumbBlock.defaultProps = blockDefaultProps;
|
|
88
75
|
BreadcrumbBlock.meta = {
|
|
89
76
|
category: 'display',
|
|
90
|
-
loading: {
|
|
91
|
-
type: 'SkeletonParagraph',
|
|
92
|
-
properties: {
|
|
93
|
-
lines: 1
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
77
|
icons: [],
|
|
97
78
|
styles: [
|
|
98
79
|
'blocks/Breadcrumb/style.less'
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"icon": {
|
|
55
55
|
"type": ["string", "object"],
|
|
56
|
-
"description": "Name of an
|
|
56
|
+
"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 use an icon in breadcrumb link.",
|
|
57
57
|
"docs": {
|
|
58
58
|
"displayType": "icon"
|
|
59
59
|
}
|
|
@@ -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.
|
|
@@ -18,11 +17,11 @@ import { Button } from 'antd';
|
|
|
18
17
|
import { get, type } from '@lowdefy/helpers';
|
|
19
18
|
import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
20
19
|
import color from '../../color.js';
|
|
21
|
-
const ButtonBlock = ({ blockId ,
|
|
20
|
+
const ButtonBlock = ({ blockId , components: { Icon } , events , loading , methods , onClick , properties , rename , })=>{
|
|
22
21
|
const onClickActionName = get(rename, 'events.onClick', {
|
|
23
22
|
default: 'onClick'
|
|
24
23
|
});
|
|
25
|
-
return(/*#__PURE__*/
|
|
24
|
+
return(/*#__PURE__*/ React.createElement(Button, {
|
|
26
25
|
block: properties.block,
|
|
27
26
|
className: methods.makeCssClass([
|
|
28
27
|
{
|
|
@@ -35,22 +34,26 @@ const ButtonBlock = ({ blockId , events , loading , components: { Icon } , meth
|
|
|
35
34
|
'&:hover': properties.color && {
|
|
36
35
|
backgroundColor: color(properties.color, 5),
|
|
37
36
|
borderColor: color(properties.color, 5)
|
|
37
|
+
},
|
|
38
|
+
'&:focus': properties.color && {
|
|
39
|
+
backgroundColor: properties.color,
|
|
40
|
+
borderColor: properties.color
|
|
38
41
|
}
|
|
39
42
|
},
|
|
40
43
|
properties.style,
|
|
41
44
|
]),
|
|
42
|
-
disabled: properties.disabled || get(events, `${onClickActionName}.loading`),
|
|
45
|
+
disabled: properties.disabled || get(events, `${onClickActionName}.loading`) || loading,
|
|
43
46
|
ghost: properties.ghost,
|
|
44
47
|
danger: properties.danger,
|
|
45
48
|
href: properties.href,
|
|
46
49
|
id: blockId,
|
|
47
|
-
loading:
|
|
50
|
+
loading: get(events, `${onClickActionName}.loading`),
|
|
48
51
|
shape: properties.shape,
|
|
49
52
|
size: properties.size,
|
|
50
53
|
type: get(properties, 'type', {
|
|
51
54
|
default: 'primary'
|
|
52
55
|
}),
|
|
53
|
-
icon: properties.icon && /*#__PURE__*/
|
|
56
|
+
icon: properties.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
54
57
|
blockId: `${blockId}_icon`,
|
|
55
58
|
events: events,
|
|
56
59
|
properties: properties.icon
|
|
@@ -58,19 +61,15 @@ const ButtonBlock = ({ blockId , events , loading , components: { Icon } , meth
|
|
|
58
61
|
onClick: onClick || (()=>methods.triggerEvent({
|
|
59
62
|
name: onClickActionName
|
|
60
63
|
})
|
|
61
|
-
)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}));
|
|
64
|
+
)
|
|
65
|
+
}, !properties.hideTitle && renderHtml({
|
|
66
|
+
html: type.isNone(properties.title) ? blockId : properties.title,
|
|
67
|
+
methods
|
|
68
|
+
})));
|
|
67
69
|
};
|
|
68
70
|
ButtonBlock.defaultProps = blockDefaultProps;
|
|
69
71
|
ButtonBlock.meta = {
|
|
70
72
|
category: 'display',
|
|
71
|
-
loading: {
|
|
72
|
-
type: 'SkeletonButton'
|
|
73
|
-
},
|
|
74
73
|
icons: [],
|
|
75
74
|
styles: [
|
|
76
75
|
'blocks/Button/style.less'
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"icon": {
|
|
44
44
|
"type": ["string", "object"],
|
|
45
|
-
"description": "Name of an
|
|
45
|
+
"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 use icon in button.",
|
|
46
46
|
"docs": {
|
|
47
47
|
"displayType": "icon"
|
|
48
48
|
}
|