@croquiscom/pds 10.12.0 → 10.13.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,11 @@
1
1
  # @croquiscom/pds
2
2
 
3
+ ## 10.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5bc22a6: DropdownFilter kind 추가
8
+
3
9
  ## 10.12.0
4
10
 
5
11
  ### Minor Changes
@@ -3,6 +3,7 @@ import { InputSize } from '../input/types';
3
3
  import { DropdownProps } from './Dropdown';
4
4
  import { IconProps } from '../icons/generated';
5
5
  import { AriaFocusProps } from '../../types/common';
6
+ import { Kind } from './DropdownFilterOptions';
6
7
  export interface DropdownFilterOption<OptionValue> {
7
8
  /**
8
9
  * 필터 검색 영역에 텍스트 형태로 노출되고, 자동 완성을 위해 사용되는 문자열 값입니다.
@@ -52,15 +53,21 @@ export interface DropdownFilterProps<OptionValue> extends Omit<DropdownProps<Opt
52
53
  * @default false
53
54
  */
54
55
  showFilter?: boolean;
56
+ /**
57
+ * 옵션 라벨앞 셀렉션 요소 타입
58
+ * - radio의 경우 selectionGroup내에서 단일 선택, selectionGroup이 없다면 전체 옵션중 단일 선택만 가능합니다.
59
+ * @default 'checkbox'
60
+ */
61
+ kind?: Kind;
55
62
  /**
56
63
  * showFilter true일 경우 필터 검색 방식을 커스텀할 수 있습니다.
57
64
  */
58
65
  optionFilter?: (inputValue: string, item: DropdownFilterOption<OptionValue>, index: number) => boolean;
59
66
  /**
60
67
  * DropdownFilter Option들의 전체 선택 여부
61
- * - showFilter 옵션 또는 selectionGroup이 있을 경우 전체 선택은 무시됩니다.
68
+ * - showFilter 옵션 또는 selectionGroup이 있을 경우, selectionType이 'radio'일 경우 전체 선택은 무시됩니다.
62
69
  */
63
70
  allCheck?: boolean;
64
71
  onChange?: (value: OptionValue[]) => void;
65
72
  }
66
- export declare const DropdownFilter: <OptionValue extends string | number>({ label, value: valueProp, selectionGroup, options, width, size: sizeProp, startIcon, disabled, status, zIndex, maxHeight, className, filterPlaceholder, optionsMatchRefWidth, autoPlacement: autoPlacementProps, unstableFocusVisible, showFilter, helperText, optionFilter, allCheck, keyExtractor, onChange, }: DropdownFilterProps<OptionValue> & AriaFocusProps) => React.JSX.Element;
73
+ export declare const DropdownFilter: <OptionValue extends string | number>({ label, value: valueProp, selectionGroup, options, width, size: sizeProp, startIcon, disabled, status, zIndex, maxHeight, className, filterPlaceholder, optionsMatchRefWidth, autoPlacement: autoPlacementProps, unstableFocusVisible, showFilter, helperText, kind, optionFilter, allCheck, keyExtractor, onChange, }: DropdownFilterProps<OptionValue> & AriaFocusProps) => React.JSX.Element;
@@ -5,6 +5,7 @@ export default meta;
5
5
  type Story = StoryObj<typeof DropdownFilter>;
6
6
  export declare const Base: Story;
7
7
  export declare const WithIcon: Story;
8
+ export declare const SelectionRadioType: Story;
8
9
  export declare const Selected: Story;
9
10
  export declare const Disabled: Story;
10
11
  export declare const Error: Story;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { AriaFocusProps } from '../../types/common';
3
3
  import { DropdownFilterGroupOption, DropdownFilterOption } from '../dropdown';
4
4
  import { PopoverContentProps } from './DropdownOptions';
5
+ export type Kind = 'radio' | 'checkbox';
5
6
  export interface DropdownFilterOptionsProps<OptionValue> extends Omit<PopoverContentProps<OptionValue>, 'isPositioned' | 'estimateSize' | 'value' | 'options'> {
6
7
  showFilter: boolean;
7
8
  isAllCheck: boolean;
@@ -12,7 +13,8 @@ export interface DropdownFilterOptionsProps<OptionValue> extends Omit<PopoverCon
12
13
  searchValue?: string;
13
14
  onChangeSearchValue?: (value: string) => void;
14
15
  selectedList: OptionValue[];
16
+ kind: Kind;
15
17
  onConfirm: (value: OptionValue[]) => void;
16
18
  onAllCheck: () => void;
17
19
  }
18
- export declare const DropdownFilterOptions: <OptionValue extends string | number>({ className, zIndex, size: sizeProp, initialFocus, options, onClose, noDataText, value: valueProp, unstableFocusVisible, keyExtractor, onChange, focusIndex, context, getFloatingProps, getItemProps, floatingStyles, refs, setRefs, setFocusIndex, showFilter, isAllCheck, isOptionGroup, filterPlaceholder, searchValue, onChangeSearchValue, selectedList, onConfirm, onAllCheck, }: DropdownFilterOptionsProps<OptionValue> & AriaFocusProps) => React.JSX.Element;
20
+ export declare const DropdownFilterOptions: <OptionValue extends string | number>({ className, zIndex, size: sizeProp, initialFocus, options, onClose, noDataText, value: valueProp, unstableFocusVisible, keyExtractor, onChange, focusIndex, context, getFloatingProps, getItemProps, floatingStyles, refs, setRefs, setFocusIndex, showFilter, isAllCheck, isOptionGroup, filterPlaceholder, searchValue, onChangeSearchValue, selectedList, kind, onConfirm, onAllCheck, }: DropdownFilterOptionsProps<OptionValue> & AriaFocusProps) => React.JSX.Element;