pds-dev-kit-web 1.3.18 → 1.3.21
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/dist/src/desktop/common/components/TextFieldBase/TextFieldBase.js +1 -1
- package/dist/src/desktop/components/BasicList/BasicList.js +1 -17
- package/dist/src/desktop/components/BasicListItem/BasicListItem.d.ts +12 -10
- package/dist/src/desktop/components/BasicListItem/BasicListItem.js +77 -43
- package/dist/src/desktop/components/Checkbox/Checkbox.js +3 -1
- package/dist/src/desktop/components/Dropdown/Dropdown.js +1 -1
- package/dist/src/desktop/components/EditApplyTextField/EditApplyTextField.js +2 -2
- package/dist/src/desktop/components/IconButton/IconButton.d.ts +4 -3
- package/dist/src/desktop/components/IconButton/IconButton.js +4 -4
- package/dist/src/mobile/common/components/TextFieldBase/TextFieldBase.js +1 -1
- package/dist/src/mobile/components/BasicList/BasicList.js +1 -17
- package/dist/src/mobile/components/BasicListItem/BasicListItem.d.ts +13 -11
- package/dist/src/mobile/components/BasicListItem/BasicListItem.js +74 -48
- package/dist/src/mobile/components/Checkbox/Checkbox.d.ts +3 -2
- package/dist/src/mobile/components/Checkbox/Checkbox.js +10 -4
- package/dist/src/mobile/components/Dropdown/Dropdown.js +1 -1
- package/dist/src/mobile/components/IconButton/IconButton.d.ts +4 -3
- package/dist/src/mobile/components/IconButton/IconButton.js +5 -8
- package/package.json +1 -1
- package/release-note.md +9 -10
|
@@ -174,7 +174,7 @@ function TextFieldBase(_a) {
|
|
|
174
174
|
if (textLineType === 'single') {
|
|
175
175
|
return (react_1.default.createElement(S_InputWrapper, null,
|
|
176
176
|
react_1.default.createElement(S_Input, __assign({}, register(name, validation), rest, { name: name, defaultValue: defaultText, placeholder: hintText, type: inputType, state: state, readOnly: state === 'read_only', disabled: state === 'disabled', maxLength: maxLength, textSize: textSize, textWeight: textWeight, textPadding: textPadding, colorTheme: colorTheme, min: min, max: max, onFocus: handleFocus, onChange: handleChange, onBlur: handleBlur, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, ref: ref })),
|
|
177
|
-
deleteIconMode === 'use' && isFocused && (react_1.default.createElement(IconButton_1.IconButton, { iconName: "ic_delete", baseSize: "small", shapeType: "rectangle", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconSize: deleteIconSize, iconColorKey: deleteIconColor, iconFillType: "fill", state: state === 'disabled' ? 'disabled' : 'normal', onMouseDown: deleteValue }))));
|
|
177
|
+
deleteIconMode === 'use' && isFocused && (react_1.default.createElement(IconButton_1.IconButton, { iconName: "ic_delete", baseSize: "small", shapeType: "rectangle", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconSize: deleteIconSize, iconColorKey: deleteIconColor, iconFillType: "fill", state: state === 'disabled' ? 'disabled' : 'normal', tabIndex: -1, onMouseDown: deleteValue }))));
|
|
178
178
|
}
|
|
179
179
|
if (textLineType === 'multi') {
|
|
180
180
|
return (react_1.default.createElement(S_Multi, __assign({}, register(name, validation), rest, { name: name, defaultValue: defaultText, placeholder: hintText, state: state, readOnly: state === 'read_only' && true, disabled: state === 'disabled' && true, maxLength: maxLength, rows: multiRows, textSize: textSize, textWeight: textWeight, textPadding: textPadding, colorTheme: colorTheme, onFocus: handleFocus, onChange: handleChange, onBlur: handleBlur, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, ref: ref })));
|
|
@@ -3,38 +3,22 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
4
|
return cooked;
|
|
5
5
|
};
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
6
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
7
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
8
|
};
|
|
20
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
10
|
var react_1 = __importDefault(require("react"));
|
|
22
|
-
var react_hook_form_1 = require("react-hook-form");
|
|
23
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
24
|
-
var common_1 = require("../../../common");
|
|
25
12
|
var hybrid_1 = require("../../../hybrid");
|
|
26
13
|
var TextLabel_1 = require("../TextLabel");
|
|
27
14
|
function BasicList(_a) {
|
|
28
15
|
var children = _a.children, _b = _a.titleStyleTheme, titleStyleTheme = _b === void 0 ? 'headingBold' : _b, titleText = _a.titleText, captionText = _a.captionText, _c = _a.columns, columns = _c === void 0 ? 1 : _c, _d = _a.columnSpacing, columnSpacing = _d === void 0 ? 16 : _d, _e = _a.rowSpacing, rowSpacing = _e === void 0 ? 0 : _e;
|
|
29
|
-
var methods = (0, react_hook_form_1.useForm)();
|
|
30
16
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
31
17
|
(titleText || captionText) && (react_1.default.createElement(S_TitleBox, null,
|
|
32
18
|
react_1.default.createElement(TextLabel_1.TextLabel, { text: titleText, styleTheme: titleStyleTheme }),
|
|
33
19
|
titleText && captionText && react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_a", spacingType: "height" }),
|
|
34
20
|
captionText && react_1.default.createElement(TextLabel_1.TextLabel, { text: captionText, styleTheme: "body2Regular" }))),
|
|
35
|
-
react_1.default.createElement(
|
|
36
|
-
react_1.default.createElement(common_1.Form, null,
|
|
37
|
-
react_1.default.createElement(S_BasicListWrapper, { columns: columns, columnSpacing: columnSpacing, rowSpacing: rowSpacing }, children)))));
|
|
21
|
+
react_1.default.createElement(S_BasicListWrapper, { columns: columns, columnSpacing: columnSpacing, rowSpacing: rowSpacing }, children)));
|
|
38
22
|
}
|
|
39
23
|
var S_TitleBox = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-bottom: ", ";\n padding: ", ";\n"], ["\n margin-bottom: ", ";\n padding: ", ";\n"])), function (_a) {
|
|
40
24
|
var theme = _a.theme;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { FillIconNameKeys, LineIconNameKeys, PDSTextType } from '../../../common';
|
|
3
3
|
export declare type BasicListItemProps = {
|
|
4
4
|
selectionMode?: 'none' | 'check' | 'radio';
|
|
@@ -12,7 +12,7 @@ export declare type BasicListItemProps = {
|
|
|
12
12
|
imageSrc?: string;
|
|
13
13
|
iconName?: FillIconNameKeys | LineIconNameKeys;
|
|
14
14
|
iconFillType?: 'fill' | 'line';
|
|
15
|
-
displayType?: 'none' | 'text' | '
|
|
15
|
+
displayType?: 'none' | 'text' | 'ibtn_text' | 'ibtn_amount1' | 'ibtn_amount2' | 'mbtn' | 'switch';
|
|
16
16
|
captionText?: PDSTextType;
|
|
17
17
|
iBtn1IconName?: FillIconNameKeys | LineIconNameKeys;
|
|
18
18
|
iBtn1IconFillType?: 'fill' | 'line';
|
|
@@ -22,21 +22,23 @@ export declare type BasicListItemProps = {
|
|
|
22
22
|
mBtnText?: PDSTextType;
|
|
23
23
|
dividerType?: 'none' | 'solid';
|
|
24
24
|
titleFontWeight?: 'bold' | 'regular';
|
|
25
|
-
|
|
25
|
+
checkboxId?: string | number;
|
|
26
|
+
radioId?: string;
|
|
26
27
|
radioValue?: string;
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
onClick?: () => void;
|
|
29
|
+
onClickIBtn1?: () => void;
|
|
30
|
+
onClickIBtn2?: () => void;
|
|
29
31
|
onClickMBtn?: () => void;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
onClickRadio?: (value: string) => void;
|
|
33
|
+
onClickSwitch?: () => void;
|
|
32
34
|
};
|
|
33
35
|
export declare type StyleProps = {
|
|
34
36
|
isSelected?: boolean;
|
|
35
37
|
selectionMode?: 'none' | 'check' | 'radio';
|
|
36
|
-
|
|
38
|
+
captionText?: PDSTextType;
|
|
37
39
|
badgeStatus?: 'cancel' | 'active' | 'inactive';
|
|
38
40
|
imageIconMode?: 'none' | 'image' | 'icon';
|
|
39
|
-
displayType?: 'none' | 'text' | '
|
|
41
|
+
displayType?: 'none' | 'text' | 'ibtn_text' | 'ibtn_amount1' | 'ibtn_amount2' | 'mbtn' | 'switch';
|
|
40
42
|
};
|
|
41
|
-
declare function BasicListItem({ selectionMode, titleText, titleTextColorTheme, descText, badgeMode, badgeStatus, imageIconMode, imageShapeType, imageSrc, iconName, iconFillType, displayType, captionText, iBtn1IconName, iBtn1IconFillType, iBtn2IconName, iBtn2IconFillType, mBtnFillType, mBtnText, dividerType, titleFontWeight,
|
|
43
|
+
declare function BasicListItem({ selectionMode, titleText, titleTextColorTheme, descText, badgeMode, badgeStatus, imageIconMode, imageShapeType, imageSrc, iconName, iconFillType, displayType, captionText, iBtn1IconName, iBtn1IconFillType, iBtn2IconName, iBtn2IconFillType, mBtnFillType, mBtnText, dividerType, titleFontWeight, checkboxId, radioId, radioValue, onClick, onClickIBtn1, onClickIBtn2, onClickMBtn, onClickRadio, onClickSwitch }: BasicListItemProps): JSX.Element;
|
|
42
44
|
export default BasicListItem;
|
|
@@ -17,52 +17,79 @@ var MainButton_1 = require("../MainButton");
|
|
|
17
17
|
var Radio_1 = require("../Radio");
|
|
18
18
|
var TextLabel_1 = require("../TextLabel");
|
|
19
19
|
function BasicListItem(_a) {
|
|
20
|
-
var _b = _a.selectionMode, selectionMode = _b === void 0 ? 'none' : _b, titleText = _a.titleText, _c = _a.titleTextColorTheme, titleTextColorTheme = _c === void 0 ? 'none' : _c, descText = _a.descText, _d = _a.badgeMode, badgeMode = _d === void 0 ? 'none' : _d, _e = _a.badgeStatus, badgeStatus = _e === void 0 ? 'inactive' : _e, _f = _a.imageIconMode, imageIconMode = _f === void 0 ? 'none' : _f, _g = _a.imageShapeType, imageShapeType = _g === void 0 ? 'round' : _g, imageSrc = _a.imageSrc, iconName = _a.iconName, _h = _a.iconFillType, iconFillType = _h === void 0 ? 'line' : _h, _j = _a.displayType, displayType = _j === void 0 ? 'none' : _j, captionText = _a.captionText, iBtn1IconName = _a.iBtn1IconName, _k = _a.iBtn1IconFillType, iBtn1IconFillType = _k === void 0 ? 'line' : _k, iBtn2IconName = _a.iBtn2IconName, _l = _a.iBtn2IconFillType, iBtn2IconFillType = _l === void 0 ? 'line' : _l, _m = _a.mBtnFillType, mBtnFillType = _m === void 0 ? 'fill' : _m, mBtnText = _a.mBtnText, _o = _a.dividerType, dividerType = _o === void 0 ? 'none' : _o, _p = _a.titleFontWeight, titleFontWeight = _p === void 0 ? 'regular' : _p,
|
|
20
|
+
var _b = _a.selectionMode, selectionMode = _b === void 0 ? 'none' : _b, titleText = _a.titleText, _c = _a.titleTextColorTheme, titleTextColorTheme = _c === void 0 ? 'none' : _c, descText = _a.descText, _d = _a.badgeMode, badgeMode = _d === void 0 ? 'none' : _d, _e = _a.badgeStatus, badgeStatus = _e === void 0 ? 'inactive' : _e, _f = _a.imageIconMode, imageIconMode = _f === void 0 ? 'none' : _f, _g = _a.imageShapeType, imageShapeType = _g === void 0 ? 'round' : _g, imageSrc = _a.imageSrc, iconName = _a.iconName, _h = _a.iconFillType, iconFillType = _h === void 0 ? 'line' : _h, _j = _a.displayType, displayType = _j === void 0 ? 'none' : _j, captionText = _a.captionText, iBtn1IconName = _a.iBtn1IconName, _k = _a.iBtn1IconFillType, iBtn1IconFillType = _k === void 0 ? 'line' : _k, iBtn2IconName = _a.iBtn2IconName, _l = _a.iBtn2IconFillType, iBtn2IconFillType = _l === void 0 ? 'line' : _l, _m = _a.mBtnFillType, mBtnFillType = _m === void 0 ? 'fill' : _m, mBtnText = _a.mBtnText, _o = _a.dividerType, dividerType = _o === void 0 ? 'none' : _o, _p = _a.titleFontWeight, titleFontWeight = _p === void 0 ? 'regular' : _p, checkboxId = _a.checkboxId, radioId = _a.radioId, radioValue = _a.radioValue, onClick = _a.onClick, onClickIBtn1 = _a.onClickIBtn1, onClickIBtn2 = _a.onClickIBtn2, onClickMBtn = _a.onClickMBtn, onClickRadio = _a.onClickRadio, onClickSwitch = _a.onClickSwitch;
|
|
21
21
|
var methods = (0, react_hook_form_1.useFormContext)();
|
|
22
|
-
var isSelected =
|
|
22
|
+
var isSelected = methods === null || methods === void 0 ? void 0 : methods.watch((checkboxId === null || checkboxId === void 0 ? void 0 : checkboxId.toString()) || '');
|
|
23
23
|
var handleCheckBoxClick = function (e) {
|
|
24
24
|
e.preventDefault();
|
|
25
|
-
if (!
|
|
25
|
+
if (!checkboxId) {
|
|
26
26
|
return;
|
|
27
|
-
|
|
28
|
-
methods.
|
|
27
|
+
}
|
|
28
|
+
var checkedStatus = methods.getValues(checkboxId.toString());
|
|
29
|
+
methods.setValue(checkboxId.toString(), !checkedStatus);
|
|
29
30
|
};
|
|
30
31
|
var handleMBtnClick = function () {
|
|
31
32
|
if (onClickMBtn) {
|
|
32
33
|
onClickMBtn();
|
|
33
34
|
}
|
|
34
|
-
return;
|
|
35
35
|
};
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
var handleIBtn1Click = function (e) {
|
|
37
|
+
e.stopPropagation();
|
|
38
|
+
if (onClickIBtn1) {
|
|
39
|
+
onClickIBtn1();
|
|
39
40
|
}
|
|
40
|
-
return;
|
|
41
41
|
};
|
|
42
|
-
var
|
|
43
|
-
if (
|
|
44
|
-
|
|
42
|
+
var handleIBtn2Click = function () {
|
|
43
|
+
if (onClickIBtn2) {
|
|
44
|
+
onClickIBtn2();
|
|
45
45
|
}
|
|
46
|
-
return;
|
|
47
46
|
};
|
|
48
47
|
var handleSwitchClick = function () {
|
|
49
|
-
if (
|
|
50
|
-
|
|
48
|
+
if (onClickSwitch) {
|
|
49
|
+
onClickSwitch();
|
|
51
50
|
}
|
|
52
|
-
return;
|
|
53
51
|
};
|
|
54
|
-
var
|
|
55
|
-
if (
|
|
56
|
-
|
|
52
|
+
var handleRadioClick = function (e) {
|
|
53
|
+
if (onClickRadio) {
|
|
54
|
+
onClickRadio(e.target.value);
|
|
57
55
|
}
|
|
58
|
-
return;
|
|
59
56
|
};
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
var handleClick = function (e) {
|
|
58
|
+
switch (selectionMode) {
|
|
59
|
+
case 'radio': {
|
|
60
|
+
if (onClickRadio && radioId) {
|
|
61
|
+
onClickRadio(radioId);
|
|
62
|
+
}
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
case 'check': {
|
|
66
|
+
if (!checkboxId) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
e.stopPropagation();
|
|
70
|
+
var checkedStatus = methods.getValues(checkboxId.toString());
|
|
71
|
+
methods.setValue(checkboxId.toString(), !checkedStatus);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
default:
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
switch (displayType) {
|
|
78
|
+
case 'ibtn_amount1':
|
|
79
|
+
case 'ibtn_text':
|
|
80
|
+
case 'none': {
|
|
81
|
+
if (onClick) {
|
|
82
|
+
onClick();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
return (react_1.default.createElement(S_BasicListItem, { displayType: displayType, selectionMode: selectionMode, isSelected: isSelected, onClick: handleClick },
|
|
88
|
+
react_1.default.createElement(S_BasicListItemBox, { imageIconMode: imageIconMode, captionText: captionText },
|
|
62
89
|
react_1.default.createElement(S_LeftBox, null,
|
|
63
|
-
selectionMode !== 'none' && (react_1.default.createElement(S_SelectionBoxWrapper, {
|
|
64
|
-
selectionMode === 'check' &&
|
|
65
|
-
selectionMode === 'radio' && radioValue && (react_1.default.createElement(Radio_1.Radio, { name:
|
|
90
|
+
selectionMode !== 'none' && (react_1.default.createElement(S_SelectionBoxWrapper, { selectionMode: selectionMode },
|
|
91
|
+
selectionMode === 'check' && checkboxId && (react_1.default.createElement(Checkbox_1.Checkbox, { name: checkboxId.toString(), state: "normal", onChange: handleCheckBoxClick })),
|
|
92
|
+
selectionMode === 'radio' && radioValue && radioId && (react_1.default.createElement(Radio_1.Radio, { name: radioId, value: radioValue, onChange: handleRadioClick, checked: radioId === radioValue })))),
|
|
66
93
|
badgeMode === 'left' && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
67
94
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_c", spacingType: "width" }),
|
|
68
95
|
react_1.default.createElement(S_Badge, { badgeStatus: badgeStatus }))),
|
|
@@ -76,23 +103,25 @@ function BasicListItem(_a) {
|
|
|
76
103
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_c", spacingType: "width" }),
|
|
77
104
|
react_1.default.createElement(S_TextBox, null,
|
|
78
105
|
react_1.default.createElement(S_TextWrapper, null,
|
|
79
|
-
react_1.default.createElement(TextLabel_1.TextLabel, { text: titleText, colorTheme: titleTextColorTheme === 'none' ? 'sysTextPrimary' : 'sysTextError', styleTheme: titleFontWeight === 'bold' ? 'body2Bold' : 'body2Regular', singleLineMode: "use", ellipsisMode: "use" })),
|
|
80
|
-
|
|
106
|
+
react_1.default.createElement(TextLabel_1.TextLabel, { text: titleText, colorTheme: titleTextColorTheme === 'none' ? 'sysTextPrimary' : 'sysTextError', styleTheme: titleFontWeight === 'bold' ? 'body2Bold' : 'body2Regular', singleLineMode: "use", ellipsisMode: "use", lineLimit: 1 })),
|
|
107
|
+
captionText && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
81
108
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_a" }),
|
|
82
109
|
react_1.default.createElement(S_TextWrapper, null,
|
|
83
|
-
react_1.default.createElement(TextLabel_1.TextLabel, { text:
|
|
110
|
+
react_1.default.createElement(TextLabel_1.TextLabel, { text: captionText, colorTheme: "sysTextSecondary", styleTheme: "caption1Regular", textAlign: "right", singleLineMode: "use", ellipsisMode: "use", lineLimit: 1 })))))),
|
|
84
111
|
react_1.default.createElement(S_RightBox, { displayType: displayType },
|
|
85
|
-
(displayType === '
|
|
86
|
-
react_1.default.createElement(
|
|
87
|
-
|
|
112
|
+
(displayType === 'text' || displayType === 'ibtn_text') && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
113
|
+
react_1.default.createElement(TextLabel_1.TextLabel, { text: descText, colorTheme: "sysTextTertiary", styleTheme: "caption1Regular", singleLineMode: "use", ellipsisMode: "use", lineLimit: 1 }),
|
|
114
|
+
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_c", spacingType: "width" }))),
|
|
115
|
+
(displayType === 'ibtn_amount1' ||
|
|
116
|
+
displayType === 'ibtn_amount2' ||
|
|
117
|
+
displayType === 'ibtn_text') && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
118
|
+
displayType === 'ibtn_amount2' && (react_1.default.createElement(S_IconWrapper, null, iBtn2IconName && (react_1.default.createElement(IconButton_1.IconButton, { iconName: iBtn2IconName, iconFillType: iBtn2IconFillType, baseSize: "medium", iconSize: 20, shapeType: "rectangle", baseColorKey: "ui_cpnt_button_fill_base_transparent", onClick: handleIBtn2Click })))),
|
|
119
|
+
react_1.default.createElement(S_IconWrapper, null, iBtn1IconName && (react_1.default.createElement(IconButton_1.IconButton, { iconName: iBtn1IconName, iconFillType: iBtn1IconFillType, baseSize: "medium", iconSize: 20, shapeType: "rectangle", baseColorKey: "ui_cpnt_button_fill_base_transparent", onClick: handleIBtn1Click }))))),
|
|
88
120
|
displayType === 'mbtn' && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
89
121
|
react_1.default.createElement(MainButton_1.MainButton, { text: mBtnText, fillType: mBtnFillType, size: "small", onClick: handleMBtnClick }),
|
|
90
122
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_c", spacingType: "width" }))),
|
|
91
123
|
displayType === 'switch' && (react_1.default.createElement(S_SwitchWrapper, null,
|
|
92
124
|
react_1.default.createElement(hybrid_1.Switch, { name: "BLI_SWITCH", onClick: handleSwitchClick }),
|
|
93
|
-
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_c", spacingType: "width" }))),
|
|
94
|
-
displayType === 'text' && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
95
|
-
react_1.default.createElement(TextLabel_1.TextLabel, { text: captionText, colorTheme: "sysTextTertiary", styleTheme: "caption1Regular", textAlign: "right", singleLineMode: "use", ellipsisMode: "use", lineLimit: 1 }),
|
|
96
125
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_c", spacingType: "width" }))))),
|
|
97
126
|
react_1.default.createElement(S_DividerWrapper, null, dividerType === 'solid' && react_1.default.createElement(hybrid_1.Divider, { direction: "horizontal", displayType: "line" }))));
|
|
98
127
|
}
|
|
@@ -100,24 +129,29 @@ var S_BasicListItem = styled_components_1.default.li(templateObject_1 || (templa
|
|
|
100
129
|
var theme = _a.theme, isSelected = _a.isSelected;
|
|
101
130
|
return isSelected ? theme.ui_cpnt_list_base_area_select : theme.ui_cpnt_list_base_area;
|
|
102
131
|
}, function (_a) {
|
|
103
|
-
var displayType = _a.displayType;
|
|
104
|
-
|
|
132
|
+
var displayType = _a.displayType, selectionMode = _a.selectionMode, onClick = _a.onClick;
|
|
133
|
+
if (displayType === 'ibtn_amount1' || displayType === 'ibtn_text' || displayType === 'none') {
|
|
134
|
+
if (onClick) {
|
|
135
|
+
return 'pointer';
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if (selectionMode === 'check' || selectionMode === 'radio') {
|
|
139
|
+
return 'pointer';
|
|
140
|
+
}
|
|
141
|
+
return 'default';
|
|
105
142
|
}, function (_a) {
|
|
106
143
|
var theme = _a.theme;
|
|
107
144
|
return "0 " + theme.spacing.spacingC;
|
|
108
145
|
});
|
|
109
146
|
var S_BasicListItemBox = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n height: ", ";\n padding: ", ";\n width: 100%;\n"], ["\n align-items: center;\n display: flex;\n height: ", ";\n padding: ", ";\n width: 100%;\n"])), function (_a) {
|
|
110
|
-
var imageIconMode = _a.imageIconMode,
|
|
111
|
-
return imageIconMode === 'image' ||
|
|
147
|
+
var imageIconMode = _a.imageIconMode, captionText = _a.captionText;
|
|
148
|
+
return imageIconMode === 'image' || captionText ? '80px' : '56px';
|
|
112
149
|
}, function (_a) {
|
|
113
150
|
var theme = _a.theme;
|
|
114
151
|
return "0 " + theme.spacing.spacingC;
|
|
115
152
|
});
|
|
116
153
|
var S_LeftBox = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n flex: 7;\n width: 100%;\n"], ["\n align-items: center;\n display: flex;\n flex: 7;\n width: 100%;\n"])));
|
|
117
|
-
var S_SelectionBoxWrapper = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n height: 40px;\n justify-content: center;\n
|
|
118
|
-
var selectionMode = _a.selectionMode, theme = _a.theme;
|
|
119
|
-
return selectionMode === 'check' && "" + theme.spacing.spacingB;
|
|
120
|
-
});
|
|
154
|
+
var S_SelectionBoxWrapper = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n height: 40px;\n justify-content: center;\n width: 40px;\n"], ["\n align-items: center;\n display: flex;\n height: 40px;\n justify-content: center;\n width: 40px;\n"])));
|
|
121
155
|
var S_IconWrapper = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n justify-content: center;\n"], ["\n align-items: center;\n display: flex;\n justify-content: center;\n"])));
|
|
122
156
|
var S_TextBox = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n justify-content: center;\n width: 100%;\n"], ["\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n justify-content: center;\n width: 100%;\n"])));
|
|
123
157
|
var S_TextWrapper = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n justify-content: center;\n"], ["\n justify-content: center;\n"])));
|
|
@@ -30,7 +30,9 @@ function Checkbox(_a) {
|
|
|
30
30
|
var isChecked = (0, react_hook_form_1.useWatch)({ name: name });
|
|
31
31
|
var handleChange = function (e) {
|
|
32
32
|
checkboxFormRegister.onChange(e);
|
|
33
|
-
|
|
33
|
+
if (onChange) {
|
|
34
|
+
onChange(e);
|
|
35
|
+
}
|
|
34
36
|
};
|
|
35
37
|
var icon = function () {
|
|
36
38
|
switch (state) {
|
|
@@ -130,7 +130,7 @@ var small = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 =
|
|
|
130
130
|
var responsiveMode = _a.responsiveMode;
|
|
131
131
|
return (responsiveMode === 'use' ? '100%' : '188px');
|
|
132
132
|
});
|
|
133
|
-
var S_Dropdown = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: inline-block;\n position: relative;\n\n ", ";\n"], ["\n display: inline-block;\n position: relative;\n\n ", ";\n"])), function (_a) {
|
|
133
|
+
var S_Dropdown = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: inline-block;\n outline: none;\n position: relative;\n\n ", ";\n"], ["\n display: inline-block;\n outline: none;\n position: relative;\n\n ", ";\n"])), function (_a) {
|
|
134
134
|
var size = _a.size;
|
|
135
135
|
return size &&
|
|
136
136
|
{
|
|
@@ -128,8 +128,8 @@ function EditApplyTextField(_a) {
|
|
|
128
128
|
react_1.default.createElement(S_EditApplyTextField, null,
|
|
129
129
|
react_1.default.createElement(S_S_TextFieldBaseWrapper, { size: size, responsiveMode: responsiveMode, textLineType: textLineType, isFocused: isFocused, isError: isError, state: state }, S_TextFieldBase()),
|
|
130
130
|
isOpen === true && (react_1.default.createElement(S_ButtonBox, null,
|
|
131
|
-
react_1.default.createElement(IconButton_1.IconButton, { iconName: "ic_xmark", fillType: "fill", baseSize: "small", iconSize: 16, shapeType: "circular", shadow: "visible", iconColorKey: "ui_cpnt_button_icon_enabled", baseColorKey: "ui_cpnt_button_fill_base_white", onMouseDown: handleCancel }),
|
|
132
|
-
react_1.default.createElement(IconButton_1.IconButton, { iconName: "ic_check", fillType: "fill", baseSize: "small", iconSize: 16, shapeType: "circular", shadow: "visible", iconColorKey: "ui_cpnt_button_icon_on_primary", baseColorKey: "ui_cpnt_button_fill_base_primary",
|
|
131
|
+
react_1.default.createElement(IconButton_1.IconButton, { iconName: "ic_xmark", fillType: "fill", baseSize: "small", iconSize: 16, shapeType: "circular", shadow: "visible", iconColorKey: "ui_cpnt_button_icon_enabled", baseColorKey: "ui_cpnt_button_fill_base_white", tabIndex: -1, onMouseDown: handleCancel }),
|
|
132
|
+
react_1.default.createElement(IconButton_1.IconButton, { iconName: "ic_check", fillType: "fill", baseSize: "small", iconSize: 16, shapeType: "circular", shadow: "visible", iconColorKey: "ui_cpnt_button_icon_on_primary", baseColorKey: "ui_cpnt_button_fill_base_primary", state: isError === true ? 'disabled' : 'normal', tabIndex: -1, onMouseDown: handleSubmit })))),
|
|
133
133
|
((_b = errors[name]) === null || _b === void 0 ? void 0 : _b.message) && (react_1.default.createElement(S_Error, { isFocused: isFocused }, t(errors[name].message))))));
|
|
134
134
|
}
|
|
135
135
|
var S_EditApplyTextFieldWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: ", ";\n"], ["\n width: ", ";\n"])), function (_a) {
|
|
@@ -14,8 +14,9 @@ export declare type IconButtonProps = {
|
|
|
14
14
|
colorTheme?: 'none' | 'line1' | 'line2';
|
|
15
15
|
type?: 'submit' | 'reset' | 'button';
|
|
16
16
|
state?: 'normal' | 'disabled';
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
tabIndex?: number;
|
|
18
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
19
|
+
onMouseDown?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
19
20
|
};
|
|
20
|
-
declare function IconButton({ fillType, shapeType, baseSize, baseColorKey, borderColorKey, iconSize, iconFillType, iconName, iconColorKey, shadow, colorTheme, type, state, onClick, onMouseDown }: IconButtonProps): JSX.Element;
|
|
21
|
+
declare function IconButton({ fillType, shapeType, baseSize, baseColorKey, borderColorKey, iconSize, iconFillType, iconName, iconColorKey, shadow, colorTheme, type, state, tabIndex, onClick, onMouseDown }: IconButtonProps): JSX.Element;
|
|
21
22
|
export default IconButton;
|
|
@@ -31,10 +31,10 @@ var styled_components_1 = __importStar(require("styled-components"));
|
|
|
31
31
|
var common_1 = require("../../../common");
|
|
32
32
|
var hybrid_1 = require("../../../hybrid");
|
|
33
33
|
function IconButton(_a) {
|
|
34
|
-
var _b = _a.fillType, fillType = _b === void 0 ? 'fill' : _b, _c = _a.shapeType, shapeType = _c === void 0 ? 'rectangle' : _c, _d = _a.baseSize, baseSize = _d === void 0 ? 'small' : _d, baseColorKey = _a.baseColorKey, borderColorKey = _a.borderColorKey, _e = _a.iconSize, iconSize = _e === void 0 ? 24 : _e, _f = _a.iconFillType, iconFillType = _f === void 0 ? 'line' : _f, iconName = _a.iconName, iconColorKey = _a.iconColorKey, _g = _a.shadow, shadow = _g === void 0 ? 'hidden' : _g, _h = _a.colorTheme, colorTheme = _h === void 0 ? 'none' : _h, _j = _a.type, type = _j === void 0 ? 'button' : _j, _k = _a.state, state = _k === void 0 ? 'normal' : _k, onClick = _a.onClick, onMouseDown = _a.onMouseDown;
|
|
35
|
-
var handleClick = function () {
|
|
34
|
+
var _b = _a.fillType, fillType = _b === void 0 ? 'fill' : _b, _c = _a.shapeType, shapeType = _c === void 0 ? 'rectangle' : _c, _d = _a.baseSize, baseSize = _d === void 0 ? 'small' : _d, baseColorKey = _a.baseColorKey, borderColorKey = _a.borderColorKey, _e = _a.iconSize, iconSize = _e === void 0 ? 24 : _e, _f = _a.iconFillType, iconFillType = _f === void 0 ? 'line' : _f, iconName = _a.iconName, iconColorKey = _a.iconColorKey, _g = _a.shadow, shadow = _g === void 0 ? 'hidden' : _g, _h = _a.colorTheme, colorTheme = _h === void 0 ? 'none' : _h, _j = _a.type, type = _j === void 0 ? 'button' : _j, _k = _a.state, state = _k === void 0 ? 'normal' : _k, tabIndex = _a.tabIndex, onClick = _a.onClick, onMouseDown = _a.onMouseDown;
|
|
35
|
+
var handleClick = function (e) {
|
|
36
36
|
if (onClick) {
|
|
37
|
-
onClick();
|
|
37
|
+
onClick(e);
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
var handleMouseDown = function (e) {
|
|
@@ -62,7 +62,7 @@ function IconButton(_a) {
|
|
|
62
62
|
}
|
|
63
63
|
return iconStateColorObj[fillType];
|
|
64
64
|
};
|
|
65
|
-
return (react_1.default.createElement(S_IconButton, { fillType: fillType, shapeType: shapeType, baseSize: baseSize, baseColorKey: baseColorKey, borderColorKey: borderColorKey, shadow: shadow, colorTheme: colorTheme, type: type, state: state, disabled: state === 'disabled', onClick: handleClick, onMouseDown: handleMouseDown },
|
|
65
|
+
return (react_1.default.createElement(S_IconButton, { fillType: fillType, shapeType: shapeType, baseSize: baseSize, baseColorKey: baseColorKey, borderColorKey: borderColorKey, shadow: shadow, colorTheme: colorTheme, type: type, state: state, disabled: state === 'disabled', tabIndex: tabIndex, onClick: handleClick, onMouseDown: handleMouseDown },
|
|
66
66
|
react_1.default.createElement(hybrid_1.Icon, { iconName: iconName, size: iconSize, colorKey: IconColorSelect(), fillType: iconFillType })));
|
|
67
67
|
}
|
|
68
68
|
var fillDisabled = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n"], ["\n background-color: ", ";\n"])), function (_a) {
|
|
@@ -174,7 +174,7 @@ function TextFieldBase(_a) {
|
|
|
174
174
|
if (textLineType === 'single') {
|
|
175
175
|
return (react_1.default.createElement(S_InputWrapper, null,
|
|
176
176
|
react_1.default.createElement(S_Input, __assign({}, register(name, validation), rest, { name: name, defaultValue: defaultText, placeholder: hintText, type: inputType, state: state, readOnly: state === 'read_only', disabled: state === 'disabled', maxLength: maxLength, textSize: textSize, textWeight: textWeight, textPadding: textPadding, colorTheme: colorTheme, min: min, max: max, onFocus: handleFocus, onChange: handleChange, onBlur: handleBlur, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, ref: ref })),
|
|
177
|
-
deleteIconMode === 'use' && isFocused && (react_1.default.createElement(IconButton_1.IconButton, { iconName: "ic_delete", baseSize: "small", shapeType: "rectangle", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconSize: deleteIconSize, iconColorKey: deleteIconColor, iconFillType: "fill", state: state === 'disabled' ? 'disabled' : 'normal', onMouseDown: deleteValue }))));
|
|
177
|
+
deleteIconMode === 'use' && isFocused && (react_1.default.createElement(IconButton_1.IconButton, { iconName: "ic_delete", baseSize: "small", shapeType: "rectangle", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconSize: deleteIconSize, iconColorKey: deleteIconColor, iconFillType: "fill", state: state === 'disabled' ? 'disabled' : 'normal', tabIndex: -1, onMouseDown: deleteValue }))));
|
|
178
178
|
}
|
|
179
179
|
if (textLineType === 'multi') {
|
|
180
180
|
return (react_1.default.createElement(S_Multi, __assign({}, register(name, validation), rest, { name: name, defaultValue: defaultText, placeholder: hintText, state: state, readOnly: state === 'read_only' && true, disabled: state === 'disabled' && true, maxLength: maxLength, rows: multiRows, textSize: textSize, textWeight: textWeight, textPadding: textPadding, colorTheme: colorTheme, onFocus: handleFocus, onChange: handleChange, onBlur: handleBlur, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, ref: ref })));
|
|
@@ -3,38 +3,22 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
4
|
return cooked;
|
|
5
5
|
};
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
6
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
7
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
8
|
};
|
|
20
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
10
|
var react_1 = __importDefault(require("react"));
|
|
22
|
-
var react_hook_form_1 = require("react-hook-form");
|
|
23
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
24
|
-
var common_1 = require("../../../common");
|
|
25
12
|
var hybrid_1 = require("../../../hybrid");
|
|
26
13
|
var TextLabel_1 = require("../TextLabel");
|
|
27
14
|
function BasicList(_a) {
|
|
28
15
|
var children = _a.children, _b = _a.titleStyleTheme, titleStyleTheme = _b === void 0 ? 'headingBold' : _b, titleText = _a.titleText, captionText = _a.captionText, _c = _a.columns, columns = _c === void 0 ? 1 : _c, _d = _a.columnSpacing, columnSpacing = _d === void 0 ? 16 : _d, _e = _a.rowSpacing, rowSpacing = _e === void 0 ? 0 : _e;
|
|
29
|
-
var methods = (0, react_hook_form_1.useForm)();
|
|
30
16
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
31
17
|
(titleText || captionText) && (react_1.default.createElement(S_TitleBox, null,
|
|
32
18
|
react_1.default.createElement(TextLabel_1.TextLabel, { text: titleText, styleTheme: titleStyleTheme }),
|
|
33
19
|
titleText && captionText && react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_a", spacingType: "height" }),
|
|
34
20
|
captionText && react_1.default.createElement(TextLabel_1.TextLabel, { text: captionText, styleTheme: "body2Regular" }))),
|
|
35
|
-
react_1.default.createElement(
|
|
36
|
-
react_1.default.createElement(common_1.Form, null,
|
|
37
|
-
react_1.default.createElement(S_BasicListWrapper, { columns: columns, columnSpacing: columnSpacing, rowSpacing: rowSpacing }, children)))));
|
|
21
|
+
react_1.default.createElement(S_BasicListWrapper, { columns: columns, columnSpacing: columnSpacing, rowSpacing: rowSpacing }, children)));
|
|
38
22
|
}
|
|
39
23
|
var S_TitleBox = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin-bottom: ", ";\n padding: ", ";\n"], ["\n margin-bottom: ", ";\n padding: ", ";\n"])), function (_a) {
|
|
40
24
|
var theme = _a.theme;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { FillIconNameKeys, LineIconNameKeys, PDSTextType } from '../../../common';
|
|
3
3
|
export declare type BasicListItemProps = {
|
|
4
4
|
selectionMode?: 'none' | 'check' | 'radio';
|
|
@@ -12,7 +12,7 @@ export declare type BasicListItemProps = {
|
|
|
12
12
|
imageSrc?: string;
|
|
13
13
|
iconName?: FillIconNameKeys | LineIconNameKeys;
|
|
14
14
|
iconFillType?: 'fill' | 'line';
|
|
15
|
-
displayType?: 'none' | 'text' | '
|
|
15
|
+
displayType?: 'none' | 'text' | 'ibtn_text' | 'ibtn_amount1' | 'ibtn_amount2' | 'mbtn' | 'switch';
|
|
16
16
|
captionText?: PDSTextType;
|
|
17
17
|
iBtn1IconName?: FillIconNameKeys | LineIconNameKeys;
|
|
18
18
|
iBtn1IconFillType?: 'fill' | 'line';
|
|
@@ -22,21 +22,23 @@ export declare type BasicListItemProps = {
|
|
|
22
22
|
mBtnText?: PDSTextType;
|
|
23
23
|
dividerType?: 'none' | 'solid';
|
|
24
24
|
titleFontWeight?: 'bold' | 'regular';
|
|
25
|
-
|
|
25
|
+
checkboxId?: number | string;
|
|
26
|
+
radioId?: string;
|
|
26
27
|
radioValue?: string;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
onClick?: () => void;
|
|
29
|
+
onClickIBtn1?: () => void;
|
|
30
|
+
onClickIBtn2?: () => void;
|
|
31
|
+
onClickMBtn?: () => void;
|
|
32
|
+
onClickRadio?: (value: string) => void;
|
|
33
|
+
onClickSwitch?: () => void;
|
|
32
34
|
};
|
|
33
35
|
export declare type StyleProps = {
|
|
34
36
|
isSelected?: boolean;
|
|
35
37
|
selectionMode?: 'none' | 'check' | 'radio';
|
|
36
|
-
|
|
38
|
+
captionText?: PDSTextType;
|
|
37
39
|
badgeStatus?: 'cancel' | 'active' | 'inactive';
|
|
38
40
|
imageIconMode?: 'none' | 'image' | 'icon';
|
|
39
|
-
displayType?: 'none' | 'text' | '
|
|
41
|
+
displayType?: 'none' | 'text' | 'ibtn_text' | 'ibtn_amount1' | 'ibtn_amount2' | 'mbtn' | 'switch';
|
|
40
42
|
};
|
|
41
|
-
declare function BasicListItem({ selectionMode, titleText, titleTextColorTheme, descText, badgeMode, badgeStatus, imageIconMode, imageShapeType, imageSrc, iconName, iconFillType, displayType, captionText, iBtn1IconName, iBtn1IconFillType, iBtn2IconName, iBtn2IconFillType, mBtnFillType, mBtnText, dividerType, titleFontWeight,
|
|
43
|
+
declare function BasicListItem({ selectionMode, titleText, titleTextColorTheme, descText, badgeMode, badgeStatus, imageIconMode, imageShapeType, imageSrc, iconName, iconFillType, displayType, captionText, iBtn1IconName, iBtn1IconFillType, iBtn2IconName, iBtn2IconFillType, mBtnFillType, mBtnText, dividerType, titleFontWeight, checkboxId, radioId, radioValue, onClick, onClickRadio, onClickSwitch, onClickIBtn1, onClickIBtn2, onClickMBtn }: BasicListItemProps): JSX.Element;
|
|
42
44
|
export default BasicListItem;
|
|
@@ -17,52 +17,79 @@ var MainButton_1 = require("../MainButton");
|
|
|
17
17
|
var Radio_1 = require("../Radio");
|
|
18
18
|
var TextLabel_1 = require("../TextLabel");
|
|
19
19
|
function BasicListItem(_a) {
|
|
20
|
-
var _b = _a.selectionMode, selectionMode = _b === void 0 ? 'none' : _b, titleText = _a.titleText, _c = _a.titleTextColorTheme, titleTextColorTheme = _c === void 0 ? 'none' : _c, descText = _a.descText, _d = _a.badgeMode, badgeMode = _d === void 0 ? 'none' : _d, _e = _a.badgeStatus, badgeStatus = _e === void 0 ? 'inactive' : _e, _f = _a.imageIconMode, imageIconMode = _f === void 0 ? 'none' : _f, _g = _a.imageShapeType, imageShapeType = _g === void 0 ? 'round' : _g, imageSrc = _a.imageSrc, iconName = _a.iconName, _h = _a.iconFillType, iconFillType = _h === void 0 ? 'line' : _h, _j = _a.displayType, displayType = _j === void 0 ? 'none' : _j, captionText = _a.captionText, iBtn1IconName = _a.iBtn1IconName, _k = _a.iBtn1IconFillType, iBtn1IconFillType = _k === void 0 ? 'line' : _k, iBtn2IconName = _a.iBtn2IconName, _l = _a.iBtn2IconFillType, iBtn2IconFillType = _l === void 0 ? 'line' : _l, _m = _a.mBtnFillType, mBtnFillType = _m === void 0 ? 'fill' : _m, mBtnText = _a.mBtnText, _o = _a.dividerType, dividerType = _o === void 0 ? 'none' : _o, _p = _a.titleFontWeight, titleFontWeight = _p === void 0 ? 'regular' : _p,
|
|
20
|
+
var _b = _a.selectionMode, selectionMode = _b === void 0 ? 'none' : _b, titleText = _a.titleText, _c = _a.titleTextColorTheme, titleTextColorTheme = _c === void 0 ? 'none' : _c, descText = _a.descText, _d = _a.badgeMode, badgeMode = _d === void 0 ? 'none' : _d, _e = _a.badgeStatus, badgeStatus = _e === void 0 ? 'inactive' : _e, _f = _a.imageIconMode, imageIconMode = _f === void 0 ? 'none' : _f, _g = _a.imageShapeType, imageShapeType = _g === void 0 ? 'round' : _g, imageSrc = _a.imageSrc, iconName = _a.iconName, _h = _a.iconFillType, iconFillType = _h === void 0 ? 'line' : _h, _j = _a.displayType, displayType = _j === void 0 ? 'none' : _j, captionText = _a.captionText, iBtn1IconName = _a.iBtn1IconName, _k = _a.iBtn1IconFillType, iBtn1IconFillType = _k === void 0 ? 'line' : _k, iBtn2IconName = _a.iBtn2IconName, _l = _a.iBtn2IconFillType, iBtn2IconFillType = _l === void 0 ? 'line' : _l, _m = _a.mBtnFillType, mBtnFillType = _m === void 0 ? 'fill' : _m, mBtnText = _a.mBtnText, _o = _a.dividerType, dividerType = _o === void 0 ? 'none' : _o, _p = _a.titleFontWeight, titleFontWeight = _p === void 0 ? 'regular' : _p, checkboxId = _a.checkboxId, radioId = _a.radioId, radioValue = _a.radioValue, onClick = _a.onClick, onClickRadio = _a.onClickRadio, onClickSwitch = _a.onClickSwitch, onClickIBtn1 = _a.onClickIBtn1, onClickIBtn2 = _a.onClickIBtn2, onClickMBtn = _a.onClickMBtn;
|
|
21
21
|
var methods = (0, react_hook_form_1.useFormContext)();
|
|
22
|
-
var isSelected =
|
|
23
|
-
var
|
|
22
|
+
var isSelected = methods === null || methods === void 0 ? void 0 : methods.watch((checkboxId === null || checkboxId === void 0 ? void 0 : checkboxId.toString()) || '');
|
|
23
|
+
var handleCheckBoxClick = function (e) {
|
|
24
24
|
e.preventDefault();
|
|
25
|
-
if (!
|
|
25
|
+
if (!checkboxId) {
|
|
26
26
|
return;
|
|
27
|
-
|
|
28
|
-
methods.
|
|
27
|
+
}
|
|
28
|
+
var checkedStatus = methods.getValues(checkboxId.toString());
|
|
29
|
+
methods.setValue(checkboxId.toString(), !checkedStatus);
|
|
30
|
+
};
|
|
31
|
+
var handleMBtnClick = function () {
|
|
32
|
+
if (onClickMBtn) {
|
|
33
|
+
onClickMBtn();
|
|
34
|
+
}
|
|
29
35
|
};
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
var handleIBtn1Click = function (e) {
|
|
37
|
+
e.stopPropagation();
|
|
38
|
+
if (onClickIBtn1) {
|
|
39
|
+
onClickIBtn1();
|
|
33
40
|
}
|
|
34
|
-
return;
|
|
35
41
|
};
|
|
36
|
-
var
|
|
37
|
-
if (
|
|
38
|
-
|
|
42
|
+
var handleIBtn2Click = function () {
|
|
43
|
+
if (onClickIBtn2) {
|
|
44
|
+
onClickIBtn2();
|
|
39
45
|
}
|
|
40
|
-
return;
|
|
41
46
|
};
|
|
42
|
-
var
|
|
43
|
-
if (
|
|
44
|
-
|
|
47
|
+
var handleSwitchClick = function () {
|
|
48
|
+
if (onClickSwitch) {
|
|
49
|
+
onClickSwitch();
|
|
45
50
|
}
|
|
46
|
-
return;
|
|
47
51
|
};
|
|
48
|
-
var
|
|
49
|
-
if (
|
|
50
|
-
|
|
52
|
+
var handleRadioClick = function (e) {
|
|
53
|
+
if (onClickRadio) {
|
|
54
|
+
onClickRadio(e.target.value);
|
|
51
55
|
}
|
|
52
|
-
return;
|
|
53
56
|
};
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
var handleClick = function (e) {
|
|
58
|
+
switch (selectionMode) {
|
|
59
|
+
case 'radio': {
|
|
60
|
+
if (onClickRadio && radioId) {
|
|
61
|
+
onClickRadio(radioId);
|
|
62
|
+
}
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
case 'check': {
|
|
66
|
+
if (!checkboxId) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
e.stopPropagation();
|
|
70
|
+
var checkedStatus = methods.getValues(checkboxId.toString());
|
|
71
|
+
methods.setValue(checkboxId.toString(), !checkedStatus);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
default:
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
switch (displayType) {
|
|
78
|
+
case 'ibtn_amount1':
|
|
79
|
+
case 'ibtn_text':
|
|
80
|
+
case 'none': {
|
|
81
|
+
if (onClick) {
|
|
82
|
+
onClick();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
57
85
|
}
|
|
58
|
-
return;
|
|
59
86
|
};
|
|
60
|
-
return (react_1.default.createElement(S_BasicListItem, { isSelected: isSelected },
|
|
61
|
-
react_1.default.createElement(S_BasicListItemBox, { imageIconMode: imageIconMode,
|
|
87
|
+
return (react_1.default.createElement(S_BasicListItem, { isSelected: isSelected, onClick: handleClick },
|
|
88
|
+
react_1.default.createElement(S_BasicListItemBox, { imageIconMode: imageIconMode, captionText: captionText },
|
|
62
89
|
react_1.default.createElement(S_LeftBox, null,
|
|
63
|
-
selectionMode !== 'none' &&
|
|
64
|
-
selectionMode === 'check' && (react_1.default.createElement(Checkbox_1.Checkbox, { name:
|
|
65
|
-
selectionMode === 'radio' && radioValue && (react_1.default.createElement(Radio_1.Radio, { name:
|
|
90
|
+
selectionMode !== 'none' && checkboxId && (react_1.default.createElement(S_SelectionBoxWrapper, { selectionMode: selectionMode },
|
|
91
|
+
selectionMode === 'check' && (react_1.default.createElement(Checkbox_1.Checkbox, { name: checkboxId.toString(), state: "normal", onChange: handleCheckBoxClick })),
|
|
92
|
+
selectionMode === 'radio' && radioValue && radioId && (react_1.default.createElement(Radio_1.Radio, { name: radioId, value: radioValue, onChange: handleRadioClick, checked: radioId === radioValue })))),
|
|
66
93
|
badgeMode === 'left' && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
67
94
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_c", spacingType: "width" }),
|
|
68
95
|
react_1.default.createElement(S_Badge, { badgeStatus: badgeStatus }))),
|
|
@@ -76,23 +103,25 @@ function BasicListItem(_a) {
|
|
|
76
103
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_c", spacingType: "width" }),
|
|
77
104
|
react_1.default.createElement(S_TextBox, null,
|
|
78
105
|
react_1.default.createElement(S_TextWrapper, null,
|
|
79
|
-
react_1.default.createElement(TextLabel_1.TextLabel, { text: titleText, colorTheme: titleTextColorTheme === 'none' ? 'sysTextPrimary' : 'sysTextError', styleTheme: titleFontWeight === 'bold' ? 'body2Bold' : 'body2Regular', singleLineMode: "use", ellipsisMode: "use" })),
|
|
80
|
-
|
|
106
|
+
react_1.default.createElement(TextLabel_1.TextLabel, { text: titleText, colorTheme: titleTextColorTheme === 'none' ? 'sysTextPrimary' : 'sysTextError', styleTheme: titleFontWeight === 'bold' ? 'body2Bold' : 'body2Regular', singleLineMode: "use", ellipsisMode: "use", lineLimit: 1 })),
|
|
107
|
+
captionText && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
81
108
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_a" }),
|
|
82
109
|
react_1.default.createElement(S_TextWrapper, null,
|
|
83
|
-
react_1.default.createElement(TextLabel_1.TextLabel, { text:
|
|
110
|
+
react_1.default.createElement(TextLabel_1.TextLabel, { text: captionText, colorTheme: "sysTextSecondary", styleTheme: "caption1Regular", textAlign: "right", singleLineMode: "use", ellipsisMode: "use", lineLimit: 1 })))))),
|
|
84
111
|
react_1.default.createElement(S_RightBox, { displayType: displayType },
|
|
85
|
-
(displayType === '
|
|
86
|
-
react_1.default.createElement(
|
|
87
|
-
|
|
112
|
+
(displayType === 'text' || displayType === 'ibtn_text') && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
113
|
+
react_1.default.createElement(TextLabel_1.TextLabel, { text: descText, colorTheme: "sysTextTertiary", styleTheme: "caption1Regular", singleLineMode: "use", ellipsisMode: "use", lineLimit: 1 }),
|
|
114
|
+
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_c", spacingType: "width" }))),
|
|
115
|
+
(displayType === 'ibtn_amount1' ||
|
|
116
|
+
displayType === 'ibtn_amount2' ||
|
|
117
|
+
displayType === 'ibtn_text') && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
118
|
+
displayType === 'ibtn_amount2' && (react_1.default.createElement(S_IconWrapper, null, iBtn2IconName && (react_1.default.createElement(IconButton_1.IconButton, { iconName: iBtn2IconName, iconFillType: iBtn2IconFillType, baseSize: "medium", iconSize: 20, shapeType: "rectangle", baseColorKey: "ui_cpnt_button_fill_base_transparent", onClick: handleIBtn2Click })))),
|
|
119
|
+
react_1.default.createElement(S_IconWrapper, null, iBtn1IconName && (react_1.default.createElement(IconButton_1.IconButton, { iconName: iBtn1IconName, iconFillType: iBtn1IconFillType, baseSize: "medium", iconSize: 20, shapeType: "rectangle", baseColorKey: "ui_cpnt_button_fill_base_transparent", onClick: handleIBtn1Click }))))),
|
|
88
120
|
displayType === 'mbtn' && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
89
|
-
react_1.default.createElement(MainButton_1.MainButton, { text: mBtnText, fillType: mBtnFillType, size: "small", onMouseDown:
|
|
121
|
+
react_1.default.createElement(MainButton_1.MainButton, { text: mBtnText, fillType: mBtnFillType, size: "small", onMouseDown: handleMBtnClick }),
|
|
90
122
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_c", spacingType: "width" }))),
|
|
91
123
|
displayType === 'switch' && (react_1.default.createElement(S_SwitchWrapper, null,
|
|
92
|
-
react_1.default.createElement(hybrid_1.Switch, { name: "BLI_SWITCH", onClick:
|
|
93
|
-
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_c", spacingType: "width" }))),
|
|
94
|
-
displayType === 'text' && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
95
|
-
react_1.default.createElement(TextLabel_1.TextLabel, { text: captionText, colorTheme: "sysTextTertiary", styleTheme: "caption1Regular", textAlign: "right", singleLineMode: "use", ellipsisMode: "use", lineLimit: 1 }),
|
|
124
|
+
react_1.default.createElement(hybrid_1.Switch, { name: "BLI_SWITCH", onClick: handleSwitchClick }),
|
|
96
125
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_c", spacingType: "width" }))))),
|
|
97
126
|
react_1.default.createElement(S_DividerWrapper, null, dividerType === 'solid' && react_1.default.createElement(hybrid_1.Divider, { direction: "horizontal", displayType: "line" }))));
|
|
98
127
|
}
|
|
@@ -104,17 +133,14 @@ var S_BasicListItem = styled_components_1.default.li(templateObject_1 || (templa
|
|
|
104
133
|
return "0 " + theme.spacing.spacingC;
|
|
105
134
|
});
|
|
106
135
|
var S_BasicListItemBox = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n height: ", ";\n padding: ", ";\n width: 100%;\n"], ["\n align-items: center;\n display: flex;\n height: ", ";\n padding: ", ";\n width: 100%;\n"])), function (_a) {
|
|
107
|
-
var imageIconMode = _a.imageIconMode,
|
|
108
|
-
return imageIconMode === 'image' ||
|
|
136
|
+
var imageIconMode = _a.imageIconMode, captionText = _a.captionText;
|
|
137
|
+
return imageIconMode === 'image' || captionText ? '80px' : '56px';
|
|
109
138
|
}, function (_a) {
|
|
110
139
|
var theme = _a.theme;
|
|
111
140
|
return "0 " + theme.spacing.spacingC;
|
|
112
141
|
});
|
|
113
142
|
var S_LeftBox = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n flex: 7;\n width: 100%;\n"], ["\n align-items: center;\n display: flex;\n flex: 7;\n width: 100%;\n"])));
|
|
114
|
-
var S_SelectionBoxWrapper = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n height: 40px;\n justify-content: center;\n
|
|
115
|
-
var selectionMode = _a.selectionMode, theme = _a.theme;
|
|
116
|
-
return selectionMode === 'check' && "" + theme.spacing.spacingB;
|
|
117
|
-
});
|
|
143
|
+
var S_SelectionBoxWrapper = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n height: 40px;\n justify-content: center;\n width: 40px;\n"], ["\n align-items: center;\n display: flex;\n height: 40px;\n justify-content: center;\n width: 40px;\n"])));
|
|
118
144
|
var S_IconWrapper = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n justify-content: center;\n"], ["\n align-items: center;\n display: flex;\n justify-content: center;\n"])));
|
|
119
145
|
var S_TextBox = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n justify-content: center;\n width: 100%;\n"], ["\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n justify-content: center;\n width: 100%;\n"])));
|
|
120
146
|
var S_TextWrapper = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n justify-content: center;\n"], ["\n justify-content: center;\n"])));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { Path } from 'react-hook-form';
|
|
3
3
|
import { IFormValues, PDSTextType } from '../../../common';
|
|
4
4
|
declare type CheckboxProps = {
|
|
@@ -6,6 +6,7 @@ declare type CheckboxProps = {
|
|
|
6
6
|
fontWeight?: 'bold' | 'regular';
|
|
7
7
|
state?: 'normal' | 'disabled';
|
|
8
8
|
name: Path<IFormValues>;
|
|
9
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
9
10
|
};
|
|
10
|
-
declare function Checkbox({ text, fontWeight, state, name }: CheckboxProps): JSX.Element;
|
|
11
|
+
declare function Checkbox({ text, fontWeight, state, name, onChange }: CheckboxProps): JSX.Element;
|
|
11
12
|
export default Checkbox;
|
|
@@ -24,10 +24,16 @@ var styled_components_1 = __importDefault(require("styled-components"));
|
|
|
24
24
|
var hybrid_1 = require("../../../hybrid");
|
|
25
25
|
var TextLabel_1 = require("../TextLabel");
|
|
26
26
|
function Checkbox(_a) {
|
|
27
|
-
var text = _a.text, _b = _a.fontWeight, fontWeight = _b === void 0 ? 'regular' : _b, _c = _a.state, state = _c === void 0 ? 'normal' : _c, name = _a.name;
|
|
27
|
+
var text = _a.text, _b = _a.fontWeight, fontWeight = _b === void 0 ? 'regular' : _b, _c = _a.state, state = _c === void 0 ? 'normal' : _c, name = _a.name, onChange = _a.onChange;
|
|
28
28
|
var register = (0, react_hook_form_1.useFormContext)().register;
|
|
29
29
|
var checkboxFormRegister = register(name);
|
|
30
30
|
var isChecked = (0, react_hook_form_1.useWatch)({ name: name });
|
|
31
|
+
var handleChange = function (e) {
|
|
32
|
+
checkboxFormRegister.onChange(e);
|
|
33
|
+
if (onChange) {
|
|
34
|
+
onChange(e);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
31
37
|
var icon = function () {
|
|
32
38
|
switch (state) {
|
|
33
39
|
case 'normal': {
|
|
@@ -48,10 +54,10 @@ function Checkbox(_a) {
|
|
|
48
54
|
react_1.default.createElement(TextLabel_1.TextLabel, { text: text, styleTheme: fontWeight === 'regular' ? 'body2Regular' : 'body2Bold', colorOverride: state === 'normal'
|
|
49
55
|
? 'ui_cpnt_selcontrols_text_default'
|
|
50
56
|
: 'ui_cpnt_selcontrols_text_disabled' }))),
|
|
51
|
-
react_1.default.createElement("input", __assign({ hidden: true, type: "checkbox" }, checkboxFormRegister, { id: name, disabled: state === 'disabled' })))));
|
|
57
|
+
react_1.default.createElement("input", __assign({ hidden: true, type: "checkbox" }, checkboxFormRegister, { id: name, disabled: state === 'disabled', onChange: handleChange })))));
|
|
52
58
|
}
|
|
53
|
-
var S_Checkbox = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 24px;\n"], ["\n height: 24px;\n"])));
|
|
54
|
-
var S_Label = styled_components_1.default.label(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n align-items: center;\n
|
|
59
|
+
var S_Checkbox = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n height: 24px;\n"], ["\n align-items: center;\n display: flex;\n height: 24px;\n"])));
|
|
60
|
+
var S_Label = styled_components_1.default.label(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n"], ["\n align-items: center;\n display: flex;\n"])));
|
|
55
61
|
var S_OverrideIconWrapper = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n position: relative;\n"], ["\n align-items: center;\n display: flex;\n position: relative;\n"])));
|
|
56
62
|
var S_OverrideIcon = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n left: 0;\n position: absolute;\n top: 0;\n"], ["\n left: 0;\n position: absolute;\n top: 0;\n"])));
|
|
57
63
|
var S_TextWrapper = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n padding-left: ", ";\n"], ["\n padding-left: ", ";\n"])), function (_a) {
|
|
@@ -121,7 +121,7 @@ var small = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 =
|
|
|
121
121
|
var responsiveMode = _a.responsiveMode;
|
|
122
122
|
return (responsiveMode === 'use' ? '100%' : '188px');
|
|
123
123
|
});
|
|
124
|
-
var S_Dropdown = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: inline-block;\n position: relative;\n\n ", ";\n"], ["\n display: inline-block;\n position: relative;\n\n ", ";\n"])), function (_a) {
|
|
124
|
+
var S_Dropdown = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: inline-block;\n outline: none;\n position: relative;\n\n ", ";\n"], ["\n display: inline-block;\n outline: none;\n position: relative;\n\n ", ";\n"])), function (_a) {
|
|
125
125
|
var size = _a.size;
|
|
126
126
|
return size &&
|
|
127
127
|
{
|
|
@@ -14,8 +14,9 @@ export declare type IconButtonProps = {
|
|
|
14
14
|
colorTheme?: 'none' | 'line1' | 'line2';
|
|
15
15
|
type?: 'submit' | 'reset' | 'button';
|
|
16
16
|
state?: 'normal' | 'disabled';
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
tabIndex?: number;
|
|
18
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
19
|
+
onMouseDown?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
19
20
|
};
|
|
20
|
-
declare function IconButton({ fillType, shapeType, baseSize, baseColorKey, borderColorKey, iconSize, iconFillType, iconName, iconColorKey, shadow, colorTheme, type, state, onClick, onMouseDown }: IconButtonProps): JSX.Element;
|
|
21
|
+
declare function IconButton({ fillType, shapeType, baseSize, baseColorKey, borderColorKey, iconSize, iconFillType, iconName, iconColorKey, shadow, colorTheme, type, state, tabIndex, onClick, onMouseDown }: IconButtonProps): JSX.Element;
|
|
21
22
|
export default IconButton;
|
|
@@ -31,10 +31,10 @@ var styled_components_1 = __importStar(require("styled-components"));
|
|
|
31
31
|
var ui_colors_1 = require("../../../common/styles/ui-colors");
|
|
32
32
|
var hybrid_1 = require("../../../hybrid");
|
|
33
33
|
function IconButton(_a) {
|
|
34
|
-
var _b = _a.fillType, fillType = _b === void 0 ? 'fill' : _b, _c = _a.shapeType, shapeType = _c === void 0 ? 'rectangle' : _c, _d = _a.baseSize, baseSize = _d === void 0 ? 'small' : _d, baseColorKey = _a.baseColorKey, borderColorKey = _a.borderColorKey, _e = _a.iconSize, iconSize = _e === void 0 ? 24 : _e, _f = _a.iconFillType, iconFillType = _f === void 0 ? 'line' : _f, iconName = _a.iconName, iconColorKey = _a.iconColorKey, _g = _a.shadow, shadow = _g === void 0 ? 'hidden' : _g, _h = _a.colorTheme, colorTheme = _h === void 0 ? 'none' : _h, _j = _a.type, type = _j === void 0 ? 'button' : _j, _k = _a.state, state = _k === void 0 ? 'normal' : _k, onClick = _a.onClick, onMouseDown = _a.onMouseDown;
|
|
35
|
-
var handleClick = function () {
|
|
34
|
+
var _b = _a.fillType, fillType = _b === void 0 ? 'fill' : _b, _c = _a.shapeType, shapeType = _c === void 0 ? 'rectangle' : _c, _d = _a.baseSize, baseSize = _d === void 0 ? 'small' : _d, baseColorKey = _a.baseColorKey, borderColorKey = _a.borderColorKey, _e = _a.iconSize, iconSize = _e === void 0 ? 24 : _e, _f = _a.iconFillType, iconFillType = _f === void 0 ? 'line' : _f, iconName = _a.iconName, iconColorKey = _a.iconColorKey, _g = _a.shadow, shadow = _g === void 0 ? 'hidden' : _g, _h = _a.colorTheme, colorTheme = _h === void 0 ? 'none' : _h, _j = _a.type, type = _j === void 0 ? 'button' : _j, _k = _a.state, state = _k === void 0 ? 'normal' : _k, tabIndex = _a.tabIndex, onClick = _a.onClick, onMouseDown = _a.onMouseDown;
|
|
35
|
+
var handleClick = function (e) {
|
|
36
36
|
if (onClick) {
|
|
37
|
-
onClick();
|
|
37
|
+
onClick(e);
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
var handleMouseDown = function (e) {
|
|
@@ -62,7 +62,7 @@ function IconButton(_a) {
|
|
|
62
62
|
}
|
|
63
63
|
return iconStateColorObj[fillType];
|
|
64
64
|
};
|
|
65
|
-
return (react_1.default.createElement(S_IconButton, { fillType: fillType, shapeType: shapeType, baseSize: baseSize, baseColorKey: baseColorKey, borderColorKey: borderColorKey, shadow: shadow, colorTheme: colorTheme, type: type, state: state, disabled: state === 'disabled', onClick: handleClick, onMouseDown: handleMouseDown },
|
|
65
|
+
return (react_1.default.createElement(S_IconButton, { fillType: fillType, shapeType: shapeType, baseSize: baseSize, baseColorKey: baseColorKey, borderColorKey: borderColorKey, shadow: shadow, colorTheme: colorTheme, type: type, state: state, disabled: state === 'disabled', tabIndex: tabIndex, onClick: handleClick, onMouseDown: handleMouseDown },
|
|
66
66
|
react_1.default.createElement(hybrid_1.Icon, { iconName: iconName, size: iconSize, colorKey: IconColorSelect(), fillType: iconFillType })));
|
|
67
67
|
}
|
|
68
68
|
var fillDisabled = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n"], ["\n background-color: ", ";\n"])), function (_a) {
|
|
@@ -130,10 +130,7 @@ var line2ColorTheme = (0, styled_components_1.css)(templateObject_11 || (templat
|
|
|
130
130
|
var theme = _a.theme;
|
|
131
131
|
return theme.ui_cpnt_button_line_border_primary;
|
|
132
132
|
});
|
|
133
|
-
var iconButtonStyle = (0, styled_components_1.css)(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n align-items: center;\n background-color: transparent;\n border: 1px solid transparent;\n
|
|
134
|
-
var state = _a.state;
|
|
135
|
-
return (state === 'normal' ? 'pointer' : 'default');
|
|
136
|
-
}, function (_a) {
|
|
133
|
+
var iconButtonStyle = (0, styled_components_1.css)(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n align-items: center;\n background-color: transparent;\n border: 1px solid transparent;\n display: flex;\n justify-content: center;\n ", ";\n ", ";\n ", ";\n ", ";\n"], ["\n align-items: center;\n background-color: transparent;\n border: 1px solid transparent;\n display: flex;\n justify-content: center;\n ", ";\n ", ";\n ", ";\n ", ";\n"])), function (_a) {
|
|
137
134
|
var shapeType = _a.shapeType;
|
|
138
135
|
return shapeType && { circular: 'border-radius: 50%', rectangle: '' }[shapeType];
|
|
139
136
|
}, function (_a) {
|
package/package.json
CHANGED
package/release-note.md
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
# PDS-DEV-KIT-WEB Release Notes
|
|
2
|
-
## [v1.3.
|
|
3
|
-
|
|
4
|
-
### Layout
|
|
5
|
-
* WTN_3 추가
|
|
6
|
-
* WTS_1 추가
|
|
2
|
+
## [v1.3.21]
|
|
7
3
|
|
|
8
4
|
### Component
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*
|
|
5
|
+
* Common
|
|
6
|
+
* TextFieldBase
|
|
7
|
+
* 내부 IconButton에 tabIndex={-1} 추가
|
|
8
|
+
* EditApplyTextField
|
|
9
|
+
* 내부 IconButton에 tabIndex={-1} 추가
|
|
10
|
+
* IconButton
|
|
11
|
+
* tabIndex prop 추가
|
|
12
|
+
* onClick과 onMouseDown의 type 수정
|