@lowdefy/blocks-antd 4.0.0-alpha.9 → 4.0.0-rc.1
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 -3
- package/dist/blocks/Affix/style.less +1 -1
- package/dist/blocks/Alert/Alert.js +10 -12
- package/dist/blocks/Alert/style.less +1 -1
- package/dist/blocks/AutoComplete/AutoComplete.js +17 -39
- package/dist/blocks/AutoComplete/schema.json +5 -46
- package/dist/blocks/AutoComplete/style.less +1 -1
- package/dist/blocks/Avatar/Avatar.js +4 -6
- package/dist/blocks/Avatar/style.less +1 -1
- package/dist/blocks/Badge/Badge.js +2 -3
- package/dist/blocks/Badge/style.less +1 -1
- package/dist/blocks/Breadcrumb/Breadcrumb.js +13 -16
- package/dist/blocks/Breadcrumb/style.less +1 -1
- package/dist/blocks/Button/Button.js +6 -7
- package/dist/blocks/Button/style.less +1 -1
- package/dist/blocks/ButtonSelector/ButtonSelector.js +6 -7
- package/dist/blocks/ButtonSelector/style.less +1 -1
- package/dist/blocks/Card/Card.js +4 -6
- package/dist/blocks/Card/style.less +1 -1
- package/dist/blocks/CheckboxSelector/CheckboxSelector.js +6 -7
- package/dist/blocks/CheckboxSelector/style.less +1 -1
- package/dist/blocks/CheckboxSwitch/CheckboxSwitch.js +5 -5
- package/dist/blocks/CheckboxSwitch/style.less +1 -1
- package/dist/blocks/Collapse/Collapse.js +11 -15
- package/dist/blocks/Collapse/style.less +1 -1
- package/dist/blocks/Comment/Comment.js +3 -3
- package/dist/blocks/Comment/style.less +1 -1
- package/dist/blocks/ConfirmModal/ConfirmModal.js +3 -3
- package/dist/blocks/ConfirmModal/style.less +1 -1
- package/dist/blocks/Content/Content.js +2 -3
- package/dist/blocks/Content/style.less +1 -1
- package/dist/blocks/ControlledList/ControlledList.js +5 -5
- package/dist/blocks/ControlledList/style.less +1 -1
- package/dist/blocks/DateRangeSelector/DateRangeSelector.js +11 -14
- package/dist/blocks/DateRangeSelector/style.less +1 -1
- package/dist/blocks/DateSelector/DateSelector.js +7 -7
- package/dist/blocks/DateSelector/style.less +1 -1
- package/dist/blocks/DateTimeSelector/DateTimeSelector.js +10 -8
- package/dist/blocks/DateTimeSelector/style.less +1 -1
- package/dist/blocks/Descriptions/Descriptions.js +13 -15
- package/dist/blocks/Descriptions/style.less +1 -1
- package/dist/blocks/Divider/Divider.js +2 -3
- package/dist/blocks/Divider/style.less +1 -1
- package/dist/blocks/Drawer/Drawer.js +5 -7
- package/dist/blocks/Drawer/style.less +1 -1
- package/dist/blocks/Footer/Footer.js +2 -3
- package/dist/blocks/Footer/style.less +1 -1
- package/dist/blocks/Header/Header.js +3 -4
- package/dist/blocks/Header/style.less +1 -1
- package/dist/blocks/Label/Label.js +23 -27
- package/dist/blocks/Label/getLabelCol.js +1 -1
- package/dist/blocks/Label/getWrapperCol.js +1 -1
- package/dist/blocks/Label/labelLogic.js +15 -15
- package/dist/blocks/Label/style.less +5 -1
- package/dist/blocks/Layout/Layout.js +2 -3
- package/dist/blocks/Layout/style.less +1 -1
- package/dist/blocks/Menu/Menu.js +49 -57
- package/dist/blocks/Menu/style.less +1 -1
- package/dist/blocks/Message/Message.js +4 -5
- package/dist/blocks/Message/style.less +1 -1
- package/dist/blocks/MobileMenu/MobileMenu.js +7 -9
- package/dist/blocks/MobileMenu/style.less +1 -1
- package/dist/blocks/Modal/Modal.js +11 -14
- package/dist/blocks/Modal/style.less +1 -1
- package/dist/blocks/MonthSelector/MonthSelector.js +7 -7
- package/dist/blocks/MonthSelector/style.less +1 -1
- package/dist/blocks/MultipleSelector/MultipleSelector.js +9 -11
- package/dist/blocks/MultipleSelector/style.less +1 -1
- package/dist/blocks/Notification/Notification.js +5 -7
- package/dist/blocks/Notification/style.less +1 -1
- package/dist/blocks/NumberInput/NumberInput.js +6 -4
- package/dist/blocks/NumberInput/schema.json +7 -0
- package/dist/blocks/NumberInput/style.less +1 -1
- package/dist/blocks/PageHCF/PageHCF.js +2 -3
- package/dist/blocks/PageHCF/style.less +1 -1
- package/dist/blocks/PageHCSF/PageHCSF.js +2 -3
- package/dist/blocks/PageHCSF/style.less +1 -1
- package/dist/blocks/PageHSCF/PageHSCF.js +2 -3
- package/dist/blocks/PageHSCF/style.less +1 -1
- package/dist/blocks/PageHeaderMenu/PageHeaderMenu.js +47 -35
- package/dist/blocks/PageHeaderMenu/schema.json +5 -5
- package/dist/blocks/PageHeaderMenu/style.less +1 -1
- package/dist/blocks/PageSHCF/PageSHCF.js +2 -3
- package/dist/blocks/PageSHCF/style.less +1 -1
- package/dist/blocks/PageSiderMenu/PageSiderMenu.js +45 -43
- package/dist/blocks/PageSiderMenu/schema.json +5 -5
- package/dist/blocks/PageSiderMenu/style.less +1 -1
- package/dist/blocks/Pagination/Pagination.js +4 -5
- package/dist/blocks/Pagination/style.less +1 -1
- package/dist/blocks/Paragraph/Paragraph.js +3 -4
- package/dist/blocks/Paragraph/style.less +2 -1
- package/dist/blocks/ParagraphInput/ParagraphInput.js +5 -5
- package/dist/blocks/ParagraphInput/style.less +1 -1
- package/dist/blocks/PasswordInput/PasswordInput.js +7 -6
- package/dist/blocks/PasswordInput/style.less +1 -1
- package/dist/blocks/Progress/Progress.js +2 -3
- package/dist/blocks/Progress/style.less +1 -1
- package/dist/blocks/RadioSelector/RadioSelector.js +9 -10
- package/dist/blocks/RadioSelector/style.less +1 -1
- package/dist/blocks/RatingSlider/RatingSlider.js +11 -13
- package/dist/blocks/RatingSlider/style.less +1 -1
- package/dist/blocks/Result/Result.js +2 -3
- package/dist/blocks/Result/style.less +1 -1
- package/dist/blocks/Selector/Selector.js +9 -11
- package/dist/blocks/Selector/style.less +1 -1
- package/dist/blocks/Sider/Sider.js +5 -7
- package/dist/blocks/Sider/style.less +1 -1
- package/dist/blocks/Statistic/Statistic.js +2 -3
- package/dist/blocks/Statistic/style.less +1 -1
- package/dist/blocks/Switch/Switch.js +5 -5
- package/dist/blocks/Switch/style.less +1 -1
- package/dist/blocks/Tabs/Tabs.js +11 -16
- package/dist/blocks/Tabs/style.less +1 -1
- package/dist/blocks/TextArea/TextArea.js +6 -6
- package/dist/blocks/TextArea/style.less +1 -1
- package/dist/blocks/TextInput/TextInput.js +9 -8
- package/dist/blocks/TextInput/style.less +1 -1
- package/dist/blocks/TimelineList/TimelineList.js +10 -10
- package/dist/blocks/TimelineList/style.less +1 -1
- package/dist/blocks/Title/Title.js +5 -5
- package/dist/blocks/Title/style.less +2 -1
- package/dist/blocks/TitleInput/TitleInput.js +6 -6
- package/dist/blocks/TitleInput/style.less +1 -1
- package/dist/blocks/Tooltip/Tooltip.js +2 -3
- package/dist/blocks/Tooltip/style.less +1 -1
- package/dist/blocks/WeekSelector/WeekSelector.js +7 -7
- 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 +2 -2
- package/package.json +28 -29
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 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.
|
|
@@ -25,8 +25,8 @@ import Layout from '../Layout/Layout.js';
|
|
|
25
25
|
import Menu from '../Menu/Menu.js';
|
|
26
26
|
import MobileMenu from '../MobileMenu/MobileMenu.js';
|
|
27
27
|
import Sider from '../Sider/Sider.js';
|
|
28
|
-
const PageSiderMenu = ({ basePath , blockId , components: { Icon , Link } , events , content , menus , methods , pageId , properties
|
|
29
|
-
const [openSiderState, setSiderOpen] = useState(!
|
|
28
|
+
const PageSiderMenu = ({ basePath , blockId , components: { Icon , Link } , events , content , menus , methods , pageId , properties })=>{
|
|
29
|
+
const [openSiderState, setSiderOpen] = useState(!properties.sider?.initialCollapsed);
|
|
30
30
|
useEffect(()=>{
|
|
31
31
|
methods.registerMethod('toggleSiderOpen', ()=>{
|
|
32
32
|
methods._toggleSiderOpen({
|
|
@@ -49,6 +49,9 @@ const PageSiderMenu = ({ basePath , blockId , components: { Icon , Link } , eve
|
|
|
49
49
|
display: 'flex',
|
|
50
50
|
alignItems: 'center',
|
|
51
51
|
padding: '0 46px',
|
|
52
|
+
xs: {
|
|
53
|
+
padding: '0 10px'
|
|
54
|
+
},
|
|
52
55
|
sm: {
|
|
53
56
|
padding: '0 15px'
|
|
54
57
|
},
|
|
@@ -69,11 +72,17 @@ const PageSiderMenu = ({ basePath , blockId , components: { Icon , Link } , eve
|
|
|
69
72
|
logo: {
|
|
70
73
|
margin: '0 30px 0 0',
|
|
71
74
|
flex: '0 1 auto',
|
|
75
|
+
width: 130,
|
|
76
|
+
xs: {
|
|
77
|
+
margin: '0 5px',
|
|
78
|
+
width: 40
|
|
79
|
+
},
|
|
72
80
|
sm: {
|
|
73
|
-
margin: '0 10px
|
|
81
|
+
margin: '0 10px',
|
|
82
|
+
width: 130
|
|
74
83
|
},
|
|
75
84
|
md: {
|
|
76
|
-
margin: '0 15px
|
|
85
|
+
margin: '0 15px'
|
|
77
86
|
}
|
|
78
87
|
},
|
|
79
88
|
desktop: {
|
|
@@ -93,6 +102,9 @@ const PageSiderMenu = ({ basePath , blockId , components: { Icon , Link } , eve
|
|
|
93
102
|
},
|
|
94
103
|
body: {
|
|
95
104
|
padding: '0 40px 40px 40px',
|
|
105
|
+
xs: {
|
|
106
|
+
padding: '0 5px 5px 5px'
|
|
107
|
+
},
|
|
96
108
|
sm: {
|
|
97
109
|
padding: '0 10px 10px 10px'
|
|
98
110
|
},
|
|
@@ -114,6 +126,9 @@ const PageSiderMenu = ({ basePath , blockId , components: { Icon , Link } , eve
|
|
|
114
126
|
},
|
|
115
127
|
noBreadcrumb: {
|
|
116
128
|
padding: '20px 0',
|
|
129
|
+
xs: {
|
|
130
|
+
padding: '5px 0'
|
|
131
|
+
},
|
|
117
132
|
sm: {
|
|
118
133
|
padding: '5px 0'
|
|
119
134
|
},
|
|
@@ -122,7 +137,7 @@ const PageSiderMenu = ({ basePath , blockId , components: { Icon , Link } , eve
|
|
|
122
137
|
}
|
|
123
138
|
}
|
|
124
139
|
};
|
|
125
|
-
return
|
|
140
|
+
return /*#__PURE__*/ React.createElement(Layout, {
|
|
126
141
|
blockId: blockId,
|
|
127
142
|
components: {
|
|
128
143
|
Icon,
|
|
@@ -131,9 +146,7 @@ const PageSiderMenu = ({ basePath , blockId , components: { Icon , Link } , eve
|
|
|
131
146
|
events: events,
|
|
132
147
|
properties: {
|
|
133
148
|
style: mergeObjects([
|
|
134
|
-
|
|
135
|
-
minHeight: '100vh'
|
|
136
|
-
},
|
|
149
|
+
styles.layout,
|
|
137
150
|
properties.style
|
|
138
151
|
])
|
|
139
152
|
},
|
|
@@ -159,7 +172,7 @@ const PageSiderMenu = ({ basePath , blockId , components: { Icon , Link } , eve
|
|
|
159
172
|
{
|
|
160
173
|
width: 'auto'
|
|
161
174
|
},
|
|
162
|
-
properties.header
|
|
175
|
+
properties.header?.contentStyle
|
|
163
176
|
])), /*#__PURE__*/ React.createElement("div", {
|
|
164
177
|
className: methods.makeCssClass([
|
|
165
178
|
styles.mobile,
|
|
@@ -179,10 +192,10 @@ const PageSiderMenu = ({ basePath , blockId , components: { Icon , Link } , eve
|
|
|
179
192
|
properties: mergeObjects([
|
|
180
193
|
{
|
|
181
194
|
mode: 'inline',
|
|
182
|
-
theme: get(properties, 'sider.theme')
|
|
195
|
+
theme: get(properties, 'sider.theme') ?? 'light'
|
|
183
196
|
},
|
|
184
197
|
properties.menu,
|
|
185
|
-
properties.menuMd
|
|
198
|
+
properties.menuMd
|
|
186
199
|
]),
|
|
187
200
|
rename: {
|
|
188
201
|
methods: {
|
|
@@ -196,25 +209,17 @@ const PageSiderMenu = ({ basePath , blockId , components: { Icon , Link } , eve
|
|
|
196
209
|
}
|
|
197
210
|
}))), /*#__PURE__*/ React.createElement(Link, {
|
|
198
211
|
home: true
|
|
199
|
-
}, /*#__PURE__*/ React.createElement("
|
|
200
|
-
|
|
201
|
-
srcSet: properties.logo
|
|
202
|
-
|
|
203
|
-
|
|
212
|
+
}, /*#__PURE__*/ React.createElement("picture", null, /*#__PURE__*/ React.createElement("source", {
|
|
213
|
+
media: `(min-width:${properties.logo?.breakpoint ?? 577}px)`,
|
|
214
|
+
srcSet: properties.logo?.src ?? `${basePath}/logo-${properties.header?.theme ?? 'dark'}-theme.png`
|
|
215
|
+
}), /*#__PURE__*/ React.createElement("img", {
|
|
216
|
+
src: properties.logo?.srcMobile ?? properties.logo?.src ?? `${basePath}/logo-square-${properties.header?.theme ?? 'dark'}-theme.png`,
|
|
217
|
+
alt: properties.logo?.alt ?? 'Lowdefy',
|
|
204
218
|
className: methods.makeCssClass([
|
|
205
|
-
{
|
|
206
|
-
width: 130,
|
|
207
|
-
sm: {
|
|
208
|
-
width: properties.logo && properties.logo.src && !properties.logo.srcSet ? 130 : 40
|
|
209
|
-
},
|
|
210
|
-
md: {
|
|
211
|
-
width: 130
|
|
212
|
-
}
|
|
213
|
-
},
|
|
214
219
|
styles.logo,
|
|
215
|
-
properties.logo
|
|
220
|
+
properties.logo?.style
|
|
216
221
|
])
|
|
217
|
-
})))
|
|
222
|
+
}))))
|
|
218
223
|
}
|
|
219
224
|
}), /*#__PURE__*/ React.createElement(Layout, {
|
|
220
225
|
blockId: `${blockId}_layout`,
|
|
@@ -235,10 +240,10 @@ const PageSiderMenu = ({ basePath , blockId , components: { Icon , Link } , eve
|
|
|
235
240
|
methods: methods,
|
|
236
241
|
properties: mergeObjects([
|
|
237
242
|
{
|
|
238
|
-
theme: get(properties, 'sider.theme')
|
|
243
|
+
theme: get(properties, 'sider.theme') ?? 'light',
|
|
239
244
|
style: styles.desktop
|
|
240
245
|
},
|
|
241
|
-
properties.sider
|
|
246
|
+
properties.sider
|
|
242
247
|
]),
|
|
243
248
|
rename: {
|
|
244
249
|
methods: {
|
|
@@ -263,13 +268,13 @@ const PageSiderMenu = ({ basePath , blockId , components: { Icon , Link } , eve
|
|
|
263
268
|
properties: mergeObjects([
|
|
264
269
|
{
|
|
265
270
|
mode: 'inline',
|
|
266
|
-
theme: get(properties, 'sider.theme')
|
|
271
|
+
theme: get(properties, 'sider.theme') ?? 'light'
|
|
267
272
|
},
|
|
268
|
-
properties.menu,
|
|
269
|
-
properties.menuLg,
|
|
270
273
|
{
|
|
271
274
|
style: styles.desktop
|
|
272
|
-
},
|
|
275
|
+
},
|
|
276
|
+
properties.menu,
|
|
277
|
+
properties.menuLg
|
|
273
278
|
]),
|
|
274
279
|
rename: {
|
|
275
280
|
methods: {
|
|
@@ -286,7 +291,7 @@ const PageSiderMenu = ({ basePath , blockId , components: { Icon , Link } , eve
|
|
|
286
291
|
style: {
|
|
287
292
|
flex: '1 0 auto'
|
|
288
293
|
}
|
|
289
|
-
}, content.sider && content.sider()), !get(properties, 'sider.hideToggleButton')
|
|
294
|
+
}, content.sider && content.sider()), !get(properties, 'sider.hideToggleButton') ?? /*#__PURE__*/ React.createElement(Affix, {
|
|
290
295
|
blockId: `${blockId}_toggle_sider_affix`,
|
|
291
296
|
components: {
|
|
292
297
|
Icon,
|
|
@@ -321,11 +326,10 @@ const PageSiderMenu = ({ basePath , blockId , components: { Icon , Link } , eve
|
|
|
321
326
|
icon: {
|
|
322
327
|
name: openSiderState ? 'AiOutlineMenuFold' : 'AiOutlineMenuUnfold'
|
|
323
328
|
},
|
|
324
|
-
...properties.toggleSiderButton
|
|
329
|
+
...properties.toggleSiderButton ?? {}
|
|
325
330
|
},
|
|
326
331
|
methods: methods,
|
|
327
|
-
onClick: ()=>methods.toggleSiderOpen()
|
|
328
|
-
,
|
|
332
|
+
onClick: ()=>methods.toggleSiderOpen(),
|
|
329
333
|
rename: {
|
|
330
334
|
events: {
|
|
331
335
|
onClick: 'onToggleSider'
|
|
@@ -360,11 +364,9 @@ const PageSiderMenu = ({ basePath , blockId , components: { Icon , Link } , eve
|
|
|
360
364
|
methods: methods,
|
|
361
365
|
properties: mergeObjects([
|
|
362
366
|
{
|
|
363
|
-
style:
|
|
364
|
-
padding: '16px 0'
|
|
365
|
-
}
|
|
367
|
+
style: styles.breadcrumb
|
|
366
368
|
},
|
|
367
|
-
properties.breadcrumb
|
|
369
|
+
properties.breadcrumb
|
|
368
370
|
]),
|
|
369
371
|
rename: {
|
|
370
372
|
events: {
|
|
@@ -390,7 +392,7 @@ const PageSiderMenu = ({ basePath , blockId , components: { Icon , Link } , eve
|
|
|
390
392
|
}
|
|
391
393
|
}))
|
|
392
394
|
}
|
|
393
|
-
})
|
|
395
|
+
});
|
|
394
396
|
};
|
|
395
397
|
PageSiderMenu.defaultProps = blockDefaultProps;
|
|
396
398
|
PageSiderMenu.meta = {
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
"type": "string",
|
|
14
14
|
"description": "Header logo source url."
|
|
15
15
|
},
|
|
16
|
-
"
|
|
16
|
+
"srcMobile": {
|
|
17
17
|
"type": "string",
|
|
18
|
-
"description": "Header logo
|
|
18
|
+
"description": "Header logo img element for mobile."
|
|
19
19
|
},
|
|
20
|
-
"
|
|
21
|
-
"type": "
|
|
22
|
-
"description": "Header logo
|
|
20
|
+
"breakpoint": {
|
|
21
|
+
"type": "number",
|
|
22
|
+
"description": "Header logo breakpoint for switching between mobile and desktop logo."
|
|
23
23
|
},
|
|
24
24
|
"alt": {
|
|
25
25
|
"type": "string",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 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.
|
|
@@ -39,8 +39,7 @@ const createChangeHandler = ({ eventName , methods })=>(current, pageSize)=>{
|
|
|
39
39
|
skip: current * pageSize
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
}
|
|
43
|
-
;
|
|
42
|
+
};
|
|
44
43
|
const PaginationBlock = ({ blockId , loading , methods , properties , value })=>{
|
|
45
44
|
const showTotal = type.isFunction(properties.showTotal) ? properties.showTotal : (total, range)=>{
|
|
46
45
|
if (type.isString(properties.showTotal)) {
|
|
@@ -51,7 +50,7 @@ const PaginationBlock = ({ blockId , loading , methods , properties , value })=
|
|
|
51
50
|
}
|
|
52
51
|
return `${range[0]}-${range[1]} of ${total} items`;
|
|
53
52
|
};
|
|
54
|
-
return
|
|
53
|
+
return /*#__PURE__*/ React.createElement(Pagination, {
|
|
55
54
|
id: blockId,
|
|
56
55
|
disabled: properties.disabled || loading,
|
|
57
56
|
hideOnSinglePage: properties.hideOnSinglePage,
|
|
@@ -80,7 +79,7 @@ const PaginationBlock = ({ blockId , loading , methods , properties , value })=
|
|
|
80
79
|
size: properties.size,
|
|
81
80
|
total: properties.total !== undefined ? properties.total : 100,
|
|
82
81
|
current: type.isNone(value) || !type.isObject(value) || !type.isNumber(value.current) ? 1 : value.current
|
|
83
|
-
})
|
|
82
|
+
});
|
|
84
83
|
};
|
|
85
84
|
PaginationBlock.defaultProps = blockDefaultProps;
|
|
86
85
|
PaginationBlock.meta = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 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.
|
|
@@ -43,7 +43,7 @@ const ParagraphBlock = ({ blockId , components: { Icon } , events , methods , p
|
|
|
43
43
|
blockId: `${blockId}_copyable_after_icon`,
|
|
44
44
|
events: events,
|
|
45
45
|
properties: properties.copyable.icon[1]
|
|
46
|
-
})
|
|
46
|
+
})
|
|
47
47
|
] : /*#__PURE__*/ React.createElement(Icon, {
|
|
48
48
|
blockId: `${blockId}_copyable_icon`,
|
|
49
49
|
events: events,
|
|
@@ -90,8 +90,7 @@ const ParagraphBlock = ({ blockId , components: { Icon } , events , methods , p
|
|
|
90
90
|
}, renderHtml({
|
|
91
91
|
html: properties.content,
|
|
92
92
|
methods
|
|
93
|
-
}))
|
|
94
|
-
;
|
|
93
|
+
}));
|
|
95
94
|
ParagraphBlock.defaultProps = blockDefaultProps;
|
|
96
95
|
ParagraphBlock.meta = {
|
|
97
96
|
category: 'display',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 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,3 +15,4 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
@import 'antd/lib/typography/style/index.less';
|
|
18
|
+
@import 'antd/lib/tooltip/style/index.less';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 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 { Typography } from 'antd';
|
|
|
17
17
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
18
18
|
import { type } from '@lowdefy/helpers';
|
|
19
19
|
const Paragraph = Typography.Paragraph;
|
|
20
|
-
const ParagraphInput = ({ blockId , components: { Icon } , events , loading , methods , properties , value
|
|
20
|
+
const ParagraphInput = ({ blockId , components: { Icon } , events , loading , methods , properties , value })=>{
|
|
21
21
|
const [editing, setEdit] = useState(false);
|
|
22
22
|
const editableEvents = {
|
|
23
23
|
onStart: ()=>{
|
|
@@ -37,7 +37,7 @@ const ParagraphInput = ({ blockId , components: { Icon } , events , loading , m
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
-
return
|
|
40
|
+
return /*#__PURE__*/ React.createElement(Paragraph, {
|
|
41
41
|
id: blockId,
|
|
42
42
|
className: methods.makeCssClass(properties.style),
|
|
43
43
|
code: properties.code,
|
|
@@ -63,7 +63,7 @@ const ParagraphInput = ({ blockId , components: { Icon } , events , loading , m
|
|
|
63
63
|
blockId: `${blockId}_copyable_after_icon`,
|
|
64
64
|
events: events,
|
|
65
65
|
properties: properties.copyable.icon[1]
|
|
66
|
-
})
|
|
66
|
+
})
|
|
67
67
|
] : /*#__PURE__*/ React.createElement(Icon, {
|
|
68
68
|
blockId: `${blockId}_copyable_icon`,
|
|
69
69
|
events: events,
|
|
@@ -111,7 +111,7 @@ const ParagraphInput = ({ blockId , components: { Icon } , events , loading , m
|
|
|
111
111
|
strong: properties.strong,
|
|
112
112
|
type: properties.type,
|
|
113
113
|
underline: properties.underline
|
|
114
|
-
}, !type.isNone(value) ? value.toString() : '')
|
|
114
|
+
}, !type.isNone(value) ? value.toString() : '');
|
|
115
115
|
};
|
|
116
116
|
ParagraphInput.defaultProps = blockDefaultProps;
|
|
117
117
|
ParagraphInput.meta = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 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,8 +17,8 @@ import { Input } from 'antd';
|
|
|
17
17
|
import { blockDefaultProps } from '@lowdefy/block-utils';
|
|
18
18
|
import Label from '../Label/Label.js';
|
|
19
19
|
import useRunAfterUpdate from '../../useRunAfterUpdate.js';
|
|
20
|
-
const PasswordInput = ({ blockId , components , events , loading , methods , properties , required , validation , value
|
|
21
|
-
return
|
|
20
|
+
const PasswordInput = ({ blockId , components , events , loading , methods , properties , required , validation , value })=>{
|
|
21
|
+
return /*#__PURE__*/ React.createElement(Label, {
|
|
22
22
|
blockId: blockId,
|
|
23
23
|
components: components,
|
|
24
24
|
events: events,
|
|
@@ -32,7 +32,7 @@ const PasswordInput = ({ blockId , components , events , loading , methods , pro
|
|
|
32
32
|
content: {
|
|
33
33
|
content: ()=>{
|
|
34
34
|
const runAfterUpdate = useRunAfterUpdate();
|
|
35
|
-
return
|
|
35
|
+
return /*#__PURE__*/ React.createElement(Input.Password, {
|
|
36
36
|
id: `${blockId}_input`,
|
|
37
37
|
bordered: properties.bordered,
|
|
38
38
|
className: methods.makeCssClass(properties.inputStyle),
|
|
@@ -57,11 +57,12 @@ const PasswordInput = ({ blockId , components , events , loading , methods , pro
|
|
|
57
57
|
placeholder: properties.placeholder,
|
|
58
58
|
value: value,
|
|
59
59
|
size: properties.size,
|
|
60
|
+
status: validation.status,
|
|
60
61
|
visibilityToggle: properties.visibilityToggle
|
|
61
|
-
})
|
|
62
|
+
});
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
|
-
})
|
|
65
|
+
});
|
|
65
66
|
};
|
|
66
67
|
PasswordInput.defaultProps = blockDefaultProps;
|
|
67
68
|
PasswordInput.meta = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 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.
|
|
@@ -30,8 +30,7 @@ const ProgressBlock = ({ blockId , properties })=>/*#__PURE__*/ React.createEle
|
|
|
30
30
|
trailColor: properties.trailColor,
|
|
31
31
|
type: properties.type,
|
|
32
32
|
width: properties.width
|
|
33
|
-
})
|
|
34
|
-
;
|
|
33
|
+
});
|
|
35
34
|
ProgressBlock.defaultProps = blockDefaultProps;
|
|
36
35
|
ProgressBlock.meta = {
|
|
37
36
|
category: 'display',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 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.
|
|
@@ -20,9 +20,9 @@ import Label from '../Label/Label.js';
|
|
|
20
20
|
import getValueIndex from '../../getValueIndex.js';
|
|
21
21
|
import getUniqueValues from '../../getUniqueValues.js';
|
|
22
22
|
const RadioGroup = Radio.Group;
|
|
23
|
-
const RadioSelector = ({ blockId , components , events , loading , properties , required , validation , value , methods
|
|
23
|
+
const RadioSelector = ({ blockId , components , events , loading , properties , required , validation , value , methods })=>{
|
|
24
24
|
const uniqueValueOptions = getUniqueValues(properties.options || []);
|
|
25
|
-
return
|
|
25
|
+
return /*#__PURE__*/ React.createElement(Label, {
|
|
26
26
|
blockId: blockId,
|
|
27
27
|
components: components,
|
|
28
28
|
events: events,
|
|
@@ -45,7 +45,7 @@ const RadioSelector = ({ blockId , components , events , loading , properties ,
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
-
properties.inputStyle
|
|
48
|
+
properties.inputStyle
|
|
49
49
|
]),
|
|
50
50
|
disabled: properties.disabled || loading,
|
|
51
51
|
onChange: (event)=>{
|
|
@@ -54,7 +54,7 @@ const RadioSelector = ({ blockId , components , events , loading , properties ,
|
|
|
54
54
|
name: 'onChange'
|
|
55
55
|
});
|
|
56
56
|
},
|
|
57
|
-
value: getValueIndex(value, uniqueValueOptions)
|
|
57
|
+
value: `${getValueIndex(value, uniqueValueOptions)}`
|
|
58
58
|
}, /*#__PURE__*/ React.createElement(Space, {
|
|
59
59
|
direction: properties.direction,
|
|
60
60
|
wrap: type.isNone(properties.wrap) ? true : properties.wrap,
|
|
@@ -62,14 +62,14 @@ const RadioSelector = ({ blockId , components , events , loading , properties ,
|
|
|
62
62
|
}, uniqueValueOptions.map((opt, i)=>type.isPrimitive(opt) ? /*#__PURE__*/ React.createElement(Radio, {
|
|
63
63
|
id: `${blockId}_${opt}`,
|
|
64
64
|
key: i,
|
|
65
|
-
value: i
|
|
65
|
+
value: `${i}`
|
|
66
66
|
}, renderHtml({
|
|
67
67
|
html: `${opt}`,
|
|
68
68
|
methods
|
|
69
69
|
})) : /*#__PURE__*/ React.createElement(Radio, {
|
|
70
70
|
id: `${blockId}_${i}`,
|
|
71
71
|
key: i,
|
|
72
|
-
value: i
|
|
72
|
+
value: `${i}`,
|
|
73
73
|
disabled: opt.disabled,
|
|
74
74
|
className: methods.makeCssClass(opt.style)
|
|
75
75
|
}, type.isNone(opt.label) ? renderHtml({
|
|
@@ -78,10 +78,9 @@ const RadioSelector = ({ blockId , components , events , loading , properties ,
|
|
|
78
78
|
}) : renderHtml({
|
|
79
79
|
html: opt.label,
|
|
80
80
|
methods
|
|
81
|
-
}))
|
|
82
|
-
)))
|
|
81
|
+
})))))
|
|
83
82
|
}
|
|
84
|
-
})
|
|
83
|
+
});
|
|
85
84
|
};
|
|
86
85
|
RadioSelector.defaultProps = blockDefaultProps;
|
|
87
86
|
RadioSelector.meta = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 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.
|
|
@@ -63,7 +63,7 @@ const styles = {
|
|
|
63
63
|
flexDirection: 'row'
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
|
-
const RatingSlider = ({ blockId , components: { Icon , Link } , events , loading , methods , properties , required , validation , value
|
|
66
|
+
const RatingSlider = ({ blockId , components: { Icon , Link } , events , loading , methods , properties , required , validation , value })=>{
|
|
67
67
|
const [check, unCheck] = useState(false);
|
|
68
68
|
let propertiesIconMin = serializer.copy(properties.minIcon);
|
|
69
69
|
if (type.isString(propertiesIconMin)) {
|
|
@@ -82,12 +82,11 @@ const RatingSlider = ({ blockId , components: { Icon , Link } , events , loadin
|
|
|
82
82
|
default: 10
|
|
83
83
|
}),
|
|
84
84
|
properties.min || 0
|
|
85
|
-
].sort((a, b)=>a - b
|
|
86
|
-
);
|
|
85
|
+
].sort((a, b)=>a - b);
|
|
87
86
|
// round to fix floating point error
|
|
88
87
|
const minMin = parseFloat((minMax[0] - (properties.step || 1)).toPrecision(8));
|
|
89
88
|
const validationColor = validation.status === 'error' ? '#ff4d4f' : validation.status === 'warning' ? '#faad14' : null;
|
|
90
|
-
return
|
|
89
|
+
return /*#__PURE__*/ React.createElement(Label, {
|
|
91
90
|
blockId: blockId,
|
|
92
91
|
components: {
|
|
93
92
|
Icon,
|
|
@@ -108,7 +107,7 @@ const RatingSlider = ({ blockId , components: { Icon , Link } , events , loadin
|
|
|
108
107
|
styles.content,
|
|
109
108
|
{
|
|
110
109
|
paddingRight: validation.status && 30
|
|
111
|
-
}
|
|
110
|
+
}
|
|
112
111
|
])
|
|
113
112
|
}, !required && !properties.disableNotApplicable && /*#__PURE__*/ React.createElement(CheckboxSelector, {
|
|
114
113
|
blockId: `${blockId}_checkbox_selector`,
|
|
@@ -133,7 +132,7 @@ const RatingSlider = ({ blockId , components: { Icon , Link } , events , loadin
|
|
|
133
132
|
properties.CheckboxInput,
|
|
134
133
|
{
|
|
135
134
|
style: styles.checkbox
|
|
136
|
-
}
|
|
135
|
+
}
|
|
137
136
|
]),
|
|
138
137
|
methods: {
|
|
139
138
|
...methods,
|
|
@@ -158,7 +157,7 @@ const RatingSlider = ({ blockId , components: { Icon , Link } , events , loadin
|
|
|
158
157
|
style: styles.iconLeft,
|
|
159
158
|
color: properties.color
|
|
160
159
|
},
|
|
161
|
-
propertiesIconMin
|
|
160
|
+
propertiesIconMin
|
|
162
161
|
])
|
|
163
162
|
}), /*#__PURE__*/ React.createElement(Slider, {
|
|
164
163
|
id: `${blockId}_input`,
|
|
@@ -183,7 +182,7 @@ const RatingSlider = ({ blockId , components: { Icon , Link } , events , loadin
|
|
|
183
182
|
'& > div.ant-slider-rail': {
|
|
184
183
|
backgroundColor: `${validationColor} !important`
|
|
185
184
|
}
|
|
186
|
-
}
|
|
185
|
+
}
|
|
187
186
|
]), methods.makeCssClass(styles.slider), methods.makeCssClass(properties.inputStyle)),
|
|
188
187
|
autoFocus: properties.autoFocus,
|
|
189
188
|
disabled: properties.disabled || check === true && !properties.disableNotApplicable || loading,
|
|
@@ -191,8 +190,7 @@ const RatingSlider = ({ blockId , components: { Icon , Link } , events , loadin
|
|
|
191
190
|
default: true
|
|
192
191
|
}),
|
|
193
192
|
tooltipVisible: value === null || properties.tooltipVisible === 'never' ? false : properties.tooltipVisible === 'always' ? true : undefined,
|
|
194
|
-
tipFormatter: (val)=>`${val}
|
|
195
|
-
,
|
|
193
|
+
tipFormatter: (val)=>`${val}`,
|
|
196
194
|
marks: properties.marks || (get(properties, 'showMarks', {
|
|
197
195
|
default: true
|
|
198
196
|
}) ? includeMarks(minMax, minMin, properties.step || 1) : undefined),
|
|
@@ -220,11 +218,11 @@ const RatingSlider = ({ blockId , components: { Icon , Link } , events , loadin
|
|
|
220
218
|
style: styles.iconRight,
|
|
221
219
|
color: properties.color
|
|
222
220
|
},
|
|
223
|
-
propertiesIconMax
|
|
221
|
+
propertiesIconMax
|
|
224
222
|
])
|
|
225
223
|
}))
|
|
226
224
|
}
|
|
227
|
-
})
|
|
225
|
+
});
|
|
228
226
|
};
|
|
229
227
|
RatingSlider.defaultProps = blockDefaultProps;
|
|
230
228
|
RatingSlider.meta = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 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.
|
|
@@ -36,8 +36,7 @@ const ResultBlock = ({ blockId , components: { Icon } , events , content , meth
|
|
|
36
36
|
})
|
|
37
37
|
}, content.content && content.content({
|
|
38
38
|
justifyContent: 'center'
|
|
39
|
-
}))
|
|
40
|
-
;
|
|
39
|
+
}));
|
|
41
40
|
ResultBlock.defaultProps = blockDefaultProps;
|
|
42
41
|
ResultBlock.meta = {
|
|
43
42
|
category: 'container',
|