@dartech/arsenal-ui 1.3.86 → 1.3.88

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.
Files changed (2) hide show
  1. package/index.js +48 -22
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -750,7 +750,7 @@ const ControlAutocomplete = _a => {
750
750
  useEffect(() => {
751
751
  if (typeof value === 'string' && valueKey && useStringValue && !localValue && options.length && !!options[0] && typeof options[0] === 'object') {
752
752
  setLocalValue(options.find(el => el[valueKey] === value));
753
- }
753
+ } else setLocalValue(value);
754
754
  }, [localValue, options, useStringValue, value, valueKey]);
755
755
  return jsx(Autocomplete, Object.assign({}, fieldProps, {
756
756
  value: useStringValue ? localValue !== null && localValue !== void 0 ? localValue : null : value,
@@ -3756,25 +3756,51 @@ const FileValueWidget = ({
3756
3756
  const base64 = yield convertBase64(file);
3757
3757
  setValue(name, base64);
3758
3758
  }), [name, setValue]);
3759
- return jsxs(Button, Object.assign({
3760
- component: "label",
3761
- variant: "contained",
3762
- size: "large",
3763
- color: "primary",
3764
- sx: {
3765
- marginTop: 4
3766
- }
3767
- }, {
3768
- children: [fileValue ? 'Change file' : 'Upload file', jsx("input", Object.assign({
3769
- type: "hidden"
3770
- }, register(`${name}`, {
3771
- required: true
3772
- }))), jsx("input", {
3773
- type: "file",
3774
- hidden: true,
3775
- onChange: handleFileRead
3776
- })]
3777
- }));
3759
+ return jsxs(Fragment, {
3760
+ children: [jsxs(Box, Object.assign({
3761
+ mb: 2,
3762
+ display: "flex",
3763
+ flex: "row"
3764
+ }, {
3765
+ children: [jsx(Typography, {
3766
+ children: "Does file uploaded:"
3767
+ }), fileValue ? jsx(SvgIcon, Object.assign({
3768
+ sx: {
3769
+ paddingLeft: 2
3770
+ }
3771
+ }, {
3772
+ children: jsx("path", {
3773
+ d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
3774
+ })
3775
+ })) : jsx(SvgIcon, Object.assign({
3776
+ sx: {
3777
+ paddingLeft: 2
3778
+ }
3779
+ }, {
3780
+ children: jsx("path", {
3781
+ d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"
3782
+ })
3783
+ }))]
3784
+ })), jsxs(Button, Object.assign({
3785
+ component: "label",
3786
+ variant: "contained",
3787
+ size: "large",
3788
+ color: "primary",
3789
+ sx: {
3790
+ marginTop: 4
3791
+ }
3792
+ }, {
3793
+ children: [fileValue ? 'Change file' : 'Upload file', jsx("input", Object.assign({
3794
+ type: "hidden"
3795
+ }, register(`${name}`, {
3796
+ required: true
3797
+ }))), jsx("input", {
3798
+ type: "file",
3799
+ hidden: true,
3800
+ onChange: handleFileRead
3801
+ })]
3802
+ }))]
3803
+ });
3778
3804
  };
3779
3805
  var FileValueWidget$1 = FileValueWidget;
3780
3806
 
@@ -5702,7 +5728,7 @@ const PropertyValueComponent = ({
5702
5728
  value: data
5703
5729
  }) : defaultRender(data);
5704
5730
  case PropertyType.FILE_REFERENCE:
5705
- return jsx(Button, Object.assign({
5731
+ return data === null ? defaultRender(data) : jsx(Button, Object.assign({
5706
5732
  component: Link,
5707
5733
  color: "primary",
5708
5734
  variant: "contained",
@@ -5715,7 +5741,7 @@ const PropertyValueComponent = ({
5715
5741
  children: "Download via link"
5716
5742
  }));
5717
5743
  case PropertyType.FILE:
5718
- return jsx(FileDefinitionValueView$1, {
5744
+ return data === null ? defaultRender(data) : jsx(FileDefinitionValueView$1, {
5719
5745
  data: data,
5720
5746
  property: property
5721
5747
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dartech/arsenal-ui",
3
- "version": "1.3.86",
3
+ "version": "1.3.88",
4
4
  "author": "DAR",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"