@dartech/arsenal-ui 1.3.99 → 1.4.0
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
|
@@ -34,7 +34,7 @@ import { abcdef } from '@uiw/codemirror-theme-abcdef';
|
|
|
34
34
|
import Typography from '@mui/material/Typography';
|
|
35
35
|
import Switch from '@mui/material/Switch';
|
|
36
36
|
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
|
|
37
|
-
import { format, isMatch, isValid
|
|
37
|
+
import { format, parse, isMatch, isValid } from 'date-fns';
|
|
38
38
|
import { DateTimePicker } from '@mui/x-date-pickers/DateTimePicker';
|
|
39
39
|
import { TimePicker } from '@mui/x-date-pickers/TimePicker';
|
|
40
40
|
import Chip from '@mui/material/Chip';
|
|
@@ -1531,7 +1531,14 @@ const formatPropertyValue = (propertyType, value, params) => {
|
|
|
1531
1531
|
case PropertyType.DATE_TIME:
|
|
1532
1532
|
case PropertyType.TIME:
|
|
1533
1533
|
{
|
|
1534
|
-
if (value)
|
|
1534
|
+
if (value) {
|
|
1535
|
+
try {
|
|
1536
|
+
const formatString = params.formatText.replace(/[Z,z,x]+/g, 'XX');
|
|
1537
|
+
parsedValue = format(parse(value, formatString, new Date()), formatString);
|
|
1538
|
+
} catch (e) {
|
|
1539
|
+
console.error(e);
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1535
1542
|
break;
|
|
1536
1543
|
}
|
|
1537
1544
|
case PropertyType.JSON:
|
|
@@ -5239,9 +5246,10 @@ const CreatePropertiesList = /*#__PURE__*/forwardRef(({
|
|
|
5239
5246
|
return {
|
|
5240
5247
|
getProperties: () => getValues('properties'),
|
|
5241
5248
|
addProperty: handleAddParameter,
|
|
5242
|
-
removeProperty: handleRemoveParameter
|
|
5249
|
+
removeProperty: handleRemoveParameter,
|
|
5250
|
+
trigger
|
|
5243
5251
|
};
|
|
5244
|
-
}, [getValues, handleAddParameter, handleRemoveParameter]);
|
|
5252
|
+
}, [getValues, handleAddParameter, handleRemoveParameter, trigger]);
|
|
5245
5253
|
return jsxs(Fragment, {
|
|
5246
5254
|
children: [error && error.message && jsx(Grid, Object.assign({
|
|
5247
5255
|
sm: 12
|
|
@@ -5256,7 +5264,7 @@ const CreatePropertiesList = /*#__PURE__*/forwardRef(({
|
|
|
5256
5264
|
ref: ref => refs.current[index] = ref
|
|
5257
5265
|
}, {
|
|
5258
5266
|
children: jsxs(Accordion, Object.assign({
|
|
5259
|
-
defaultExpanded:
|
|
5267
|
+
defaultExpanded: !(properties === null || properties === void 0 ? void 0 : properties.length),
|
|
5260
5268
|
elevation: 3
|
|
5261
5269
|
}, {
|
|
5262
5270
|
children: [jsx(AccordionSummary, Object.assign({
|
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { type RefMethods } from '../../Property/UpsertProperty/CreatePropertiesList';
|
|
2
3
|
import { EntityReferenceProperty } from '../../../interfaces';
|
|
3
4
|
type Props = {
|
|
4
5
|
definitionFieldName?: string;
|
|
@@ -19,5 +20,5 @@ type Props = {
|
|
|
19
20
|
name: string;
|
|
20
21
|
}>;
|
|
21
22
|
};
|
|
22
|
-
export declare const CreateDefinition: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<
|
|
23
|
+
export declare const CreateDefinition: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<RefMethods>>;
|
|
23
24
|
export default CreateDefinition;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { UseFormTrigger } from 'react-hook-form';
|
|
2
3
|
import { CustomPropertyFieldProps, EntityReferenceProperty, PropertiesArrayType } from '../../../interfaces';
|
|
3
4
|
type Props = {
|
|
4
5
|
properties: PropertiesArrayType<any>;
|
|
@@ -25,5 +26,11 @@ type Props = {
|
|
|
25
26
|
name: string;
|
|
26
27
|
}>;
|
|
27
28
|
};
|
|
28
|
-
export
|
|
29
|
+
export type RefMethods = {
|
|
30
|
+
getProperties: () => PropertiesArrayType<any>;
|
|
31
|
+
trigger: UseFormTrigger<{
|
|
32
|
+
properties: PropertiesArrayType<any>;
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
export declare const CreatePropertiesList: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<RefMethods>>;
|
|
29
36
|
export default CreatePropertiesList;
|