@onehat/ui 0.4.70 → 0.4.72
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 +18 -10
- 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 +14 -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/MeterTypesCombo.js +4 -2
- 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 +20 -18
- package/src/Components/Form/Field/Json.js +7 -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 +104 -103
- package/src/Components/Form/Label.js +15 -14
- package/src/Components/Grid/Grid.js +62 -52
- package/src/Components/Grid/GridHeaderRow.js +42 -40
- package/src/Components/Grid/GridRow.js +92 -90
- 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 +26 -10
- package/src/Components/Grid/RowHandle.js +55 -0
- package/src/Components/Grid/RowSelectHandle.js +1 -0
- package/src/{Hooks → Components/Grid}/useAsyncRenderers.js +1 -1
- package/src/Components/Hoc/Secondary/withSecondaryData.js +2 -1
- package/src/Components/Hoc/Secondary/withSecondaryEditor.js +4 -3
- package/src/Components/Hoc/Secondary/withSecondarySelection.js +3 -2
- package/src/Components/Hoc/Secondary/withSecondaryValue.js +2 -1
- package/src/Components/Hoc/Secondary/withSecondaryWindowedEditor.js +6 -5
- package/src/Components/Hoc/withAlert.js +38 -35
- package/src/Components/Hoc/withCollapsible.js +9 -4
- package/src/Components/Hoc/withComponent.js +6 -0
- package/src/Components/Hoc/withContextMenu.js +33 -26
- package/src/Components/Hoc/withData.js +3 -2
- package/src/Components/Hoc/withDnd.js +17 -8
- package/src/Components/Hoc/withDraggable.js +21 -5
- package/src/Components/Hoc/withEditor.js +3 -2
- package/src/Components/Hoc/withEvents.js +11 -1
- package/src/Components/Hoc/withFilters.js +26 -20
- package/src/Components/Hoc/withModal.js +10 -8
- package/src/Components/Hoc/withPdfButtons.js +3 -2
- package/src/Components/Hoc/withPermissions.js +3 -2
- package/src/Components/Hoc/withPresetButtons.js +3 -2
- package/src/Components/Hoc/withSelection.js +2 -8
- package/src/Components/Hoc/withToast.js +5 -2
- package/src/Components/Hoc/withTooltip.js +10 -1
- package/src/Components/Hoc/withValue.js +3 -9
- 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/GlobalModals.js +47 -0
- 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 +34 -17
- package/src/Components/Tree/TreeNode.js +30 -29
- package/src/Components/Tree/TreeNodeDragHandle.js +18 -13
- package/src/Components/Viewer/MeterTypeText.js +29 -8
- 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/Constants/MeterTypes.js +2 -0
- package/src/Functions/addIconProps.js +46 -0
- package/src/Functions/testProps.js +1 -1
- package/src/Hooks/useWhyDidYouUpdate.js +33 -0
- package/src/PlatformImports/Web/Attachments.js +1 -1
- package/src/Components/Hoc/withBlank.js +0 -10
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
HStack,
|
|
4
4
|
VStackNative,
|
|
5
5
|
} from '@project-components/Gluestack';
|
|
6
|
+
import clsx from 'clsx';
|
|
6
7
|
import {
|
|
7
8
|
EDITOR_TYPE__WINDOWED,
|
|
8
9
|
} from '../../../../Constants/Editor.js';
|
|
@@ -79,10 +80,10 @@ function TagComponent(props) {
|
|
|
79
80
|
isEditorViewOnly={true}
|
|
80
81
|
selection={[record]}
|
|
81
82
|
onEditorClose={hideModal}
|
|
82
|
-
className={
|
|
83
|
-
w-full
|
|
84
|
-
p-0
|
|
85
|
-
|
|
83
|
+
className={clsx(
|
|
84
|
+
'w-full',
|
|
85
|
+
'p-0',
|
|
86
|
+
)}
|
|
86
87
|
/>,
|
|
87
88
|
onCancel: hideModal,
|
|
88
89
|
});
|
|
@@ -244,11 +245,11 @@ function TagComponent(props) {
|
|
|
244
245
|
_combo.selectorSelectedField = propsToPass.selectorSelectedField;
|
|
245
246
|
}
|
|
246
247
|
|
|
247
|
-
let className =
|
|
248
|
-
Tag
|
|
249
|
-
w-full
|
|
250
|
-
p-0
|
|
251
|
-
|
|
248
|
+
let className = clsx(
|
|
249
|
+
'Tag',
|
|
250
|
+
'w-full',
|
|
251
|
+
'p-0',
|
|
252
|
+
);
|
|
252
253
|
if (isInFilter) {
|
|
253
254
|
className += ' max-w-[250px]';
|
|
254
255
|
}
|
|
@@ -269,21 +270,21 @@ function TagComponent(props) {
|
|
|
269
270
|
style.flex = props.flex;
|
|
270
271
|
}
|
|
271
272
|
}
|
|
272
|
-
let valueBoxesClassName =
|
|
273
|
-
Tag-valueBoxes-container
|
|
274
|
-
w-full
|
|
275
|
-
min-h-[40px]
|
|
276
|
-
max-h-[200px]
|
|
277
|
-
mb-1
|
|
278
|
-
p-1
|
|
279
|
-
flex-wrap
|
|
280
|
-
overflow-auto
|
|
281
|
-
border
|
|
282
|
-
border-grey-300
|
|
283
|
-
rounded-md
|
|
284
|
-
bg-grey-100
|
|
285
|
-
|
|
286
|
-
|
|
273
|
+
let valueBoxesClassName = clsx(
|
|
274
|
+
'Tag-valueBoxes-container',
|
|
275
|
+
'w-full',
|
|
276
|
+
'min-h-[40px]',
|
|
277
|
+
'max-h-[200px]',
|
|
278
|
+
'mb-1',
|
|
279
|
+
'p-1',
|
|
280
|
+
'flex-wrap',
|
|
281
|
+
'overflow-auto',
|
|
282
|
+
'border',
|
|
283
|
+
'border-grey-300',
|
|
284
|
+
'rounded-md',
|
|
285
|
+
'bg-grey-100',
|
|
286
|
+
styles.FORM_TAG_CLASSNAME,
|
|
287
|
+
),
|
|
287
288
|
comboClassName = '';
|
|
288
289
|
if (_combo.className) {
|
|
289
290
|
comboClassName = _combo.className;
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
HStackNative,
|
|
3
3
|
Text,
|
|
4
4
|
} from '@project-components/Gluestack';
|
|
5
|
+
import clsx from 'clsx';
|
|
5
6
|
import testProps from '../../../../Functions/testProps.js';
|
|
6
7
|
import IconButton from '../../../Buttons/IconButton.js';
|
|
7
8
|
import Eye from '../../../Icons/Eye.js';
|
|
@@ -20,17 +21,17 @@ export default function ValueBox(props) {
|
|
|
20
21
|
styles = UiGlobals.styles;
|
|
21
22
|
return <HStackNative
|
|
22
23
|
{...testProps('valueBox-' + text)}
|
|
23
|
-
className={
|
|
24
|
-
ValueBox-HStackNative
|
|
25
|
-
max-w-full
|
|
26
|
-
items-center
|
|
27
|
-
mr-1
|
|
28
|
-
bg-grey-100
|
|
29
|
-
border
|
|
30
|
-
border-grey-400
|
|
31
|
-
rounded-md
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
className={clsx(
|
|
25
|
+
'ValueBox-HStackNative',
|
|
26
|
+
'max-w-full',
|
|
27
|
+
'items-center',
|
|
28
|
+
'mr-1',
|
|
29
|
+
'bg-grey-100',
|
|
30
|
+
'border',
|
|
31
|
+
'border-grey-400',
|
|
32
|
+
'rounded-md',
|
|
33
|
+
!onDelete ? 'pr-4' : '',
|
|
34
|
+
)}
|
|
34
35
|
>
|
|
35
36
|
{showEye &&
|
|
36
37
|
<IconButton
|
|
@@ -41,22 +42,22 @@ export default function ValueBox(props) {
|
|
|
41
42
|
className: 'text-grey-600',
|
|
42
43
|
}}
|
|
43
44
|
onPress={onView}
|
|
44
|
-
className={
|
|
45
|
-
ValueBox-eyeBtn
|
|
46
|
-
h-full
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
className={clsx(
|
|
46
|
+
'ValueBox-eyeBtn',
|
|
47
|
+
'h-full',
|
|
48
|
+
minimizeForRow ? 'py-0' : '',
|
|
49
|
+
styles.FORM_TAG_BTN_CLASSNAME,
|
|
50
|
+
)}
|
|
50
51
|
/>}
|
|
51
52
|
<Text
|
|
52
|
-
className={
|
|
53
|
-
ValueBox-Text
|
|
54
|
-
text-grey-600
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
className={clsx(
|
|
54
|
+
'ValueBox-Text',
|
|
55
|
+
'text-grey-600',
|
|
56
|
+
styles.FORM_TAG_VALUEBOX_CLASSNAME,
|
|
57
|
+
showEye ? 'ml-0' : 'ml-1',
|
|
58
|
+
onDelete ? 'mr-0' : 'mr-1',
|
|
59
|
+
minimizeForRow ? 'py-0' : '',
|
|
60
|
+
)}
|
|
60
61
|
>{text}</Text>
|
|
61
62
|
{onDelete &&
|
|
62
63
|
<IconButton
|
|
@@ -67,12 +68,12 @@ export default function ValueBox(props) {
|
|
|
67
68
|
className: 'text-grey-600',
|
|
68
69
|
}}
|
|
69
70
|
onPress={onDelete}
|
|
70
|
-
className={
|
|
71
|
-
ValueBox-xBtn
|
|
72
|
-
h-full
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
className={clsx(
|
|
72
|
+
'ValueBox-xBtn',
|
|
73
|
+
'h-full',
|
|
74
|
+
minimizeForRow ? 'py-0' : '',
|
|
75
|
+
styles.FORM_TAG_BTN_CLASSNAME,
|
|
76
|
+
)}
|
|
76
77
|
/>}
|
|
77
78
|
</HStackNative>;
|
|
78
79
|
}
|
|
@@ -2,6 +2,7 @@ import { forwardRef } from 'react';
|
|
|
2
2
|
import {
|
|
3
3
|
TextNative,
|
|
4
4
|
} from '@project-components/Gluestack';
|
|
5
|
+
import clsx from 'clsx';
|
|
5
6
|
import UiGlobals from '../../../UiGlobals.js';
|
|
6
7
|
import withComponent from '../../Hoc/withComponent.js';
|
|
7
8
|
import withTooltip from '../../Hoc/withTooltip.js';
|
|
@@ -10,14 +11,14 @@ const
|
|
|
10
11
|
TextElement = (props) => {
|
|
11
12
|
const styles = UiGlobals.styles;
|
|
12
13
|
|
|
13
|
-
let className =
|
|
14
|
-
Text
|
|
15
|
-
flex-1
|
|
16
|
-
min-h-[40px]
|
|
17
|
-
px-3
|
|
18
|
-
py-2
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
let className = clsx(
|
|
15
|
+
'Text',
|
|
16
|
+
'flex-1',
|
|
17
|
+
'min-h-[40px]',
|
|
18
|
+
'px-3',
|
|
19
|
+
'py-2',
|
|
20
|
+
styles.FORM_TEXT_CLASSNAME,
|
|
21
|
+
);
|
|
21
22
|
if (props.className) {
|
|
22
23
|
className += ' ' + props.className;
|
|
23
24
|
}
|
|
@@ -2,6 +2,7 @@ import { forwardRef, useState, useEffect, useRef, } from 'react';
|
|
|
2
2
|
import {
|
|
3
3
|
Textarea, TextareaInput,
|
|
4
4
|
} from '@project-components/Gluestack';
|
|
5
|
+
import clsx from 'clsx';
|
|
5
6
|
import UiGlobals from '../../../UiGlobals.js';
|
|
6
7
|
import withComponent from '../../Hoc/withComponent.js';
|
|
7
8
|
import withTooltip from '../../Hoc/withTooltip.js';
|
|
@@ -79,14 +80,14 @@ const TextAreaElement = forwardRef((props, ref) => {
|
|
|
79
80
|
if (localValue === null || typeof localValue === 'undefined') {
|
|
80
81
|
localValue = ''; // If the value is null or undefined, don't let this be an uncontrolled input
|
|
81
82
|
}
|
|
82
|
-
let textareaClassName =
|
|
83
|
-
Textarea
|
|
84
|
-
|
|
85
|
-
inputClassName =
|
|
86
|
-
TextAreaInput
|
|
87
|
-
flex-1
|
|
88
|
-
|
|
89
|
-
|
|
83
|
+
let textareaClassName = clsx(
|
|
84
|
+
'Textarea',
|
|
85
|
+
),
|
|
86
|
+
inputClassName = clsx(
|
|
87
|
+
'TextAreaInput',
|
|
88
|
+
'flex-1',
|
|
89
|
+
styles.FORM_TEXTAREA_CLASSNAME,
|
|
90
|
+
);
|
|
90
91
|
if (className) {
|
|
91
92
|
inputClassName += ' ' + className;
|
|
92
93
|
}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
Switch,
|
|
7
7
|
TextNative,
|
|
8
8
|
} from '@project-components/Gluestack';
|
|
9
|
+
import clsx from 'clsx';
|
|
9
10
|
import UiGlobals from '../../../UiGlobals.js';
|
|
10
11
|
import IconButton from '../../Buttons/IconButton.js';
|
|
11
12
|
import Na from '../../Icons/Na.js';
|
|
@@ -44,12 +45,12 @@ const
|
|
|
44
45
|
}
|
|
45
46
|
};
|
|
46
47
|
|
|
47
|
-
let className =
|
|
48
|
-
Toggle
|
|
49
|
-
h-full
|
|
50
|
-
items-center
|
|
51
|
-
py-[2px]
|
|
52
|
-
|
|
48
|
+
let className = clsx(
|
|
49
|
+
'Toggle',
|
|
50
|
+
'h-full',
|
|
51
|
+
'items-center',
|
|
52
|
+
'py-[2px]',
|
|
53
|
+
);
|
|
53
54
|
if (props.className) {
|
|
54
55
|
className += ' ' + props.className;
|
|
55
56
|
}
|
|
@@ -64,10 +65,10 @@ const
|
|
|
64
65
|
className: 'text-grey-400',
|
|
65
66
|
}}
|
|
66
67
|
onPress={onToggle}
|
|
67
|
-
className={
|
|
68
|
-
border
|
|
69
|
-
border-grey-700
|
|
70
|
-
|
|
68
|
+
className={clsx(
|
|
69
|
+
'border',
|
|
70
|
+
'border-grey-700',
|
|
71
|
+
)}
|
|
71
72
|
/>
|
|
72
73
|
</HStack>;
|
|
73
74
|
}
|
|
@@ -98,11 +99,11 @@ const
|
|
|
98
99
|
>
|
|
99
100
|
<TextNative
|
|
100
101
|
{...testProps('readout')}
|
|
101
|
-
className={
|
|
102
|
-
ml-1
|
|
103
|
-
mr-2
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
className={clsx(
|
|
103
|
+
'ml-1',
|
|
104
|
+
'mr-2',
|
|
105
|
+
styles.FORM_TOGGLE_READOUT_CLASSNAME,
|
|
106
|
+
)}
|
|
106
107
|
>{_.isNil(value) ? 'N/A' : (!!value ? onText : offText)}</TextNative>
|
|
107
108
|
</Pressable>
|
|
108
109
|
</HStack>;
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
Text,
|
|
6
6
|
TextNative,
|
|
7
7
|
} from '@project-components/Gluestack';
|
|
8
|
+
import clsx from 'clsx';
|
|
8
9
|
import FieldSetContext from '../../Contexts/FieldSetContext.js';
|
|
9
10
|
import useForceUpdate from '../../Hooks/useForceUpdate.js';
|
|
10
11
|
import testProps from '../../Functions/testProps.js';
|
|
@@ -76,17 +77,17 @@ export default function FieldSet(props) {
|
|
|
76
77
|
}
|
|
77
78
|
};
|
|
78
79
|
|
|
79
|
-
let className =
|
|
80
|
-
FieldSet-Box
|
|
81
|
-
mb-4
|
|
82
|
-
mx-0
|
|
83
|
-
p-1
|
|
84
|
-
pb-2
|
|
85
|
-
gap-2
|
|
86
|
-
border
|
|
87
|
-
border-grey-400
|
|
88
|
-
|
|
89
|
-
|
|
80
|
+
let className = clsx(
|
|
81
|
+
'FieldSet-Box',
|
|
82
|
+
'mb-4',
|
|
83
|
+
'mx-0',
|
|
84
|
+
'p-1',
|
|
85
|
+
'pb-2',
|
|
86
|
+
'gap-2',
|
|
87
|
+
'border',
|
|
88
|
+
'border-grey-400',
|
|
89
|
+
styles.FORM_FIELDSET_BG,
|
|
90
|
+
);
|
|
90
91
|
if (props.className) {
|
|
91
92
|
className += props.className;
|
|
92
93
|
}
|
|
@@ -99,25 +100,25 @@ export default function FieldSet(props) {
|
|
|
99
100
|
{title &&
|
|
100
101
|
<HStack
|
|
101
102
|
style={{ userSelect: 'none', }}
|
|
102
|
-
className={
|
|
103
|
-
FieldSet-title-HStack
|
|
104
|
-
w-full
|
|
105
|
-
mb-1
|
|
106
|
-
border
|
|
107
|
-
border-b-grey-200
|
|
108
|
-
|
|
103
|
+
className={clsx(
|
|
104
|
+
'FieldSet-title-HStack',
|
|
105
|
+
'w-full',
|
|
106
|
+
'mb-1',
|
|
107
|
+
'border',
|
|
108
|
+
'border-b-grey-200',
|
|
109
|
+
)}
|
|
109
110
|
>
|
|
110
111
|
<TextNative
|
|
111
112
|
numberOfLines={1}
|
|
112
113
|
ellipsizeMode="head"
|
|
113
|
-
className={
|
|
114
|
-
FieldSet-title-TextNative
|
|
115
|
-
flex-1
|
|
116
|
-
py-1
|
|
117
|
-
px-3
|
|
118
|
-
font-bold
|
|
119
|
-
|
|
120
|
-
|
|
114
|
+
className={clsx(
|
|
115
|
+
'FieldSet-title-TextNative',
|
|
116
|
+
'flex-1',
|
|
117
|
+
'py-1',
|
|
118
|
+
'px-3',
|
|
119
|
+
'font-bold',
|
|
120
|
+
styles.FORM_FIELDSET_FONTSIZE,
|
|
121
|
+
)}
|
|
121
122
|
>{title}</TextNative>
|
|
122
123
|
|
|
123
124
|
{showToggleAllCheckbox &&
|
|
@@ -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 Animated, {
|
|
12
13
|
useSharedValue,
|
|
13
14
|
useAnimatedStyle,
|
|
@@ -222,16 +223,16 @@ function Form(props) {
|
|
|
222
223
|
// Build the fields that match the current columnsConfig in the grid
|
|
223
224
|
const
|
|
224
225
|
elements = [],
|
|
225
|
-
columnClassName =
|
|
226
|
-
Form-column
|
|
227
|
-
justify-center
|
|
228
|
-
items-center
|
|
229
|
-
h-[60px]
|
|
230
|
-
border-r-1
|
|
231
|
-
border-r-grey-200
|
|
232
|
-
px-1
|
|
233
|
-
|
|
234
|
-
|
|
226
|
+
columnClassName = clsx(
|
|
227
|
+
'Form-column',
|
|
228
|
+
'justify-center',
|
|
229
|
+
'items-center',
|
|
230
|
+
'h-[60px]',
|
|
231
|
+
'border-r-1',
|
|
232
|
+
'border-r-grey-200',
|
|
233
|
+
'px-1',
|
|
234
|
+
styles.INLINE_EDITOR_MIN_WIDTH,
|
|
235
|
+
);
|
|
235
236
|
_.each(columnsConfig, (config, ix) => {
|
|
236
237
|
let {
|
|
237
238
|
fieldName,
|
|
@@ -459,21 +460,21 @@ function Form(props) {
|
|
|
459
460
|
<Icon
|
|
460
461
|
as={Pencil}
|
|
461
462
|
size="2xs"
|
|
462
|
-
className={
|
|
463
|
-
absolute
|
|
464
|
-
top-[2px]
|
|
465
|
-
left-[2px]
|
|
466
|
-
text-grey-300
|
|
467
|
-
|
|
463
|
+
className={clsx(
|
|
464
|
+
'absolute',
|
|
465
|
+
'top-[2px]',
|
|
466
|
+
'left-[2px]',
|
|
467
|
+
'text-grey-300',
|
|
468
|
+
)}
|
|
468
469
|
/> : null;
|
|
469
470
|
return <HStack
|
|
470
471
|
key={fieldName + '-HStack-' + ix}
|
|
471
|
-
className={
|
|
472
|
-
Form-HStack1
|
|
473
|
-
flex-${flex}
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
472
|
+
className={clsx(
|
|
473
|
+
'Form-HStack1',
|
|
474
|
+
`flex-${flex}`,
|
|
475
|
+
error ? 'bg-[#fdd]' : 'bg-white',
|
|
476
|
+
columnClassName,
|
|
477
|
+
)}
|
|
477
478
|
style={{
|
|
478
479
|
width: w,
|
|
479
480
|
}}
|
|
@@ -851,13 +852,13 @@ function Form(props) {
|
|
|
851
852
|
}
|
|
852
853
|
if (isRequired) {
|
|
853
854
|
requiredIndicator = <Text
|
|
854
|
-
className={
|
|
855
|
-
Form-requiredIndicator
|
|
856
|
-
self-center
|
|
857
|
-
text-[#f00]
|
|
858
|
-
text-[30px]
|
|
859
|
-
pr-1
|
|
860
|
-
|
|
855
|
+
className={clsx(
|
|
856
|
+
'Form-requiredIndicator',
|
|
857
|
+
'self-center',
|
|
858
|
+
'text-[#f00]',
|
|
859
|
+
'text-[30px]',
|
|
860
|
+
'pr-1',
|
|
861
|
+
)}
|
|
861
862
|
>*</Text>;
|
|
862
863
|
}
|
|
863
864
|
}
|
|
@@ -900,22 +901,22 @@ function Form(props) {
|
|
|
900
901
|
<Icon
|
|
901
902
|
as={Pencil}
|
|
902
903
|
size="2xs"
|
|
903
|
-
className={
|
|
904
|
-
absolute
|
|
905
|
-
top-[2px]
|
|
906
|
-
left-[2px]
|
|
907
|
-
text-grey-300
|
|
908
|
-
|
|
904
|
+
className={clsx(
|
|
905
|
+
'absolute',
|
|
906
|
+
'top-[2px]',
|
|
907
|
+
'left-[2px]',
|
|
908
|
+
'text-grey-300',
|
|
909
|
+
)}
|
|
909
910
|
/> : null;
|
|
910
911
|
return <HStack
|
|
911
912
|
key={'Controller-HStack-' + ix}
|
|
912
|
-
className={
|
|
913
|
-
Form-HStack11
|
|
914
|
-
min-h-[50px]
|
|
915
|
-
w-full
|
|
916
|
-
flex-none
|
|
917
|
-
|
|
918
|
-
|
|
913
|
+
className={clsx(
|
|
914
|
+
'Form-HStack11',
|
|
915
|
+
'min-h-[50px]',
|
|
916
|
+
'w-full',
|
|
917
|
+
'flex-none',
|
|
918
|
+
error ? 'bg-[#fdd]' : '',
|
|
919
|
+
)}
|
|
919
920
|
>
|
|
920
921
|
{dirtyIcon}
|
|
921
922
|
{element}
|
|
@@ -981,11 +982,11 @@ function Form(props) {
|
|
|
981
982
|
title += ' for ' + record.displayValue;
|
|
982
983
|
}
|
|
983
984
|
titleElement = <Text
|
|
984
|
-
className={
|
|
985
|
-
Form-Ancillary-Title
|
|
986
|
-
font-bold
|
|
987
|
-
|
|
988
|
-
|
|
985
|
+
className={clsx(
|
|
986
|
+
'Form-Ancillary-Title',
|
|
987
|
+
'font-bold',
|
|
988
|
+
styles.FORM_ANCILLARY_TITLE_CLASSNAME
|
|
989
|
+
)}
|
|
989
990
|
>{title}</Text>;
|
|
990
991
|
if (icon) {
|
|
991
992
|
titleElement = <HStack className="items-center"><Icon as={icon} className="w-[32px] h-[32px] mr-2" />{titleElement}</HStack>
|
|
@@ -993,21 +994,21 @@ function Form(props) {
|
|
|
993
994
|
}
|
|
994
995
|
if (description) {
|
|
995
996
|
description = <Text
|
|
996
|
-
className={
|
|
997
|
-
Form-Ancillary-Description
|
|
998
|
-
italic
|
|
999
|
-
|
|
1000
|
-
|
|
997
|
+
className={clsx(
|
|
998
|
+
'Form-Ancillary-Description',
|
|
999
|
+
'italic',
|
|
1000
|
+
styles.FORM_ANCILLARY_DESCRIPTION_CLASSNAME
|
|
1001
|
+
)}
|
|
1001
1002
|
>{description}</Text>;
|
|
1002
1003
|
}
|
|
1003
1004
|
components.push(<VStack
|
|
1004
1005
|
ref={(el) => (ancillaryItemsRef.current[ix +1 /* offset for "scroll to top" */] = el)}
|
|
1005
1006
|
key={'ancillary-' + ix}
|
|
1006
|
-
className={
|
|
1007
|
-
Form-VStack12
|
|
1008
|
-
mx-1
|
|
1009
|
-
my-3
|
|
1010
|
-
|
|
1007
|
+
className={clsx(
|
|
1008
|
+
'Form-VStack12',
|
|
1009
|
+
'mx-1',
|
|
1010
|
+
'my-3'
|
|
1011
|
+
)}
|
|
1011
1012
|
>
|
|
1012
1013
|
{titleElement}
|
|
1013
1014
|
{description}
|
|
@@ -1213,9 +1214,9 @@ function Form(props) {
|
|
|
1213
1214
|
size: 'sm',
|
|
1214
1215
|
className: 'text-white',
|
|
1215
1216
|
}}
|
|
1216
|
-
className={
|
|
1217
|
-
mr-4
|
|
1218
|
-
|
|
1217
|
+
className={clsx(
|
|
1218
|
+
'mr-4'
|
|
1219
|
+
)}
|
|
1219
1220
|
text="Back"
|
|
1220
1221
|
/>}
|
|
1221
1222
|
<Text className="text-[20px] ml-1 text-grey-500">Edit Mode</Text>
|
|
@@ -1310,11 +1311,11 @@ function Form(props) {
|
|
|
1310
1311
|
key="deleteBtn"
|
|
1311
1312
|
onPress={onDelete}
|
|
1312
1313
|
icon={Trash}
|
|
1313
|
-
className={
|
|
1314
|
-
bg-warning-500
|
|
1315
|
-
hover:bg-warning-700
|
|
1316
|
-
text-white
|
|
1317
|
-
|
|
1314
|
+
className={clsx(
|
|
1315
|
+
'bg-warning-500',
|
|
1316
|
+
'hover:bg-warning-700',
|
|
1317
|
+
'text-white',
|
|
1318
|
+
)}
|
|
1318
1319
|
text="Delete"
|
|
1319
1320
|
/>
|
|
1320
1321
|
</HStack>}
|
|
@@ -1393,44 +1394,44 @@ function Form(props) {
|
|
|
1393
1394
|
if (editorType === EDITOR_TYPE__INLINE) {
|
|
1394
1395
|
footer =
|
|
1395
1396
|
<Box
|
|
1396
|
-
className={
|
|
1397
|
-
Form-inlineFooter-container
|
|
1398
|
-
relative
|
|
1399
|
-
w-full
|
|
1400
|
-
|
|
1397
|
+
className={clsx(
|
|
1398
|
+
'Form-inlineFooter-container',
|
|
1399
|
+
'relative',
|
|
1400
|
+
'w-full',
|
|
1401
|
+
)}
|
|
1401
1402
|
>
|
|
1402
1403
|
<HStack
|
|
1403
|
-
className={
|
|
1404
|
-
Form-inlineFooter
|
|
1405
|
-
absolute
|
|
1406
|
-
top-[5px]
|
|
1407
|
-
left-[40px]
|
|
1408
|
-
w-[100px]
|
|
1409
|
-
min-w-[300px]
|
|
1410
|
-
py-2
|
|
1411
|
-
gap-2
|
|
1412
|
-
justify-center
|
|
1413
|
-
items-center
|
|
1414
|
-
rounded-b-lg
|
|
1415
|
-
bg-primary-700
|
|
1416
|
-
|
|
1404
|
+
className={clsx(
|
|
1405
|
+
'Form-inlineFooter',
|
|
1406
|
+
'absolute',
|
|
1407
|
+
'top-[5px]',
|
|
1408
|
+
'left-[40px]',
|
|
1409
|
+
'w-[100px]',
|
|
1410
|
+
'min-w-[300px]',
|
|
1411
|
+
'py-2',
|
|
1412
|
+
'gap-2',
|
|
1413
|
+
'justify-center',
|
|
1414
|
+
'items-center',
|
|
1415
|
+
'rounded-b-lg',
|
|
1416
|
+
'bg-primary-700',
|
|
1417
|
+
)}
|
|
1417
1418
|
>{footerButtons}</HStack>
|
|
1418
1419
|
</Box>;
|
|
1419
1420
|
} else {
|
|
1420
1421
|
if (!disableFooter) {
|
|
1421
|
-
let footerClassName =
|
|
1422
|
-
Form-Footer
|
|
1423
|
-
justify-end
|
|
1424
|
-
gap-2
|
|
1425
|
-
|
|
1422
|
+
let footerClassName = clsx(
|
|
1423
|
+
'Form-Footer',
|
|
1424
|
+
'justify-end',
|
|
1425
|
+
'gap-2',
|
|
1426
|
+
);
|
|
1426
1427
|
if (editorType === EDITOR_TYPE__INLINE) {
|
|
1427
|
-
footerClassName +=
|
|
1428
|
-
sticky
|
|
1429
|
-
self-start
|
|
1430
|
-
justify-center
|
|
1431
|
-
bg-primary-100
|
|
1432
|
-
rounded-b-lg
|
|
1433
|
-
|
|
1428
|
+
footerClassName += clsx(
|
|
1429
|
+
'sticky',
|
|
1430
|
+
'self-start',
|
|
1431
|
+
'justify-center',
|
|
1432
|
+
'bg-primary-100',
|
|
1433
|
+
'rounded-b-lg',
|
|
1434
|
+
);
|
|
1434
1435
|
}
|
|
1435
1436
|
if (isSaving) {
|
|
1436
1437
|
footerClassName += ' border-t-2 border-t-[#f00]'
|
|
@@ -1458,13 +1459,13 @@ function Form(props) {
|
|
|
1458
1459
|
editor}
|
|
1459
1460
|
{editorType !== EDITOR_TYPE__INLINE &&
|
|
1460
1461
|
<ScrollView
|
|
1461
|
-
className={
|
|
1462
|
-
Form-ScrollView
|
|
1463
|
-
w-full
|
|
1464
|
-
flex-1
|
|
1465
|
-
pb-1
|
|
1466
|
-
web:min-h-[${minHeight}px]
|
|
1467
|
-
|
|
1462
|
+
className={clsx(
|
|
1463
|
+
'Form-ScrollView',
|
|
1464
|
+
'w-full',
|
|
1465
|
+
'flex-1',
|
|
1466
|
+
'pb-1',
|
|
1467
|
+
`web:min-h-[${minHeight}px]`,
|
|
1468
|
+
)}
|
|
1468
1469
|
onScroll={onScroll}
|
|
1469
1470
|
scrollEventThrottle={16 /* ms */}
|
|
1470
1471
|
contentContainerStyle={{
|