pds-dev-kit-web 2.0.14-alpha.0 → 2.1.0-alpha.0
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 +9 -3
- package/dist/src/common/assets/icons/line/DottedCircle.d.ts +4 -0
- package/dist/src/common/assets/icons/line/DottedCircle.js +30 -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/styles/colorSet/PaletteColor_Dark.json +14 -2
- package/dist/src/common/styles/colorSet/PaletteColor_light.json +13 -1
- package/dist/src/common/styles/colorSet/UIColor.json +26 -1
- package/dist/src/common/styles/colorSet/index.d.ts +51 -2
- package/dist/src/common/styles/colorSet/index.js +2 -2
- package/dist/src/common/styles/colorSet/ui-type.d.ts +25 -0
- package/dist/src/common/types/components.d.ts +8 -0
- package/dist/src/desktop/common/components/TextFieldBase/TextFieldBase.d.ts +4 -1
- package/dist/src/desktop/common/components/TextFieldBase/TextFieldBase.js +36 -11
- package/dist/src/desktop/common/components/TextFieldBase/constants.d.ts +1 -0
- package/dist/src/desktop/common/components/TextFieldBase/constants.js +4 -0
- package/dist/src/desktop/components/BasicButtonGroup/BasicButtonGroup.d.ts +9 -0
- package/dist/src/desktop/components/BasicButtonGroup/BasicButtonGroup.js +73 -0
- package/dist/src/desktop/components/BasicButtonGroup/index.d.ts +1 -0
- package/dist/src/desktop/components/BasicButtonGroup/index.js +8 -0
- package/dist/src/desktop/components/IconButton/IconButton.d.ts +5 -3
- package/dist/src/desktop/components/IconButton/IconButton.js +52 -4
- package/dist/src/desktop/components/IconButton/constants.d.ts +15 -0
- package/dist/src/desktop/components/IconButton/constants.js +19 -0
- package/dist/src/desktop/components/SegmentedButtonGroup/SegmentedButtonGroup.d.ts +18 -0
- package/dist/src/desktop/components/SegmentedButtonGroup/SegmentedButtonGroup.js +143 -0
- package/dist/src/desktop/components/SegmentedButtonGroup/index.d.ts +1 -0
- package/dist/src/desktop/components/SegmentedButtonGroup/index.js +8 -0
- package/dist/src/desktop/components/Select/Select.js +12 -6
- package/dist/src/desktop/components/Slider/Slider.d.ts +19 -0
- package/dist/src/desktop/components/Slider/Slider.js +200 -0
- package/dist/src/desktop/components/Slider/index.d.ts +1 -0
- package/dist/src/desktop/components/Slider/index.js +8 -0
- package/dist/src/desktop/components/TextButton/TextButton.d.ts +1 -1
- package/dist/src/desktop/components/TextButton/TextButton.js +3 -0
- package/dist/src/desktop/components/TextField/TextField.d.ts +3 -1
- package/dist/src/desktop/components/TextField/TextField.js +8 -8
- package/dist/src/desktop/components/UploadIconButton/UploadIconButton.d.ts +5 -3
- package/dist/src/desktop/components/UploadIconButton/UploadIconButton.js +52 -4
- package/dist/src/desktop/components/UploadTextButton/UploadTextButton.d.ts +1 -1
- package/dist/src/desktop/components/UploadTextButton/UploadTextButton.js +3 -0
- package/dist/src/desktop/components/index.d.ts +4 -1
- package/dist/src/desktop/components/index.js +7 -1
- package/dist/src/desktop/index.d.ts +1 -1
- package/dist/src/desktop/index.js +5 -2
- package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/ContentsContainer.d.ts +1 -1
- package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/ContentsContainer.js +2 -1
- package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/variation/WSG.js +57 -32
- package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/variation/WSI.d.ts +15 -0
- package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/variation/WSI.js +117 -0
- package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/variation/index.d.ts +1 -0
- package/dist/src/desktop/layout/LayoutWS/Containers/ContentsContainer/variation/index.js +3 -1
- package/dist/src/desktop/layout/LayoutWS/ContainersBox/ContainersBox.d.ts +1 -1
- package/dist/src/mobile/common/components/TextFieldBase/TextFieldBase.d.ts +4 -1
- package/dist/src/mobile/common/components/TextFieldBase/TextFieldBase.js +35 -10
- package/dist/src/mobile/common/components/TextFieldBase/constants.d.ts +1 -0
- package/dist/src/mobile/common/components/TextFieldBase/constants.js +4 -0
- package/dist/src/mobile/components/BasicButtonGroup/BasicButtonGroup.d.ts +9 -0
- package/dist/src/mobile/components/BasicButtonGroup/BasicButtonGroup.js +73 -0
- package/dist/src/mobile/components/BasicButtonGroup/index.d.ts +1 -0
- package/dist/src/mobile/components/BasicButtonGroup/index.js +8 -0
- package/dist/src/mobile/components/ContextMenu/ContextMenu.js +1 -1
- package/dist/src/mobile/components/IconButton/IconButton.d.ts +1 -1
- package/dist/src/mobile/components/IconButton/IconButton.js +1 -1
- package/dist/src/mobile/components/SegmentedButtonGroup/SegmentedButtonGroup.d.ts +18 -0
- package/dist/src/mobile/components/SegmentedButtonGroup/SegmentedButtonGroup.js +143 -0
- package/dist/src/mobile/components/SegmentedButtonGroup/index.d.ts +1 -0
- package/dist/src/mobile/components/SegmentedButtonGroup/index.js +8 -0
- package/dist/src/mobile/components/Select/Select.js +12 -6
- package/dist/src/mobile/components/Slider/Slider.d.ts +19 -0
- package/dist/src/mobile/components/Slider/Slider.js +197 -0
- package/dist/src/mobile/components/Slider/index.d.ts +1 -0
- package/dist/src/mobile/components/Slider/index.js +8 -0
- package/dist/src/mobile/components/TextButton/TextButton.d.ts +1 -1
- package/dist/src/mobile/components/TextButton/TextButton.js +3 -0
- package/dist/src/mobile/components/TextField/TextField.d.ts +3 -1
- package/dist/src/mobile/components/TextField/TextField.js +8 -8
- package/dist/src/mobile/components/UploadIconButton/UploadIconButton.d.ts +1 -1
- package/dist/src/mobile/components/UploadIconButton/UploadIconButton.js +1 -1
- package/dist/src/mobile/components/UploadTextButton/UploadTextButton.d.ts +1 -1
- package/dist/src/mobile/components/UploadTextButton/UploadTextButton.js +3 -0
- package/dist/src/mobile/components/index.d.ts +4 -1
- package/dist/src/mobile/components/index.js +7 -1
- package/dist/src/mobile/index.d.ts +1 -1
- package/dist/src/mobile/index.js +5 -1
- package/package.json +1 -1
- package/release-note.md +7 -7
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __assign = (this && this.__assign) || function () {
|
|
7
|
+
__assign = Object.assign || function(t) {
|
|
8
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
+
s = arguments[i];
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
return __assign.apply(this, arguments);
|
|
16
|
+
};
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
var components_1 = require("../../../hybrid/components");
|
|
39
|
+
var styled_components_1 = __importStar(require("styled-components"));
|
|
40
|
+
function BasicButtonGroup(_a) {
|
|
41
|
+
var _b = _a.size, size = _b === void 0 ? 'medium' : _b, valueArray = _a.valueArray, _c = _a.state, state = _c === void 0 ? 'normal' : _c;
|
|
42
|
+
return ((0, jsx_runtime_1.jsx)(S_BasicButtonGroup, __assign({ "x-pds-name": "BasicButtonGroup", "x-pds-element-type": "component", "x-pds-device-type": "desktop" }, { children: valueArray.map(function (_a, index) {
|
|
43
|
+
var iconName = _a.iconName, _b = _a.iconFillType, iconFillType = _b === void 0 ? 'line' : _b, _c = _a.state, buttonState = _c === void 0 ? 'normal' : _c, onClick = _a.onClick, onMouseDown = _a.onMouseDown;
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)(S_BasicButton, __assign({ size: size, onClick: function (e) { return onClick && onClick(e); }, onMouseDown: function (e) { return onMouseDown && onMouseDown(e); }, disabled: state === 'disabled' || buttonState === 'disabled' }, { children: (0, jsx_runtime_1.jsx)(components_1.Icon, { iconName: iconName, size: size === 'small' ? 20 : 24, iconFillType: iconFillType, colorKey: state === 'disabled' || buttonState === 'disabled'
|
|
45
|
+
? 'ui_cpnt_button_icon_disabled'
|
|
46
|
+
: 'ui_cpnt_button_icon_enabled' }, void 0) }), iconName + index));
|
|
47
|
+
}) }), void 0));
|
|
48
|
+
}
|
|
49
|
+
var S_BasicButtonGroup = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: max-content;\n\n & > button:not(:last-child) {\n margin-right: ", ";\n }\n"], ["\n width: max-content;\n\n & > button:not(:last-child) {\n margin-right: ", ";\n }\n"])), function (_a) {
|
|
50
|
+
var theme = _a.theme;
|
|
51
|
+
return theme.spacing.spacingA;
|
|
52
|
+
});
|
|
53
|
+
var large = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-radius: 14px;\n height: 48px;\n width: 48px;\n"], ["\n border-radius: 14px;\n height: 48px;\n width: 48px;\n"])));
|
|
54
|
+
var medium = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border-radius: 12px;\n height: 40px;\n width: 40px;\n"], ["\n border-radius: 12px;\n height: 40px;\n width: 40px;\n"])));
|
|
55
|
+
var small = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border-radius: 10px;\n height: 32px;\n width: 32px;\n"], ["\n border-radius: 10px;\n height: 32px;\n width: 32px;\n"])));
|
|
56
|
+
var S_BasicButton = styled_components_1.default.button(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border: none;\n display: inline-flex;\n justify-content: center;\n position: relative;\n\n ", ";\n\n &::before {\n background-color: transparent;\n border-radius: inherit;\n content: '';\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n }\n\n &:hover:enabled:before {\n background-color: ", ";\n }\n\n &:active:enabled:before {\n background-color: ", ";\n }\n\n &:disabled {\n background-color: ", ";\n cursor: default;\n }\n"], ["\n align-items: center;\n background-color: ", ";\n border: none;\n display: inline-flex;\n justify-content: center;\n position: relative;\n\n ", ";\n\n &::before {\n background-color: transparent;\n border-radius: inherit;\n content: '';\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n }\n\n &:hover:enabled:before {\n background-color: ", ";\n }\n\n &:active:enabled:before {\n background-color: ", ";\n }\n\n &:disabled {\n background-color: ", ";\n cursor: default;\n }\n"])), function (_a) {
|
|
57
|
+
var theme = _a.theme;
|
|
58
|
+
return theme.ui_cpnt_basicbuttongroup_base_default;
|
|
59
|
+
}, function (_a) {
|
|
60
|
+
var size = _a.size;
|
|
61
|
+
return size && { large: large, medium: medium, small: small }[size];
|
|
62
|
+
}, function (_a) {
|
|
63
|
+
var theme = _a.theme;
|
|
64
|
+
return theme.ui_cpnt_button_fill_on_base_hover;
|
|
65
|
+
}, function (_a) {
|
|
66
|
+
var theme = _a.theme;
|
|
67
|
+
return theme.ui_cpnt_button_fill_on_base_pressed;
|
|
68
|
+
}, function (_a) {
|
|
69
|
+
var theme = _a.theme;
|
|
70
|
+
return theme.ui_cpnt_basicbuttongroup_base_disabled;
|
|
71
|
+
});
|
|
72
|
+
exports.default = BasicButtonGroup;
|
|
73
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BasicButtonGroup } from './BasicButtonGroup';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BasicButtonGroup = void 0;
|
|
7
|
+
var BasicButtonGroup_1 = require("./BasicButtonGroup");
|
|
8
|
+
Object.defineProperty(exports, "BasicButtonGroup", { enumerable: true, get: function () { return __importDefault(BasicButtonGroup_1).default; } });
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { FillIconNameKeys, LineIconNameKeys, UiColors } from '../../../common';
|
|
2
|
+
import type { FillIconNameKeys, LineIconNameKeys, PDSTextType, UiColors } from '../../../common';
|
|
3
3
|
export declare type IconButtonProps = {
|
|
4
|
+
tooltipText?: PDSTextType;
|
|
5
|
+
tooltipPosition?: 'left_top' | 'left_bottom' | 'center_top' | 'center_bottom' | 'right_top' | 'right_bottom';
|
|
4
6
|
fillType?: 'fill' | 'line';
|
|
5
7
|
shapeType?: 'circular' | 'rectangle';
|
|
6
8
|
baseSize?: 'xxlarge' | 'large' | 'medium' | 'small' | 'xsmall';
|
|
7
9
|
baseColorKey?: UiColors;
|
|
8
10
|
borderColorKey?: UiColors;
|
|
9
|
-
iconSize?: 12 | 16 | 20 | 24 | 48 | 72;
|
|
11
|
+
iconSize?: 12 | 16 | 20 | 24 | 32 | 48 | 72;
|
|
10
12
|
iconFillType?: 'fill' | 'line';
|
|
11
13
|
iconName: FillIconNameKeys | LineIconNameKeys;
|
|
12
14
|
iconColorKey?: UiColors;
|
|
@@ -18,5 +20,5 @@ export declare type IconButtonProps = {
|
|
|
18
20
|
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
19
21
|
onMouseDown?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
20
22
|
};
|
|
21
|
-
declare function IconButton({ fillType, shapeType, baseSize, baseColorKey, borderColorKey, iconSize, iconFillType, iconName, iconColorKey, shadow, colorTheme, type, state, tabIndex, onClick, onMouseDown }: IconButtonProps): JSX.Element;
|
|
23
|
+
declare function IconButton({ tooltipText, tooltipPosition, fillType, shapeType, baseSize, baseColorKey, borderColorKey, iconSize, iconFillType, iconName, iconColorKey, shadow, colorTheme, type, state, tabIndex, onClick, onMouseDown }: IconButtonProps): JSX.Element;
|
|
22
24
|
export default IconButton;
|
|
@@ -35,11 +35,18 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
35
35
|
};
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
var react_1 = require("react");
|
|
38
39
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
39
40
|
var transitionStyle_1 = require("../../../common/styles/movement/transitionStyle");
|
|
40
41
|
var hybrid_1 = require("../../../hybrid");
|
|
42
|
+
var TextLabel_1 = require("../TextLabel");
|
|
43
|
+
var constants_1 = require("./constants");
|
|
41
44
|
function IconButton(_a) {
|
|
42
|
-
var _b = _a.
|
|
45
|
+
var tooltipText = _a.tooltipText, _b = _a.tooltipPosition, tooltipPosition = _b === void 0 ? 'center_bottom' : _b, _c = _a.fillType, fillType = _c === void 0 ? 'fill' : _c, _d = _a.shapeType, shapeType = _d === void 0 ? 'rectangle' : _d, _e = _a.baseSize, baseSize = _e === void 0 ? 'small' : _e, baseColorKey = _a.baseColorKey, borderColorKey = _a.borderColorKey, _f = _a.iconSize, iconSize = _f === void 0 ? 24 : _f, _g = _a.iconFillType, iconFillType = _g === void 0 ? 'line' : _g, iconName = _a.iconName, iconColorKey = _a.iconColorKey, _h = _a.shadow, shadow = _h === void 0 ? 'hidden' : _h, _j = _a.colorTheme, colorTheme = _j === void 0 ? 'none' : _j, _k = _a.type, type = _k === void 0 ? 'button' : _k, _l = _a.state, state = _l === void 0 ? 'normal' : _l, tabIndex = _a.tabIndex, onClick = _a.onClick, onMouseDown = _a.onMouseDown;
|
|
46
|
+
var _m = (0, react_1.useState)(false), isTooltipOpen = _m[0], setIsTooltipOpen = _m[1];
|
|
47
|
+
var handleTooltipToggle = function (value) {
|
|
48
|
+
setIsTooltipOpen(value);
|
|
49
|
+
};
|
|
43
50
|
var handleClick = function (e) {
|
|
44
51
|
if (onClick) {
|
|
45
52
|
onClick(e);
|
|
@@ -73,7 +80,7 @@ function IconButton(_a) {
|
|
|
73
80
|
}
|
|
74
81
|
return iconStateColorObj[fillType];
|
|
75
82
|
};
|
|
76
|
-
return ((0, jsx_runtime_1.
|
|
83
|
+
return ((0, jsx_runtime_1.jsxs)(S_IconButton, __assign({ "x-pds-name": "IconButton", "x-pds-element-type": "component", "x-pds-device-type": "desktop", fillType: fillType, shapeType: shapeType, baseSize: baseSize, baseColorKey: baseColorKey, borderColorKey: borderColorKey, shadow: shadow, colorTheme: colorTheme, type: type, state: state, disabled: state === 'disabled', tabIndex: tabIndex, onClick: handleClick, onMouseDown: handleMouseDown, onMouseEnter: function () { return tooltipText && handleTooltipToggle(true); }, onMouseLeave: function () { return tooltipText && handleTooltipToggle(false); } }, { children: [(0, jsx_runtime_1.jsx)(hybrid_1.Icon, { iconName: iconName, size: iconSize, colorKey: IconColorSelect(), fillType: iconFillType }, void 0), tooltipText && isTooltipOpen && ((0, jsx_runtime_1.jsx)(S_TooltipWrapper, __assign({ className: "TooltipWrapper", isTooltipOpen: isTooltipOpen, tooltipPosition: tooltipPosition, baseSize: baseSize }, { children: (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: tooltipText, colorOverride: "ui_cpnt_textlabel_button_tooltip", styleTheme: "caption2Regular", colorTheme: "sysTextSecondary" }, void 0) }), void 0))] }), void 0));
|
|
77
84
|
}
|
|
78
85
|
var fillDisabled = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n"], ["\n background-color: ", ";\n"])), function (_a) {
|
|
79
86
|
var theme = _a.theme, baseColorKey = _a.baseColorKey;
|
|
@@ -81,7 +88,7 @@ var fillDisabled = (0, styled_components_1.css)(templateObject_1 || (templateObj
|
|
|
81
88
|
? ''
|
|
82
89
|
: theme.ui_cpnt_button_fill_base_disabled;
|
|
83
90
|
});
|
|
84
|
-
var fill = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n border: none;\n position: relative;\n\n &::before {\n
|
|
91
|
+
var fill = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n border: none;\n position: relative;\n\n &::before {\n background-color: transparent;\n border-radius: inherit;\n content: '';\n height: 100%;\n position: absolute;\n width: 100%;\n ", "\n }\n\n &:hover:enabled::before {\n background-color: ", ";\n }\n\n &:active:enabled::before {\n background-color: ", ";\n }\n\n ", ";\n"], ["\n background-color: ", ";\n border: none;\n position: relative;\n\n &::before {\n background-color: transparent;\n border-radius: inherit;\n content: '';\n height: 100%;\n position: absolute;\n width: 100%;\n ", "\n }\n\n &:hover:enabled::before {\n background-color: ", ";\n }\n\n &:active:enabled::before {\n background-color: ", ";\n }\n\n ", ";\n"])), function (_a) {
|
|
85
92
|
var theme = _a.theme, baseColorKey = _a.baseColorKey;
|
|
86
93
|
return baseColorKey ? theme[baseColorKey] : theme.ui_cpnt_button_fill_base_primary;
|
|
87
94
|
}, transitionStyle_1.ButtonTransition, function (_a) {
|
|
@@ -172,5 +179,46 @@ var iconButtonStyle = (0, styled_components_1.css)(templateObject_12 || (templat
|
|
|
172
179
|
}[baseSize];
|
|
173
180
|
});
|
|
174
181
|
var S_IconButton = styled_components_1.default.button(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), iconButtonStyle);
|
|
182
|
+
var tooltipPositionSpacing = (0, styled_components_1.css)(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), function (_a) {
|
|
183
|
+
var baseSize = _a.baseSize;
|
|
184
|
+
return baseSize &&
|
|
185
|
+
{
|
|
186
|
+
xxlarge: constants_1.TOOLTIP_POSITION_SPACING.xxlarge,
|
|
187
|
+
large: constants_1.TOOLTIP_POSITION_SPACING.large,
|
|
188
|
+
medium: constants_1.TOOLTIP_POSITION_SPACING.medium,
|
|
189
|
+
small: constants_1.TOOLTIP_POSITION_SPACING.small,
|
|
190
|
+
xsmall: constants_1.TOOLTIP_POSITION_SPACING.xsmall
|
|
191
|
+
}[baseSize];
|
|
192
|
+
});
|
|
193
|
+
var tooltipLeftTop = (0, styled_components_1.css)(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n bottom: ", ";\n right: 0;\n"], ["\n bottom: ", ";\n right: 0;\n"])), tooltipPositionSpacing);
|
|
194
|
+
var tooltipLeftBottom = (0, styled_components_1.css)(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n right: 0;\n top: ", ";\n"], ["\n right: 0;\n top: ", ";\n"])), tooltipPositionSpacing);
|
|
195
|
+
var tooltipCenterTop = (0, styled_components_1.css)(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n bottom: ", ";\n"], ["\n bottom: ", ";\n"])), tooltipPositionSpacing);
|
|
196
|
+
var tooltipCenterBottom = (0, styled_components_1.css)(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n top: ", ";\n"], ["\n top: ", ";\n"])), tooltipPositionSpacing);
|
|
197
|
+
var tooltipRightTop = (0, styled_components_1.css)(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n bottom: ", ";\n left: 0;\n"], ["\n bottom: ", ";\n left: 0;\n"])), tooltipPositionSpacing);
|
|
198
|
+
var tooltipRightBottom = (0, styled_components_1.css)(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n left: 0;\n top: ", ";\n"], ["\n left: 0;\n top: ", ";\n"])), tooltipPositionSpacing);
|
|
199
|
+
var S_TooltipWrapper = styled_components_1.default.div(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border-radius: ", ";\n box-sizing: border-box;\n display: flex;\n justify-content: center;\n padding: ", ";\n position: absolute;\n width: max-content;\n z-index: 400;\n\n ", ";\n\n ", "\n"], ["\n align-items: center;\n background-color: ", ";\n border-radius: ", ";\n box-sizing: border-box;\n display: flex;\n justify-content: center;\n padding: ", ";\n position: absolute;\n width: max-content;\n z-index: 400;\n\n ", ";\n\n ", "\n"])), function (_a) {
|
|
200
|
+
var theme = _a.theme;
|
|
201
|
+
return theme.ui_cpnt_button_tooltip_base;
|
|
202
|
+
}, function (_a) {
|
|
203
|
+
var theme = _a.theme;
|
|
204
|
+
return theme.spacing.spacingA;
|
|
205
|
+
}, function (_a) {
|
|
206
|
+
var theme = _a.theme;
|
|
207
|
+
return theme.spacing.spacingA + " " + theme.spacing.spacingB;
|
|
208
|
+
}, function (_a) {
|
|
209
|
+
var isTooltipOpen = _a.isTooltipOpen;
|
|
210
|
+
return !isTooltipOpen && 'display: none';
|
|
211
|
+
}, function (_a) {
|
|
212
|
+
var tooltipPosition = _a.tooltipPosition;
|
|
213
|
+
return tooltipPosition &&
|
|
214
|
+
{
|
|
215
|
+
left_top: tooltipLeftTop,
|
|
216
|
+
left_bottom: tooltipLeftBottom,
|
|
217
|
+
center_top: tooltipCenterTop,
|
|
218
|
+
center_bottom: tooltipCenterBottom,
|
|
219
|
+
right_top: tooltipRightTop,
|
|
220
|
+
right_bottom: tooltipRightBottom
|
|
221
|
+
}[tooltipPosition];
|
|
222
|
+
});
|
|
175
223
|
exports.default = IconButton;
|
|
176
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13;
|
|
224
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const ICON_BUTTON_SIZE: {
|
|
2
|
+
xxlarge: number;
|
|
3
|
+
large: number;
|
|
4
|
+
medium: number;
|
|
5
|
+
small: number;
|
|
6
|
+
xsmall: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const ICON_BUTTON_TOOLTIP_SPACING = 8;
|
|
9
|
+
export declare const TOOLTIP_POSITION_SPACING: {
|
|
10
|
+
xxlarge: string;
|
|
11
|
+
large: string;
|
|
12
|
+
medium: string;
|
|
13
|
+
small: string;
|
|
14
|
+
xsmall: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TOOLTIP_POSITION_SPACING = exports.ICON_BUTTON_TOOLTIP_SPACING = exports.ICON_BUTTON_SIZE = void 0;
|
|
4
|
+
exports.ICON_BUTTON_SIZE = {
|
|
5
|
+
xxlarge: 96,
|
|
6
|
+
large: 48,
|
|
7
|
+
medium: 40,
|
|
8
|
+
small: 32,
|
|
9
|
+
xsmall: 24
|
|
10
|
+
};
|
|
11
|
+
exports.ICON_BUTTON_TOOLTIP_SPACING = 8;
|
|
12
|
+
// NOTE - iconSize 크기에 따라 위치를 이동시켜주고, iconButtonSize에 간격까지 8px을 추가해준 값입니다.(IconButton과 tooltip의 간격)
|
|
13
|
+
exports.TOOLTIP_POSITION_SPACING = {
|
|
14
|
+
xxlarge: "calc(" + exports.ICON_BUTTON_SIZE.xxlarge + "px + " + exports.ICON_BUTTON_TOOLTIP_SPACING + "px)",
|
|
15
|
+
large: "calc(" + exports.ICON_BUTTON_SIZE.large + "px + " + exports.ICON_BUTTON_TOOLTIP_SPACING + "px)",
|
|
16
|
+
medium: "calc(" + exports.ICON_BUTTON_SIZE.medium + "px + " + exports.ICON_BUTTON_TOOLTIP_SPACING + "px)",
|
|
17
|
+
small: "calc(" + exports.ICON_BUTTON_SIZE.small + "px + " + exports.ICON_BUTTON_TOOLTIP_SPACING + "px)",
|
|
18
|
+
xsmall: "calc(" + exports.ICON_BUTTON_SIZE.xsmall + "px + " + exports.ICON_BUTTON_TOOLTIP_SPACING + "px)"
|
|
19
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { FillIconNameKeys, LineIconNameKeys, PDSValueOption } from '../../../common/types';
|
|
3
|
+
declare type SegmentedButtonGroupValueOption = Pick<PDSValueOption, 'value'> & {
|
|
4
|
+
iconName: FillIconNameKeys | LineIconNameKeys;
|
|
5
|
+
iconFillType?: 'fill' | 'line';
|
|
6
|
+
state?: 'normal' | 'disabled';
|
|
7
|
+
};
|
|
8
|
+
export declare type SegmentedButtonGroupProps = {
|
|
9
|
+
size?: 'large' | 'medium' | 'small';
|
|
10
|
+
value: PDSValueOption['value'] | PDSValueOption['value'][];
|
|
11
|
+
valueArray: SegmentedButtonGroupValueOption[];
|
|
12
|
+
selectedType?: 'single' | 'multi';
|
|
13
|
+
state?: 'normal' | 'disabled';
|
|
14
|
+
onClick?: (value: PDSValueOption['value']) => void;
|
|
15
|
+
onMouseDown?: (value: PDSValueOption['value']) => void;
|
|
16
|
+
};
|
|
17
|
+
declare function SegmentedButtonGroup({ size, value, valueArray, selectedType, state, onClick, onMouseDown }: SegmentedButtonGroupProps): JSX.Element;
|
|
18
|
+
export default SegmentedButtonGroup;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __assign = (this && this.__assign) || function () {
|
|
7
|
+
__assign = Object.assign || function(t) {
|
|
8
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
+
s = arguments[i];
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
return __assign.apply(this, arguments);
|
|
16
|
+
};
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
+
var components_1 = require("../../../hybrid/components");
|
|
39
|
+
var styled_components_1 = __importStar(require("styled-components"));
|
|
40
|
+
function SegmentedButtonGroup(_a) {
|
|
41
|
+
var _b = _a.size, size = _b === void 0 ? 'medium' : _b, value = _a.value, valueArray = _a.valueArray, _c = _a.selectedType, selectedType = _c === void 0 ? 'single' : _c, _d = _a.state, state = _d === void 0 ? 'normal' : _d, onClick = _a.onClick, onMouseDown = _a.onMouseDown;
|
|
42
|
+
var handleClick = function (value) {
|
|
43
|
+
if (onClick) {
|
|
44
|
+
onClick(value);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var handleMouseDown = function (value) {
|
|
48
|
+
if (onMouseDown) {
|
|
49
|
+
onMouseDown(value);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var checkSelection = function (currentButtonValue) {
|
|
53
|
+
if (selectedType === 'multi' && Array.isArray(value)) {
|
|
54
|
+
return value.includes(currentButtonValue);
|
|
55
|
+
}
|
|
56
|
+
return value === currentButtonValue;
|
|
57
|
+
};
|
|
58
|
+
var getIconColorKey = function (isSelected, isDisabled) {
|
|
59
|
+
if (isDisabled) {
|
|
60
|
+
return 'ui_cpnt_button_icon_disabled';
|
|
61
|
+
}
|
|
62
|
+
if (isSelected) {
|
|
63
|
+
return 'ui_cpnt_button_icon_white';
|
|
64
|
+
}
|
|
65
|
+
return 'ui_cpnt_button_icon_enabled';
|
|
66
|
+
};
|
|
67
|
+
return ((0, jsx_runtime_1.jsx)(S_SegmentedButtonGroupGroups, __assign({ "x-pds-name": "SegmentedButtonGroup", "x-pds-element-type": "component", "x-pds-device-type": "desktop", selectedType: selectedType }, { children: valueArray.map(function (_a) {
|
|
68
|
+
var currentButtonValue = _a.value, iconName = _a.iconName, _b = _a.iconFillType, iconFillType = _b === void 0 ? 'line' : _b, _c = _a.state, buttonState = _c === void 0 ? 'normal' : _c;
|
|
69
|
+
return ((0, jsx_runtime_1.jsx)(S_BasicButton, __assign({ size: size, onClick: function () { return handleClick(currentButtonValue); }, onMouseDown: function () { return handleMouseDown(currentButtonValue); }, disabled: state === 'disabled' || buttonState === 'disabled', selectedType: selectedType, isSelected: checkSelection(currentButtonValue) }, { children: (0, jsx_runtime_1.jsx)(components_1.Icon, { iconName: iconName, size: size === 'small' ? 20 : 24, iconFillType: iconFillType, colorKey: getIconColorKey(checkSelection(currentButtonValue), state === 'disabled' || buttonState === 'disabled') }, void 0) }), String(currentButtonValue)));
|
|
70
|
+
}) }), void 0));
|
|
71
|
+
}
|
|
72
|
+
var S_SegmentedButtonGroupGroups = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: max-content;\n\n & > button:not(:last-child) {\n margin-right: ", ";\n }\n"], ["\n width: max-content;\n\n & > button:not(:last-child) {\n margin-right: ", ";\n }\n"])), function (_a) {
|
|
73
|
+
var selectedType = _a.selectedType, theme = _a.theme;
|
|
74
|
+
return selectedType === 'single' && theme.spacing.spacingA;
|
|
75
|
+
});
|
|
76
|
+
var large = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-radius: ", ";\n height: 48px;\n width: 48px;\n\n &:nth-child(1) {\n border-bottom-left-radius: ", ";\n border-top-left-radius: ", ";\n }\n\n &:nth-last-child(1) {\n border-bottom-right-radius: ", ";\n border-top-right-radius: ", ";\n }\n"], ["\n border-radius: ", ";\n height: 48px;\n width: 48px;\n\n &:nth-child(1) {\n border-bottom-left-radius: ", ";\n border-top-left-radius: ", ";\n }\n\n &:nth-last-child(1) {\n border-bottom-right-radius: ", ";\n border-top-right-radius: ", ";\n }\n"])), function (_a) {
|
|
77
|
+
var selectedType = _a.selectedType;
|
|
78
|
+
return selectedType === 'single' && '14px';
|
|
79
|
+
}, function (_a) {
|
|
80
|
+
var selectedType = _a.selectedType;
|
|
81
|
+
return selectedType === 'multi' && '14px';
|
|
82
|
+
}, function (_a) {
|
|
83
|
+
var selectedType = _a.selectedType;
|
|
84
|
+
return selectedType === 'multi' && '14px';
|
|
85
|
+
}, function (_a) {
|
|
86
|
+
var selectedType = _a.selectedType;
|
|
87
|
+
return selectedType === 'multi' && '14px';
|
|
88
|
+
}, function (_a) {
|
|
89
|
+
var selectedType = _a.selectedType;
|
|
90
|
+
return selectedType === 'multi' && '14px';
|
|
91
|
+
});
|
|
92
|
+
var medium = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border-radius: ", ";\n height: 40px;\n width: 40px;\n\n &:nth-child(1) {\n border-bottom-left-radius: ", ";\n border-top-left-radius: ", ";\n }\n\n &:nth-last-child(1) {\n border-bottom-right-radius: ", ";\n border-top-right-radius: ", ";\n }\n"], ["\n border-radius: ", ";\n height: 40px;\n width: 40px;\n\n &:nth-child(1) {\n border-bottom-left-radius: ", ";\n border-top-left-radius: ", ";\n }\n\n &:nth-last-child(1) {\n border-bottom-right-radius: ", ";\n border-top-right-radius: ", ";\n }\n"])), function (_a) {
|
|
93
|
+
var selectedType = _a.selectedType;
|
|
94
|
+
return selectedType === 'single' && '12px';
|
|
95
|
+
}, function (_a) {
|
|
96
|
+
var selectedType = _a.selectedType;
|
|
97
|
+
return selectedType === 'multi' && '12px';
|
|
98
|
+
}, function (_a) {
|
|
99
|
+
var selectedType = _a.selectedType;
|
|
100
|
+
return selectedType === 'multi' && '12px';
|
|
101
|
+
}, function (_a) {
|
|
102
|
+
var selectedType = _a.selectedType;
|
|
103
|
+
return selectedType === 'multi' && '12px';
|
|
104
|
+
}, function (_a) {
|
|
105
|
+
var selectedType = _a.selectedType;
|
|
106
|
+
return selectedType === 'multi' && '12px';
|
|
107
|
+
});
|
|
108
|
+
var small = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border-radius: ", ";\n height: 32px;\n width: 32px;\n\n &:nth-child(1) {\n border-bottom-left-radius: ", ";\n border-top-left-radius: ", ";\n }\n\n &:nth-last-child(1) {\n border-bottom-right-radius: ", ";\n border-top-right-radius: ", ";\n }\n"], ["\n border-radius: ", ";\n height: 32px;\n width: 32px;\n\n &:nth-child(1) {\n border-bottom-left-radius: ", ";\n border-top-left-radius: ", ";\n }\n\n &:nth-last-child(1) {\n border-bottom-right-radius: ", ";\n border-top-right-radius: ", ";\n }\n"])), function (_a) {
|
|
109
|
+
var selectedType = _a.selectedType;
|
|
110
|
+
return selectedType === 'single' && '10px';
|
|
111
|
+
}, function (_a) {
|
|
112
|
+
var selectedType = _a.selectedType;
|
|
113
|
+
return selectedType === 'multi' && '10px';
|
|
114
|
+
}, function (_a) {
|
|
115
|
+
var selectedType = _a.selectedType;
|
|
116
|
+
return selectedType === 'multi' && '10px';
|
|
117
|
+
}, function (_a) {
|
|
118
|
+
var selectedType = _a.selectedType;
|
|
119
|
+
return selectedType === 'multi' && '10px';
|
|
120
|
+
}, function (_a) {
|
|
121
|
+
var selectedType = _a.selectedType;
|
|
122
|
+
return selectedType === 'multi' && '10px';
|
|
123
|
+
});
|
|
124
|
+
var S_BasicButton = styled_components_1.default.button(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border: none;\n display: inline-flex;\n justify-content: center;\n position: relative;\n\n ", ";\n\n &::before {\n background-color: transparent;\n border-radius: inherit;\n content: '';\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n }\n\n &:hover:enabled:before {\n background-color: ", ";\n }\n\n &:active:enabled:before {\n background-color: ", ";\n }\n\n &:disabled {\n background-color: ", ";\n cursor: default;\n }\n"], ["\n align-items: center;\n background-color: ", ";\n border: none;\n display: inline-flex;\n justify-content: center;\n position: relative;\n\n ", ";\n\n &::before {\n background-color: transparent;\n border-radius: inherit;\n content: '';\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n }\n\n &:hover:enabled:before {\n background-color: ", ";\n }\n\n &:active:enabled:before {\n background-color: ", ";\n }\n\n &:disabled {\n background-color: ", ";\n cursor: default;\n }\n"])), function (_a) {
|
|
125
|
+
var isSelected = _a.isSelected, theme = _a.theme;
|
|
126
|
+
return isSelected
|
|
127
|
+
? theme.ui_cpnt_segmentedbuttongroup_base_selected
|
|
128
|
+
: theme.ui_cpnt_segmentedbuttongroup_base_default;
|
|
129
|
+
}, function (_a) {
|
|
130
|
+
var size = _a.size;
|
|
131
|
+
return size && { large: large, medium: medium, small: small }[size];
|
|
132
|
+
}, function (_a) {
|
|
133
|
+
var theme = _a.theme;
|
|
134
|
+
return theme.ui_cpnt_segmentedbuttongroup_on_base_hover;
|
|
135
|
+
}, function (_a) {
|
|
136
|
+
var theme = _a.theme;
|
|
137
|
+
return theme.ui_cpnt_segmentedbuttongroup_on_base_pressed;
|
|
138
|
+
}, function (_a) {
|
|
139
|
+
var theme = _a.theme;
|
|
140
|
+
return theme.ui_cpnt_segmentedbuttongroup_base_disabled;
|
|
141
|
+
});
|
|
142
|
+
exports.default = SegmentedButtonGroup;
|
|
143
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SegmentedButtonGroup } from './SegmentedButtonGroup';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SegmentedButtonGroup = void 0;
|
|
7
|
+
var SegmentedButtonGroup_1 = require("./SegmentedButtonGroup");
|
|
8
|
+
Object.defineProperty(exports, "SegmentedButtonGroup", { enumerable: true, get: function () { return __importDefault(SegmentedButtonGroup_1).default; } });
|
|
@@ -63,7 +63,7 @@ function Select(_a) {
|
|
|
63
63
|
return 'ui_cpnt_select_icon_01';
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
|
-
return ((0, jsx_runtime_1.jsxs)(S_Box, __assign({ "x-pds-name": "Select", "x-pds-element-type": "component", "x-pds-device-type": "desktop", size: size, responsiveMode: responsiveMode, tabIndex: 0, customWidth: customWidth }, { children: [(0, jsx_runtime_1.jsx)(S_Icon_Wrapper, __assign({ state: state }, { children: (0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: 16, fillType: "line", iconName: "ic_arrow_down", colorKey: getIconColorKey() }, void 0) }), void 0), (0, jsx_runtime_1.jsxs)(S_Select, __assign({ disabled: state === 'disabled' || state === 'read_only', state: state, colorTheme: colorTheme, onChange: handleChange, defaultValue: (_b = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value) !== null && _b !== void 0 ? _b : HINT, value: value || undefined }, { children: [hintText && ((0, jsx_runtime_1.jsx)("option", __assign({ disabled: true, value: HINT }, { children: hintText }), void 0)), valueArray.map(function (el) { return ((0, jsx_runtime_1.jsx)("option", __assign({ value: el.value }, { children: el.text }), el.value)); })] }), void 0)] }), void 0));
|
|
66
|
+
return ((0, jsx_runtime_1.jsxs)(S_Box, __assign({ "x-pds-name": "Select", "x-pds-element-type": "component", "x-pds-device-type": "desktop", "$size": size, responsiveMode: responsiveMode, tabIndex: 0, customWidth: customWidth }, { children: [(0, jsx_runtime_1.jsx)(S_Icon_Wrapper, __assign({ state: state }, { children: (0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: 16, fillType: "line", iconName: "ic_arrow_down", colorKey: getIconColorKey() }, void 0) }), void 0), (0, jsx_runtime_1.jsxs)(S_Select, __assign({ disabled: state === 'disabled' || state === 'read_only', state: state, "$size": size, colorTheme: colorTheme, onChange: handleChange, defaultValue: (_b = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value) !== null && _b !== void 0 ? _b : HINT, value: value || undefined }, { children: [hintText && ((0, jsx_runtime_1.jsx)("option", __assign({ disabled: true, value: HINT }, { children: hintText }), void 0)), valueArray.map(function (el) { return ((0, jsx_runtime_1.jsx)("option", __assign({ value: el.value }, { children: el.text }), el.value)); })] }), void 0)] }), void 0));
|
|
67
67
|
}
|
|
68
68
|
var large = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 48px;\n width: 432px;\n"], ["\n height: 48px;\n width: 432px;\n"])));
|
|
69
69
|
var medium = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 40px;\n width: 188px;\n"], ["\n height: 40px;\n width: 188px;\n"])));
|
|
@@ -97,14 +97,14 @@ var dark = (0, styled_components_1.css)(templateObject_5 || (templateObject_5 =
|
|
|
97
97
|
return theme.ui_cpnt_select_text_darktheme_enabled;
|
|
98
98
|
});
|
|
99
99
|
var S_Box = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n position: relative;\n z-index: 0;\n\n ", "\n ", ";\n ", "\n"], ["\n position: relative;\n z-index: 0;\n\n ", "\n ", ";\n ", "\n"])), function (_a) {
|
|
100
|
-
var size = _a
|
|
101
|
-
return size &&
|
|
100
|
+
var $size = _a.$size;
|
|
101
|
+
return $size &&
|
|
102
102
|
{
|
|
103
103
|
large: large,
|
|
104
104
|
medium: medium,
|
|
105
105
|
small: small,
|
|
106
106
|
rlarge: rlarge
|
|
107
|
-
}[size];
|
|
107
|
+
}[$size];
|
|
108
108
|
}, function (_a) {
|
|
109
109
|
var responsiveMode = _a.responsiveMode;
|
|
110
110
|
return responsiveMode === 'use' && 'width: 100%';
|
|
@@ -146,8 +146,14 @@ var S_Select = styled_components_1.default.select(templateObject_11 || (template
|
|
|
146
146
|
var theme = _a.theme;
|
|
147
147
|
return theme.ui_cpnt_select_border_normal;
|
|
148
148
|
}, function (_a) {
|
|
149
|
-
var size = _a
|
|
150
|
-
return
|
|
149
|
+
var $size = _a.$size;
|
|
150
|
+
return $size &&
|
|
151
|
+
{
|
|
152
|
+
small: '10px',
|
|
153
|
+
medium: '12px',
|
|
154
|
+
large: '14px',
|
|
155
|
+
rlarge: '14px'
|
|
156
|
+
}[$size];
|
|
151
157
|
}, function (_a) {
|
|
152
158
|
var theme = _a.theme;
|
|
153
159
|
return theme.ui_cpnt_select_text_hint;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { PDSTextType } from '../../../common/types';
|
|
3
|
+
export declare type Props = {
|
|
4
|
+
min: number;
|
|
5
|
+
max: number;
|
|
6
|
+
step?: number;
|
|
7
|
+
name?: string;
|
|
8
|
+
defaultValue?: string | number;
|
|
9
|
+
tooltipText?: PDSTextType;
|
|
10
|
+
state?: 'normal' | 'disabled';
|
|
11
|
+
prefixText?: PDSTextType;
|
|
12
|
+
suffixText?: PDSTextType;
|
|
13
|
+
customWidth?: string;
|
|
14
|
+
responsiveMode?: 'none' | 'use';
|
|
15
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
16
|
+
onClick?: (e: React.MouseEvent<HTMLInputElement>) => void;
|
|
17
|
+
};
|
|
18
|
+
declare const _default: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLInputElement>>;
|
|
19
|
+
export default _default;
|