@lowdefy/blocks-antd 4.0.0-alpha.1 → 4.0.0-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocks/Affix/Affix.js +11 -6
- package/dist/blocks/Affix/style.less +1 -1
- package/dist/blocks/Alert/Alert.js +28 -10
- package/dist/blocks/Alert/style.less +1 -1
- package/dist/blocks/AutoComplete/AutoComplete.js +41 -34
- package/dist/blocks/AutoComplete/style.less +1 -1
- package/dist/blocks/Avatar/Avatar.js +12 -7
- package/dist/blocks/Avatar/schema.json +1 -1
- package/dist/blocks/Avatar/style.less +1 -1
- package/dist/blocks/Badge/Badge.js +12 -7
- package/dist/blocks/Badge/schema.json +1 -1
- package/dist/blocks/Badge/style.less +1 -1
- package/dist/blocks/Breadcrumb/Breadcrumb.js +56 -64
- package/dist/blocks/Breadcrumb/schema.json +1 -1
- package/dist/blocks/Breadcrumb/style.less +1 -1
- package/dist/blocks/Button/Button.js +22 -13
- package/dist/blocks/Button/schema.json +1 -1
- package/dist/blocks/Button/style.less +1 -1
- package/dist/blocks/ButtonSelector/ButtonSelector.js +36 -29
- package/dist/blocks/ButtonSelector/style.less +1 -1
- package/dist/blocks/Card/Card.js +11 -6
- package/dist/blocks/Card/style.less +1 -1
- package/dist/blocks/CheckboxSelector/CheckboxSelector.js +40 -34
- package/dist/blocks/CheckboxSelector/style.less +1 -1
- package/dist/blocks/CheckboxSwitch/CheckboxSwitch.js +21 -15
- package/dist/blocks/CheckboxSwitch/style.less +1 -1
- package/dist/blocks/Collapse/Collapse.js +38 -21
- package/dist/blocks/Collapse/schema.json +1 -1
- package/dist/blocks/Collapse/style.less +1 -1
- package/dist/blocks/Comment/Comment.js +13 -9
- package/dist/blocks/Comment/style.less +1 -1
- package/dist/blocks/ConfirmModal/ConfirmModal.js +28 -10
- package/dist/blocks/ConfirmModal/schema.json +1 -1
- package/dist/blocks/ConfirmModal/style.less +1 -1
- package/dist/blocks/Content/Content.js +11 -6
- package/dist/blocks/Content/style.less +1 -1
- package/dist/blocks/ControlledList/ControlledList.js +61 -63
- package/dist/blocks/ControlledList/style.less +1 -1
- package/dist/blocks/DateRangeSelector/DateRangeSelector.js +55 -50
- package/dist/blocks/DateRangeSelector/schema.json +2 -2
- package/dist/blocks/DateRangeSelector/style.less +1 -1
- package/dist/blocks/DateSelector/DateSelector.js +49 -44
- package/dist/blocks/DateSelector/schema.json +2 -2
- package/dist/blocks/DateSelector/style.less +1 -1
- package/dist/blocks/DateTimeSelector/DateTimeSelector.js +56 -51
- package/dist/blocks/DateTimeSelector/schema.json +2 -2
- package/dist/blocks/DateTimeSelector/style.less +1 -1
- package/dist/blocks/Descriptions/Descriptions.js +42 -38
- package/dist/blocks/Descriptions/style.less +1 -1
- package/dist/blocks/Divider/Divider.js +14 -9
- package/dist/blocks/Divider/style.less +1 -1
- package/dist/blocks/Drawer/Drawer.js +11 -6
- package/dist/blocks/Drawer/style.less +1 -1
- package/dist/blocks/Footer/Footer.js +11 -6
- package/dist/blocks/Footer/style.less +1 -1
- package/dist/blocks/Header/Header.js +11 -9
- package/dist/blocks/Header/schema.json +0 -4
- package/dist/blocks/Header/style.less +1 -1
- package/dist/blocks/Label/Label.js +70 -67
- package/dist/blocks/Label/getLabelCol.js +1 -1
- package/dist/blocks/Label/getWrapperCol.js +1 -1
- package/dist/blocks/Label/labelLogic.js +2 -3
- package/dist/blocks/Label/style.less +1 -1
- package/dist/blocks/Layout/Layout.js +11 -6
- package/dist/blocks/Layout/style.less +1 -1
- package/dist/blocks/Menu/Menu.js +123 -218
- package/dist/blocks/Menu/schema.json +1 -15
- package/dist/blocks/Menu/style.less +1 -1
- package/dist/blocks/Message/Message.js +11 -6
- package/dist/blocks/Message/schema.json +1 -1
- package/dist/blocks/Message/style.less +1 -1
- package/dist/blocks/MobileMenu/MobileMenu.js +85 -85
- package/dist/blocks/MobileMenu/schema.json +1 -15
- package/dist/blocks/MobileMenu/style.less +1 -1
- package/dist/blocks/Modal/Modal.js +76 -60
- package/dist/blocks/Modal/style.less +1 -1
- package/dist/blocks/MonthSelector/MonthSelector.js +47 -42
- package/dist/blocks/MonthSelector/schema.json +2 -2
- package/dist/blocks/MonthSelector/style.less +1 -1
- package/dist/blocks/MultipleSelector/MultipleSelector.js +104 -99
- package/dist/blocks/MultipleSelector/schema.json +6 -6
- package/dist/blocks/MultipleSelector/style.less +1 -1
- package/dist/blocks/Notification/Notification.js +13 -8
- package/dist/blocks/Notification/schema.json +2 -2
- package/dist/blocks/Notification/style.less +1 -1
- package/dist/blocks/NumberInput/NumberInput.js +14 -6
- package/dist/blocks/NumberInput/style.less +1 -1
- package/dist/blocks/PageHCF/PageHCF.js +34 -34
- package/dist/blocks/PageHCF/schema.json +0 -29
- package/dist/blocks/PageHCF/style.less +1 -1
- package/dist/blocks/PageHCSF/PageHCSF.js +61 -66
- package/dist/blocks/PageHCSF/schema.json +0 -30
- package/dist/blocks/PageHCSF/style.less +1 -1
- package/dist/blocks/PageHSCF/PageHSCF.js +61 -66
- package/dist/blocks/PageHSCF/schema.json +0 -30
- package/dist/blocks/PageHSCF/style.less +1 -1
- package/dist/blocks/PageHeaderMenu/PageHeaderMenu.js +151 -167
- package/dist/blocks/PageHeaderMenu/schema.json +1 -24
- package/dist/blocks/PageHeaderMenu/style.less +1 -1
- package/dist/blocks/PageSHCF/PageSHCF.js +60 -65
- package/dist/blocks/PageSHCF/schema.json +0 -30
- package/dist/blocks/PageSHCF/style.less +1 -1
- package/dist/blocks/PageSiderMenu/PageSiderMenu.js +258 -285
- package/dist/blocks/PageSiderMenu/schema.json +1 -31
- package/dist/blocks/PageSiderMenu/style.less +1 -1
- package/dist/blocks/Pagination/Pagination.js +17 -5
- package/dist/blocks/Pagination/style.less +1 -1
- package/dist/blocks/Paragraph/Paragraph.js +21 -14
- package/dist/blocks/Paragraph/style.less +1 -1
- package/dist/blocks/ParagraphInput/ParagraphInput.js +22 -14
- package/dist/blocks/ParagraphInput/style.less +1 -1
- package/dist/blocks/PasswordInput/PasswordInput.js +14 -6
- package/dist/blocks/PasswordInput/style.less +1 -1
- package/dist/blocks/Progress/Progress.js +9 -3
- package/dist/blocks/Progress/style.less +1 -1
- package/dist/blocks/RadioSelector/RadioSelector.js +40 -34
- package/dist/blocks/RadioSelector/style.less +1 -1
- package/dist/blocks/RatingSlider/RatingSlider.js +127 -126
- package/dist/blocks/RatingSlider/schema.json +4 -4
- package/dist/blocks/RatingSlider/style.less +1 -1
- package/dist/blocks/Result/Result.js +13 -8
- package/dist/blocks/Result/schema.json +1 -1
- package/dist/blocks/Result/style.less +1 -1
- package/dist/blocks/Selector/Selector.js +96 -91
- package/dist/blocks/Selector/schema.json +4 -4
- package/dist/blocks/Selector/style.less +1 -1
- package/dist/blocks/Sider/Sider.js +12 -9
- package/dist/blocks/Sider/schema.json +0 -7
- package/dist/blocks/Sider/style.less +1 -1
- package/dist/blocks/Statistic/Statistic.js +11 -5
- package/dist/blocks/Statistic/schema.json +2 -2
- package/dist/blocks/Statistic/style.less +1 -1
- package/dist/blocks/Switch/Switch.js +22 -19
- package/dist/blocks/Switch/schema.json +4 -4
- package/dist/blocks/Switch/style.less +1 -1
- package/dist/blocks/Tabs/Tabs.js +36 -24
- package/dist/blocks/Tabs/schema.json +1 -1
- package/dist/blocks/Tabs/style.less +1 -1
- package/dist/blocks/TextArea/TextArea.js +14 -6
- package/dist/blocks/TextArea/style.less +1 -1
- package/dist/blocks/TextInput/TextInput.js +16 -8
- package/dist/blocks/TextInput/schema.json +2 -2
- package/dist/blocks/TextInput/style.less +1 -1
- package/dist/blocks/TimelineList/TimelineList.js +56 -40
- package/dist/blocks/TimelineList/schema.json +4 -1
- package/dist/blocks/TimelineList/style.less +1 -1
- package/dist/blocks/Title/Title.js +21 -14
- package/dist/blocks/Title/style.less +1 -1
- package/dist/blocks/TitleInput/TitleInput.js +22 -14
- package/dist/blocks/TitleInput/style.less +1 -1
- package/dist/blocks/Tooltip/Tooltip.js +11 -9
- package/dist/blocks/Tooltip/style.less +1 -1
- package/dist/blocks/WeekSelector/WeekSelector.js +47 -42
- package/dist/blocks/WeekSelector/schema.json +2 -2
- package/dist/blocks/WeekSelector/style.less +1 -1
- package/dist/blocks.js +74 -0
- package/dist/color.js +1 -1
- package/dist/disabledDate.js +2 -3
- package/dist/getUniqueValues.js +1 -1
- package/dist/getValueIndex.js +1 -1
- package/dist/style.less +1 -1
- package/dist/{blocks/Alert/index.js → types.js} +16 -19
- package/dist/useRunAfterUpdate.js +1 -1
- package/dist/validationExamples.js +1 -1
- package/package.json +27 -23
- package/dist/blocks/Affix/index.js +0 -26
- package/dist/blocks/AutoComplete/index.js +0 -33
- package/dist/blocks/Avatar/index.js +0 -28
- package/dist/blocks/Badge/index.js +0 -26
- package/dist/blocks/Breadcrumb/index.js +0 -31
- package/dist/blocks/Button/index.js +0 -28
- package/dist/blocks/ButtonSelector/index.js +0 -33
- package/dist/blocks/Card/index.js +0 -31
- package/dist/blocks/CheckboxSelector/index.js +0 -33
- package/dist/blocks/CheckboxSwitch/index.js +0 -36
- package/dist/blocks/Collapse/index.js +0 -31
- package/dist/blocks/Comment/index.js +0 -28
- package/dist/blocks/ConfirmModal/index.js +0 -59
- package/dist/blocks/Content/index.js +0 -26
- package/dist/blocks/ControlledList/index.js +0 -36
- package/dist/blocks/DateRangeSelector/index.js +0 -33
- package/dist/blocks/DateSelector/index.js +0 -33
- package/dist/blocks/DateTimeSelector/index.js +0 -33
- package/dist/blocks/Descriptions/index.js +0 -31
- package/dist/blocks/Divider/index.js +0 -31
- package/dist/blocks/Drawer/index.js +0 -41
- package/dist/blocks/Footer/index.js +0 -26
- package/dist/blocks/Header/index.js +0 -26
- package/dist/blocks/Label/index.js +0 -32
- package/dist/blocks/Layout/index.js +0 -31
- package/dist/blocks/Menu/index.js +0 -26
- package/dist/blocks/Message/index.js +0 -53
- package/dist/blocks/MobileMenu/index.js +0 -41
- package/dist/blocks/Modal/index.js +0 -41
- package/dist/blocks/MonthSelector/index.js +0 -33
- package/dist/blocks/MultipleSelector/index.js +0 -33
- package/dist/blocks/Notification/index.js +0 -59
- package/dist/blocks/NumberInput/index.js +0 -33
- package/dist/blocks/PageHCF/index.js +0 -31
- package/dist/blocks/PageHCSF/index.js +0 -46
- package/dist/blocks/PageHSCF/index.js +0 -46
- package/dist/blocks/PageHeaderMenu/index.js +0 -46
- package/dist/blocks/PageSHCF/index.js +0 -46
- package/dist/blocks/PageSiderMenu/index.js +0 -57
- package/dist/blocks/Pagination/index.js +0 -37
- package/dist/blocks/Paragraph/index.js +0 -28
- package/dist/blocks/ParagraphInput/index.js +0 -36
- package/dist/blocks/PasswordInput/index.js +0 -33
- package/dist/blocks/Progress/index.js +0 -31
- package/dist/blocks/RadioSelector/index.js +0 -33
- package/dist/blocks/RatingSlider/index.js +0 -33
- package/dist/blocks/Result/index.js +0 -31
- package/dist/blocks/S3UploadButton/S3UploadButton.js +0 -171
- package/dist/blocks/S3UploadButton/index.js +0 -29
- package/dist/blocks/S3UploadButton/schema.json +0 -83
- package/dist/blocks/S3UploadButton/style.less +0 -18
- package/dist/blocks/Selector/index.js +0 -33
- package/dist/blocks/Sider/index.js +0 -41
- package/dist/blocks/Statistic/index.js +0 -31
- package/dist/blocks/Switch/index.js +0 -33
- package/dist/blocks/Tabs/index.js +0 -31
- package/dist/blocks/TextArea/index.js +0 -33
- package/dist/blocks/TextInput/index.js +0 -33
- package/dist/blocks/TimelineList/index.js +0 -31
- package/dist/blocks/Title/index.js +0 -31
- package/dist/blocks/TitleInput/index.js +0 -39
- package/dist/blocks/Tooltip/index.js +0 -31
- package/dist/blocks/WeekSelector/index.js +0 -33
- package/dist/index.js +0 -152
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx } 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.
|
|
@@ -19,7 +18,7 @@ import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
|
19
18
|
import { type } from '@lowdefy/helpers';
|
|
20
19
|
const Title = Typography.Title;
|
|
21
20
|
const TitleBlock = ({ blockId , components: { Icon } , events , properties , methods })=>{
|
|
22
|
-
return(/*#__PURE__*/
|
|
21
|
+
return(/*#__PURE__*/ React.createElement(Title, {
|
|
23
22
|
id: blockId,
|
|
24
23
|
className: methods.makeCssClass([
|
|
25
24
|
properties.color && {
|
|
@@ -39,17 +38,19 @@ const TitleBlock = ({ blockId , components: { Icon } , events , properties , me
|
|
|
39
38
|
});
|
|
40
39
|
},
|
|
41
40
|
icon: properties.copyable.icon && (type.isArray(properties.copyable.icon) ? [
|
|
42
|
-
/*#__PURE__*/
|
|
41
|
+
/*#__PURE__*/ React.createElement(Icon, {
|
|
42
|
+
key: "copy-icon",
|
|
43
43
|
blockId: `${blockId}_copyable_before_icon`,
|
|
44
44
|
events: events,
|
|
45
45
|
properties: properties.copyable.icon[0]
|
|
46
|
-
}
|
|
47
|
-
/*#__PURE__*/
|
|
46
|
+
}),
|
|
47
|
+
/*#__PURE__*/ React.createElement(Icon, {
|
|
48
|
+
key: "copied-icon",
|
|
48
49
|
blockId: `${blockId}_copyable_after_icon`,
|
|
49
50
|
events: events,
|
|
50
51
|
properties: properties.copyable.icon[1]
|
|
51
|
-
}
|
|
52
|
-
] : /*#__PURE__*/
|
|
52
|
+
}),
|
|
53
|
+
] : /*#__PURE__*/ React.createElement(Icon, {
|
|
53
54
|
blockId: `${blockId}_copyable_icon`,
|
|
54
55
|
events: events,
|
|
55
56
|
properties: properties.copyable.icon
|
|
@@ -91,12 +92,18 @@ const TitleBlock = ({ blockId , components: { Icon } , events , properties , me
|
|
|
91
92
|
level: properties.level,
|
|
92
93
|
mark: properties.mark,
|
|
93
94
|
type: properties.type,
|
|
94
|
-
underline: properties.underline
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}));
|
|
95
|
+
underline: properties.underline
|
|
96
|
+
}, renderHtml({
|
|
97
|
+
html: properties.content,
|
|
98
|
+
methods
|
|
99
|
+
})));
|
|
100
100
|
};
|
|
101
101
|
TitleBlock.defaultProps = blockDefaultProps;
|
|
102
|
+
TitleBlock.meta = {
|
|
103
|
+
category: 'display',
|
|
104
|
+
icons: [],
|
|
105
|
+
styles: [
|
|
106
|
+
'blocks/Title/style.less'
|
|
107
|
+
]
|
|
108
|
+
};
|
|
102
109
|
export default TitleBlock;
|
|
@@ -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,7 +17,7 @@ import { Typography } from 'antd';
|
|
|
18
17
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
19
18
|
import { type } from '@lowdefy/helpers';
|
|
20
19
|
const Title = Typography.Title;
|
|
21
|
-
const TitleInput = ({ blockId , components: { Icon } , events , methods , properties , value })=>{
|
|
20
|
+
const TitleInput = ({ blockId , components: { Icon } , events , loading , methods , properties , value , })=>{
|
|
22
21
|
const [editing, setEdit] = useState(false);
|
|
23
22
|
const editableEvents = {
|
|
24
23
|
onStart: ()=>{
|
|
@@ -38,7 +37,7 @@ const TitleInput = ({ blockId , components: { Icon } , events , methods , prope
|
|
|
38
37
|
});
|
|
39
38
|
}
|
|
40
39
|
};
|
|
41
|
-
return(/*#__PURE__*/
|
|
40
|
+
return(/*#__PURE__*/ React.createElement(Title, {
|
|
42
41
|
id: blockId,
|
|
43
42
|
code: properties.code,
|
|
44
43
|
italic: properties.italic,
|
|
@@ -63,17 +62,19 @@ const TitleInput = ({ blockId , components: { Icon } , events , methods , prope
|
|
|
63
62
|
});
|
|
64
63
|
},
|
|
65
64
|
icon: properties.copyable.icon && (type.isArray(properties.copyable.icon) ? [
|
|
66
|
-
/*#__PURE__*/
|
|
65
|
+
/*#__PURE__*/ React.createElement(Icon, {
|
|
66
|
+
key: "copy-icon",
|
|
67
67
|
events: events,
|
|
68
68
|
blockId: `${blockId}_copyable_before_icon`,
|
|
69
69
|
properties: properties.copyable.icon[0]
|
|
70
|
-
}
|
|
71
|
-
/*#__PURE__*/
|
|
70
|
+
}),
|
|
71
|
+
/*#__PURE__*/ React.createElement(Icon, {
|
|
72
|
+
key: "copied-icon",
|
|
72
73
|
events: events,
|
|
73
74
|
blockId: `${blockId}_copyable_after_icon`,
|
|
74
75
|
properties: properties.copyable.icon[1]
|
|
75
|
-
}
|
|
76
|
-
] : /*#__PURE__*/
|
|
76
|
+
}),
|
|
77
|
+
] : /*#__PURE__*/ React.createElement(Icon, {
|
|
77
78
|
blockId: `${blockId}_copyable_icon`,
|
|
78
79
|
events: events,
|
|
79
80
|
properties: properties.copyable.icon
|
|
@@ -81,7 +82,7 @@ const TitleInput = ({ blockId , components: { Icon } , events , methods , prope
|
|
|
81
82
|
tooltips: properties.copyable.tooltips
|
|
82
83
|
} : properties.copyable,
|
|
83
84
|
delete: properties.delete,
|
|
84
|
-
disabled: properties.disabled,
|
|
85
|
+
disabled: properties.disabled || loading,
|
|
85
86
|
ellipsis: type.isObject(properties.ellipsis) ? {
|
|
86
87
|
rows: properties.ellipsis.rows,
|
|
87
88
|
expandable: properties.ellipsis.expandable,
|
|
@@ -96,7 +97,7 @@ const TitleInput = ({ blockId , components: { Icon } , events , methods , prope
|
|
|
96
97
|
}
|
|
97
98
|
} : properties.ellipsis,
|
|
98
99
|
editable: type.isObject(properties.editable) ? {
|
|
99
|
-
icon: properties.editable.icon && /*#__PURE__*/
|
|
100
|
+
icon: properties.editable.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
100
101
|
blockId: `${blockId}_editable_icon`,
|
|
101
102
|
events: events,
|
|
102
103
|
properties: properties.editable.icon
|
|
@@ -106,9 +107,16 @@ const TitleInput = ({ blockId , components: { Icon } , events , methods , prope
|
|
|
106
107
|
maxLength: properties.editable.maxLength,
|
|
107
108
|
autoSize: properties.editable.autoSize,
|
|
108
109
|
...editableEvents
|
|
109
|
-
} : properties.editable !== false && editableEvents
|
|
110
|
-
|
|
111
|
-
}));
|
|
110
|
+
} : properties.editable !== false && editableEvents
|
|
111
|
+
}, !type.isNone(value) ? value.toString() : ''));
|
|
112
112
|
};
|
|
113
113
|
TitleInput.defaultProps = blockDefaultProps;
|
|
114
|
+
TitleInput.meta = {
|
|
115
|
+
valueType: 'string',
|
|
116
|
+
category: 'input',
|
|
117
|
+
icons: [],
|
|
118
|
+
styles: [
|
|
119
|
+
'blocks/TitleInput/style.less'
|
|
120
|
+
]
|
|
121
|
+
};
|
|
114
122
|
export default TitleInput;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { 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.
|
|
@@ -16,7 +15,7 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
16
15
|
*/ import React from 'react';
|
|
17
16
|
import { Tooltip } from 'antd';
|
|
18
17
|
import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
19
|
-
const TooltipBlock = ({ blockId , content , properties , methods })=>/*#__PURE__*/
|
|
18
|
+
const TooltipBlock = ({ blockId , content , properties , methods })=>/*#__PURE__*/ React.createElement(Tooltip, {
|
|
20
19
|
id: blockId,
|
|
21
20
|
title: renderHtml({
|
|
22
21
|
html: properties.title,
|
|
@@ -36,12 +35,15 @@ const TooltipBlock = ({ blockId , content , properties , methods })=>/*#__PURE_
|
|
|
36
35
|
onVisibleChange: ()=>methods.triggerEvent({
|
|
37
36
|
name: 'onVisibleChange'
|
|
38
37
|
})
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
content.content && content.content(),
|
|
42
|
-
'' // required by antd to wrap element in span tag.
|
|
43
|
-
]
|
|
44
|
-
})
|
|
38
|
+
}, content.content && content.content(), '' // required by antd to wrap element in span tag.
|
|
39
|
+
)
|
|
45
40
|
;
|
|
46
41
|
TooltipBlock.defaultProps = blockDefaultProps;
|
|
42
|
+
TooltipBlock.meta = {
|
|
43
|
+
category: 'container',
|
|
44
|
+
icons: [],
|
|
45
|
+
styles: [
|
|
46
|
+
'blocks/Tooltip/style.less'
|
|
47
|
+
]
|
|
48
|
+
};
|
|
47
49
|
export default TooltipBlock;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
/*
|
|
3
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
4
3
|
|
|
5
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
5
|
you may not use this file except in compliance with the License.
|
|
@@ -22,7 +21,7 @@ import disabledDate from '../../disabledDate.js';
|
|
|
22
21
|
import Label from '../Label/Label.js';
|
|
23
22
|
const WeekPicker = DatePicker.WeekPicker;
|
|
24
23
|
const WeekSelector = ({ blockId , components: { Icon , Link } , events , loading , methods , properties , required , validation , value , })=>{
|
|
25
|
-
return(/*#__PURE__*/
|
|
24
|
+
return(/*#__PURE__*/ React.createElement(Label, {
|
|
26
25
|
blockId: blockId,
|
|
27
26
|
components: {
|
|
28
27
|
Icon,
|
|
@@ -36,51 +35,57 @@ const WeekSelector = ({ blockId , components: { Icon , Link } , events , loadin
|
|
|
36
35
|
},
|
|
37
36
|
validation: validation,
|
|
38
37
|
required: required,
|
|
39
|
-
loading: loading,
|
|
40
38
|
content: {
|
|
41
|
-
content: ()=>/*#__PURE__*/
|
|
39
|
+
content: ()=>/*#__PURE__*/ React.createElement("div", {
|
|
42
40
|
className: methods.makeCssClass({
|
|
43
41
|
width: '100%'
|
|
42
|
+
})
|
|
43
|
+
}, /*#__PURE__*/ React.createElement("div", {
|
|
44
|
+
id: `${blockId}_popup`
|
|
45
|
+
}), /*#__PURE__*/ React.createElement(WeekPicker, {
|
|
46
|
+
id: `${blockId}_input`,
|
|
47
|
+
allowClear: properties.allowClear !== false,
|
|
48
|
+
autoFocus: properties.autoFocus,
|
|
49
|
+
bordered: properties.bordered,
|
|
50
|
+
className: methods.makeCssClass([
|
|
51
|
+
{
|
|
52
|
+
width: '100%'
|
|
53
|
+
},
|
|
54
|
+
properties.inputStyle
|
|
55
|
+
]),
|
|
56
|
+
disabled: properties.disabled || loading,
|
|
57
|
+
disabledDate: disabledDate(properties.disabledDates),
|
|
58
|
+
format: properties.format || 'YYYY-wo',
|
|
59
|
+
getPopupContainer: ()=>document.getElementById(`${blockId}_popup`)
|
|
60
|
+
,
|
|
61
|
+
placeholder: properties.placeholder || 'Select Week',
|
|
62
|
+
size: properties.size,
|
|
63
|
+
suffixIcon: properties.suffixIcon && /*#__PURE__*/ React.createElement(Icon, {
|
|
64
|
+
blockId: `${blockId}_suffixIcon`,
|
|
65
|
+
events: events,
|
|
66
|
+
properties: properties.suffixIcon || 'AiOutlineCalendar'
|
|
44
67
|
}),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
bordered: properties.bordered,
|
|
54
|
-
className: methods.makeCssClass([
|
|
55
|
-
{
|
|
56
|
-
width: '100%'
|
|
57
|
-
},
|
|
58
|
-
properties.inputStyle
|
|
59
|
-
]),
|
|
60
|
-
disabled: properties.disabled,
|
|
61
|
-
disabledDate: disabledDate(properties.disabledDates),
|
|
62
|
-
format: properties.format || 'YYYY-wo',
|
|
63
|
-
getPopupContainer: ()=>document.getElementById(`${blockId}_popup`)
|
|
64
|
-
,
|
|
65
|
-
placeholder: properties.placeholder || 'Select Week',
|
|
66
|
-
size: properties.size,
|
|
67
|
-
suffixIcon: properties.suffixIcon && /*#__PURE__*/ _jsx(Icon, {
|
|
68
|
-
blockId: `${blockId}_suffixIcon`,
|
|
69
|
-
events: events,
|
|
70
|
-
properties: properties.suffixIcon || 'CalendarOutlined'
|
|
71
|
-
}),
|
|
72
|
-
onChange: (newVal)=>{
|
|
73
|
-
methods.setValue(!newVal ? null : moment.utc(newVal.add(newVal.utcOffset(), 'minutes')).startOf('week').toDate());
|
|
74
|
-
methods.triggerEvent({
|
|
75
|
-
name: 'onChange'
|
|
76
|
-
});
|
|
77
|
-
},
|
|
78
|
-
value: value && type.isDate(value) ? moment.utc(value).startOf('week') : null
|
|
79
|
-
})
|
|
80
|
-
]
|
|
81
|
-
})
|
|
68
|
+
onChange: (newVal)=>{
|
|
69
|
+
methods.setValue(!newVal ? null : moment.utc(newVal.add(newVal.utcOffset(), 'minutes')).startOf('week').toDate());
|
|
70
|
+
methods.triggerEvent({
|
|
71
|
+
name: 'onChange'
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
value: value && type.isDate(value) ? moment.utc(value).startOf('week') : null
|
|
75
|
+
}))
|
|
82
76
|
}
|
|
83
77
|
}));
|
|
84
78
|
};
|
|
85
79
|
WeekSelector.defaultProps = blockDefaultProps;
|
|
80
|
+
WeekSelector.meta = {
|
|
81
|
+
valueType: 'date',
|
|
82
|
+
category: 'input',
|
|
83
|
+
icons: [
|
|
84
|
+
...Label.meta.icons,
|
|
85
|
+
'AiOutlineCalendar'
|
|
86
|
+
],
|
|
87
|
+
styles: [
|
|
88
|
+
'blocks/WeekSelector/style.less'
|
|
89
|
+
]
|
|
90
|
+
};
|
|
86
91
|
export default WeekSelector;
|
|
@@ -158,8 +158,8 @@
|
|
|
158
158
|
},
|
|
159
159
|
"suffixIcon": {
|
|
160
160
|
"type": ["string", "object"],
|
|
161
|
-
"default": "
|
|
162
|
-
"description": "Name of an
|
|
161
|
+
"default": "AiOutlineCalendar",
|
|
162
|
+
"description": "Name of an React-Icon (See <a href='https://react-icons.github.io/react-icons/'>all icons</a>) or properties of an Icon block to customize icon at the right-hand side of the date picker.",
|
|
163
163
|
"docs": {
|
|
164
164
|
"displayType": "icon"
|
|
165
165
|
}
|
package/dist/blocks.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ export { default as Affix } from './blocks/Affix/Affix.js';
|
|
16
|
+
export { default as Alert } from './blocks/Alert/Alert.js';
|
|
17
|
+
export { default as AutoComplete } from './blocks/AutoComplete/AutoComplete.js';
|
|
18
|
+
export { default as Avatar } from './blocks/Avatar/Avatar.js';
|
|
19
|
+
export { default as Badge } from './blocks/Badge/Badge.js';
|
|
20
|
+
export { default as Breadcrumb } from './blocks/Breadcrumb/Breadcrumb.js';
|
|
21
|
+
export { default as Button } from './blocks/Button/Button.js';
|
|
22
|
+
export { default as ButtonSelector } from './blocks/ButtonSelector/ButtonSelector.js';
|
|
23
|
+
export { default as Card } from './blocks/Card/Card.js';
|
|
24
|
+
export { default as CheckboxSelector } from './blocks/CheckboxSelector/CheckboxSelector.js';
|
|
25
|
+
export { default as CheckboxSwitch } from './blocks/CheckboxSwitch/CheckboxSwitch.js';
|
|
26
|
+
export { default as Collapse } from './blocks/Collapse/Collapse.js';
|
|
27
|
+
export { default as Comment } from './blocks/Comment/Comment.js';
|
|
28
|
+
export { default as ConfirmModal } from './blocks/ConfirmModal/ConfirmModal.js';
|
|
29
|
+
export { default as Content } from './blocks/Content/Content.js';
|
|
30
|
+
export { default as ControlledList } from './blocks/ControlledList/ControlledList.js';
|
|
31
|
+
export { default as DateRangeSelector } from './blocks/DateRangeSelector/DateRangeSelector.js';
|
|
32
|
+
export { default as DateSelector } from './blocks/DateSelector/DateSelector.js';
|
|
33
|
+
export { default as DateTimeSelector } from './blocks/DateTimeSelector/DateTimeSelector.js';
|
|
34
|
+
export { default as Descriptions } from './blocks/Descriptions/Descriptions.js';
|
|
35
|
+
export { default as Divider } from './blocks/Divider/Divider.js';
|
|
36
|
+
export { default as Drawer } from './blocks/Drawer/Drawer.js';
|
|
37
|
+
export { default as Footer } from './blocks/Footer/Footer.js';
|
|
38
|
+
export { default as Header } from './blocks/Header/Header.js';
|
|
39
|
+
export { default as Label } from './blocks/Label/Label.js';
|
|
40
|
+
export { default as Layout } from './blocks/Layout/Layout.js';
|
|
41
|
+
export { default as Menu } from './blocks/Menu/Menu.js';
|
|
42
|
+
export { default as Message } from './blocks/Message/Message.js';
|
|
43
|
+
export { default as MobileMenu } from './blocks/MobileMenu/MobileMenu.js';
|
|
44
|
+
export { default as Modal } from './blocks/Modal/Modal.js';
|
|
45
|
+
export { default as MonthSelector } from './blocks/MonthSelector/MonthSelector.js';
|
|
46
|
+
export { default as MultipleSelector } from './blocks/MultipleSelector/MultipleSelector.js';
|
|
47
|
+
export { default as Notification } from './blocks/Notification/Notification.js';
|
|
48
|
+
export { default as NumberInput } from './blocks/NumberInput/NumberInput.js';
|
|
49
|
+
export { default as PageHCF } from './blocks/PageHCF/PageHCF.js';
|
|
50
|
+
export { default as PageHCSF } from './blocks/PageHCSF/PageHCSF.js';
|
|
51
|
+
export { default as PageHeaderMenu } from './blocks/PageHeaderMenu/PageHeaderMenu.js';
|
|
52
|
+
export { default as PageHSCF } from './blocks/PageHSCF/PageHSCF.js';
|
|
53
|
+
export { default as PageSHCF } from './blocks/PageSHCF/PageSHCF.js';
|
|
54
|
+
export { default as PageSiderMenu } from './blocks/PageSiderMenu/PageSiderMenu.js';
|
|
55
|
+
export { default as Pagination } from './blocks/Pagination/Pagination.js';
|
|
56
|
+
export { default as Paragraph } from './blocks/Paragraph/Paragraph.js';
|
|
57
|
+
export { default as ParagraphInput } from './blocks/ParagraphInput/ParagraphInput.js';
|
|
58
|
+
export { default as PasswordInput } from './blocks/PasswordInput/PasswordInput.js';
|
|
59
|
+
export { default as Progress } from './blocks/Progress/Progress.js';
|
|
60
|
+
export { default as RadioSelector } from './blocks/RadioSelector/RadioSelector.js';
|
|
61
|
+
export { default as RatingSlider } from './blocks/RatingSlider/RatingSlider.js';
|
|
62
|
+
export { default as Result } from './blocks/Result/Result.js';
|
|
63
|
+
export { default as Selector } from './blocks/Selector/Selector.js';
|
|
64
|
+
export { default as Sider } from './blocks/Sider/Sider.js';
|
|
65
|
+
export { default as Statistic } from './blocks/Statistic/Statistic.js';
|
|
66
|
+
export { default as Switch } from './blocks/Switch/Switch.js';
|
|
67
|
+
export { default as Tabs } from './blocks/Tabs/Tabs.js';
|
|
68
|
+
export { default as TimelineList } from './blocks/TimelineList/TimelineList.js';
|
|
69
|
+
export { default as TextArea } from './blocks/TextArea/TextArea.js';
|
|
70
|
+
export { default as TextInput } from './blocks/TextInput/TextInput.js';
|
|
71
|
+
export { default as Title } from './blocks/Title/Title.js';
|
|
72
|
+
export { default as TitleInput } from './blocks/TitleInput/TitleInput.js';
|
|
73
|
+
export { default as Tooltip } from './blocks/Tooltip/Tooltip.js';
|
|
74
|
+
export { default as WeekSelector } from './blocks/WeekSelector/WeekSelector.js';
|
package/dist/color.js
CHANGED
package/dist/disabledDate.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2022 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.
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import moment from 'moment';
|
|
16
16
|
import { type } from '@lowdefy/helpers';
|
|
17
|
-
const disabledDate = (disabledDates = {
|
|
18
|
-
})=>{
|
|
17
|
+
const disabledDate = (disabledDates = {})=>{
|
|
19
18
|
const min = type.isNone(disabledDates.min) ? undefined : moment(disabledDates.min).utc().startOf('day');
|
|
20
19
|
const max = type.isNone(disabledDates.max) ? undefined : moment(disabledDates.max).utc().endOf('day');
|
|
21
20
|
const dates = (disabledDates.dates || []).map((date)=>moment(date).utc().startOf('day')
|
package/dist/getUniqueValues.js
CHANGED
package/dist/getValueIndex.js
CHANGED
package/dist/style.less
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-
|
|
1
|
+
/* eslint-disable import/namespace */ /*
|
|
2
|
+
Copyright 2020-2022 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.
|
|
@@ -12,23 +12,20 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
*/ import * as blocks from './blocks.js';
|
|
16
|
+
const icons = {};
|
|
17
|
+
const styles = {};
|
|
18
|
+
Object.keys(blocks).forEach((block)=>{
|
|
19
|
+
icons[block] = blocks[block].meta.icons || [];
|
|
20
|
+
styles[block] = blocks[block].meta.styles || [];
|
|
21
|
+
});
|
|
22
|
+
export default {
|
|
23
|
+
blocks: Object.keys(blocks),
|
|
24
|
+
icons,
|
|
25
|
+
styles: {
|
|
26
|
+
default: [
|
|
27
|
+
'style.less'
|
|
20
28
|
],
|
|
21
|
-
|
|
22
|
-
'AiOutlined'
|
|
23
|
-
]
|
|
24
|
-
},
|
|
25
|
-
meta: {
|
|
26
|
-
category: 'container',
|
|
27
|
-
loading: {
|
|
28
|
-
type: 'Skeleton',
|
|
29
|
-
properties: {
|
|
30
|
-
height: 40
|
|
31
|
-
}
|
|
32
|
-
}
|
|
29
|
+
...styles
|
|
33
30
|
}
|
|
34
31
|
};
|