@dartech/arsenal-ui 1.4.12 → 1.4.13

Sign up to get free protection for your applications and to get access to all the features.
package/index.js CHANGED
@@ -5963,19 +5963,21 @@ const PropertyFiller = ({
5963
5963
  }
5964
5964
  }
5965
5965
  clearErrors();
5966
- }, [name, defaultProperyValue, clearErrors, value, setFillOption, fillOption, propertyType, setValue, property]);
5966
+ }, [name, clearErrors, value, setFillOption, fillOption, propertyType, property]);
5967
5967
  useEffect(() => {
5968
5968
  var _a;
5969
5969
  if (!isDirty && isPropertyValueEmpty(value)) {
5970
5970
  if (property.isRequired && (property.defaultValue === null || property.value === null)) {
5971
- setValue(name, (_a = prevValueRef.current[fillOption]) !== null && _a !== void 0 ? _a : defaultProperyValue);
5971
+ setValue(name, (_a = prevValueRef.current[fillOption]) !== null && _a !== void 0 ? _a : defaultProperyValue, {
5972
+ shouldDirty: true
5973
+ });
5972
5974
  } else if (!property.isRequired && (property.defaultValue === null || property.value === null)) {
5973
5975
  setValue(name, null);
5974
5976
  } else if (!(isPropertyValueEmpty(property.defaultValue) || isPropertyValueEmpty(property.value))) {
5975
5977
  setValue(name, property.defaultValue || property.value);
5976
5978
  }
5977
5979
  }
5978
- }, [value, setValue, defaultProperyValue, property, name, fillOption, isDirty]);
5980
+ }, [value, property, name, fillOption, isDirty]);
5979
5981
  useEffect(() => {
5980
5982
  if (!isPropertyValueEmpty(value) && property.propertyType !== PropertyType.JSON) {
5981
5983
  setValue(name, value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dartech/arsenal-ui",
3
- "version": "1.4.12",
3
+ "version": "1.4.13",
4
4
  "author": "DAR",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -20,5 +20,5 @@ export type PropertyFillerProps = {
20
20
  name: string;
21
21
  }>;
22
22
  };
23
- export declare const PropertyFiller: ({ property, name, useExpression, label, required, title, entityReferenceDefinitionSources, entityReferenceValueComponent, fileReferenceValueComponent, requiredErrorText }: PropertyFillerProps) => JSX.Element;
23
+ export declare const PropertyFiller: ({ property, name, useExpression, label, required, title, entityReferenceDefinitionSources, entityReferenceValueComponent, fileReferenceValueComponent, requiredErrorText, }: PropertyFillerProps) => JSX.Element;
24
24
  export default PropertyFiller;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Control } from 'react-hook-form';
3
2
  type Props = {
4
3
  control: Control<any>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  type Props = {
3
2
  name: string;
4
3
  label?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  type Props = {
3
2
  name: string;
4
3
  format: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  type Props = {
3
2
  name: string;
4
3
  label?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  type Props = {
3
2
  name: string;
4
3
  label?: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PropertyUnion } from '../../../interfaces';
3
2
  type PropertyItemProps = {
4
3
  property: PropertyUnion;