@croquiscom/pds 8.10.4 → 8.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @croquiscom/pds
2
2
 
3
+ ## 8.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 09ba973: Timepicker 텍스트 기입 활성화
8
+
9
+ ## 8.11.0
10
+
11
+ ### Minor Changes
12
+
13
+ - b8e985e: Textarea autoSize 추가
14
+
3
15
  ## 8.10.4
4
16
 
5
17
  ### Patch Changes
@@ -1,6 +1,10 @@
1
1
  import React, { TextareaHTMLAttributes } from 'react';
2
2
  import { AriaFocusProps } from '../../types/common';
3
3
  import { SizeProps } from '../../styles';
4
+ export interface AutoSizeType {
5
+ minRows?: number;
6
+ maxRows?: number;
7
+ }
4
8
  export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement>, SizeProps, AriaFocusProps {
5
9
  error?: boolean;
6
10
  /**
@@ -8,5 +12,14 @@ export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElemen
8
12
  * @default false
9
13
  */
10
14
  showCounter?: boolean;
15
+ /**
16
+ * 입혁하는 텍스트에 따라 자동으로 크기를 조절하며 최소/최대 라인수를 설정할 수 있습니다.
17
+ * - height 또는 textarea 기본 rows 속성이 있을 경우 적용되지 않습니다.
18
+ * - autoSize를 사용할 경우 기본 resize는 none처리됩니다.
19
+ * - minRows(최소 행 수)의 기본값은 2입니다.
20
+ * - maxRows(최대 행 수)를 넘어갈 경우 자동 내부 스크롤 처리됩니다.
21
+ * @default false
22
+ */
23
+ autoSize?: boolean | AutoSizeType;
11
24
  }
12
25
  export declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
@@ -3,6 +3,10 @@ import { ComponentMeta } from '@storybook/react';
3
3
  declare const _default: ComponentMeta<React.ForwardRefExoticComponent<import("./Textarea").TextareaProps & React.RefAttributes<HTMLTextAreaElement>>>;
4
4
  export default _default;
5
5
  export declare const Base: any;
6
+ export declare const AutoSize: any;
7
+ export declare const AutoSizeWithMinRows: any;
8
+ export declare const AutoSizeWithMaxRows: any;
9
+ export declare const AutoSizeWithMinMaxRows: any;
6
10
  export declare const Error: any;
7
11
  export declare const WithFormHelperText: () => JSX.Element;
8
12
  export declare const Disabled: any;
@@ -0,0 +1,18 @@
1
+ type TextareaSizingData = {
2
+ paddingSize: number;
3
+ borderSize: number;
4
+ sizingStyles: string;
5
+ };
6
+ export declare function getTextareaComputedStyle(textarea: HTMLTextAreaElement): TextareaSizingData;
7
+ /**
8
+ * @desc Textarea autoSize 동적 Height 계산
9
+ * - 입력 콘텐츠의 폰트/크기/행 간격등 요소에 따른 높이 계산시 브라우저마다의 일관된 값을 처리하도록 가상의 숨겨진 hiddenTextarea를 재사용합니다.
10
+ * - hiddenTextarea를 통해 해당 요소의 스타일을 적용하여 텍스트의 크기를 계산하고 실제로 보이는 textarea의 높이를 조절합니다.
11
+ */
12
+ export declare function getTextareaAutoSizeStyles(sizingData: TextareaSizingData, value: string, minRows?: number, maxRows?: number): {
13
+ maxHeight: number;
14
+ minHeight: number;
15
+ resize: string;
16
+ height: number;
17
+ };
18
+ export {};