@onehat/ui 0.3.21 → 0.3.23
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onehat/ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.23",
|
|
4
4
|
"description": "Base UI for OneHat apps",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"js-cookie": "^3.0.5",
|
|
36
36
|
"native-base": "^3.4.28",
|
|
37
37
|
"react-hook-form": "^7.45.0",
|
|
38
|
-
"react-native-svg": "^13.13.0",
|
|
39
38
|
"react-redux": "^8.1.2",
|
|
40
39
|
"yup": "^1.2.0"
|
|
41
40
|
},
|
|
@@ -48,7 +47,8 @@
|
|
|
48
47
|
"react-dom": "*",
|
|
49
48
|
"react-draggable": "^4.4.5",
|
|
50
49
|
"react-native": "*",
|
|
51
|
-
"react-native-draggable": "^3.3.0"
|
|
50
|
+
"react-native-draggable": "^3.3.0",
|
|
51
|
+
"react-native-svg": "*"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@babel/core": "^7.22.1",
|
|
@@ -203,7 +203,7 @@ function Form(props) {
|
|
|
203
203
|
let editorProps = {};
|
|
204
204
|
if (!editor) {
|
|
205
205
|
const propertyDef = fieldName && Repository?.getSchema().getPropertyDefinition(fieldName);
|
|
206
|
-
editor = propertyDef[fieldName].
|
|
206
|
+
editor = propertyDef[fieldName].editorType;
|
|
207
207
|
if (_.isPlainObject(editor)) {
|
|
208
208
|
const {
|
|
209
209
|
type,
|
|
@@ -276,14 +276,25 @@ function Form(props) {
|
|
|
276
276
|
if (propertyDef?.isEditingDisabled) {
|
|
277
277
|
isEditable = false;
|
|
278
278
|
}
|
|
279
|
-
if (
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
279
|
+
if (!type && Repository) {
|
|
280
|
+
if (isEditable) {
|
|
281
|
+
const
|
|
282
|
+
{
|
|
283
|
+
type: t,
|
|
284
|
+
...p
|
|
285
|
+
} = propertyDef.editorType;
|
|
286
|
+
type = t;
|
|
287
|
+
editorTypeProps = p;
|
|
288
|
+
} else if (propertyDef.viewerType) {
|
|
289
|
+
const
|
|
290
|
+
{
|
|
291
|
+
type: t,
|
|
292
|
+
...p
|
|
293
|
+
} = propertyDef.viewerType;
|
|
294
|
+
type = t
|
|
295
|
+
} else {
|
|
296
|
+
type = 'Text';
|
|
297
|
+
}
|
|
287
298
|
}
|
|
288
299
|
if (type?.match && type.match(/Combo$/) && Repository?.isRemote && !Repository?.isLoaded) {
|
|
289
300
|
editorTypeProps.autoLoad = true;
|
|
@@ -307,10 +318,8 @@ function Form(props) {
|
|
|
307
318
|
}
|
|
308
319
|
|
|
309
320
|
if (isEditorViewOnly || !isEditable) {
|
|
310
|
-
const
|
|
311
|
-
|
|
312
|
-
value = (record && record[name]) || (startingValues && startingValues[name]) || null;
|
|
313
|
-
let element = <Text
|
|
321
|
+
const value = (record && record[name]) || (startingValues && startingValues[name]) || null;
|
|
322
|
+
let element = <Element
|
|
314
323
|
value={value}
|
|
315
324
|
{...propsToPass}
|
|
316
325
|
/>;
|
|
@@ -66,14 +66,17 @@ function Panel(props) {
|
|
|
66
66
|
|
|
67
67
|
useEffect(() => {
|
|
68
68
|
let titleSuffix = '';
|
|
69
|
+
if (props.titleSuffix) {
|
|
70
|
+
titleSuffix += ' ' + props.titleSuffix;
|
|
71
|
+
}
|
|
69
72
|
if (selectorSelected?.[0]?.displayValue) {
|
|
70
|
-
titleSuffix
|
|
73
|
+
titleSuffix += ' for ' + selectorSelected[0].displayValue;
|
|
71
74
|
}
|
|
72
75
|
setTitleSuffix(titleSuffix);
|
|
73
76
|
if (!isReady) {
|
|
74
77
|
setIsReady(true);
|
|
75
78
|
}
|
|
76
|
-
}, [selectorSelected,
|
|
79
|
+
}, [selectorSelected, props.titleSuffix]);
|
|
77
80
|
|
|
78
81
|
if (!isReady) {
|
|
79
82
|
return null;
|
|
@@ -18,10 +18,10 @@ function TagViewer(props) {
|
|
|
18
18
|
return <Text
|
|
19
19
|
numberOfLines={1}
|
|
20
20
|
ellipsizeMode="head"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
fontSize={styles.FORM_TEXT_FONTSIZE}
|
|
22
|
+
minHeight='40px'
|
|
23
|
+
px={3}
|
|
24
|
+
py={2}
|
|
25
25
|
{...props}
|
|
26
26
|
>{values}</Text>;
|
|
27
27
|
}
|