@lowdefy/blocks-antd 4.0.0-alpha.1 → 4.0.0-alpha.10
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 +26 -22
- 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
|
@@ -52,13 +52,6 @@
|
|
|
52
52
|
"displayType": "yaml"
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
|
-
"color": {
|
|
56
|
-
"type": "string",
|
|
57
|
-
"description": "Header color.",
|
|
58
|
-
"docs": {
|
|
59
|
-
"displayType": "color"
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
55
|
"style": {
|
|
63
56
|
"type": "object",
|
|
64
57
|
"description": "Header css style object.",
|
|
@@ -88,13 +81,6 @@
|
|
|
88
81
|
"default": true,
|
|
89
82
|
"description": "Whether can be collapsed."
|
|
90
83
|
},
|
|
91
|
-
"color": {
|
|
92
|
-
"type": "string",
|
|
93
|
-
"description": "Sider color",
|
|
94
|
-
"docs": {
|
|
95
|
-
"displayType": "color"
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
84
|
"initialCollapsed": {
|
|
99
85
|
"type": "boolean",
|
|
100
86
|
"default": true,
|
|
@@ -221,7 +207,7 @@
|
|
|
221
207
|
},
|
|
222
208
|
"icon": {
|
|
223
209
|
"type": ["string", "object"],
|
|
224
|
-
"description": "Name of an
|
|
210
|
+
"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 on menu item.",
|
|
225
211
|
"docs": {
|
|
226
212
|
"displayType": "icon"
|
|
227
213
|
}
|
|
@@ -272,22 +258,6 @@
|
|
|
272
258
|
"type": "array",
|
|
273
259
|
"description": "Trigger action when menu is closed."
|
|
274
260
|
},
|
|
275
|
-
"onEnter": {
|
|
276
|
-
"type": "array",
|
|
277
|
-
"description": "Trigger actions every time a context is mounted and keep the page in loading until all actions have finished."
|
|
278
|
-
},
|
|
279
|
-
"onEnterAsync": {
|
|
280
|
-
"type": "array",
|
|
281
|
-
"description": "Trigger actions every time a context is mounted and do not keep the page in loading."
|
|
282
|
-
},
|
|
283
|
-
"onInit": {
|
|
284
|
-
"type": "array",
|
|
285
|
-
"description": "Trigger actions the first time a context is mounted and keep the page in loading until all actions have finished."
|
|
286
|
-
},
|
|
287
|
-
"onInitAsync": {
|
|
288
|
-
"type": "array",
|
|
289
|
-
"description": "Trigger actions the first time a context is mounted and do not keep the page in loading."
|
|
290
|
-
},
|
|
291
261
|
"onMenuItemSelect": {
|
|
292
262
|
"type": "array",
|
|
293
263
|
"description": "Trigger action when menu item is selected."
|
|
@@ -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.
|
|
@@ -42,7 +41,7 @@ const createChangeHandler = ({ eventName , methods })=>(current, pageSize)=>{
|
|
|
42
41
|
});
|
|
43
42
|
}
|
|
44
43
|
;
|
|
45
|
-
const PaginationBlock = ({ blockId , methods , properties , value })=>{
|
|
44
|
+
const PaginationBlock = ({ blockId , loading , methods , properties , value })=>{
|
|
46
45
|
const showTotal = type.isFunction(properties.showTotal) ? properties.showTotal : (total, range)=>{
|
|
47
46
|
if (type.isString(properties.showTotal)) {
|
|
48
47
|
return properties.showTotal;
|
|
@@ -52,9 +51,9 @@ const PaginationBlock = ({ blockId , methods , properties , value })=>{
|
|
|
52
51
|
}
|
|
53
52
|
return `${range[0]}-${range[1]} of ${total} items`;
|
|
54
53
|
};
|
|
55
|
-
return(/*#__PURE__*/
|
|
54
|
+
return(/*#__PURE__*/ React.createElement(Pagination, {
|
|
56
55
|
id: blockId,
|
|
57
|
-
disabled: properties.disabled,
|
|
56
|
+
disabled: properties.disabled || loading,
|
|
58
57
|
hideOnSinglePage: properties.hideOnSinglePage,
|
|
59
58
|
onChange: createChangeHandler({
|
|
60
59
|
eventName: 'onChange',
|
|
@@ -84,4 +83,17 @@ const PaginationBlock = ({ blockId , methods , properties , value })=>{
|
|
|
84
83
|
}));
|
|
85
84
|
};
|
|
86
85
|
PaginationBlock.defaultProps = blockDefaultProps;
|
|
86
|
+
PaginationBlock.meta = {
|
|
87
|
+
valueType: 'object',
|
|
88
|
+
initValue: {
|
|
89
|
+
current: 0,
|
|
90
|
+
pageSize: 10,
|
|
91
|
+
skip: 0
|
|
92
|
+
},
|
|
93
|
+
category: 'input',
|
|
94
|
+
icons: [],
|
|
95
|
+
styles: [
|
|
96
|
+
'blocks/Pagination/style.less'
|
|
97
|
+
]
|
|
98
|
+
};
|
|
87
99
|
export default PaginationBlock;
|
|
@@ -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 { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
|
18
17
|
import { type } from '@lowdefy/helpers';
|
|
19
18
|
import { Typography } from 'antd';
|
|
20
19
|
const Paragraph = Typography.Paragraph;
|
|
21
|
-
const ParagraphBlock = ({ blockId , components: { Icon } , events , methods , properties })=>/*#__PURE__*/
|
|
20
|
+
const ParagraphBlock = ({ blockId , components: { Icon } , events , methods , properties })=>/*#__PURE__*/ React.createElement(Paragraph, {
|
|
22
21
|
id: blockId,
|
|
23
22
|
className: methods.makeCssClass(properties.style),
|
|
24
23
|
code: properties.code,
|
|
@@ -33,17 +32,19 @@ const ParagraphBlock = ({ blockId , components: { Icon } , events , methods , p
|
|
|
33
32
|
});
|
|
34
33
|
},
|
|
35
34
|
icon: properties.copyable.icon && (type.isArray(properties.copyable.icon) ? [
|
|
36
|
-
/*#__PURE__*/
|
|
35
|
+
/*#__PURE__*/ React.createElement(Icon, {
|
|
36
|
+
key: "copy-icon",
|
|
37
37
|
events: events,
|
|
38
38
|
blockId: `${blockId}_copyable_before_icon`,
|
|
39
39
|
properties: properties.copyable.icon[0]
|
|
40
|
-
}
|
|
41
|
-
/*#__PURE__*/
|
|
40
|
+
}),
|
|
41
|
+
/*#__PURE__*/ React.createElement(Icon, {
|
|
42
|
+
key: "copied-icon",
|
|
42
43
|
blockId: `${blockId}_copyable_after_icon`,
|
|
43
44
|
events: events,
|
|
44
45
|
properties: properties.copyable.icon[1]
|
|
45
|
-
}
|
|
46
|
-
] : /*#__PURE__*/
|
|
46
|
+
}),
|
|
47
|
+
] : /*#__PURE__*/ React.createElement(Icon, {
|
|
47
48
|
blockId: `${blockId}_copyable_icon`,
|
|
48
49
|
events: events,
|
|
49
50
|
properties: properties.copyable.icon
|
|
@@ -85,12 +86,18 @@ const ParagraphBlock = ({ blockId , components: { Icon } , events , methods , p
|
|
|
85
86
|
mark: properties.mark,
|
|
86
87
|
strong: properties.strong,
|
|
87
88
|
type: properties.type,
|
|
88
|
-
underline: properties.underline
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
})
|
|
89
|
+
underline: properties.underline
|
|
90
|
+
}, renderHtml({
|
|
91
|
+
html: properties.content,
|
|
92
|
+
methods
|
|
93
|
+
}))
|
|
94
94
|
;
|
|
95
95
|
ParagraphBlock.defaultProps = blockDefaultProps;
|
|
96
|
+
ParagraphBlock.meta = {
|
|
97
|
+
category: 'display',
|
|
98
|
+
icons: [],
|
|
99
|
+
styles: [
|
|
100
|
+
'blocks/Paragraph/style.less'
|
|
101
|
+
]
|
|
102
|
+
};
|
|
96
103
|
export default ParagraphBlock;
|
|
@@ -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 Paragraph = Typography.Paragraph;
|
|
21
|
-
const ParagraphInput = ({ blockId ,
|
|
20
|
+
const ParagraphInput = ({ 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 ParagraphInput = ({ blockId , events , components: { Icon } , properties
|
|
|
38
37
|
});
|
|
39
38
|
}
|
|
40
39
|
};
|
|
41
|
-
return(/*#__PURE__*/
|
|
40
|
+
return(/*#__PURE__*/ React.createElement(Paragraph, {
|
|
42
41
|
id: blockId,
|
|
43
42
|
className: methods.makeCssClass(properties.style),
|
|
44
43
|
code: properties.code,
|
|
@@ -53,17 +52,19 @@ const ParagraphInput = ({ blockId , events , components: { Icon } , properties
|
|
|
53
52
|
});
|
|
54
53
|
},
|
|
55
54
|
icon: properties.copyable.icon && (type.isArray(properties.copyable.icon) ? [
|
|
56
|
-
/*#__PURE__*/
|
|
55
|
+
/*#__PURE__*/ React.createElement(Icon, {
|
|
56
|
+
key: "copy-icon",
|
|
57
57
|
blockId: `${blockId}_copyable_before_icon`,
|
|
58
58
|
events: events,
|
|
59
59
|
properties: properties.copyable.icon[0]
|
|
60
|
-
}
|
|
61
|
-
/*#__PURE__*/
|
|
60
|
+
}),
|
|
61
|
+
/*#__PURE__*/ React.createElement(Icon, {
|
|
62
|
+
key: "copied-icon",
|
|
62
63
|
blockId: `${blockId}_copyable_after_icon`,
|
|
63
64
|
events: events,
|
|
64
65
|
properties: properties.copyable.icon[1]
|
|
65
|
-
}
|
|
66
|
-
] : /*#__PURE__*/
|
|
66
|
+
}),
|
|
67
|
+
] : /*#__PURE__*/ React.createElement(Icon, {
|
|
67
68
|
blockId: `${blockId}_copyable_icon`,
|
|
68
69
|
events: events,
|
|
69
70
|
properties: properties.copyable.icon
|
|
@@ -71,7 +72,7 @@ const ParagraphInput = ({ blockId , events , components: { Icon } , properties
|
|
|
71
72
|
tooltips: properties.copyable.tooltips
|
|
72
73
|
} : properties.copyable,
|
|
73
74
|
delete: properties.delete,
|
|
74
|
-
disabled: properties.disabled,
|
|
75
|
+
disabled: properties.disabled || loading,
|
|
75
76
|
ellipsis: type.isObject(properties.ellipsis) ? {
|
|
76
77
|
rows: properties.ellipsis.rows,
|
|
77
78
|
expandable: properties.ellipsis.expandable,
|
|
@@ -94,7 +95,7 @@ const ParagraphInput = ({ blockId , events , components: { Icon } , properties
|
|
|
94
95
|
}
|
|
95
96
|
} : properties.ellipsis,
|
|
96
97
|
editable: type.isObject(properties.editable) ? {
|
|
97
|
-
icon: properties.editable.icon && /*#__PURE__*/
|
|
98
|
+
icon: properties.editable.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
98
99
|
blockId: `${blockId}_editable_icon`,
|
|
99
100
|
events: events,
|
|
100
101
|
properties: properties.editable.icon
|
|
@@ -109,9 +110,16 @@ const ParagraphInput = ({ blockId , events , components: { Icon } , properties
|
|
|
109
110
|
mark: properties.mark,
|
|
110
111
|
strong: properties.strong,
|
|
111
112
|
type: properties.type,
|
|
112
|
-
underline: properties.underline
|
|
113
|
-
|
|
114
|
-
}));
|
|
113
|
+
underline: properties.underline
|
|
114
|
+
}, !type.isNone(value) ? value.toString() : ''));
|
|
115
115
|
};
|
|
116
116
|
ParagraphInput.defaultProps = blockDefaultProps;
|
|
117
|
+
ParagraphInput.meta = {
|
|
118
|
+
valueType: 'string',
|
|
119
|
+
category: 'input',
|
|
120
|
+
icons: [],
|
|
121
|
+
styles: [
|
|
122
|
+
'blocks/ParagraphInput/style.less'
|
|
123
|
+
]
|
|
124
|
+
};
|
|
117
125
|
export default ParagraphInput;
|
|
@@ -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,11 +18,10 @@ import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
|
19
18
|
import Label from '../Label/Label.js';
|
|
20
19
|
import useRunAfterUpdate from '../../useRunAfterUpdate.js';
|
|
21
20
|
const PasswordInput = ({ blockId , components , events , loading , methods , properties , required , validation , value , })=>{
|
|
22
|
-
return(/*#__PURE__*/
|
|
21
|
+
return(/*#__PURE__*/ React.createElement(Label, {
|
|
23
22
|
blockId: blockId,
|
|
24
23
|
components: components,
|
|
25
24
|
events: events,
|
|
26
|
-
loading: loading,
|
|
27
25
|
properties: {
|
|
28
26
|
title: properties.title,
|
|
29
27
|
size: properties.size,
|
|
@@ -34,12 +32,12 @@ const PasswordInput = ({ blockId , components , events , loading , methods , pro
|
|
|
34
32
|
content: {
|
|
35
33
|
content: ()=>{
|
|
36
34
|
const runAfterUpdate = useRunAfterUpdate();
|
|
37
|
-
return(/*#__PURE__*/
|
|
35
|
+
return(/*#__PURE__*/ React.createElement(Input.Password, {
|
|
38
36
|
id: `${blockId}_input`,
|
|
39
37
|
bordered: properties.bordered,
|
|
40
38
|
className: methods.makeCssClass(properties.inputStyle),
|
|
41
39
|
autoFocus: properties.autoFocus,
|
|
42
|
-
disabled: properties.disabled,
|
|
40
|
+
disabled: properties.disabled || loading,
|
|
43
41
|
onChange: (event)=>{
|
|
44
42
|
methods.setValue(event.target.value);
|
|
45
43
|
methods.triggerEvent({
|
|
@@ -66,4 +64,14 @@ const PasswordInput = ({ blockId , components , events , loading , methods , pro
|
|
|
66
64
|
}));
|
|
67
65
|
};
|
|
68
66
|
PasswordInput.defaultProps = blockDefaultProps;
|
|
67
|
+
PasswordInput.meta = {
|
|
68
|
+
valueType: 'string',
|
|
69
|
+
category: 'input',
|
|
70
|
+
icons: [
|
|
71
|
+
...Label.meta.icons
|
|
72
|
+
],
|
|
73
|
+
styles: [
|
|
74
|
+
'blocks/PasswordInput/style.less'
|
|
75
|
+
]
|
|
76
|
+
};
|
|
69
77
|
export default PasswordInput;
|
|
@@ -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 { Progress } from 'antd';
|
|
18
17
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
19
|
-
const ProgressBlock = ({ blockId , properties })=>/*#__PURE__*/
|
|
18
|
+
const ProgressBlock = ({ blockId , properties })=>/*#__PURE__*/ React.createElement(Progress, {
|
|
20
19
|
gapDegree: properties.gapDegree,
|
|
21
20
|
gapPosition: properties.gapPosition,
|
|
22
21
|
id: blockId,
|
|
@@ -34,4 +33,11 @@ const ProgressBlock = ({ blockId , properties })=>/*#__PURE__*/ _jsx(Progress,
|
|
|
34
33
|
})
|
|
35
34
|
;
|
|
36
35
|
ProgressBlock.defaultProps = blockDefaultProps;
|
|
36
|
+
ProgressBlock.meta = {
|
|
37
|
+
category: 'display',
|
|
38
|
+
icons: [],
|
|
39
|
+
styles: [
|
|
40
|
+
'blocks/Progress/style.less'
|
|
41
|
+
]
|
|
42
|
+
};
|
|
37
43
|
export default ProgressBlock;
|
|
@@ -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.
|
|
@@ -23,7 +22,7 @@ import getUniqueValues from '../../getUniqueValues.js';
|
|
|
23
22
|
const RadioGroup = Radio.Group;
|
|
24
23
|
const RadioSelector = ({ blockId , components , events , loading , properties , required , validation , value , methods , })=>{
|
|
25
24
|
const uniqueValueOptions = getUniqueValues(properties.options || []);
|
|
26
|
-
return(/*#__PURE__*/
|
|
25
|
+
return(/*#__PURE__*/ React.createElement(Label, {
|
|
27
26
|
blockId: blockId,
|
|
28
27
|
components: components,
|
|
29
28
|
events: events,
|
|
@@ -34,9 +33,8 @@ const RadioSelector = ({ blockId , components , events , loading , properties ,
|
|
|
34
33
|
},
|
|
35
34
|
validation: validation,
|
|
36
35
|
required: required,
|
|
37
|
-
loading: loading,
|
|
38
36
|
content: {
|
|
39
|
-
content: ()=>/*#__PURE__*/
|
|
37
|
+
content: ()=>/*#__PURE__*/ React.createElement(RadioGroup, {
|
|
40
38
|
id: `${blockId}_input`,
|
|
41
39
|
className: methods.makeCssClass([
|
|
42
40
|
properties.color && {
|
|
@@ -49,43 +47,51 @@ const RadioSelector = ({ blockId , components , events , loading , properties ,
|
|
|
49
47
|
},
|
|
50
48
|
properties.inputStyle,
|
|
51
49
|
]),
|
|
52
|
-
disabled: properties.disabled,
|
|
50
|
+
disabled: properties.disabled || loading,
|
|
53
51
|
onChange: (event)=>{
|
|
54
52
|
methods.setValue(type.isPrimitive(uniqueValueOptions[event.target.value]) ? uniqueValueOptions[event.target.value] : uniqueValueOptions[event.target.value].value);
|
|
55
53
|
methods.triggerEvent({
|
|
56
54
|
name: 'onChange'
|
|
57
55
|
});
|
|
58
56
|
},
|
|
59
|
-
value: getValueIndex(value, uniqueValueOptions)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
})
|
|
86
|
-
})
|
|
57
|
+
value: getValueIndex(value, uniqueValueOptions)
|
|
58
|
+
}, /*#__PURE__*/ React.createElement(Space, {
|
|
59
|
+
direction: properties.direction,
|
|
60
|
+
wrap: type.isNone(properties.wrap) ? true : properties.wrap,
|
|
61
|
+
align: type.isNone(properties.align) ? 'start' : properties.align
|
|
62
|
+
}, uniqueValueOptions.map((opt, i)=>type.isPrimitive(opt) ? /*#__PURE__*/ React.createElement(Radio, {
|
|
63
|
+
id: `${blockId}_${opt}`,
|
|
64
|
+
key: i,
|
|
65
|
+
value: i
|
|
66
|
+
}, renderHtml({
|
|
67
|
+
html: `${opt}`,
|
|
68
|
+
methods
|
|
69
|
+
})) : /*#__PURE__*/ React.createElement(Radio, {
|
|
70
|
+
id: `${blockId}_${i}`,
|
|
71
|
+
key: i,
|
|
72
|
+
value: i,
|
|
73
|
+
disabled: opt.disabled,
|
|
74
|
+
className: methods.makeCssClass(opt.style)
|
|
75
|
+
}, type.isNone(opt.label) ? renderHtml({
|
|
76
|
+
html: `${opt.value}`,
|
|
77
|
+
methods
|
|
78
|
+
}) : renderHtml({
|
|
79
|
+
html: opt.label,
|
|
80
|
+
methods
|
|
81
|
+
}))
|
|
82
|
+
)))
|
|
87
83
|
}
|
|
88
84
|
}));
|
|
89
85
|
};
|
|
90
86
|
RadioSelector.defaultProps = blockDefaultProps;
|
|
87
|
+
RadioSelector.meta = {
|
|
88
|
+
valueType: 'any',
|
|
89
|
+
category: 'input',
|
|
90
|
+
icons: [
|
|
91
|
+
...Label.meta.icons
|
|
92
|
+
],
|
|
93
|
+
styles: [
|
|
94
|
+
'blocks/RadioSelector/style.less'
|
|
95
|
+
]
|
|
96
|
+
};
|
|
91
97
|
export default RadioSelector;
|