@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,46 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2021 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 {
|
|
16
|
-
import: {
|
|
17
|
-
block: 'blocks/PageHSCF/PageHSCF.js',
|
|
18
|
-
styles: [
|
|
19
|
-
'blocks/PageHSCF/style.less'
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
meta: {
|
|
23
|
-
category: 'container',
|
|
24
|
-
loading: {
|
|
25
|
-
type: 'Spinner',
|
|
26
|
-
properties: {
|
|
27
|
-
height: '100vh'
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
test: {
|
|
32
|
-
methods: [
|
|
33
|
-
{
|
|
34
|
-
name: 'toggleSiderOpen',
|
|
35
|
-
args: {
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
name: 'setSiderOpen',
|
|
40
|
-
args: {
|
|
41
|
-
open: true
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
]
|
|
45
|
-
}
|
|
46
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2021 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 {
|
|
16
|
-
import: {
|
|
17
|
-
block: 'blocks/PageHeaderMenu/PageHeaderMenu.js',
|
|
18
|
-
styles: [
|
|
19
|
-
'blocks/PageHeaderMenu/style.less'
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
meta: {
|
|
23
|
-
category: 'container',
|
|
24
|
-
loading: {
|
|
25
|
-
type: 'Spinner',
|
|
26
|
-
properties: {
|
|
27
|
-
height: '100vh'
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
test: {
|
|
32
|
-
methods: [
|
|
33
|
-
{
|
|
34
|
-
name: 'toggleOpen',
|
|
35
|
-
args: {
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
name: 'setOpen',
|
|
40
|
-
args: {
|
|
41
|
-
open: true
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
]
|
|
45
|
-
}
|
|
46
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2021 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 {
|
|
16
|
-
import: {
|
|
17
|
-
block: 'blocks/PageSHCF/PageSHCF.js',
|
|
18
|
-
styles: [
|
|
19
|
-
'blocks/PageSHCF/style.less'
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
meta: {
|
|
23
|
-
category: 'container',
|
|
24
|
-
loading: {
|
|
25
|
-
type: 'Spinner',
|
|
26
|
-
properties: {
|
|
27
|
-
height: '100vh'
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
test: {
|
|
32
|
-
methods: [
|
|
33
|
-
{
|
|
34
|
-
name: 'toggleSiderOpen',
|
|
35
|
-
args: {
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
name: 'setSiderOpen',
|
|
40
|
-
args: {
|
|
41
|
-
open: true
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
]
|
|
45
|
-
}
|
|
46
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2021 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 {
|
|
16
|
-
import: {
|
|
17
|
-
block: 'blocks/PageSiderMenu/PageSiderMenu.js',
|
|
18
|
-
styles: [
|
|
19
|
-
'blocks/PageSiderMenu/style.less'
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
meta: {
|
|
23
|
-
category: 'container',
|
|
24
|
-
loading: {
|
|
25
|
-
type: 'Spinner',
|
|
26
|
-
properties: {
|
|
27
|
-
height: '100vh'
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
test: {
|
|
32
|
-
methods: [
|
|
33
|
-
{
|
|
34
|
-
name: 'toggleMobileMenuOpen',
|
|
35
|
-
args: {
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
name: 'setMobileMenuOpen',
|
|
40
|
-
args: {
|
|
41
|
-
open: true
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
name: 'toggleSiderOpen',
|
|
46
|
-
args: {
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
name: 'setSiderOpen',
|
|
51
|
-
args: {
|
|
52
|
-
open: true
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2021 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 {
|
|
16
|
-
import: {
|
|
17
|
-
block: 'blocks/Pagination/Pagination.js',
|
|
18
|
-
styles: [
|
|
19
|
-
'blocks/Pagination/style.less'
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
meta: {
|
|
23
|
-
valueType: 'object',
|
|
24
|
-
initValue: {
|
|
25
|
-
current: 0,
|
|
26
|
-
pageSize: 10,
|
|
27
|
-
skip: 0
|
|
28
|
-
},
|
|
29
|
-
category: 'input',
|
|
30
|
-
loading: {
|
|
31
|
-
type: 'Skeleton',
|
|
32
|
-
properties: {
|
|
33
|
-
height: 33
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2021 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 {
|
|
16
|
-
import: {
|
|
17
|
-
block: 'blocks/Paragraph/Paragraph.js',
|
|
18
|
-
styles: [
|
|
19
|
-
'blocks/Paragraph/style.less'
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
meta: {
|
|
23
|
-
category: 'display',
|
|
24
|
-
loading: {
|
|
25
|
-
type: 'SkeletonParagraph'
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2021 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 {
|
|
16
|
-
import: {
|
|
17
|
-
block: 'blocks/ParagraphInput/ParagraphInput.js',
|
|
18
|
-
styles: [
|
|
19
|
-
'blocks/ParagraphInput/style.less'
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
meta: {
|
|
23
|
-
valueType: 'string',
|
|
24
|
-
category: 'input',
|
|
25
|
-
loading: {
|
|
26
|
-
type: 'SkeletonParagraph'
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
test: {
|
|
30
|
-
validation: true,
|
|
31
|
-
required: true,
|
|
32
|
-
values: [
|
|
33
|
-
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
|
|
34
|
-
]
|
|
35
|
-
}
|
|
36
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2021 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 {
|
|
16
|
-
import: {
|
|
17
|
-
block: 'blocks/PasswordInput/PasswordInput.js',
|
|
18
|
-
styles: [
|
|
19
|
-
'blocks/PasswordInput/style.less'
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
meta: {
|
|
23
|
-
valueType: 'string',
|
|
24
|
-
category: 'input',
|
|
25
|
-
loading: {
|
|
26
|
-
type: 'SkeletonInput'
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
test: {
|
|
30
|
-
validation: true,
|
|
31
|
-
required: true
|
|
32
|
-
}
|
|
33
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2021 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 {
|
|
16
|
-
import: {
|
|
17
|
-
block: 'blocks/Progress/Progress.js',
|
|
18
|
-
styles: [
|
|
19
|
-
'blocks/Progress/style.less'
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
meta: {
|
|
23
|
-
category: 'display',
|
|
24
|
-
loading: {
|
|
25
|
-
type: 'Skeleton',
|
|
26
|
-
properties: {
|
|
27
|
-
height: 40
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2021 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 {
|
|
16
|
-
import: {
|
|
17
|
-
block: 'blocks/RadioSelector/RadioSelector.js',
|
|
18
|
-
styles: [
|
|
19
|
-
'blocks/RadioSelector/style.less'
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
meta: {
|
|
23
|
-
valueType: 'any',
|
|
24
|
-
category: 'input',
|
|
25
|
-
loading: {
|
|
26
|
-
type: 'SkeletonInput'
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
test: {
|
|
30
|
-
validation: true,
|
|
31
|
-
required: true
|
|
32
|
-
}
|
|
33
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2021 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 {
|
|
16
|
-
import: {
|
|
17
|
-
block: 'blocks/RatingSlider/RatingSlider.js',
|
|
18
|
-
styles: [
|
|
19
|
-
'blocks/RatingSlider/style.less'
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
meta: {
|
|
23
|
-
valueType: 'any',
|
|
24
|
-
category: 'input',
|
|
25
|
-
loading: {
|
|
26
|
-
type: 'SkeletonInput'
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
test: {
|
|
30
|
-
validation: true,
|
|
31
|
-
required: true
|
|
32
|
-
}
|
|
33
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2021 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 {
|
|
16
|
-
import: {
|
|
17
|
-
block: 'blocks/Result/Result.js',
|
|
18
|
-
styles: [
|
|
19
|
-
'blocks/Result/style.less'
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
meta: {
|
|
23
|
-
category: 'container',
|
|
24
|
-
loading: {
|
|
25
|
-
type: 'Spinner',
|
|
26
|
-
properties: {
|
|
27
|
-
height: '100vh'
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
};
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/*
|
|
3
|
-
Copyright 2020-2021 Lowdefy, Inc
|
|
4
|
-
|
|
5
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
you may not use this file except in compliance with the License.
|
|
7
|
-
You may obtain a copy of the License at
|
|
8
|
-
|
|
9
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
|
|
11
|
-
Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
See the License for the specific language governing permissions and
|
|
15
|
-
limitations under the License.
|
|
16
|
-
*/ import React, { useEffect, useState } from 'react';
|
|
17
|
-
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
18
|
-
import { get } from '@lowdefy/helpers';
|
|
19
|
-
import { Upload } from 'antd';
|
|
20
|
-
import Button from '../Button/Button.js';
|
|
21
|
-
const makeFileValue = (file, s3Parameters)=>{
|
|
22
|
-
const { lastModified , name , percent , size , status , type , uid } = file;
|
|
23
|
-
const { bucket , key } = get(s3Parameters, uid, {
|
|
24
|
-
default: {
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
return {
|
|
28
|
-
bucket,
|
|
29
|
-
key,
|
|
30
|
-
lastModified,
|
|
31
|
-
name,
|
|
32
|
-
percent,
|
|
33
|
-
size,
|
|
34
|
-
status,
|
|
35
|
-
type,
|
|
36
|
-
uid
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
const makeOnChangeValue = (s3Parameters, changeEvent)=>{
|
|
40
|
-
const { file , fileList } = changeEvent;
|
|
41
|
-
return {
|
|
42
|
-
file: makeFileValue(file, s3Parameters),
|
|
43
|
-
fileList: fileList.map((fl)=>makeFileValue(fl, s3Parameters)
|
|
44
|
-
)
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
const getDisabled = ({ properties , value })=>{
|
|
48
|
-
if (properties.disabled) return true;
|
|
49
|
-
if (properties.singleFile && value && (value.fileList || []).length >= 1) {
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
return false;
|
|
53
|
-
};
|
|
54
|
-
const getCustomRequest = ({ methods , setS3Parameters })=>async ({ file , onError , onProgress , onSuccess })=>{
|
|
55
|
-
try {
|
|
56
|
-
const { name , size , type , uid } = file;
|
|
57
|
-
const s3PostPolicyResponse = await methods.triggerEvent({
|
|
58
|
-
name: '__getS3PostPolicy',
|
|
59
|
-
event: {
|
|
60
|
-
filename: name,
|
|
61
|
-
size,
|
|
62
|
-
type,
|
|
63
|
-
uid
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
if (s3PostPolicyResponse.success !== true) {
|
|
67
|
-
throw new Error('S3 post policy request error.');
|
|
68
|
-
}
|
|
69
|
-
const { url , fields } = s3PostPolicyResponse.responses.__getS3PostPolicy.response[0];
|
|
70
|
-
const { bucket , key } = fields;
|
|
71
|
-
setS3Parameters((prevState)=>{
|
|
72
|
-
const ret = {
|
|
73
|
-
...prevState
|
|
74
|
-
};
|
|
75
|
-
ret[uid] = {
|
|
76
|
-
bucket,
|
|
77
|
-
key
|
|
78
|
-
};
|
|
79
|
-
return ret;
|
|
80
|
-
});
|
|
81
|
-
// Set 20 % progress on policy is acquired else user waits to long before progress is reported
|
|
82
|
-
onProgress({
|
|
83
|
-
percent: 20
|
|
84
|
-
});
|
|
85
|
-
// Create FormData with all required fields in S3 policy
|
|
86
|
-
const formData = new FormData();
|
|
87
|
-
Object.keys(fields).forEach((field)=>{
|
|
88
|
-
formData.append(field, fields[field]);
|
|
89
|
-
});
|
|
90
|
-
// file needs to be the last field in the form
|
|
91
|
-
formData.append('file', file);
|
|
92
|
-
const xhr = new XMLHttpRequest();
|
|
93
|
-
xhr.upload.onprogress = (event)=>{
|
|
94
|
-
if (event.lengthComputable) {
|
|
95
|
-
onProgress({
|
|
96
|
-
percent: event.loaded / event.total * 80 + 20
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
xhr.addEventListener('error', onError);
|
|
101
|
-
xhr.addEventListener('load', onSuccess);
|
|
102
|
-
xhr.open('post', url);
|
|
103
|
-
xhr.send(formData);
|
|
104
|
-
} catch (error) {
|
|
105
|
-
console.error(error);
|
|
106
|
-
onError(error);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
;
|
|
110
|
-
const S3UploadButtonBlock = ({ blockId , components , events , methods , properties , value })=>{
|
|
111
|
-
// Use state here because we need to set s3 bucket and key as block value
|
|
112
|
-
// The customRequest function does not have access to the updated block value,
|
|
113
|
-
// so it cannot set the value directly. customRequest sets the parameters to s3Parameters state,
|
|
114
|
-
// and then onChange updates the block value.
|
|
115
|
-
const [s3Parameters, setS3Parameters] = useState(value);
|
|
116
|
-
const customRequest = getCustomRequest({
|
|
117
|
-
methods,
|
|
118
|
-
setS3Parameters
|
|
119
|
-
});
|
|
120
|
-
useEffect(()=>{
|
|
121
|
-
methods.setValue({
|
|
122
|
-
file: null,
|
|
123
|
-
fileList: []
|
|
124
|
-
});
|
|
125
|
-
methods.registerEvent({
|
|
126
|
-
name: '__getS3PostPolicy',
|
|
127
|
-
actions: [
|
|
128
|
-
{
|
|
129
|
-
id: '__getS3PostPolicy',
|
|
130
|
-
type: 'Request',
|
|
131
|
-
params: [
|
|
132
|
-
properties.s3PostPolicyRequestId
|
|
133
|
-
]
|
|
134
|
-
},
|
|
135
|
-
]
|
|
136
|
-
});
|
|
137
|
-
}, []);
|
|
138
|
-
const disabled = getDisabled({
|
|
139
|
-
properties,
|
|
140
|
-
value
|
|
141
|
-
});
|
|
142
|
-
return(/*#__PURE__*/ _jsx(Upload, {
|
|
143
|
-
accept: properties.accept,
|
|
144
|
-
customRequest: customRequest,
|
|
145
|
-
disabled: disabled,
|
|
146
|
-
id: blockId,
|
|
147
|
-
multiple: !properties.singleFile,
|
|
148
|
-
showUploadList: properties.showUploadList,
|
|
149
|
-
onChange: (event)=>{
|
|
150
|
-
methods.setValue(makeOnChangeValue(s3Parameters, event));
|
|
151
|
-
methods.triggerEvent({
|
|
152
|
-
name: 'onChange'
|
|
153
|
-
});
|
|
154
|
-
},
|
|
155
|
-
children: /*#__PURE__*/ _jsx(Button, {
|
|
156
|
-
blockId: `${blockId}_button`,
|
|
157
|
-
components: components,
|
|
158
|
-
events: events,
|
|
159
|
-
properties: {
|
|
160
|
-
disabled,
|
|
161
|
-
icon: 'UploadOutlined',
|
|
162
|
-
title: 'Upload',
|
|
163
|
-
type: 'default',
|
|
164
|
-
...properties.button
|
|
165
|
-
},
|
|
166
|
-
methods: methods
|
|
167
|
-
})
|
|
168
|
-
}));
|
|
169
|
-
};
|
|
170
|
-
S3UploadButtonBlock.defaultProps = blockDefaultProps;
|
|
171
|
-
export default S3UploadButtonBlock;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020-2021 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 {
|
|
16
|
-
import: {
|
|
17
|
-
block: 'blocks/S3UploadButton/S3UploadButton.js',
|
|
18
|
-
styles: [
|
|
19
|
-
'blocks/S3UploadButton/style.less'
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
meta: {
|
|
23
|
-
valueType: 'object',
|
|
24
|
-
category: 'input',
|
|
25
|
-
loading: {
|
|
26
|
-
type: 'SkeletonButton'
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
};
|