@dartech/arsenal-ui 1.3.83 → 1.3.84
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 +146 -26
- package/package.json +1 -1
- package/src/interfaces/definition.d.ts +9 -1
- package/src/lib/Definition/CreateDefinition/CreateDefinition.d.ts +4 -1
- package/src/lib/Definition/DefinitionFiller/DefinitionFiller.d.ts +4 -1
- package/src/lib/Property/PropertyFiller/MultiplePropertyFiller.d.ts +4 -1
- package/src/lib/Property/PropertyFiller/MultiplePropertyWidget.d.ts +4 -1
- package/src/lib/Property/PropertyFiller/PropertyFiller.d.ts +4 -1
- package/src/lib/Property/PropertyWidget/PropertyWidget.d.ts +4 -1
- package/src/lib/Property/UpsertProperty/CreatePropertiesList.d.ts +4 -1
- package/src/lib/Property/UpsertProperty/CreatePropertyFormFields.d.ts +4 -1
- package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/EntityAdditionalFields.d.ts +4 -1
- package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/PropertyAdditionalFields.d.ts +4 -1
- package/src/lib/Property/UpsertProperty/PropertyValueField/BooleanValueField.d.ts +0 -1
- package/src/lib/Property/UpsertProperty/PropertyValueField/DateTimeValueField.d.ts +0 -1
- package/src/lib/Property/UpsertProperty/PropertyValueField/DateValueField.d.ts +0 -1
- package/src/lib/Property/UpsertProperty/PropertyValueField/FileValueWidget.d.ts +6 -0
- package/src/lib/Property/UpsertProperty/PropertyValueField/JsonValueField.d.ts +0 -1
- package/src/lib/Property/UpsertProperty/PropertyValueField/PropertyValueField.d.ts +4 -1
- package/src/lib/Property/UpsertProperty/PropertyValueField/StringValueField.d.ts +2 -1
- package/src/lib/Property/UpsertProperty/PropertyValueField/TimeValueField.d.ts +0 -1
- package/src/lib/Property/ViewProperty/PropertyItem.d.ts +0 -1
package/index.js
CHANGED
@@ -100,6 +100,8 @@ var PropertyType;
|
|
100
100
|
PropertyType["BOOLEAN"] = "BOOLEAN";
|
101
101
|
PropertyType["ENTITY_REFERENCE"] = "ENTITY_REFERENCE";
|
102
102
|
PropertyType["ENTITY"] = "ENTITY";
|
103
|
+
PropertyType["FILE"] = "FILE";
|
104
|
+
PropertyType["FILE_REFERENCE"] = "FILE_REFERENCE";
|
103
105
|
PropertyType["JSON"] = "JSON";
|
104
106
|
PropertyType["DATE"] = "DATE";
|
105
107
|
PropertyType["TIME"] = "TIME";
|
@@ -3285,7 +3287,8 @@ const EntityAdditionalFields = ({
|
|
3285
3287
|
entityDefinition: _entityDefinition = false,
|
3286
3288
|
globalParameter: _globalParameter = false,
|
3287
3289
|
entityReferenceDefinitionSources,
|
3288
|
-
entityReferenceValueComponent
|
3290
|
+
entityReferenceValueComponent,
|
3291
|
+
fileReferenceValueComponent
|
3289
3292
|
}) => {
|
3290
3293
|
const {
|
3291
3294
|
control,
|
@@ -3430,7 +3433,8 @@ const EntityAdditionalFields = ({
|
|
3430
3433
|
entityDefinition: _entityDefinition,
|
3431
3434
|
globalParameter: _globalParameter,
|
3432
3435
|
entityReferenceDefinitionSources: entityReferenceDefinitionSources,
|
3433
|
-
entityReferenceValueComponent: entityReferenceValueComponent
|
3436
|
+
entityReferenceValueComponent: entityReferenceValueComponent,
|
3437
|
+
fileReferenceValueComponent: fileReferenceValueComponent
|
3434
3438
|
})
|
3435
3439
|
}))]
|
3436
3440
|
}))
|
@@ -3602,7 +3606,8 @@ const PropertyAdditionalFields = ({
|
|
3602
3606
|
entityDefinition: _entityDefinition = false,
|
3603
3607
|
globalParameter: _globalParameter = false,
|
3604
3608
|
entityReferenceDefinitionSources,
|
3605
|
-
entityReferenceValueComponent
|
3609
|
+
entityReferenceValueComponent,
|
3610
|
+
fileReferenceValueComponent
|
3606
3611
|
}) => {
|
3607
3612
|
switch (propertyType) {
|
3608
3613
|
case PropertyType.STRING:
|
@@ -3639,7 +3644,8 @@ const PropertyAdditionalFields = ({
|
|
3639
3644
|
globalParameter: _globalParameter,
|
3640
3645
|
entityDefinition: _entityDefinition,
|
3641
3646
|
entityReferenceDefinitionSources: entityReferenceDefinitionSources,
|
3642
|
-
entityReferenceValueComponent: entityReferenceValueComponent
|
3647
|
+
entityReferenceValueComponent: entityReferenceValueComponent,
|
3648
|
+
fileReferenceValueComponent: fileReferenceValueComponent
|
3643
3649
|
});
|
3644
3650
|
default:
|
3645
3651
|
return null;
|
@@ -3668,8 +3674,10 @@ const StringValueField = ({
|
|
3668
3674
|
name,
|
3669
3675
|
rules: {
|
3670
3676
|
required: required && (Array.isArray(restrictedValues) && restrictedValues.length ? 'Please, select a value' : 'Please, fill this field')
|
3677
|
+
// pattern: validate && urlValidator,
|
3671
3678
|
}
|
3672
3679
|
});
|
3680
|
+
|
3673
3681
|
const value = useWatch({
|
3674
3682
|
control,
|
3675
3683
|
name
|
@@ -3707,6 +3715,79 @@ const StringValueField = ({
|
|
3707
3715
|
};
|
3708
3716
|
var StringValueField$1 = StringValueField;
|
3709
3717
|
|
3718
|
+
const convertBase64 = file => {
|
3719
|
+
return new Promise((resolve, reject) => {
|
3720
|
+
const fileReader = new FileReader();
|
3721
|
+
fileReader.readAsDataURL(file);
|
3722
|
+
fileReader.onload = () => {
|
3723
|
+
resolve(fileReader.result);
|
3724
|
+
};
|
3725
|
+
fileReader.onerror = error => {
|
3726
|
+
reject(error);
|
3727
|
+
};
|
3728
|
+
});
|
3729
|
+
};
|
3730
|
+
const FileValueWidget = ({
|
3731
|
+
name
|
3732
|
+
}) => {
|
3733
|
+
const {
|
3734
|
+
control,
|
3735
|
+
setValue,
|
3736
|
+
register
|
3737
|
+
} = useFormContext();
|
3738
|
+
const [fileType, setFileType] = useState(null);
|
3739
|
+
const fileValue = useWatch({
|
3740
|
+
control,
|
3741
|
+
name
|
3742
|
+
});
|
3743
|
+
const handleFileRead = useCallback(event => __awaiter(void 0, void 0, void 0, function* () {
|
3744
|
+
const file = event.target.files[0];
|
3745
|
+
const reader = new FileReader();
|
3746
|
+
reader.readAsDataURL(file);
|
3747
|
+
const base64 = yield convertBase64(file);
|
3748
|
+
setValue(name, base64);
|
3749
|
+
}), [name, setValue]);
|
3750
|
+
useEffect(() => {
|
3751
|
+
if (fileValue) {
|
3752
|
+
const type = fileValue.substring(fileValue.indexOf(':') + 1, fileValue.indexOf(';base64'));
|
3753
|
+
if (type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') {
|
3754
|
+
setFileType('application/xls');
|
3755
|
+
} else if (type === 'application/vnd.openxmlformats-officedocument.wordprocessingml.document') {
|
3756
|
+
setFileType('application/docx');
|
3757
|
+
} else {
|
3758
|
+
setFileType(type);
|
3759
|
+
}
|
3760
|
+
}
|
3761
|
+
}, [fileValue]);
|
3762
|
+
return jsxs(Fragment, {
|
3763
|
+
children: [fileType && jsx(Box, Object.assign({
|
3764
|
+
mb: 2
|
3765
|
+
}, {
|
3766
|
+
children: jsx(Typography, Object.assign({
|
3767
|
+
variant: "subtitle2"
|
3768
|
+
}, {
|
3769
|
+
children: `Uploaded file type: ${fileType}`
|
3770
|
+
}))
|
3771
|
+
})), jsxs(Button, Object.assign({
|
3772
|
+
component: "label",
|
3773
|
+
variant: "contained",
|
3774
|
+
size: "large",
|
3775
|
+
color: "primary"
|
3776
|
+
}, {
|
3777
|
+
children: [fileType ? 'Change file' : 'Upload file', jsx("input", Object.assign({
|
3778
|
+
type: "hidden"
|
3779
|
+
}, register(`${name}`, {
|
3780
|
+
required: true
|
3781
|
+
}))), jsx("input", {
|
3782
|
+
type: "file",
|
3783
|
+
hidden: true,
|
3784
|
+
onChange: handleFileRead
|
3785
|
+
})]
|
3786
|
+
}))]
|
3787
|
+
});
|
3788
|
+
};
|
3789
|
+
var FileValueWidget$1 = FileValueWidget;
|
3790
|
+
|
3710
3791
|
const PropertyWidget = ({
|
3711
3792
|
property,
|
3712
3793
|
name,
|
@@ -3714,7 +3795,8 @@ const PropertyWidget = ({
|
|
3714
3795
|
useExpression,
|
3715
3796
|
control,
|
3716
3797
|
entityReferenceDefinitionSources,
|
3717
|
-
entityReferenceValueComponent: EntityReferenceValueComponent
|
3798
|
+
entityReferenceValueComponent: EntityReferenceValueComponent,
|
3799
|
+
fileReferenceValueComponent: FileReferenceValueComponent
|
3718
3800
|
}) => {
|
3719
3801
|
const propertyType = useMemo(() => typeof property.propertyType === 'string' ? property.propertyType : property['propertyType']['value'], [property]);
|
3720
3802
|
switch (propertyType) {
|
@@ -3807,6 +3889,21 @@ const PropertyWidget = ({
|
|
3807
3889
|
label: label
|
3808
3890
|
});
|
3809
3891
|
}
|
3892
|
+
case PropertyType.FILE:
|
3893
|
+
return jsx(FileValueWidget$1, {
|
3894
|
+
name: name
|
3895
|
+
});
|
3896
|
+
case PropertyType.FILE_REFERENCE:
|
3897
|
+
if (FileReferenceValueComponent) {
|
3898
|
+
return jsx(FileReferenceValueComponent, {
|
3899
|
+
name: name
|
3900
|
+
});
|
3901
|
+
} else {
|
3902
|
+
return jsx(StringValueField$1, {
|
3903
|
+
name: name,
|
3904
|
+
label: label
|
3905
|
+
});
|
3906
|
+
}
|
3810
3907
|
case PropertyType.ANY:
|
3811
3908
|
return jsx(ControlAceEditor, {
|
3812
3909
|
control: control,
|
@@ -3820,7 +3917,8 @@ const PropertyWidget = ({
|
|
3820
3917
|
dataFieldName: name,
|
3821
3918
|
useExpression: useExpression,
|
3822
3919
|
entityReferenceDefinitionSources: entityReferenceDefinitionSources,
|
3823
|
-
entityReferenceValueComponent: EntityReferenceValueComponent
|
3920
|
+
entityReferenceValueComponent: EntityReferenceValueComponent,
|
3921
|
+
fileReferenceValueComponent: FileReferenceValueComponent
|
3824
3922
|
});
|
3825
3923
|
default:
|
3826
3924
|
return jsx("div", {
|
@@ -3862,6 +3960,8 @@ const usePropertyFiller = ({
|
|
3862
3960
|
case PropertyType.DATE_TIME:
|
3863
3961
|
case PropertyType.ENTITY_REFERENCE:
|
3864
3962
|
case PropertyType.ANY:
|
3963
|
+
case PropertyType.FILE:
|
3964
|
+
case PropertyType.FILE_REFERENCE:
|
3865
3965
|
return '';
|
3866
3966
|
case PropertyType.JSON:
|
3867
3967
|
return {};
|
@@ -3929,7 +4029,8 @@ const PropertyFiller = ({
|
|
3929
4029
|
required,
|
3930
4030
|
title,
|
3931
4031
|
entityReferenceDefinitionSources,
|
3932
|
-
entityReferenceValueComponent
|
4032
|
+
entityReferenceValueComponent,
|
4033
|
+
fileReferenceValueComponent
|
3933
4034
|
}) => {
|
3934
4035
|
const {
|
3935
4036
|
control,
|
@@ -4103,12 +4204,14 @@ const PropertyFiller = ({
|
|
4103
4204
|
useExpression: useExpression,
|
4104
4205
|
label: valueLabel,
|
4105
4206
|
entityReferenceDefinitionSources: entityReferenceDefinitionSources,
|
4106
|
-
entityReferenceValueComponent: entityReferenceValueComponent
|
4207
|
+
entityReferenceValueComponent: entityReferenceValueComponent,
|
4208
|
+
fileReferenceValueComponent: fileReferenceValueComponent
|
4107
4209
|
}), fillOption === 'dem_builder' && jsx(CreateDefinition, {
|
4108
4210
|
title: "JSON",
|
4109
4211
|
definitionFieldName: name,
|
4110
4212
|
entityReferenceDefinitionSources: entityReferenceDefinitionSources,
|
4111
|
-
entityReferenceValueComponent: entityReferenceValueComponent
|
4213
|
+
entityReferenceValueComponent: entityReferenceValueComponent,
|
4214
|
+
fileReferenceValueComponent: fileReferenceValueComponent
|
4112
4215
|
}), error && jsx(FormHelperText, Object.assign({
|
4113
4216
|
error: true
|
4114
4217
|
}, {
|
@@ -4124,7 +4227,8 @@ const MultiplePropertyWidget = ({
|
|
4124
4227
|
required,
|
4125
4228
|
label,
|
4126
4229
|
entityReferenceDefinitionSources,
|
4127
|
-
entityReferenceValueComponent
|
4230
|
+
entityReferenceValueComponent,
|
4231
|
+
fileReferenceValueComponent
|
4128
4232
|
}) => {
|
4129
4233
|
const {
|
4130
4234
|
control,
|
@@ -4171,7 +4275,8 @@ const MultiplePropertyWidget = ({
|
|
4171
4275
|
name: `${name}.${index}`,
|
4172
4276
|
label: `${label || property.name} (${index + 1})`,
|
4173
4277
|
entityReferenceDefinitionSources: entityReferenceDefinitionSources,
|
4174
|
-
entityReferenceValueComponent: entityReferenceValueComponent
|
4278
|
+
entityReferenceValueComponent: entityReferenceValueComponent,
|
4279
|
+
fileReferenceValueComponent: fileReferenceValueComponent
|
4175
4280
|
}), jsx(Box, Object.assign({
|
4176
4281
|
mt: "8px",
|
4177
4282
|
ml: "4px"
|
@@ -4213,7 +4318,8 @@ const MultiplePropertyFiller = ({
|
|
4213
4318
|
label,
|
4214
4319
|
title,
|
4215
4320
|
entityReferenceDefinitionSources,
|
4216
|
-
entityReferenceValueComponent
|
4321
|
+
entityReferenceValueComponent,
|
4322
|
+
fileReferenceValueComponent
|
4217
4323
|
}) => {
|
4218
4324
|
var _a;
|
4219
4325
|
const [selectTouched, setSelectTouched] = useState(false);
|
@@ -4357,7 +4463,8 @@ const MultiplePropertyFiller = ({
|
|
4357
4463
|
required: required,
|
4358
4464
|
label: label,
|
4359
4465
|
entityReferenceDefinitionSources: entityReferenceDefinitionSources,
|
4360
|
-
entityReferenceValueComponent: entityReferenceValueComponent
|
4466
|
+
entityReferenceValueComponent: entityReferenceValueComponent,
|
4467
|
+
fileReferenceValueComponent: fileReferenceValueComponent
|
4361
4468
|
}), error && jsx(FormHelperText, Object.assign({
|
4362
4469
|
error: true
|
4363
4470
|
}, {
|
@@ -4372,7 +4479,8 @@ const PropertyValueField = ({
|
|
4372
4479
|
label: _label = '',
|
4373
4480
|
required,
|
4374
4481
|
entityReferenceDefinitionSources,
|
4375
|
-
entityReferenceValueComponent
|
4482
|
+
entityReferenceValueComponent,
|
4483
|
+
fileReferenceValueComponent
|
4376
4484
|
}) => {
|
4377
4485
|
const {
|
4378
4486
|
control
|
@@ -4425,14 +4533,16 @@ const PropertyValueField = ({
|
|
4425
4533
|
title: _label,
|
4426
4534
|
required: required,
|
4427
4535
|
entityReferenceDefinitionSources: entityReferenceDefinitionSources,
|
4428
|
-
entityReferenceValueComponent: entityReferenceValueComponent
|
4536
|
+
entityReferenceValueComponent: entityReferenceValueComponent,
|
4537
|
+
fileReferenceValueComponent: fileReferenceValueComponent
|
4429
4538
|
}) : jsx(PropertyFiller, {
|
4430
4539
|
name: name,
|
4431
4540
|
property: fillerProperty,
|
4432
4541
|
title: _label,
|
4433
4542
|
required: required,
|
4434
4543
|
entityReferenceDefinitionSources: entityReferenceDefinitionSources,
|
4435
|
-
entityReferenceValueComponent: entityReferenceValueComponent
|
4544
|
+
entityReferenceValueComponent: entityReferenceValueComponent,
|
4545
|
+
fileReferenceValueComponent: fileReferenceValueComponent
|
4436
4546
|
});
|
4437
4547
|
};
|
4438
4548
|
|
@@ -4831,7 +4941,8 @@ const CreatePropertyFormFields = ({
|
|
4831
4941
|
globalParameter: _globalParameter = false,
|
4832
4942
|
customPropertyFields: _customPropertyFields = [],
|
4833
4943
|
entityReferenceDefinitionSources,
|
4834
|
-
entityReferenceValueComponent
|
4944
|
+
entityReferenceValueComponent,
|
4945
|
+
fileReferenceValueComponent
|
4835
4946
|
}) => {
|
4836
4947
|
var _a;
|
4837
4948
|
const {
|
@@ -4959,14 +5070,16 @@ const CreatePropertyFormFields = ({
|
|
4959
5070
|
globalParameter: _globalParameter,
|
4960
5071
|
entityDefinition: _entityDefinition,
|
4961
5072
|
entityReferenceDefinitionSources: entityReferenceDefinitionSources,
|
4962
|
-
entityReferenceValueComponent: entityReferenceValueComponent
|
5073
|
+
entityReferenceValueComponent: entityReferenceValueComponent,
|
5074
|
+
fileReferenceValueComponent: fileReferenceValueComponent
|
4963
5075
|
}), jsx(PropertyValueField, {
|
4964
5076
|
propertyFieldName: propertyFieldName,
|
4965
5077
|
name: `${propertyFieldName}.${_globalParameter ? 'value' : 'defaultValue'}`,
|
4966
5078
|
label: valueLabel,
|
4967
5079
|
required: _globalParameter ? isRequired : false,
|
4968
5080
|
entityReferenceDefinitionSources: entityReferenceDefinitionSources,
|
4969
|
-
entityReferenceValueComponent: entityReferenceValueComponent
|
5081
|
+
entityReferenceValueComponent: entityReferenceValueComponent,
|
5082
|
+
fileReferenceValueComponent: fileReferenceValueComponent
|
4970
5083
|
})]
|
4971
5084
|
}), customFields.length ? jsx(Fragment, {
|
4972
5085
|
children: customFields.map((field, index) => jsx(Grid, {
|
@@ -5002,7 +5115,8 @@ const CreatePropertiesList = ({
|
|
5002
5115
|
entityPropFields,
|
5003
5116
|
parentRemove,
|
5004
5117
|
entityReferenceDefinitionSources,
|
5005
|
-
entityReferenceValueComponent
|
5118
|
+
entityReferenceValueComponent,
|
5119
|
+
fileReferenceValueComponent
|
5006
5120
|
}) => {
|
5007
5121
|
const fieldName = useMemo(() => parentFieldName ? `${parentFieldName}.properties` : `properties`, [parentFieldName]);
|
5008
5122
|
const {
|
@@ -5098,7 +5212,8 @@ const CreatePropertiesList = ({
|
|
5098
5212
|
globalParameter: _globalParameter,
|
5099
5213
|
customPropertyFields: _customPropertyFields,
|
5100
5214
|
entityReferenceDefinitionSources: entityReferenceDefinitionSources,
|
5101
|
-
entityReferenceValueComponent: entityReferenceValueComponent
|
5215
|
+
entityReferenceValueComponent: entityReferenceValueComponent,
|
5216
|
+
fileReferenceValueComponent: fileReferenceValueComponent
|
5102
5217
|
})
|
5103
5218
|
}), jsx(AccordionActions, {
|
5104
5219
|
children: jsx(Button, Object.assign({
|
@@ -5134,7 +5249,8 @@ const CreateDefinition = ({
|
|
5134
5249
|
hideNameField,
|
5135
5250
|
required: _required = false,
|
5136
5251
|
entityReferenceDefinitionSources,
|
5137
|
-
entityReferenceValueComponent
|
5252
|
+
entityReferenceValueComponent,
|
5253
|
+
fileReferenceValueComponent
|
5138
5254
|
}) => {
|
5139
5255
|
const {
|
5140
5256
|
control
|
@@ -5187,7 +5303,8 @@ const CreateDefinition = ({
|
|
5187
5303
|
required: _required,
|
5188
5304
|
parentFieldName: definitionFieldName,
|
5189
5305
|
entityReferenceDefinitionSources: entityReferenceDefinitionSources,
|
5190
|
-
entityReferenceValueComponent: entityReferenceValueComponent
|
5306
|
+
entityReferenceValueComponent: entityReferenceValueComponent,
|
5307
|
+
fileReferenceValueComponent: fileReferenceValueComponent
|
5191
5308
|
})]
|
5192
5309
|
}));
|
5193
5310
|
};
|
@@ -5465,7 +5582,8 @@ const DefinitionFiller = ({
|
|
5465
5582
|
useExpression: _useExpression = false,
|
5466
5583
|
title,
|
5467
5584
|
entityReferenceDefinitionSources,
|
5468
|
-
entityReferenceValueComponent
|
5585
|
+
entityReferenceValueComponent,
|
5586
|
+
fileReferenceValueComponent
|
5469
5587
|
}) => {
|
5470
5588
|
const stepperData = useMemo(() => {
|
5471
5589
|
if (properties) {
|
@@ -5490,6 +5608,7 @@ const DefinitionFiller = ({
|
|
5490
5608
|
label: property.name,
|
5491
5609
|
required: property.isRequired,
|
5492
5610
|
entityReferenceValueComponent: entityReferenceValueComponent,
|
5611
|
+
fileReferenceValueComponent: fileReferenceValueComponent,
|
5493
5612
|
entityReferenceDefinitionSources: entityReferenceDefinitionSources
|
5494
5613
|
}) : jsx(PropertyFiller, {
|
5495
5614
|
property: property,
|
@@ -5498,13 +5617,14 @@ const DefinitionFiller = ({
|
|
5498
5617
|
label: property.name,
|
5499
5618
|
required: property.isRequired,
|
5500
5619
|
entityReferenceDefinitionSources: entityReferenceDefinitionSources,
|
5501
|
-
entityReferenceValueComponent: entityReferenceValueComponent
|
5620
|
+
entityReferenceValueComponent: entityReferenceValueComponent,
|
5621
|
+
fileReferenceValueComponent: fileReferenceValueComponent
|
5502
5622
|
})
|
5503
5623
|
};
|
5504
5624
|
});
|
5505
5625
|
}
|
5506
5626
|
return [];
|
5507
|
-
}, [properties, dataFieldName, _useExpression, entityReferenceValueComponent, entityReferenceDefinitionSources]);
|
5627
|
+
}, [properties, dataFieldName, _useExpression, entityReferenceValueComponent, entityReferenceDefinitionSources, fileReferenceValueComponent]);
|
5508
5628
|
return jsx(LocalizationProvider, Object.assign({
|
5509
5629
|
dateAdapter: AdapterDateFns
|
5510
5630
|
}, {
|
package/package.json
CHANGED
@@ -10,6 +10,8 @@ export declare enum PropertyType {
|
|
10
10
|
BOOLEAN = "BOOLEAN",
|
11
11
|
ENTITY_REFERENCE = "ENTITY_REFERENCE",
|
12
12
|
ENTITY = "ENTITY",
|
13
|
+
FILE = "FILE",
|
14
|
+
FILE_REFERENCE = "FILE_REFERENCE",
|
13
15
|
JSON = "JSON",
|
14
16
|
DATE = "DATE",
|
15
17
|
TIME = "TIME",
|
@@ -105,7 +107,13 @@ export interface TimeProperty extends Property {
|
|
105
107
|
export interface AnyProperty extends Property {
|
106
108
|
propertyType: PropertyType.ANY;
|
107
109
|
}
|
108
|
-
export
|
110
|
+
export interface FileProperty extends Property {
|
111
|
+
propertyType: PropertyType.FILE;
|
112
|
+
}
|
113
|
+
export interface FileReferenceProperty extends Property {
|
114
|
+
propertyType: PropertyType.FILE_REFERENCE;
|
115
|
+
}
|
116
|
+
export type PropertyUnion<T = Record<string, never>> = BigDecimalProperty | BigIntegerProperty | BooleanProperty | DateProperty | DateTimeProperty | DoubleProperty | EntityTypeProperty<T> | EntityReferenceProperty | FloatProperty | StringProperty | IntegerProperty | JsonProperty | LongProperty | TimeProperty | AnyProperty | EntityReferenceProperty | FileProperty | FileReferenceProperty;
|
109
117
|
export declare const DATE_DEFAULT_FORMAT = "yyyy-MM-dd";
|
110
118
|
export declare const TIME_DEFAULT_FORMAT = "HH:mm:ss";
|
111
119
|
export declare const DATE_TIME_DEFAULT_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX";
|
@@ -15,6 +15,9 @@ type Props = {
|
|
15
15
|
name: string;
|
16
16
|
property: EntityReferenceProperty;
|
17
17
|
}>;
|
18
|
+
fileReferenceValueComponent?: React.ElementType<{
|
19
|
+
name: string;
|
20
|
+
}>;
|
18
21
|
};
|
19
|
-
export declare const CreateDefinition: ({ definitionFieldName, title, hideCodeField, hideVersionField, hideNameField, required, entityReferenceDefinitionSources, entityReferenceValueComponent, }: Props) => JSX.Element;
|
22
|
+
export declare const CreateDefinition: ({ definitionFieldName, title, hideCodeField, hideVersionField, hideNameField, required, entityReferenceDefinitionSources, entityReferenceValueComponent, fileReferenceValueComponent, }: Props) => JSX.Element;
|
20
23
|
export default CreateDefinition;
|
@@ -13,6 +13,9 @@ type Props = {
|
|
13
13
|
name: string;
|
14
14
|
property: EntityReferenceProperty;
|
15
15
|
}>;
|
16
|
+
fileReferenceValueComponent?: React.ElementType<{
|
17
|
+
name: string;
|
18
|
+
}>;
|
16
19
|
};
|
17
|
-
export declare const DefinitionFiller: ({ properties, dataFieldName, useExpression, title, entityReferenceDefinitionSources, entityReferenceValueComponent, }: Props) => JSX.Element;
|
20
|
+
export declare const DefinitionFiller: ({ properties, dataFieldName, useExpression, title, entityReferenceDefinitionSources, entityReferenceValueComponent, fileReferenceValueComponent, }: Props) => JSX.Element;
|
18
21
|
export default DefinitionFiller;
|
@@ -15,6 +15,9 @@ type Props = {
|
|
15
15
|
name: string;
|
16
16
|
property: EntityReferenceProperty;
|
17
17
|
}>;
|
18
|
+
fileReferenceValueComponent?: React.ElementType<{
|
19
|
+
name: string;
|
20
|
+
}>;
|
18
21
|
};
|
19
|
-
export declare const MultiplePropertyFiller: ({ property, name, useExpression, required, label, title, entityReferenceDefinitionSources, entityReferenceValueComponent, }: Props) => JSX.Element;
|
22
|
+
export declare const MultiplePropertyFiller: ({ property, name, useExpression, required, label, title, entityReferenceDefinitionSources, entityReferenceValueComponent, fileReferenceValueComponent, }: Props) => JSX.Element;
|
20
23
|
export default MultiplePropertyFiller;
|
@@ -14,6 +14,9 @@ type Props = {
|
|
14
14
|
name: string;
|
15
15
|
property: EntityReferenceProperty;
|
16
16
|
}>;
|
17
|
+
fileReferenceValueComponent?: React.ElementType<{
|
18
|
+
name: string;
|
19
|
+
}>;
|
17
20
|
};
|
18
|
-
export declare const MultiplePropertyWidget: ({ name, property, useExpression, required, label, entityReferenceDefinitionSources, entityReferenceValueComponent, }: Props) => JSX.Element;
|
21
|
+
export declare const MultiplePropertyWidget: ({ name, property, useExpression, required, label, entityReferenceDefinitionSources, entityReferenceValueComponent, fileReferenceValueComponent, }: Props) => JSX.Element;
|
19
22
|
export default MultiplePropertyWidget;
|
@@ -15,6 +15,9 @@ export type PropertyFillerProps = {
|
|
15
15
|
name: string;
|
16
16
|
property: EntityReferenceProperty;
|
17
17
|
}>;
|
18
|
+
fileReferenceValueComponent?: React.ElementType<{
|
19
|
+
name: string;
|
20
|
+
}>;
|
18
21
|
};
|
19
|
-
export declare const PropertyFiller: ({ property, name, useExpression, label, required, title, entityReferenceDefinitionSources, entityReferenceValueComponent, }: PropertyFillerProps) => JSX.Element;
|
22
|
+
export declare const PropertyFiller: ({ property, name, useExpression, label, required, title, entityReferenceDefinitionSources, entityReferenceValueComponent, fileReferenceValueComponent, }: PropertyFillerProps) => JSX.Element;
|
20
23
|
export default PropertyFiller;
|
@@ -15,6 +15,9 @@ type Props = {
|
|
15
15
|
name: string;
|
16
16
|
property: EntityReferenceProperty;
|
17
17
|
}>;
|
18
|
+
fileReferenceValueComponent?: React.ElementType<{
|
19
|
+
name: string;
|
20
|
+
}>;
|
18
21
|
};
|
19
|
-
export declare const PropertyWidget: ({ property, name, label, useExpression, control, entityReferenceDefinitionSources, entityReferenceValueComponent: EntityReferenceValueComponent, }: Props) => JSX.Element;
|
22
|
+
export declare const PropertyWidget: ({ property, name, label, useExpression, control, entityReferenceDefinitionSources, entityReferenceValueComponent: EntityReferenceValueComponent, fileReferenceValueComponent: FileReferenceValueComponent, }: Props) => JSX.Element;
|
20
23
|
export default PropertyWidget;
|
@@ -20,6 +20,9 @@ type Props = {
|
|
20
20
|
name: string;
|
21
21
|
property: EntityReferenceProperty;
|
22
22
|
}>;
|
23
|
+
fileReferenceValueComponent?: React.ElementType<{
|
24
|
+
name: string;
|
25
|
+
}>;
|
23
26
|
};
|
24
|
-
export declare const CreatePropertiesList: ({ parentFieldName, hideAddButton, focusOnIndex, required, entityDefinition, globalParameter, customPropertyFields, entityPropFields, parentRemove, entityReferenceDefinitionSources, entityReferenceValueComponent, }: Props) => JSX.Element;
|
27
|
+
export declare const CreatePropertiesList: ({ parentFieldName, hideAddButton, focusOnIndex, required, entityDefinition, globalParameter, customPropertyFields, entityPropFields, parentRemove, entityReferenceDefinitionSources, entityReferenceValueComponent, fileReferenceValueComponent, }: Props) => JSX.Element;
|
25
28
|
export default CreatePropertiesList;
|
@@ -13,6 +13,9 @@ type Props = {
|
|
13
13
|
name: string;
|
14
14
|
property: EntityReferenceProperty;
|
15
15
|
}>;
|
16
|
+
fileReferenceValueComponent?: React.ElementType<{
|
17
|
+
name: string;
|
18
|
+
}>;
|
16
19
|
};
|
17
|
-
export declare const CreatePropertyFormFields: ({ propertyFieldName, entityDefinition, globalParameter, customPropertyFields, entityReferenceDefinitionSources, entityReferenceValueComponent, }: Props) => JSX.Element;
|
20
|
+
export declare const CreatePropertyFormFields: ({ propertyFieldName, entityDefinition, globalParameter, customPropertyFields, entityReferenceDefinitionSources, entityReferenceValueComponent, fileReferenceValueComponent, }: Props) => JSX.Element;
|
18
21
|
export default CreatePropertyFormFields;
|
package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/EntityAdditionalFields.d.ts
CHANGED
@@ -12,6 +12,9 @@ type Props = {
|
|
12
12
|
name: string;
|
13
13
|
property: EntityReferenceProperty;
|
14
14
|
}>;
|
15
|
+
fileReferenceValueComponent?: React.ElementType<{
|
16
|
+
name: string;
|
17
|
+
}>;
|
15
18
|
};
|
16
|
-
declare const EntityAdditionalFields: ({ parentPropertyFieldName, entityDefinition, globalParameter, entityReferenceDefinitionSources, entityReferenceValueComponent, }: Props) => JSX.Element;
|
19
|
+
declare const EntityAdditionalFields: ({ parentPropertyFieldName, entityDefinition, globalParameter, entityReferenceDefinitionSources, entityReferenceValueComponent, fileReferenceValueComponent, }: Props) => JSX.Element;
|
17
20
|
export default EntityAdditionalFields;
|
package/src/lib/Property/UpsertProperty/PropertyAdditionalFields/PropertyAdditionalFields.d.ts
CHANGED
@@ -13,6 +13,9 @@ type Props = {
|
|
13
13
|
name: string;
|
14
14
|
property: EntityReferenceProperty;
|
15
15
|
}>;
|
16
|
+
fileReferenceValueComponent?: React.ElementType<{
|
17
|
+
name: string;
|
18
|
+
}>;
|
16
19
|
};
|
17
|
-
export declare const PropertyAdditionalFields: ({ propertyType, propertyFieldName, entityDefinition, globalParameter, entityReferenceDefinitionSources, entityReferenceValueComponent, }: Props) => JSX.Element;
|
20
|
+
export declare const PropertyAdditionalFields: ({ propertyType, propertyFieldName, entityDefinition, globalParameter, entityReferenceDefinitionSources, entityReferenceValueComponent, fileReferenceValueComponent, }: Props) => JSX.Element;
|
18
21
|
export default PropertyAdditionalFields;
|
@@ -13,6 +13,9 @@ type Props = {
|
|
13
13
|
name: string;
|
14
14
|
property: EntityReferenceProperty;
|
15
15
|
}>;
|
16
|
+
fileReferenceValueComponent?: React.ElementType<{
|
17
|
+
name: string;
|
18
|
+
}>;
|
16
19
|
};
|
17
|
-
export declare const PropertyValueField: ({ propertyFieldName, name, label, required, entityReferenceDefinitionSources, entityReferenceValueComponent, }: Props) => JSX.Element;
|
20
|
+
export declare const PropertyValueField: ({ propertyFieldName, name, label, required, entityReferenceDefinitionSources, entityReferenceValueComponent, fileReferenceValueComponent, }: Props) => JSX.Element;
|
18
21
|
export default PropertyValueField;
|
@@ -4,6 +4,7 @@ type Props = {
|
|
4
4
|
label?: string;
|
5
5
|
required?: boolean;
|
6
6
|
restrictedValues?: string[];
|
7
|
+
urlValidate?: boolean;
|
7
8
|
};
|
8
|
-
declare const StringValueField: ({ name, label, required, restrictedValues }: Props) => JSX.Element;
|
9
|
+
declare const StringValueField: ({ name, label, required, restrictedValues, }: Props) => JSX.Element;
|
9
10
|
export default StringValueField;
|