pds-dev-kit-web 0.5.13 → 0.5.17
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 +4 -4
- package/dist/index.js +2 -2
- package/dist/src/common/index.d.ts +2 -5
- package/dist/src/common/services/i18n/resources/en.json +83 -27
- package/dist/src/common/services/i18n/resources/es.json +69 -13
- package/dist/src/common/services/i18n/resources/index.d.ts +228 -4
- package/dist/src/common/services/i18n/resources/jp.json +69 -13
- package/dist/src/common/services/i18n/resources/ko.json +69 -13
- package/dist/src/common/styles/colorSet/UIColor.json +1 -1
- package/dist/src/common/styles/colorSet/index.d.ts +55 -55
- package/dist/src/common/styles/colorSet/index.js +2 -2
- package/dist/src/common/types/index.d.ts +5 -0
- package/dist/src/common/types/index.js +17 -0
- package/dist/src/common/types/styled-components.d.ts +3 -0
- package/dist/src/common/types/text.d.ts +2 -0
- package/dist/src/common/types/text.js +2 -0
- package/dist/src/desktop/common/components/TextFieldBase/TextFieldBase.d.ts +3 -9
- package/dist/src/desktop/common/components/TextFieldBase/TextFieldBase.js +10 -9
- package/dist/src/desktop/components/Card/Card.d.ts +3 -2
- package/dist/src/desktop/components/Card/Card.js +1 -7
- package/dist/src/desktop/components/Checkbox/Checkbox.d.ts +2 -2
- package/dist/src/desktop/components/Chip/Chip.d.ts +2 -5
- package/dist/src/desktop/components/Chip/Chip.js +6 -1
- package/dist/src/desktop/components/ContextMenuItem/ContextMenuItem.d.ts +2 -1
- package/dist/src/desktop/components/DesktopHeaderBar/DesktopHeaderBar.d.ts +5 -5
- package/dist/src/desktop/components/DesktopHeaderBar/DesktopHeaderBar.js +13 -3
- package/dist/src/desktop/components/DesktopTabBar/DesktopTabBar.d.ts +3 -2
- package/dist/src/desktop/components/DesktopTabBar/DesktopTabBar.js +17 -40
- package/dist/src/desktop/components/DesktopTabBar/index.d.ts +1 -1
- package/dist/src/desktop/components/DesktopTabBar/index.js +2 -2
- package/dist/src/desktop/components/EditApplyTextField/EditApplyTextField.d.ts +5 -8
- package/dist/src/desktop/components/EditApplyTextField/EditApplyTextField.js +11 -7
- package/dist/src/desktop/components/FilterBar/FilterBar.d.ts +2 -5
- package/dist/src/desktop/components/FloatingActionButton/FloatingActionButton.d.ts +2 -5
- package/dist/src/desktop/components/FloatingActionButton/FloatingActionButton.js +12 -2
- package/dist/src/desktop/components/Hero/Hero.d.ts +3 -2
- package/dist/src/desktop/components/IconButton/IconButton.d.ts +1 -6
- package/dist/src/desktop/components/IconButton/IconButton.js +14 -4
- package/dist/src/desktop/components/MainButton/MainButton.d.ts +2 -5
- package/dist/src/desktop/components/MainButton/MainButton.js +11 -1
- package/dist/src/desktop/components/Radio/Radio.d.ts +2 -1
- package/dist/src/desktop/components/Radio/Radio.js +6 -1
- package/dist/src/desktop/components/ReactionButton/ReactionButton.d.ts +2 -1
- package/dist/src/desktop/components/Select/Select.d.ts +2 -1
- package/dist/src/desktop/components/StatusBlock/StatusBlock.d.ts +2 -1
- package/dist/src/desktop/components/TextButton/TextButton.d.ts +2 -1
- package/dist/src/desktop/components/TextButton/TextButton.js +6 -1
- package/dist/src/desktop/components/TextField/TextField.d.ts +3 -8
- package/dist/src/desktop/components/TextField/TextField.js +13 -2
- package/dist/src/desktop/components/TextLabel/TextLabel.d.ts +2 -4
- package/dist/src/desktop/components/UploadIconButton/UploadIconButton.js +6 -1
- package/dist/src/desktop/components/UploadMainButton/UploadMainButton.d.ts +2 -2
- package/dist/src/desktop/components/UploadMainButton/UploadMainButton.js +6 -1
- package/dist/src/desktop/components/UploadTextButton/UploadTextButton.d.ts +2 -1
- package/dist/src/desktop/components/UploadTextButton/UploadTextButton.js +6 -1
- package/dist/src/desktop/components/UserDesktopNavBar/UserDesktopNavBar.d.ts +4 -3
- package/dist/src/desktop/components/UserDesktopNavBar/UserDesktopNavBar.js +23 -14
- package/dist/src/desktop/components/UserDesktopTabBar/UserDesktopTabBar.d.ts +2 -1
- package/dist/src/desktop/components/UserDesktopTabBar/UserDesktopTabBar.js +11 -7
- package/dist/src/desktop/components/index.d.ts +2 -2
- package/dist/src/desktop/components/index.js +2 -2
- package/dist/src/desktop/index.d.ts +2 -2
- package/dist/src/desktop/index.js +2 -2
- package/dist/src/hybrid/components/Switch/Switch.js +1 -1
- package/dist/src/mobile/common/components/TextFieldBase/TextFieldBase.d.ts +3 -9
- package/dist/src/mobile/common/components/TextFieldBase/TextFieldBase.js +10 -9
- package/dist/src/mobile/components/BlogTextField/BlogTextField.d.ts +3 -8
- package/dist/src/mobile/components/BlogTextField/BlogTextField.js +1 -0
- package/dist/src/mobile/components/Card/Card.d.ts +3 -2
- package/dist/src/mobile/components/Card/Card.js +1 -7
- package/dist/src/mobile/components/Checkbox/Checkbox.d.ts +2 -2
- package/dist/src/mobile/components/Chip/Chip.d.ts +2 -5
- package/dist/src/mobile/components/Chip/Chip.js +11 -6
- package/dist/src/mobile/components/ContextMenuItem/ContextMenuItem.d.ts +2 -1
- package/dist/src/mobile/components/IconButton/IconButton.d.ts +2 -2
- package/dist/src/mobile/components/IconButton/IconButton.js +12 -2
- package/dist/src/mobile/components/MainButton/MainButton.d.ts +4 -7
- package/dist/src/mobile/components/MainButton/MainButton.js +12 -2
- package/dist/src/mobile/components/MobileHeaderBar/MobileHeaderBar.d.ts +2 -2
- package/dist/src/mobile/components/MobileHeaderBar/MobileHeaderBar.js +18 -3
- package/dist/src/mobile/components/MobileTabBar/MobileTabBar.d.ts +2 -1
- package/dist/src/mobile/components/MobileTabBar/MobileTabBar.js +12 -8
- package/dist/src/mobile/components/Radio/Radio.d.ts +2 -1
- package/dist/src/mobile/components/Radio/Radio.js +6 -1
- package/dist/src/mobile/components/ReactionButton/ReactionButton.d.ts +4 -3
- package/dist/src/mobile/components/ReactionButton/ReactionButton.js +5 -5
- package/dist/src/mobile/components/Select/Select.d.ts +2 -1
- package/dist/src/mobile/components/StatusBlock/StatusBlock.d.ts +2 -1
- package/dist/src/mobile/components/TextButton/TextButton.d.ts +2 -1
- package/dist/src/mobile/components/TextButton/TextButton.js +6 -1
- package/dist/src/mobile/components/TextField/TextField.d.ts +3 -8
- package/dist/src/mobile/components/TextField/TextField.js +13 -2
- package/dist/src/mobile/components/TextLabel/TextLabel.d.ts +2 -4
- package/dist/src/mobile/components/UploadIconButton/UploadIconButton.js +6 -1
- package/dist/src/mobile/components/UploadMainButton/UploadMainButton.d.ts +2 -2
- package/dist/src/mobile/components/UploadMainButton/UploadMainButton.js +6 -1
- package/dist/src/mobile/components/UploadTextButton/UploadTextButton.d.ts +2 -1
- package/dist/src/mobile/components/UploadTextButton/UploadTextButton.js +6 -1
- package/package.json +1 -1
|
@@ -31,12 +31,13 @@ var styled_components_1 = __importStar(require("styled-components"));
|
|
|
31
31
|
var components_1 = require("../../common/components");
|
|
32
32
|
var IconButton_1 = require("../IconButton");
|
|
33
33
|
function EditApplyTextField(_a) {
|
|
34
|
-
var
|
|
34
|
+
var _b;
|
|
35
|
+
var name = _a.name, hintText = _a.hintText, defaultText = _a.defaultText, validation = _a.validation, _c = _a.preventBlankMode, preventBlankMode = _c === void 0 ? 'none' : _c, _d = _a.size, size = _d === void 0 ? 'large' : _d, _e = _a.textLineType, textLineType = _e === void 0 ? 'single' : _e, _f = _a.multiRows, multiRows = _f === void 0 ? 8 : _f, _g = _a.autoMinRows, autoMinRows = _g === void 0 ? 8 : _g, autoMaxRows = _a.autoMaxRows, _h = _a.inputType, inputType = _h === void 0 ? 'text' : _h, _j = _a.state, state = _j === void 0 ? 'normal' : _j, max = _a.max, maxLength = _a.maxLength, min = _a.min, onBlur = _a.onBlur, onChange = _a.onChange, onClickSubmitBtn = _a.onClickSubmitBtn, onFocus = _a.onFocus, onTarget = _a.onTarget;
|
|
35
36
|
var t = (0, react_i18next_1.useTranslation)('translation').t;
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var
|
|
37
|
+
var _k = (0, react_hook_form_1.useFormContext)(), register = _k.register, setValue = _k.setValue, trigger = _k.trigger, watch = _k.watch, errors = _k.formState.errors;
|
|
38
|
+
var _l = (0, react_1.useState)(false), isFocused = _l[0], setIsFocused = _l[1];
|
|
39
|
+
var _m = (0, react_1.useState)(false), isOpen = _m[0], setIsOpen = _m[1];
|
|
40
|
+
var _o = (0, react_1.useState)(), prevValue = _o[0], setPrevValue = _o[1];
|
|
40
41
|
var currentValue = watch(name);
|
|
41
42
|
var validateOnChange = register(name, validation).onChange;
|
|
42
43
|
var isError = Object.keys(errors).some(function (error) { return error === name; });
|
|
@@ -92,6 +93,9 @@ function EditApplyTextField(_a) {
|
|
|
92
93
|
setValue(name, currentValue);
|
|
93
94
|
setPrevValue(currentValue);
|
|
94
95
|
}
|
|
96
|
+
if (onClickSubmitBtn) {
|
|
97
|
+
onClickSubmitBtn();
|
|
98
|
+
}
|
|
95
99
|
}
|
|
96
100
|
var handleKeyUp = function (e) {
|
|
97
101
|
if (textLineType === 'single' && e.key === 'Enter') {
|
|
@@ -121,7 +125,7 @@ function EditApplyTextField(_a) {
|
|
|
121
125
|
isOpen === true && (react_1.default.createElement(S_ButtonBox, null,
|
|
122
126
|
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 }),
|
|
123
127
|
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", onMouseDown: handleSubmit, state: isError === true ? 'disabled' : 'normal' })))),
|
|
124
|
-
errors[name] && react_1.default.createElement(S_Error, { isFocused: isFocused }, t(errors[name].message)))));
|
|
128
|
+
((_b = errors[name]) === null || _b === void 0 ? void 0 : _b.message) && (react_1.default.createElement(S_Error, { isFocused: isFocused }, t(errors[name].message))))));
|
|
125
129
|
}
|
|
126
130
|
var S_EditApplyTextFieldWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: ", ";\n"], ["\n width: ", ";\n"])), function (_a) {
|
|
127
131
|
var size = _a.size;
|
|
@@ -211,7 +215,7 @@ var S_S_TextFieldBaseWrapper = styled_components_1.default.div(templateObject_10
|
|
|
211
215
|
disabled: disabled
|
|
212
216
|
}[state];
|
|
213
217
|
});
|
|
214
|
-
var S_Error = styled_components_1.default.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n color: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-top: ", ";\n margin-right: ", ";\n"], ["\n color: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-top: ", ";\n margin-right: ", ";\n"])), function (_a) {
|
|
218
|
+
var S_Error = styled_components_1.default.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n color: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-top: ", ";\n margin-right: ", ";\n text-align: left;\n"], ["\n color: ", ";\n font-size: ", ";\n font-weight: ", ";\n line-height: ", ";\n margin-top: ", ";\n margin-right: ", ";\n text-align: left;\n"])), function (_a) {
|
|
215
219
|
var theme = _a.theme;
|
|
216
220
|
return theme.ui_cpnt_textfield_text_error;
|
|
217
221
|
}, function (_a) {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
import lineIcons from '../../../common/assets/icons/line';
|
|
4
|
-
export declare type FillIconNameKeys = keyof typeof fillIcons;
|
|
5
|
-
export declare type LineIconNameKeys = keyof typeof lineIcons;
|
|
2
|
+
import { PDSTextType } from '../../../common';
|
|
6
3
|
declare type ChipProps = {
|
|
7
4
|
text: string;
|
|
8
5
|
path: string;
|
|
@@ -10,7 +7,7 @@ declare type ChipProps = {
|
|
|
10
7
|
export declare type FilterBarProps = {
|
|
11
8
|
displayType: 'chips' | 'searchfield' | 'filterchips_searchfield';
|
|
12
9
|
textArray: ChipProps[];
|
|
13
|
-
hintText?:
|
|
10
|
+
hintText?: PDSTextType;
|
|
14
11
|
activeChipId?: string | number;
|
|
15
12
|
name?: string;
|
|
16
13
|
onClickChip?: (activeChipId: string | number) => void;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
import lineIcons from '../../../common/assets/icons/line';
|
|
4
|
-
export declare type FillIconNameKeys = keyof typeof fillIcons;
|
|
5
|
-
export declare type LineIconNameKeys = keyof typeof lineIcons;
|
|
2
|
+
import { FillIconNameKeys, LineIconNameKeys, PDSTextType } from '../../../common';
|
|
6
3
|
export declare type FloatingActionButtonProps = {
|
|
7
|
-
text?:
|
|
4
|
+
text?: PDSTextType;
|
|
8
5
|
displayType?: 'icon_only' | 'text_only' | 'icon_text';
|
|
9
6
|
size?: 'xlarge' | 'large';
|
|
10
7
|
fontWeight?: 'bold' | 'regular';
|
|
@@ -39,6 +39,16 @@ var TextLabel_1 = require("../TextLabel");
|
|
|
39
39
|
// state?: 'normal' | 'disabled';
|
|
40
40
|
function FloatingActionButton(_a) {
|
|
41
41
|
var text = _a.text, _b = _a.displayType, displayType = _b === void 0 ? 'icon_text' : _b, _c = _a.size, size = _c === void 0 ? 'large' : _c, fontWeight = _a.fontWeight, _d = _a.iconFillType, iconFillType = _d === void 0 ? 'line' : _d, iconName = _a.iconName, _e = _a.colorTheme, colorTheme = _e === void 0 ? 'none' : _e, _f = _a.state, state = _f === void 0 ? 'normal' : _f, onClick = _a.onClick, onMouseDown = _a.onMouseDown;
|
|
42
|
+
var handleClick = function () {
|
|
43
|
+
if (onClick) {
|
|
44
|
+
onClick();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var handleMouseDown = function () {
|
|
48
|
+
if (onMouseDown) {
|
|
49
|
+
onMouseDown();
|
|
50
|
+
}
|
|
51
|
+
};
|
|
42
52
|
var iconColor = function () {
|
|
43
53
|
if (state === 'disabled') {
|
|
44
54
|
return 'ui_cpnt_button_icon_disabled';
|
|
@@ -46,9 +56,9 @@ function FloatingActionButton(_a) {
|
|
|
46
56
|
return 'ui_cpnt_button_icon_on_primary';
|
|
47
57
|
};
|
|
48
58
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
49
|
-
displayType === 'icon_only' && (react_1.default.createElement(S_ButtonIconOnly, { size: size, fontWeight: fontWeight, colorTheme: colorTheme, state: state, disabled: state === 'disabled', onClick:
|
|
59
|
+
displayType === 'icon_only' && (react_1.default.createElement(S_ButtonIconOnly, { size: size, fontWeight: fontWeight, colorTheme: colorTheme, state: state, disabled: state === 'disabled', onClick: handleClick, onMouseDown: handleMouseDown },
|
|
50
60
|
react_1.default.createElement(hybrid_1.Icon, { iconName: iconName, size: size === 'large' ? 20 : 24, colorKey: iconColor(), fillType: iconFillType }))),
|
|
51
|
-
displayType !== 'icon_only' && (react_1.default.createElement(S_Button, { size: size, fontWeight: fontWeight, colorTheme: colorTheme, state: state, disabled: state === 'disabled', onClick:
|
|
61
|
+
displayType !== 'icon_only' && (react_1.default.createElement(S_Button, { size: size, fontWeight: fontWeight, colorTheme: colorTheme, state: state, disabled: state === 'disabled', onClick: handleClick, onMouseDown: handleMouseDown },
|
|
52
62
|
displayType === 'text_only' && (react_1.default.createElement(TextLabel_1.TextLabel, { text: text, styleTheme: "body1Bold", btnMode: "use", colorTheme: state === 'disabled' ? 'sysTextTertiary' : 'usrTextBrandOnPrimary', colorOverride: state === 'disabled' ? 'ui_cpnt_button_text_darktheme_disabled' : undefined })),
|
|
53
63
|
displayType === 'icon_text' && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
54
64
|
react_1.default.createElement(hybrid_1.Icon, { iconName: iconName, size: 20, colorKey: iconColor(), fillType: iconFillType }),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { PDSTextType } from '../../../common';
|
|
2
3
|
export declare type HeroProps = {
|
|
3
|
-
heroText:
|
|
4
|
-
leadText?:
|
|
4
|
+
heroText: PDSTextType;
|
|
5
|
+
leadText?: PDSTextType;
|
|
5
6
|
leadTextColorTheme?: 'normal' | 'emphasis';
|
|
6
7
|
};
|
|
7
8
|
declare function Hero({ heroText, leadText, leadTextColorTheme }: HeroProps): JSX.Element;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
import lineIcons from '../../../common/assets/icons/line';
|
|
4
|
-
import { uiColors } from '../../../common/styles/ui-colors';
|
|
5
|
-
export declare type FillIconNameKeys = keyof typeof fillIcons;
|
|
6
|
-
export declare type LineIconNameKeys = keyof typeof lineIcons;
|
|
7
|
-
export declare type UiColors = keyof typeof uiColors;
|
|
2
|
+
import { FillIconNameKeys, LineIconNameKeys, UiColors } from '../../../common';
|
|
8
3
|
export declare type IconButtonProps = {
|
|
9
4
|
fillType?: 'fill' | 'line';
|
|
10
5
|
shapeType?: 'circular' | 'rectangle';
|
|
@@ -28,10 +28,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
var react_1 = __importDefault(require("react"));
|
|
30
30
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
31
|
-
var
|
|
31
|
+
var common_1 = require("../../../common");
|
|
32
32
|
var hybrid_1 = require("../../../hybrid");
|
|
33
33
|
function IconButton(_a) {
|
|
34
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 () {
|
|
36
|
+
if (onClick) {
|
|
37
|
+
onClick();
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var handleMouseDown = function () {
|
|
41
|
+
if (onMouseDown) {
|
|
42
|
+
onMouseDown();
|
|
43
|
+
}
|
|
44
|
+
};
|
|
35
45
|
var iconStateColorObj = {
|
|
36
46
|
fill: 'ui_cpnt_button_icon_on_primary',
|
|
37
47
|
line: 'ui_cpnt_button_icon_enabled'
|
|
@@ -52,7 +62,7 @@ function IconButton(_a) {
|
|
|
52
62
|
}
|
|
53
63
|
return iconStateColorObj[fillType];
|
|
54
64
|
};
|
|
55
|
-
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:
|
|
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 },
|
|
56
66
|
react_1.default.createElement(hybrid_1.Icon, { iconName: iconName, size: iconSize, colorKey: IconColorSelect(), fillType: iconFillType })));
|
|
57
67
|
}
|
|
58
68
|
var fillDisabled = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n"], ["\n background-color: ", ";\n"])), function (_a) {
|
|
@@ -63,7 +73,7 @@ var fillDisabled = (0, styled_components_1.css)(templateObject_1 || (templateObj
|
|
|
63
73
|
});
|
|
64
74
|
var fill = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n\n &:hover:enabled {\n ", "\n }\n\n &:active:enabled {\n ", "\n }\n\n ", ";\n"], ["\n background-color: ", ";\n\n &:hover:enabled {\n ", "\n }\n\n &:active:enabled {\n ", "\n }\n\n ", ";\n"])), function (_a) {
|
|
65
75
|
var theme = _a.theme, baseColorKey = _a.baseColorKey;
|
|
66
|
-
return baseColorKey ?
|
|
76
|
+
return baseColorKey ? common_1.uiColors[baseColorKey] : theme.ui_cpnt_button_fill_base_primary;
|
|
67
77
|
}, function (_a) {
|
|
68
78
|
var theme = _a.theme, baseColorKey = _a.baseColorKey;
|
|
69
79
|
return baseColorKey === 'ui_cpnt_button_fill_base_transparent'
|
|
@@ -90,7 +100,7 @@ var line = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 =
|
|
|
90
100
|
return theme.ui_cpnt_button_line_base_default;
|
|
91
101
|
}, function (_a) {
|
|
92
102
|
var theme = _a.theme, borderColorKey = _a.borderColorKey;
|
|
93
|
-
return borderColorKey ?
|
|
103
|
+
return borderColorKey ? common_1.uiColors[borderColorKey] : theme.ui_cpnt_button_line_border_enabled;
|
|
94
104
|
}, function (_a) {
|
|
95
105
|
var colorTheme = _a.colorTheme;
|
|
96
106
|
switch (colorTheme) {
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
3
|
-
import lineIcons from '../../../common/assets/icons/line';
|
|
4
|
-
export declare type FillIconNameKeys = keyof typeof fillIcons;
|
|
5
|
-
export declare type LineIconNameKeys = keyof typeof lineIcons;
|
|
2
|
+
import { FillIconNameKeys, LineIconNameKeys, PDSTextType } from '../../../common';
|
|
6
3
|
export declare type MainButtonProps = {
|
|
7
|
-
text?:
|
|
4
|
+
text?: PDSTextType;
|
|
8
5
|
fillType?: 'fill' | 'line';
|
|
9
6
|
size?: 'large' | 'medium' | 'small' | 'xsmall' | 'rlarge';
|
|
10
7
|
fontWeight?: 'bold' | 'regular';
|
|
@@ -38,6 +38,16 @@ var TextLabel_1 = require("../TextLabel");
|
|
|
38
38
|
// shadow?: 'hidden' | 'visible';
|
|
39
39
|
function MainButton(_a) {
|
|
40
40
|
var text = _a.text, _b = _a.fillType, fillType = _b === void 0 ? 'fill' : _b, _c = _a.size, size = _c === void 0 ? 'large' : _c, fontWeight = _a.fontWeight, _d = _a.iconMode, iconMode = _d === void 0 ? 'none' : _d, _e = _a.iconFillType, iconFillType = _e === void 0 ? 'line' : _e, iconName = _a.iconName, _f = _a.colorTheme, colorTheme = _f === void 0 ? 'none' : _f, _g = _a.type, type = _g === void 0 ? 'button' : _g, _h = _a.state, state = _h === void 0 ? 'normal' : _h, onClick = _a.onClick, onMouseDown = _a.onMouseDown;
|
|
41
|
+
var handleClick = function () {
|
|
42
|
+
if (onClick) {
|
|
43
|
+
onClick();
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
var handleMouseDown = function () {
|
|
47
|
+
if (onMouseDown) {
|
|
48
|
+
onMouseDown();
|
|
49
|
+
}
|
|
50
|
+
};
|
|
41
51
|
var textStyle = {
|
|
42
52
|
rlarge: 'body1Bold',
|
|
43
53
|
large: 'body1Bold',
|
|
@@ -84,7 +94,7 @@ function MainButton(_a) {
|
|
|
84
94
|
}
|
|
85
95
|
return iconFillTypeColorObj[fillType];
|
|
86
96
|
};
|
|
87
|
-
return (react_1.default.createElement(S_Button, { fillType: fillType, size: size, fontWeight: fontWeight, colorTheme: colorTheme, type: type, state: state, disabled: state === 'disabled', onClick:
|
|
97
|
+
return (react_1.default.createElement(S_Button, { fillType: fillType, size: size, fontWeight: fontWeight, colorTheme: colorTheme, type: type, state: state, disabled: state === 'disabled', onClick: handleClick, onMouseDown: handleMouseDown },
|
|
88
98
|
size !== 'xsmall' && iconMode === 'left' && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
89
99
|
react_1.default.createElement(hybrid_1.Icon, { iconName: iconName, size: size === 'large' || size === 'rlarge' ? 20 : 16, colorKey: iconColor(), fillType: iconFillType }),
|
|
90
100
|
react_1.default.createElement(hybrid_1.Spacing, { size: size === 'large' || size === 'rlarge' ? 'spacing_b' : 'spacing_a', spacingType: "width" }))),
|
|
@@ -13,6 +13,11 @@ var hybrid_1 = require("../../../hybrid");
|
|
|
13
13
|
var TextLabel_1 = require("../TextLabel");
|
|
14
14
|
function Radio(_a) {
|
|
15
15
|
var text = _a.text, _b = _a.fontWeight, fontWeight = _b === void 0 ? 'regular' : _b, _c = _a.state, state = _c === void 0 ? 'normal' : _c, _d = _a.checked, checked = _d === void 0 ? false : _d, name = _a.name, value = _a.value, onChange = _a.onChange;
|
|
16
|
+
var handleChange = function (e) {
|
|
17
|
+
if (onChange) {
|
|
18
|
+
onChange(e);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
16
21
|
var icon = function () {
|
|
17
22
|
switch (state) {
|
|
18
23
|
case 'normal': {
|
|
@@ -32,7 +37,7 @@ function Radio(_a) {
|
|
|
32
37
|
react_1.default.createElement(TextLabel_1.TextLabel, { text: text, styleTheme: fontWeight === 'regular' ? 'body2Regular' : 'body2Bold', colorOverride: state === 'normal'
|
|
33
38
|
? 'ui_cpnt_selcontrols_text_default'
|
|
34
39
|
: 'ui_cpnt_selcontrols_text_disabled' })),
|
|
35
|
-
react_1.default.createElement("input", { hidden: true, id: value, type: "radio", name: name, value: value, checked: checked, color: value, onChange:
|
|
40
|
+
react_1.default.createElement("input", { hidden: true, id: value, type: "radio", name: name, value: value, checked: checked, color: value, onChange: handleChange, disabled: state === 'disabled' })));
|
|
36
41
|
}
|
|
37
42
|
var S_Label = styled_components_1.default.label(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n cursor: pointer;\n display: flex;\n height: 24px;\n"], ["\n align-items: center;\n cursor: pointer;\n display: flex;\n height: 24px;\n"])));
|
|
38
43
|
var S_OverrideIconWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n position: relative;\n"], ["\n align-items: center;\n display: flex;\n position: relative;\n"])));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { PDSTextType } from '../../../common';
|
|
2
3
|
export declare type ReactionButtonProps = {
|
|
3
|
-
text:
|
|
4
|
+
text: PDSTextType;
|
|
4
5
|
iconName?: 'ic_thumb_up' | 'ic_heart' | 'ic_thumb_down' | 'ic_reply';
|
|
5
6
|
status?: 'default' | 'select';
|
|
6
7
|
colorTheme?: 'none' | 'dark';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { PDSTextType } from '../../../common';
|
|
2
3
|
declare type Value = {
|
|
3
4
|
text: string;
|
|
4
5
|
value: string | number;
|
|
5
6
|
};
|
|
6
7
|
declare type SelectProps = {
|
|
7
|
-
hintText?:
|
|
8
|
+
hintText?: PDSTextType;
|
|
8
9
|
defaultValue?: Value;
|
|
9
10
|
valueArray: Value[];
|
|
10
11
|
size?: 'large' | 'medium' | 'small' | 'rlarge';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { PDSTextType } from '../../../common';
|
|
2
3
|
export declare type StatusBlockProps = {
|
|
3
|
-
text?:
|
|
4
|
+
text?: PDSTextType;
|
|
4
5
|
size?: 'large' | 'medium' | 'small';
|
|
5
6
|
state?: 'basic' | 'standby' | 'proceeding' | 'cancel' | 'end' | 'error';
|
|
6
7
|
width?: number | 'responsive';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { PDSTextType } from '../../../common';
|
|
2
3
|
export declare type TextButtonProps = {
|
|
3
|
-
text?:
|
|
4
|
+
text?: PDSTextType;
|
|
4
5
|
size?: 'rlarge' | 'large' | 'medium' | 'small' | 'xsmall';
|
|
5
6
|
fontWeight?: 'bold' | 'regular';
|
|
6
7
|
type?: 'submit' | 'reset' | 'button';
|
|
@@ -55,6 +55,11 @@ var TextLabel_1 = require("../TextLabel");
|
|
|
55
55
|
// colorTheme?: 'none';
|
|
56
56
|
function TextButton(_a) {
|
|
57
57
|
var text = _a.text, _b = _a.size, size = _b === void 0 ? 'large' : _b, fontWeight = _a.fontWeight, _c = _a.type, type = _c === void 0 ? 'button' : _c, _d = _a.state, state = _d === void 0 ? 'normal' : _d, onClick = _a.onClick, rest = __rest(_a, ["text", "size", "fontWeight", "type", "state", "onClick"]);
|
|
58
|
+
var handleClick = function () {
|
|
59
|
+
if (onClick) {
|
|
60
|
+
onClick();
|
|
61
|
+
}
|
|
62
|
+
};
|
|
58
63
|
var textStyle = {
|
|
59
64
|
rlarge: 'body1Bold',
|
|
60
65
|
large: 'body1Bold',
|
|
@@ -62,7 +67,7 @@ function TextButton(_a) {
|
|
|
62
67
|
small: 'caption1Bold',
|
|
63
68
|
xsmall: 'caption1Regular'
|
|
64
69
|
};
|
|
65
|
-
return (react_1.default.createElement(S_Button, __assign({}, rest, { size: size, onClick:
|
|
70
|
+
return (react_1.default.createElement(S_Button, __assign({}, rest, { size: size, onClick: handleClick, type: type, fontWeight: fontWeight, disabled: state === 'disabled' }),
|
|
66
71
|
react_1.default.createElement(TextLabel_1.TextLabel, { text: text, styleTheme: textStyle[size], colorTheme: state === 'disabled' ? 'sysTextTertiary' : 'usrTextBrandPrimary', btnMode: "use" })));
|
|
67
72
|
}
|
|
68
73
|
var large = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 48px;\n ", ";\n"], ["\n height: 48px;\n ", ";\n"])), function (_a) {
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import { TFunctionResult } from 'i18next';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { Path } from 'react-hook-form';
|
|
4
|
-
import
|
|
5
|
-
import lineIcons from '../../../common/assets/icons/line';
|
|
6
|
-
import { IFormValues } from '../../../common/types/form';
|
|
7
|
-
export declare type FillIconNameKeys = keyof typeof fillIcons;
|
|
8
|
-
export declare type LineIconNameKeys = keyof typeof lineIcons;
|
|
3
|
+
import { FillIconNameKeys, IFormValues, LineIconNameKeys, PDSTextType } from '../../../common';
|
|
9
4
|
export declare type TextFieldProps = {
|
|
10
5
|
name: Path<IFormValues>;
|
|
11
|
-
hintText?:
|
|
12
|
-
defaultText?:
|
|
6
|
+
hintText?: PDSTextType;
|
|
7
|
+
defaultText?: PDSTextType;
|
|
13
8
|
validation?: {
|
|
14
9
|
[key: string]: any;
|
|
15
10
|
};
|
|
@@ -23,6 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
/* eslint-disable react/jsx-no-bind */
|
|
26
27
|
var react_1 = __importStar(require("react"));
|
|
27
28
|
var react_hook_form_1 = require("react-hook-form");
|
|
28
29
|
var react_i18next_1 = require("react-i18next");
|
|
@@ -47,6 +48,16 @@ function TextField(_a) {
|
|
|
47
48
|
var _q = (0, react_hook_form_1.useFormContext)(), register = _q.register, trigger = _q.trigger, errors = _q.formState.errors;
|
|
48
49
|
var _r = register(name, validation), validateOnChange = _r.onChange, validateOnBlur = _r.onBlur;
|
|
49
50
|
var isError = Object.keys(errors).some(function (error) { return error === name; });
|
|
51
|
+
var handleClickIBtn1 = function () {
|
|
52
|
+
if (onClickIBtn1) {
|
|
53
|
+
onClickIBtn1();
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
var handleClickIBtn2 = function () {
|
|
57
|
+
if (onClickIBtn2) {
|
|
58
|
+
onClickIBtn2();
|
|
59
|
+
}
|
|
60
|
+
};
|
|
50
61
|
function handleFocus() {
|
|
51
62
|
if (state !== 'read_only') {
|
|
52
63
|
setIsFocused(true);
|
|
@@ -98,12 +109,12 @@ function TextField(_a) {
|
|
|
98
109
|
{
|
|
99
110
|
none: iconThemeColorNoneObj[state],
|
|
100
111
|
dark: iconThemeColorDarkObj[state]
|
|
101
|
-
}[colorTheme], iconFillType: iBtn2IconFillType === 'fill' ? 'fill' : 'line', state: state === 'disabled' ? 'disabled' : 'normal', onClick:
|
|
112
|
+
}[colorTheme], iconFillType: iBtn2IconFillType === 'fill' ? 'fill' : 'line', state: state === 'disabled' ? 'disabled' : 'normal', onClick: handleClickIBtn2 })),
|
|
102
113
|
iBtn1IconName && (react_1.default.createElement(IconButton_1.IconButton, { iconName: iBtn1IconName, baseSize: "small", shapeType: "rectangle", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconSize: size === 'large' || size === 'rlarge' ? 20 : 16, iconColorKey: colorTheme &&
|
|
103
114
|
{
|
|
104
115
|
none: iconThemeColorNoneObj[state],
|
|
105
116
|
dark: iconThemeColorDarkObj[state]
|
|
106
|
-
}[colorTheme], iconFillType: iBtn1IconFillType === 'fill' ? 'fill' : 'line', state: state === 'disabled' ? 'disabled' : 'normal', onClick:
|
|
117
|
+
}[colorTheme], iconFillType: iBtn1IconFillType === 'fill' ? 'fill' : 'line', state: state === 'disabled' ? 'disabled' : 'normal', onClick: handleClickIBtn1 })))));
|
|
107
118
|
}
|
|
108
119
|
};
|
|
109
120
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
import { uiColors } from '../../../common';
|
|
4
|
-
export declare type UiColors = keyof typeof uiColors;
|
|
2
|
+
import { PDSTextType, UiColors } from '../../../common';
|
|
5
3
|
export declare type TextLabelProps = {
|
|
6
|
-
text:
|
|
4
|
+
text: PDSTextType;
|
|
7
5
|
textAlign?: 'left' | 'center' | 'right';
|
|
8
6
|
styleTheme?: 'displayBold' | 'headingBold' | 'leadParaBold' | 'leadParaRegular' | 'subTitleBold' | 'subTitleRegular' | 'body1Bold' | 'body1Regular' | 'body2Bold' | 'body2Regular' | 'caption1Bold' | 'caption1Regular' | 'caption2Bold' | 'caption2Regular' | 'form1Regular' | 'form2Regular' | 'blog1Regular';
|
|
9
7
|
colorOverride?: UiColors;
|
|
@@ -33,6 +33,11 @@ var hybrid_1 = require("../../../hybrid");
|
|
|
33
33
|
var types_1 = require("./types");
|
|
34
34
|
function UploadIconButton(_a) {
|
|
35
35
|
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, _g = _a.iconName, iconName = _g === void 0 ? 'ic_upload' : _g, iconColorKey = _a.iconColorKey, _h = _a.shadow, shadow = _h === void 0 ? 'hidden' : _h, _j = _a.colorTheme, colorTheme = _j === void 0 ? 'none' : _j, _k = _a.state, state = _k === void 0 ? 'normal' : _k, _l = _a.accept, accept = _l === void 0 ? '*' : _l, _m = _a.multipleMode, multipleMode = _m === void 0 ? 'none' : _m, onClick = _a.onClick;
|
|
36
|
+
var handleClick = function (e) {
|
|
37
|
+
if (onClick) {
|
|
38
|
+
onClick(e);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
36
41
|
var IconColorSelect = function () {
|
|
37
42
|
if (state === 'disabled') {
|
|
38
43
|
return 'ui_cpnt_button_icon_disabled';
|
|
@@ -46,7 +51,7 @@ function UploadIconButton(_a) {
|
|
|
46
51
|
return types_1.iconStateColors[fillType];
|
|
47
52
|
};
|
|
48
53
|
return (react_1.default.createElement(S_UploadIconButton, { fillType: fillType, shapeType: shapeType, baseSize: baseSize, baseColorKey: baseColorKey, borderColorKey: borderColorKey, shadow: shadow, colorTheme: colorTheme, isDisabled: state === 'disabled' },
|
|
49
|
-
react_1.default.createElement("input", { type: "file", hidden: true, disabled: state === 'disabled', accept: accept, multiple: multipleMode === 'use', onChange:
|
|
54
|
+
react_1.default.createElement("input", { type: "file", hidden: true, disabled: state === 'disabled', accept: accept, multiple: multipleMode === 'use', onChange: handleClick }),
|
|
50
55
|
react_1.default.createElement(hybrid_1.Icon, { iconName: iconName, size: iconSize, colorKey: IconColorSelect(), fillType: iconFillType })));
|
|
51
56
|
}
|
|
52
57
|
var fillDisabled = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n"], ["\n background-color: ", ";\n"])), function (_a) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FillIconNameKeys, LineIconNameKeys } from '../../../common';
|
|
2
|
+
import { FillIconNameKeys, LineIconNameKeys, PDSTextType } from '../../../common';
|
|
3
3
|
declare type UploadMainButtonProps = {
|
|
4
|
-
text?:
|
|
4
|
+
text?: PDSTextType;
|
|
5
5
|
fillType?: 'fill' | 'line';
|
|
6
6
|
size?: 'large' | 'medium' | 'small' | 'xsmall' | 'rlarge';
|
|
7
7
|
fontWeight?: 'bold' | 'regular';
|
|
@@ -33,6 +33,11 @@ var TextLabel_1 = require("../TextLabel");
|
|
|
33
33
|
var types_1 = require("./types");
|
|
34
34
|
function UploadMainButton(_a) {
|
|
35
35
|
var text = _a.text, _b = _a.fillType, fillType = _b === void 0 ? 'fill' : _b, _c = _a.size, size = _c === void 0 ? 'large' : _c, fontWeight = _a.fontWeight, _d = _a.iconMode, iconMode = _d === void 0 ? 'none' : _d, _e = _a.iconFillType, iconFillType = _e === void 0 ? 'line' : _e, _f = _a.iconName, iconName = _f === void 0 ? 'ic_upload' : _f, _g = _a.colorTheme, colorTheme = _g === void 0 ? 'none' : _g, _h = _a.state, state = _h === void 0 ? 'normal' : _h, _j = _a.accept, accept = _j === void 0 ? '*' : _j, _k = _a.multipleMode, multipleMode = _k === void 0 ? 'none' : _k, onClick = _a.onClick;
|
|
36
|
+
var handleClick = function (e) {
|
|
37
|
+
if (onClick) {
|
|
38
|
+
onClick(e);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
36
41
|
var selectTextThemeColor = function () {
|
|
37
42
|
if (colorTheme === 'line3' && state === 'disabled') {
|
|
38
43
|
return 'ui_cpnt_button_text_darktheme_disabled';
|
|
@@ -55,7 +60,7 @@ function UploadMainButton(_a) {
|
|
|
55
60
|
return types_1.iconFillTypeColors[fillType];
|
|
56
61
|
};
|
|
57
62
|
return (react_1.default.createElement(S_UploadMainButton, { fillType: fillType, size: size, fontWeight: fontWeight, colorTheme: colorTheme, disabled: state === 'disabled' },
|
|
58
|
-
react_1.default.createElement("input", { type: "file", hidden: true, disabled: state === 'disabled', accept: accept, multiple: multipleMode === 'use', onChange:
|
|
63
|
+
react_1.default.createElement("input", { type: "file", hidden: true, disabled: state === 'disabled', accept: accept, multiple: multipleMode === 'use', onChange: handleClick }),
|
|
59
64
|
size !== 'xsmall' && iconMode === 'left' && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
60
65
|
react_1.default.createElement(hybrid_1.Icon, { iconName: iconName, size: size === 'large' || size === 'rlarge' ? 20 : 16, colorKey: iconColor(), fillType: iconFillType }),
|
|
61
66
|
react_1.default.createElement(hybrid_1.Spacing, { size: size === 'large' || size === 'rlarge' ? 'spacing_b' : 'spacing_a', spacingType: "width" }))),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { PDSTextType } from '../../../common';
|
|
2
3
|
declare type UploadTextButtonProps = {
|
|
3
|
-
text?:
|
|
4
|
+
text?: PDSTextType;
|
|
4
5
|
size?: 'rlarge' | 'large' | 'medium' | 'small' | 'xsmall';
|
|
5
6
|
fontWeight?: 'bold' | 'regular';
|
|
6
7
|
state?: 'normal' | 'disabled';
|
|
@@ -38,8 +38,13 @@ var textStyle = {
|
|
|
38
38
|
};
|
|
39
39
|
function UploadTextButton(_a) {
|
|
40
40
|
var text = _a.text, _b = _a.size, size = _b === void 0 ? 'large' : _b, fontWeight = _a.fontWeight, _c = _a.state, state = _c === void 0 ? 'normal' : _c, _d = _a.accept, accept = _d === void 0 ? '*' : _d, _e = _a.multipleMode, multipleMode = _e === void 0 ? 'none' : _e, onClick = _a.onClick;
|
|
41
|
+
var handleClick = function (e) {
|
|
42
|
+
if (onClick) {
|
|
43
|
+
onClick(e);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
41
46
|
return (react_1.default.createElement(S_UploadTextButton, { size: size, fontWeight: fontWeight, disabled: state === 'disabled' },
|
|
42
|
-
react_1.default.createElement("input", { type: "file", hidden: true, disabled: state === 'disabled', accept: accept, multiple: multipleMode === 'use', onChange:
|
|
47
|
+
react_1.default.createElement("input", { type: "file", hidden: true, disabled: state === 'disabled', accept: accept, multiple: multipleMode === 'use', onChange: handleClick }),
|
|
43
48
|
react_1.default.createElement(TextLabel_1.TextLabel, { text: text, styleTheme: textStyle[size], colorTheme: state === 'disabled' ? 'sysTextTertiary' : 'usrTextBrandPrimary', btnMode: "use" })));
|
|
44
49
|
}
|
|
45
50
|
var large = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 48px;\n width: ", ";\n"], ["\n height: 48px;\n width: ", ";\n"])), function (_a) {
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { PDSTextType } from '../../../common';
|
|
2
3
|
declare type TextObj = {
|
|
3
4
|
path: string;
|
|
4
|
-
title:
|
|
5
|
+
title: PDSTextType;
|
|
5
6
|
code: string;
|
|
6
7
|
};
|
|
7
8
|
declare type Props = {
|
|
8
9
|
logoImageSrc?: string;
|
|
9
|
-
titleText?:
|
|
10
|
+
titleText?: PDSTextType;
|
|
10
11
|
menuMode: 'center_text' | 'none';
|
|
11
12
|
textArray?: TextObj[];
|
|
12
13
|
userImageSrc?: string;
|
|
13
14
|
loginInfoMode?: 'none' | 'profile' | 'button';
|
|
14
|
-
mBtnText?:
|
|
15
|
+
mBtnText?: PDSTextType;
|
|
15
16
|
dividerType?: 'none' | 'solid';
|
|
16
17
|
onClickLogo?: () => void;
|
|
17
18
|
onClickLoginInfo?: () => void;
|
|
@@ -29,12 +29,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
var react_1 = __importStar(require("react"));
|
|
30
30
|
var react_router_dom_1 = require("react-router-dom");
|
|
31
31
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
32
|
-
var
|
|
33
|
-
var
|
|
34
|
-
var ContextMenu_1 = __importDefault(require("../ContextMenu/ContextMenu"));
|
|
32
|
+
var hybrid_1 = require("../../../hybrid");
|
|
33
|
+
var ContextMenu_1 = require("../ContextMenu");
|
|
35
34
|
var ContextMenuItem_1 = require("../ContextMenuItem");
|
|
36
|
-
var IconButton_1 =
|
|
37
|
-
var MainButton_1 =
|
|
35
|
+
var IconButton_1 = require("../IconButton");
|
|
36
|
+
var MainButton_1 = require("../MainButton");
|
|
38
37
|
var TextLabel_1 = require("../TextLabel");
|
|
39
38
|
function UserDesktopNavBar(_a) {
|
|
40
39
|
var logoImageSrc = _a.logoImageSrc, titleText = _a.titleText, _b = _a.menuMode, menuMode = _b === void 0 ? 'center_text' : _b, textArray = _a.textArray, userImageSrc = _a.userImageSrc, _c = _a.loginInfoMode, loginInfoMode = _c === void 0 ? 'profile' : _c, mBtnText = _a.mBtnText, _d = _a.dividerType, dividerType = _d === void 0 ? 'none' : _d, onClickLogo = _a.onClickLogo, onClickLoginInfo = _a.onClickLoginInfo;
|
|
@@ -58,24 +57,34 @@ function UserDesktopNavBar(_a) {
|
|
|
58
57
|
var hiddenTexts = array.slice(MAX_VISIBLE_TEXTS_NUM);
|
|
59
58
|
return hiddenTexts;
|
|
60
59
|
}
|
|
61
|
-
var
|
|
60
|
+
var handleClick = function (path) {
|
|
62
61
|
history.push(path);
|
|
63
62
|
};
|
|
63
|
+
var handleClickLogo = function () {
|
|
64
|
+
if (onClickLogo) {
|
|
65
|
+
onClickLogo();
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
var handleClickLoginInfo = function () {
|
|
69
|
+
if (onClickLoginInfo) {
|
|
70
|
+
onClickLoginInfo();
|
|
71
|
+
}
|
|
72
|
+
};
|
|
64
73
|
return (react_1.default.createElement(S_UserDesktopNavBar, null,
|
|
65
74
|
react_1.default.createElement(S_NavBar, null,
|
|
66
|
-
logoImageSrc ? (react_1.default.createElement(S_Logo, { src: logoImageSrc, onClick:
|
|
75
|
+
logoImageSrc ? (react_1.default.createElement(S_Logo, { src: logoImageSrc, onClick: handleClickLogo })) : (react_1.default.createElement(S_TextWrapper, { onClick: handleClickLogo },
|
|
67
76
|
react_1.default.createElement(TextLabel_1.TextLabel, { text: titleText, singleLineMode: "use", styleTheme: "headingBold", colorTheme: "sysTextPrimary", ellipsisMode: "use", lineLimit: 1 }))),
|
|
68
77
|
menuMode === 'center_text' && (react_1.default.createElement(S_pApps, null,
|
|
69
|
-
visibleTexts.map(function (value) { return (react_1.default.createElement(S_VisiblePAppWrapper, { key: value.path, onClick: function () { return
|
|
78
|
+
visibleTexts.map(function (value) { return (react_1.default.createElement(S_VisiblePAppWrapper, { key: value.path, onClick: function () { return handleClick(value.path); } }, currentPathName.includes(value.path) ? (react_1.default.createElement(TextLabel_1.TextLabel, { text: value.title, styleTheme: "body1Bold", colorTheme: "sysTextPrimary", singleLineMode: "use" })) : (react_1.default.createElement(TextLabel_1.TextLabel, { text: value.title, styleTheme: "body1Regular", colorTheme: "sysTextSecondary", singleLineMode: "use" })))); }),
|
|
70
79
|
hiddenTexts.length > 0 && (react_1.default.createElement(S_MorePApps, null,
|
|
71
80
|
react_1.default.createElement(S_IconButtonWrapper, { onClick: function () { return setIsContextMenuOpen(!isContextMenuOpen); } },
|
|
72
|
-
react_1.default.createElement(IconButton_1.
|
|
73
|
-
react_1.default.createElement(S_ContextMenuWrapper, null, isContextMenuOpen && (react_1.default.createElement(ContextMenu_1.
|
|
81
|
+
react_1.default.createElement(IconButton_1.IconButton, { fillType: "fill", baseSize: "medium", baseColorKey: "ui_cpnt_button_fill_base_transparent", iconSize: 24, iconName: "ic_more", iconColorKey: "ui_cpnt_button_icon_default", shapeType: "rectangle", iconFillType: "fill" })),
|
|
82
|
+
react_1.default.createElement(S_ContextMenuWrapper, null, isContextMenuOpen && (react_1.default.createElement(ContextMenu_1.ContextMenu, null, hiddenTexts.map(function (pApp) { return (react_1.default.createElement(ContextMenuItem_1.ContextMenuItem, { key: pApp.path, size: "medium", value: pApp.path, text: pApp.title, onClick: handleClick })); })))))))),
|
|
74
83
|
react_1.default.createElement(S_ProfileWrapper, null,
|
|
75
|
-
loginInfoMode === 'profile' && (react_1.default.createElement(S_ImageViewWrapper, { onClick:
|
|
76
|
-
react_1.default.createElement(
|
|
77
|
-
loginInfoMode === 'button' && (react_1.default.createElement(MainButton_1.
|
|
78
|
-
dividerType === 'solid' && react_1.default.createElement(
|
|
84
|
+
loginInfoMode === 'profile' && (react_1.default.createElement(S_ImageViewWrapper, { onClick: handleClickLoginInfo },
|
|
85
|
+
react_1.default.createElement(hybrid_1.ImageView, { src: userImageSrc, shapeType: "circular", width: 32, ratio: "1_1", scaleType: "cover", borderMode: "use" }))),
|
|
86
|
+
loginInfoMode === 'button' && (react_1.default.createElement(MainButton_1.MainButton, { size: "small", fillType: "line", text: mBtnText, onClick: handleClickLoginInfo })))),
|
|
87
|
+
dividerType === 'solid' && react_1.default.createElement(hybrid_1.Divider, null)));
|
|
79
88
|
}
|
|
80
89
|
var S_UserDesktopNavBar = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 64px;\n background-color: ", ";\n min-width: 1200px;\n"], ["\n height: 64px;\n background-color: ", ";\n min-width: 1200px;\n"])), function (_a) {
|
|
81
90
|
var theme = _a.theme;
|