pds-dev-kit-web 1.4.18 → 1.4.19

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.
@@ -5,9 +5,9 @@ declare type BasicListProps = {
5
5
  titleStyleTheme?: 'headingBold' | 'leadParaBold' | 'subTitleBold';
6
6
  titleText?: PDSTextType;
7
7
  captionText?: PDSTextType;
8
- columns: 1 | 2 | 3 | 4 | 5 | 6;
9
- columnSpacing: 0 | 16 | 24;
10
- rowSpacing: 0 | 24 | 32 | 48 | 64;
8
+ columns?: 1 | 2 | 3 | 4 | 5 | 6;
9
+ columnSpacing?: 0 | 16 | 24;
10
+ rowSpacing?: 0 | 24 | 32 | 48 | 64;
11
11
  };
12
12
  declare function BasicList({ children, titleStyleTheme, titleText, captionText, columns, columnSpacing, rowSpacing }: BasicListProps): JSX.Element;
13
13
  export default BasicList;
@@ -4,7 +4,7 @@ declare type DesktopAlertDialogProps = {
4
4
  iconMode?: 'none' | 'success' | 'error' | 'warning' | 'information';
5
5
  titleText?: PDSTextType;
6
6
  contentText: PDSTextType;
7
- btnMode: 'tbtn_amount1' | 'tbtn_amount2' | 'tbtn_amount3';
7
+ btnMode?: 'tbtn_amount1' | 'tbtn_amount2' | 'tbtn_amount3';
8
8
  tBtn1Text?: PDSTextType;
9
9
  tBtn2Text?: PDSTextType;
10
10
  tBtn3Text?: PDSTextType;
@@ -6,9 +6,10 @@ declare type DropDownValues = PDSValueOption & {
6
6
  };
7
7
  declare type Props = {
8
8
  colorTheme?: 'none' | 'dark' | 'white';
9
- defaultValue?: PDSValueOption;
10
9
  hintText?: TFunctionResult;
11
10
  maxHeightItemNumber?: number;
11
+ defaultValue?: PDSValueOption;
12
+ value?: PDSValueOption;
12
13
  responsiveMode?: 'none' | 'use';
13
14
  selectionMode?: 'single' | 'multi';
14
15
  size?: 'large' | 'small';
@@ -16,5 +17,5 @@ declare type Props = {
16
17
  valueArray: DropDownValues[];
17
18
  onChange?: (option: PDSValueOption) => void;
18
19
  };
19
- declare function Dropdown({ colorTheme, defaultValue, hintText, maxHeightItemNumber, responsiveMode, selectionMode, size, state, valueArray, onChange }: Props): JSX.Element;
20
+ declare function Dropdown({ colorTheme, value, defaultValue, hintText, maxHeightItemNumber, responsiveMode, selectionMode, size, state, valueArray, onChange }: Props): JSX.Element;
20
21
  export default Dropdown;
@@ -31,14 +31,19 @@ var ContextMenuItem_1 = require("../ContextMenuItem");
31
31
  var TextLabel_1 = require("../TextLabel");
32
32
  // TODO: selectionMode의 multi 기능 구현 추가 필요
33
33
  function Dropdown(_a) {
34
- var _b = _a.colorTheme, colorTheme = _b === void 0 ? 'none' : _b, defaultValue = _a.defaultValue, hintText = _a.hintText, _c = _a.maxHeightItemNumber, maxHeightItemNumber = _c === void 0 ? 5 : _c, _d = _a.responsiveMode, responsiveMode = _d === void 0 ? 'none' : _d, _e = _a.selectionMode, selectionMode = _e === void 0 ? 'single' : _e, _f = _a.size, size = _f === void 0 ? 'large' : _f, _g = _a.state, state = _g === void 0 ? 'normal' : _g, valueArray = _a.valueArray, onChange = _a.onChange;
34
+ var _b = _a.colorTheme, colorTheme = _b === void 0 ? 'none' : _b, value = _a.value, defaultValue = _a.defaultValue, hintText = _a.hintText, _c = _a.maxHeightItemNumber, maxHeightItemNumber = _c === void 0 ? 5 : _c, _d = _a.responsiveMode, responsiveMode = _d === void 0 ? 'none' : _d, _e = _a.selectionMode, selectionMode = _e === void 0 ? 'single' : _e, _f = _a.size, size = _f === void 0 ? 'large' : _f, _g = _a.state, state = _g === void 0 ? 'normal' : _g, valueArray = _a.valueArray, onChange = _a.onChange;
35
35
  var _h = (0, react_1.useState)(false), isFocused = _h[0], setIsFocused = _h[1];
36
- var _j = (0, react_1.useState)(defaultValue), selectedOption = _j[0], setSelectedOption = _j[1];
36
+ var _j = (0, react_1.useState)(defaultValue), selectedValue = _j[0], setSelectedValue = _j[1];
37
37
  (0, react_1.useEffect)(function () {
38
38
  if (defaultValue) {
39
- setSelectedOption(defaultValue);
39
+ setSelectedValue(defaultValue);
40
40
  }
41
41
  }, [defaultValue]);
42
+ (0, react_1.useEffect)(function () {
43
+ if (value) {
44
+ setSelectedValue(value);
45
+ }
46
+ }, [value]);
42
47
  var handleClick = function () {
43
48
  if (state === 'disabled' || state === 'read_only') {
44
49
  return;
@@ -51,8 +56,10 @@ function Dropdown(_a) {
51
56
  }
52
57
  };
53
58
  var handleClickOption = function (option) {
54
- setSelectedOption(option);
55
59
  setIsFocused(false);
60
+ if (!value) {
61
+ setSelectedValue(option);
62
+ }
56
63
  if (onChange) {
57
64
  onChange(option);
58
65
  }
@@ -140,11 +147,12 @@ function Dropdown(_a) {
140
147
  return (react_1.default.createElement(S_Dropdown, { className: "container", size: size, tabIndex: 0, onBlur: handleBlur, responsiveMode: responsiveMode },
141
148
  react_1.default.createElement(S_Select, { size: size, onClick: handleClick, isFocused: isFocused, state: state, colorTheme: colorTheme, responsiveMode: responsiveMode },
142
149
  react_1.default.createElement(S_TextLabel, null,
143
- react_1.default.createElement(TextLabel_1.TextLabel, { text: (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.text) || hintText, styleTheme: "form2Regular", singleLineMode: "use", colorTheme: getTextColorTheme(), colorOverride: getTextColorOverride() })),
150
+ react_1.default.createElement(TextLabel_1.TextLabel, { text: (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.text) || hintText, styleTheme: "form2Regular", singleLineMode: "use", colorTheme: getTextColorTheme(), colorOverride: getTextColorOverride() })),
144
151
  react_1.default.createElement(hybrid_1.Icon, { size: 16, fillType: "line", iconName: isFocused ? 'ic_arrow_up' : 'ic_arrow_down', colorKey: getIconColorKey() }),
145
152
  react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_d", spacingType: "width" })),
146
153
  isFocused && (react_1.default.createElement(S_ContextMenuWrapper, null,
147
- react_1.default.createElement(ContextMenu_1.ContextMenu, { autoWidthMode: "use", maxHeight: maxHeight }, valueArray.map(function (el) { return (react_1.default.createElement(ContextMenuItem_1.ContextMenuItem, { key: el.value, option: el, size: size, isSelected: el.value === (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value), onClick: handleClickOption, state: el.state })); }))))));
154
+ react_1.default.createElement(ContextMenu_1.ContextMenu, { autoWidthMode: "use", maxHeight: maxHeight }, valueArray.map(function (el) { return (react_1.default.createElement(react_1.Fragment, { key: el.value },
155
+ react_1.default.createElement(ContextMenuItem_1.ContextMenuItem, { option: el, size: size, isSelected: (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.value) === el.value, onClick: handleClickOption, state: el.state }))); }))))));
148
156
  }
149
157
  var S_TextLabel = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex: 1;\n padding-left: ", ";\n padding-right: ", ";\n"], ["\n flex: 1;\n padding-left: ", ";\n padding-right: ", ";\n"])), function (_a) {
150
158
  var theme = _a.theme;
@@ -2,7 +2,7 @@
2
2
  import { Path } from 'react-hook-form';
3
3
  import { IFormValues, PDSTextType, PDSValueOption } from '../../../common';
4
4
  export declare type FilterBarProps = {
5
- displayType: 'chips' | 'searchfield' | 'filterchips_searchfield';
5
+ displayType?: 'chips' | 'searchfield' | 'filterchips_searchfield';
6
6
  textArray: PDSValueOption[];
7
7
  hintText?: PDSTextType;
8
8
  value?: PDSValueOption;
@@ -122,22 +122,34 @@ function MainButton(_a) {
122
122
  react_1.default.createElement(hybrid_1.Spacing, { size: size === 'large' || size === 'rlarge' ? 'spacing_b' : 'spacing_a', spacingType: "width" }),
123
123
  react_1.default.createElement(hybrid_1.Icon, { iconName: iconName, size: size === 'large' || size === 'rlarge' ? 20 : 16, colorKey: iconColor(), fillType: iconFillType })))));
124
124
  }
125
- var large = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 48px;\n min-width: 96px;\n padding: 0 24px;\n ", "\n ", ";\n"], ["\n height: 48px;\n min-width: 96px;\n padding: 0 24px;\n ", "\n ", ";\n"])), function (_a) {
125
+ var large = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 48px;\n min-width: 96px;\n padding: 0 ", ";\n ", "\n ", ";\n"], ["\n height: 48px;\n min-width: 96px;\n padding: 0 ", ";\n ", "\n ", ";\n"])), function (_a) {
126
+ var theme = _a.theme;
127
+ return theme.spacing.spacingE;
128
+ }, function (_a) {
126
129
  var shapeType = _a.shapeType;
127
130
  return shapeType === 'round' && 'border-radius: 14px;';
128
131
  }, function (_a) {
129
132
  var size = _a.size;
130
133
  return size === 'rlarge' && 'width: 100%';
131
134
  });
132
- var medium = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 40px;\n padding: 0 24px;\n ", "\n"], ["\n height: 40px;\n padding: 0 24px;\n ", "\n"])), function (_a) {
135
+ var medium = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 40px;\n min-width: 64px;\n padding: 0 ", ";\n ", "\n"], ["\n height: 40px;\n min-width: 64px;\n padding: 0 ", ";\n ", "\n"])), function (_a) {
136
+ var theme = _a.theme;
137
+ return theme.spacing.spacingE;
138
+ }, function (_a) {
133
139
  var shapeType = _a.shapeType;
134
140
  return shapeType === 'round' && 'border-radius: 14px;';
135
141
  });
136
- var small = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 32px;\n padding: 0 16px;\n ", "\n"], ["\n height: 32px;\n padding: 0 16px;\n ", "\n"])), function (_a) {
142
+ var small = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 32px;\n min-width: 48px;\n padding: 0 ", ";\n ", "\n"], ["\n height: 32px;\n min-width: 48px;\n padding: 0 ", ";\n ", "\n"])), function (_a) {
143
+ var theme = _a.theme;
144
+ return theme.spacing.spacingD;
145
+ }, function (_a) {
137
146
  var shapeType = _a.shapeType;
138
147
  return shapeType === 'round' && 'border-radius: 10px;';
139
148
  });
140
- var xsmall = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 24px;\n padding: 0 16px;\n ", "\n"], ["\n height: 24px;\n padding: 0 16px;\n ", "\n"])), function (_a) {
149
+ var xsmall = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 24px;\n min-width: 48px;\n padding: 0 ", ";\n ", "\n"], ["\n height: 24px;\n min-width: 48px;\n padding: 0 ", ";\n ", "\n"])), function (_a) {
150
+ var theme = _a.theme;
151
+ return theme.spacing.spacingD;
152
+ }, function (_a) {
141
153
  var shapeType = _a.shapeType;
142
154
  return shapeType === 'round' && 'border-radius: 8px;';
143
155
  });
@@ -1,18 +1,19 @@
1
- import React from 'react';
1
+ import React, { SelectHTMLAttributes } from 'react';
2
2
  import { PDSTextType } from '../../../common';
3
- declare type Value = {
3
+ declare type SelectOption = {
4
4
  text: string;
5
- value: string | number;
5
+ value: SelectHTMLAttributes<HTMLSelectElement>['value'];
6
6
  };
7
7
  declare type SelectProps = {
8
8
  hintText?: PDSTextType;
9
- defaultValue?: Value;
10
- valueArray: Value[];
9
+ defaultValue?: SelectOption;
10
+ value?: SelectOption['value'];
11
+ valueArray: SelectOption[];
11
12
  size?: 'large' | 'medium' | 'small' | 'rlarge';
12
13
  responsiveMode?: 'none' | 'use';
13
14
  state?: 'normal' | 'read_only' | 'disabled';
14
15
  onChange?: (e: React.ChangeEvent<HTMLSelectElement>) => void;
15
16
  colorTheme?: 'none' | 'dark';
16
17
  };
17
- declare function Select({ hintText, defaultValue, valueArray, size, responsiveMode, state, onChange, colorTheme }: SelectProps): JSX.Element;
18
+ declare function Select({ hintText, defaultValue, value, valueArray, size, responsiveMode, state, onChange, colorTheme }: SelectProps): JSX.Element;
18
19
  export default Select;
@@ -32,7 +32,7 @@ var hybrid_1 = require("../../../hybrid");
32
32
  var HINT = 'HINT_VALUE';
33
33
  function Select(_a) {
34
34
  var _b;
35
- var hintText = _a.hintText, defaultValue = _a.defaultValue, valueArray = _a.valueArray, _c = _a.size, size = _c === void 0 ? 'large' : _c, _d = _a.responsiveMode, responsiveMode = _d === void 0 ? 'none' : _d, _e = _a.state, state = _e === void 0 ? 'normal' : _e, onChange = _a.onChange, _f = _a.colorTheme, colorTheme = _f === void 0 ? 'none' : _f;
35
+ var hintText = _a.hintText, defaultValue = _a.defaultValue, value = _a.value, valueArray = _a.valueArray, _c = _a.size, size = _c === void 0 ? 'large' : _c, _d = _a.responsiveMode, responsiveMode = _d === void 0 ? 'none' : _d, _e = _a.state, state = _e === void 0 ? 'normal' : _e, onChange = _a.onChange, _f = _a.colorTheme, colorTheme = _f === void 0 ? 'none' : _f;
36
36
  var handleChange = function (e) {
37
37
  if (onChange) {
38
38
  onChange(e);
@@ -57,7 +57,7 @@ function Select(_a) {
57
57
  return (react_1.default.createElement(S_Box, { size: size, responsiveMode: responsiveMode, tabIndex: 0 },
58
58
  react_1.default.createElement(S_Icon_Wrapper, { state: state },
59
59
  react_1.default.createElement(hybrid_1.Icon, { size: 16, fillType: "line", iconName: "ic_arrow_down", colorKey: getIconColorKey() })),
60
- react_1.default.createElement(S_Select, { disabled: state === 'disabled' || state === 'read_only', state: state, colorTheme: colorTheme, onChange: handleChange, defaultValue: (_b = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value) !== null && _b !== void 0 ? _b : HINT },
60
+ react_1.default.createElement(S_Select, { disabled: state === 'disabled' || state === 'read_only', state: state, colorTheme: colorTheme, onChange: handleChange, defaultValue: (_b = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value) !== null && _b !== void 0 ? _b : HINT, value: value },
61
61
  hintText && (react_1.default.createElement("option", { disabled: true, value: HINT }, hintText)),
62
62
  valueArray.map(function (el) { return (react_1.default.createElement("option", { key: el.value, value: el.value }, el.text)); }))));
63
63
  }
@@ -99,21 +99,21 @@ var large = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 =
99
99
  var size = _a.size;
100
100
  return size === 'rlarge' && 'width: 100%';
101
101
  });
102
- var medium = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 40px;\n padding: 0 ", ";\n ", "\n"], ["\n height: 40px;\n padding: 0 ", ";\n ", "\n"])), function (_a) {
102
+ var medium = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 40px;\n min-width: 64px;\n padding: 0 ", ";\n ", "\n"], ["\n height: 40px;\n min-width: 64px;\n padding: 0 ", ";\n ", "\n"])), function (_a) {
103
103
  var theme = _a.theme;
104
104
  return theme.spacing.spacingE;
105
105
  }, function (_a) {
106
106
  var shapeType = _a.shapeType;
107
107
  return shapeType === 'round' && 'border-radius: 14px;';
108
108
  });
109
- var small = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 32px;\n padding: 0 ", ";\n ", "\n"], ["\n height: 32px;\n padding: 0 ", ";\n ", "\n"])), function (_a) {
109
+ var small = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 32px;\n min-width: 48px;\n padding: 0 ", ";\n ", "\n"], ["\n height: 32px;\n min-width: 48px;\n padding: 0 ", ";\n ", "\n"])), function (_a) {
110
110
  var theme = _a.theme;
111
111
  return theme.spacing.spacingD;
112
112
  }, function (_a) {
113
113
  var shapeType = _a.shapeType;
114
114
  return shapeType === 'round' && 'border-radius: 10px;';
115
115
  });
116
- var xsmall = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 24px;\n padding: 0 ", ";\n ", "\n"], ["\n height: 24px;\n padding: 0 ", ";\n ", "\n"])), function (_a) {
116
+ var xsmall = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 24px;\n min-width: 48px;\n padding: 0 ", ";\n ", "\n"], ["\n height: 24px;\n min-width: 48px;\n padding: 0 ", ";\n ", "\n"])), function (_a) {
117
117
  var theme = _a.theme;
118
118
  return theme.spacing.spacingD;
119
119
  }, function (_a) {
@@ -3,7 +3,7 @@ import { PDSTextType, PDSValueOption } from '../../../common';
3
3
  declare type Props = {
4
4
  logoImageSrc?: string;
5
5
  titleText?: PDSTextType;
6
- menuMode: 'center_text' | 'none';
6
+ menuMode?: 'center_text' | 'none';
7
7
  textArray?: PDSValueOption[];
8
8
  userImageSrc?: string;
9
9
  loginInfoMode?: 'none' | 'profile' | 'button';
@@ -5,9 +5,9 @@ declare type BasicListProps = {
5
5
  titleStyleTheme?: 'headingBold' | 'leadParaBold' | 'subTitleBold';
6
6
  titleText?: PDSTextType;
7
7
  captionText?: PDSTextType;
8
- columns: 1 | 2 | 3 | 4 | 5 | 6;
9
- columnSpacing: 0 | 16 | 24;
10
- rowSpacing: 0 | 24 | 32 | 48 | 64;
8
+ columns?: 1 | 2 | 3 | 4 | 5 | 6;
9
+ columnSpacing?: 0 | 16 | 24;
10
+ rowSpacing?: 0 | 24 | 32 | 48 | 64;
11
11
  };
12
12
  declare function BasicList({ children, titleStyleTheme, titleText, captionText, columns, columnSpacing, rowSpacing }: BasicListProps): JSX.Element;
13
13
  export default BasicList;
@@ -7,6 +7,7 @@ declare type DropDownValues = PDSValueOption & {
7
7
  declare type Props = {
8
8
  colorTheme?: 'none' | 'dark' | 'white';
9
9
  defaultValue?: PDSValueOption;
10
+ value?: PDSValueOption;
10
11
  hintText?: TFunctionResult;
11
12
  maxHeightItemNumber?: number;
12
13
  responsiveMode?: 'none' | 'use';
@@ -16,5 +17,5 @@ declare type Props = {
16
17
  valueArray: DropDownValues[];
17
18
  onChange?: (option: PDSValueOption) => void;
18
19
  };
19
- declare function Dropdown({ colorTheme, defaultValue, hintText, maxHeightItemNumber, responsiveMode, selectionMode, size, state, valueArray, onChange }: Props): JSX.Element;
20
+ declare function Dropdown({ colorTheme, value, defaultValue, hintText, maxHeightItemNumber, responsiveMode, selectionMode, size, state, valueArray, onChange }: Props): JSX.Element;
20
21
  export default Dropdown;
@@ -31,14 +31,19 @@ var ContextMenuItem_1 = require("../ContextMenuItem");
31
31
  var TextLabel_1 = require("../TextLabel");
32
32
  // TODO: selectionMode의 multi 기능 구현 추가 필요
33
33
  function Dropdown(_a) {
34
- var _b = _a.colorTheme, colorTheme = _b === void 0 ? 'none' : _b, defaultValue = _a.defaultValue, hintText = _a.hintText, _c = _a.maxHeightItemNumber, maxHeightItemNumber = _c === void 0 ? 5 : _c, _d = _a.responsiveMode, responsiveMode = _d === void 0 ? 'none' : _d, _e = _a.selectionMode, selectionMode = _e === void 0 ? 'single' : _e, _f = _a.size, size = _f === void 0 ? 'large' : _f, _g = _a.state, state = _g === void 0 ? 'normal' : _g, valueArray = _a.valueArray, onChange = _a.onChange;
35
- var _h = (0, react_1.useState)(true), isFocused = _h[0], setIsFocused = _h[1];
36
- var _j = (0, react_1.useState)(defaultValue), selectedOption = _j[0], setSelectedOption = _j[1];
34
+ var _b = _a.colorTheme, colorTheme = _b === void 0 ? 'none' : _b, value = _a.value, defaultValue = _a.defaultValue, hintText = _a.hintText, _c = _a.maxHeightItemNumber, maxHeightItemNumber = _c === void 0 ? 5 : _c, _d = _a.responsiveMode, responsiveMode = _d === void 0 ? 'none' : _d, _e = _a.selectionMode, selectionMode = _e === void 0 ? 'single' : _e, _f = _a.size, size = _f === void 0 ? 'large' : _f, _g = _a.state, state = _g === void 0 ? 'normal' : _g, valueArray = _a.valueArray, onChange = _a.onChange;
35
+ var _h = (0, react_1.useState)(false), isFocused = _h[0], setIsFocused = _h[1];
36
+ var _j = (0, react_1.useState)(defaultValue), selectedValue = _j[0], setSelectedValue = _j[1];
37
37
  (0, react_1.useEffect)(function () {
38
38
  if (defaultValue) {
39
- setSelectedOption(defaultValue);
39
+ setSelectedValue(defaultValue);
40
40
  }
41
41
  }, [defaultValue]);
42
+ (0, react_1.useEffect)(function () {
43
+ if (value) {
44
+ setSelectedValue(value);
45
+ }
46
+ }, [value]);
42
47
  var handleClick = function () {
43
48
  if (state === 'disabled' || state === 'read_only') {
44
49
  return;
@@ -51,8 +56,10 @@ function Dropdown(_a) {
51
56
  }
52
57
  };
53
58
  var handleClickOption = function (option) {
54
- setSelectedOption(option);
55
59
  setIsFocused(false);
60
+ if (!value) {
61
+ setSelectedValue(option);
62
+ }
56
63
  if (onChange) {
57
64
  onChange(option);
58
65
  }
@@ -140,11 +147,12 @@ function Dropdown(_a) {
140
147
  return (react_1.default.createElement(S_Dropdown, { className: "container", size: size, tabIndex: 0, onBlur: handleBlur, responsiveMode: responsiveMode },
141
148
  react_1.default.createElement(S_Select, { size: size, onClick: handleClick, isFocused: isFocused, state: state, colorTheme: colorTheme, responsiveMode: responsiveMode },
142
149
  react_1.default.createElement(S_TextLabel, null,
143
- react_1.default.createElement(TextLabel_1.TextLabel, { text: (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.text) || hintText, styleTheme: "form2Regular", singleLineMode: "use", colorTheme: getTextColorTheme(), colorOverride: getTextColorOverride() })),
150
+ react_1.default.createElement(TextLabel_1.TextLabel, { text: (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.text) || hintText, styleTheme: "form2Regular", singleLineMode: "use", colorTheme: getTextColorTheme(), colorOverride: getTextColorOverride() })),
144
151
  react_1.default.createElement(hybrid_1.Icon, { size: 16, fillType: "line", iconName: isFocused ? 'ic_arrow_up' : 'ic_arrow_down', colorKey: getIconColorKey() }),
145
152
  react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_d", spacingType: "width" })),
146
153
  isFocused && (react_1.default.createElement(S_ContextMenuWrapper, null,
147
- react_1.default.createElement(ContextMenu_1.ContextMenu, { autoWidthMode: "use", maxHeight: maxHeight }, valueArray.map(function (el) { return (react_1.default.createElement(ContextMenuItem_1.ContextMenuItem, { key: el.value, option: el, size: size, isSelected: el.value === (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value), onClick: handleClickOption, state: el.state })); }))))));
154
+ react_1.default.createElement(ContextMenu_1.ContextMenu, { autoWidthMode: "use", maxHeight: maxHeight }, valueArray.map(function (el) { return (react_1.default.createElement(react_1.Fragment, { key: el.value },
155
+ react_1.default.createElement(ContextMenuItem_1.ContextMenuItem, { option: el, size: size, isSelected: (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.value) === el.value, onClick: handleClickOption, state: el.state }))); }))))));
148
156
  }
149
157
  var S_TextLabel = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex: 1;\n padding-left: ", ";\n padding-right: ", ";\n"], ["\n flex: 1;\n padding-left: ", ";\n padding-right: ", ";\n"])), function (_a) {
150
158
  var theme = _a.theme;
@@ -122,22 +122,34 @@ function MainButton(_a) {
122
122
  react_1.default.createElement(hybrid_1.Spacing, { size: size === 'large' || size === 'rlarge' ? 'spacing_b' : 'spacing_a', spacingType: "width" }),
123
123
  react_1.default.createElement(hybrid_1.Icon, { iconName: iconName, size: size === 'large' || size === 'rlarge' ? 20 : 16, colorKey: iconColor(), fillType: iconFillType })))));
124
124
  }
125
- var large = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 48px;\n min-width: 96px;\n padding: 0 24px;\n ", "\n ", ";\n"], ["\n height: 48px;\n min-width: 96px;\n padding: 0 24px;\n ", "\n ", ";\n"])), function (_a) {
125
+ var large = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 48px;\n min-width: 96px;\n padding: 0 ", ";\n ", "\n ", ";\n"], ["\n height: 48px;\n min-width: 96px;\n padding: 0 ", ";\n ", "\n ", ";\n"])), function (_a) {
126
+ var theme = _a.theme;
127
+ return theme.spacing.spacingE;
128
+ }, function (_a) {
126
129
  var shapeType = _a.shapeType;
127
130
  return shapeType === 'round' && 'border-radius: 14px;';
128
131
  }, function (_a) {
129
132
  var size = _a.size;
130
133
  return size === 'rlarge' && 'width: 100%';
131
134
  });
132
- var medium = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 40px;\n padding: 0 24px;\n ", "\n"], ["\n height: 40px;\n padding: 0 24px;\n ", "\n"])), function (_a) {
135
+ var medium = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 40px;\n min-width: 64px;\n padding: 0 ", ";\n ", "\n"], ["\n height: 40px;\n min-width: 64px;\n padding: 0 ", ";\n ", "\n"])), function (_a) {
136
+ var theme = _a.theme;
137
+ return theme.spacing.spacingE;
138
+ }, function (_a) {
133
139
  var shapeType = _a.shapeType;
134
140
  return shapeType === 'round' && 'border-radius: 14px;';
135
141
  });
136
- var small = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 32px;\n padding: 0 16px;\n ", "\n"], ["\n height: 32px;\n padding: 0 16px;\n ", "\n"])), function (_a) {
142
+ var small = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 32px;\n min-width: 48px;\n padding: 0 ", ";\n ", "\n"], ["\n height: 32px;\n min-width: 48px;\n padding: 0 ", ";\n ", "\n"])), function (_a) {
143
+ var theme = _a.theme;
144
+ return theme.spacing.spacingD;
145
+ }, function (_a) {
137
146
  var shapeType = _a.shapeType;
138
147
  return shapeType === 'round' && 'border-radius: 10px;';
139
148
  });
140
- var xsmall = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 24px;\n padding: 0 16px;\n ", "\n"], ["\n height: 24px;\n padding: 0 16px;\n ", "\n"])), function (_a) {
149
+ var xsmall = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 24px;\n min-width: 48px;\n padding: 0 ", ";\n ", "\n"], ["\n height: 24px;\n min-width: 48px;\n padding: 0 ", ";\n ", "\n"])), function (_a) {
150
+ var theme = _a.theme;
151
+ return theme.spacing.spacingD;
152
+ }, function (_a) {
141
153
  var shapeType = _a.shapeType;
142
154
  return shapeType === 'round' && 'border-radius: 8px;';
143
155
  });
@@ -4,7 +4,7 @@ declare type MobileAlertDialogProps = {
4
4
  iconMode?: 'none' | 'success' | 'error' | 'warning' | 'information';
5
5
  titleText?: PDSTextType;
6
6
  contentText: PDSTextType;
7
- btnMode: 'tbtn_amount1' | 'tbtn_amount2' | 'tbtn_amount3';
7
+ btnMode?: 'tbtn_amount1' | 'tbtn_amount2' | 'tbtn_amount3';
8
8
  btnStack?: 'side' | 'stack';
9
9
  tBtn1Text?: PDSTextType;
10
10
  tBtn2Text?: PDSTextType;
@@ -1,18 +1,19 @@
1
- import React from 'react';
1
+ import React, { SelectHTMLAttributes } from 'react';
2
2
  import { PDSTextType } from '../../../common';
3
- declare type Value = {
3
+ declare type SelectOption = {
4
4
  text: string;
5
- value: string | number;
5
+ value: SelectHTMLAttributes<HTMLSelectElement>['value'];
6
6
  };
7
7
  declare type SelectProps = {
8
8
  hintText?: PDSTextType;
9
- defaultValue?: Value;
10
- valueArray: Value[];
9
+ defaultValue?: SelectOption;
10
+ value?: SelectOption['value'];
11
+ valueArray: SelectOption[];
11
12
  size?: 'large' | 'medium' | 'small' | 'rlarge';
12
13
  responsiveMode?: 'none' | 'use';
13
14
  state?: 'normal' | 'read_only' | 'disabled';
14
15
  onChange?: (e: React.ChangeEvent<HTMLSelectElement>) => void;
15
16
  colorTheme?: 'none' | 'dark';
16
17
  };
17
- declare function Select({ hintText, defaultValue, valueArray, size, responsiveMode, state, onChange, colorTheme }: SelectProps): JSX.Element;
18
+ declare function Select({ hintText, defaultValue, value, valueArray, size, responsiveMode, state, onChange, colorTheme }: SelectProps): JSX.Element;
18
19
  export default Select;
@@ -32,7 +32,7 @@ var hybrid_1 = require("../../../hybrid");
32
32
  var HINT = 'HINT_VALUE';
33
33
  function Select(_a) {
34
34
  var _b;
35
- var hintText = _a.hintText, defaultValue = _a.defaultValue, valueArray = _a.valueArray, _c = _a.size, size = _c === void 0 ? 'large' : _c, _d = _a.responsiveMode, responsiveMode = _d === void 0 ? 'none' : _d, _e = _a.state, state = _e === void 0 ? 'normal' : _e, onChange = _a.onChange, _f = _a.colorTheme, colorTheme = _f === void 0 ? 'none' : _f;
35
+ var hintText = _a.hintText, defaultValue = _a.defaultValue, value = _a.value, valueArray = _a.valueArray, _c = _a.size, size = _c === void 0 ? 'large' : _c, _d = _a.responsiveMode, responsiveMode = _d === void 0 ? 'none' : _d, _e = _a.state, state = _e === void 0 ? 'normal' : _e, onChange = _a.onChange, _f = _a.colorTheme, colorTheme = _f === void 0 ? 'none' : _f;
36
36
  var handleChange = function (e) {
37
37
  if (onChange) {
38
38
  onChange(e);
@@ -53,7 +53,7 @@ function Select(_a) {
53
53
  return (react_1.default.createElement(S_Box, { size: size, responsiveMode: responsiveMode, tabIndex: 0 },
54
54
  react_1.default.createElement(S_Icon_Wrapper, { state: state },
55
55
  react_1.default.createElement(hybrid_1.Icon, { size: 16, fillType: "line", iconName: "ic_arrow_down", colorKey: getIconColorKey() })),
56
- react_1.default.createElement(S_Select, { disabled: state === 'disabled' || state === 'read_only', state: state, colorTheme: colorTheme, onChange: handleChange, defaultValue: (_b = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value) !== null && _b !== void 0 ? _b : HINT },
56
+ react_1.default.createElement(S_Select, { disabled: state === 'disabled' || state === 'read_only', state: state, colorTheme: colorTheme, onChange: handleChange, defaultValue: (_b = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value) !== null && _b !== void 0 ? _b : HINT, value: value },
57
57
  hintText && (react_1.default.createElement("option", { disabled: true, value: HINT }, hintText)),
58
58
  valueArray.map(function (el) { return (react_1.default.createElement("option", { key: el.value, value: el.value }, el.text)); }))));
59
59
  }
@@ -99,21 +99,21 @@ var large = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 =
99
99
  var size = _a.size;
100
100
  return size === 'rlarge' && 'width: 100%';
101
101
  });
102
- var medium = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 40px;\n padding: 0 ", ";\n ", "\n"], ["\n height: 40px;\n padding: 0 ", ";\n ", "\n"])), function (_a) {
102
+ var medium = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 40px;\n min-width: 64px;\n padding: 0 ", ";\n ", "\n"], ["\n height: 40px;\n min-width: 64px;\n padding: 0 ", ";\n ", "\n"])), function (_a) {
103
103
  var theme = _a.theme;
104
104
  return theme.spacing.spacingE;
105
105
  }, function (_a) {
106
106
  var shapeType = _a.shapeType;
107
107
  return shapeType === 'round' && 'border-radius: 14px;';
108
108
  });
109
- var small = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 32px;\n padding: 0 ", ";\n ", "\n"], ["\n height: 32px;\n padding: 0 ", ";\n ", "\n"])), function (_a) {
109
+ var small = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 32px;\n min-width: 48px;\n padding: 0 ", ";\n ", "\n"], ["\n height: 32px;\n min-width: 48px;\n padding: 0 ", ";\n ", "\n"])), function (_a) {
110
110
  var theme = _a.theme;
111
111
  return theme.spacing.spacingD;
112
112
  }, function (_a) {
113
113
  var shapeType = _a.shapeType;
114
114
  return shapeType === 'round' && 'border-radius: 10px;';
115
115
  });
116
- var xsmall = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 24px;\n padding: 0 ", ";\n ", "\n"], ["\n height: 24px;\n padding: 0 ", ";\n ", "\n"])), function (_a) {
116
+ var xsmall = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 24px;\n min-width: 48px;\n padding: 0 ", ";\n ", "\n"], ["\n height: 24px;\n min-width: 48px;\n padding: 0 ", ";\n ", "\n"])), function (_a) {
117
117
  var theme = _a.theme;
118
118
  return theme.spacing.spacingD;
119
119
  }, function (_a) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web",
3
- "version": "1.4.18",
3
+ "version": "1.4.19",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
package/release-note.md CHANGED
@@ -1,6 +1,29 @@
1
1
  # PDS-DEV-KIT-WEB Release Notes
2
- ## [v1.4.18]
2
+ ## [v1.4.19]
3
3
 
4
4
  ### Component
5
- * DynamicDesktopNavbar
6
- * 'DISPLAY_ONLY'유형 디자인 수정
5
+ * BasicList
6
+ * defaultValue를 받을 수 있도록 prop의 type을 optional로 변경
7
+ * columns
8
+ * columnSpacing
9
+ * rowSpacing
10
+ * DesktopAlertDialog
11
+ * defaultValue를 받을 수 있도록 prop의 type을 optional로 변경
12
+ * btnMode
13
+ * Dropdown
14
+ * value prop 추가
15
+ * FilterBar
16
+ * defaultValue를 받을 수 있도록 prop의 type을 optional로 변경
17
+ * displayType
18
+ * MainButton
19
+ * 사이즈별 min-width 추가
20
+ * MobileAlertDialog
21
+ * defaultValue를 받을 수 있도록 prop의 type을 optional로 변경
22
+ * btnMode
23
+ * Select
24
+ * value prop 추가
25
+ * UploadMainButton
26
+ * 사이즈별 min-width 추가
27
+ * UserDesktopNavBar
28
+ * defaultValue를 받을 수 있도록 prop의 type을 optional로 변경
29
+ * menuMode