@dartech/arsenal-ui 1.3.68 → 1.3.70
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 +279 -82
- package/package.json +2 -1
- package/src/interfaces/definition.d.ts +2 -1
- package/src/interfaces/index.d.ts +1 -0
- package/src/interfaces/instances.d.ts +71 -0
- package/src/lib/Definition/DefinitionFiller/DefinitionFiller.d.ts +2 -1
- package/src/lib/Property/PropertyFiller/MultiplePropertyFiller.d.ts +2 -1
- package/src/lib/Property/PropertyFiller/MultiplePropertyWidget.d.ts +2 -1
- package/src/lib/Property/PropertyFiller/PropertyFiller.d.ts +3 -2
- package/src/lib/Property/PropertyWidget/PropertyWidget.d.ts +2 -1
- package/src/lib/Property/UpsertProperty/PropertyValueField/EntityReferenceValueField.d.ts +10 -0
- package/src/utils/services.d.ts +23 -0
- package/src/utils/test-mocks.d.ts +166 -0
package/index.js
CHANGED
@@ -38,7 +38,7 @@ import { format, isMatch, isValid, parse } 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';
|
41
|
-
import Grid from '@mui/material/Unstable_Grid2
|
41
|
+
import Grid from '@mui/material/Unstable_Grid2';
|
42
42
|
import { toString, parse as parse$1 } from 'duration-fns';
|
43
43
|
import Pagination from '@mui/material/Pagination';
|
44
44
|
import MuiTablePagination from '@mui/material/TablePagination';
|
@@ -57,7 +57,6 @@ import MoreHorizIcon from '@mui/icons-material/MoreHoriz';
|
|
57
57
|
import Paper from '@mui/material/Paper';
|
58
58
|
import Tab from '@mui/material/Tab';
|
59
59
|
import Tabs from '@mui/material/Tabs';
|
60
|
-
import Grid$1 from '@mui/material/Unstable_Grid2';
|
61
60
|
import Accordion from '@mui/material/Accordion';
|
62
61
|
import AccordionSummary from '@mui/material/AccordionSummary';
|
63
62
|
import AccordionDetails from '@mui/material/AccordionDetails';
|
@@ -71,10 +70,11 @@ import StepContent from '@mui/material/StepContent';
|
|
71
70
|
import StepConnector from '@mui/material/StepConnector';
|
72
71
|
import Select from '@mui/material/Select';
|
73
72
|
import InputLabel from '@mui/material/InputLabel';
|
73
|
+
import { toast } from 'react-toastify';
|
74
|
+
import axios from 'axios';
|
74
75
|
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
|
75
76
|
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
76
77
|
import classnames from 'classnames';
|
77
|
-
import { toast } from 'react-toastify';
|
78
78
|
import CssBaseline from '@mui/material/CssBaseline';
|
79
79
|
import MuiDrawer from '@mui/material/Drawer';
|
80
80
|
import MuiList from '@mui/material/List';
|
@@ -1218,7 +1218,6 @@ const JsonView = /*#__PURE__*/forwardRef(({
|
|
1218
1218
|
const [loading, setLoading] = useState(true);
|
1219
1219
|
const onCreateEditor = useCallback(view => {
|
1220
1220
|
const onScroll = e => {
|
1221
|
-
console.log();
|
1222
1221
|
if (view.scrollDOM.scrollHeight - view.scrollDOM.offsetHeight - e.target.scrollTop < 10) {
|
1223
1222
|
setTimeout(() => view.scrollDOM.scrollTo(0, 0), 200);
|
1224
1223
|
}
|
@@ -3132,7 +3131,7 @@ const BigDecimalPropertyFields = ({
|
|
3132
3131
|
control
|
3133
3132
|
} = useFormContext();
|
3134
3133
|
return jsxs(Fragment, {
|
3135
|
-
children: [jsx(Grid
|
3134
|
+
children: [jsx(Grid, {
|
3136
3135
|
children: jsx(ControlNumberInput, {
|
3137
3136
|
required: true,
|
3138
3137
|
control: control,
|
@@ -3140,7 +3139,7 @@ const BigDecimalPropertyFields = ({
|
|
3140
3139
|
name: `${propertyFieldName}.precisionScale`,
|
3141
3140
|
label: "Precision Scale"
|
3142
3141
|
})
|
3143
|
-
}), jsx(Grid
|
3142
|
+
}), jsx(Grid, {
|
3144
3143
|
children: jsx(ControlSelect, {
|
3145
3144
|
required: true,
|
3146
3145
|
control: control,
|
@@ -3161,7 +3160,7 @@ const DateAdditionalFields = ({
|
|
3161
3160
|
const {
|
3162
3161
|
control
|
3163
3162
|
} = useFormContext();
|
3164
|
-
return jsx(Grid
|
3163
|
+
return jsx(Grid, {
|
3165
3164
|
children: jsx(ControlInput, {
|
3166
3165
|
required: true,
|
3167
3166
|
control: control,
|
@@ -3306,17 +3305,17 @@ const EntityAdditionalFields = ({
|
|
3306
3305
|
}
|
3307
3306
|
});
|
3308
3307
|
return jsxs(Fragment, {
|
3309
|
-
children: [jsx(Grid
|
3308
|
+
children: [jsx(Grid, {
|
3310
3309
|
children: jsx(Typography, Object.assign({
|
3311
3310
|
variant: "h6"
|
3312
3311
|
}, {
|
3313
3312
|
children: "Properties"
|
3314
3313
|
}))
|
3315
|
-
}), jsx(Grid
|
3314
|
+
}), jsx(Grid, {
|
3316
3315
|
children: jsx(EntityPropertiesShortView$1, {
|
3317
3316
|
properties: properties
|
3318
3317
|
})
|
3319
|
-
}), jsx(Grid
|
3318
|
+
}), jsx(Grid, {
|
3320
3319
|
children: jsx(Button, Object.assign({
|
3321
3320
|
variant: "contained",
|
3322
3321
|
color: "primary",
|
@@ -3339,7 +3338,7 @@ const EntityAdditionalFields = ({
|
|
3339
3338
|
overflow: 'hidden'
|
3340
3339
|
}
|
3341
3340
|
}, {
|
3342
|
-
children: jsxs(Grid
|
3341
|
+
children: jsxs(Grid, Object.assign({
|
3343
3342
|
container: true,
|
3344
3343
|
direction: "row",
|
3345
3344
|
spacing: 2,
|
@@ -3347,7 +3346,7 @@ const EntityAdditionalFields = ({
|
|
3347
3346
|
height: '100%'
|
3348
3347
|
}
|
3349
3348
|
}, {
|
3350
|
-
children: [jsxs(Grid
|
3349
|
+
children: [jsxs(Grid, Object.assign({
|
3351
3350
|
xs: 3,
|
3352
3351
|
style: {
|
3353
3352
|
backgroundColor: '#f9f9f9',
|
@@ -3388,7 +3387,7 @@ const EntityAdditionalFields = ({
|
|
3388
3387
|
}, {
|
3389
3388
|
children: "Add property"
|
3390
3389
|
}))]
|
3391
|
-
})), jsx(Grid
|
3390
|
+
})), jsx(Grid, Object.assign({
|
3392
3391
|
container: true,
|
3393
3392
|
wrap: "nowrap",
|
3394
3393
|
direction: "column",
|
@@ -3422,35 +3421,72 @@ const EntityAdditionalFields = ({
|
|
3422
3421
|
};
|
3423
3422
|
var EntityAdditionalFields$1 = EntityAdditionalFields;
|
3424
3423
|
|
3424
|
+
const sources = [{
|
3425
|
+
label: 'Arsenal',
|
3426
|
+
value: 'ARSENAL'
|
3427
|
+
}, {
|
3428
|
+
label: 'Scalend',
|
3429
|
+
value: 'SCALEND'
|
3430
|
+
}];
|
3431
|
+
const modules = [{
|
3432
|
+
label: 'Customers',
|
3433
|
+
value: 'CUSTOMERS'
|
3434
|
+
}, {
|
3435
|
+
label: 'Products',
|
3436
|
+
value: 'PRODUCTS'
|
3437
|
+
}, {
|
3438
|
+
label: 'Pledges',
|
3439
|
+
value: 'PLEDGES'
|
3440
|
+
}];
|
3425
3441
|
const EntityReferencePropertyFields = ({
|
3426
3442
|
propertyFieldName
|
3427
3443
|
}) => {
|
3428
3444
|
const {
|
3429
3445
|
control
|
3430
3446
|
} = useFormContext();
|
3447
|
+
const source = useWatch({
|
3448
|
+
control,
|
3449
|
+
name: `${propertyFieldName}.source`
|
3450
|
+
});
|
3431
3451
|
return jsxs(Fragment, {
|
3432
|
-
children: [jsx(Grid
|
3433
|
-
children: jsx(
|
3452
|
+
children: [jsx(Grid, {
|
3453
|
+
children: jsx(ControlSelect, {
|
3454
|
+
required: true,
|
3455
|
+
control: control,
|
3456
|
+
name: `${propertyFieldName}.source`,
|
3457
|
+
label: "Source",
|
3458
|
+
options: sources
|
3459
|
+
})
|
3460
|
+
}), source && jsx(Grid, {
|
3461
|
+
children: source === 'ARSENAL' ? jsx(ControlInput, {
|
3434
3462
|
required: true,
|
3435
3463
|
control: control,
|
3436
3464
|
name: `${propertyFieldName}.definitionCode`,
|
3437
3465
|
label: "Definition Code"
|
3466
|
+
}) : jsx(ControlSelect, {
|
3467
|
+
required: true,
|
3468
|
+
control: control,
|
3469
|
+
name: `${propertyFieldName}.definitionCode`,
|
3470
|
+
label: "Definition Code",
|
3471
|
+
valueKey: "value",
|
3472
|
+
options: modules
|
3438
3473
|
})
|
3439
|
-
}), jsx(Grid
|
3474
|
+
}), jsx(Grid, {
|
3440
3475
|
children: jsx(ControlInput, {
|
3441
3476
|
required: true,
|
3442
3477
|
control: control,
|
3443
3478
|
name: `${propertyFieldName}.definitionVersion`,
|
3444
|
-
label: "Definition Version"
|
3479
|
+
label: "Definition Version",
|
3480
|
+
defaultValue: 1
|
3445
3481
|
})
|
3446
|
-
}), jsx(Grid
|
3482
|
+
}), jsx(Grid, {
|
3447
3483
|
children: jsx(ControlInput, {
|
3448
3484
|
required: true,
|
3449
3485
|
control: control,
|
3450
3486
|
name: `${propertyFieldName}.labelPropertyCode`,
|
3451
3487
|
label: "Label Property Code"
|
3452
3488
|
})
|
3453
|
-
}), jsx(Grid
|
3489
|
+
}), jsx(Grid, {
|
3454
3490
|
children: jsx(ControlInput, {
|
3455
3491
|
required: true,
|
3456
3492
|
control: control,
|
@@ -3504,13 +3540,13 @@ const StringPropertyFields = ({
|
|
3504
3540
|
}
|
3505
3541
|
};
|
3506
3542
|
return jsxs(Fragment, {
|
3507
|
-
children: [jsx(Grid
|
3543
|
+
children: [jsx(Grid, {
|
3508
3544
|
children: jsx(Typography, Object.assign({
|
3509
3545
|
variant: "h6"
|
3510
3546
|
}, {
|
3511
3547
|
children: "Restricted Values"
|
3512
3548
|
}))
|
3513
|
-
}), !!(restrictedValues === null || restrictedValues === void 0 ? void 0 : restrictedValues.length) && jsx(Grid
|
3549
|
+
}), !!(restrictedValues === null || restrictedValues === void 0 ? void 0 : restrictedValues.length) && jsx(Grid, {
|
3514
3550
|
children: jsx(Box, Object.assign({
|
3515
3551
|
display: "flex",
|
3516
3552
|
flexWrap: "wrap"
|
@@ -3524,7 +3560,7 @@ const StringPropertyFields = ({
|
|
3524
3560
|
onDelete: () => handleDelete(index)
|
3525
3561
|
}, index))
|
3526
3562
|
}))
|
3527
|
-
}), jsx(Grid
|
3563
|
+
}), jsx(Grid, {
|
3528
3564
|
children: jsx(TextField, {
|
3529
3565
|
fullWidth: true,
|
3530
3566
|
variant: "outlined",
|
@@ -3663,12 +3699,138 @@ const StringValueField = ({
|
|
3663
3699
|
};
|
3664
3700
|
var StringValueField$1 = StringValueField;
|
3665
3701
|
|
3702
|
+
function useEntitiesService({
|
3703
|
+
baseURL
|
3704
|
+
}) {
|
3705
|
+
const entitiesInstance = axios.create({
|
3706
|
+
baseURL: baseURL
|
3707
|
+
});
|
3708
|
+
const getEntitiesByCodeAndVersion = ({
|
3709
|
+
definitionCode,
|
3710
|
+
definitionVersion
|
3711
|
+
}) => __awaiter(this, void 0, void 0, function* () {
|
3712
|
+
const response = yield entitiesInstance.get(`/entities/code/${definitionCode}/version/${definitionVersion}`);
|
3713
|
+
console.log(response);
|
3714
|
+
return response.data;
|
3715
|
+
});
|
3716
|
+
const getCustomerApplications = params => __awaiter(this, void 0, void 0, function* () {
|
3717
|
+
const response = yield entitiesInstance.get('/customer-application-instances', {
|
3718
|
+
params
|
3719
|
+
});
|
3720
|
+
return response.data['collection'];
|
3721
|
+
});
|
3722
|
+
const getProducts = params => __awaiter(this, void 0, void 0, function* () {
|
3723
|
+
const response = yield entitiesInstance.get('/products', {
|
3724
|
+
params
|
3725
|
+
});
|
3726
|
+
return response.data['collection'];
|
3727
|
+
});
|
3728
|
+
const getPledgeInstances = params => __awaiter(this, void 0, void 0, function* () {
|
3729
|
+
const response = yield entitiesInstance.get('/pledge-instances', {
|
3730
|
+
params
|
3731
|
+
});
|
3732
|
+
return response.data['collection'];
|
3733
|
+
});
|
3734
|
+
return {
|
3735
|
+
getEntitiesByCodeAndVersion,
|
3736
|
+
getCustomerApplications,
|
3737
|
+
getProducts,
|
3738
|
+
getPledgeInstances
|
3739
|
+
};
|
3740
|
+
}
|
3741
|
+
|
3742
|
+
const EntityReferenceValueField = ({
|
3743
|
+
name,
|
3744
|
+
required: _required = false,
|
3745
|
+
definitionProperty,
|
3746
|
+
baseURL: _baseURL = 'https://dev-sl-api.dar-dev.zone/api/v1'
|
3747
|
+
}) => {
|
3748
|
+
const {
|
3749
|
+
control
|
3750
|
+
} = useFormContext();
|
3751
|
+
const {
|
3752
|
+
source,
|
3753
|
+
definitionCode,
|
3754
|
+
definitionVersion,
|
3755
|
+
valuePropertyCode,
|
3756
|
+
labelPropertyCode
|
3757
|
+
} = definitionProperty;
|
3758
|
+
const {
|
3759
|
+
getCustomerApplications,
|
3760
|
+
getEntitiesByCodeAndVersion,
|
3761
|
+
getPledgeInstances,
|
3762
|
+
getProducts
|
3763
|
+
} = useEntitiesService({
|
3764
|
+
baseURL: _baseURL
|
3765
|
+
});
|
3766
|
+
const [loading, setLoading] = useState(false);
|
3767
|
+
const [referredInstancesValues, setReferredInstancesValues] = useState([]);
|
3768
|
+
const scalendCallback = useMemo(() => {
|
3769
|
+
if (source === 'SCALEND') {
|
3770
|
+
switch (definitionCode) {
|
3771
|
+
case 'CUSTOMERS':
|
3772
|
+
return getCustomerApplications;
|
3773
|
+
case 'PLEDGES':
|
3774
|
+
return getPledgeInstances;
|
3775
|
+
case 'PRODUCTS':
|
3776
|
+
return getProducts;
|
3777
|
+
default:
|
3778
|
+
return null;
|
3779
|
+
}
|
3780
|
+
}
|
3781
|
+
return null;
|
3782
|
+
}, [definitionCode, source]);
|
3783
|
+
useEffect(() => {
|
3784
|
+
if (definitionCode && definitionVersion) {
|
3785
|
+
setLoading(true);
|
3786
|
+
if (source === 'ARSENAL') {
|
3787
|
+
getEntitiesByCodeAndVersion({
|
3788
|
+
definitionCode,
|
3789
|
+
definitionVersion
|
3790
|
+
}).then(instances => {
|
3791
|
+
const instanceValues = instances.map(instance => instance['data'][`${valuePropertyCode}`]);
|
3792
|
+
setReferredInstancesValues(instanceValues);
|
3793
|
+
}).catch(error => {
|
3794
|
+
setReferredInstancesValues([]);
|
3795
|
+
toast.error(error);
|
3796
|
+
}).finally(() => {
|
3797
|
+
setLoading(false);
|
3798
|
+
});
|
3799
|
+
} else if (source === 'SCALEND') {
|
3800
|
+
scalendCallback().then(instances => {
|
3801
|
+
const instanceValues = instances.map(instance => instance.id);
|
3802
|
+
setReferredInstancesValues(instanceValues);
|
3803
|
+
}).catch(error => {
|
3804
|
+
setReferredInstancesValues([]);
|
3805
|
+
toast.error(error);
|
3806
|
+
}).finally(() => {
|
3807
|
+
setLoading(false);
|
3808
|
+
});
|
3809
|
+
}
|
3810
|
+
}
|
3811
|
+
}, [definitionCode, definitionVersion, valuePropertyCode, source, labelPropertyCode, scalendCallback]);
|
3812
|
+
return jsx(Grid, {
|
3813
|
+
children: jsx(ControlAutocomplete, {
|
3814
|
+
required: _required,
|
3815
|
+
control: control,
|
3816
|
+
name: source === 'SCALEND' ? name : `${name}.${labelPropertyCode}`,
|
3817
|
+
label: labelPropertyCode,
|
3818
|
+
labelKey: labelPropertyCode,
|
3819
|
+
valueKey: valuePropertyCode,
|
3820
|
+
loading: loading,
|
3821
|
+
options: referredInstancesValues
|
3822
|
+
})
|
3823
|
+
});
|
3824
|
+
};
|
3825
|
+
var EntityReferenceValueField$1 = EntityReferenceValueField;
|
3826
|
+
|
3666
3827
|
const PropertyWidget = ({
|
3667
3828
|
property,
|
3668
3829
|
name,
|
3669
3830
|
label,
|
3670
3831
|
useExpression,
|
3671
|
-
control
|
3832
|
+
control,
|
3833
|
+
baseURL
|
3672
3834
|
}) => {
|
3673
3835
|
const propertyType = useMemo(() => typeof property.propertyType === 'string' ? property.propertyType : property['propertyType']['value'], [property]);
|
3674
3836
|
switch (propertyType) {
|
@@ -3750,14 +3912,13 @@ const PropertyWidget = ({
|
|
3750
3912
|
restrictedValues: property.restrictedValues
|
3751
3913
|
});
|
3752
3914
|
case PropertyType.ENTITY_REFERENCE:
|
3753
|
-
return jsx(
|
3915
|
+
return jsx(EntityReferenceValueField$1
|
3754
3916
|
// required
|
3755
3917
|
, {
|
3756
3918
|
// required
|
3757
|
-
hideErrorMessage: true,
|
3758
3919
|
name: name,
|
3759
|
-
|
3760
|
-
|
3920
|
+
definitionProperty: property,
|
3921
|
+
baseURL: baseURL
|
3761
3922
|
});
|
3762
3923
|
case PropertyType.ANY:
|
3763
3924
|
return jsx(ControlAceEditor, {
|
@@ -3876,17 +4037,17 @@ const PropertyFiller = ({
|
|
3876
4037
|
useExpression,
|
3877
4038
|
label,
|
3878
4039
|
required,
|
3879
|
-
title
|
4040
|
+
title,
|
4041
|
+
baseURL
|
3880
4042
|
}) => {
|
3881
4043
|
const {
|
3882
4044
|
control,
|
3883
4045
|
clearErrors,
|
3884
|
-
setValue
|
4046
|
+
setValue,
|
4047
|
+
watch
|
3885
4048
|
} = useFormContext();
|
3886
4049
|
const {
|
3887
|
-
field: {
|
3888
|
-
value
|
3889
|
-
},
|
4050
|
+
// field: { value },
|
3890
4051
|
fieldState: {
|
3891
4052
|
error,
|
3892
4053
|
isDirty
|
@@ -3897,11 +4058,13 @@ const PropertyFiller = ({
|
|
3897
4058
|
defaultValue: property.defaultValue,
|
3898
4059
|
rules: {
|
3899
4060
|
validate: val => {
|
3900
|
-
if (required && val === null) return 'Please, fill this
|
4061
|
+
if (required && val === null) return 'Please, fill this field';
|
3901
4062
|
return true;
|
3902
4063
|
}
|
3903
4064
|
}
|
3904
4065
|
});
|
4066
|
+
const value = watch(name);
|
4067
|
+
const prevValueRef = useRef({});
|
3905
4068
|
const {
|
3906
4069
|
propertyType,
|
3907
4070
|
valueLabel,
|
@@ -3920,24 +4083,32 @@ const PropertyFiller = ({
|
|
3920
4083
|
});
|
3921
4084
|
const handleFillOptionChange = useCallback(event => {
|
3922
4085
|
const selectedType = event.target.value;
|
4086
|
+
prevValueRef.current = Object.assign(Object.assign({}, prevValueRef.current), {
|
4087
|
+
[fillOption]: value
|
4088
|
+
});
|
3923
4089
|
setFillOption(selectedType);
|
4090
|
+
const prevValue = prevValueRef.current[selectedType];
|
3924
4091
|
if (selectedType === 'null') {
|
3925
|
-
setValue(name, null
|
4092
|
+
setValue(name, null, {
|
4093
|
+
shouldDirty: true
|
4094
|
+
});
|
3926
4095
|
} else if (selectedType === 'widget') {
|
3927
4096
|
if (propertyType === PropertyType.JSON && value && typeof value !== 'string' && fillOption === 'dem_builder' && 'properties' in value) {
|
3928
4097
|
const definitionValue = Object.assign(Object.assign({}, value), {
|
3929
4098
|
properties: propertiesArrayToObject(value.property || [])
|
3930
4099
|
});
|
3931
4100
|
try {
|
3932
|
-
setValue(name, JSON.stringify(definitionValue, null, '\t'));
|
4101
|
+
setValue(name, prevValue !== null && prevValue !== void 0 ? prevValue : JSON.stringify(definitionValue, null, '\t'));
|
3933
4102
|
} catch (error) {
|
3934
4103
|
console.log('Stringify failed', error);
|
3935
4104
|
}
|
3936
4105
|
} else {
|
3937
|
-
setValue(name, property.defaultValue || defaultProperyValue);
|
4106
|
+
setValue(name, prevValue !== null && prevValue !== void 0 ? prevValue : property.defaultValue || defaultProperyValue);
|
3938
4107
|
}
|
3939
4108
|
} else if (selectedType === 'expression' || selectedType === 'string') {
|
3940
|
-
setValue(name, ''
|
4109
|
+
setValue(name, prevValue !== null && prevValue !== void 0 ? prevValue : '', {
|
4110
|
+
shouldDirty: true
|
4111
|
+
});
|
3941
4112
|
} else if (selectedType === 'dem_builder') {
|
3942
4113
|
const defaultArrayValue = {
|
3943
4114
|
code: '',
|
@@ -3949,12 +4120,18 @@ const PropertyFiller = ({
|
|
3949
4120
|
try {
|
3950
4121
|
const definitionValue = JSON.parse(value);
|
3951
4122
|
definitionValue['properties'] = propertiesObjectToArray(definitionValue['properties'] || {});
|
3952
|
-
setValue(name, definitionValue
|
4123
|
+
setValue(name, prevValue !== null && prevValue !== void 0 ? prevValue : definitionValue, {
|
4124
|
+
shouldDirty: true
|
4125
|
+
});
|
3953
4126
|
} catch (error) {
|
3954
|
-
setValue(name, defaultArrayValue
|
4127
|
+
setValue(name, prevValue !== null && prevValue !== void 0 ? prevValue : defaultArrayValue, {
|
4128
|
+
shouldDirty: true
|
4129
|
+
});
|
3955
4130
|
}
|
3956
4131
|
} else {
|
3957
|
-
setValue(name, defaultArrayValue
|
4132
|
+
setValue(name, prevValue !== null && prevValue !== void 0 ? prevValue : defaultArrayValue, {
|
4133
|
+
shouldDirty: true
|
4134
|
+
});
|
3958
4135
|
}
|
3959
4136
|
}
|
3960
4137
|
clearErrors();
|
@@ -3965,11 +4142,12 @@ const PropertyFiller = ({
|
|
3965
4142
|
}
|
3966
4143
|
}, [isDirty, property, name, setValue]);
|
3967
4144
|
useEffect(() => {
|
4145
|
+
var _a;
|
3968
4146
|
if (value === undefined || property.isRequired && value === null && !property.defaultValue) {
|
3969
|
-
setValue(name, defaultProperyValue);
|
4147
|
+
setValue(name, (_a = prevValueRef.current[fillOption]) !== null && _a !== void 0 ? _a : defaultProperyValue);
|
3970
4148
|
}
|
3971
|
-
}, [value, setValue, defaultProperyValue, property, name]);
|
3972
|
-
return jsxs(Grid
|
4149
|
+
}, [value, setValue, defaultProperyValue, property, name, fillOption]);
|
4150
|
+
return jsxs(Grid, Object.assign({
|
3973
4151
|
xs: 12
|
3974
4152
|
}, {
|
3975
4153
|
children: [title && jsx(Box, Object.assign({
|
@@ -4032,7 +4210,8 @@ const PropertyFiller = ({
|
|
4032
4210
|
property: property,
|
4033
4211
|
name: name,
|
4034
4212
|
useExpression: useExpression,
|
4035
|
-
label: valueLabel
|
4213
|
+
label: valueLabel,
|
4214
|
+
baseURL: baseURL
|
4036
4215
|
}), fillOption === 'dem_builder' && jsx(CreateDefinition, {
|
4037
4216
|
title: "JSON",
|
4038
4217
|
definitionFieldName: name
|
@@ -4096,7 +4275,8 @@ const MultiplePropertyWidget = ({
|
|
4096
4275
|
property,
|
4097
4276
|
useExpression,
|
4098
4277
|
required,
|
4099
|
-
label
|
4278
|
+
label,
|
4279
|
+
baseURL
|
4100
4280
|
}) => {
|
4101
4281
|
const {
|
4102
4282
|
control,
|
@@ -4118,13 +4298,13 @@ const MultiplePropertyWidget = ({
|
|
4118
4298
|
const handleDeleteValue = useCallback(index => {
|
4119
4299
|
setValue(name, removeArrayItem(values, index));
|
4120
4300
|
}, [name, values, setValue]);
|
4121
|
-
return jsxs(Grid
|
4301
|
+
return jsxs(Grid, Object.assign({
|
4122
4302
|
container: true,
|
4123
4303
|
spacing: 2,
|
4124
4304
|
direction: "column",
|
4125
4305
|
xs: 12
|
4126
4306
|
}, {
|
4127
|
-
children: [Array.isArray(values) && values.length ? values.map((value, index) => jsx(Grid
|
4307
|
+
children: [Array.isArray(values) && values.length ? values.map((value, index) => jsx(Grid, Object.assign({
|
4128
4308
|
xs: 12
|
4129
4309
|
}, {
|
4130
4310
|
children: jsxs(Box, Object.assign({
|
@@ -4141,12 +4321,14 @@ const MultiplePropertyWidget = ({
|
|
4141
4321
|
property: property,
|
4142
4322
|
useExpression: useExpression,
|
4143
4323
|
name: `${name}.${index}`,
|
4144
|
-
label: `${label || property.name} (${index + 1})
|
4324
|
+
label: `${label || property.name} (${index + 1})`,
|
4325
|
+
baseURL: baseURL
|
4145
4326
|
}), jsx(Box, Object.assign({
|
4146
4327
|
mt: "8px",
|
4147
4328
|
ml: "4px"
|
4148
4329
|
}, {
|
4149
4330
|
children: jsx(IconButton, Object.assign({
|
4331
|
+
id: "close-button",
|
4150
4332
|
size: "small",
|
4151
4333
|
onClick: () => handleDeleteValue(index)
|
4152
4334
|
}, {
|
@@ -4160,7 +4342,7 @@ const MultiplePropertyWidget = ({
|
|
4160
4342
|
}))
|
4161
4343
|
}))]
|
4162
4344
|
}))
|
4163
|
-
}), index)) : null, jsx(Grid
|
4345
|
+
}), index)) : null, jsx(Grid, {
|
4164
4346
|
children: jsx(Button, Object.assign({
|
4165
4347
|
variant: "contained",
|
4166
4348
|
size: "small",
|
@@ -4180,20 +4362,21 @@ const MultiplePropertyFiller = ({
|
|
4180
4362
|
useExpression,
|
4181
4363
|
required,
|
4182
4364
|
label,
|
4183
|
-
title
|
4365
|
+
title,
|
4366
|
+
baseURL
|
4184
4367
|
}) => {
|
4185
4368
|
var _a;
|
4186
4369
|
const [selectTouched, setSelectTouched] = useState(false);
|
4187
4370
|
const {
|
4188
4371
|
control,
|
4189
4372
|
clearErrors,
|
4190
|
-
setValue
|
4373
|
+
setValue,
|
4374
|
+
watch
|
4191
4375
|
} = useFormContext();
|
4192
4376
|
const {
|
4193
4377
|
field: {
|
4194
4378
|
ref,
|
4195
|
-
onChange
|
4196
|
-
value
|
4379
|
+
onChange
|
4197
4380
|
},
|
4198
4381
|
fieldState: {
|
4199
4382
|
error,
|
@@ -4210,6 +4393,8 @@ const MultiplePropertyFiller = ({
|
|
4210
4393
|
}
|
4211
4394
|
}
|
4212
4395
|
});
|
4396
|
+
const value = watch(name);
|
4397
|
+
const prevValueRef = useRef({});
|
4213
4398
|
const {
|
4214
4399
|
propertyType,
|
4215
4400
|
valueLabel,
|
@@ -4229,13 +4414,21 @@ const MultiplePropertyFiller = ({
|
|
4229
4414
|
});
|
4230
4415
|
const handleFillOptionChange = event => {
|
4231
4416
|
setSelectTouched(true);
|
4417
|
+
prevValueRef.current = Object.assign(Object.assign({}, prevValueRef.current), {
|
4418
|
+
[fillOption]: value
|
4419
|
+
});
|
4232
4420
|
const selectedType = event.target.value;
|
4421
|
+
const prevValue = prevValueRef.current[selectedType];
|
4233
4422
|
if (selectedType === 'null') {
|
4234
4423
|
setValue(name, null);
|
4235
4424
|
} else if (selectedType === 'expression' || selectedType === 'json_valid' || selectedType === 'json_notvalid') {
|
4236
|
-
|
4425
|
+
setValue(name, prevValue !== null && prevValue !== void 0 ? prevValue : '', {
|
4426
|
+
shouldDirty: true
|
4427
|
+
});
|
4237
4428
|
} else if (selectedType === 'widget') {
|
4238
|
-
|
4429
|
+
setValue(name, prevValue !== null && prevValue !== void 0 ? prevValue : [], {
|
4430
|
+
shouldDirty: true
|
4431
|
+
});
|
4239
4432
|
}
|
4240
4433
|
setFillOption(selectedType);
|
4241
4434
|
clearErrors(name);
|
@@ -4251,7 +4444,7 @@ const MultiplePropertyFiller = ({
|
|
4251
4444
|
checkFillOption();
|
4252
4445
|
}
|
4253
4446
|
}, [checkFillOption, selectTouched, value]);
|
4254
|
-
return jsxs(Grid
|
4447
|
+
return jsxs(Grid, {
|
4255
4448
|
children: [title && jsx(Box, Object.assign({
|
4256
4449
|
mb: 2
|
4257
4450
|
}, {
|
@@ -4304,7 +4497,8 @@ const MultiplePropertyFiller = ({
|
|
4304
4497
|
name: name,
|
4305
4498
|
useExpression: useExpression,
|
4306
4499
|
required: required,
|
4307
|
-
label: label
|
4500
|
+
label: label,
|
4501
|
+
baseURL: baseURL
|
4308
4502
|
}), error && jsx(FormHelperText, Object.assign({
|
4309
4503
|
error: true
|
4310
4504
|
}, {
|
@@ -4815,26 +5009,26 @@ const CreatePropertyFormFields = ({
|
|
4815
5009
|
setValue(`${propertyFieldName}.propertyType`, propertyTypes.find(el => el.value === propertyType));
|
4816
5010
|
}
|
4817
5011
|
}, [propertyType, setValue, propertyFieldName]);
|
4818
|
-
return jsxs(Grid
|
5012
|
+
return jsxs(Grid, Object.assign({
|
4819
5013
|
container: true,
|
4820
5014
|
direction: "column",
|
4821
5015
|
spacing: 2
|
4822
5016
|
}, {
|
4823
|
-
children: [jsx(Grid
|
5017
|
+
children: [jsx(Grid, {
|
4824
5018
|
children: jsx(ControlInput, {
|
4825
5019
|
required: true,
|
4826
5020
|
control: control,
|
4827
5021
|
name: `${propertyFieldName}.key`,
|
4828
5022
|
label: "Key"
|
4829
5023
|
})
|
4830
|
-
}), jsx(Grid
|
5024
|
+
}), jsx(Grid, {
|
4831
5025
|
children: jsx(ControlInput, {
|
4832
5026
|
required: true,
|
4833
5027
|
control: control,
|
4834
5028
|
name: `${propertyFieldName}.name`,
|
4835
5029
|
label: "Name"
|
4836
5030
|
})
|
4837
|
-
}), jsx(Grid
|
5031
|
+
}), jsx(Grid, {
|
4838
5032
|
children: jsx(ControlAutocomplete, {
|
4839
5033
|
required: true,
|
4840
5034
|
control: control,
|
@@ -4843,21 +5037,21 @@ const CreatePropertyFormFields = ({
|
|
4843
5037
|
options: propertyTypes,
|
4844
5038
|
onChange: handlePropertyTypeChange
|
4845
5039
|
})
|
4846
|
-
}), jsx(Grid
|
5040
|
+
}), jsx(Grid, {
|
4847
5041
|
children: jsx(ControlNumberInput, {
|
4848
5042
|
required: true,
|
4849
5043
|
control: control,
|
4850
5044
|
name: `${propertyFieldName}.sortOrder`,
|
4851
5045
|
label: "Sort Order"
|
4852
5046
|
})
|
4853
|
-
}), jsx(Grid
|
5047
|
+
}), jsx(Grid, {
|
4854
5048
|
children: jsx(ControlAceEditor, {
|
4855
5049
|
control: control,
|
4856
5050
|
name: `${propertyFieldName}.uiSettings`,
|
4857
5051
|
label: "UI Settings",
|
4858
5052
|
validateJson: true
|
4859
5053
|
})
|
4860
|
-
}), jsxs(Grid
|
5054
|
+
}), jsxs(Grid, {
|
4861
5055
|
children: [jsx(ControlCheckbox, {
|
4862
5056
|
control: control,
|
4863
5057
|
name: `${propertyFieldName}.isMultiple`,
|
@@ -4884,7 +5078,7 @@ const CreatePropertyFormFields = ({
|
|
4884
5078
|
}, index))
|
4885
5079
|
}) : null]
|
4886
5080
|
}), propertyType && jsxs(Fragment, {
|
4887
|
-
children: [jsx(Grid
|
5081
|
+
children: [jsx(Grid, {
|
4888
5082
|
children: jsx(PropertyValidatorContext.Provider, Object.assign({
|
4889
5083
|
value: (_a = propertyType.value) !== null && _a !== void 0 ? _a : propertyType
|
4890
5084
|
}, {
|
@@ -4904,7 +5098,7 @@ const CreatePropertyFormFields = ({
|
|
4904
5098
|
required: _globalParameter ? isRequired : false
|
4905
5099
|
})]
|
4906
5100
|
}), customFields.length ? jsx(Fragment, {
|
4907
|
-
children: customFields.map((field, index) => jsx(Grid
|
5101
|
+
children: customFields.map((field, index) => jsx(Grid, {
|
4908
5102
|
children: jsx(CustomPropertyField$1, Object.assign({}, field, {
|
4909
5103
|
propertyFieldName: propertyFieldName
|
4910
5104
|
}))
|
@@ -4977,7 +5171,7 @@ const CreatePropertiesList = ({
|
|
4977
5171
|
setValue(`${fieldName}`, removeArrayItem(properties, index));
|
4978
5172
|
}, [properties, fieldName, setValue]);
|
4979
5173
|
return jsxs(Fragment, {
|
4980
|
-
children: [error && error.message && jsx(Grid
|
5174
|
+
children: [error && error.message && jsx(Grid, Object.assign({
|
4981
5175
|
sm: 12
|
4982
5176
|
}, {
|
4983
5177
|
children: jsx(Typography, Object.assign({
|
@@ -4985,7 +5179,7 @@ const CreatePropertiesList = ({
|
|
4985
5179
|
}, {
|
4986
5180
|
children: error.message
|
4987
5181
|
}))
|
4988
|
-
})), Array.isArray(properties) && properties.map((property, index) => jsx(Grid
|
5182
|
+
})), Array.isArray(properties) && properties.map((property, index) => jsx(Grid, Object.assign({
|
4989
5183
|
sm: 12,
|
4990
5184
|
ref: ref => refs.current[index] = ref
|
4991
5185
|
}, {
|
@@ -5022,7 +5216,7 @@ const CreatePropertiesList = ({
|
|
5022
5216
|
}))
|
5023
5217
|
})]
|
5024
5218
|
}))
|
5025
|
-
}), index)), !hideAddButton && jsx(Grid
|
5219
|
+
}), index)), !hideAddButton && jsx(Grid, Object.assign({
|
5026
5220
|
xs: 12
|
5027
5221
|
}, {
|
5028
5222
|
children: jsx(Button, Object.assign({
|
@@ -5048,12 +5242,12 @@ const CreateDefinition = ({
|
|
5048
5242
|
const {
|
5049
5243
|
control
|
5050
5244
|
} = useFormContext();
|
5051
|
-
return jsxs(Grid
|
5245
|
+
return jsxs(Grid, Object.assign({
|
5052
5246
|
container: true,
|
5053
5247
|
direction: "column",
|
5054
5248
|
spacing: 2
|
5055
5249
|
}, {
|
5056
|
-
children: [title && jsx(Grid
|
5250
|
+
children: [title && jsx(Grid, Object.assign({
|
5057
5251
|
sm: 12
|
5058
5252
|
}, {
|
5059
5253
|
children: jsx(Box, Object.assign({
|
@@ -5065,7 +5259,7 @@ const CreateDefinition = ({
|
|
5065
5259
|
children: title
|
5066
5260
|
}))
|
5067
5261
|
}))
|
5068
|
-
})), !hideNameField && jsx(Grid
|
5262
|
+
})), !hideNameField && jsx(Grid, Object.assign({
|
5069
5263
|
sm: 12
|
5070
5264
|
}, {
|
5071
5265
|
children: jsx(ControlInput, {
|
@@ -5074,7 +5268,7 @@ const CreateDefinition = ({
|
|
5074
5268
|
name: definitionFieldName ? `${definitionFieldName}.name` : `name`,
|
5075
5269
|
label: "Name"
|
5076
5270
|
})
|
5077
|
-
})), !hideCodeField && jsx(Grid
|
5271
|
+
})), !hideCodeField && jsx(Grid, Object.assign({
|
5078
5272
|
sm: 12
|
5079
5273
|
}, {
|
5080
5274
|
children: jsx(ControlInput, {
|
@@ -5083,7 +5277,7 @@ const CreateDefinition = ({
|
|
5083
5277
|
name: definitionFieldName ? `${definitionFieldName}.code` : `code`,
|
5084
5278
|
label: "Code"
|
5085
5279
|
})
|
5086
|
-
})), !hideVersionField && jsx(Grid
|
5280
|
+
})), !hideVersionField && jsx(Grid, Object.assign({
|
5087
5281
|
sm: 12
|
5088
5282
|
}, {
|
5089
5283
|
children: jsx(ControlNumberInput, {
|
@@ -5370,7 +5564,8 @@ const DefinitionFiller = ({
|
|
5370
5564
|
properties,
|
5371
5565
|
dataFieldName,
|
5372
5566
|
useExpression: _useExpression = false,
|
5373
|
-
title
|
5567
|
+
title,
|
5568
|
+
baseURL
|
5374
5569
|
}) => {
|
5375
5570
|
const stepperData = useMemo(() => {
|
5376
5571
|
if (properties) {
|
@@ -5385,7 +5580,7 @@ const DefinitionFiller = ({
|
|
5385
5580
|
children: [jsxs("b", {
|
5386
5581
|
children: [property.name, property.isRequired ? '*' : '']
|
5387
5582
|
}), jsxs("span", {
|
5388
|
-
children: [property.key, " | ", property.isMultiple ? 'multiple' : 'single', " |
|
5583
|
+
children: [property.key, " | ", property.isMultiple ? 'multiple' : 'single', " |", ' ', propertyType]
|
5389
5584
|
})]
|
5390
5585
|
})),
|
5391
5586
|
content: property.isMultiple ? jsx(MultiplePropertyFiller, {
|
@@ -5393,28 +5588,30 @@ const DefinitionFiller = ({
|
|
5393
5588
|
name: `${dataFieldName}.${property.key}`,
|
5394
5589
|
useExpression: _useExpression,
|
5395
5590
|
label: property.name,
|
5396
|
-
required: property.isRequired
|
5591
|
+
required: property.isRequired,
|
5592
|
+
baseURL: baseURL
|
5397
5593
|
}) : jsx(PropertyFiller, {
|
5398
5594
|
property: property,
|
5399
5595
|
name: `${dataFieldName}.${property.key}`,
|
5400
5596
|
useExpression: _useExpression,
|
5401
5597
|
label: property.name,
|
5402
|
-
required: property.isRequired
|
5598
|
+
required: property.isRequired,
|
5599
|
+
baseURL: baseURL
|
5403
5600
|
})
|
5404
5601
|
};
|
5405
5602
|
});
|
5406
5603
|
}
|
5407
5604
|
return [];
|
5408
|
-
}, [properties, dataFieldName, _useExpression]);
|
5605
|
+
}, [properties, dataFieldName, _useExpression, baseURL]);
|
5409
5606
|
return jsx(LocalizationProvider, Object.assign({
|
5410
5607
|
dateAdapter: AdapterDateFns
|
5411
5608
|
}, {
|
5412
|
-
children: jsxs(Grid
|
5609
|
+
children: jsxs(Grid, Object.assign({
|
5413
5610
|
container: true,
|
5414
5611
|
direction: "column",
|
5415
5612
|
spacing: 2
|
5416
5613
|
}, {
|
5417
|
-
children: [title && jsx(Grid
|
5614
|
+
children: [title && jsx(Grid, Object.assign({
|
5418
5615
|
xs: 12
|
5419
5616
|
}, {
|
5420
5617
|
children: jsx("div", Object.assign({
|
@@ -5541,7 +5738,7 @@ const DefinitionValueView = ({
|
|
5541
5738
|
}
|
5542
5739
|
return [];
|
5543
5740
|
}, [properties, data]);
|
5544
|
-
return jsx(Grid
|
5741
|
+
return jsx(Grid, Object.assign({
|
5545
5742
|
container: true,
|
5546
5743
|
direction: "column",
|
5547
5744
|
spacing: 2
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dartech/arsenal-ui",
|
3
|
-
"version": "1.3.
|
3
|
+
"version": "1.3.70",
|
4
4
|
"author": "DAR",
|
5
5
|
"publishConfig": {
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
@@ -27,6 +27,7 @@
|
|
27
27
|
"classnames": "^2.3.1",
|
28
28
|
"@tanstack/react-query": "^4.24.10",
|
29
29
|
"@rollup/plugin-node-resolve": "13.3.0",
|
30
|
+
"axios": "1.4.0",
|
30
31
|
"qs": "6.11.0"
|
31
32
|
},
|
32
33
|
"module": "./index.js",
|
@@ -76,6 +76,7 @@ export interface EntityTypeProperty<T = Record<string, never>> extends Property
|
|
76
76
|
}
|
77
77
|
export interface EntityReferenceProperty extends Property {
|
78
78
|
propertyType: PropertyType.ENTITY_REFERENCE;
|
79
|
+
source: string;
|
79
80
|
definitionCode: string;
|
80
81
|
definitionVersion: string;
|
81
82
|
labelPropertyCode: string;
|
@@ -104,7 +105,7 @@ export interface TimeProperty extends Property {
|
|
104
105
|
export interface AnyProperty extends Property {
|
105
106
|
propertyType: PropertyType.ANY;
|
106
107
|
}
|
107
|
-
export type PropertyUnion<T = Record<string, never>> = BigDecimalProperty | BigIntegerProperty | BooleanProperty | DateProperty | DateTimeProperty | DoubleProperty | EntityTypeProperty<T> | EntityReferenceProperty | FloatProperty | StringProperty | IntegerProperty | JsonProperty | LongProperty | TimeProperty | AnyProperty;
|
108
|
+
export type PropertyUnion<T = Record<string, never>> = BigDecimalProperty | BigIntegerProperty | BooleanProperty | DateProperty | DateTimeProperty | DoubleProperty | EntityTypeProperty<T> | EntityReferenceProperty | FloatProperty | StringProperty | IntegerProperty | JsonProperty | LongProperty | TimeProperty | AnyProperty | EntityReferenceProperty;
|
108
109
|
export declare const DATE_DEFAULT_FORMAT = "yyyy-MM-dd";
|
109
110
|
export declare const TIME_DEFAULT_FORMAT = "HH:mm:ss";
|
110
111
|
export declare const DATE_TIME_DEFAULT_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX";
|
@@ -0,0 +1,71 @@
|
|
1
|
+
export interface Entity {
|
2
|
+
id: string;
|
3
|
+
definitionCode: string;
|
4
|
+
definitionVersion: number;
|
5
|
+
data: Record<string, unknown>;
|
6
|
+
createdAt: Date;
|
7
|
+
updatedAt: Date;
|
8
|
+
}
|
9
|
+
export interface CustomerApplication {
|
10
|
+
id: string;
|
11
|
+
customerId: string;
|
12
|
+
definitionCode: string;
|
13
|
+
definitionVersion: number | string;
|
14
|
+
data: Record<string, any>;
|
15
|
+
createdAt: string;
|
16
|
+
updatedAt: string;
|
17
|
+
}
|
18
|
+
export interface PledgeInstance {
|
19
|
+
id: string;
|
20
|
+
definitionCode: string;
|
21
|
+
definitionVersion: number | string;
|
22
|
+
data: Record<string, any>;
|
23
|
+
createdAt: string;
|
24
|
+
updatedAt: string;
|
25
|
+
definition?: {
|
26
|
+
id: string;
|
27
|
+
name: string;
|
28
|
+
};
|
29
|
+
}
|
30
|
+
export interface Product {
|
31
|
+
id: string;
|
32
|
+
definitionCode: string;
|
33
|
+
definitionVersion: number;
|
34
|
+
data: {
|
35
|
+
[key: string]: unknown;
|
36
|
+
};
|
37
|
+
customerApplicationDefinitionRef: {
|
38
|
+
code: string;
|
39
|
+
version: number | string;
|
40
|
+
}[];
|
41
|
+
minAmount: number;
|
42
|
+
maxAmount: number;
|
43
|
+
periodType: string;
|
44
|
+
minTerm: number;
|
45
|
+
maxTerm: number;
|
46
|
+
interestRate: number;
|
47
|
+
currency: string;
|
48
|
+
overpaymentCoefficient: number;
|
49
|
+
minPartialRepaymentAmount: number;
|
50
|
+
principalOverdueRate: number;
|
51
|
+
interestOverdueRate: number;
|
52
|
+
carteBlanchePeriod: number;
|
53
|
+
gracePeriod: number;
|
54
|
+
maxOverdueCoefficient: number;
|
55
|
+
maxOverdueDays: number;
|
56
|
+
maxNumberOfProlongations: number;
|
57
|
+
prolongationAvailableOverdueDay: number;
|
58
|
+
prolongationSettings: {
|
59
|
+
days: number[] | string;
|
60
|
+
rate: number;
|
61
|
+
availableFromGap: number;
|
62
|
+
}[];
|
63
|
+
maxProlongationDays: number;
|
64
|
+
createdAt: Date;
|
65
|
+
updatedAt: Date;
|
66
|
+
privateMetadata: Record<string, unknown>;
|
67
|
+
isActive: boolean;
|
68
|
+
isOverpaymentAllowed: boolean;
|
69
|
+
isPartialPaymentAllowed: boolean;
|
70
|
+
isProlongationAllowed: boolean;
|
71
|
+
}
|
@@ -5,6 +5,7 @@ type Props = {
|
|
5
5
|
dataFieldName: string;
|
6
6
|
useExpression?: boolean;
|
7
7
|
title?: string;
|
8
|
+
baseURL?: string;
|
8
9
|
};
|
9
|
-
export declare const DefinitionFiller: ({ properties, dataFieldName, useExpression, title }: Props) => JSX.Element;
|
10
|
+
export declare const DefinitionFiller: ({ properties, dataFieldName, useExpression, title, baseURL, }: Props) => JSX.Element;
|
10
11
|
export default DefinitionFiller;
|
@@ -7,6 +7,7 @@ type Props = {
|
|
7
7
|
required?: boolean;
|
8
8
|
label?: string;
|
9
9
|
title?: string;
|
10
|
+
baseURL?: string;
|
10
11
|
};
|
11
|
-
export declare const MultiplePropertyFiller: ({ property, name, useExpression, required, label, title, }: Props) => JSX.Element;
|
12
|
+
export declare const MultiplePropertyFiller: ({ property, name, useExpression, required, label, title, baseURL, }: Props) => JSX.Element;
|
12
13
|
export default MultiplePropertyFiller;
|
@@ -6,6 +6,7 @@ type Props = {
|
|
6
6
|
useExpression?: boolean;
|
7
7
|
required?: boolean;
|
8
8
|
label?: string;
|
9
|
+
baseURL?: string;
|
9
10
|
};
|
10
|
-
declare const MultiplePropertyWidget: ({ name, property, useExpression, required, label, }: Props) => JSX.Element;
|
11
|
+
export declare const MultiplePropertyWidget: ({ name, property, useExpression, required, label, baseURL, }: Props) => JSX.Element;
|
11
12
|
export default MultiplePropertyWidget;
|
@@ -1,12 +1,13 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { PropertyUnion } from '../../../interfaces';
|
3
|
-
type
|
3
|
+
export type PropertyFillerProps = {
|
4
4
|
property: PropertyUnion;
|
5
5
|
name: string;
|
6
6
|
useExpression?: boolean;
|
7
7
|
label?: string;
|
8
8
|
required?: boolean;
|
9
9
|
title?: string;
|
10
|
+
baseURL?: string;
|
10
11
|
};
|
11
|
-
export declare const PropertyFiller: ({ property, name, useExpression, label, required, title, }:
|
12
|
+
export declare const PropertyFiller: ({ property, name, useExpression, label, required, title, baseURL, }: PropertyFillerProps) => JSX.Element;
|
12
13
|
export default PropertyFiller;
|
@@ -7,6 +7,7 @@ type Props = {
|
|
7
7
|
label?: string;
|
8
8
|
useExpression?: boolean;
|
9
9
|
control: Control<any>;
|
10
|
+
baseURL?: string;
|
10
11
|
};
|
11
|
-
export declare const PropertyWidget: ({ property, name, label, useExpression, control }: Props) => JSX.Element;
|
12
|
+
export declare const PropertyWidget: ({ property, name, label, useExpression, control, baseURL, }: Props) => JSX.Element;
|
12
13
|
export default PropertyWidget;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { EntityReferenceProperty } from '../../../../interfaces/definition';
|
3
|
+
type Props = {
|
4
|
+
name: string;
|
5
|
+
required?: boolean;
|
6
|
+
definitionProperty: EntityReferenceProperty;
|
7
|
+
baseURL?: string;
|
8
|
+
};
|
9
|
+
declare const EntityReferenceValueField: ({ name, required, definitionProperty, baseURL, }: Props) => JSX.Element;
|
10
|
+
export default EntityReferenceValueField;
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { CustomerApplication, Entity, PledgeInstance, Product } from '../interfaces';
|
2
|
+
type Props = {
|
3
|
+
baseURL: string;
|
4
|
+
};
|
5
|
+
export declare function useEntitiesService({ baseURL }: Props): {
|
6
|
+
getEntitiesByCodeAndVersion: ({ definitionCode, definitionVersion, }: {
|
7
|
+
definitionCode: any;
|
8
|
+
definitionVersion: any;
|
9
|
+
}) => Promise<Entity[]>;
|
10
|
+
getCustomerApplications: (params?: {
|
11
|
+
definitionCode;
|
12
|
+
definitionVersion;
|
13
|
+
}) => Promise<CustomerApplication[]>;
|
14
|
+
getProducts: (params?: {
|
15
|
+
definitionCode;
|
16
|
+
definitionVersion;
|
17
|
+
}) => Promise<Product[]>;
|
18
|
+
getPledgeInstances: (params?: {
|
19
|
+
definitionCode;
|
20
|
+
definitionVersion;
|
21
|
+
}) => Promise<PledgeInstance[]>;
|
22
|
+
};
|
23
|
+
export {};
|
@@ -0,0 +1,166 @@
|
|
1
|
+
import { PropertiesArrayType } from '../interfaces';
|
2
|
+
export declare const mockProperties: PropertiesArrayType<Record<string, never>>;
|
3
|
+
export declare const mockPropsArray: ({
|
4
|
+
key: string;
|
5
|
+
propertyType: string;
|
6
|
+
name: string;
|
7
|
+
isRequired: boolean;
|
8
|
+
isMultiple: boolean;
|
9
|
+
sortOrder: number;
|
10
|
+
isEnabled: boolean;
|
11
|
+
uiSettings: any;
|
12
|
+
validationNode: any;
|
13
|
+
isViewableInList: boolean;
|
14
|
+
restrictedValues: any;
|
15
|
+
defaultValue: string;
|
16
|
+
defaultValues: any;
|
17
|
+
precisionScale?: undefined;
|
18
|
+
roundingMode?: undefined;
|
19
|
+
definitionCode?: undefined;
|
20
|
+
definitionVersion?: undefined;
|
21
|
+
labelPropertyCode?: undefined;
|
22
|
+
valuePropertyCode?: undefined;
|
23
|
+
} | {
|
24
|
+
key: string;
|
25
|
+
propertyType: string;
|
26
|
+
name: string;
|
27
|
+
isRequired: boolean;
|
28
|
+
isMultiple: boolean;
|
29
|
+
sortOrder: number;
|
30
|
+
isEnabled: boolean;
|
31
|
+
uiSettings: any;
|
32
|
+
validationNode: any;
|
33
|
+
isViewableInList: boolean;
|
34
|
+
defaultValue: number;
|
35
|
+
defaultValues: any;
|
36
|
+
precisionScale: number;
|
37
|
+
roundingMode: string;
|
38
|
+
restrictedValues?: undefined;
|
39
|
+
definitionCode?: undefined;
|
40
|
+
definitionVersion?: undefined;
|
41
|
+
labelPropertyCode?: undefined;
|
42
|
+
valuePropertyCode?: undefined;
|
43
|
+
} | {
|
44
|
+
key: string;
|
45
|
+
propertyType: string;
|
46
|
+
name: string;
|
47
|
+
isRequired: boolean;
|
48
|
+
isMultiple: boolean;
|
49
|
+
sortOrder: number;
|
50
|
+
isEnabled: boolean;
|
51
|
+
uiSettings: any;
|
52
|
+
validationNode: any;
|
53
|
+
isViewableInList: boolean;
|
54
|
+
definitionCode: string;
|
55
|
+
definitionVersion: string;
|
56
|
+
labelPropertyCode: string;
|
57
|
+
valuePropertyCode: string;
|
58
|
+
defaultValue: string;
|
59
|
+
defaultValues: any;
|
60
|
+
restrictedValues?: undefined;
|
61
|
+
precisionScale?: undefined;
|
62
|
+
roundingMode?: undefined;
|
63
|
+
})[];
|
64
|
+
export declare const mockPropsObject: {
|
65
|
+
any: {
|
66
|
+
propertyType: string;
|
67
|
+
name: string;
|
68
|
+
isRequired: boolean;
|
69
|
+
isMultiple: boolean;
|
70
|
+
sortOrder: number;
|
71
|
+
isEnabled: boolean;
|
72
|
+
uiSettings: any;
|
73
|
+
validationNode: any;
|
74
|
+
isViewableInList: boolean;
|
75
|
+
restrictedValues: any;
|
76
|
+
defaultValue: any;
|
77
|
+
defaultValues: any;
|
78
|
+
};
|
79
|
+
int: {
|
80
|
+
propertyType: string;
|
81
|
+
name: string;
|
82
|
+
isRequired: boolean;
|
83
|
+
isMultiple: boolean;
|
84
|
+
sortOrder: number;
|
85
|
+
isEnabled: boolean;
|
86
|
+
uiSettings: any;
|
87
|
+
validationNode: any;
|
88
|
+
isViewableInList: boolean;
|
89
|
+
restrictedValues: any;
|
90
|
+
defaultValue: any;
|
91
|
+
defaultValues: any;
|
92
|
+
};
|
93
|
+
string: {
|
94
|
+
propertyType: string;
|
95
|
+
name: string;
|
96
|
+
isRequired: boolean;
|
97
|
+
isMultiple: boolean;
|
98
|
+
sortOrder: number;
|
99
|
+
isEnabled: boolean;
|
100
|
+
uiSettings: any;
|
101
|
+
validationNode: any;
|
102
|
+
isViewableInList: boolean;
|
103
|
+
restrictedValues: any;
|
104
|
+
defaultValue: any;
|
105
|
+
defaultValues: any;
|
106
|
+
};
|
107
|
+
entity: {
|
108
|
+
propertyType: string;
|
109
|
+
name: string;
|
110
|
+
isRequired: boolean;
|
111
|
+
isMultiple: boolean;
|
112
|
+
sortOrder: number;
|
113
|
+
isEnabled: boolean;
|
114
|
+
uiSettings: any;
|
115
|
+
validationNode: any;
|
116
|
+
isViewableInList: boolean;
|
117
|
+
properties: {
|
118
|
+
foo: {
|
119
|
+
propertyType: string;
|
120
|
+
name: string;
|
121
|
+
isRequired: boolean;
|
122
|
+
isMultiple: boolean;
|
123
|
+
sortOrder: number;
|
124
|
+
isEnabled: boolean;
|
125
|
+
uiSettings: any;
|
126
|
+
validationNode: any;
|
127
|
+
isViewableInList: boolean;
|
128
|
+
restrictedValues: string[];
|
129
|
+
defaultValue: string;
|
130
|
+
defaultValues: any;
|
131
|
+
};
|
132
|
+
};
|
133
|
+
defaultValue: {
|
134
|
+
asd: string;
|
135
|
+
};
|
136
|
+
defaultValues: any;
|
137
|
+
};
|
138
|
+
b_decimal: {
|
139
|
+
propertyType: string;
|
140
|
+
name: string;
|
141
|
+
isRequired: boolean;
|
142
|
+
isMultiple: boolean;
|
143
|
+
sortOrder: number;
|
144
|
+
isEnabled: boolean;
|
145
|
+
uiSettings: any;
|
146
|
+
validationNode: any;
|
147
|
+
isViewableInList: boolean;
|
148
|
+
defaultValue: any;
|
149
|
+
defaultValues: any;
|
150
|
+
precisionScale: number;
|
151
|
+
roundingMode: string;
|
152
|
+
};
|
153
|
+
json: {
|
154
|
+
propertyType: string;
|
155
|
+
name: string;
|
156
|
+
isRequired: boolean;
|
157
|
+
isMultiple: boolean;
|
158
|
+
sortOrder: number;
|
159
|
+
isEnabled: boolean;
|
160
|
+
uiSettings: any;
|
161
|
+
validationNode: any;
|
162
|
+
isViewableInList: boolean;
|
163
|
+
defaultValue: any;
|
164
|
+
defaultValues: any;
|
165
|
+
};
|
166
|
+
};
|