@teamturing/react-kit 2.32.9 → 2.33.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.
@@ -1,10 +1,12 @@
1
- /// <reference types="react" />
1
+ import { ReactNode } from 'react';
2
2
  import { TextareaAutosizeProps } from 'react-textarea-autosize';
3
3
  type Props = {
4
4
  validationStatus?: 'error' | 'success' | undefined;
5
+ renderCount?: (count: number, element: HTMLTextAreaElement | null) => ReactNode;
5
6
  } & TextareaAutosizeProps;
6
7
  declare const Textarea: import("react").ForwardRefExoticComponent<{
7
8
  validationStatus?: 'error' | 'success' | undefined;
9
+ renderCount?: ((count: number, element: HTMLTextAreaElement | null) => ReactNode) | undefined;
8
10
  } & TextareaAutosizeProps & import("react").RefAttributes<HTMLTextAreaElement>>;
9
11
  export default Textarea;
10
12
  export type { Props as TextareaProps };
package/dist/index.js CHANGED
@@ -36640,6 +36640,7 @@ var toArray$1 = /*@__PURE__*/getDefaultExportFromCjs(lodash_toarray);
36640
36640
  const Textarea = /*#__PURE__*/React.forwardRef(({
36641
36641
  validationStatus,
36642
36642
  disabled,
36643
+ renderCount = count => `${commaizeNumber(count)}자`,
36643
36644
  ...props
36644
36645
  }, ref) => {
36645
36646
  const inputRef = useProvidedOrCreatedRef(ref);
@@ -36672,8 +36673,8 @@ const Textarea = /*#__PURE__*/React.forwardRef(({
36672
36673
  },
36673
36674
  disabled: disabled,
36674
36675
  onChange: handleChange
36675
- }), /*#__PURE__*/jsxRuntimeExports.jsxs(TextareaCount, {
36676
- children: [commaizeNumber(count), "\uC790"]
36676
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(TextareaCount, {
36677
+ children: renderCount(count, inputRef.current)
36677
36678
  })]
36678
36679
  });
36679
36680
  });
@@ -11,6 +11,7 @@ import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js'
11
11
  const Textarea = /*#__PURE__*/forwardRef(({
12
12
  validationStatus,
13
13
  disabled,
14
+ renderCount = count => `${commaizeNumber(count)}자`,
14
15
  ...props
15
16
  }, ref) => {
16
17
  const inputRef = useProvidedOrCreatedRef(ref);
@@ -43,8 +44,8 @@ const Textarea = /*#__PURE__*/forwardRef(({
43
44
  },
44
45
  disabled: disabled,
45
46
  onChange: handleChange
46
- }), /*#__PURE__*/jsxRuntimeExports.jsxs(TextareaCount, {
47
- children: [commaizeNumber(count), "\uC790"]
47
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(TextareaCount, {
48
+ children: renderCount(count, inputRef.current)
48
49
  })]
49
50
  });
50
51
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamturing/react-kit",
3
- "version": "2.32.9",
3
+ "version": "2.33.0",
4
4
  "description": "React components, hooks for create teamturing web application",
5
5
  "author": "Sungchang Park <psch300@gmail.com> (https://github.com/psch300)",
6
6
  "homepage": "https://github.com/weareteamturing/bombe#readme",
@@ -66,5 +66,5 @@
66
66
  "react-textarea-autosize": "^8.5.3",
67
67
  "styled-system": "^5.1.5"
68
68
  },
69
- "gitHead": "d5e827ad3c107cd1e10693c0b5887da2ea4cba18"
69
+ "gitHead": "249a90d29a2e6dcd0cff9076059492615777a08a"
70
70
  }