@onehat/ui 0.4.10 → 0.4.11
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/package.json
CHANGED
|
@@ -372,8 +372,7 @@ export const DateElement = forwardRef((props, ref) => {
|
|
|
372
372
|
flex-1
|
|
373
373
|
h-full
|
|
374
374
|
m-0
|
|
375
|
-
rounded-
|
|
376
|
-
rounded-br-none
|
|
375
|
+
rounded-r-lg
|
|
377
376
|
${styles.FORM_DATE_INPUT_BG}
|
|
378
377
|
${styles.FORM_DATE_INPUT_BG_FOCUS}
|
|
379
378
|
${styles.FORM_DATE_READOUT_FONTSIZE}
|
|
@@ -1205,7 +1205,6 @@ function Form(props) {
|
|
|
1205
1205
|
key="resetBtn"
|
|
1206
1206
|
onPress={() => doReset()}
|
|
1207
1207
|
icon={Rotate}
|
|
1208
|
-
className="mr-2"
|
|
1209
1208
|
isDisabled={!formState.isDirty}
|
|
1210
1209
|
/>}
|
|
1211
1210
|
|
|
@@ -1215,7 +1214,7 @@ function Form(props) {
|
|
|
1215
1214
|
key="cancelBtn"
|
|
1216
1215
|
variant={editorType === EDITOR_TYPE__INLINE ? 'solid' : 'outline'}
|
|
1217
1216
|
onPress={onCancel}
|
|
1218
|
-
className="text-white
|
|
1217
|
+
className="text-white"
|
|
1219
1218
|
text="Cancel"
|
|
1220
1219
|
/>}
|
|
1221
1220
|
|
|
@@ -1225,7 +1224,7 @@ function Form(props) {
|
|
|
1225
1224
|
key="closeBtn"
|
|
1226
1225
|
variant={editorType === EDITOR_TYPE__INLINE ? 'solid' : 'outline'}
|
|
1227
1226
|
onPress={onClose}
|
|
1228
|
-
className="text-white
|
|
1227
|
+
className="text-white"
|
|
1229
1228
|
text="Close"
|
|
1230
1229
|
/>}
|
|
1231
1230
|
|
|
@@ -1277,6 +1276,7 @@ function Form(props) {
|
|
|
1277
1276
|
w-[100px]
|
|
1278
1277
|
min-w-[300px]
|
|
1279
1278
|
py-2
|
|
1279
|
+
gap-2
|
|
1280
1280
|
justify-center
|
|
1281
1281
|
items-center
|
|
1282
1282
|
rounded-b-lg
|
|
@@ -1287,8 +1287,11 @@ function Form(props) {
|
|
|
1287
1287
|
</Box>;
|
|
1288
1288
|
} else {
|
|
1289
1289
|
if (!disableFooter) {
|
|
1290
|
-
let footerClassName =
|
|
1291
|
-
|
|
1290
|
+
let footerClassName = `
|
|
1291
|
+
Form-Footer
|
|
1292
|
+
justify-end
|
|
1293
|
+
gap-2
|
|
1294
|
+
`;
|
|
1292
1295
|
if (editorType === EDITOR_TYPE__INLINE) {
|
|
1293
1296
|
footerClassName += `
|
|
1294
1297
|
sticky
|
|
@@ -137,13 +137,12 @@ function Panel(props) {
|
|
|
137
137
|
className={`
|
|
138
138
|
Panel-VSstack
|
|
139
139
|
flex-1
|
|
140
|
-
flex
|
|
141
140
|
w-full
|
|
142
141
|
overflow-hidden
|
|
143
142
|
`}
|
|
144
143
|
>
|
|
145
144
|
{isScrollable ?
|
|
146
|
-
<ScrollView className="ScrollView">
|
|
145
|
+
<ScrollView className="Panel-ScrollView">
|
|
147
146
|
{children}
|
|
148
147
|
</ScrollView> :
|
|
149
148
|
children}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { cloneElement, isValidElement } from 'react';
|
|
2
2
|
import {
|
|
3
|
+
Box,
|
|
3
4
|
HStack,
|
|
4
5
|
Icon,
|
|
5
6
|
Text,
|
|
6
7
|
VStack,
|
|
8
|
+
VStackNative,
|
|
7
9
|
} from '@project-components/Gluestack';
|
|
8
10
|
import { EDITOR_TYPE__PLAIN } from '../../Constants/Editor';
|
|
9
11
|
import {
|
|
@@ -41,15 +43,14 @@ function Report(props) {
|
|
|
41
43
|
buttons = [];
|
|
42
44
|
|
|
43
45
|
const propsIcon = props._icon || {};
|
|
44
|
-
propsIcon.
|
|
45
|
-
propsIcon.px = 5;
|
|
46
|
+
propsIcon.className = 'w-full h-full text-primary-500';
|
|
46
47
|
let icon = props.icon;
|
|
47
48
|
if (_.isEmpty(icon)) {
|
|
48
49
|
icon = ChartLine;
|
|
49
50
|
}
|
|
50
|
-
if (
|
|
51
|
+
if (isValidElement(icon)) {
|
|
51
52
|
if (!_.isEmpty(propsIcon)) {
|
|
52
|
-
icon =
|
|
53
|
+
icon = cloneElement(icon, {...propsIcon});
|
|
53
54
|
}
|
|
54
55
|
} else {
|
|
55
56
|
icon = <Icon as={icon} {...propsIcon} />;
|
|
@@ -60,14 +61,13 @@ function Report(props) {
|
|
|
60
61
|
...testProps('excelBtn'),
|
|
61
62
|
key: 'excelBtn',
|
|
62
63
|
text: 'Download Excel',
|
|
63
|
-
|
|
64
|
+
icon: Excel,
|
|
64
65
|
onPress: (data) => getReport({
|
|
65
66
|
reportId,
|
|
66
67
|
data,
|
|
67
68
|
reportType: REPORT_TYPES__EXCEL,
|
|
68
69
|
showReportHeaders,
|
|
69
70
|
}),
|
|
70
|
-
ml: 1,
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
if (!disablePdf) {
|
|
@@ -75,22 +75,30 @@ function Report(props) {
|
|
|
75
75
|
...testProps('pdfBtn'),
|
|
76
76
|
key: 'pdfBtn',
|
|
77
77
|
text: 'Download PDF',
|
|
78
|
-
|
|
78
|
+
icon: Pdf,
|
|
79
79
|
onPress: (data) => getReport({
|
|
80
80
|
reportId,
|
|
81
81
|
data,
|
|
82
82
|
reportType: REPORT_TYPES__PDF,
|
|
83
83
|
showReportHeaders,
|
|
84
84
|
}),
|
|
85
|
-
ml: 1,
|
|
86
85
|
});
|
|
87
86
|
}
|
|
88
|
-
return <
|
|
87
|
+
return <VStackNative
|
|
89
88
|
{...testProps('Report-' + reportId)}
|
|
90
|
-
className=
|
|
89
|
+
className={`
|
|
90
|
+
w-full
|
|
91
|
+
border
|
|
92
|
+
border-primary-300
|
|
93
|
+
p-4
|
|
94
|
+
mb-3
|
|
95
|
+
rounded-lg
|
|
96
|
+
`}
|
|
91
97
|
>
|
|
92
98
|
<HStack>
|
|
93
|
-
|
|
99
|
+
<Box className="w-[50px] mr-4">
|
|
100
|
+
{icon}
|
|
101
|
+
</Box>
|
|
94
102
|
<VStack className="flex-1">
|
|
95
103
|
<Text className="text-2xl max-w-full">{title}</Text>
|
|
96
104
|
<Text className="text-sm">{description}</Text>
|
|
@@ -101,7 +109,7 @@ function Report(props) {
|
|
|
101
109
|
additionalFooterButtons={buttons}
|
|
102
110
|
{...props._form}
|
|
103
111
|
/>
|
|
104
|
-
</
|
|
112
|
+
</VStackNative>;
|
|
105
113
|
}
|
|
106
114
|
|
|
107
115
|
export default withComponent(Report);
|
|
@@ -362,14 +362,17 @@ function Viewer(props) {
|
|
|
362
362
|
canEdit = false;
|
|
363
363
|
}
|
|
364
364
|
|
|
365
|
-
let className =
|
|
365
|
+
let className = `
|
|
366
|
+
Viewer-VStackNative
|
|
367
|
+
h-full
|
|
368
|
+
bg-white
|
|
369
|
+
`;
|
|
366
370
|
if (props.className) {
|
|
367
371
|
className += ' ' + props.className;
|
|
368
372
|
}
|
|
369
373
|
|
|
370
374
|
return <VStackNative
|
|
371
375
|
{...testProps(self)}
|
|
372
|
-
{...props}
|
|
373
376
|
className={className}
|
|
374
377
|
onLayout={onLayout}
|
|
375
378
|
>
|
|
@@ -379,9 +382,10 @@ function Viewer(props) {
|
|
|
379
382
|
_web={{ height: 1 }}
|
|
380
383
|
ref={scrollViewRef}
|
|
381
384
|
className={`
|
|
382
|
-
ScrollView
|
|
385
|
+
Viewer-ScrollView
|
|
383
386
|
w-full
|
|
384
387
|
pb-1
|
|
388
|
+
flex-1
|
|
385
389
|
`}
|
|
386
390
|
>
|
|
387
391
|
{canEdit && onEditMode &&
|