pds-dev-kit-web 1.3.4 → 1.3.7
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/index.d.ts +2 -2
- package/dist/src/common/assets/icons/line/DesignPreference.d.ts +4 -0
- package/dist/src/common/assets/icons/line/DesignPreference.js +38 -0
- package/dist/src/common/assets/icons/line/index.d.ts +1 -0
- package/dist/src/common/assets/icons/line/index.js +2 -0
- package/dist/src/common/index.d.ts +2 -2
- package/dist/src/common/styles/colorSet/PaletteColor_Dark.json +10 -2
- package/dist/src/common/styles/colorSet/PaletteColor_light.json +10 -2
- package/dist/src/common/styles/colorSet/UIColor.json +10 -2
- package/dist/src/common/styles/colorSet/index.d.ts +367 -343
- package/dist/src/common/styles/colorSet/index.js +5 -5
- package/dist/src/common/styles/colorSet/ui-type.d.ts +8 -0
- package/dist/src/common/types/comopnents.d.ts +5 -0
- package/dist/src/common/types/comopnents.js +2 -0
- package/dist/src/common/types/index.d.ts +1 -0
- package/dist/src/common/types/index.js +1 -0
- package/dist/src/desktop/components/AdminList/AdminList.d.ts +12 -12
- package/dist/src/desktop/components/AdminList/AdminList.js +14 -57
- package/dist/src/desktop/components/AdminList/BulkActionBar.d.ts +10 -10
- package/dist/src/desktop/components/AdminList/BulkActionBar.js +6 -6
- package/dist/src/desktop/components/AdminList/HeaderRow.js +5 -9
- package/dist/src/desktop/components/AdminListHeader/AdminListHeader.d.ts +5 -4
- package/dist/src/desktop/components/AdminListHeader/AdminListHeader.js +22 -8
- package/dist/src/desktop/components/AdminListHeader/HeaderBar.d.ts +4 -5
- package/dist/src/desktop/components/AdminListHeader/HeaderBar.js +3 -3
- package/dist/src/desktop/components/AdminListItem/AdminListItem.js +28 -23
- package/dist/src/desktop/components/Chip/Chip.d.ts +9 -5
- package/dist/src/desktop/components/Chip/Chip.js +45 -18
- package/dist/src/desktop/components/ContextMenuItem/ContextMenuItem.d.ts +8 -5
- package/dist/src/desktop/components/ContextMenuItem/ContextMenuItem.js +8 -3
- package/dist/src/desktop/components/DesktopHeaderBar/DesktopHeaderBar.d.ts +13 -30
- package/dist/src/desktop/components/DesktopHeaderBar/DesktopHeaderBar.js +70 -18
- package/dist/src/desktop/components/DesktopTabBar/DesktopTabBar.js +23 -19
- package/dist/src/desktop/components/Dropdown/Dropdown.d.ts +4 -7
- package/dist/src/desktop/components/Dropdown/Dropdown.js +9 -4
- package/dist/src/desktop/components/EditApplyTextField/EditApplyTextField.js +5 -2
- package/dist/src/desktop/components/FilterBar/FilterBar.d.ts +8 -10
- package/dist/src/desktop/components/FilterBar/FilterBar.js +9 -17
- package/dist/src/desktop/components/UserDesktopNavBar/UserDesktopNavBar.d.ts +2 -7
- package/dist/src/desktop/components/UserDesktopNavBar/UserDesktopNavBar.js +4 -4
- package/dist/src/desktop/layout/LayoutWF/LayoutWF.js +1 -1
- package/dist/src/desktop/layout/LayoutWS/LayoutWS.js +1 -1
- package/dist/src/desktop/layout/LayoutWT/LayoutWT.js +1 -1
- package/dist/src/mobile/components/Chip/Chip.d.ts +9 -5
- package/dist/src/mobile/components/Chip/Chip.js +52 -28
- package/dist/src/mobile/components/ContextMenuItem/ContextMenuItem.d.ts +8 -5
- package/dist/src/mobile/components/ContextMenuItem/ContextMenuItem.js +8 -3
- package/dist/src/mobile/components/Dropdown/Dropdown.d.ts +6 -8
- package/dist/src/mobile/components/Dropdown/Dropdown.js +9 -4
- package/package.json +1 -1
- package/release-note.md +15 -2
|
@@ -3,22 +3,51 @@ 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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
6
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
27
|
};
|
|
9
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
var react_1 =
|
|
29
|
+
var react_1 = __importStar(require("react"));
|
|
11
30
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
31
|
var Icon_1 = require("../../../hybrid/components/Icon");
|
|
13
32
|
var TextLabel_1 = require("../TextLabel");
|
|
14
33
|
function Chip(_a) {
|
|
15
|
-
var _b = _a.displayType, displayType = _b === void 0 ? 'filter_single' : _b,
|
|
16
|
-
var
|
|
34
|
+
var _b = _a.displayType, displayType = _b === void 0 ? 'filter_single' : _b, _c = _a.filterIconMode, filterIconMode = _c === void 0 ? 'none' : _c, _d = _a.iconFillType, iconFillType = _d === void 0 ? 'line' : _d, iconName = _a.iconName, text = _a.text, value = _a.value, id = _a.id, activeChipId = _a.activeChipId, chipId = _a.chipId, onClickChip = _a.onClickChip, onClickXMarkIcon = _a.onClickXMarkIcon;
|
|
35
|
+
var isActive = (0, react_1.useMemo)(function () {
|
|
36
|
+
if (activeChipId !== undefined && chipId !== undefined) {
|
|
37
|
+
return activeChipId === chipId;
|
|
38
|
+
}
|
|
39
|
+
if (value !== undefined && id !== undefined) {
|
|
40
|
+
return value === id;
|
|
41
|
+
}
|
|
42
|
+
return false;
|
|
43
|
+
}, [activeChipId, chipId, value, id]);
|
|
44
|
+
var handleClickChip = function () {
|
|
17
45
|
if (onClickChip) {
|
|
18
46
|
onClickChip();
|
|
19
47
|
}
|
|
20
48
|
};
|
|
21
|
-
var handleClickXMarkIcon = function () {
|
|
49
|
+
var handleClickXMarkIcon = function (e) {
|
|
50
|
+
e.stopPropagation();
|
|
22
51
|
if (onClickXMarkIcon) {
|
|
23
52
|
onClickXMarkIcon();
|
|
24
53
|
}
|
|
@@ -26,39 +55,37 @@ function Chip(_a) {
|
|
|
26
55
|
var chipType = function () {
|
|
27
56
|
switch (displayType) {
|
|
28
57
|
case 'category_choice':
|
|
29
|
-
return (react_1.default.createElement(S_CategoryChoiceChip, { isActive:
|
|
30
|
-
|
|
58
|
+
return (react_1.default.createElement(S_CategoryChoiceChip, { isActive: isActive, onClick: handleClickChip },
|
|
59
|
+
!isActive && (react_1.default.createElement(S_CategoryIconWrapper, { isActive: isActive },
|
|
31
60
|
react_1.default.createElement(Icon_1.Icon, { size: 16, fillType: "line", iconName: "ic_filter", colorKey: "ui_cpnt_chip_line_icon_01" }))),
|
|
32
|
-
react_1.default.createElement(TextLabel_1.TextLabel, { text: text, styleTheme: "caption1Regular", singleLineMode: "use", colorTheme:
|
|
33
|
-
|
|
61
|
+
react_1.default.createElement(TextLabel_1.TextLabel, { text: text, styleTheme: "caption1Regular", singleLineMode: "use", colorTheme: isActive ? 'usrTextBrandOnPrimary' : 'sysTextPrimary' }),
|
|
62
|
+
isActive && (react_1.default.createElement(S_CategoryIconWrapper, { isActive: isActive },
|
|
34
63
|
react_1.default.createElement(Icon_1.Icon, { size: 12, fillType: "line", iconName: "ic_xmark", colorKey: "ui_cpnt_chip_fill_icon_active_01" })))));
|
|
35
64
|
case 'information':
|
|
36
|
-
return (react_1.default.createElement(S_InfoChip, { onClick:
|
|
65
|
+
return (react_1.default.createElement(S_InfoChip, { onClick: handleClickChip },
|
|
37
66
|
react_1.default.createElement(TextLabel_1.TextLabel, { text: text, styleTheme: "caption2Regular", singleLineMode: "use", colorTheme: "sysTextPrimary" })));
|
|
38
67
|
case 'label':
|
|
39
|
-
return (react_1.default.createElement(S_LabelChip, { onClick:
|
|
68
|
+
return (react_1.default.createElement(S_LabelChip, { onClick: handleClickChip },
|
|
40
69
|
react_1.default.createElement(TextLabel_1.TextLabel, { text: text, styleTheme: "caption2Bold", singleLineMode: "use", colorTheme: "sysTextTertiary" })));
|
|
41
70
|
case 'time':
|
|
42
|
-
return (react_1.default.createElement(S_TimeChip, { onClick:
|
|
71
|
+
return (react_1.default.createElement(S_TimeChip, { onClick: handleClickChip },
|
|
43
72
|
react_1.default.createElement(TextLabel_1.TextLabel, { text: text, styleTheme: "caption2Bold", singleLineMode: "use", colorTheme: "sysTextWhite" })));
|
|
44
73
|
case 'removable':
|
|
45
|
-
return (react_1.default.createElement(S_RemovableChip, { onClick:
|
|
74
|
+
return (react_1.default.createElement(S_RemovableChip, { onClick: handleClickChip },
|
|
46
75
|
react_1.default.createElement(TextLabel_1.TextLabel, { text: text, styleTheme: "caption1Regular", singleLineMode: "use", colorTheme: "sysTextSecondary" }),
|
|
47
76
|
react_1.default.createElement(S_XIconWrapper, { onClick: handleClickXMarkIcon },
|
|
48
77
|
react_1.default.createElement(Icon_1.Icon, { size: 12, iconName: "ic_xmark", fillType: "line", colorKey: "ui_cpnt_chip_fill_icon_inactive" }))));
|
|
49
78
|
default:
|
|
50
|
-
return (react_1.default.createElement(S_FilterSingleChip, { isActive:
|
|
79
|
+
return (react_1.default.createElement(S_FilterSingleChip, { isActive: isActive, onClick: handleClickChip },
|
|
51
80
|
filterIconMode === 'left' && (react_1.default.createElement(S_FilterIconWrapper, null,
|
|
52
|
-
react_1.default.createElement(Icon_1.Icon, { fillType: iconFillType, iconName: iconName, size: 16, colorKey:
|
|
53
|
-
|
|
54
|
-
: 'ui_cpnt_chip_line_icon_02' }))),
|
|
55
|
-
react_1.default.createElement(TextLabel_1.TextLabel, { text: text, styleTheme: "caption1Regular", singleLineMode: "use", colorTheme: chipId === activeChipId ? 'usrTextBrandOnPrimary' : 'sysTextSecondary' })));
|
|
81
|
+
react_1.default.createElement(Icon_1.Icon, { fillType: iconFillType, iconName: iconName, size: 16, colorKey: isActive ? 'ui_cpnt_chip_fill_icon_active_01' : 'ui_cpnt_chip_line_icon_02' }))),
|
|
82
|
+
react_1.default.createElement(TextLabel_1.TextLabel, { text: text, styleTheme: "caption1Regular", singleLineMode: "use", colorTheme: isActive ? 'usrTextBrandOnPrimary' : 'sysTextSecondary' })));
|
|
56
83
|
}
|
|
57
84
|
};
|
|
58
85
|
return react_1.default.createElement(S_ChipWrapper, null, chipType());
|
|
59
86
|
}
|
|
60
87
|
exports.default = Chip;
|
|
61
|
-
var S_CategoryChoiceChip = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-radius: 16px;\n box-sizing: border-box;\n background-color: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n height: 32px;\n padding-left: ", ";\n padding-right: ", ";\n gap: 4px;\n cursor: pointer;\n
|
|
88
|
+
var S_CategoryChoiceChip = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-radius: 16px;\n box-sizing: border-box;\n background-color: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n height: 32px;\n padding-left: ", ";\n padding-right: ", ";\n gap: 4px;\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n }\n ", ";\n"], ["\n border-radius: 16px;\n box-sizing: border-box;\n background-color: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n height: 32px;\n padding-left: ", ";\n padding-right: ", ";\n gap: 4px;\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n }\n ", ";\n"])), function (_a) {
|
|
62
89
|
var theme = _a.theme, isActive = _a.isActive;
|
|
63
90
|
return isActive ? theme.ui_cpnt_chip_fill_base_active_01 : '';
|
|
64
91
|
}, function (_a) {
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { PDSTextType } from '../../../common';
|
|
2
|
+
import { PDSTextType, PDSValueOption } from '../../../common';
|
|
3
3
|
export declare type ContextMenuItemProps = {
|
|
4
|
-
|
|
4
|
+
option?: PDSValueOption;
|
|
5
5
|
size?: 'large' | 'medium' | 'small';
|
|
6
|
-
value: string | number | boolean;
|
|
7
6
|
isSelected?: boolean;
|
|
8
|
-
onClick
|
|
7
|
+
onClick?: (value: PDSValueOption | string | number | boolean) => void;
|
|
8
|
+
/** @deprecated option 필드를 대신 사용하세요. */
|
|
9
|
+
text?: PDSTextType;
|
|
10
|
+
/** @deprecated option 필드를 대신 사용하세요. */
|
|
11
|
+
value?: string | number | boolean;
|
|
9
12
|
};
|
|
10
|
-
declare function ContextMenuItem({
|
|
13
|
+
declare function ContextMenuItem({ option, size, isSelected, onClick, text, value }: ContextMenuItemProps): JSX.Element;
|
|
11
14
|
export default ContextMenuItem;
|
|
@@ -30,12 +30,17 @@ var react_1 = __importDefault(require("react"));
|
|
|
30
30
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
31
31
|
var TextLabel_1 = require("../TextLabel");
|
|
32
32
|
function ContextMenuItem(_a) {
|
|
33
|
-
var
|
|
33
|
+
var option = _a.option, _b = _a.size, size = _b === void 0 ? 'small' : _b, _c = _a.isSelected, isSelected = _c === void 0 ? false : _c, onClick = _a.onClick, text = _a.text, value = _a.value;
|
|
34
34
|
var handleClick = function () {
|
|
35
|
-
onClick
|
|
35
|
+
if (onClick && option) {
|
|
36
|
+
onClick(option);
|
|
37
|
+
}
|
|
38
|
+
if (onClick && value) {
|
|
39
|
+
onClick(value);
|
|
40
|
+
}
|
|
36
41
|
};
|
|
37
42
|
return (react_1.default.createElement(S_ContextMenuItem, { size: size, onClick: handleClick, selected: isSelected },
|
|
38
|
-
react_1.default.createElement(TextLabel_1.TextLabel, { text: text, styleTheme: "form2Regular", singleLineMode: "use" })));
|
|
43
|
+
react_1.default.createElement(TextLabel_1.TextLabel, { text: (option === null || option === void 0 ? void 0 : option.text) || text, styleTheme: "form2Regular", singleLineMode: "use" })));
|
|
39
44
|
}
|
|
40
45
|
var large = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 48px;\n padding: 0 ", ";\n"], ["\n height: 48px;\n padding: 0 ", ";\n"])), function (_a) {
|
|
41
46
|
var theme = _a.theme;
|
|
@@ -1,39 +1,22 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FillIconNameKeys, LineIconNameKeys, PDSTextType } from '../../../common';
|
|
3
|
-
declare
|
|
4
|
-
size: "large" | "xlarge";
|
|
5
|
-
leftDisplayType: "text" | "icon" | "back";
|
|
6
|
-
rightBtnMode: "none" | "close" | "mbtn";
|
|
7
|
-
dividerType: "none" | "solid";
|
|
8
|
-
};
|
|
9
|
-
declare type DefaultProps = Readonly<typeof defaultProps>;
|
|
10
|
-
declare type OptionalProps = {
|
|
3
|
+
declare type DesktopHeaderBarProps = {
|
|
11
4
|
text?: PDSTextType;
|
|
5
|
+
size?: 'xlarge' | 'large';
|
|
6
|
+
leftDisplayType?: 'text' | 'icon' | 'back';
|
|
12
7
|
iconName?: FillIconNameKeys | LineIconNameKeys;
|
|
8
|
+
rightBtnMode?: 'none' | 'close' | 'mbtn' | 'mbtn_fill' | 'help_window';
|
|
9
|
+
rightBtn2Mode?: 'none' | 'mbtn' | 'mbtn_fill' | 'help_window';
|
|
10
|
+
rightBtn3Mode?: 'none' | 'help_window';
|
|
13
11
|
mBtnText?: PDSTextType;
|
|
12
|
+
mBtn2Text?: PDSTextType;
|
|
13
|
+
mBtnState?: 'normal' | 'disabled';
|
|
14
|
+
mBtn2State?: 'normal' | 'disabled';
|
|
15
|
+
dividerType?: 'none' | 'solid';
|
|
14
16
|
onClickLeftBtn?: () => void;
|
|
15
17
|
onClickRightBtn?: () => void;
|
|
18
|
+
onClickRightBtn2?: () => void;
|
|
19
|
+
onClickRightBtn3?: () => void;
|
|
16
20
|
};
|
|
17
|
-
declare
|
|
18
|
-
[P in keyof Required<T>]: Pick<T, P> extends Required<Pick<T, P>> ? T[P] : T[P] | undefined;
|
|
19
|
-
};
|
|
20
|
-
declare type TextType = {
|
|
21
|
-
leftDisplayType: 'text';
|
|
22
|
-
text: PDSTextType;
|
|
23
|
-
};
|
|
24
|
-
declare type IconType = {
|
|
25
|
-
leftDisplayType: 'icon';
|
|
26
|
-
} & Complete<Pick<OptionalProps, 'iconName'>>;
|
|
27
|
-
declare type BackType = {
|
|
28
|
-
leftDisplayType: 'back';
|
|
29
|
-
} & Complete<Pick<OptionalProps, 'onClickLeftBtn'>>;
|
|
30
|
-
declare type CloseType = {
|
|
31
|
-
rightBtnMode: 'close';
|
|
32
|
-
} & Complete<Pick<OptionalProps, 'onClickRightBtn'>>;
|
|
33
|
-
declare type MBtnType = {
|
|
34
|
-
rightBtnMode: 'mbtn';
|
|
35
|
-
mBtnText: PDSTextType;
|
|
36
|
-
} & Complete<Pick<OptionalProps, 'onClickRightBtn'>>;
|
|
37
|
-
declare type DesktopHeaderBarProps = OptionalProps & (TextType | IconType | BackType | CloseType | MBtnType) & Partial<DefaultProps>;
|
|
38
|
-
declare function DesktopHeaderBar({ text, size, leftDisplayType, iconName, rightBtnMode, mBtnText, dividerType, onClickLeftBtn, onClickRightBtn }: DesktopHeaderBarProps): JSX.Element;
|
|
21
|
+
declare function DesktopHeaderBar({ text, size, leftDisplayType, iconName, rightBtnMode, rightBtn2Mode, rightBtn3Mode, mBtnText, mBtn2Text, mBtnState, mBtn2State, dividerType, onClickLeftBtn, onClickRightBtn, onClickRightBtn2, onClickRightBtn3 }: DesktopHeaderBarProps): JSX.Element;
|
|
39
22
|
export default DesktopHeaderBar;
|
|
@@ -13,14 +13,12 @@ var hybrid_1 = require("../../../hybrid");
|
|
|
13
13
|
var IconButton_1 = require("../IconButton");
|
|
14
14
|
var MainButton_1 = require("../MainButton");
|
|
15
15
|
var TextLabel_1 = require("../TextLabel");
|
|
16
|
-
var defaultProps = {
|
|
17
|
-
size: 'xlarge',
|
|
18
|
-
leftDisplayType: 'text',
|
|
19
|
-
rightBtnMode: 'none',
|
|
20
|
-
dividerType: 'none'
|
|
21
|
-
};
|
|
22
16
|
function DesktopHeaderBar(_a) {
|
|
23
|
-
var text = _a.text, _b = _a.size, size = _b === void 0 ? 'xlarge' : _b, _c = _a.leftDisplayType, leftDisplayType = _c === void 0 ? 'text' : _c, iconName = _a.iconName, _d = _a.rightBtnMode, rightBtnMode = _d === void 0 ? 'none' : _d, mBtnText = _a.mBtnText,
|
|
17
|
+
var text = _a.text, _b = _a.size, size = _b === void 0 ? 'xlarge' : _b, _c = _a.leftDisplayType, leftDisplayType = _c === void 0 ? 'text' : _c, iconName = _a.iconName, _d = _a.rightBtnMode, rightBtnMode = _d === void 0 ? 'none' : _d, _e = _a.rightBtn2Mode, rightBtn2Mode = _e === void 0 ? 'none' : _e, _f = _a.rightBtn3Mode, rightBtn3Mode = _f === void 0 ? 'none' : _f, mBtnText = _a.mBtnText, mBtn2Text = _a.mBtn2Text, _g = _a.mBtnState, mBtnState = _g === void 0 ? 'normal' : _g, _h = _a.mBtn2State, mBtn2State = _h === void 0 ? 'normal' : _h, _j = _a.dividerType, dividerType = _j === void 0 ? 'none' : _j, onClickLeftBtn = _a.onClickLeftBtn, onClickRightBtn = _a.onClickRightBtn, onClickRightBtn2 = _a.onClickRightBtn2, onClickRightBtn3 = _a.onClickRightBtn3;
|
|
18
|
+
var isLastButtonIcon = rightBtnMode === 'close' ||
|
|
19
|
+
rightBtnMode === 'help_window' ||
|
|
20
|
+
(rightBtnMode === 'none' && rightBtn2Mode === 'help_window') ||
|
|
21
|
+
(rightBtnMode === 'none' && rightBtn2Mode === 'none' && rightBtn3Mode === 'help_window');
|
|
24
22
|
var handleClickLeftBtn = function () {
|
|
25
23
|
if (onClickLeftBtn) {
|
|
26
24
|
onClickLeftBtn();
|
|
@@ -31,6 +29,23 @@ function DesktopHeaderBar(_a) {
|
|
|
31
29
|
onClickRightBtn();
|
|
32
30
|
}
|
|
33
31
|
};
|
|
32
|
+
var handleClickRightBtn2 = function () {
|
|
33
|
+
if (onClickRightBtn2) {
|
|
34
|
+
onClickRightBtn2();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var handleClickRightBtn3 = function () {
|
|
38
|
+
if (onClickRightBtn3) {
|
|
39
|
+
onClickRightBtn3();
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var mBtnElement = function (text, state, handleClick) {
|
|
43
|
+
return size === 'xlarge' && (react_1.default.createElement(MainButton_1.MainButton, { text: text, size: "small", fillType: "line", onClick: handleClick, state: state }));
|
|
44
|
+
};
|
|
45
|
+
var mBtnFillElement = function (text, state, handleClick) {
|
|
46
|
+
return size === 'xlarge' && (react_1.default.createElement(MainButton_1.MainButton, { text: text, size: "small", onClick: handleClick, state: state }));
|
|
47
|
+
};
|
|
48
|
+
var iconButtonElement = function (iconName, handleClick) { return (react_1.default.createElement(IconButton_1.IconButton, { fillType: "fill", baseSize: "large", iconSize: 24, shapeType: "rectangle", iconName: iconName, iconFillType: "line", onClick: handleClick, iconColorKey: "ui_cpnt_button_icon_enabled", baseColorKey: "ui_cpnt_button_fill_base_transparent" })); };
|
|
34
49
|
var leftDisplayMode = function () {
|
|
35
50
|
switch (leftDisplayType) {
|
|
36
51
|
case 'icon': {
|
|
@@ -39,21 +54,52 @@ function DesktopHeaderBar(_a) {
|
|
|
39
54
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_c", spacingType: "width" })));
|
|
40
55
|
}
|
|
41
56
|
case 'back': {
|
|
42
|
-
return (
|
|
57
|
+
return iconButtonElement('ic_arrow_left', handleClickLeftBtn);
|
|
43
58
|
}
|
|
44
59
|
case 'text': {
|
|
45
60
|
return;
|
|
46
61
|
}
|
|
47
62
|
}
|
|
48
63
|
};
|
|
64
|
+
var rightButton3Mode = function () {
|
|
65
|
+
switch (rightBtn3Mode) {
|
|
66
|
+
case 'help_window': {
|
|
67
|
+
return iconButtonElement('ic_help_window', handleClickRightBtn3);
|
|
68
|
+
}
|
|
69
|
+
case 'none': {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
var rightButton2Mode = function () {
|
|
75
|
+
switch (rightBtn2Mode) {
|
|
76
|
+
case 'mbtn': {
|
|
77
|
+
return mBtnElement(mBtn2Text, mBtn2State, handleClickRightBtn2);
|
|
78
|
+
}
|
|
79
|
+
case 'mbtn_fill': {
|
|
80
|
+
return mBtnFillElement(mBtn2Text, mBtn2State, handleClickRightBtn2);
|
|
81
|
+
}
|
|
82
|
+
case 'help_window': {
|
|
83
|
+
return iconButtonElement('ic_help_window', handleClickRightBtn2);
|
|
84
|
+
}
|
|
85
|
+
case 'none': {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
49
90
|
var rightButtonMode = function () {
|
|
50
91
|
switch (rightBtnMode) {
|
|
51
92
|
case 'close': {
|
|
52
|
-
return (
|
|
93
|
+
return iconButtonElement('ic_xmark', handleClickRightBtn);
|
|
53
94
|
}
|
|
54
95
|
case 'mbtn': {
|
|
55
|
-
return (
|
|
56
|
-
|
|
96
|
+
return mBtnElement(mBtnText, mBtnState, handleClickRightBtn);
|
|
97
|
+
}
|
|
98
|
+
case 'mbtn_fill': {
|
|
99
|
+
return mBtnFillElement(mBtnText, mBtnState, handleClickRightBtn);
|
|
100
|
+
}
|
|
101
|
+
case 'help_window': {
|
|
102
|
+
return iconButtonElement('ic_help_window', handleClickRightBtn);
|
|
57
103
|
}
|
|
58
104
|
case 'none': {
|
|
59
105
|
return;
|
|
@@ -64,9 +110,12 @@ function DesktopHeaderBar(_a) {
|
|
|
64
110
|
react_1.default.createElement(S_LeftDisplayBox, null,
|
|
65
111
|
leftDisplayMode(),
|
|
66
112
|
react_1.default.createElement(TextLabel_1.TextLabel, { text: text, styleTheme: "body1Bold", singleLineMode: "use", colorTheme: "sysTextPrimary" })),
|
|
67
|
-
|
|
113
|
+
react_1.default.createElement(S_ButtonBox, { isLastButtonIcon: isLastButtonIcon },
|
|
114
|
+
rightButton3Mode(),
|
|
115
|
+
rightButton2Mode(),
|
|
116
|
+
rightButtonMode())));
|
|
68
117
|
}
|
|
69
|
-
var S_DesktopHeaderBar = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border-bottom: ", ";\n box-sizing: border-box;\n display: flex;\n height: ", ";\n justify-content: space-between;\n padding-left: ", ";\n
|
|
118
|
+
var S_DesktopHeaderBar = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border-bottom: ", ";\n box-sizing: border-box;\n display: flex;\n height: ", ";\n justify-content: space-between;\n padding-left: ", ";\n"], ["\n align-items: center;\n background-color: ", ";\n border-bottom: ", ";\n box-sizing: border-box;\n display: flex;\n height: ", ";\n justify-content: space-between;\n padding-left: ", ";\n"])), function (_a) {
|
|
70
119
|
var theme = _a.theme;
|
|
71
120
|
return theme.ui_cpnt_headerbar_base_area;
|
|
72
121
|
}, function (_a) {
|
|
@@ -78,14 +127,17 @@ var S_DesktopHeaderBar = styled_components_1.default.div(templateObject_1 || (te
|
|
|
78
127
|
}, function (_a) {
|
|
79
128
|
var hasBackIcon = _a.hasBackIcon, theme = _a.theme;
|
|
80
129
|
return hasBackIcon ? theme.spacing.spacingC : theme.spacing.spacingE;
|
|
81
|
-
}, function (_a) {
|
|
82
|
-
var theme = _a.theme;
|
|
83
|
-
return theme.spacing.spacingB;
|
|
84
130
|
});
|
|
85
|
-
var S_LeftDisplayBox = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n"], ["\n align-items: center;\n display: flex;\n"])))
|
|
86
|
-
var S_MainButtonWrapper = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin: 0 ", ";\n"], ["\n margin: 0 ", ";\n"])), function (_a) {
|
|
131
|
+
var S_LeftDisplayBox = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n margin-right: ", ";\n"], ["\n align-items: center;\n display: flex;\n margin-right: ", ";\n"])), function (_a) {
|
|
87
132
|
var theme = _a.theme;
|
|
88
133
|
return theme.spacing.spacingD;
|
|
89
134
|
});
|
|
135
|
+
var S_ButtonBox = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n margin-right: ", ";\n\n & > :not(:last-child) {\n margin-right: ", ";\n }\n"], ["\n align-items: center;\n display: flex;\n margin-right: ", ";\n\n & > :not(:last-child) {\n margin-right: ", ";\n }\n"])), function (_a) {
|
|
136
|
+
var isLastButtonIcon = _a.isLastButtonIcon, theme = _a.theme;
|
|
137
|
+
return isLastButtonIcon ? theme.spacing.spacingB : theme.spacing.spacingE;
|
|
138
|
+
}, function (_a) {
|
|
139
|
+
var theme = _a.theme;
|
|
140
|
+
return theme.spacing.spacingB;
|
|
141
|
+
});
|
|
90
142
|
exports.default = DesktopHeaderBar;
|
|
91
143
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -50,24 +50,21 @@ function DesktopTabBar(_a) {
|
|
|
50
50
|
return (react_1.default.createElement(TextLabel_1.TextLabel, { text: value.title, styleTheme: pathname === value.path ? 'caption1Bold' : 'caption1Regular', colorTheme: pathname === value.path ? 'usrTextBrandPrimary' : 'sysTextSecondary', singleLineMode: "use" }));
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
-
return (react_1.default.createElement(
|
|
54
|
-
react_1.default.createElement(
|
|
55
|
-
|
|
53
|
+
return (react_1.default.createElement(S_TabBox, null,
|
|
54
|
+
textArray.map(function (value) { return (react_1.default.createElement(S_TabWrapper, { key: value.path, isActive: pathname.includes(value.path), styleTheme: styleTheme },
|
|
55
|
+
react_1.default.createElement(S_TitleWrapper, { onClick: function () {
|
|
56
56
|
handleClick(value);
|
|
57
|
-
} },
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
} }, textLabel(value, false)),
|
|
58
|
+
value.subArray && pathname.includes(value.path) && (react_1.default.createElement(S_SubTabBox, null, value.subArray.map(function (subValue) { return (react_1.default.createElement(S_SubWrapper, { onClick: function () {
|
|
59
|
+
handleClick(subValue);
|
|
60
|
+
}, key: subValue.path }, textLabel(subValue, true))); }))))); }),
|
|
61
|
+
textArray.map(function (value) {
|
|
62
|
+
return value.subArray && pathname.includes(value.path) && react_1.default.createElement(S_SubBackground, { key: value.path });
|
|
63
|
+
})));
|
|
61
64
|
}
|
|
62
|
-
var mediumStyle = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: flex-end;\n box-sizing: border-box;\n justify-content: center;\n
|
|
65
|
+
var mediumStyle = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: flex-end;\n box-sizing: border-box;\n justify-content: center;\n display: flex;\n margin-right: ", ";\n position: relative;\n\n &:last-child {\n margin-right: 0;\n }\n\n &::after {\n background-color: ", ";\n bottom: -1px;\n content: '';\n height: 2px;\n position: absolute;\n width: 100%;\n ", ";\n }\n"], ["\n align-items: flex-end;\n box-sizing: border-box;\n justify-content: center;\n display: flex;\n margin-right: ", ";\n position: relative;\n\n &:last-child {\n margin-right: 0;\n }\n\n &::after {\n background-color: ", ";\n bottom: -1px;\n content: '';\n height: 2px;\n position: absolute;\n width: 100%;\n ", ";\n }\n"])), function (_a) {
|
|
63
66
|
var theme = _a.theme;
|
|
64
67
|
return theme.spacing.spacingD;
|
|
65
|
-
}, function (_a) {
|
|
66
|
-
var theme = _a.theme;
|
|
67
|
-
return theme.spacing.spacingA;
|
|
68
|
-
}, function (_a) {
|
|
69
|
-
var theme = _a.theme;
|
|
70
|
-
return theme.spacing.spacingB;
|
|
71
68
|
}, function (_a) {
|
|
72
69
|
var theme = _a.theme, styleTheme = _a.styleTheme;
|
|
73
70
|
return styleTheme === 'content'
|
|
@@ -78,7 +75,14 @@ var mediumStyle = (0, styled_components_1.css)(templateObject_1 || (templateObje
|
|
|
78
75
|
return !isActive && "display: none;";
|
|
79
76
|
});
|
|
80
77
|
var S_TabWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n ", "\n"], ["\n position: relative;\n ", "\n"])), mediumStyle);
|
|
81
|
-
var
|
|
78
|
+
var S_TitleWrapper = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n cursor: pointer;\n min-width: 100%;\n padding: 0 ", ";\n padding-bottom: ", ";\n"], ["\n cursor: pointer;\n min-width: 100%;\n padding: 0 ", ";\n padding-bottom: ", ";\n"])), function (_a) {
|
|
79
|
+
var theme = _a.theme;
|
|
80
|
+
return theme.spacing.spacingA;
|
|
81
|
+
}, function (_a) {
|
|
82
|
+
var theme = _a.theme;
|
|
83
|
+
return theme.spacing.spacingB;
|
|
84
|
+
});
|
|
85
|
+
var S_TabBox = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n background-color: ", ";\n border-bottom: 1px solid ", ";\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n padding-left: ", ";\n position: relative;\n height: 40px;\n"], ["\n background-color: ", ";\n border-bottom: 1px solid ", ";\n box-sizing: border-box;\n display: flex;\n flex-direction: row;\n padding-left: ", ";\n position: relative;\n height: 40px;\n"])), function (_a) {
|
|
82
86
|
var theme = _a.theme;
|
|
83
87
|
return theme.ui_cpnt_tabbar_base_area;
|
|
84
88
|
}, function (_a) {
|
|
@@ -88,12 +92,12 @@ var S_TabBox = styled_components_1.default.div(templateObject_3 || (templateObje
|
|
|
88
92
|
var theme = _a.theme;
|
|
89
93
|
return theme.spacing.spacingE;
|
|
90
94
|
});
|
|
91
|
-
var S_SubBackground = styled_components_1.default.div(
|
|
95
|
+
var S_SubBackground = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: 100%;\n height: 32px;\n background-color: ", ";\n position: absolute;\n bottom: -33px;\n left: 0px;\n"], ["\n width: 100%;\n height: 32px;\n background-color: ", ";\n position: absolute;\n bottom: -33px;\n left: 0px;\n"])), function (_a) {
|
|
92
96
|
var theme = _a.theme;
|
|
93
97
|
return theme.ui_cpnt_tabbar_base_area_sub;
|
|
94
98
|
});
|
|
95
|
-
var S_SubTabBox = styled_components_1.default.div(
|
|
96
|
-
var S_SubWrapper = styled_components_1.default.div(
|
|
99
|
+
var S_SubTabBox = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n width: 100vw;\n position: absolute;\n bottom: -33px;\n left: 0px;\n height: 32px;\n display: flex;\n z-index: 1;\n"], ["\n width: 100vw;\n position: absolute;\n bottom: -33px;\n left: 0px;\n height: 32px;\n display: flex;\n z-index: 1;\n"])));
|
|
100
|
+
var S_SubWrapper = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n align-items: center;\n justify-content: center;\n cursor: pointer;\n display: flex;\n margin-right: ", ";\n position: relative;\n padding: 0 ", ";\n\n &:last-child {\n margin-right: 0;\n }\n"], ["\n align-items: center;\n justify-content: center;\n cursor: pointer;\n display: flex;\n margin-right: ", ";\n position: relative;\n padding: 0 ", ";\n\n &:last-child {\n margin-right: 0;\n }\n"])), function (_a) {
|
|
97
101
|
var theme = _a.theme;
|
|
98
102
|
return theme.spacing.spacingE;
|
|
99
103
|
}, function (_a) {
|
|
@@ -101,4 +105,4 @@ var S_SubWrapper = styled_components_1.default.div(templateObject_6 || (template
|
|
|
101
105
|
return theme.spacing.spacingA;
|
|
102
106
|
});
|
|
103
107
|
exports.default = DesktopTabBar;
|
|
104
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
108
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TFunctionResult } from 'i18next';
|
|
3
|
-
|
|
4
|
-
text: TFunctionResult;
|
|
5
|
-
value: string | number | boolean;
|
|
6
|
-
};
|
|
3
|
+
import { PDSValueOption } from '../../../common';
|
|
7
4
|
declare type Props = {
|
|
8
5
|
size?: 'large' | 'small';
|
|
9
6
|
hintText?: TFunctionResult;
|
|
10
|
-
defaultValue?:
|
|
11
|
-
valueArray:
|
|
7
|
+
defaultValue?: PDSValueOption;
|
|
8
|
+
valueArray: PDSValueOption[];
|
|
12
9
|
selectMode?: 'one' | 'multi';
|
|
13
10
|
state?: 'normal' | 'read_only' | 'disabled';
|
|
14
11
|
colorTheme?: 'none' | 'dark';
|
|
15
|
-
onChange?: (
|
|
12
|
+
onChange?: (option: PDSValueOption) => void;
|
|
16
13
|
};
|
|
17
14
|
declare function Dropdown({ size, hintText, defaultValue, valueArray, selectMode, state, colorTheme, onChange }: Props): JSX.Element;
|
|
18
15
|
export default Dropdown;
|
|
@@ -34,6 +34,11 @@ function Dropdown(_a) {
|
|
|
34
34
|
var _b = _a.size, size = _b === void 0 ? 'large' : _b, hintText = _a.hintText, defaultValue = _a.defaultValue, valueArray = _a.valueArray, _c = _a.selectMode, selectMode = _c === void 0 ? 'one' : _c, _d = _a.state, state = _d === void 0 ? 'normal' : _d, _e = _a.colorTheme, colorTheme = _e === void 0 ? 'none' : _e, onChange = _a.onChange;
|
|
35
35
|
var _f = (0, react_1.useState)(false), isFocused = _f[0], setIsFocused = _f[1];
|
|
36
36
|
var _g = (0, react_1.useState)(defaultValue), selectedOption = _g[0], setSelectedOption = _g[1];
|
|
37
|
+
(0, react_1.useEffect)(function () {
|
|
38
|
+
if (defaultValue) {
|
|
39
|
+
setSelectedOption(defaultValue);
|
|
40
|
+
}
|
|
41
|
+
}, [defaultValue]);
|
|
37
42
|
var handleClick = function () {
|
|
38
43
|
if (state === 'disabled' || state === 'read_only') {
|
|
39
44
|
return;
|
|
@@ -45,11 +50,11 @@ function Dropdown(_a) {
|
|
|
45
50
|
setIsFocused(false);
|
|
46
51
|
}
|
|
47
52
|
};
|
|
48
|
-
var handleClickOption = function (
|
|
49
|
-
setSelectedOption(
|
|
53
|
+
var handleClickOption = function (option) {
|
|
54
|
+
setSelectedOption(option);
|
|
50
55
|
setIsFocused(false);
|
|
51
56
|
if (onChange) {
|
|
52
|
-
onChange(
|
|
57
|
+
onChange(option);
|
|
53
58
|
}
|
|
54
59
|
};
|
|
55
60
|
var getIconColorKey = function () {
|
|
@@ -99,7 +104,7 @@ function Dropdown(_a) {
|
|
|
99
104
|
react_1.default.createElement(hybrid_1.Icon, { size: 16, fillType: "line", iconName: isFocused ? 'ic_arrow_up' : 'ic_arrow_down', colorKey: getIconColorKey() }),
|
|
100
105
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_d", spacingType: "width" })),
|
|
101
106
|
isFocused && (react_1.default.createElement(S_ContextMenuWrapper, null,
|
|
102
|
-
react_1.default.createElement(ContextMenu_1.ContextMenu, { autoWidthMode: "use" }, valueArray.map(function (el) { return (react_1.default.createElement(ContextMenuItem_1.ContextMenuItem, { key: el.value,
|
|
107
|
+
react_1.default.createElement(ContextMenu_1.ContextMenu, { autoWidthMode: "use" }, 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 })); }))))));
|
|
103
108
|
}
|
|
104
109
|
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) {
|
|
105
110
|
var theme = _a.theme;
|
|
@@ -37,14 +37,17 @@ function EditApplyTextField(_a) {
|
|
|
37
37
|
var _l = (0, react_hook_form_1.useFormContext)(), register = _l.register, setValue = _l.setValue, trigger = _l.trigger, watch = _l.watch, errors = _l.formState.errors;
|
|
38
38
|
var _m = (0, react_1.useState)(false), isFocused = _m[0], setIsFocused = _m[1];
|
|
39
39
|
var _o = (0, react_1.useState)(false), isOpen = _o[0], setIsOpen = _o[1];
|
|
40
|
-
var _p = (0, react_1.useState)(), prevValue = _p[0], setPrevValue = _p[1];
|
|
40
|
+
var _p = (0, react_1.useState)(defaultText !== null && defaultText !== void 0 ? defaultText : ''), prevValue = _p[0], setPrevValue = _p[1];
|
|
41
41
|
var currentValue = watch(name);
|
|
42
42
|
var validateOnChange = register(name, validation).onChange;
|
|
43
43
|
var isError = Object.keys(errors).some(function (error) { return error === name; });
|
|
44
44
|
(0, react_1.useEffect)(function () {
|
|
45
|
-
if (defaultText) {
|
|
45
|
+
if (defaultText !== undefined && defaultText !== null) {
|
|
46
46
|
setPrevValue(defaultText);
|
|
47
|
+
setValue(name, defaultText);
|
|
48
|
+
return;
|
|
47
49
|
}
|
|
50
|
+
setValue(name, '');
|
|
48
51
|
}, [defaultText]);
|
|
49
52
|
function handleFocus(e) {
|
|
50
53
|
if (state !== 'read_only') {
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
text: string;
|
|
5
|
-
path: string;
|
|
6
|
-
};
|
|
2
|
+
import { Path } from 'react-hook-form';
|
|
3
|
+
import { IFormValues, PDSTextType, PDSValueOption } from '../../../common';
|
|
7
4
|
export declare type FilterBarProps = {
|
|
8
5
|
displayType: 'chips' | 'searchfield' | 'filterchips_searchfield';
|
|
9
|
-
textArray:
|
|
6
|
+
textArray: PDSValueOption[];
|
|
10
7
|
hintText?: PDSTextType;
|
|
8
|
+
value?: PDSValueOption;
|
|
9
|
+
name?: Path<IFormValues>;
|
|
10
|
+
onClickChip?: (option: PDSValueOption) => void;
|
|
11
|
+
/** @deprecated value 필드를 대신 사용하세요. */
|
|
11
12
|
activeChipId?: string | number;
|
|
12
|
-
name?: string;
|
|
13
|
-
onClickChip?: (activeChipId: string | number) => void;
|
|
14
13
|
};
|
|
15
|
-
export default function FilterBar({ displayType, textArray, hintText,
|
|
16
|
-
export {};
|
|
14
|
+
export default function FilterBar({ displayType, textArray, hintText, value, name, onClickChip, activeChipId }: FilterBarProps): JSX.Element;
|
|
@@ -12,16 +12,14 @@ var styled_components_1 = __importDefault(require("styled-components"));
|
|
|
12
12
|
var Chip_1 = require("../Chip");
|
|
13
13
|
var TextField_1 = require("../TextField");
|
|
14
14
|
function FilterBar(_a) {
|
|
15
|
-
var _b = _a.displayType, displayType = _b === void 0 ? 'chips' : _b, textArray = _a.textArray, hintText = _a.hintText,
|
|
16
|
-
var handleOnClick = function (value) {
|
|
17
|
-
if (onClickChip) {
|
|
18
|
-
onClickChip(value);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
15
|
+
var _b = _a.displayType, displayType = _b === void 0 ? 'chips' : _b, textArray = _a.textArray, hintText = _a.hintText, value = _a.value, name = _a.name, onClickChip = _a.onClickChip, activeChipId = _a.activeChipId;
|
|
21
16
|
var renderingChip = function () {
|
|
22
17
|
if (displayType === 'chips' || displayType === 'filterchips_searchfield') {
|
|
23
|
-
return textArray.map(function (
|
|
24
|
-
|
|
18
|
+
return textArray.map(function (option) {
|
|
19
|
+
var _a;
|
|
20
|
+
return (react_1.default.createElement(S_ChipWrapper, { key: option.value },
|
|
21
|
+
react_1.default.createElement(Chip_1.Chip, { displayType: "filter_single", text: option.text, value: (value === null || value === void 0 ? void 0 : value.value) || undefined, id: option.value, onClickChip: function () { return onClickChip && onClickChip(option); }, activeChipId: activeChipId, chipId: (_a = option.value) === null || _a === void 0 ? void 0 : _a.toString() })));
|
|
22
|
+
});
|
|
25
23
|
}
|
|
26
24
|
};
|
|
27
25
|
var renderingTextField = function () {
|
|
@@ -34,19 +32,13 @@ function FilterBar(_a) {
|
|
|
34
32
|
renderingTextField()));
|
|
35
33
|
}
|
|
36
34
|
exports.default = FilterBar;
|
|
37
|
-
var S_FilterBarBox = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n
|
|
38
|
-
var theme = _a.theme;
|
|
39
|
-
return theme.spacing.spacingD;
|
|
40
|
-
}, function (_a) {
|
|
41
|
-
var theme = _a.theme;
|
|
42
|
-
return theme.spacing.spacingE;
|
|
43
|
-
});
|
|
35
|
+
var S_FilterBarBox = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"], ["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
|
|
44
36
|
var S_ChipBox = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n margin-right: ", ";\n"], ["\n display: flex;\n flex-wrap: wrap;\n margin-right: ", ";\n"])), function (_a) {
|
|
45
37
|
var theme = _a.theme;
|
|
46
38
|
return theme.spacing.spacingE;
|
|
47
39
|
});
|
|
48
|
-
var S_ChipWrapper = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding: ", ";\n"], ["\n padding: ", ";\n"])), function (_a) {
|
|
40
|
+
var S_ChipWrapper = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding-right: ", ";\n\n &:last-child {\n padding-right: 0;\n }\n"], ["\n padding-right: ", ";\n\n &:last-child {\n padding-right: 0;\n }\n"])), function (_a) {
|
|
49
41
|
var theme = _a.theme;
|
|
50
|
-
return theme.spacing.
|
|
42
|
+
return theme.spacing.spacingB;
|
|
51
43
|
});
|
|
52
44
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { PDSTextType } from '../../../common';
|
|
3
|
-
declare type TextObj = {
|
|
4
|
-
path: string;
|
|
5
|
-
title: PDSTextType;
|
|
6
|
-
code: string;
|
|
7
|
-
};
|
|
2
|
+
import { PDSTextType, PDSValueOption } from '../../../common';
|
|
8
3
|
declare type Props = {
|
|
9
4
|
logoImageSrc?: string;
|
|
10
5
|
titleText?: PDSTextType;
|
|
11
6
|
menuMode: 'center_text' | 'none';
|
|
12
|
-
textArray?:
|
|
7
|
+
textArray?: PDSValueOption[];
|
|
13
8
|
userImageSrc?: string;
|
|
14
9
|
loginInfoMode?: 'none' | 'profile' | 'button';
|
|
15
10
|
mBtnText?: PDSTextType;
|