@onehat/ui 0.4.69 → 0.4.71
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 +2 -1
- package/src/Components/Accordion/Accordion.js +1 -0
- package/src/Components/Blank.js +1 -0
- package/src/Components/Buttons/BackButton.js +1 -0
- package/src/Components/Buttons/Button.js +5 -4
- package/src/Components/Buttons/CartButtonWithBadge.js +1 -0
- package/src/Components/Buttons/IconButton.js +9 -8
- package/src/Components/Buttons/PlusMinusButton.js +5 -4
- package/src/Components/Buttons/SquareButton.js +19 -18
- package/src/Components/Container/Container.js +1 -0
- package/src/Components/Container/ContainerColumn.js +4 -3
- package/src/Components/Container/ScreenContainer.js +13 -13
- package/src/Components/Container/Splitter.js +33 -28
- package/src/Components/Editor/InlineEditor.js +32 -30
- package/src/Components/Fab/DynamicFab.js +14 -13
- package/src/Components/Fab/FabWithTooltip.js +1 -0
- package/src/Components/Filter/DateRange.js +8 -7
- package/src/Components/Filter/NumberRange.js +8 -7
- package/src/Components/Form/Field/CKEditor/CKEditor.js +1 -0
- package/src/Components/Form/Field/Checkbox/CheckboxGroup.js +1 -0
- package/src/Components/Form/Field/Color.js +41 -40
- package/src/Components/Form/Field/Combo/Combo.js +173 -172
- package/src/Components/Form/Field/Combo/PageSizeCombo.js +1 -0
- package/src/Components/Form/Field/Date.js +117 -116
- package/src/Components/Form/Field/DisplayField.js +6 -5
- package/src/Components/Form/Field/File.js +1 -0
- package/src/Components/Form/Field/FormikForm.js +1 -0
- package/src/Components/Form/Field/Input.js +15 -14
- package/src/Components/Form/Field/Json.js +8 -6
- package/src/Components/Form/Field/Number.js +31 -30
- package/src/Components/Form/Field/RadioGroup/RadioGroup.js +1 -0
- package/src/Components/Form/Field/Select/PageSizeSelect.js +1 -0
- package/src/Components/Form/Field/Select/Select.js +9 -8
- package/src/Components/Form/Field/Slider.js +15 -14
- package/src/Components/Form/Field/Tag/Tag.js +25 -24
- package/src/Components/Form/Field/Tag/ValueBox.js +32 -31
- package/src/Components/Form/Field/Text.js +9 -8
- package/src/Components/Form/Field/TextArea.js +9 -8
- package/src/Components/Form/Field/Toggle.js +16 -15
- package/src/Components/Form/FieldSet.js +27 -26
- package/src/Components/Form/Form.js +105 -104
- package/src/Components/Form/Label.js +15 -14
- package/src/Components/Grid/Grid.js +48 -46
- package/src/Components/Grid/GridHeaderRow.js +42 -40
- package/src/Components/Grid/GridRow.js +119 -80
- package/src/Components/Grid/HeaderColumnSelectorHandle.js +9 -8
- package/src/Components/Grid/HeaderReorderHandle.js +9 -8
- package/src/Components/Grid/HeaderResizeHandle.js +9 -8
- package/src/Components/Grid/NoRecordsFound.js +4 -3
- package/src/Components/Grid/RowDragHandle.js +1 -0
- package/src/Components/Grid/RowSelectHandle.js +1 -0
- package/src/Components/Hoc/Secondary/withSecondaryEditor.js +1 -1
- package/src/Components/Hoc/Secondary/withSecondaryWindowedEditor.js +6 -5
- package/src/Components/Hoc/withAlert.js +35 -34
- package/src/Components/Hoc/withContextMenu.js +27 -26
- package/src/Components/Hoc/withDnd.js +1 -0
- package/src/Components/Hoc/withEditor.js +1 -1
- package/src/Components/Hoc/withFilters.js +19 -18
- package/src/Components/Hoc/withModal.js +7 -6
- package/src/Components/Hoc/withToast.js +1 -0
- package/src/Components/Hoc/withWindowedEditor.js +6 -5
- package/src/Components/Layout/AsyncOperation.js +1 -0
- package/src/Components/Layout/CenterBox.js +9 -8
- package/src/Components/Layout/Footer.js +11 -10
- package/src/Components/Layout/ScreenHeader.js +5 -4
- package/src/Components/Layout/TextWithTooltip.js +1 -0
- package/src/Components/Messages/ConfirmationMessage.js +6 -5
- package/src/Components/Messages/ErrorMessage.js +40 -39
- package/src/Components/Messages/Loading.js +1 -0
- package/src/Components/Messages/OkMessage.js +11 -10
- package/src/Components/Messages/Unauthorized.js +1 -0
- package/src/Components/Messages/WaitMessage.js +16 -15
- package/src/Components/Panel/AccordionGridPanel.js +1 -0
- package/src/Components/Panel/FormPanel.js +1 -0
- package/src/Components/Panel/Header.js +59 -58
- package/src/Components/Panel/Mask.js +1 -0
- package/src/Components/Panel/Panel.js +7 -6
- package/src/Components/Picker/Picker.js +1 -0
- package/src/Components/Report/Report.js +35 -34
- package/src/Components/Screens/Manager.js +1 -0
- package/src/Components/Screens/ReportsManager.js +1 -0
- package/src/Components/Tab/Tab.js +1 -0
- package/src/Components/Tab/TabBar.js +67 -66
- package/src/Components/Toolbar/FilterToolbar.js +14 -11
- package/src/Components/Toolbar/Pagination.js +26 -25
- package/src/Components/Toolbar/PaginationToolbar.js +13 -12
- package/src/Components/Toolbar/Toolbar.js +13 -12
- package/src/Components/Tooltip/Tooltip.js +1 -0
- package/src/Components/Tree/Tree.js +12 -11
- package/src/Components/Tree/TreeNode.js +20 -19
- package/src/Components/Tree/TreeNodeDragHandle.js +11 -10
- package/src/Components/Viewer/MeterTypeText.js +8 -7
- package/src/Components/Viewer/TextWithLinks.js +16 -15
- package/src/Components/Viewer/Viewer.js +23 -22
- package/src/Components/Window/UploadsDownloadsWindow.js +6 -5
- package/src/Components/index.js +1 -0
- package/src/Hooks/useAsyncRenderers.js +53 -0
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
Modal, ModalBackdrop, ModalHeader, ModalContent, ModalCloseButton, ModalBody, ModalFooter,
|
|
3
3
|
Text,
|
|
4
4
|
} from '@project-components/Gluestack';
|
|
5
|
+
import clsx from 'clsx';
|
|
5
6
|
import Button from '../Buttons/Button';
|
|
6
7
|
|
|
7
8
|
export default function OkMessage(props) {
|
|
@@ -14,20 +15,20 @@ export default function OkMessage(props) {
|
|
|
14
15
|
<ModalBackdrop />
|
|
15
16
|
<ModalContent maxWidth="400px">
|
|
16
17
|
<ModalBody
|
|
17
|
-
className={
|
|
18
|
-
p-5
|
|
19
|
-
pb-0
|
|
20
|
-
border-t-0
|
|
21
|
-
|
|
18
|
+
className={clsx(
|
|
19
|
+
'p-5',
|
|
20
|
+
'pb-0',
|
|
21
|
+
'border-t-0',
|
|
22
|
+
)}
|
|
22
23
|
>
|
|
23
24
|
<Text className="text-black">{textMessage}</Text>
|
|
24
25
|
</ModalBody>
|
|
25
26
|
<ModalFooter
|
|
26
|
-
className={
|
|
27
|
-
p-0
|
|
28
|
-
pr-4
|
|
29
|
-
border-t-0
|
|
30
|
-
|
|
27
|
+
className={clsx(
|
|
28
|
+
'p-0',
|
|
29
|
+
'pr-4',
|
|
30
|
+
'border-t-0',
|
|
31
|
+
)}
|
|
31
32
|
>
|
|
32
33
|
<Button
|
|
33
34
|
variant="outline"
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
Spinner,
|
|
5
5
|
Text,
|
|
6
6
|
} from '@project-components/Gluestack';
|
|
7
|
+
import clsx from 'clsx';
|
|
7
8
|
import testProps from '../../Functions/testProps.js';
|
|
8
9
|
|
|
9
10
|
export default function WaitMessage(props) {
|
|
@@ -22,25 +23,25 @@ export default function WaitMessage(props) {
|
|
|
22
23
|
>
|
|
23
24
|
<ModalBackdrop />
|
|
24
25
|
<ModalContent
|
|
25
|
-
className={
|
|
26
|
-
ModalContent
|
|
27
|
-
w-[200px]
|
|
28
|
-
h-[50px]
|
|
29
|
-
shadow-lg
|
|
30
|
-
|
|
26
|
+
className={clsx(
|
|
27
|
+
'ModalContent',
|
|
28
|
+
'w-[200px]',
|
|
29
|
+
'h-[50px]',
|
|
30
|
+
'shadow-lg',
|
|
31
|
+
)}
|
|
31
32
|
>
|
|
32
33
|
<HStack
|
|
33
|
-
className={
|
|
34
|
-
HStack
|
|
35
|
-
items-center
|
|
36
|
-
justify-center
|
|
37
|
-
|
|
34
|
+
className={clsx(
|
|
35
|
+
'HStack',
|
|
36
|
+
'items-center',
|
|
37
|
+
'justify-center',
|
|
38
|
+
)}
|
|
38
39
|
>
|
|
39
40
|
<Spinner
|
|
40
|
-
className={
|
|
41
|
-
mr-2
|
|
42
|
-
focus:outline-none
|
|
43
|
-
|
|
41
|
+
className={clsx(
|
|
42
|
+
'mr-2',
|
|
43
|
+
'focus:outline-none',
|
|
44
|
+
)}
|
|
44
45
|
/>
|
|
45
46
|
<Text className="text-black">{text}</Text>
|
|
46
47
|
</HStack>
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
ScrollView,
|
|
4
4
|
VStack,
|
|
5
5
|
} from '@project-components/Gluestack';
|
|
6
|
+
import clsx from 'clsx';
|
|
6
7
|
import Accordion from 'react-native-collapsible/Accordion'; // https://www.npmjs.com/package/react-native-collapsible
|
|
7
8
|
import testProps from '../../Functions/testProps';
|
|
8
9
|
import Footer from '../Layout/Footer.js';
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
TextNative,
|
|
6
6
|
VStack,
|
|
7
7
|
} from '@project-components/Gluestack';
|
|
8
|
+
import clsx from 'clsx';
|
|
8
9
|
import {
|
|
9
10
|
HORIZONTAL,
|
|
10
11
|
VERTICAL,
|
|
@@ -41,17 +42,17 @@ export default function Header(props) {
|
|
|
41
42
|
let closeBtn = null,
|
|
42
43
|
collapseBtn = null;
|
|
43
44
|
if (onClose) {
|
|
44
|
-
let closeClassName =
|
|
45
|
-
Header-closeBtn
|
|
46
|
-
self-center
|
|
47
|
-
border
|
|
48
|
-
border-grey-400
|
|
49
|
-
h-[20px]
|
|
50
|
-
w-[20px]
|
|
51
|
-
px-[2px]
|
|
52
|
-
py-[2px]
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
let closeClassName = clsx(
|
|
46
|
+
'Header-closeBtn',
|
|
47
|
+
'self-center',
|
|
48
|
+
'border',
|
|
49
|
+
'border-grey-400',
|
|
50
|
+
'h-[20px]',
|
|
51
|
+
'w-[20px]',
|
|
52
|
+
'px-[2px]',
|
|
53
|
+
'py-[2px]',
|
|
54
|
+
styles.PANEL_HEADER_BG,
|
|
55
|
+
);
|
|
55
56
|
if (collapseDirection === HORIZONTAL && isCollapsed) {
|
|
56
57
|
closeClassName += ' mb-1';
|
|
57
58
|
}
|
|
@@ -67,17 +68,17 @@ export default function Header(props) {
|
|
|
67
68
|
/>;
|
|
68
69
|
}
|
|
69
70
|
if (isCollapsible) {
|
|
70
|
-
let collapseClassName =
|
|
71
|
-
Header-collapseBtn
|
|
72
|
-
self-center
|
|
73
|
-
border
|
|
74
|
-
border-grey-400
|
|
75
|
-
h-[20px]
|
|
76
|
-
w-[20px]
|
|
77
|
-
px-[2px]
|
|
78
|
-
py-[2px]
|
|
79
|
-
|
|
80
|
-
|
|
71
|
+
let collapseClassName = clsx(
|
|
72
|
+
'Header-collapseBtn',
|
|
73
|
+
'self-center',
|
|
74
|
+
'border',
|
|
75
|
+
'border-grey-400',
|
|
76
|
+
'h-[20px]',
|
|
77
|
+
'w-[20px]',
|
|
78
|
+
'px-[2px]',
|
|
79
|
+
'py-[2px]',
|
|
80
|
+
styles.PANEL_HEADER_BG,
|
|
81
|
+
);
|
|
81
82
|
if (collapseDirection === HORIZONTAL && isCollapsed) {
|
|
82
83
|
collapseClassName += ' mb-1';
|
|
83
84
|
}
|
|
@@ -97,17 +98,17 @@ export default function Header(props) {
|
|
|
97
98
|
doubleClickStyle.cursor = 'pointer';
|
|
98
99
|
}
|
|
99
100
|
|
|
100
|
-
let panelClassName =
|
|
101
|
-
Header
|
|
102
|
-
bg-grey-300
|
|
103
|
-
items-center
|
|
104
|
-
justify-start
|
|
105
|
-
py-1
|
|
106
|
-
border-b-grey-400
|
|
107
|
-
border-b-1
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
101
|
+
let panelClassName = clsx(
|
|
102
|
+
'Header',
|
|
103
|
+
'bg-grey-300',
|
|
104
|
+
'items-center',
|
|
105
|
+
'justify-start',
|
|
106
|
+
'py-1',
|
|
107
|
+
'border-b-grey-400',
|
|
108
|
+
'border-b-1',
|
|
109
|
+
isWindow ? 'rounded-t-lg' : '',
|
|
110
|
+
styles.PANEL_HEADER_BG,
|
|
111
|
+
);
|
|
111
112
|
if (CURRENT_MODE === UI_MODE_WEB) {
|
|
112
113
|
|
|
113
114
|
if (isCollapsed) {
|
|
@@ -137,12 +138,12 @@ export default function Header(props) {
|
|
|
137
138
|
<TextNative
|
|
138
139
|
numberOfLines={1}
|
|
139
140
|
ellipsizeMode="head"
|
|
140
|
-
className={
|
|
141
|
-
Header-TextNative1
|
|
142
|
-
flex-1
|
|
143
|
-
font-bold
|
|
144
|
-
|
|
145
|
-
|
|
141
|
+
className={clsx(
|
|
142
|
+
'Header-TextNative1',
|
|
143
|
+
'flex-1',
|
|
144
|
+
'font-bold',
|
|
145
|
+
styles.PANEL_HEADER_TEXT_CLASSNAME,
|
|
146
|
+
)}>{title}</TextNative>
|
|
146
147
|
</div>
|
|
147
148
|
</VStack>
|
|
148
149
|
</div>;
|
|
@@ -175,12 +176,12 @@ export default function Header(props) {
|
|
|
175
176
|
<TextNative
|
|
176
177
|
numberOfLines={1}
|
|
177
178
|
ellipsizeMode="head"
|
|
178
|
-
className={
|
|
179
|
-
Header-TextNative2
|
|
180
|
-
flex-1
|
|
181
|
-
font-bold
|
|
182
|
-
|
|
183
|
-
|
|
179
|
+
className={clsx(
|
|
180
|
+
'Header-TextNative2',
|
|
181
|
+
'flex-1',
|
|
182
|
+
'font-bold',
|
|
183
|
+
styles.PANEL_HEADER_TEXT_CLASSNAME,
|
|
184
|
+
)}
|
|
184
185
|
>{title}</TextNative>
|
|
185
186
|
{collapseBtn}
|
|
186
187
|
</HStack>
|
|
@@ -215,13 +216,13 @@ export default function Header(props) {
|
|
|
215
216
|
numberOfLines={1}
|
|
216
217
|
ellipsizeMode="head"
|
|
217
218
|
style={{ transform: [{ rotate: '-90deg'}] }}
|
|
218
|
-
className={
|
|
219
|
-
Header-TextNative3
|
|
220
|
-
font-bold
|
|
221
|
-
w-[200px]
|
|
222
|
-
text-right
|
|
223
|
-
|
|
224
|
-
|
|
219
|
+
className={clsx(
|
|
220
|
+
'Header-TextNative3',
|
|
221
|
+
'font-bold',
|
|
222
|
+
'w-[200px]',
|
|
223
|
+
'text-right',
|
|
224
|
+
styles.PANEL_HEADER_TEXT_CLASSNAME,
|
|
225
|
+
)}
|
|
225
226
|
>{title}</TextNative>
|
|
226
227
|
</VStack>
|
|
227
228
|
</VStack>
|
|
@@ -251,12 +252,12 @@ export default function Header(props) {
|
|
|
251
252
|
<TextNative
|
|
252
253
|
numberOfLines={1}
|
|
253
254
|
ellipsizeMode="head"
|
|
254
|
-
className={
|
|
255
|
-
Header-TextNative4
|
|
256
|
-
font-bold
|
|
257
|
-
flex-1
|
|
258
|
-
|
|
259
|
-
|
|
255
|
+
className={clsx(
|
|
256
|
+
'Header-TextNative4',
|
|
257
|
+
'font-bold',
|
|
258
|
+
'flex-1',
|
|
259
|
+
styles.PANEL_HEADER_TEXT_CLASSNAME,
|
|
260
|
+
)}>{title}</TextNative>
|
|
260
261
|
{collapseBtn}
|
|
261
262
|
</HStack>
|
|
262
263
|
</Pressable>;
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
VStack,
|
|
5
5
|
VStackNative,
|
|
6
6
|
} from '@project-components/Gluestack';
|
|
7
|
+
import clsx from 'clsx';
|
|
7
8
|
import {
|
|
8
9
|
HORIZONTAL,
|
|
9
10
|
VERTICAL,
|
|
@@ -136,12 +137,12 @@ function Panel(props) {
|
|
|
136
137
|
{!isCollapsed && <>
|
|
137
138
|
{topToolbar}
|
|
138
139
|
<VStack
|
|
139
|
-
className={
|
|
140
|
-
Panel-VSstack
|
|
141
|
-
flex-1
|
|
142
|
-
w-full
|
|
143
|
-
overflow-hidden
|
|
144
|
-
|
|
140
|
+
className={clsx(
|
|
141
|
+
'Panel-VSstack',
|
|
142
|
+
'flex-1',
|
|
143
|
+
'w-full',
|
|
144
|
+
'overflow-hidden',
|
|
145
|
+
)}
|
|
145
146
|
>
|
|
146
147
|
{isScrollable ?
|
|
147
148
|
<ScrollView
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
VStack,
|
|
9
9
|
VStackNative,
|
|
10
10
|
} from '@project-components/Gluestack';
|
|
11
|
+
import clsx from 'clsx';
|
|
11
12
|
import { EDITOR_TYPE__PLAIN } from '../../Constants/Editor';
|
|
12
13
|
import {
|
|
13
14
|
UI_MODE_WEB,
|
|
@@ -72,11 +73,11 @@ function Report(props) {
|
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
if (isQuickReport) {
|
|
75
|
-
let className =
|
|
76
|
-
Report
|
|
77
|
-
max-w-[100px]
|
|
78
|
-
m-2
|
|
79
|
-
|
|
76
|
+
let className = clsx(
|
|
77
|
+
'Report',
|
|
78
|
+
'max-w-[100px]',
|
|
79
|
+
'm-2',
|
|
80
|
+
);
|
|
80
81
|
if (props.className) {
|
|
81
82
|
className += ' ' + props.className;
|
|
82
83
|
}
|
|
@@ -86,28 +87,28 @@ function Report(props) {
|
|
|
86
87
|
>
|
|
87
88
|
<Pressable
|
|
88
89
|
onPress={onPressQuickReport}
|
|
89
|
-
className={
|
|
90
|
-
flex-1
|
|
91
|
-
items-center
|
|
92
|
-
justify-center
|
|
93
|
-
flex-col
|
|
94
|
-
bg-white
|
|
95
|
-
p-3
|
|
96
|
-
rounded-lg
|
|
97
|
-
border
|
|
98
|
-
border-primary-300
|
|
99
|
-
hover:bg-primary-300
|
|
100
|
-
|
|
90
|
+
className={clsx(
|
|
91
|
+
'flex-1',
|
|
92
|
+
'items-center',
|
|
93
|
+
'justify-center',
|
|
94
|
+
'flex-col',
|
|
95
|
+
'bg-white',
|
|
96
|
+
'p-3',
|
|
97
|
+
'rounded-lg',
|
|
98
|
+
'border',
|
|
99
|
+
'border-primary-300',
|
|
100
|
+
'hover:bg-primary-300',
|
|
101
|
+
)}
|
|
101
102
|
>
|
|
102
103
|
{icon}
|
|
103
104
|
<Text
|
|
104
|
-
className={
|
|
105
|
-
text-black
|
|
106
|
-
text-center
|
|
107
|
-
text-[17px]
|
|
108
|
-
leading-tight
|
|
109
|
-
mt-2
|
|
110
|
-
|
|
105
|
+
className={clsx(
|
|
106
|
+
'text-black',
|
|
107
|
+
'text-center',
|
|
108
|
+
'text-[17px]',
|
|
109
|
+
'leading-tight',
|
|
110
|
+
'mt-2',
|
|
111
|
+
)}
|
|
111
112
|
>{title}</Text>
|
|
112
113
|
</Pressable>
|
|
113
114
|
</VStackNative>;
|
|
@@ -145,16 +146,16 @@ function Report(props) {
|
|
|
145
146
|
}
|
|
146
147
|
return <VStackNative
|
|
147
148
|
{...testProps('Report-' + reportId)}
|
|
148
|
-
className={
|
|
149
|
-
w-full
|
|
150
|
-
border
|
|
151
|
-
border-primary-300
|
|
152
|
-
p-4
|
|
153
|
-
mb-3
|
|
154
|
-
bg-white
|
|
155
|
-
rounded-lg
|
|
156
|
-
shadow-sm
|
|
157
|
-
|
|
149
|
+
className={clsx(
|
|
150
|
+
'w-full',
|
|
151
|
+
'border',
|
|
152
|
+
'border-primary-300',
|
|
153
|
+
'p-4',
|
|
154
|
+
'mb-3',
|
|
155
|
+
'bg-white',
|
|
156
|
+
'rounded-lg',
|
|
157
|
+
'shadow-sm',
|
|
158
|
+
)}
|
|
158
159
|
>
|
|
159
160
|
<HStack>
|
|
160
161
|
<Box className="w-[50px] mr-4">
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
VStack,
|
|
9
9
|
VStackNative,
|
|
10
10
|
} from '@project-components/Gluestack';
|
|
11
|
+
import clsx from 'clsx';
|
|
11
12
|
import {
|
|
12
13
|
HORIZONTAL,
|
|
13
14
|
VERTICAL,
|
|
@@ -130,11 +131,11 @@ function TabBar(props) {
|
|
|
130
131
|
tooltip={isCollapsed ? 'Expand' : 'Collapse'}
|
|
131
132
|
/>;
|
|
132
133
|
} else {
|
|
133
|
-
tabClassName +=
|
|
134
|
-
|
|
135
|
-
pr-0
|
|
136
|
-
mr-0
|
|
137
|
-
|
|
134
|
+
tabClassName += clsx(
|
|
135
|
+
direction === VERTICAL ? 'w-[200px]' : '',
|
|
136
|
+
'pr-0',
|
|
137
|
+
'mr-0',
|
|
138
|
+
);
|
|
138
139
|
_icon.as = Minimize;
|
|
139
140
|
button = <Button
|
|
140
141
|
{...testProps('toggleBtn')}
|
|
@@ -158,59 +159,59 @@ function TabBar(props) {
|
|
|
158
159
|
getTabProps = () => {
|
|
159
160
|
const
|
|
160
161
|
tabProps = {
|
|
161
|
-
className:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
className: clsx(
|
|
163
|
+
styles.TAB_BG,
|
|
164
|
+
isCollapsed ? 'justify-center' : 'justify-start',
|
|
165
|
+
),
|
|
165
166
|
},
|
|
166
167
|
textProps = {
|
|
167
168
|
// numberOfLines: 1,
|
|
168
169
|
// ellipsizeMode: 'head',
|
|
169
|
-
className:
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
className: clsx(
|
|
171
|
+
styles.TAB_FONTSIZE,
|
|
172
|
+
styles.TAB_COLOR,
|
|
173
|
+
),
|
|
173
174
|
},
|
|
174
175
|
iconProps = {
|
|
175
176
|
// size: 'md',
|
|
176
|
-
className:
|
|
177
|
-
|
|
178
|
-
|
|
177
|
+
className: clsx(
|
|
178
|
+
styles.TAB_ICON_COLOR,
|
|
179
|
+
),
|
|
179
180
|
};
|
|
180
181
|
switch(direction) {
|
|
181
182
|
case VERTICAL:
|
|
182
|
-
tabProps.className +=
|
|
183
|
-
rounded-l-lg
|
|
184
|
-
rounded-r-none
|
|
185
|
-
w-full
|
|
186
|
-
ml-2
|
|
187
|
-
mr-0
|
|
188
|
-
mb-1
|
|
189
|
-
px-4
|
|
190
|
-
|
|
191
|
-
textProps.className +=
|
|
192
|
-
w-full
|
|
193
|
-
mr-0
|
|
194
|
-
mb-1
|
|
195
|
-
py-0
|
|
196
|
-
pl-3
|
|
197
|
-
pr-0
|
|
198
|
-
flex-1
|
|
199
|
-
text-left
|
|
200
|
-
|
|
183
|
+
tabProps.className += clsx(
|
|
184
|
+
'rounded-l-lg',
|
|
185
|
+
'rounded-r-none',
|
|
186
|
+
'w-full',
|
|
187
|
+
'ml-2',
|
|
188
|
+
'mr-0',
|
|
189
|
+
'mb-1',
|
|
190
|
+
'px-4',
|
|
191
|
+
);
|
|
192
|
+
textProps.className += clsx(
|
|
193
|
+
'w-full',
|
|
194
|
+
'mr-0',
|
|
195
|
+
'mb-1',
|
|
196
|
+
'py-0',
|
|
197
|
+
'pl-3',
|
|
198
|
+
'pr-0',
|
|
199
|
+
'flex-1',
|
|
200
|
+
'text-left',
|
|
201
|
+
);
|
|
201
202
|
break;
|
|
202
203
|
case HORIZONTAL:
|
|
203
|
-
tabProps.className +=
|
|
204
|
-
rounded-t
|
|
205
|
-
rounded-b-none
|
|
206
|
-
mr-1
|
|
207
|
-
py-1
|
|
208
|
-
|
|
209
|
-
textProps.className +=
|
|
210
|
-
px-1
|
|
211
|
-
py-0
|
|
212
|
-
mr-1
|
|
213
|
-
|
|
204
|
+
tabProps.className += clsx(
|
|
205
|
+
'rounded-t',
|
|
206
|
+
'rounded-b-none',
|
|
207
|
+
'mr-1',
|
|
208
|
+
'py-1',
|
|
209
|
+
);
|
|
210
|
+
textProps.className += clsx(
|
|
211
|
+
'px-1',
|
|
212
|
+
'py-0',
|
|
213
|
+
'mr-1',
|
|
214
|
+
);
|
|
214
215
|
break;
|
|
215
216
|
default:
|
|
216
217
|
}
|
|
@@ -459,16 +460,16 @@ function TabBar(props) {
|
|
|
459
460
|
tabBar = <VStackNative
|
|
460
461
|
{...testProps('TabBar')}
|
|
461
462
|
{...propsToPass}
|
|
462
|
-
className={
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
items-center
|
|
466
|
-
justify-start
|
|
467
|
-
py-2
|
|
468
|
-
overflow-x-hidden
|
|
469
|
-
overflow-y-auto
|
|
470
|
-
|
|
471
|
-
|
|
463
|
+
className={clsx(
|
|
464
|
+
isCollapsed ? 'w-[50px]' : 'w-[' + tabWidth + 'px]',
|
|
465
|
+
isCollapsed ? 'pl-1' : 'pl-4',
|
|
466
|
+
'items-center',
|
|
467
|
+
'justify-start',
|
|
468
|
+
'py-2',
|
|
469
|
+
'overflow-x-hidden',
|
|
470
|
+
'overflow-y-auto',
|
|
471
|
+
styles.TAB_BAR_CLASSNAME
|
|
472
|
+
)}
|
|
472
473
|
>
|
|
473
474
|
{renderedTabs}
|
|
474
475
|
{canToggleCollapse ?
|
|
@@ -488,16 +489,16 @@ function TabBar(props) {
|
|
|
488
489
|
if (direction === HORIZONTAL) {
|
|
489
490
|
tabBar = <HStackNative
|
|
490
491
|
{...testProps('TabBar')}
|
|
491
|
-
className={
|
|
492
|
-
|
|
493
|
-
items-center
|
|
494
|
-
justify-start
|
|
495
|
-
overflow-x-auto
|
|
496
|
-
overflow-y-hidden
|
|
497
|
-
p-1
|
|
498
|
-
pb-0
|
|
499
|
-
|
|
500
|
-
|
|
492
|
+
className={clsx(
|
|
493
|
+
'h-[' + tabHeight + 'px]',
|
|
494
|
+
'items-center',
|
|
495
|
+
'justify-start',
|
|
496
|
+
'overflow-x-auto',
|
|
497
|
+
'overflow-y-hidden',
|
|
498
|
+
'p-1',
|
|
499
|
+
'pb-0',
|
|
500
|
+
styles.TAB_BAR_CLASSNAME
|
|
501
|
+
)}
|
|
501
502
|
>
|
|
502
503
|
<ScrollView
|
|
503
504
|
horizontal={true}
|