@dartech/arsenal-ui 1.3.73 → 1.3.74
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/index.js
CHANGED
@@ -1474,8 +1474,18 @@ const formatTableRowValue = ({
|
|
1474
1474
|
const digitsOnly = new RegExp('^[-+]?[0-9]+$');
|
1475
1475
|
const floatsOnly = new RegExp(/^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/);
|
1476
1476
|
const isExpression = value => {
|
1477
|
-
|
1478
|
-
|
1477
|
+
if (typeof value === 'string') return /\$(?:S?JS)?\(/g.test(value);
|
1478
|
+
if (Array.isArray(value)) {
|
1479
|
+
for (const item of value) {
|
1480
|
+
if (isExpression(item)) return true;
|
1481
|
+
}
|
1482
|
+
}
|
1483
|
+
if (typeof value === 'object') {
|
1484
|
+
for (const key in value) {
|
1485
|
+
if (isExpression(value[key])) return true;
|
1486
|
+
}
|
1487
|
+
}
|
1488
|
+
return false;
|
1479
1489
|
};
|
1480
1490
|
const isDateType = propertyType => {
|
1481
1491
|
return propertyType === PropertyType.DATE || propertyType === PropertyType.DATE_TIME || propertyType === PropertyType.TIME;
|
@@ -1888,7 +1898,7 @@ const ControlNumberInput = _a => {
|
|
1888
1898
|
} else if (!decimal && !digitsOnly.test(val)) {
|
1889
1899
|
return 'Not valid integer';
|
1890
1900
|
}
|
1891
|
-
return true;
|
1901
|
+
return validate ? typeof validate === 'function' ? validate(val) : true : true;
|
1892
1902
|
}
|
1893
1903
|
}
|
1894
1904
|
}),
|
@@ -5585,29 +5595,25 @@ const PropertyValueComponent = ({
|
|
5585
5595
|
padding: '4px'
|
5586
5596
|
}
|
5587
5597
|
}, {
|
5588
|
-
children: value === null ? 'null' :
|
5598
|
+
children: value === null ? 'null' : JSON.stringify(value)
|
5589
5599
|
}));
|
5590
|
-
|
5591
|
-
|
5592
|
-
|
5593
|
-
|
5594
|
-
|
5595
|
-
|
5596
|
-
|
5597
|
-
|
5598
|
-
|
5599
|
-
|
5600
|
-
|
5601
|
-
|
5602
|
-
|
5603
|
-
|
5604
|
-
|
5605
|
-
|
5606
|
-
|
5607
|
-
}) : defaultRender(data);
|
5608
|
-
default:
|
5609
|
-
return defaultRender(data);
|
5610
|
-
}
|
5600
|
+
switch (property.propertyType) {
|
5601
|
+
case PropertyType.JSON:
|
5602
|
+
return jsx(JsonView, {
|
5603
|
+
value: data
|
5604
|
+
});
|
5605
|
+
case PropertyType.ENTITY:
|
5606
|
+
return jsx(DefinitionValueView, {
|
5607
|
+
properties: properties,
|
5608
|
+
data: data
|
5609
|
+
});
|
5610
|
+
case PropertyType.ANY:
|
5611
|
+
// TODO need to prefetch data and show as is
|
5612
|
+
return typeof data === 'object' ? jsx(JsonView, {
|
5613
|
+
value: data
|
5614
|
+
}) : defaultRender(data);
|
5615
|
+
default:
|
5616
|
+
return defaultRender(data);
|
5611
5617
|
}
|
5612
5618
|
};
|
5613
5619
|
const PropertyDataView = ({
|
package/package.json
CHANGED
@@ -3,6 +3,7 @@ import { PropertiesArrayType } from '../../../interfaces';
|
|
3
3
|
type Props = {
|
4
4
|
properties: PropertiesArrayType<unknown>;
|
5
5
|
data: unknown;
|
6
|
+
update?: number;
|
6
7
|
};
|
7
8
|
export declare const DefinitionValueView: ({ properties, data }: Props) => JSX.Element;
|
8
9
|
export default DefinitionValueView;
|