@ceed/cds 1.11.1 → 1.12.0

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.
@@ -29,5 +29,10 @@ declare const Uploader: React.MemoExoticComponent<(props: {
29
29
  */
30
30
  maxFileTotalSize: number;
31
31
  uploaded?: UserUpload[] | undefined;
32
+ /**
33
+ * 모든 안내 메세지/에러 메세지보다 해당 메세지가 우선적으로 보여진다.
34
+ * 기본 안내 메세지 및 에러 메세지를 사용하려면 해당 필드를 비워야 한다.
35
+ */
36
+ helperText?: string | undefined;
32
37
  }) => React.JSX.Element>;
33
38
  export { Uploader };
package/dist/index.cjs CHANGED
@@ -5916,7 +5916,9 @@ var Uploader = import_react48.default.memo(
5916
5916
  onChange,
5917
5917
  label,
5918
5918
  disabled,
5919
- onDelete
5919
+ onDelete,
5920
+ error: errorProp,
5921
+ helperText: helperTextProp
5920
5922
  } = props;
5921
5923
  const dropZoneRef = (0, import_react48.useRef)(null);
5922
5924
  const inputRef = (0, import_react48.useRef)(null);
@@ -5935,6 +5937,9 @@ var Uploader = import_react48.default.memo(
5935
5937
  [accepts]
5936
5938
  );
5937
5939
  const helperText = (0, import_react48.useMemo)(() => {
5940
+ if (helperTextProp) {
5941
+ return helperTextProp;
5942
+ }
5938
5943
  const [allAcceptedTypes, acceptedTypes] = [
5939
5944
  accepts.filter((accept2) => ["image/*", "video/*", "audio/*"].includes(accept2)).map((accept2) => {
5940
5945
  const [type] = accept2.split("/");
@@ -5960,8 +5965,8 @@ var Uploader = import_react48.default.memo(
5960
5965
  helperTexts.push(`Up to ${maxCount} ${maxCount === 1 ? "file" : "files"}`);
5961
5966
  }
5962
5967
  return helperTexts.join(", ");
5963
- }, [accepts, maxFileTotalSize, maxCount]);
5964
- const error = (0, import_react48.useMemo)(() => !!errorText || props.error, [props.error, errorText]);
5968
+ }, [accepts, maxFileTotalSize, maxCount, helperTextProp]);
5969
+ const error = (0, import_react48.useMemo)(() => !!errorText || errorProp, [errorProp, errorText]);
5965
5970
  const showDropZone = (0, import_react48.useMemo)(
5966
5971
  () => !maxCount || maxCount && [...uploaded, ...files].length !== maxCount,
5967
5972
  [files, maxCount, uploaded]
package/dist/index.js CHANGED
@@ -5894,7 +5894,9 @@ var Uploader = React45.memo(
5894
5894
  onChange,
5895
5895
  label,
5896
5896
  disabled,
5897
- onDelete
5897
+ onDelete,
5898
+ error: errorProp,
5899
+ helperText: helperTextProp
5898
5900
  } = props;
5899
5901
  const dropZoneRef = useRef10(null);
5900
5902
  const inputRef = useRef10(null);
@@ -5913,6 +5915,9 @@ var Uploader = React45.memo(
5913
5915
  [accepts]
5914
5916
  );
5915
5917
  const helperText = useMemo14(() => {
5918
+ if (helperTextProp) {
5919
+ return helperTextProp;
5920
+ }
5916
5921
  const [allAcceptedTypes, acceptedTypes] = [
5917
5922
  accepts.filter((accept2) => ["image/*", "video/*", "audio/*"].includes(accept2)).map((accept2) => {
5918
5923
  const [type] = accept2.split("/");
@@ -5938,8 +5943,8 @@ var Uploader = React45.memo(
5938
5943
  helperTexts.push(`Up to ${maxCount} ${maxCount === 1 ? "file" : "files"}`);
5939
5944
  }
5940
5945
  return helperTexts.join(", ");
5941
- }, [accepts, maxFileTotalSize, maxCount]);
5942
- const error = useMemo14(() => !!errorText || props.error, [props.error, errorText]);
5946
+ }, [accepts, maxFileTotalSize, maxCount, helperTextProp]);
5947
+ const error = useMemo14(() => !!errorText || errorProp, [errorProp, errorText]);
5943
5948
  const showDropZone = useMemo14(
5944
5949
  () => !maxCount || maxCount && [...uploaded, ...files].length !== maxCount,
5945
5950
  [files, maxCount, uploaded]