pds-dev-kit-web 0.5.12 → 0.5.16
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
|
@@ -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,11 +1,12 @@
|
|
|
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';
|
|
7
8
|
onClick?: (e?: Event, ...args: any) => void;
|
|
8
|
-
|
|
9
|
+
onMouseDown?: (e?: Event, ...args: any) => void;
|
|
9
10
|
};
|
|
10
|
-
declare function ReactionButton({ text, iconName, status, colorTheme, onClick,
|
|
11
|
+
declare function ReactionButton({ text, iconName, status, colorTheme, onClick, onMouseDown }: ReactionButtonProps): JSX.Element;
|
|
11
12
|
export default ReactionButton;
|
|
@@ -31,15 +31,15 @@ var styled_components_1 = __importStar(require("styled-components"));
|
|
|
31
31
|
var hybrid_1 = require("../../../hybrid");
|
|
32
32
|
var TextLabel_1 = require("../TextLabel");
|
|
33
33
|
function ReactionButton(_a) {
|
|
34
|
-
var text = _a.text, _b = _a.iconName, iconName = _b === void 0 ? 'ic_thumb_up' : _b, _c = _a.status, status = _c === void 0 ? 'default' : _c, _d = _a.colorTheme, colorTheme = _d === void 0 ? 'none' : _d, onClick = _a.onClick,
|
|
34
|
+
var text = _a.text, _b = _a.iconName, iconName = _b === void 0 ? 'ic_thumb_up' : _b, _c = _a.status, status = _c === void 0 ? 'default' : _c, _d = _a.colorTheme, colorTheme = _d === void 0 ? 'none' : _d, onClick = _a.onClick, onMouseDown = _a.onMouseDown;
|
|
35
35
|
var handleClick = function () {
|
|
36
36
|
if (onClick) {
|
|
37
37
|
onClick();
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
-
var
|
|
41
|
-
if (
|
|
42
|
-
|
|
40
|
+
var handleMouseDown = function () {
|
|
41
|
+
if (onMouseDown) {
|
|
42
|
+
onMouseDown();
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
var IconColorByStatus = function () {
|
|
@@ -96,7 +96,7 @@ function ReactionButton(_a) {
|
|
|
96
96
|
return value;
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
|
-
return (react_1.default.createElement(S_ReactionButton, { onClick: handleClick,
|
|
99
|
+
return (react_1.default.createElement(S_ReactionButton, { onClick: handleClick, onMouseDown: handleMouseDown },
|
|
100
100
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_a", spacingType: "width" }),
|
|
101
101
|
react_1.default.createElement(hybrid_1.Icon, { size: 16, fillType: "fill", iconName: iconName, colorKey: colorTheme === 'none' ? IconColorByStatus() : IconColorByColorByTheme() }),
|
|
102
102
|
react_1.default.createElement(hybrid_1.Spacing, { size: "spacing_a", spacingType: "width" }),
|
|
@@ -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) {
|