@lowdefy/blocks-antd 4.0.0-rc.8 → 4.0.0
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 -2
- package/dist/blocks/Affix/style.less +1 -1
- package/dist/blocks/Alert/Alert.js +7 -20
- package/dist/blocks/Alert/style.less +1 -1
- package/dist/blocks/AutoComplete/AutoComplete.js +18 -3
- package/dist/blocks/AutoComplete/schema.json +12 -0
- package/dist/blocks/AutoComplete/style.less +1 -1
- package/dist/blocks/Avatar/Avatar.js +2 -2
- package/dist/blocks/Avatar/style.less +1 -1
- package/dist/blocks/Badge/Badge.js +2 -2
- package/dist/blocks/Badge/style.less +1 -1
- package/dist/blocks/Breadcrumb/Breadcrumb.js +7 -20
- package/dist/blocks/Breadcrumb/style.less +1 -1
- package/dist/blocks/Button/Button.js +2 -2
- package/dist/blocks/Button/style.less +1 -1
- package/dist/blocks/ButtonSelector/ButtonSelector.js +2 -2
- package/dist/blocks/ButtonSelector/style.less +1 -1
- package/dist/blocks/Card/Card.js +3 -2
- package/dist/blocks/Card/style.less +1 -1
- package/dist/blocks/Carousel/Carousel.js +9 -22
- package/dist/blocks/Carousel/style.less +1 -1
- package/dist/blocks/CheckboxSelector/CheckboxSelector.js +2 -2
- package/dist/blocks/CheckboxSelector/style.less +1 -1
- package/dist/blocks/CheckboxSwitch/CheckboxSwitch.js +2 -2
- package/dist/blocks/CheckboxSwitch/style.less +1 -1
- package/dist/blocks/Collapse/Collapse.js +8 -21
- package/dist/blocks/Collapse/style.less +1 -1
- package/dist/blocks/Comment/Comment.js +2 -2
- package/dist/blocks/Comment/style.less +1 -1
- package/dist/blocks/ConfirmModal/ConfirmModal.js +9 -9
- package/dist/blocks/ConfirmModal/style.less +1 -1
- package/dist/blocks/Content/Content.js +2 -2
- package/dist/blocks/Content/style.less +1 -1
- package/dist/blocks/ControlledList/ControlledList.js +6 -6
- package/dist/blocks/ControlledList/style.less +1 -1
- package/dist/blocks/DateRangeSelector/DateRangeSelector.js +9 -9
- package/dist/blocks/DateRangeSelector/style.less +1 -1
- package/dist/blocks/DateSelector/DateSelector.js +5 -5
- package/dist/blocks/DateSelector/style.less +1 -1
- package/dist/blocks/DateTimeSelector/DateTimeSelector.js +19 -17
- package/dist/blocks/DateTimeSelector/style.less +1 -1
- package/dist/blocks/Descriptions/Descriptions.js +3 -3
- package/dist/blocks/Descriptions/style.less +1 -1
- package/dist/blocks/Divider/Divider.js +2 -2
- package/dist/blocks/Divider/style.less +1 -1
- package/dist/blocks/Drawer/Drawer.js +4 -4
- package/dist/blocks/Drawer/style.less +1 -1
- package/dist/blocks/Footer/Footer.js +2 -2
- package/dist/blocks/Footer/style.less +1 -1
- package/dist/blocks/Header/Header.js +2 -2
- package/dist/blocks/Header/style.less +1 -1
- package/dist/blocks/Label/Label.js +10 -22
- package/dist/blocks/Label/getLabelCol.js +1 -1
- package/dist/blocks/Label/getWrapperCol.js +7 -7
- package/dist/blocks/Label/labelLogic.js +18 -18
- package/dist/blocks/Label/style.less +1 -1
- package/dist/blocks/Layout/Layout.js +2 -2
- package/dist/blocks/Layout/style.less +1 -1
- package/dist/blocks/Menu/Menu.js +35 -43
- package/dist/blocks/Menu/style.less +1 -1
- package/dist/blocks/Message/Message.js +6 -6
- package/dist/blocks/Message/style.less +1 -1
- package/dist/blocks/MobileMenu/MobileMenu.js +5 -5
- package/dist/blocks/MobileMenu/style.less +1 -1
- package/dist/blocks/Modal/Modal.js +12 -25
- package/dist/blocks/Modal/style.less +1 -1
- package/dist/blocks/MonthSelector/MonthSelector.js +5 -5
- package/dist/blocks/MonthSelector/style.less +1 -1
- package/dist/blocks/MultipleSelector/MultipleSelector.js +42 -5
- package/dist/blocks/MultipleSelector/schema.json +43 -0
- package/dist/blocks/MultipleSelector/style.less +2 -1
- package/dist/blocks/Notification/Notification.js +2 -2
- package/dist/blocks/Notification/style.less +1 -1
- package/dist/blocks/NumberInput/NumberInput.js +12 -2
- package/dist/blocks/NumberInput/schema.json +9 -1
- package/dist/blocks/NumberInput/style.less +1 -1
- package/dist/blocks/PageHeaderMenu/PageHeaderMenu.js +2 -2
- package/dist/blocks/PageHeaderMenu/style.less +1 -1
- package/dist/blocks/PageSiderMenu/PageSiderMenu.js +3 -3
- package/dist/blocks/PageSiderMenu/style.less +1 -1
- package/dist/blocks/Pagination/Pagination.js +4 -4
- package/dist/blocks/Pagination/style.less +1 -1
- package/dist/blocks/Paragraph/Paragraph.js +3 -2
- package/dist/blocks/Paragraph/schema.json +4 -0
- package/dist/blocks/Paragraph/style.less +1 -1
- package/dist/blocks/ParagraphInput/ParagraphInput.js +2 -2
- package/dist/blocks/ParagraphInput/style.less +1 -1
- package/dist/blocks/PasswordInput/PasswordInput.js +12 -2
- package/dist/blocks/PasswordInput/schema.json +8 -0
- package/dist/blocks/PasswordInput/style.less +1 -1
- package/dist/blocks/PhoneNumberInput/PhoneNumberInput.js +26 -6
- package/dist/blocks/PhoneNumberInput/schema.json +8 -0
- package/dist/blocks/PhoneNumberInput/style.less +1 -1
- package/dist/blocks/Progress/Progress.js +2 -2
- package/dist/blocks/Progress/style.less +1 -1
- package/dist/blocks/RadioSelector/RadioSelector.js +2 -2
- package/dist/blocks/RadioSelector/style.less +1 -1
- package/dist/blocks/RatingSlider/RatingSlider.js +9 -9
- package/dist/blocks/RatingSlider/style.less +1 -1
- package/dist/blocks/Result/Result.js +2 -2
- package/dist/blocks/Result/style.less +1 -1
- package/dist/blocks/Selector/Selector.js +17 -2
- package/dist/blocks/Selector/schema.json +12 -0
- package/dist/blocks/Selector/style.less +1 -1
- package/dist/blocks/Sider/Sider.js +5 -5
- package/dist/blocks/Sider/style.less +1 -1
- package/dist/blocks/Slider/Slider.js +76 -0
- package/dist/blocks/Slider/style.less +18 -0
- package/dist/blocks/Statistic/Statistic.js +11 -5
- package/dist/blocks/Statistic/style.less +1 -1
- package/dist/blocks/Switch/Switch.js +2 -2
- package/dist/blocks/Switch/style.less +1 -1
- package/dist/blocks/Tabs/Tabs.js +55 -53
- package/dist/blocks/Tabs/schema.json +1 -5
- package/dist/blocks/Tabs/style.less +1 -1
- package/dist/blocks/Tag/Tag.js +57 -0
- package/dist/blocks/Tag/schema.json +45 -0
- package/dist/blocks/Tag/style.less +17 -0
- package/dist/blocks/TextArea/TextArea.js +12 -2
- package/dist/blocks/TextArea/schema.json +8 -0
- package/dist/blocks/TextArea/style.less +1 -1
- package/dist/blocks/TextInput/TextInput.js +13 -3
- package/dist/blocks/TextInput/schema.json +8 -0
- package/dist/blocks/TextInput/style.less +1 -1
- package/dist/blocks/TimelineList/TimelineList.js +12 -25
- package/dist/blocks/TimelineList/style.less +1 -1
- package/dist/blocks/Title/Title.js +2 -2
- package/dist/blocks/Title/style.less +1 -1
- package/dist/blocks/TitleInput/TitleInput.js +2 -2
- package/dist/blocks/TitleInput/style.less +1 -1
- package/dist/blocks/Tooltip/Tooltip.js +3 -3
- package/dist/blocks/Tooltip/style.less +1 -1
- package/dist/blocks/WeekSelector/WeekSelector.js +5 -5
- package/dist/blocks/WeekSelector/style.less +1 -1
- package/dist/blocks.js +3 -1
- 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/types.js +3 -3
- package/dist/useRunAfterUpdate.js +1 -1
- package/dist/validationExamples.js +1 -1
- package/package.json +21 -23
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import { Affix } from 'antd';
|
|
17
17
|
import { get } from '@lowdefy/helpers';
|
|
18
18
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
19
|
-
const AffixBlock = ({ blockId
|
|
19
|
+
const AffixBlock = ({ blockId, content, methods, properties, rename })=>/*#__PURE__*/ React.createElement(Affix, {
|
|
20
20
|
id: blockId,
|
|
21
21
|
className: methods.makeCssClass(properties.style),
|
|
22
22
|
offsetBottom: properties.offsetBottom,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 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,25 +12,11 @@
|
|
|
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
|
-
_extends = Object.assign || function(target) {
|
|
17
|
-
for(var i = 1; i < arguments.length; i++){
|
|
18
|
-
var source = arguments[i];
|
|
19
|
-
for(var key in source){
|
|
20
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
21
|
-
target[key] = source[key];
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return target;
|
|
26
|
-
};
|
|
27
|
-
return _extends.apply(this, arguments);
|
|
28
|
-
}
|
|
29
|
-
import React from 'react';
|
|
15
|
+
*/ import React from 'react';
|
|
30
16
|
import { Alert } from 'antd';
|
|
31
17
|
import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
32
18
|
import { type } from '@lowdefy/helpers';
|
|
33
|
-
const AlertBlock = ({ blockId
|
|
19
|
+
const AlertBlock = ({ blockId, content, events, components: { Icon }, methods, properties })=>{
|
|
34
20
|
const additionalProps = {};
|
|
35
21
|
if (properties.icon) {
|
|
36
22
|
additionalProps.icon = /*#__PURE__*/ React.createElement(Icon, {
|
|
@@ -39,7 +25,7 @@ const AlertBlock = ({ blockId , content , events , components: { Icon } , metho
|
|
|
39
25
|
properties: properties.icon
|
|
40
26
|
});
|
|
41
27
|
}
|
|
42
|
-
return /*#__PURE__*/ React.createElement(Alert,
|
|
28
|
+
return /*#__PURE__*/ React.createElement(Alert, {
|
|
43
29
|
action: content.action && content.action(),
|
|
44
30
|
afterClose: ()=>methods.triggerEvent({
|
|
45
31
|
name: 'afterClose'
|
|
@@ -64,8 +50,9 @@ const AlertBlock = ({ blockId , content , events , components: { Icon } , metho
|
|
|
64
50
|
name: 'onClose'
|
|
65
51
|
}),
|
|
66
52
|
showIcon: properties.showIcon === false ? false : true,
|
|
67
|
-
type: properties.type
|
|
68
|
-
|
|
53
|
+
type: properties.type,
|
|
54
|
+
...additionalProps
|
|
55
|
+
});
|
|
69
56
|
};
|
|
70
57
|
AlertBlock.defaultProps = blockDefaultProps;
|
|
71
58
|
AlertBlock.meta = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -18,7 +18,7 @@ import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
|
18
18
|
import { type } from '@lowdefy/helpers';
|
|
19
19
|
import Label from '../Label/Label.js';
|
|
20
20
|
const Option = AutoComplete.Option;
|
|
21
|
-
const AutoCompleteInput = ({ blockId
|
|
21
|
+
const AutoCompleteInput = ({ blockId, components, events, loading, methods, properties, required, validation, value })=>{
|
|
22
22
|
return /*#__PURE__*/ React.createElement(Label, {
|
|
23
23
|
blockId: blockId,
|
|
24
24
|
components: components,
|
|
@@ -44,7 +44,7 @@ const AutoCompleteInput = ({ blockId , components , events , loading , methods ,
|
|
|
44
44
|
]),
|
|
45
45
|
defaultOpen: properties.defaultOpen,
|
|
46
46
|
disabled: properties.disabled || loading,
|
|
47
|
-
placeholder: properties.placeholder
|
|
47
|
+
placeholder: properties.placeholder ?? 'Type or select item',
|
|
48
48
|
allowClear: properties.allowClear !== false,
|
|
49
49
|
size: properties.size,
|
|
50
50
|
filterOption: (input, option)=>`${option.value}`.toLowerCase().indexOf(input.toLowerCase()) >= 0,
|
|
@@ -54,6 +54,21 @@ const AutoCompleteInput = ({ blockId , components , events , loading , methods ,
|
|
|
54
54
|
name: 'onChange'
|
|
55
55
|
});
|
|
56
56
|
},
|
|
57
|
+
onFocus: ()=>{
|
|
58
|
+
methods.triggerEvent({
|
|
59
|
+
name: 'onFocus'
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
onBlur: ()=>{
|
|
63
|
+
methods.triggerEvent({
|
|
64
|
+
name: 'onBlur'
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
onClear: ()=>{
|
|
68
|
+
methods.triggerEvent({
|
|
69
|
+
name: 'onClear'
|
|
70
|
+
});
|
|
71
|
+
},
|
|
57
72
|
onSearch: (newVal)=>{
|
|
58
73
|
methods.triggerEvent({
|
|
59
74
|
name: 'onSearch',
|
|
@@ -135,10 +135,22 @@
|
|
|
135
135
|
"type": "object",
|
|
136
136
|
"additionalProperties": false,
|
|
137
137
|
"properties": {
|
|
138
|
+
"onBlur": {
|
|
139
|
+
"type": "array",
|
|
140
|
+
"description": "Trigger action event occurs when selector loses focus."
|
|
141
|
+
},
|
|
138
142
|
"onChange": {
|
|
139
143
|
"type": "array",
|
|
140
144
|
"description": "Trigger actions when selection is changed."
|
|
141
145
|
},
|
|
146
|
+
"onFocus": {
|
|
147
|
+
"type": "array",
|
|
148
|
+
"description": "Trigger action when an selector gets focus."
|
|
149
|
+
},
|
|
150
|
+
"onClear": {
|
|
151
|
+
"type": "array",
|
|
152
|
+
"description": "Trigger action when selector gets cleared."
|
|
153
|
+
},
|
|
142
154
|
"onSearch": {
|
|
143
155
|
"type": "array",
|
|
144
156
|
"description": "Called when searching items."
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 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.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/ import React from 'react';
|
|
16
16
|
import { Avatar } from 'antd';
|
|
17
17
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
18
|
-
const AvatarBlock = ({ blockId
|
|
18
|
+
const AvatarBlock = ({ blockId, events, components: { Icon }, methods, properties })=>/*#__PURE__*/ React.createElement(Avatar, {
|
|
19
19
|
id: blockId,
|
|
20
20
|
alt: properties.alt,
|
|
21
21
|
gap: properties.gap,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import { type } from '@lowdefy/helpers';
|
|
17
17
|
import { Badge } from 'antd';
|
|
18
18
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
19
|
-
const BadgeBlock = ({ blockId
|
|
19
|
+
const BadgeBlock = ({ blockId, events, content, components: { Icon }, properties })=>/*#__PURE__*/ React.createElement(Badge, {
|
|
20
20
|
id: blockId,
|
|
21
21
|
color: properties.color,
|
|
22
22
|
dot: properties.dot,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 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,25 +12,11 @@
|
|
|
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
|
-
_extends = Object.assign || function(target) {
|
|
17
|
-
for(var i = 1; i < arguments.length; i++){
|
|
18
|
-
var source = arguments[i];
|
|
19
|
-
for(var key in source){
|
|
20
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
21
|
-
target[key] = source[key];
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return target;
|
|
26
|
-
};
|
|
27
|
-
return _extends.apply(this, arguments);
|
|
28
|
-
}
|
|
29
|
-
import React from 'react';
|
|
15
|
+
*/ import React from 'react';
|
|
30
16
|
import { type, get } from '@lowdefy/helpers';
|
|
31
17
|
import { Breadcrumb } from 'antd';
|
|
32
18
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
33
|
-
const BreadcrumbBlock = ({ blockId
|
|
19
|
+
const BreadcrumbBlock = ({ blockId, events, components: { Icon, Link }, methods, properties, rename })=>{
|
|
34
20
|
const onClickActionName = get(rename, 'events.onClick', {
|
|
35
21
|
default: 'onClick'
|
|
36
22
|
});
|
|
@@ -47,15 +33,16 @@ const BreadcrumbBlock = ({ blockId , events , components: { Icon , Link } , met
|
|
|
47
33
|
index
|
|
48
34
|
}
|
|
49
35
|
}))
|
|
50
|
-
}, /*#__PURE__*/ React.createElement(Link,
|
|
36
|
+
}, /*#__PURE__*/ React.createElement(Link, {
|
|
51
37
|
id: `${blockId}_${index}`,
|
|
52
38
|
className: methods.makeCssClass([
|
|
53
39
|
{
|
|
54
40
|
cursor: events[onClickActionName] && 'pointer'
|
|
55
41
|
},
|
|
56
42
|
link.style
|
|
57
|
-
])
|
|
58
|
-
|
|
43
|
+
]),
|
|
44
|
+
...link
|
|
45
|
+
}, ()=>/*#__PURE__*/ React.createElement(React.Fragment, null, link.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
59
46
|
blockId: `${blockId}_${index}_icon`,
|
|
60
47
|
events: events,
|
|
61
48
|
properties: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 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.
|
|
@@ -17,7 +17,7 @@ import { Button } from 'antd';
|
|
|
17
17
|
import { get, type } from '@lowdefy/helpers';
|
|
18
18
|
import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
19
19
|
import color from '../../color.js';
|
|
20
|
-
const ButtonBlock = ({ blockId
|
|
20
|
+
const ButtonBlock = ({ blockId, components: { Icon }, events, loading, methods, onClick, properties, rename })=>{
|
|
21
21
|
const onClickActionName = get(rename, 'events.onClick', {
|
|
22
22
|
default: 'onClick'
|
|
23
23
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -19,7 +19,7 @@ import { type } from '@lowdefy/helpers';
|
|
|
19
19
|
import Label from '../Label/Label.js';
|
|
20
20
|
import getValueIndex from '../../getValueIndex.js';
|
|
21
21
|
import getUniqueValues from '../../getUniqueValues.js';
|
|
22
|
-
const ButtonSelector = ({ blockId
|
|
22
|
+
const ButtonSelector = ({ blockId, components, events, loading, properties, required, validation, value, methods })=>{
|
|
23
23
|
const uniqueValueOptions = getUniqueValues(properties.options || []);
|
|
24
24
|
return /*#__PURE__*/ React.createElement(Label, {
|
|
25
25
|
blockId: blockId,
|
package/dist/blocks/Card/Card.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 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.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/ import React from 'react';
|
|
16
16
|
import { Card } from 'antd';
|
|
17
17
|
import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
18
|
-
const CardBlock = ({ blockId
|
|
18
|
+
const CardBlock = ({ blockId, content, properties, methods, events })=>/*#__PURE__*/ React.createElement(Card, {
|
|
19
19
|
id: blockId,
|
|
20
20
|
title: content.title ? content.title() : renderHtml({
|
|
21
21
|
html: properties.title,
|
|
@@ -24,6 +24,7 @@ const CardBlock = ({ blockId , content , properties , methods , events })=>/*#_
|
|
|
24
24
|
headStyle: methods.makeCssClass(properties.headerStyle, true),
|
|
25
25
|
bodyStyle: methods.makeCssClass(properties.bodyStyle, true),
|
|
26
26
|
bordered: properties.bordered,
|
|
27
|
+
cover: content.cover && content.cover(),
|
|
27
28
|
extra: content.extra && content.extra(),
|
|
28
29
|
hoverable: properties.hoverable,
|
|
29
30
|
size: properties.size,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 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,24 +12,10 @@
|
|
|
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
|
-
_extends = Object.assign || function(target) {
|
|
17
|
-
for(var i = 1; i < arguments.length; i++){
|
|
18
|
-
var source = arguments[i];
|
|
19
|
-
for(var key in source){
|
|
20
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
21
|
-
target[key] = source[key];
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return target;
|
|
26
|
-
};
|
|
27
|
-
return _extends.apply(this, arguments);
|
|
28
|
-
}
|
|
29
|
-
import React, { useEffect, useRef } from 'react';
|
|
15
|
+
*/ import React, { useEffect, useRef } from 'react';
|
|
30
16
|
import { Carousel } from 'antd';
|
|
31
17
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
32
|
-
const getSlides = ({ content
|
|
18
|
+
const getSlides = ({ content, properties })=>{
|
|
33
19
|
let slides = properties.slides;
|
|
34
20
|
if (!slides) {
|
|
35
21
|
slides = Object.keys(content).sort().map((key)=>({
|
|
@@ -38,18 +24,18 @@ const getSlides = ({ content , properties })=>{
|
|
|
38
24
|
}
|
|
39
25
|
return slides;
|
|
40
26
|
};
|
|
41
|
-
const CarouselBlock = ({ blockId
|
|
27
|
+
const CarouselBlock = ({ blockId, content, properties, methods })=>{
|
|
42
28
|
const slides = getSlides({
|
|
43
29
|
content,
|
|
44
30
|
properties
|
|
45
31
|
});
|
|
46
32
|
const carousel = useRef();
|
|
47
33
|
useEffect(()=>{
|
|
48
|
-
methods.registerMethod('goTo', ({ slide
|
|
34
|
+
methods.registerMethod('goTo', ({ slide, dontAnimate = false })=>{
|
|
49
35
|
const slideNumber = slides.findIndex((item)=>{
|
|
50
36
|
return item.key === slide;
|
|
51
37
|
});
|
|
52
|
-
if (slideNumber
|
|
38
|
+
if (slideNumber !== -1) {
|
|
53
39
|
carousel.current.goTo(slideNumber, dontAnimate);
|
|
54
40
|
}
|
|
55
41
|
});
|
|
@@ -60,7 +46,8 @@ const CarouselBlock = ({ blockId , content , properties , methods })=>{
|
|
|
60
46
|
carousel.current.prev();
|
|
61
47
|
});
|
|
62
48
|
}, []);
|
|
63
|
-
return /*#__PURE__*/ React.createElement(Carousel,
|
|
49
|
+
return /*#__PURE__*/ React.createElement(Carousel, {
|
|
50
|
+
...properties,
|
|
64
51
|
id: blockId,
|
|
65
52
|
afterChange: (current)=>{
|
|
66
53
|
methods.triggerEvent({
|
|
@@ -87,7 +74,7 @@ const CarouselBlock = ({ blockId , content , properties , methods })=>{
|
|
|
87
74
|
}),
|
|
88
75
|
className: methods.makeCssClass(properties.style),
|
|
89
76
|
ref: carousel
|
|
90
|
-
}
|
|
77
|
+
}, slides?.map((slide)=>/*#__PURE__*/ React.createElement("div", {
|
|
91
78
|
key: slide.key
|
|
92
79
|
}, content[slide.key] && content[slide.key]())));
|
|
93
80
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -19,7 +19,7 @@ import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
|
19
19
|
import Label from '../Label/Label.js';
|
|
20
20
|
import getValueIndex from '../../getValueIndex.js';
|
|
21
21
|
import getUniqueValues from '../../getUniqueValues.js';
|
|
22
|
-
const CheckboxSelector = ({ blockId
|
|
22
|
+
const CheckboxSelector = ({ blockId, components, events, loading, properties, required, validation, value, methods })=>{
|
|
23
23
|
const uniqueValueOptions = getUniqueValues(properties.options || []);
|
|
24
24
|
return /*#__PURE__*/ React.createElement(Label, {
|
|
25
25
|
blockId: blockId,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import { Checkbox, Space } from 'antd';
|
|
17
17
|
import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
18
18
|
import Label from '../Label/Label.js';
|
|
19
|
-
const CheckboxSwitch = ({ blockId
|
|
19
|
+
const CheckboxSwitch = ({ blockId, components, events, loading, properties, required, validation, value, methods })=>{
|
|
20
20
|
return /*#__PURE__*/ React.createElement(Label, {
|
|
21
21
|
blockId: blockId,
|
|
22
22
|
components: components,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 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,25 +12,11 @@
|
|
|
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
|
-
_extends = Object.assign || function(target) {
|
|
17
|
-
for(var i = 1; i < arguments.length; i++){
|
|
18
|
-
var source = arguments[i];
|
|
19
|
-
for(var key in source){
|
|
20
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
21
|
-
target[key] = source[key];
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return target;
|
|
26
|
-
};
|
|
27
|
-
return _extends.apply(this, arguments);
|
|
28
|
-
}
|
|
29
|
-
import React from 'react';
|
|
15
|
+
*/ import React from 'react';
|
|
30
16
|
import { Collapse } from 'antd';
|
|
31
17
|
import { serializer, type } from '@lowdefy/helpers';
|
|
32
18
|
import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
33
|
-
const CollapseBlock = ({ blockId
|
|
19
|
+
const CollapseBlock = ({ blockId, events, content, components: { Icon }, methods, properties })=>{
|
|
34
20
|
const panels = properties.panels || Object.keys(content).sort().map((key)=>({
|
|
35
21
|
key,
|
|
36
22
|
title: key
|
|
@@ -45,7 +31,7 @@ const CollapseBlock = ({ blockId , events , content , components: { Icon } , me
|
|
|
45
31
|
name: propertiesIconExpand
|
|
46
32
|
};
|
|
47
33
|
}
|
|
48
|
-
return /*#__PURE__*/ React.createElement(Collapse,
|
|
34
|
+
return /*#__PURE__*/ React.createElement(Collapse, {
|
|
49
35
|
id: blockId,
|
|
50
36
|
defaultActiveKey: properties.defaultActiveKey || panels[0].key,
|
|
51
37
|
bordered: properties.bordered,
|
|
@@ -56,7 +42,7 @@ const CollapseBlock = ({ blockId , events , content , components: { Icon } , me
|
|
|
56
42
|
activeKey
|
|
57
43
|
}
|
|
58
44
|
}),
|
|
59
|
-
expandIcon: propertiesIconExpand && (({ isActive
|
|
45
|
+
expandIcon: propertiesIconExpand && (({ isActive })=>/*#__PURE__*/ React.createElement(Icon, {
|
|
60
46
|
blockId: `${blockId}_expandIcon`,
|
|
61
47
|
events: events,
|
|
62
48
|
properties: {
|
|
@@ -65,8 +51,9 @@ const CollapseBlock = ({ blockId , events , content , components: { Icon } , me
|
|
|
65
51
|
}
|
|
66
52
|
})),
|
|
67
53
|
expandIconPosition: properties.expandIconPosition,
|
|
68
|
-
destroyInactivePanel: properties.destroyInactivePanel
|
|
69
|
-
|
|
54
|
+
destroyInactivePanel: properties.destroyInactivePanel,
|
|
55
|
+
...additionalProps
|
|
56
|
+
}, panels.map((panel)=>/*#__PURE__*/ React.createElement(Collapse.Panel, {
|
|
70
57
|
extra: content[panel.extraKey] && content[panel.extraKey](),
|
|
71
58
|
collapsible: panel.disabled && 'disabled',
|
|
72
59
|
forceRender: properties.forceRender,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 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.
|
|
@@ -17,7 +17,7 @@ import { Comment } from 'antd';
|
|
|
17
17
|
import { type } from '@lowdefy/helpers';
|
|
18
18
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
19
19
|
import Avatar from '../Avatar/Avatar.js';
|
|
20
|
-
const CommentBlock = ({ blockId
|
|
20
|
+
const CommentBlock = ({ blockId, components, content, properties, methods })=>{
|
|
21
21
|
let avatar = {};
|
|
22
22
|
if (type.isObject(properties.avatar)) {
|
|
23
23
|
avatar = properties.avatar;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2024 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.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/ import React, { useEffect } from 'react';
|
|
16
16
|
import { Modal } from 'antd';
|
|
17
17
|
import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
18
|
-
const ConfirmModal = ({ blockId
|
|
18
|
+
const ConfirmModal = ({ blockId, events, content, components: { Icon }, methods, properties })=>{
|
|
19
19
|
useEffect(()=>{
|
|
20
20
|
methods.registerMethod('open', (args = {})=>{
|
|
21
21
|
const additionalProps = {};
|
|
@@ -36,14 +36,14 @@ const ConfirmModal = ({ blockId , events , content , components: { Icon } , met
|
|
|
36
36
|
methods
|
|
37
37
|
}),
|
|
38
38
|
bodyStyle: methods.makeCssClass(properties.bodyStyle, true),
|
|
39
|
-
content: content.content && content.content()
|
|
39
|
+
content: (content.content && content.content()) ?? renderHtml({
|
|
40
40
|
html: properties.content,
|
|
41
41
|
methods
|
|
42
42
|
}),
|
|
43
43
|
className: methods.makeCssClass(properties.modalStyle),
|
|
44
44
|
closable: properties.closable,
|
|
45
|
-
okText: properties.okText
|
|
46
|
-
okButtonProps: properties.okButton
|
|
45
|
+
okText: properties.okText ?? 'Ok',
|
|
46
|
+
okButtonProps: properties.okButton?.icon ? {
|
|
47
47
|
...properties.okButton,
|
|
48
48
|
icon: properties.okButton.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
49
49
|
blockId: `${blockId}_ok_icon`,
|
|
@@ -51,7 +51,7 @@ const ConfirmModal = ({ blockId , events , content , components: { Icon } , met
|
|
|
51
51
|
properties: properties.okButton.icon
|
|
52
52
|
})
|
|
53
53
|
} : properties.okButton,
|
|
54
|
-
cancelButtonProps: properties.cancelButton
|
|
54
|
+
cancelButtonProps: properties.cancelButton?.icon ? {
|
|
55
55
|
...properties.cancelButton,
|
|
56
56
|
icon: properties.cancelButton.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
57
57
|
blockId: `${blockId}_ok_icon`,
|
|
@@ -59,10 +59,10 @@ const ConfirmModal = ({ blockId , events , content , components: { Icon } , met
|
|
|
59
59
|
properties: properties.cancelButton.icon
|
|
60
60
|
})
|
|
61
61
|
} : properties.cancelButton,
|
|
62
|
-
cancelText: properties.cancelText
|
|
63
|
-
centered: properties.centered
|
|
62
|
+
cancelText: properties.cancelText ?? 'Cancel',
|
|
63
|
+
centered: properties.centered ?? false,
|
|
64
64
|
mask: properties.mask !== undefined ? properties.mask : true,
|
|
65
|
-
maskClosable: properties.maskClosable
|
|
65
|
+
maskClosable: properties.maskClosable ?? false,
|
|
66
66
|
width: properties.width,
|
|
67
67
|
zIndex: properties.zIndex,
|
|
68
68
|
onOk: async ()=>{
|