@dartech/arsenal-ui 1.3.90 → 1.3.92

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
@@ -3814,7 +3814,10 @@ const PropertyWidget = ({
3814
3814
  entityReferenceValueComponent: EntityReferenceValueComponent,
3815
3815
  fileReferenceValueComponent: FileReferenceValueComponent
3816
3816
  }) => {
3817
- const propertyType = useMemo(() => typeof property.propertyType === 'string' ? property.propertyType : property['propertyType']['value'], [property]);
3817
+ const propertyType = useMemo(() => {
3818
+ var _a;
3819
+ return typeof property.propertyType === 'string' ? property.propertyType : (_a = property['propertyType']) === null || _a === void 0 ? void 0 : _a['value'];
3820
+ }, [property]);
3818
3821
  switch (propertyType) {
3819
3822
  case PropertyType.BIG_DECIMAL:
3820
3823
  case PropertyType.FLOAT:
@@ -3886,7 +3889,6 @@ const PropertyWidget = ({
3886
3889
  hideErrorMessage: true,
3887
3890
  validateJson: true
3888
3891
  });
3889
- // return <JsonEditor validate name={name} ref={ref} useParsedValue />;
3890
3892
  case PropertyType.STRING:
3891
3893
  return jsx(StringValueField$1, {
3892
3894
  name: name,
@@ -4055,7 +4057,6 @@ const PropertyFiller = ({
4055
4057
  watch
4056
4058
  } = useFormContext();
4057
4059
  const {
4058
- // field: { value },
4059
4060
  fieldState: {
4060
4061
  error,
4061
4062
  isDirty
@@ -4499,32 +4500,14 @@ const PropertyValueField = ({
4499
4500
  fileReferenceValueComponent
4500
4501
  }) => {
4501
4502
  const {
4502
- control
4503
+ watch
4503
4504
  } = useFormContext();
4504
- const propertyType = useWatch({
4505
- control,
4506
- name: `${propertyFieldName}.propertyType`
4507
- });
4508
- const isMultiple = useWatch({
4509
- control,
4510
- name: `${propertyFieldName}.isMultiple`
4511
- });
4512
- const format = useWatch({
4513
- control,
4514
- name: `${propertyFieldName}.format`
4515
- });
4516
- const restrictedValues = useWatch({
4517
- control,
4518
- name: `${propertyFieldName}.restrictedValues`
4519
- });
4520
- const properties = useWatch({
4521
- control,
4522
- name: `${propertyFieldName}.properties`
4523
- });
4524
- const isRequired = useWatch({
4525
- control,
4526
- name: `${propertyFieldName}.isRequired`
4527
- });
4505
+ const propertyType = watch(`${propertyFieldName}.propertyType`);
4506
+ const isMultiple = watch(`${propertyFieldName}.isMultiple`);
4507
+ const format = watch(`${propertyFieldName}.format`);
4508
+ const restrictedValues = watch(`${propertyFieldName}.restrictedValues`);
4509
+ const properties = watch(`${propertyFieldName}.properties`);
4510
+ const isRequired = watch(`${propertyFieldName}.isRequired`);
4528
4511
  const fillerProperty = useMemo(() => {
4529
4512
  const typeValue = typeof propertyType === 'string' ? propertyType : propertyType.value;
4530
4513
  return {
@@ -4543,6 +4526,7 @@ const PropertyValueField = ({
4543
4526
  validationNode: null
4544
4527
  };
4545
4528
  }, [propertyType, format, restrictedValues, isMultiple, _label, isRequired, properties, required]);
4529
+ console.log('isMultiple', isMultiple);
4546
4530
  return isMultiple ? jsx(MultiplePropertyFiller, {
4547
4531
  name: name,
4548
4532
  property: fillerProperty,
@@ -4963,20 +4947,12 @@ const CreatePropertyFormFields = ({
4963
4947
  var _a;
4964
4948
  const {
4965
4949
  control,
4966
- setValue
4950
+ setValue,
4951
+ watch
4967
4952
  } = useFormContext();
4968
- const propertyType = useWatch({
4969
- control,
4970
- name: `${propertyFieldName}.propertyType`
4971
- });
4972
- const isMultiple = useWatch({
4973
- control,
4974
- name: `${propertyFieldName}.isMultiple`
4975
- });
4976
- const isRequired = useWatch({
4977
- control,
4978
- name: `${propertyFieldName}.isRequired`
4979
- });
4953
+ const propertyType = watch(`${propertyFieldName}.propertyType`);
4954
+ const isMultiple = watch(`${propertyFieldName}.isMultiple`);
4955
+ const isRequired = watch(`${propertyFieldName}.isRequired`);
4980
4956
  const {
4981
4957
  customCheckboxes,
4982
4958
  customFields
@@ -5091,6 +5067,7 @@ const CreatePropertyFormFields = ({
5091
5067
  }), jsx(PropertyValueField, {
5092
5068
  propertyFieldName: propertyFieldName,
5093
5069
  name: `${propertyFieldName}.${_globalParameter ? 'value' : 'defaultValue'}`,
5070
+ // name=
5094
5071
  label: valueLabel,
5095
5072
  required: _globalParameter ? isRequired : false,
5096
5073
  entityReferenceDefinitionSources: entityReferenceDefinitionSources,
@@ -5134,6 +5111,7 @@ const CreatePropertiesList = ({
5134
5111
  entityReferenceValueComponent,
5135
5112
  fileReferenceValueComponent
5136
5113
  }) => {
5114
+ var _a;
5137
5115
  const fieldName = useMemo(() => parentFieldName ? `${parentFieldName}.properties` : `properties`, [parentFieldName]);
5138
5116
  const {
5139
5117
  clearErrors,
@@ -5258,7 +5236,7 @@ const CreatePropertiesList = ({
5258
5236
  })), error && jsx(FormHelperText, Object.assign({
5259
5237
  error: true
5260
5238
  }, {
5261
- children: error.root.message
5239
+ children: (_a = error.root) === null || _a === void 0 ? void 0 : _a.message
5262
5240
  }))]
5263
5241
  }))]
5264
5242
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dartech/arsenal-ui",
3
- "version": "1.3.90",
3
+ "version": "1.3.92",
4
4
  "author": "DAR",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  type Props = {
2
3
  name: string;
3
4
  label?: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  type Props = {
2
3
  name: string;
3
4
  label?: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  type Props = {
2
3
  name: string;
3
4
  format: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  type Props = {
2
3
  name: string;
3
4
  label?: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  type Props = {
2
3
  name: string;
3
4
  label?: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { PropertyUnion } from '../../../interfaces';
2
3
  type PropertyItemProps = {
3
4
  property: PropertyUnion;