@lowdefy/blocks-antd 4.0.0-alpha.8 → 4.0.0-rc.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 -4
- package/dist/blocks/Affix/style.less +1 -1
- package/dist/blocks/Alert/Alert.js +19 -27
- package/dist/blocks/Alert/style.less +1 -1
- package/dist/blocks/AutoComplete/AutoComplete.js +17 -43
- package/dist/blocks/AutoComplete/schema.json +5 -46
- package/dist/blocks/AutoComplete/style.less +1 -1
- package/dist/blocks/Avatar/Avatar.js +3 -8
- package/dist/blocks/Avatar/schema.json +1 -1
- package/dist/blocks/Avatar/style.less +1 -1
- package/dist/blocks/Badge/Badge.js +2 -4
- package/dist/blocks/Badge/schema.json +1 -1
- package/dist/blocks/Badge/style.less +1 -1
- package/dist/blocks/Breadcrumb/Breadcrumb.js +20 -29
- package/dist/blocks/Breadcrumb/schema.json +1 -1
- package/dist/blocks/Breadcrumb/style.less +1 -1
- package/dist/blocks/Button/Button.js +11 -11
- package/dist/blocks/Button/schema.json +1 -1
- package/dist/blocks/Button/style.less +1 -1
- package/dist/blocks/ButtonSelector/ButtonSelector.js +5 -10
- package/dist/blocks/ButtonSelector/style.less +1 -1
- package/dist/blocks/Card/Card.js +3 -11
- package/dist/blocks/Card/style.less +1 -1
- package/dist/blocks/CheckboxSelector/CheckboxSelector.js +5 -10
- package/dist/blocks/CheckboxSelector/style.less +1 -1
- package/dist/blocks/CheckboxSwitch/CheckboxSwitch.js +4 -8
- package/dist/blocks/CheckboxSwitch/style.less +1 -1
- package/dist/blocks/Collapse/Collapse.js +20 -30
- package/dist/blocks/Collapse/schema.json +1 -1
- package/dist/blocks/Collapse/style.less +1 -1
- package/dist/blocks/Comment/Comment.js +3 -6
- package/dist/blocks/Comment/style.less +1 -1
- package/dist/blocks/ConfirmModal/ConfirmModal.js +19 -6
- package/dist/blocks/ConfirmModal/schema.json +1 -1
- package/dist/blocks/ConfirmModal/style.less +1 -1
- package/dist/blocks/Content/Content.js +2 -4
- package/dist/blocks/Content/style.less +1 -1
- package/dist/blocks/ControlledList/ControlledList.js +4 -10
- package/dist/blocks/ControlledList/style.less +1 -1
- package/dist/blocks/DateRangeSelector/DateRangeSelector.js +10 -17
- package/dist/blocks/DateRangeSelector/schema.json +1 -1
- package/dist/blocks/DateRangeSelector/style.less +1 -1
- package/dist/blocks/DateSelector/DateSelector.js +8 -12
- package/dist/blocks/DateSelector/schema.json +1 -1
- package/dist/blocks/DateSelector/style.less +1 -1
- package/dist/blocks/DateTimeSelector/DateTimeSelector.js +11 -13
- package/dist/blocks/DateTimeSelector/schema.json +1 -1
- package/dist/blocks/DateTimeSelector/style.less +1 -1
- package/dist/blocks/Descriptions/Descriptions.js +7 -15
- package/dist/blocks/Descriptions/style.less +1 -1
- package/dist/blocks/Divider/Divider.js +2 -9
- package/dist/blocks/Divider/style.less +1 -1
- package/dist/blocks/Drawer/Drawer.js +5 -8
- package/dist/blocks/Drawer/style.less +1 -1
- package/dist/blocks/Footer/Footer.js +2 -4
- package/dist/blocks/Footer/style.less +1 -1
- package/dist/blocks/Header/Header.js +2 -7
- package/dist/blocks/Header/schema.json +0 -4
- package/dist/blocks/Header/style.less +1 -1
- package/dist/blocks/Label/Label.js +30 -37
- package/dist/blocks/Label/getLabelCol.js +1 -1
- package/dist/blocks/Label/getWrapperCol.js +1 -1
- package/dist/blocks/Label/labelLogic.js +11 -11
- package/dist/blocks/Label/style.less +5 -1
- package/dist/blocks/Layout/Layout.js +2 -9
- package/dist/blocks/Layout/style.less +1 -1
- package/dist/blocks/Menu/Menu.js +59 -128
- package/dist/blocks/Menu/schema.json +1 -15
- package/dist/blocks/Menu/style.less +1 -1
- package/dist/blocks/Message/Message.js +4 -6
- package/dist/blocks/Message/schema.json +1 -1
- package/dist/blocks/Message/style.less +1 -1
- package/dist/blocks/MobileMenu/MobileMenu.js +6 -10
- package/dist/blocks/MobileMenu/schema.json +1 -15
- package/dist/blocks/MobileMenu/style.less +1 -1
- package/dist/blocks/Modal/Modal.js +20 -24
- package/dist/blocks/Modal/style.less +1 -1
- package/dist/blocks/MonthSelector/MonthSelector.js +7 -11
- package/dist/blocks/MonthSelector/schema.json +1 -1
- package/dist/blocks/MonthSelector/style.less +1 -1
- package/dist/blocks/MultipleSelector/MultipleSelector.js +8 -14
- package/dist/blocks/MultipleSelector/schema.json +3 -3
- package/dist/blocks/MultipleSelector/style.less +1 -1
- package/dist/blocks/Notification/Notification.js +5 -8
- package/dist/blocks/Notification/schema.json +2 -2
- package/dist/blocks/Notification/style.less +1 -1
- package/dist/blocks/NumberInput/NumberInput.js +6 -8
- package/dist/blocks/NumberInput/schema.json +7 -0
- package/dist/blocks/NumberInput/style.less +1 -1
- package/dist/blocks/PageHCF/PageHCF.js +2 -9
- package/dist/blocks/PageHCF/schema.json +0 -29
- package/dist/blocks/PageHCF/style.less +1 -1
- package/dist/blocks/PageHCSF/PageHCSF.js +2 -9
- package/dist/blocks/PageHCSF/schema.json +0 -30
- package/dist/blocks/PageHCSF/style.less +1 -1
- package/dist/blocks/PageHSCF/PageHSCF.js +2 -9
- package/dist/blocks/PageHSCF/schema.json +0 -30
- package/dist/blocks/PageHSCF/style.less +1 -1
- package/dist/blocks/PageHeaderMenu/PageHeaderMenu.js +44 -39
- package/dist/blocks/PageHeaderMenu/schema.json +6 -29
- package/dist/blocks/PageHeaderMenu/style.less +1 -1
- package/dist/blocks/PageSHCF/PageSHCF.js +2 -9
- package/dist/blocks/PageSHCF/schema.json +0 -30
- package/dist/blocks/PageSHCF/style.less +1 -1
- package/dist/blocks/PageSiderMenu/PageSiderMenu.js +42 -48
- package/dist/blocks/PageSiderMenu/schema.json +6 -36
- package/dist/blocks/PageSiderMenu/style.less +1 -1
- package/dist/blocks/Pagination/Pagination.js +6 -13
- package/dist/blocks/Pagination/style.less +1 -1
- package/dist/blocks/Paragraph/Paragraph.js +2 -6
- package/dist/blocks/Paragraph/style.less +2 -1
- package/dist/blocks/ParagraphInput/ParagraphInput.js +5 -8
- package/dist/blocks/ParagraphInput/style.less +1 -1
- package/dist/blocks/PasswordInput/PasswordInput.js +7 -10
- package/dist/blocks/PasswordInput/style.less +1 -1
- package/dist/blocks/Progress/Progress.js +2 -9
- package/dist/blocks/Progress/style.less +1 -1
- package/dist/blocks/RadioSelector/RadioSelector.js +8 -13
- package/dist/blocks/RadioSelector/style.less +1 -1
- package/dist/blocks/RatingSlider/RatingSlider.js +8 -13
- package/dist/blocks/RatingSlider/schema.json +2 -2
- package/dist/blocks/RatingSlider/style.less +1 -1
- package/dist/blocks/Result/Result.js +2 -9
- package/dist/blocks/Result/schema.json +1 -1
- package/dist/blocks/Result/style.less +1 -1
- package/dist/blocks/Selector/Selector.js +8 -14
- package/dist/blocks/Selector/schema.json +2 -2
- package/dist/blocks/Selector/style.less +1 -1
- package/dist/blocks/Sider/Sider.js +7 -11
- package/dist/blocks/Sider/schema.json +0 -7
- package/dist/blocks/Sider/style.less +1 -1
- package/dist/blocks/Statistic/Statistic.js +2 -9
- package/dist/blocks/Statistic/schema.json +2 -2
- package/dist/blocks/Statistic/style.less +1 -1
- package/dist/blocks/Switch/Switch.js +4 -9
- package/dist/blocks/Switch/schema.json +2 -2
- package/dist/blocks/Switch/style.less +1 -1
- package/dist/blocks/Tabs/Tabs.js +21 -32
- package/dist/blocks/Tabs/schema.json +1 -1
- package/dist/blocks/Tabs/style.less +1 -1
- package/dist/blocks/TextArea/TextArea.js +6 -10
- package/dist/blocks/TextArea/style.less +1 -1
- package/dist/blocks/TextInput/TextInput.js +9 -12
- package/dist/blocks/TextInput/schema.json +2 -2
- package/dist/blocks/TextInput/style.less +1 -1
- package/dist/blocks/TimelineList/TimelineList.js +19 -25
- package/dist/blocks/TimelineList/style.less +1 -1
- package/dist/blocks/Title/Title.js +3 -9
- package/dist/blocks/Title/style.less +2 -1
- package/dist/blocks/TitleInput/TitleInput.js +5 -11
- package/dist/blocks/TitleInput/style.less +1 -1
- package/dist/blocks/Tooltip/Tooltip.js +2 -9
- package/dist/blocks/Tooltip/style.less +1 -1
- package/dist/blocks/WeekSelector/WeekSelector.js +7 -11
- package/dist/blocks/WeekSelector/schema.json +1 -1
- package/dist/blocks/WeekSelector/style.less +1 -1
- package/dist/blocks.js +1 -1
- package/dist/color.js +1 -1
- package/dist/disabledDate.js +4 -7
- package/dist/getUniqueValues.js +1 -1
- package/dist/getValueIndex.js +1 -1
- package/dist/style.less +1 -1
- package/dist/types.js +1 -1
- package/dist/useRunAfterUpdate.js +1 -1
- package/dist/validationExamples.js +1 -1
- package/package.json +24 -24
|
@@ -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.
|
|
@@ -31,12 +31,10 @@ const AffixBlock = ({ blockId , content , methods , properties , rename })=>/*#
|
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
}, content.content && content.content())
|
|
35
|
-
;
|
|
34
|
+
}, content.content && content.content());
|
|
36
35
|
AffixBlock.defaultProps = blockDefaultProps;
|
|
37
36
|
AffixBlock.meta = {
|
|
38
37
|
category: 'container',
|
|
39
|
-
loading: false,
|
|
40
38
|
icons: [],
|
|
41
39
|
styles: [
|
|
42
40
|
'blocks/Affix/style.less'
|
|
@@ -1,5 +1,19 @@
|
|
|
1
|
+
function _extends() {
|
|
2
|
+
_extends = Object.assign || function(target) {
|
|
3
|
+
for(var i = 1; i < arguments.length; i++){
|
|
4
|
+
var source = arguments[i];
|
|
5
|
+
for(var key in source){
|
|
6
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
7
|
+
target[key] = source[key];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return target;
|
|
12
|
+
};
|
|
13
|
+
return _extends.apply(this, arguments);
|
|
14
|
+
}
|
|
1
15
|
/*
|
|
2
|
-
Copyright 2020-
|
|
16
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
17
|
|
|
4
18
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
19
|
you may not use this file except in compliance with the License.
|
|
@@ -16,20 +30,6 @@
|
|
|
16
30
|
import { Alert } from 'antd';
|
|
17
31
|
import { blockDefaultProps, renderHtml } from '@lowdefy/block-utils';
|
|
18
32
|
import { type } from '@lowdefy/helpers';
|
|
19
|
-
function _extends() {
|
|
20
|
-
_extends = Object.assign || function(target) {
|
|
21
|
-
for(var i = 1; i < arguments.length; i++){
|
|
22
|
-
var source = arguments[i];
|
|
23
|
-
for(var key in source){
|
|
24
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
25
|
-
target[key] = source[key];
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return target;
|
|
30
|
-
};
|
|
31
|
-
return _extends.apply(this, arguments);
|
|
32
|
-
}
|
|
33
33
|
const AlertBlock = ({ blockId , content , events , components: { Icon } , methods , properties })=>{
|
|
34
34
|
const additionalProps = {};
|
|
35
35
|
if (properties.icon) {
|
|
@@ -39,12 +39,11 @@ const AlertBlock = ({ blockId , content , events , components: { Icon } , metho
|
|
|
39
39
|
properties: properties.icon
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
return
|
|
42
|
+
return /*#__PURE__*/ React.createElement(Alert, _extends({
|
|
43
43
|
action: content.action && content.action(),
|
|
44
44
|
afterClose: ()=>methods.triggerEvent({
|
|
45
45
|
name: 'afterClose'
|
|
46
|
-
})
|
|
47
|
-
,
|
|
46
|
+
}),
|
|
48
47
|
banner: properties.banner,
|
|
49
48
|
closable: properties.closable,
|
|
50
49
|
closeText: properties.closeText,
|
|
@@ -63,21 +62,14 @@ const AlertBlock = ({ blockId , content , events , components: { Icon } , metho
|
|
|
63
62
|
}),
|
|
64
63
|
onClose: ()=>methods.triggerEvent({
|
|
65
64
|
name: 'onClose'
|
|
66
|
-
})
|
|
67
|
-
,
|
|
65
|
+
}),
|
|
68
66
|
showIcon: properties.showIcon === false ? false : true,
|
|
69
67
|
type: properties.type
|
|
70
|
-
}, additionalProps))
|
|
68
|
+
}, additionalProps));
|
|
71
69
|
};
|
|
72
70
|
AlertBlock.defaultProps = blockDefaultProps;
|
|
73
71
|
AlertBlock.meta = {
|
|
74
72
|
category: 'container',
|
|
75
|
-
loading: {
|
|
76
|
-
type: 'Skeleton',
|
|
77
|
-
properties: {
|
|
78
|
-
height: 40
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
73
|
icons: [],
|
|
82
74
|
styles: [
|
|
83
75
|
'blocks/Alert/style.less'
|
|
@@ -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,14 +14,12 @@
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import React from 'react';
|
|
16
16
|
import { AutoComplete } from 'antd';
|
|
17
|
-
import { blockDefaultProps
|
|
17
|
+
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
18
18
|
import { type } from '@lowdefy/helpers';
|
|
19
19
|
import Label from '../Label/Label.js';
|
|
20
|
-
import getUniqueValues from '../../getUniqueValues.js';
|
|
21
20
|
const Option = AutoComplete.Option;
|
|
22
21
|
const AutoCompleteInput = ({ blockId , components , events , loading , methods , properties , required , validation , value , })=>{
|
|
23
|
-
|
|
24
|
-
return(/*#__PURE__*/ React.createElement(Label, {
|
|
22
|
+
return /*#__PURE__*/ React.createElement(Label, {
|
|
25
23
|
blockId: blockId,
|
|
26
24
|
components: components,
|
|
27
25
|
events: events,
|
|
@@ -32,27 +30,26 @@ const AutoCompleteInput = ({ blockId , components , events , loading , methods ,
|
|
|
32
30
|
},
|
|
33
31
|
validation: validation,
|
|
34
32
|
required: required,
|
|
35
|
-
loading: loading,
|
|
36
33
|
content: {
|
|
37
34
|
content: ()=>/*#__PURE__*/ React.createElement(AutoComplete, {
|
|
38
35
|
id: `${blockId}_input`,
|
|
39
36
|
autoFocus: properties.autoFocus,
|
|
40
37
|
backfill: properties.backfill,
|
|
41
38
|
bordered: properties.bordered,
|
|
42
|
-
className: methods.makeCssClass(
|
|
39
|
+
className: methods.makeCssClass([
|
|
40
|
+
{
|
|
41
|
+
width: '100%'
|
|
42
|
+
},
|
|
43
|
+
properties.inputStyle
|
|
44
|
+
]),
|
|
43
45
|
defaultOpen: properties.defaultOpen,
|
|
44
|
-
disabled: properties.disabled,
|
|
46
|
+
disabled: properties.disabled || loading,
|
|
45
47
|
placeholder: properties.placeholder || 'Type or select item',
|
|
46
48
|
allowClear: properties.allowClear !== false,
|
|
47
49
|
size: properties.size,
|
|
48
|
-
filterOption: (input, option)
|
|
49
|
-
,
|
|
50
|
+
filterOption: (input, option)=>`${option.value}`.toLowerCase().indexOf(input.toLowerCase()) >= 0,
|
|
50
51
|
onChange: (newVal)=>{
|
|
51
|
-
|
|
52
|
-
if (type.isNone(val)) {
|
|
53
|
-
val = newVal;
|
|
54
|
-
}
|
|
55
|
-
methods.setValue(val);
|
|
52
|
+
methods.setValue(newVal);
|
|
56
53
|
methods.triggerEvent({
|
|
57
54
|
name: 'onChange'
|
|
58
55
|
});
|
|
@@ -65,43 +62,20 @@ const AutoCompleteInput = ({ blockId , components , events , loading , methods ,
|
|
|
65
62
|
}
|
|
66
63
|
});
|
|
67
64
|
},
|
|
68
|
-
value: type.isNone(value) ? undefined : value
|
|
69
|
-
}, (properties.options || []).map((opt, i)
|
|
65
|
+
value: type.isNone(value) ? undefined : `${value}`
|
|
66
|
+
}, (properties.options || []).map((opt, i)=>/*#__PURE__*/ React.createElement(Option, {
|
|
70
67
|
className: methods.makeCssClass(properties.optionsStyle),
|
|
71
68
|
id: `${blockId}_${i}`,
|
|
72
69
|
key: i,
|
|
73
|
-
value: `${
|
|
74
|
-
},
|
|
75
|
-
html: `${opt}`,
|
|
76
|
-
methods
|
|
77
|
-
})) : /*#__PURE__*/ React.createElement(Option, {
|
|
78
|
-
className: methods.makeCssClass([
|
|
79
|
-
properties.optionsStyle,
|
|
80
|
-
opt.style
|
|
81
|
-
]),
|
|
82
|
-
disabled: opt.disabled,
|
|
83
|
-
filterstring: opt.filterString,
|
|
84
|
-
id: `${blockId}_${i}`,
|
|
85
|
-
key: i,
|
|
86
|
-
value: `${i}`
|
|
87
|
-
}, type.isNone(opt.label) ? renderHtml({
|
|
88
|
-
html: `${opt.value}`,
|
|
89
|
-
methods
|
|
90
|
-
}) : renderHtml({
|
|
91
|
-
html: opt.label,
|
|
92
|
-
methods
|
|
93
|
-
}))
|
|
94
|
-
))
|
|
70
|
+
value: `${opt}`
|
|
71
|
+
}, `${opt}`)))
|
|
95
72
|
}
|
|
96
|
-
})
|
|
73
|
+
});
|
|
97
74
|
};
|
|
98
75
|
AutoCompleteInput.defaultProps = blockDefaultProps;
|
|
99
76
|
AutoCompleteInput.meta = {
|
|
100
77
|
valueType: 'string',
|
|
101
78
|
category: 'input',
|
|
102
|
-
loading: {
|
|
103
|
-
type: 'SkeletonInput'
|
|
104
|
-
},
|
|
105
79
|
icons: [
|
|
106
80
|
...Label.meta.icons
|
|
107
81
|
],
|
|
@@ -101,52 +101,11 @@
|
|
|
101
101
|
},
|
|
102
102
|
"options": {
|
|
103
103
|
"default": [],
|
|
104
|
-
"
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
"type": "string"
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"type": "array",
|
|
114
|
-
"description": "Options can either be an array of string values, on an array of label, value pairs.",
|
|
115
|
-
"items": {
|
|
116
|
-
"type": "object",
|
|
117
|
-
"required": ["value"],
|
|
118
|
-
"properties": {
|
|
119
|
-
"label": {
|
|
120
|
-
"type": "string",
|
|
121
|
-
"description": "Value label shown to user - supports html."
|
|
122
|
-
},
|
|
123
|
-
"value": {
|
|
124
|
-
"description": "Value selected. Can be of any type.",
|
|
125
|
-
"type": "string",
|
|
126
|
-
"docs": {
|
|
127
|
-
"displayType": "yaml"
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
"disabled": {
|
|
131
|
-
"type": "boolean",
|
|
132
|
-
"default": false,
|
|
133
|
-
"description": "Disable the option if true."
|
|
134
|
-
},
|
|
135
|
-
"filterString": {
|
|
136
|
-
"type": "string",
|
|
137
|
-
"description": "String to match against when filtering selector options during. If no filterString is provided the filter method matches against options.label."
|
|
138
|
-
},
|
|
139
|
-
"style": {
|
|
140
|
-
"type": "object",
|
|
141
|
-
"description": "Css style to applied to option.",
|
|
142
|
-
"docs": {
|
|
143
|
-
"displayType": "yaml"
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
]
|
|
104
|
+
"type": "array",
|
|
105
|
+
"description": "Options can either be an array of string values.",
|
|
106
|
+
"items": {
|
|
107
|
+
"type": "string"
|
|
108
|
+
}
|
|
150
109
|
},
|
|
151
110
|
"optionsStyle": {
|
|
152
111
|
"type": "object",
|
|
@@ -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.
|
|
@@ -24,8 +24,7 @@ const AvatarBlock = ({ blockId , events , components: { Icon } , methods , prop
|
|
|
24
24
|
src: properties.src,
|
|
25
25
|
onClick: ()=>methods.triggerEvent({
|
|
26
26
|
name: 'onClick'
|
|
27
|
-
})
|
|
28
|
-
,
|
|
27
|
+
}),
|
|
29
28
|
className: methods.makeCssClass([
|
|
30
29
|
{
|
|
31
30
|
backgroundColor: !properties.src && properties.color,
|
|
@@ -38,14 +37,10 @@ const AvatarBlock = ({ blockId , events , components: { Icon } , methods , prop
|
|
|
38
37
|
events: events,
|
|
39
38
|
properties: properties.icon
|
|
40
39
|
})
|
|
41
|
-
}, properties.content)
|
|
42
|
-
;
|
|
40
|
+
}, properties.content);
|
|
43
41
|
AvatarBlock.defaultProps = blockDefaultProps;
|
|
44
42
|
AvatarBlock.meta = {
|
|
45
43
|
category: 'display',
|
|
46
|
-
loading: {
|
|
47
|
-
type: 'SkeletonAvatar'
|
|
48
|
-
},
|
|
49
44
|
icons: [],
|
|
50
45
|
styles: [
|
|
51
46
|
'blocks/Avatar/style.less'
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"icon": {
|
|
27
27
|
"type": ["string", "object"],
|
|
28
|
-
"description": "Name of an
|
|
28
|
+
"description": "Name of an React-Icon (See <a href='https://react-icons.github.io/react-icons/'>all icons</a>) or properties of an Icon block to use an icon in avatar.",
|
|
29
29
|
"docs": {
|
|
30
30
|
"displayType": "icon"
|
|
31
31
|
}
|
|
@@ -1,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.
|
|
@@ -32,12 +32,10 @@ const BadgeBlock = ({ blockId , events , content , components: { Icon } , prope
|
|
|
32
32
|
events: events,
|
|
33
33
|
properties: properties.icon
|
|
34
34
|
}) || properties.count
|
|
35
|
-
}, content.content && content.content())
|
|
36
|
-
;
|
|
35
|
+
}, content.content && content.content());
|
|
37
36
|
BadgeBlock.defaultProps = blockDefaultProps;
|
|
38
37
|
BadgeBlock.meta = {
|
|
39
38
|
category: 'container',
|
|
40
|
-
loading: false,
|
|
41
39
|
icons: [],
|
|
42
40
|
styles: [
|
|
43
41
|
'blocks/Badge/style.less'
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"icon": {
|
|
33
33
|
"type": ["string", "object"],
|
|
34
|
-
"description": "Name of an
|
|
34
|
+
"description": "Name of an React-Icon (See <a href='https://react-icons.github.io/react-icons/'>all icons</a>) or properties of an Icon block to use an icon in badge.",
|
|
35
35
|
"docs": {
|
|
36
36
|
"displayType": "icon"
|
|
37
37
|
}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
|
+
function _extends() {
|
|
2
|
+
_extends = Object.assign || function(target) {
|
|
3
|
+
for(var i = 1; i < arguments.length; i++){
|
|
4
|
+
var source = arguments[i];
|
|
5
|
+
for(var key in source){
|
|
6
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
7
|
+
target[key] = source[key];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return target;
|
|
12
|
+
};
|
|
13
|
+
return _extends.apply(this, arguments);
|
|
14
|
+
}
|
|
1
15
|
/*
|
|
2
|
-
Copyright 2020-
|
|
16
|
+
Copyright 2020-2022 Lowdefy, Inc
|
|
3
17
|
|
|
4
18
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
19
|
you may not use this file except in compliance with the License.
|
|
@@ -16,25 +30,11 @@
|
|
|
16
30
|
import { type, get } from '@lowdefy/helpers';
|
|
17
31
|
import { Breadcrumb } from 'antd';
|
|
18
32
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
19
|
-
function _extends() {
|
|
20
|
-
_extends = Object.assign || function(target) {
|
|
21
|
-
for(var i = 1; i < arguments.length; i++){
|
|
22
|
-
var source = arguments[i];
|
|
23
|
-
for(var key in source){
|
|
24
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
25
|
-
target[key] = source[key];
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return target;
|
|
30
|
-
};
|
|
31
|
-
return _extends.apply(this, arguments);
|
|
32
|
-
}
|
|
33
33
|
const BreadcrumbBlock = ({ blockId , events , components: { Icon , Link } , methods , properties , rename , })=>{
|
|
34
34
|
const onClickActionName = get(rename, 'events.onClick', {
|
|
35
35
|
default: 'onClick'
|
|
36
36
|
});
|
|
37
|
-
return
|
|
37
|
+
return /*#__PURE__*/ React.createElement(Breadcrumb, {
|
|
38
38
|
id: blockId,
|
|
39
39
|
separator: properties.separator,
|
|
40
40
|
className: methods.makeCssClass(properties.style)
|
|
@@ -46,8 +46,7 @@ const BreadcrumbBlock = ({ blockId , events , components: { Icon , Link } , met
|
|
|
46
46
|
link,
|
|
47
47
|
index
|
|
48
48
|
}
|
|
49
|
-
})
|
|
50
|
-
)
|
|
49
|
+
}))
|
|
51
50
|
}, /*#__PURE__*/ React.createElement(Link, _extends({
|
|
52
51
|
id: `${blockId}_${index}`,
|
|
53
52
|
className: methods.makeCssClass([
|
|
@@ -56,30 +55,22 @@ const BreadcrumbBlock = ({ blockId , events , components: { Icon , Link } , met
|
|
|
56
55
|
},
|
|
57
56
|
link.style,
|
|
58
57
|
])
|
|
59
|
-
}, link), (
|
|
58
|
+
}, link), ()=>/*#__PURE__*/ React.createElement(React.Fragment, null, link.icon && /*#__PURE__*/ React.createElement(Icon, {
|
|
60
59
|
blockId: `${blockId}_${index}_icon`,
|
|
61
60
|
events: events,
|
|
62
61
|
properties: {
|
|
63
62
|
name: type.isString(link.icon) && link.icon,
|
|
64
63
|
...type.isObject(link.icon) ? link.icon : {},
|
|
65
64
|
style: {
|
|
66
|
-
|
|
65
|
+
marginRight: 8,
|
|
67
66
|
...link.icon.style || {}
|
|
68
67
|
}
|
|
69
68
|
}
|
|
70
|
-
}), type.isString(link) ? link : link.label
|
|
71
|
-
))
|
|
72
|
-
)));
|
|
69
|
+
}), type.isString(link) ? link : link.label)))));
|
|
73
70
|
};
|
|
74
71
|
BreadcrumbBlock.defaultProps = blockDefaultProps;
|
|
75
72
|
BreadcrumbBlock.meta = {
|
|
76
73
|
category: 'display',
|
|
77
|
-
loading: {
|
|
78
|
-
type: 'SkeletonParagraph',
|
|
79
|
-
properties: {
|
|
80
|
-
lines: 1
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
74
|
icons: [],
|
|
84
75
|
styles: [
|
|
85
76
|
'blocks/Breadcrumb/style.less'
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"icon": {
|
|
55
55
|
"type": ["string", "object"],
|
|
56
|
-
"description": "Name of an
|
|
56
|
+
"description": "Name of an React-Icon (See <a href='https://react-icons.github.io/react-icons/'>all icons</a>) or properties of an Icon block to use an icon in breadcrumb link.",
|
|
57
57
|
"docs": {
|
|
58
58
|
"displayType": "icon"
|
|
59
59
|
}
|
|
@@ -1,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.
|
|
@@ -17,11 +17,11 @@ 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
|
});
|
|
24
|
-
return
|
|
24
|
+
return /*#__PURE__*/ React.createElement(Button, {
|
|
25
25
|
block: properties.block,
|
|
26
26
|
className: methods.makeCssClass([
|
|
27
27
|
{
|
|
@@ -34,16 +34,20 @@ const ButtonBlock = ({ blockId , events , loading , components: { Icon } , meth
|
|
|
34
34
|
'&:hover': properties.color && {
|
|
35
35
|
backgroundColor: color(properties.color, 5),
|
|
36
36
|
borderColor: color(properties.color, 5)
|
|
37
|
+
},
|
|
38
|
+
'&:focus': properties.color && {
|
|
39
|
+
backgroundColor: properties.color,
|
|
40
|
+
borderColor: properties.color
|
|
37
41
|
}
|
|
38
42
|
},
|
|
39
43
|
properties.style,
|
|
40
44
|
]),
|
|
41
|
-
disabled: properties.disabled || get(events, `${onClickActionName}.loading`),
|
|
45
|
+
disabled: properties.disabled || get(events, `${onClickActionName}.loading`) || loading,
|
|
42
46
|
ghost: properties.ghost,
|
|
43
47
|
danger: properties.danger,
|
|
44
48
|
href: properties.href,
|
|
45
49
|
id: blockId,
|
|
46
|
-
loading:
|
|
50
|
+
loading: get(events, `${onClickActionName}.loading`),
|
|
47
51
|
shape: properties.shape,
|
|
48
52
|
size: properties.size,
|
|
49
53
|
type: get(properties, 'type', {
|
|
@@ -56,19 +60,15 @@ const ButtonBlock = ({ blockId , events , loading , components: { Icon } , meth
|
|
|
56
60
|
}),
|
|
57
61
|
onClick: onClick || (()=>methods.triggerEvent({
|
|
58
62
|
name: onClickActionName
|
|
59
|
-
})
|
|
60
|
-
)
|
|
63
|
+
}))
|
|
61
64
|
}, !properties.hideTitle && renderHtml({
|
|
62
65
|
html: type.isNone(properties.title) ? blockId : properties.title,
|
|
63
66
|
methods
|
|
64
|
-
}))
|
|
67
|
+
}));
|
|
65
68
|
};
|
|
66
69
|
ButtonBlock.defaultProps = blockDefaultProps;
|
|
67
70
|
ButtonBlock.meta = {
|
|
68
71
|
category: 'display',
|
|
69
|
-
loading: {
|
|
70
|
-
type: 'SkeletonButton'
|
|
71
|
-
},
|
|
72
72
|
icons: [],
|
|
73
73
|
styles: [
|
|
74
74
|
'blocks/Button/style.less'
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"icon": {
|
|
44
44
|
"type": ["string", "object"],
|
|
45
|
-
"description": "Name of an
|
|
45
|
+
"description": "Name of an React-Icon (See <a href='https://react-icons.github.io/react-icons/'>all icons</a>) or properties of an Icon block to use icon in button.",
|
|
46
46
|
"docs": {
|
|
47
47
|
"displayType": "icon"
|
|
48
48
|
}
|
|
@@ -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.
|
|
@@ -21,7 +21,7 @@ import getValueIndex from '../../getValueIndex.js';
|
|
|
21
21
|
import getUniqueValues from '../../getUniqueValues.js';
|
|
22
22
|
const ButtonSelector = ({ blockId , components , events , loading , properties , required , validation , value , methods , })=>{
|
|
23
23
|
const uniqueValueOptions = getUniqueValues(properties.options || []);
|
|
24
|
-
return
|
|
24
|
+
return /*#__PURE__*/ React.createElement(Label, {
|
|
25
25
|
blockId: blockId,
|
|
26
26
|
components: components,
|
|
27
27
|
events: events,
|
|
@@ -32,7 +32,6 @@ const ButtonSelector = ({ blockId , components , events , loading , properties ,
|
|
|
32
32
|
},
|
|
33
33
|
validation: validation,
|
|
34
34
|
required: required,
|
|
35
|
-
loading: loading,
|
|
36
35
|
content: {
|
|
37
36
|
content: ()=>/*#__PURE__*/ React.createElement(Radio.Group, {
|
|
38
37
|
id: `${blockId}_input`,
|
|
@@ -45,7 +44,7 @@ const ButtonSelector = ({ blockId , components , events , loading , properties ,
|
|
|
45
44
|
},
|
|
46
45
|
properties.inputStyle,
|
|
47
46
|
]),
|
|
48
|
-
disabled: properties.disabled,
|
|
47
|
+
disabled: properties.disabled || loading,
|
|
49
48
|
size: properties.size,
|
|
50
49
|
buttonStyle: properties.buttonStyle ? properties.buttonStyle : 'solid',
|
|
51
50
|
onChange: (event)=>{
|
|
@@ -74,18 +73,14 @@ const ButtonSelector = ({ blockId , components , events , loading , properties ,
|
|
|
74
73
|
}) : renderHtml({
|
|
75
74
|
html: opt.label,
|
|
76
75
|
methods
|
|
77
|
-
}))
|
|
78
|
-
))
|
|
76
|
+
}))))
|
|
79
77
|
}
|
|
80
|
-
})
|
|
78
|
+
});
|
|
81
79
|
};
|
|
82
80
|
ButtonSelector.defaultProps = blockDefaultProps;
|
|
83
81
|
ButtonSelector.meta = {
|
|
84
82
|
valueType: 'any',
|
|
85
83
|
category: 'input',
|
|
86
|
-
loading: {
|
|
87
|
-
type: 'SkeletonInput'
|
|
88
|
-
},
|
|
89
84
|
icons: [
|
|
90
85
|
...Label.meta.icons
|
|
91
86
|
],
|