@dartech/arsenal-ui 1.3.81 → 1.3.83

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
@@ -527,7 +527,7 @@ const ControlCheckbox = _a => {
527
527
  const _b = useController({
528
528
  name,
529
529
  control,
530
- defaultValue: false
530
+ defaultValue: defaultValue !== null && defaultValue !== void 0 ? defaultValue : false
531
531
  }),
532
532
  _c = _b.field,
533
533
  {
@@ -568,7 +568,7 @@ const ControlCheckbox = _a => {
568
568
  name: name,
569
569
  inputRef: ref,
570
570
  disabled: disabled,
571
- defaultChecked: defaultValue
571
+ defaultChecked: checked
572
572
  }, checkboxProps)),
573
573
  label: label
574
574
  }), !hideErrorMessage && (error === null || error === void 0 ? void 0 : error.message) && jsx(FormHelperText, {
@@ -1836,7 +1836,7 @@ const getSinglePropertyFillOptions = ({
1836
1836
  options[0].label = 'Switch';
1837
1837
  break;
1838
1838
  case PropertyType.ENTITY_REFERENCE:
1839
- options[0].label = 'Entity reference fields';
1839
+ options[0].label = 'Entity reference field';
1840
1840
  break;
1841
1841
  case PropertyType.JSON:
1842
1842
  options[0].label = 'JSON editor';
@@ -3283,7 +3283,9 @@ const defaultPropertyValues$1 = {
3283
3283
  const EntityAdditionalFields = ({
3284
3284
  parentPropertyFieldName,
3285
3285
  entityDefinition: _entityDefinition = false,
3286
- globalParameter: _globalParameter = false
3286
+ globalParameter: _globalParameter = false,
3287
+ entityReferenceDefinitionSources,
3288
+ entityReferenceValueComponent
3287
3289
  }) => {
3288
3290
  const {
3289
3291
  control,
@@ -3426,7 +3428,9 @@ const EntityAdditionalFields = ({
3426
3428
  parentFieldName: parentPropertyFieldName,
3427
3429
  focusOnIndex: focusedProperty,
3428
3430
  entityDefinition: _entityDefinition,
3429
- globalParameter: _globalParameter
3431
+ globalParameter: _globalParameter,
3432
+ entityReferenceDefinitionSources: entityReferenceDefinitionSources,
3433
+ entityReferenceValueComponent: entityReferenceValueComponent
3430
3434
  })
3431
3435
  }))]
3432
3436
  }))
@@ -3444,6 +3448,59 @@ const EntityAdditionalFields = ({
3444
3448
  };
3445
3449
  var EntityAdditionalFields$1 = EntityAdditionalFields;
3446
3450
 
3451
+ const EntityReferencePropertyFields = ({
3452
+ propertyFieldName,
3453
+ sources: _sources = [{
3454
+ label: 'Arsenal Entities',
3455
+ value: 'ARSENAL_ENTITIES'
3456
+ }]
3457
+ }) => {
3458
+ const {
3459
+ control
3460
+ } = useFormContext();
3461
+ return jsxs(Fragment, {
3462
+ children: [jsx(Grid, {
3463
+ children: jsx(ControlSelect, {
3464
+ required: true,
3465
+ control: control,
3466
+ name: `${propertyFieldName}.source`,
3467
+ label: "Source",
3468
+ options: _sources
3469
+ })
3470
+ }), jsx(Grid, {
3471
+ children: jsx(ControlInput, {
3472
+ required: true,
3473
+ control: control,
3474
+ name: `${propertyFieldName}.definitionCode`,
3475
+ label: "Definition Code"
3476
+ })
3477
+ }), jsx(Grid, {
3478
+ children: jsx(ControlInput, {
3479
+ required: true,
3480
+ control: control,
3481
+ name: `${propertyFieldName}.definitionVersion`,
3482
+ label: "Definition Version",
3483
+ defaultValue: 1
3484
+ })
3485
+ }), jsx(Grid, {
3486
+ children: jsx(ControlInput, {
3487
+ required: true,
3488
+ control: control,
3489
+ name: `${propertyFieldName}.labelPropertyCode`,
3490
+ label: "Label Property Code"
3491
+ })
3492
+ }), jsx(Grid, {
3493
+ children: jsx(ControlInput, {
3494
+ required: true,
3495
+ control: control,
3496
+ name: `${propertyFieldName}.valuePropertyCode`,
3497
+ label: "Value Property Code"
3498
+ })
3499
+ })]
3500
+ });
3501
+ };
3502
+ var EntityReferencePropertyFields$1 = EntityReferencePropertyFields;
3503
+
3447
3504
  const StringPropertyFields = ({
3448
3505
  propertyFieldName
3449
3506
  }) => {
@@ -3543,7 +3600,9 @@ const PropertyAdditionalFields = ({
3543
3600
  propertyType,
3544
3601
  propertyFieldName,
3545
3602
  entityDefinition: _entityDefinition = false,
3546
- globalParameter: _globalParameter = false
3603
+ globalParameter: _globalParameter = false,
3604
+ entityReferenceDefinitionSources,
3605
+ entityReferenceValueComponent
3547
3606
  }) => {
3548
3607
  switch (propertyType) {
3549
3608
  case PropertyType.STRING:
@@ -3570,15 +3629,17 @@ const PropertyAdditionalFields = ({
3570
3629
  defaultValue: DATE_TIME_DEFAULT_FORMAT
3571
3630
  });
3572
3631
  case PropertyType.ENTITY_REFERENCE:
3573
- // return <EntityReferencePropertyFields propertyFieldName={propertyFieldName} />;
3574
- return jsx(StringPropertyFields$1, {
3575
- propertyFieldName: propertyFieldName
3632
+ return jsx(EntityReferencePropertyFields$1, {
3633
+ propertyFieldName: propertyFieldName,
3634
+ sources: entityReferenceDefinitionSources
3576
3635
  });
3577
3636
  case PropertyType.ENTITY:
3578
3637
  return jsx(EntityAdditionalFields$1, {
3579
3638
  parentPropertyFieldName: propertyFieldName,
3580
3639
  globalParameter: _globalParameter,
3581
- entityDefinition: _entityDefinition
3640
+ entityDefinition: _entityDefinition,
3641
+ entityReferenceDefinitionSources: entityReferenceDefinitionSources,
3642
+ entityReferenceValueComponent: entityReferenceValueComponent
3582
3643
  });
3583
3644
  default:
3584
3645
  return null;
@@ -3652,7 +3713,8 @@ const PropertyWidget = ({
3652
3713
  label,
3653
3714
  useExpression,
3654
3715
  control,
3655
- baseURL
3716
+ entityReferenceDefinitionSources,
3717
+ entityReferenceValueComponent: EntityReferenceValueComponent
3656
3718
  }) => {
3657
3719
  const propertyType = useMemo(() => typeof property.propertyType === 'string' ? property.propertyType : property['propertyType']['value'], [property]);
3658
3720
  switch (propertyType) {
@@ -3734,10 +3796,17 @@ const PropertyWidget = ({
3734
3796
  restrictedValues: property.restrictedValues
3735
3797
  });
3736
3798
  case PropertyType.ENTITY_REFERENCE:
3737
- return jsx(StringValueField$1, {
3738
- name: name,
3739
- label: label
3740
- });
3799
+ if (EntityReferenceValueComponent) {
3800
+ return jsx(EntityReferenceValueComponent, {
3801
+ name: name,
3802
+ property: property
3803
+ });
3804
+ } else {
3805
+ return jsx(StringValueField$1, {
3806
+ name: name,
3807
+ label: label
3808
+ });
3809
+ }
3741
3810
  case PropertyType.ANY:
3742
3811
  return jsx(ControlAceEditor, {
3743
3812
  control: control,
@@ -3749,7 +3818,9 @@ const PropertyWidget = ({
3749
3818
  return jsx(DefinitionFiller, {
3750
3819
  properties: property.properties,
3751
3820
  dataFieldName: name,
3752
- useExpression: useExpression
3821
+ useExpression: useExpression,
3822
+ entityReferenceDefinitionSources: entityReferenceDefinitionSources,
3823
+ entityReferenceValueComponent: EntityReferenceValueComponent
3753
3824
  });
3754
3825
  default:
3755
3826
  return jsx("div", {
@@ -3857,7 +3928,8 @@ const PropertyFiller = ({
3857
3928
  label,
3858
3929
  required,
3859
3930
  title,
3860
- baseURL
3931
+ entityReferenceDefinitionSources,
3932
+ entityReferenceValueComponent
3861
3933
  }) => {
3862
3934
  const {
3863
3935
  control,
@@ -4030,10 +4102,13 @@ const PropertyFiller = ({
4030
4102
  name: name,
4031
4103
  useExpression: useExpression,
4032
4104
  label: valueLabel,
4033
- baseURL: baseURL
4105
+ entityReferenceDefinitionSources: entityReferenceDefinitionSources,
4106
+ entityReferenceValueComponent: entityReferenceValueComponent
4034
4107
  }), fillOption === 'dem_builder' && jsx(CreateDefinition, {
4035
4108
  title: "JSON",
4036
- definitionFieldName: name
4109
+ definitionFieldName: name,
4110
+ entityReferenceDefinitionSources: entityReferenceDefinitionSources,
4111
+ entityReferenceValueComponent: entityReferenceValueComponent
4037
4112
  }), error && jsx(FormHelperText, Object.assign({
4038
4113
  error: true
4039
4114
  }, {
@@ -4048,7 +4123,8 @@ const MultiplePropertyWidget = ({
4048
4123
  useExpression,
4049
4124
  required,
4050
4125
  label,
4051
- baseURL
4126
+ entityReferenceDefinitionSources,
4127
+ entityReferenceValueComponent
4052
4128
  }) => {
4053
4129
  const {
4054
4130
  control,
@@ -4094,7 +4170,8 @@ const MultiplePropertyWidget = ({
4094
4170
  useExpression: useExpression,
4095
4171
  name: `${name}.${index}`,
4096
4172
  label: `${label || property.name} (${index + 1})`,
4097
- baseURL: baseURL
4173
+ entityReferenceDefinitionSources: entityReferenceDefinitionSources,
4174
+ entityReferenceValueComponent: entityReferenceValueComponent
4098
4175
  }), jsx(Box, Object.assign({
4099
4176
  mt: "8px",
4100
4177
  ml: "4px"
@@ -4135,7 +4212,8 @@ const MultiplePropertyFiller = ({
4135
4212
  required,
4136
4213
  label,
4137
4214
  title,
4138
- baseURL
4215
+ entityReferenceDefinitionSources,
4216
+ entityReferenceValueComponent
4139
4217
  }) => {
4140
4218
  var _a;
4141
4219
  const [selectTouched, setSelectTouched] = useState(false);
@@ -4278,7 +4356,8 @@ const MultiplePropertyFiller = ({
4278
4356
  useExpression: useExpression,
4279
4357
  required: required,
4280
4358
  label: label,
4281
- baseURL: baseURL
4359
+ entityReferenceDefinitionSources: entityReferenceDefinitionSources,
4360
+ entityReferenceValueComponent: entityReferenceValueComponent
4282
4361
  }), error && jsx(FormHelperText, Object.assign({
4283
4362
  error: true
4284
4363
  }, {
@@ -4291,7 +4370,9 @@ const PropertyValueField = ({
4291
4370
  propertyFieldName,
4292
4371
  name,
4293
4372
  label: _label = '',
4294
- required
4373
+ required,
4374
+ entityReferenceDefinitionSources,
4375
+ entityReferenceValueComponent
4295
4376
  }) => {
4296
4377
  const {
4297
4378
  control
@@ -4342,12 +4423,16 @@ const PropertyValueField = ({
4342
4423
  name: name,
4343
4424
  property: fillerProperty,
4344
4425
  title: _label,
4345
- required: required
4426
+ required: required,
4427
+ entityReferenceDefinitionSources: entityReferenceDefinitionSources,
4428
+ entityReferenceValueComponent: entityReferenceValueComponent
4346
4429
  }) : jsx(PropertyFiller, {
4347
4430
  name: name,
4348
4431
  property: fillerProperty,
4349
4432
  title: _label,
4350
- required: required
4433
+ required: required,
4434
+ entityReferenceDefinitionSources: entityReferenceDefinitionSources,
4435
+ entityReferenceValueComponent: entityReferenceValueComponent
4351
4436
  });
4352
4437
  };
4353
4438
 
@@ -4744,7 +4829,9 @@ const CreatePropertyFormFields = ({
4744
4829
  propertyFieldName,
4745
4830
  entityDefinition: _entityDefinition = false,
4746
4831
  globalParameter: _globalParameter = false,
4747
- customPropertyFields: _customPropertyFields = []
4832
+ customPropertyFields: _customPropertyFields = [],
4833
+ entityReferenceDefinitionSources,
4834
+ entityReferenceValueComponent
4748
4835
  }) => {
4749
4836
  var _a;
4750
4837
  const {
@@ -4870,12 +4957,16 @@ const CreatePropertyFormFields = ({
4870
4957
  propertyType: typeof propertyType === 'string' ? propertyType : propertyType.value,
4871
4958
  propertyFieldName: propertyFieldName,
4872
4959
  globalParameter: _globalParameter,
4873
- entityDefinition: _entityDefinition
4960
+ entityDefinition: _entityDefinition,
4961
+ entityReferenceDefinitionSources: entityReferenceDefinitionSources,
4962
+ entityReferenceValueComponent: entityReferenceValueComponent
4874
4963
  }), jsx(PropertyValueField, {
4875
4964
  propertyFieldName: propertyFieldName,
4876
4965
  name: `${propertyFieldName}.${_globalParameter ? 'value' : 'defaultValue'}`,
4877
4966
  label: valueLabel,
4878
- required: _globalParameter ? isRequired : false
4967
+ required: _globalParameter ? isRequired : false,
4968
+ entityReferenceDefinitionSources: entityReferenceDefinitionSources,
4969
+ entityReferenceValueComponent: entityReferenceValueComponent
4879
4970
  })]
4880
4971
  }), customFields.length ? jsx(Fragment, {
4881
4972
  children: customFields.map((field, index) => jsx(Grid, {
@@ -4909,7 +5000,9 @@ const CreatePropertiesList = ({
4909
5000
  globalParameter: _globalParameter = false,
4910
5001
  customPropertyFields: _customPropertyFields = [],
4911
5002
  entityPropFields,
4912
- parentRemove
5003
+ parentRemove,
5004
+ entityReferenceDefinitionSources,
5005
+ entityReferenceValueComponent
4913
5006
  }) => {
4914
5007
  const fieldName = useMemo(() => parentFieldName ? `${parentFieldName}.properties` : `properties`, [parentFieldName]);
4915
5008
  const {
@@ -5003,7 +5096,9 @@ const CreatePropertiesList = ({
5003
5096
  propertyFieldName: `${fieldName}.${index}`,
5004
5097
  entityDefinition: _entityDefinition,
5005
5098
  globalParameter: _globalParameter,
5006
- customPropertyFields: _customPropertyFields
5099
+ customPropertyFields: _customPropertyFields,
5100
+ entityReferenceDefinitionSources: entityReferenceDefinitionSources,
5101
+ entityReferenceValueComponent: entityReferenceValueComponent
5007
5102
  })
5008
5103
  }), jsx(AccordionActions, {
5009
5104
  children: jsx(Button, Object.assign({
@@ -5037,7 +5132,9 @@ const CreateDefinition = ({
5037
5132
  hideCodeField,
5038
5133
  hideVersionField,
5039
5134
  hideNameField,
5040
- required: _required = false
5135
+ required: _required = false,
5136
+ entityReferenceDefinitionSources,
5137
+ entityReferenceValueComponent
5041
5138
  }) => {
5042
5139
  const {
5043
5140
  control
@@ -5088,7 +5185,9 @@ const CreateDefinition = ({
5088
5185
  })
5089
5186
  })), jsx(CreatePropertiesList, {
5090
5187
  required: _required,
5091
- parentFieldName: definitionFieldName
5188
+ parentFieldName: definitionFieldName,
5189
+ entityReferenceDefinitionSources: entityReferenceDefinitionSources,
5190
+ entityReferenceValueComponent: entityReferenceValueComponent
5092
5191
  })]
5093
5192
  }));
5094
5193
  };
@@ -5365,7 +5464,8 @@ const DefinitionFiller = ({
5365
5464
  dataFieldName,
5366
5465
  useExpression: _useExpression = false,
5367
5466
  title,
5368
- baseURL
5467
+ entityReferenceDefinitionSources,
5468
+ entityReferenceValueComponent
5369
5469
  }) => {
5370
5470
  const stepperData = useMemo(() => {
5371
5471
  if (properties) {
@@ -5389,20 +5489,22 @@ const DefinitionFiller = ({
5389
5489
  useExpression: _useExpression,
5390
5490
  label: property.name,
5391
5491
  required: property.isRequired,
5392
- baseURL: baseURL
5492
+ entityReferenceValueComponent: entityReferenceValueComponent,
5493
+ entityReferenceDefinitionSources: entityReferenceDefinitionSources
5393
5494
  }) : jsx(PropertyFiller, {
5394
5495
  property: property,
5395
5496
  name: `${dataFieldName}.${property.key}`,
5396
5497
  useExpression: _useExpression,
5397
5498
  label: property.name,
5398
5499
  required: property.isRequired,
5399
- baseURL: baseURL
5500
+ entityReferenceDefinitionSources: entityReferenceDefinitionSources,
5501
+ entityReferenceValueComponent: entityReferenceValueComponent
5400
5502
  })
5401
5503
  };
5402
5504
  });
5403
5505
  }
5404
5506
  return [];
5405
- }, [properties, dataFieldName, _useExpression, baseURL]);
5507
+ }, [properties, dataFieldName, _useExpression, entityReferenceValueComponent, entityReferenceDefinitionSources]);
5406
5508
  return jsx(LocalizationProvider, Object.assign({
5407
5509
  dateAdapter: AdapterDateFns
5408
5510
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dartech/arsenal-ui",
3
- "version": "1.3.81",
3
+ "version": "1.3.83",
4
4
  "author": "DAR",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -1,4 +1,3 @@
1
1
  export * from './definition';
2
2
  export * from './ui';
3
3
  export * from './common';
4
- export * from './instances';
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { EntityReferenceProperty } from '../../../interfaces';
2
3
  type Props = {
3
4
  definitionFieldName?: string;
4
5
  title?: string;
@@ -6,6 +7,14 @@ type Props = {
6
7
  hideVersionField?: boolean;
7
8
  hideNameField?: boolean;
8
9
  required?: boolean;
10
+ entityReferenceDefinitionSources?: {
11
+ label: string;
12
+ value: string;
13
+ }[];
14
+ entityReferenceValueComponent?: React.ElementType<{
15
+ name: string;
16
+ property: EntityReferenceProperty;
17
+ }>;
9
18
  };
10
- export declare const CreateDefinition: ({ definitionFieldName, title, hideCodeField, hideVersionField, hideNameField, required, }: Props) => JSX.Element;
19
+ export declare const CreateDefinition: ({ definitionFieldName, title, hideCodeField, hideVersionField, hideNameField, required, entityReferenceDefinitionSources, entityReferenceValueComponent, }: Props) => JSX.Element;
11
20
  export default CreateDefinition;
@@ -1,11 +1,18 @@
1
1
  /// <reference types="react" />
2
- import { PropertiesArrayType } from '../../../interfaces';
2
+ import { EntityReferenceProperty, PropertiesArrayType } from '../../../interfaces';
3
3
  type Props = {
4
4
  properties: PropertiesArrayType;
5
5
  dataFieldName: string;
6
6
  useExpression?: boolean;
7
7
  title?: string;
8
- baseURL?: string;
8
+ entityReferenceDefinitionSources?: {
9
+ label: string;
10
+ value: string;
11
+ }[];
12
+ entityReferenceValueComponent?: React.ElementType<{
13
+ name: string;
14
+ property: EntityReferenceProperty;
15
+ }>;
9
16
  };
10
- export declare const DefinitionFiller: ({ properties, dataFieldName, useExpression, title, baseURL, }: Props) => JSX.Element;
17
+ export declare const DefinitionFiller: ({ properties, dataFieldName, useExpression, title, entityReferenceDefinitionSources, entityReferenceValueComponent, }: Props) => JSX.Element;
11
18
  export default DefinitionFiller;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { PropertyUnion } from '../../../interfaces';
2
+ import { EntityReferenceProperty, PropertyUnion } from '../../../interfaces';
3
3
  type Props = {
4
4
  property: PropertyUnion;
5
5
  name: string;
@@ -7,7 +7,14 @@ type Props = {
7
7
  required?: boolean;
8
8
  label?: string;
9
9
  title?: string;
10
- baseURL?: string;
10
+ entityReferenceDefinitionSources?: {
11
+ label: string;
12
+ value: string;
13
+ }[];
14
+ entityReferenceValueComponent?: React.ElementType<{
15
+ name: string;
16
+ property: EntityReferenceProperty;
17
+ }>;
11
18
  };
12
- export declare const MultiplePropertyFiller: ({ property, name, useExpression, required, label, title, baseURL, }: Props) => JSX.Element;
19
+ export declare const MultiplePropertyFiller: ({ property, name, useExpression, required, label, title, entityReferenceDefinitionSources, entityReferenceValueComponent, }: Props) => JSX.Element;
13
20
  export default MultiplePropertyFiller;
@@ -1,12 +1,19 @@
1
1
  /// <reference types="react" />
2
- import { PropertyUnion } from '../../../interfaces';
2
+ import { EntityReferenceProperty, PropertyUnion } from '../../../interfaces';
3
3
  type Props = {
4
4
  name: string;
5
5
  property: PropertyUnion;
6
6
  useExpression?: boolean;
7
7
  required?: boolean;
8
8
  label?: string;
9
- baseURL?: string;
9
+ entityReferenceDefinitionSources?: {
10
+ label: string;
11
+ value: string;
12
+ }[];
13
+ entityReferenceValueComponent?: React.ElementType<{
14
+ name: string;
15
+ property: EntityReferenceProperty;
16
+ }>;
10
17
  };
11
- export declare const MultiplePropertyWidget: ({ name, property, useExpression, required, label, baseURL, }: Props) => JSX.Element;
18
+ export declare const MultiplePropertyWidget: ({ name, property, useExpression, required, label, entityReferenceDefinitionSources, entityReferenceValueComponent, }: Props) => JSX.Element;
12
19
  export default MultiplePropertyWidget;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { PropertyUnion } from '../../../interfaces';
2
+ import { EntityReferenceProperty, PropertyUnion } from '../../../interfaces';
3
3
  export type PropertyFillerProps = {
4
4
  property: PropertyUnion;
5
5
  name: string;
@@ -7,7 +7,14 @@ export type PropertyFillerProps = {
7
7
  label?: string;
8
8
  required?: boolean;
9
9
  title?: string;
10
- baseURL?: string;
10
+ entityReferenceDefinitionSources?: {
11
+ label: string;
12
+ value: string;
13
+ }[];
14
+ entityReferenceValueComponent?: React.ElementType<{
15
+ name: string;
16
+ property: EntityReferenceProperty;
17
+ }>;
11
18
  };
12
- export declare const PropertyFiller: ({ property, name, useExpression, label, required, title, baseURL, }: PropertyFillerProps) => JSX.Element;
19
+ export declare const PropertyFiller: ({ property, name, useExpression, label, required, title, entityReferenceDefinitionSources, entityReferenceValueComponent, }: PropertyFillerProps) => JSX.Element;
13
20
  export default PropertyFiller;
@@ -1,13 +1,20 @@
1
1
  /// <reference types="react" />
2
2
  import { Control } from 'react-hook-form';
3
- import { PropertyUnion } from '../../../interfaces';
3
+ import { EntityReferenceProperty, PropertyUnion } from '../../../interfaces';
4
4
  type Props = {
5
5
  property: PropertyUnion;
6
6
  name: string;
7
7
  label?: string;
8
8
  useExpression?: boolean;
9
9
  control: Control<any>;
10
- baseURL?: string;
10
+ entityReferenceDefinitionSources?: {
11
+ label: string;
12
+ value: string;
13
+ }[];
14
+ entityReferenceValueComponent?: React.ElementType<{
15
+ name: string;
16
+ property: EntityReferenceProperty;
17
+ }>;
11
18
  };
12
- export declare const PropertyWidget: ({ property, name, label, useExpression, control, baseURL, }: Props) => JSX.Element;
19
+ export declare const PropertyWidget: ({ property, name, label, useExpression, control, entityReferenceDefinitionSources, entityReferenceValueComponent: EntityReferenceValueComponent, }: Props) => JSX.Element;
13
20
  export default PropertyWidget;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { CustomPropertyFieldProps } from '../../../interfaces';
2
+ import { CustomPropertyFieldProps, EntityReferenceProperty } from '../../../interfaces';
3
3
  type Props = {
4
4
  parentFieldName?: string;
5
5
  hideAddButton?: boolean;
@@ -12,6 +12,14 @@ type Props = {
12
12
  id: string;
13
13
  }>;
14
14
  parentRemove?: (index?: number | number[]) => void;
15
+ entityReferenceDefinitionSources?: {
16
+ label: string;
17
+ value: string;
18
+ }[];
19
+ entityReferenceValueComponent?: React.ElementType<{
20
+ name: string;
21
+ property: EntityReferenceProperty;
22
+ }>;
15
23
  };
16
- export declare const CreatePropertiesList: ({ parentFieldName, hideAddButton, focusOnIndex, required, entityDefinition, globalParameter, customPropertyFields, entityPropFields, parentRemove, }: Props) => JSX.Element;
24
+ export declare const CreatePropertiesList: ({ parentFieldName, hideAddButton, focusOnIndex, required, entityDefinition, globalParameter, customPropertyFields, entityPropFields, parentRemove, entityReferenceDefinitionSources, entityReferenceValueComponent, }: Props) => JSX.Element;
17
25
  export default CreatePropertiesList;
@@ -1,10 +1,18 @@
1
1
  /// <reference types="react" />
2
- import { CustomPropertyFieldProps } from '../../../interfaces';
2
+ import { CustomPropertyFieldProps, EntityReferenceProperty } from '../../../interfaces';
3
3
  type Props = {
4
4
  propertyFieldName: string;
5
5
  entityDefinition?: boolean;
6
6
  globalParameter?: boolean;
7
7
  customPropertyFields?: CustomPropertyFieldProps[];
8
+ entityReferenceDefinitionSources?: {
9
+ label: string;
10
+ value: string;
11
+ }[];
12
+ entityReferenceValueComponent?: React.ElementType<{
13
+ name: string;
14
+ property: EntityReferenceProperty;
15
+ }>;
8
16
  };
9
- export declare const CreatePropertyFormFields: ({ propertyFieldName, entityDefinition, globalParameter, customPropertyFields, }: Props) => JSX.Element;
17
+ export declare const CreatePropertyFormFields: ({ propertyFieldName, entityDefinition, globalParameter, customPropertyFields, entityReferenceDefinitionSources, entityReferenceValueComponent, }: Props) => JSX.Element;
10
18
  export default CreatePropertyFormFields;
@@ -1,8 +1,17 @@
1
1
  /// <reference types="react" />
2
+ import { EntityReferenceProperty } from '../../../../interfaces';
2
3
  type Props = {
3
4
  parentPropertyFieldName: string;
4
5
  entityDefinition?: boolean;
5
6
  globalParameter?: boolean;
7
+ entityReferenceDefinitionSources?: {
8
+ label: string;
9
+ value: string;
10
+ }[];
11
+ entityReferenceValueComponent?: React.ElementType<{
12
+ name: string;
13
+ property: EntityReferenceProperty;
14
+ }>;
6
15
  };
7
- declare const EntityAdditionalFields: ({ parentPropertyFieldName, entityDefinition, globalParameter, }: Props) => JSX.Element;
16
+ declare const EntityAdditionalFields: ({ parentPropertyFieldName, entityDefinition, globalParameter, entityReferenceDefinitionSources, entityReferenceValueComponent, }: Props) => JSX.Element;
8
17
  export default EntityAdditionalFields;
@@ -1,6 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  type Props = {
3
3
  propertyFieldName: string;
4
+ sources?: {
5
+ label: string;
6
+ value: string;
7
+ }[];
4
8
  };
5
- declare const EntityReferencePropertyFields: ({ propertyFieldName }: Props) => JSX.Element;
9
+ declare const EntityReferencePropertyFields: ({ propertyFieldName, sources, }: Props) => JSX.Element;
6
10
  export default EntityReferencePropertyFields;
@@ -1,10 +1,18 @@
1
1
  /// <reference types="react" />
2
- import { PropertyType } from '../../../../interfaces';
2
+ import { PropertyType, EntityReferenceProperty } from '../../../../interfaces';
3
3
  type Props = {
4
4
  propertyType: PropertyType;
5
5
  propertyFieldName: string;
6
6
  entityDefinition?: boolean;
7
7
  globalParameter?: boolean;
8
+ entityReferenceDefinitionSources?: {
9
+ label: string;
10
+ value: string;
11
+ }[];
12
+ entityReferenceValueComponent?: React.ElementType<{
13
+ name: string;
14
+ property: EntityReferenceProperty;
15
+ }>;
8
16
  };
9
- export declare const PropertyAdditionalFields: ({ propertyType, propertyFieldName, entityDefinition, globalParameter, }: Props) => JSX.Element;
17
+ export declare const PropertyAdditionalFields: ({ propertyType, propertyFieldName, entityDefinition, globalParameter, entityReferenceDefinitionSources, entityReferenceValueComponent, }: Props) => JSX.Element;
10
18
  export default PropertyAdditionalFields;
@@ -1,9 +1,18 @@
1
1
  /// <reference types="react" />
2
+ import { EntityReferenceProperty } from '../../../../interfaces';
2
3
  type Props = {
3
4
  propertyFieldName: string;
4
5
  name: string;
5
6
  label?: string;
6
7
  required?: boolean;
8
+ entityReferenceDefinitionSources?: {
9
+ label: string;
10
+ value: string;
11
+ }[];
12
+ entityReferenceValueComponent?: React.ElementType<{
13
+ name: string;
14
+ property: EntityReferenceProperty;
15
+ }>;
7
16
  };
8
- export declare const PropertyValueField: ({ propertyFieldName, name, label, required }: Props) => JSX.Element;
17
+ export declare const PropertyValueField: ({ propertyFieldName, name, label, required, entityReferenceDefinitionSources, entityReferenceValueComponent, }: Props) => JSX.Element;
9
18
  export default PropertyValueField;
@@ -1,71 +0,0 @@
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
- }
@@ -1,10 +0,0 @@
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;
@@ -1,23 +0,0 @@
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 {};