pds-dev-kit-web-test 0.3.7 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -2
- package/dist/src/common/assets/icons/fill/DeviceMobileNotification.d.ts +4 -0
- package/dist/src/common/assets/icons/fill/DeviceMobileNotification.js +30 -0
- package/dist/src/common/assets/icons/fill/index.d.ts +1 -0
- package/dist/src/common/assets/icons/fill/index.js +2 -0
- package/dist/src/common/assets/icons/line/Chapter.js +1 -1
- package/dist/src/common/assets/icons/line/DeviceMobileNotification.d.ts +4 -0
- package/dist/src/common/assets/icons/line/DeviceMobileNotification.js +30 -0
- package/dist/src/common/assets/icons/line/Pages.js +1 -1
- package/dist/src/common/assets/icons/line/VideoPlayCircle.js +1 -1
- package/dist/src/common/assets/icons/line/index.d.ts +1 -0
- package/dist/src/common/assets/icons/line/index.js +2 -0
- package/dist/src/common/index.d.ts +1 -1
- package/dist/src/common/styles/colorSet/PaletteColor_Dark.json +2 -1
- package/dist/src/common/styles/colorSet/PaletteColor_light.json +2 -1
- package/dist/src/common/styles/colorSet/UIColor.json +2 -1
- package/dist/src/common/styles/colorSet/index.d.ts +350 -347
- package/dist/src/common/styles/colorSet/index.js +3 -3
- package/dist/src/common/styles/colorSet/ui-type.d.ts +1 -0
- package/dist/src/common/types/components.d.ts +5 -0
- package/dist/src/desktop/components/ChatBubbleListItem/ChatBubbleListItem.js +5 -5
- package/dist/src/desktop/components/DesktopTabBar/DesktopTabBar.d.ts +4 -1
- package/dist/src/desktop/components/DesktopTabBar/DesktopTabBar.js +16 -4
- package/dist/src/desktop/components/Dropdown/Dropdown.d.ts +3 -2
- package/dist/src/desktop/components/Dropdown/Dropdown.js +124 -19
- package/dist/src/desktop/components/DynamicDesktopNavBar/DynamicDesktopNavBar.js +25 -6
- package/dist/src/desktop/components/DynamicDesktopNavBar/blocks/BrandLogo.d.ts +2 -1
- package/dist/src/desktop/components/DynamicDesktopNavBar/blocks/BrandLogo.js +2 -2
- package/dist/src/desktop/components/DynamicDesktopNavBar/blocks/UserProfile.d.ts +2 -2
- package/dist/src/desktop/components/DynamicDesktopNavBar/blocks/UserProfile.js +7 -5
- package/dist/src/desktop/components/DynamicDesktopNavBar/components/LogoNav.d.ts +2 -1
- package/dist/src/desktop/components/DynamicDesktopNavBar/components/LogoNav.js +12 -3
- package/dist/src/desktop/components/DynamicDesktopNavBar/templates/DynamicDesktopNavBarTemplates.d.ts +136 -1
- package/dist/src/desktop/components/DynamicDesktopNavBar/templates/constants.d.ts +141 -0
- package/dist/src/desktop/components/DynamicDesktopNavBar/templates/constants.js +141 -0
- package/dist/src/mobile/components/ChatBubbleListItem/ChatBubbleListItem.js +5 -5
- package/dist/src/mobile/components/Dropdown/Dropdown.d.ts +3 -2
- package/dist/src/mobile/components/Dropdown/Dropdown.js +123 -18
- package/dist/src/sub/DynamicLayout/components/EditModeSectionMatcher/SectionBox.js +4 -2
- package/dist/src/sub/DynamicLayout/pagesPreviewMock.d.ts +850 -8
- package/dist/src/sub/DynamicLayout/pagesPreviewMock.js +2048 -1202
- package/dist/src/sub/DynamicLayout/sections/CustomSection/CustomSection.js +1 -1
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Button/Button.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Divider/Divider.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Image/Image.js +15 -9
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/RichText/RichText.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Text/Text.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Twitter/Twitter.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/Youtube.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/effectPropParsers/index.d.ts +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/effectPropParsers/index.js +3 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/effectPropParsers/parseEffectPropHoverAnim.d.ts +19 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/effectPropParsers/parseEffectPropHoverAnim.js +51 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/effectPropParsers/types.d.ts +4 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/effectPropParsers/types.js +1 -0
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/parseProperties.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/util/types.d.ts +4 -1
- package/package.json +1 -1
- package/release-note.md +3 -3
|
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
/* eslint-disable import/order */
|
|
7
7
|
var SemanticColor_json_1 = __importDefault(require("./SemanticColor.json"));
|
|
8
8
|
var PaletteColor_Dark_json_1 = __importDefault(require("./PaletteColor_Dark.json"));
|
|
9
|
-
var PaletteColor_light_json_1 = __importDefault(require("./PaletteColor_light.json"));
|
|
10
9
|
var UIColor_json_1 = __importDefault(require("./UIColor.json"));
|
|
10
|
+
var PaletteColor_light_json_1 = __importDefault(require("./PaletteColor_light.json"));
|
|
11
11
|
var colorSet = {
|
|
12
12
|
SemanticColor: SemanticColor_json_1.default,
|
|
13
13
|
PaletteColor_Dark: PaletteColor_Dark_json_1.default,
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
UIColor: UIColor_json_1.default,
|
|
15
|
+
PaletteColor_light: PaletteColor_light_json_1.default
|
|
16
16
|
};
|
|
17
17
|
exports.default = colorSet;
|
|
@@ -21,6 +21,11 @@ export type ContextMenuItemValueOption = {
|
|
|
21
21
|
export type DropdownValueOption = ContextMenuItemValueOption & {
|
|
22
22
|
state?: 'normal' | 'disabled';
|
|
23
23
|
};
|
|
24
|
+
export type DropdownGroupInfo = {
|
|
25
|
+
key: string;
|
|
26
|
+
values: DropdownValueOption['value'][];
|
|
27
|
+
title?: PDSTextType;
|
|
28
|
+
};
|
|
24
29
|
export type AdminListDropdownValueOption = {
|
|
25
30
|
text: DropdownValueOption['text'];
|
|
26
31
|
value: DropdownValueOption['value'];
|
|
@@ -79,26 +79,26 @@ function ChatBubbleListItem(_a) {
|
|
|
79
79
|
styleTheme === 'other_avatar' ||
|
|
80
80
|
styleTheme === 'other_avatar_sub';
|
|
81
81
|
var titleTextColorTheme = 'sysTextPrimary';
|
|
82
|
-
var countTextColorTheme = '
|
|
82
|
+
var countTextColorTheme = 'sysTextPrimary';
|
|
83
83
|
switch (colorTheme) {
|
|
84
84
|
case 'grey': {
|
|
85
85
|
titleTextColorTheme = 'sysTextPrimary';
|
|
86
|
-
countTextColorTheme = '
|
|
86
|
+
countTextColorTheme = 'sysTextPrimary';
|
|
87
87
|
break;
|
|
88
88
|
}
|
|
89
89
|
case 'brand_primary': {
|
|
90
90
|
titleTextColorTheme = 'usrTextBrandPrimary';
|
|
91
|
-
countTextColorTheme = '
|
|
91
|
+
countTextColorTheme = 'sysTextPrimary';
|
|
92
92
|
break;
|
|
93
93
|
}
|
|
94
94
|
case 'translucent_white': {
|
|
95
95
|
titleTextColorTheme = 'sysTextBlack';
|
|
96
|
-
countTextColorTheme = '
|
|
96
|
+
countTextColorTheme = 'sysTextPrimary';
|
|
97
97
|
break;
|
|
98
98
|
}
|
|
99
99
|
case 'translucent_black': {
|
|
100
100
|
titleTextColorTheme = 'sysTextWhite';
|
|
101
|
-
countTextColorTheme = '
|
|
101
|
+
countTextColorTheme = 'sysTextPrimary';
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type { PDSTabItemOption, PDSTextType } from '../../../common/types';
|
|
2
|
+
import type { FillIconNameKeys, LineIconNameKeys, PDSTabItemOption, PDSTextType } from '../../../common/types';
|
|
3
3
|
type ItemArray = PDSTabItemOption & {
|
|
4
4
|
subArray?: PDSTabItemOption[];
|
|
5
|
+
iconMode?: 'none' | 'use';
|
|
6
|
+
iconName?: FillIconNameKeys | LineIconNameKeys;
|
|
7
|
+
iconFillType?: 'line' | 'fill';
|
|
5
8
|
};
|
|
6
9
|
type TextObj = {
|
|
7
10
|
title: PDSTextType;
|
|
@@ -37,9 +37,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
37
37
|
__setModuleDefault(result, mod);
|
|
38
38
|
return result;
|
|
39
39
|
};
|
|
40
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
+
};
|
|
40
43
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
44
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
42
45
|
var react_router_dom_1 = require("react-router-dom");
|
|
46
|
+
var Icon_1 = __importDefault(require("../../../hybrid/components/Icon/Icon"));
|
|
47
|
+
var Spacing_1 = __importDefault(require("../../../hybrid/components/Spacing/Spacing"));
|
|
43
48
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
44
49
|
var TextLabel_1 = require("../TextLabel");
|
|
45
50
|
function DesktopTabBar(_a) {
|
|
@@ -67,7 +72,11 @@ function DesktopTabBar(_a) {
|
|
|
67
72
|
return ((0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: item.title, textAlign: "center", styleTheme: "leadParaBold", colorTheme: item.isActive ? 'sysTextPrimary' : 'sysTextTertiary', singleLineMode: "use", letterSpacing: "-0.04em" }));
|
|
68
73
|
}
|
|
69
74
|
};
|
|
70
|
-
return ((0, jsx_runtime_1.jsxs)(S_TabBarBox, __assign({ "x-pds-name": "DesktopTabBar", "x-pds-element-type": "component", "x-pds-device-type": "desktop" }, { children: [(0, jsx_runtime_1.jsx)(S_MainTabBarSpace, __assign({ styleTheme: styleTheme, isSubTabBarActivated: isSubTabBarActivated }, { children: itemArray.map(function (item) { return ((0, jsx_runtime_1.jsxs)(S_MainTabItemBox, __assign({ styleTheme: styleTheme }, { children: [(0, jsx_runtime_1.
|
|
75
|
+
return ((0, jsx_runtime_1.jsxs)(S_TabBarBox, __assign({ "x-pds-name": "DesktopTabBar", "x-pds-element-type": "component", "x-pds-device-type": "desktop" }, { children: [(0, jsx_runtime_1.jsx)(S_MainTabBarSpace, __assign({ styleTheme: styleTheme, isSubTabBarActivated: isSubTabBarActivated }, { children: itemArray.map(function (item) { return ((0, jsx_runtime_1.jsxs)(S_MainTabItemBox, __assign({ styleTheme: styleTheme }, { children: [(0, jsx_runtime_1.jsxs)(S_MainTabItemWrapper, __assign({ text: item.title, styleTheme: styleTheme, isActive: item.isActive, onClick: function (e) { return handelClickTabItem_1(item, e); } }, { children: [textLabel_1(item, false), item.iconMode === 'use' && item.iconName && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Spacing_1.default, { size: "spacing_a", spacingType: "width" }), (0, jsx_runtime_1.jsx)(Icon_1.default, { size: styleTheme === 'main' ? 20 : 16, iconName: item.iconName || 'ic_unavailable', fillType: item.iconFillType || 'line', colorKey: item.isActive
|
|
76
|
+
? styleTheme === 'content'
|
|
77
|
+
? 'ui_cpnt_textlabel_usr_brandprimary'
|
|
78
|
+
: 'ui_cpnt_textlabel_sys_primary'
|
|
79
|
+
: 'ui_cpnt_textlabel_sys_tertiary' })] }))] })), item.isActive && item.subArray && ((0, jsx_runtime_1.jsx)(S_SubTabBarWrapper, { children: item.subArray.map(function (subItem) { return ((0, jsx_runtime_1.jsx)(S_SubTabItemWrapper, __assign({ text: subItem.title, styleTheme: styleTheme, onClick: function (e) { return handelClickTabItem_1(subItem, e); } }, { children: textLabel_1(subItem, true) }), subItem.title)); }) }))] }), item.title)); }) })), isSubTabBarActivated && (0, jsx_runtime_1.jsx)(S_SubTabBarSpace, { styleTheme: styleTheme })] })));
|
|
71
80
|
}
|
|
72
81
|
if (textArray) {
|
|
73
82
|
var isSubTabBarActivated = textArray.some(function (item) { return pathname.includes(item.path) && item.subArray; });
|
|
@@ -149,13 +158,16 @@ var S_MainTabItemBox = styled_components_1.default.div(templateObject_5 || (temp
|
|
|
149
158
|
var theme = _a.theme, styleTheme = _a.styleTheme;
|
|
150
159
|
return styleTheme === 'main' ? '20px' : theme.spacing.spacingD;
|
|
151
160
|
});
|
|
152
|
-
var S_MainTabItemWrapper = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n align-items: flex-end;\n box-sizing: border-box;\n cursor: pointer;\n display: flex;\n height: 100%;\n padding: 0 ", ";\n padding-bottom: ", ";\n
|
|
161
|
+
var S_MainTabItemWrapper = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n align-items: flex-end;\n box-sizing: border-box;\n cursor: pointer;\n display: flex;\n height: 100%;\n padding: 0 ", ";\n ", "\n ", "\n & > [x-pds-name=\"TextLabel\"] {\n padding-bottom: ", ";\n }\n & > svg {\n padding-bottom: ", ";\n }\n"], ["\n align-items: flex-end;\n box-sizing: border-box;\n cursor: pointer;\n display: flex;\n height: 100%;\n padding: 0 ", ";\n ", "\n ", "\n & > [x-pds-name=\"TextLabel\"] {\n padding-bottom: ", ";\n }\n & > svg {\n padding-bottom: ", ";\n }\n"])), function (_a) {
|
|
153
162
|
var theme = _a.theme, styleTheme = _a.styleTheme;
|
|
154
163
|
return (styleTheme === 'main' ? 0 : theme.spacing.spacingA);
|
|
155
|
-
}, function (_a) {
|
|
164
|
+
}, tabIndicator, textOffset, function (_a) {
|
|
156
165
|
var theme = _a.theme, styleTheme = _a.styleTheme;
|
|
157
166
|
return styleTheme === 'main' ? theme.spacing.spacingA : theme.spacing.spacingB;
|
|
158
|
-
},
|
|
167
|
+
}, function (_a) {
|
|
168
|
+
var theme = _a.theme, styleTheme = _a.styleTheme;
|
|
169
|
+
return styleTheme === 'main' ? theme.spacing.spacingA : '7px';
|
|
170
|
+
});
|
|
159
171
|
var S_SubTabBarWrapper = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n bottom: -33px;\n display: flex;\n height: 32px;\n left: 0px;\n position: absolute;\n width: max-content;\n"], ["\n bottom: -33px;\n display: flex;\n height: 32px;\n left: 0px;\n position: absolute;\n width: max-content;\n"])));
|
|
160
172
|
var S_SubTabBarSpace = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background-color: ", ";\n ", ";\n height: ", ";\n"], ["\n background-color: ", ";\n ", ";\n height: ", ";\n"])), function (_a) {
|
|
161
173
|
var theme = _a.theme, styleTheme = _a.styleTheme;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { PDSTextType } from '../../../common';
|
|
3
|
-
import type { DropdownValueOption } from '../../../common/types';
|
|
3
|
+
import type { DropdownGroupInfo, DropdownValueOption } from '../../../common/types';
|
|
4
4
|
type Props = {
|
|
5
5
|
colorTheme?: 'none' | 'dark' | 'white';
|
|
6
6
|
hintText?: PDSTextType;
|
|
@@ -14,7 +14,8 @@ type Props = {
|
|
|
14
14
|
customWidth?: string;
|
|
15
15
|
displayType?: 'text_only' | 'icon_only' | 'icon_text';
|
|
16
16
|
fontWeight?: 'bold' | 'regular';
|
|
17
|
+
groupInfoArray?: DropdownGroupInfo[];
|
|
17
18
|
onChange?: (option: DropdownValueOption) => void;
|
|
18
19
|
};
|
|
19
|
-
declare function Dropdown({ colorTheme, value, defaultValue, hintText, maxHeightItemNumber, responsiveMode, size, state, valueArray, customWidth, displayType, fontWeight, onChange }: Props): JSX.Element;
|
|
20
|
+
declare function Dropdown({ colorTheme, value, defaultValue, hintText, maxHeightItemNumber, responsiveMode, size, state, valueArray, customWidth, displayType, fontWeight, groupInfoArray, onChange }: Props): JSX.Element;
|
|
20
21
|
export default Dropdown;
|
|
@@ -57,7 +57,7 @@ function Dropdown(_a) {
|
|
|
57
57
|
// selectionMode = 'single',
|
|
58
58
|
_e = _a.size,
|
|
59
59
|
// selectionMode = 'single',
|
|
60
|
-
size = _e === void 0 ? 'large' : _e, _f = _a.state, state = _f === void 0 ? 'normal' : _f, valueArray = _a.valueArray, customWidth = _a.customWidth, _g = _a.displayType, displayType = _g === void 0 ? 'text_only' : _g, _h = _a.fontWeight, fontWeight = _h === void 0 ? 'regular' : _h, onChange = _a.onChange;
|
|
60
|
+
size = _e === void 0 ? 'large' : _e, _f = _a.state, state = _f === void 0 ? 'normal' : _f, valueArray = _a.valueArray, customWidth = _a.customWidth, _g = _a.displayType, displayType = _g === void 0 ? 'text_only' : _g, _h = _a.fontWeight, fontWeight = _h === void 0 ? 'regular' : _h, groupInfoArray = _a.groupInfoArray, onChange = _a.onChange;
|
|
61
61
|
var _j = (0, react_1.useState)(false), isFocused = _j[0], setIsFocused = _j[1];
|
|
62
62
|
var _k = (0, react_1.useState)(null), selectedValue = _k[0], setSelectedValue = _k[1];
|
|
63
63
|
var _l = (0, react_1.useState)(null), contextMenuSizeOffset = _l[0], setContextMenuSizeOffset = _l[1];
|
|
@@ -132,6 +132,9 @@ function Dropdown(_a) {
|
|
|
132
132
|
};
|
|
133
133
|
var handleClickOption = function (option) {
|
|
134
134
|
setIsFocused(false);
|
|
135
|
+
if (option.state === 'disabled') {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
135
138
|
if (value === undefined) {
|
|
136
139
|
setSelectedValue(option);
|
|
137
140
|
}
|
|
@@ -235,10 +238,112 @@ function Dropdown(_a) {
|
|
|
235
238
|
var LARGE_HEIGHT = 48;
|
|
236
239
|
return LARGE_HEIGHT * maxHeightItemNumber;
|
|
237
240
|
}, [size, maxHeightItemNumber]);
|
|
241
|
+
var resultByGroup = {};
|
|
242
|
+
if (groupInfoArray) {
|
|
243
|
+
groupInfoArray.forEach(function (groupInfo) {
|
|
244
|
+
var _a;
|
|
245
|
+
var currentGroupResult = [];
|
|
246
|
+
(_a = groupInfo.values) === null || _a === void 0 ? void 0 : _a.forEach(function (value) {
|
|
247
|
+
var matchingObject = valueArray.find(function (item) { return item.value === value; });
|
|
248
|
+
if (matchingObject) {
|
|
249
|
+
currentGroupResult.push(matchingObject);
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
resultByGroup[groupInfo.key] = currentGroupResult;
|
|
253
|
+
});
|
|
254
|
+
}
|
|
238
255
|
return ((0, jsx_runtime_1.jsxs)(S_Dropdown, __assign({ "x-pds-name": "Dropdown", "x-pds-element-type": "component", "x-pds-device-type": "desktop", className: "container", ref: dropdownRef, size: size, tabIndex: 0, onBlur: handleBlur, responsiveMode: responsiveMode, customWidth: customWidth, displayType: displayType }, { children: [(0, jsx_runtime_1.jsxs)(S_Select, __assign({ size: size, onClick: handleClick, isFocused: isFocused, state: state, colorTheme: colorTheme, responsiveMode: responsiveMode, customWidth: customWidth, displayType: displayType }, { children: [(0, jsx_runtime_1.jsxs)(S_TextLabel, __assign({ size: size, responsiveMode: responsiveMode, displayType: displayType }, { children: [(displayType === 'icon_only' || displayType === 'icon_text') && (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.iconName) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: size === 'small' ? 20 : 24, iconName: selectedValue.iconName, fillType: selectedValue.iconFillType, colorKey: getIconColorKey() }), displayType === 'icon_text' && (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_b", spacingType: "width" })] })), (displayType === 'text_only' || displayType === 'icon_text') && ((0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.text) || (value === null || value === void 0 ? void 0 : value.text) || (defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.text) || hintText, styleTheme: fontWeight === 'bold' ? 'form2Bold' : 'form2Regular', singleLineMode: "use", colorTheme: getTextColorTheme(), colorOverride: getTextColorOverride(), ellipsisMode: "use", lineLimit: 1, wordBreak: "break_all" }))] })), (0, jsx_runtime_1.jsx)(hybrid_1.Icon, { size: 16, fillType: "line", iconName: isFocused ? 'ic_arrow_up' : 'ic_arrow_down', colorKey: getArrowIconColorKey() })] })), isFocused &&
|
|
239
|
-
(0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(S_ContextMenuWrapper, __assign({ ref: contextMenuRef, contextMenuPositionCss: contextMenuPositionCss }, { children: (0, jsx_runtime_1.jsx)(ContextMenu_1.ContextMenu, __assign({ autoWidthMode: "use", maxHeight: maxHeight, customWidth: getCustomWidth() }, { children:
|
|
256
|
+
(0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(S_ContextMenuWrapper, __assign({ ref: contextMenuRef, contextMenuPositionCss: contextMenuPositionCss }, { children: (0, jsx_runtime_1.jsx)(ContextMenu_1.ContextMenu, __assign({ autoWidthMode: "use", maxHeight: maxHeight, customWidth: getCustomWidth() }, { children: groupInfoArray
|
|
257
|
+
? Object.keys(resultByGroup).map(function (key) {
|
|
258
|
+
var _a, _b, _c;
|
|
259
|
+
return ((0, jsx_runtime_1.jsxs)(S_Group, __assign({ size: size, hasGroupTitle: Boolean((_a = groupInfoArray.find(function (groupInfo) { return groupInfo.key === key; })) === null || _a === void 0 ? void 0 : _a.title) }, { children: [((_b = groupInfoArray.find(function (groupInfo) { return groupInfo.key === key; })) === null || _b === void 0 ? void 0 : _b.title) && ((0, jsx_runtime_1.jsx)(S_Wrapper, __assign({ size: size }, { children: (0, jsx_runtime_1.jsx)(TextLabel_1.TextLabel, { text: (_c = groupInfoArray.find(function (groupInfo) { return groupInfo.key === key; })) === null || _c === void 0 ? void 0 : _c.title, colorTheme: "sysTextSecondary", styleTheme: "caption1Bold", letterSpacing: "0.15em" }) }))), resultByGroup[key].map(function (el) { return ((0, jsx_runtime_1.jsx)("div", __assign({ onMouseDown: function () { return handleClickOption(el); } }, { children: (0, jsx_runtime_1.jsx)(ContextMenuItem_1.ContextMenuItem, { option: el, size: size, isSelected: (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.value) === el.value, state: el.state, displayType: displayType }) }), el.value)); })] }), key));
|
|
260
|
+
})
|
|
261
|
+
: valueArray.map(function (el) { return ((0, jsx_runtime_1.jsx)("div", __assign({ onMouseDown: function () { return handleClickOption(el); } }, { children: (0, jsx_runtime_1.jsx)(ContextMenuItem_1.ContextMenuItem, { option: el, size: size, isSelected: (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.value) === el.value, state: el.state, displayType: displayType }) }), el.value)); }) })) })), document.body)] })));
|
|
240
262
|
}
|
|
241
|
-
var
|
|
263
|
+
var largeGroupTitle = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding-left: ", ";\n padding-right: ", ";\n"], ["\n padding-left: ", ";\n padding-right: ", ";\n"])), function (_a) {
|
|
264
|
+
var theme = _a.theme;
|
|
265
|
+
return theme.spacing.spacingE;
|
|
266
|
+
}, function (_a) {
|
|
267
|
+
var theme = _a.theme;
|
|
268
|
+
return theme.spacing.spacingE;
|
|
269
|
+
});
|
|
270
|
+
var mediumGroupTitle = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding-left: ", ";\n padding-right: ", ";\n"], ["\n padding-left: ", ";\n padding-right: ", ";\n"])), function (_a) {
|
|
271
|
+
var theme = _a.theme;
|
|
272
|
+
return theme.spacing.spacingD;
|
|
273
|
+
}, function (_a) {
|
|
274
|
+
var theme = _a.theme;
|
|
275
|
+
return theme.spacing.spacingD;
|
|
276
|
+
});
|
|
277
|
+
var smallGroupTitle = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding-left: ", ";\n padding-right: ", ";\n"], ["\n padding-left: ", ";\n padding-right: ", ";\n"])), function (_a) {
|
|
278
|
+
var theme = _a.theme;
|
|
279
|
+
return theme.spacing.spacingD;
|
|
280
|
+
}, function (_a) {
|
|
281
|
+
var theme = _a.theme;
|
|
282
|
+
return theme.spacing.spacingD;
|
|
283
|
+
});
|
|
284
|
+
var largeGroupDivider = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n left: ", ";\n right: ", ";\n"], ["\n left: ", ";\n right: ", ";\n"])), function (_a) {
|
|
285
|
+
var theme = _a.theme;
|
|
286
|
+
return theme.spacing.spacingE;
|
|
287
|
+
}, function (_a) {
|
|
288
|
+
var theme = _a.theme;
|
|
289
|
+
return theme.spacing.spacingE;
|
|
290
|
+
});
|
|
291
|
+
var mediumGroupDivider = (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n left: ", ";\n right: ", ";\n"], ["\n left: ", ";\n right: ", ";\n"])), function (_a) {
|
|
292
|
+
var theme = _a.theme;
|
|
293
|
+
return theme.spacing.spacingD;
|
|
294
|
+
}, function (_a) {
|
|
295
|
+
var theme = _a.theme;
|
|
296
|
+
return theme.spacing.spacingD;
|
|
297
|
+
});
|
|
298
|
+
var smallGroupDivider = (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n left: ", ";\n right: ", ";\n"], ["\n left: ", ";\n right: ", ";\n"])), function (_a) {
|
|
299
|
+
var theme = _a.theme;
|
|
300
|
+
return theme.spacing.spacingD;
|
|
301
|
+
}, function (_a) {
|
|
302
|
+
var theme = _a.theme;
|
|
303
|
+
return theme.spacing.spacingD;
|
|
304
|
+
});
|
|
305
|
+
var S_Group = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n position: relative;\n\n &:not(:last-child) {\n padding-bottom: ", ";\n }\n\n &:not(:first-child) {\n padding-top: ", ";\n ", ";\n\n &:after {\n background-color: ", ";\n content: '';\n height: 1px;\n position: absolute;\n top: 0;\n\n ", ";\n }\n }\n"], ["\n position: relative;\n\n &:not(:last-child) {\n padding-bottom: ", ";\n }\n\n &:not(:first-child) {\n padding-top: ", ";\n ", ";\n\n &:after {\n background-color: ", ";\n content: '';\n height: 1px;\n position: absolute;\n top: 0;\n\n ", ";\n }\n }\n"])), function (_a) {
|
|
306
|
+
var theme = _a.theme;
|
|
307
|
+
return theme.spacing.spacingB;
|
|
308
|
+
}, function (_a) {
|
|
309
|
+
var theme = _a.theme;
|
|
310
|
+
return theme.spacing.spacingA;
|
|
311
|
+
}, function (_a) {
|
|
312
|
+
var theme = _a.theme, hasGroupTitle = _a.hasGroupTitle;
|
|
313
|
+
return hasGroupTitle
|
|
314
|
+
? "padding-top: ".concat(theme.spacing.spacingA)
|
|
315
|
+
: "padding-top: ".concat(theme.spacing.spacingB);
|
|
316
|
+
}, function (_a) {
|
|
317
|
+
var theme = _a.theme;
|
|
318
|
+
return theme.ui_cpnt_divider;
|
|
319
|
+
}, function (_a) {
|
|
320
|
+
var size = _a.size;
|
|
321
|
+
return size &&
|
|
322
|
+
{
|
|
323
|
+
large: largeGroupDivider,
|
|
324
|
+
medium: mediumGroupDivider,
|
|
325
|
+
small: smallGroupDivider
|
|
326
|
+
}[size];
|
|
327
|
+
});
|
|
328
|
+
var S_Wrapper = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n padding-bottom: ", ";\n\n ", ":first-child & {\n padding-top: ", ";\n }\n\n ", ":not(:first-child) > & {\n padding-top: ", ";\n }\n\n ", ";\n"], ["\n padding-bottom: ", ";\n\n ", ":first-child & {\n padding-top: ", ";\n }\n\n ", ":not(:first-child) > & {\n padding-top: ", ";\n }\n\n ", ";\n"])), function (_a) {
|
|
329
|
+
var theme = _a.theme;
|
|
330
|
+
return theme.spacing.spacingC;
|
|
331
|
+
}, S_Group, function (_a) {
|
|
332
|
+
var theme = _a.theme;
|
|
333
|
+
return theme.spacing.spacingA;
|
|
334
|
+
}, S_Group, function (_a) {
|
|
335
|
+
var theme = _a.theme;
|
|
336
|
+
return theme.spacing.spacingC;
|
|
337
|
+
}, function (_a) {
|
|
338
|
+
var size = _a.size;
|
|
339
|
+
return size &&
|
|
340
|
+
{
|
|
341
|
+
large: largeGroupTitle,
|
|
342
|
+
medium: mediumGroupTitle,
|
|
343
|
+
small: smallGroupTitle
|
|
344
|
+
}[size];
|
|
345
|
+
});
|
|
346
|
+
var S_TextLabel = styled_components_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n padding-right: ", ";\n\n ", ";\n"], ["\n align-items: center;\n display: flex;\n padding-right: ", ";\n\n ", ";\n"])), function (_a) {
|
|
242
347
|
var theme = _a.theme;
|
|
243
348
|
return theme.spacing.spacingB;
|
|
244
349
|
}, function (_a) {
|
|
@@ -250,7 +355,7 @@ var S_TextLabel = styled_components_1.default.div(templateObject_1 || (templateO
|
|
|
250
355
|
small: small
|
|
251
356
|
}[size];
|
|
252
357
|
});
|
|
253
|
-
var large = (0, styled_components_1.css)(
|
|
358
|
+
var large = (0, styled_components_1.css)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n height: 48px;\n width: ", ";\n\n & > div {\n height: 48px;\n line-height: 48px;\n }\n"], ["\n height: 48px;\n width: ", ";\n\n & > div {\n height: 48px;\n line-height: 48px;\n }\n"])), function (_a) {
|
|
254
359
|
var displayType = _a.displayType, responsiveMode = _a.responsiveMode;
|
|
255
360
|
if (responsiveMode === 'use') {
|
|
256
361
|
return '100%';
|
|
@@ -260,7 +365,7 @@ var large = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 =
|
|
|
260
365
|
}
|
|
261
366
|
return '432px';
|
|
262
367
|
});
|
|
263
|
-
var medium = (0, styled_components_1.css)(
|
|
368
|
+
var medium = (0, styled_components_1.css)(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n border-radius: 12px;\n height: 40px;\n width: ", ";\n\n & > div {\n height: 40px;\n line-height: 40px;\n }\n"], ["\n border-radius: 12px;\n height: 40px;\n width: ", ";\n\n & > div {\n height: 40px;\n line-height: 40px;\n }\n"])), function (_a) {
|
|
264
369
|
var displayType = _a.displayType, responsiveMode = _a.responsiveMode;
|
|
265
370
|
if (responsiveMode === 'use') {
|
|
266
371
|
return '100%';
|
|
@@ -270,7 +375,7 @@ var medium = (0, styled_components_1.css)(templateObject_3 || (templateObject_3
|
|
|
270
375
|
}
|
|
271
376
|
return '188px';
|
|
272
377
|
});
|
|
273
|
-
var small = (0, styled_components_1.css)(
|
|
378
|
+
var small = (0, styled_components_1.css)(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n border-radius: 10px;\n height: 32px;\n width: ", ";\n\n & > div {\n height: 32px;\n line-height: 32px;\n }\n"], ["\n border-radius: 10px;\n height: 32px;\n width: ", ";\n\n & > div {\n height: 32px;\n line-height: 32px;\n }\n"])), function (_a) {
|
|
274
379
|
var displayType = _a.displayType, responsiveMode = _a.responsiveMode;
|
|
275
380
|
if (responsiveMode === 'use') {
|
|
276
381
|
return '100%';
|
|
@@ -280,7 +385,7 @@ var small = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 =
|
|
|
280
385
|
}
|
|
281
386
|
return '188px';
|
|
282
387
|
});
|
|
283
|
-
var S_Dropdown = styled_components_1.default.div(
|
|
388
|
+
var S_Dropdown = styled_components_1.default.div(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n display: inline-block;\n outline: none;\n position: relative;\n\n ", ";\n\n ", "\n"], ["\n display: inline-block;\n outline: none;\n position: relative;\n\n ", ";\n\n ", "\n"])), function (_a) {
|
|
284
389
|
var size = _a.size;
|
|
285
390
|
return size &&
|
|
286
391
|
{
|
|
@@ -292,7 +397,7 @@ var S_Dropdown = styled_components_1.default.div(templateObject_5 || (templateOb
|
|
|
292
397
|
var customWidth = _a.customWidth;
|
|
293
398
|
return customWidth && "width: ".concat(customWidth, ";");
|
|
294
399
|
});
|
|
295
|
-
var colorThemeBackgroundReadOnly = (0, styled_components_1.css)(
|
|
400
|
+
var colorThemeBackgroundReadOnly = (0, styled_components_1.css)(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), function (_a) {
|
|
296
401
|
var colorTheme = _a.colorTheme, theme = _a.theme;
|
|
297
402
|
switch (colorTheme) {
|
|
298
403
|
case 'dark':
|
|
@@ -303,7 +408,7 @@ var colorThemeBackgroundReadOnly = (0, styled_components_1.css)(templateObject_6
|
|
|
303
408
|
return theme.ui_cpnt_dropdown_base_disabled;
|
|
304
409
|
}
|
|
305
410
|
});
|
|
306
|
-
var colorThemeBackgroundDisabled = (0, styled_components_1.css)(
|
|
411
|
+
var colorThemeBackgroundDisabled = (0, styled_components_1.css)(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), function (_a) {
|
|
307
412
|
var colorTheme = _a.colorTheme, theme = _a.theme;
|
|
308
413
|
switch (colorTheme) {
|
|
309
414
|
case 'dark':
|
|
@@ -314,7 +419,7 @@ var colorThemeBackgroundDisabled = (0, styled_components_1.css)(templateObject_7
|
|
|
314
419
|
return theme.ui_cpnt_dropdown_base_disabled;
|
|
315
420
|
}
|
|
316
421
|
});
|
|
317
|
-
var colorThemeBackgroundNormal = (0, styled_components_1.css)(
|
|
422
|
+
var colorThemeBackgroundNormal = (0, styled_components_1.css)(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), function (_a) {
|
|
318
423
|
var colorTheme = _a.colorTheme, theme = _a.theme;
|
|
319
424
|
switch (colorTheme) {
|
|
320
425
|
case 'dark':
|
|
@@ -325,7 +430,7 @@ var colorThemeBackgroundNormal = (0, styled_components_1.css)(templateObject_8 |
|
|
|
325
430
|
return theme.ui_cpnt_dropdown_base_normal;
|
|
326
431
|
}
|
|
327
432
|
});
|
|
328
|
-
var colorThemeBorderWhite = (0, styled_components_1.css)(
|
|
433
|
+
var colorThemeBorderWhite = (0, styled_components_1.css)(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), function (_a) {
|
|
329
434
|
var state = _a.state, theme = _a.theme;
|
|
330
435
|
switch (state) {
|
|
331
436
|
case 'disabled':
|
|
@@ -335,7 +440,7 @@ var colorThemeBorderWhite = (0, styled_components_1.css)(templateObject_9 || (te
|
|
|
335
440
|
return theme.ui_cpnt_dropdown_border_white_normal;
|
|
336
441
|
}
|
|
337
442
|
});
|
|
338
|
-
var colorThemeBorderDark = (0, styled_components_1.css)(
|
|
443
|
+
var colorThemeBorderDark = (0, styled_components_1.css)(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), function (_a) {
|
|
339
444
|
var state = _a.state, theme = _a.theme;
|
|
340
445
|
switch (state) {
|
|
341
446
|
case 'disabled':
|
|
@@ -345,7 +450,7 @@ var colorThemeBorderDark = (0, styled_components_1.css)(templateObject_10 || (te
|
|
|
345
450
|
return theme.ui_cpnt_dropdown_border_darktheme_normal;
|
|
346
451
|
}
|
|
347
452
|
});
|
|
348
|
-
var borderColor = (0, styled_components_1.css)(
|
|
453
|
+
var borderColor = (0, styled_components_1.css)(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), function (_a) {
|
|
349
454
|
var state = _a.state, theme = _a.theme;
|
|
350
455
|
switch (state) {
|
|
351
456
|
case 'disabled':
|
|
@@ -356,7 +461,7 @@ var borderColor = (0, styled_components_1.css)(templateObject_11 || (templateObj
|
|
|
356
461
|
return theme.ui_cpnt_dropdown_border_normal;
|
|
357
462
|
}
|
|
358
463
|
});
|
|
359
|
-
var backgroundHoverColor = (0, styled_components_1.css)(
|
|
464
|
+
var backgroundHoverColor = (0, styled_components_1.css)(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), function (_a) {
|
|
360
465
|
var colorTheme = _a.colorTheme, theme = _a.theme;
|
|
361
466
|
switch (colorTheme) {
|
|
362
467
|
case 'none':
|
|
@@ -369,7 +474,7 @@ var backgroundHoverColor = (0, styled_components_1.css)(templateObject_12 || (te
|
|
|
369
474
|
return theme.ui_cpnt_textfield_base_hover;
|
|
370
475
|
}
|
|
371
476
|
});
|
|
372
|
-
var backgroundActiveColor = (0, styled_components_1.css)(
|
|
477
|
+
var backgroundActiveColor = (0, styled_components_1.css)(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), function (_a) {
|
|
373
478
|
var colorTheme = _a.colorTheme, theme = _a.theme;
|
|
374
479
|
switch (colorTheme) {
|
|
375
480
|
case 'none':
|
|
@@ -382,8 +487,8 @@ var backgroundActiveColor = (0, styled_components_1.css)(templateObject_13 || (t
|
|
|
382
487
|
return theme.ui_cpnt_textfield_base_pressed;
|
|
383
488
|
}
|
|
384
489
|
});
|
|
385
|
-
var normalActionColor = (0, styled_components_1.css)(
|
|
386
|
-
var S_Select = styled_components_1.default.div(
|
|
490
|
+
var normalActionColor = (0, styled_components_1.css)(templateObject_22 || (templateObject_22 = __makeTemplateObject(["\n &:hover {\n background-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n }\n"], ["\n &:hover {\n background-color: ", ";\n }\n\n &:active {\n background-color: ", ";\n }\n"])), backgroundHoverColor, backgroundActiveColor);
|
|
491
|
+
var S_Select = styled_components_1.default.div(templateObject_23 || (templateObject_23 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n border: 2px solid\n ", ";\n border-radius: 14px;\n box-sizing: border-box;\n cursor: ", ";\n display: flex;\n justify-content: space-between;\n padding-left: ", ";\n padding-right: ", ";\n\n ", ";\n\n ", "\n\n ", "\n\n ", "\n"], ["\n align-items: center;\n background-color: ", ";\n border: 2px solid\n ", ";\n border-radius: 14px;\n box-sizing: border-box;\n cursor: ", ";\n display: flex;\n justify-content: space-between;\n padding-left: ", ";\n padding-right: ", ";\n\n ", ";\n\n ", "\n\n ", "\n\n ", "\n"])), function (_a) {
|
|
387
492
|
var state = _a.state;
|
|
388
493
|
switch (state) {
|
|
389
494
|
case 'disabled':
|
|
@@ -434,9 +539,9 @@ var S_Select = styled_components_1.default.div(templateObject_15 || (templateObj
|
|
|
434
539
|
var state = _a.state;
|
|
435
540
|
return state === 'normal' && normalActionColor;
|
|
436
541
|
});
|
|
437
|
-
var S_ContextMenuWrapper = styled_components_1.default.div(
|
|
542
|
+
var S_ContextMenuWrapper = styled_components_1.default.div(templateObject_24 || (templateObject_24 = __makeTemplateObject(["\n display: block;\n position: absolute;\n\n ", ";\n"], ["\n display: block;\n position: absolute;\n\n ", ";\n"])), function (_a) {
|
|
438
543
|
var contextMenuPositionCss = _a.contextMenuPositionCss;
|
|
439
544
|
return contextMenuPositionCss;
|
|
440
545
|
});
|
|
441
546
|
exports.default = Dropdown;
|
|
442
|
-
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;
|
|
547
|
+
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, templateObject_22, templateObject_23, templateObject_24;
|
|
@@ -59,12 +59,25 @@ exports.BasePathContext = (0, react_1.createContext)({
|
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
61
|
function DynamicDesktopNavBar(_a) {
|
|
62
|
-
var _b
|
|
63
|
-
var
|
|
64
|
-
var _e = (
|
|
62
|
+
var _b;
|
|
63
|
+
var _c = _a.isPreview, isPreview = _c === void 0 ? false : _c, template = _a.template, brandLogo = _a.brandLogo, primaryMenus = _a.primaryMenus, secondaryMenus = _a.secondaryMenus, userProfile = _a.userProfile, basePath = _a.basePath, _d = _a.colorTheme, colorTheme = _d === void 0 ? 'none' : _d;
|
|
64
|
+
var _e = templates_1.DynamicDesktopNavBarTemplates.getTemplate(template), gridStyle = _e.gridStyle, gridTemplate = _e.gridTemplate, showSecondaryMenu = _e.showSecondaryMenu, primaryMenuOptions = _e.primaryMenuOptions, secondaryMenuOptions = _e.secondaryMenuOptions, userProfileOptions = _e.userProfileOptions;
|
|
65
|
+
var _f = (0, react_1.useReducer)(reducer_1.default, reducer_1.defaultValue), state = _f[0], dispatch = _f[1];
|
|
65
66
|
var location = (0, react_router_dom_1.useLocation)();
|
|
66
67
|
var prevLocation = (0, hooks_1.usePrevious)(location.pathname + location.search);
|
|
67
68
|
var theme = (0, styled_components_1.useTheme)();
|
|
69
|
+
var profileArea = (0, react_1.useRef)(null);
|
|
70
|
+
var userProfileAreaWidth = ((_b = profileArea === null || profileArea === void 0 ? void 0 : profileArea.current) === null || _b === void 0 ? void 0 : _b.offsetWidth) || 0;
|
|
71
|
+
var GRID_GAP = 24;
|
|
72
|
+
var gridStyleMarginLeft = "".concat(userProfileAreaWidth + GRID_GAP, "px");
|
|
73
|
+
var style = template === 'W1_0011' ? __assign(__assign({}, gridStyle), { marginLeft: gridStyleMarginLeft }) : gridStyle;
|
|
74
|
+
var isFixedWidth = template === 'W1_0006' ||
|
|
75
|
+
template === 'W1_0007' ||
|
|
76
|
+
template === 'W1_0008' ||
|
|
77
|
+
template === 'W1_0009' ||
|
|
78
|
+
template === 'W1_0010';
|
|
79
|
+
var isCenteredLogo = template === 'W1_0011';
|
|
80
|
+
var navBarHeight = '63px';
|
|
68
81
|
(0, react_1.useEffect)(function () {
|
|
69
82
|
var currentSearch = (0, utils_1.getSearchExceptGivenName)(location.search, 'from');
|
|
70
83
|
var currentLocation = location.pathname + currentSearch;
|
|
@@ -80,18 +93,24 @@ function DynamicDesktopNavBar(_a) {
|
|
|
80
93
|
function handleClickInternalMenuItemNav(url) {
|
|
81
94
|
dispatch({ type: 'INTERNAL_CLICKED', payload: { clickedURL: url } });
|
|
82
95
|
}
|
|
83
|
-
return ((0, jsx_runtime_1.jsx)(exports.BasePathContext.Provider, __assign({ value: { basePath: basePath, activeMode: state.mode, handleClickInternalMenuItemNav: handleClickInternalMenuItemNav } }, { children: colorTheme === 'transparent' ? ((0, jsx_runtime_1.jsx)(styled_components_1.ThemeProvider, __assign({ theme: __assign(__assign(__assign({}, theme), (0, theme_1.themeByGivenTone)('DARK')), { ui_menu_background: theme.ui_menu_background_transparent, ui_menu_button_base: theme.ui_menu_button_base_transparent }) }, { children: (0, jsx_runtime_1.jsx)(S_DynamicDesktopNavBar, __assign({ "x-pds-name": "DynamicDesktopNavBar", "x-pds-element-type": "component", "x-pds-device-type": "desktop", isPreview: isPreview }, { children: (0, jsx_runtime_1.jsxs)(S_Grid, __assign({ className: "DynamicDesktopNavBarGrid", gridTemplate: gridTemplate, style:
|
|
96
|
+
return ((0, jsx_runtime_1.jsx)(exports.BasePathContext.Provider, __assign({ value: { basePath: basePath, activeMode: state.mode, handleClickInternalMenuItemNav: handleClickInternalMenuItemNav } }, { children: colorTheme === 'transparent' ? ((0, jsx_runtime_1.jsx)(styled_components_1.ThemeProvider, __assign({ theme: __assign(__assign(__assign({}, theme), (0, theme_1.themeByGivenTone)('DARK')), { ui_menu_background: theme.ui_menu_background_transparent, ui_menu_button_base: theme.ui_menu_button_base_transparent }) }, { children: (0, jsx_runtime_1.jsx)(S_DynamicDesktopNavBar, __assign({ "x-pds-name": "DynamicDesktopNavBar", "x-pds-element-type": "component", "x-pds-device-type": "desktop", isFixedWidth: isFixedWidth, isPreview: isPreview, navBarHeight: navBarHeight }, { children: (0, jsx_runtime_1.jsxs)(S_Grid, __assign({ className: "DynamicDesktopNavBarGrid", gridTemplate: gridTemplate, style: style }, { children: [(0, jsx_runtime_1.jsx)(blocks_1.BrandLogo, { to: brandLogo.href, logoSrc: brandLogo.src, fallbackText: brandLogo.text, isCenteredLogo: isCenteredLogo }), (0, jsx_runtime_1.jsx)(blocks_1.PrimaryMenu, { menus: slicedPrimaryMenus, showMenuAsIcon: primaryMenuOptions.showMenuAsIcon, style: primaryMenuOptions.style }), showSecondaryMenu && ((0, jsx_runtime_1.jsx)(blocks_1.SecondaryMenu, { menus: slicedSecondaryMenus, showMenuAsIcon: secondaryMenuOptions.showMenuAsIcon, style: secondaryMenuOptions.style })), (0, jsx_runtime_1.jsx)(blocks_1.UserProfile, { ref: profileArea, src: userProfile.src, to: userProfile.href, leftIconButton: userProfile.leftIconButton, overrideUserProfile: userProfile.overrideUserProfile, style: userProfileOptions.style })] })) })) }))) : ((0, jsx_runtime_1.jsx)(S_DynamicDesktopNavBar, __assign({ "x-pds-name": "DynamicDesktopNavBar", "x-pds-element-type": "component", "x-pds-device-type": "desktop", isPreview: isPreview, isFixedWidth: isFixedWidth, navBarHeight: navBarHeight }, { children: (0, jsx_runtime_1.jsxs)(S_Grid, __assign({ className: "DynamicDesktopNavBarGrid", gridTemplate: gridTemplate, style: style }, { children: [(0, jsx_runtime_1.jsx)(blocks_1.BrandLogo, { to: brandLogo.href, logoSrc: brandLogo.src, fallbackText: brandLogo.text, isCenteredLogo: isCenteredLogo }), (0, jsx_runtime_1.jsx)(blocks_1.PrimaryMenu, { menus: slicedPrimaryMenus, showMenuAsIcon: primaryMenuOptions.showMenuAsIcon, style: primaryMenuOptions.style }), showSecondaryMenu && ((0, jsx_runtime_1.jsx)(blocks_1.SecondaryMenu, { menus: slicedSecondaryMenus, showMenuAsIcon: secondaryMenuOptions.showMenuAsIcon, style: secondaryMenuOptions.style })), (0, jsx_runtime_1.jsx)(blocks_1.UserProfile, { ref: profileArea, src: userProfile.src, to: userProfile.href, leftIconButton: userProfile.leftIconButton, overrideUserProfile: userProfile.overrideUserProfile, style: userProfileOptions.style })] })) }))) })));
|
|
84
97
|
}
|
|
85
|
-
var S_Grid = (0, styled_components_1.default)(BoxLayout_1.Grid)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n gap: 24px;\n justify-items: center;\n padding-left: ", ";\n padding-right: ", ";\n"], ["\n align-items: center;\n gap: 24px;\n justify-items: center;\n padding-left: ", ";\n padding-right: ", ";\n"])), function (_a) {
|
|
98
|
+
var S_Grid = (0, styled_components_1.default)(BoxLayout_1.Grid)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n grid-column-gap: 24px;\n justify-items: center;\n padding-left: ", ";\n padding-right: ", ";\n"], ["\n align-items: center;\n grid-column-gap: 24px;\n justify-items: center;\n padding-left: ", ";\n padding-right: ", ";\n"])), function (_a) {
|
|
86
99
|
var theme = _a.theme;
|
|
87
100
|
return theme.spacing.spacingE;
|
|
88
101
|
}, function (_a) {
|
|
89
102
|
var theme = _a.theme;
|
|
90
103
|
return theme.spacing.spacingE;
|
|
91
104
|
});
|
|
92
|
-
var S_DynamicDesktopNavBar = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n display: flex;\n height:
|
|
105
|
+
var S_DynamicDesktopNavBar = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n display: flex;\n height: ", ";\n justify-content: ", ";\n min-width: ", ";\n\n * {\n box-sizing: border-box;\n }\n\n a:active {\n pointer-events: ", ";\n }\n"], ["\n background-color: ", ";\n display: flex;\n height: ", ";\n justify-content: ", ";\n min-width: ", ";\n\n * {\n box-sizing: border-box;\n }\n\n a:active {\n pointer-events: ", ";\n }\n"])), function (_a) {
|
|
93
106
|
var theme = _a.theme;
|
|
94
107
|
return theme.ui_menu_background;
|
|
108
|
+
}, function (_a) {
|
|
109
|
+
var navBarHeight = _a.navBarHeight;
|
|
110
|
+
return navBarHeight;
|
|
111
|
+
}, function (_a) {
|
|
112
|
+
var isFixedWidth = _a.isFixedWidth;
|
|
113
|
+
return isFixedWidth && 'center';
|
|
95
114
|
}, function (_a) {
|
|
96
115
|
var isPreview = _a.isPreview;
|
|
97
116
|
return (isPreview ? '1100px' : '1200px');
|
|
@@ -4,7 +4,8 @@ type Props = {
|
|
|
4
4
|
to: string;
|
|
5
5
|
logoSrc: string;
|
|
6
6
|
fallbackText: string;
|
|
7
|
+
isCenteredLogo: boolean;
|
|
7
8
|
style?: CSSProperties;
|
|
8
9
|
};
|
|
9
|
-
declare function BrandLogo({ to, logoSrc, fallbackText, style }: Props): JSX.Element;
|
|
10
|
+
declare function BrandLogo({ to, logoSrc, fallbackText, isCenteredLogo, style }: Props): JSX.Element;
|
|
10
11
|
export default BrandLogo;
|
|
@@ -22,8 +22,8 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
22
22
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
23
23
|
var LogoNav_1 = __importDefault(require("../components/LogoNav"));
|
|
24
24
|
function BrandLogo(_a) {
|
|
25
|
-
var to = _a.to, logoSrc = _a.logoSrc, fallbackText = _a.fallbackText, style = _a.style;
|
|
26
|
-
return ((0, jsx_runtime_1.jsx)(S_BrandLogo, __assign({ style: style }, { children: (0, jsx_runtime_1.jsx)(LogoNav_1.default, { to: to, logoSrc: logoSrc, fallbackText: fallbackText }) })));
|
|
25
|
+
var to = _a.to, logoSrc = _a.logoSrc, fallbackText = _a.fallbackText, isCenteredLogo = _a.isCenteredLogo, style = _a.style;
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(S_BrandLogo, __assign({ style: style }, { children: (0, jsx_runtime_1.jsx)(LogoNav_1.default, { to: to, logoSrc: logoSrc, fallbackText: fallbackText, isCenteredLogo: isCenteredLogo }) })));
|
|
27
27
|
}
|
|
28
28
|
var S_BrandLogo = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n grid-area: BRAND_LOGO;\n"], ["\n display: flex;\n grid-area: BRAND_LOGO;\n"])));
|
|
29
29
|
exports.default = BrandLogo;
|
|
@@ -7,5 +7,5 @@ type Props = {
|
|
|
7
7
|
overrideUserProfile?: React.ReactNode;
|
|
8
8
|
style?: CSSProperties;
|
|
9
9
|
};
|
|
10
|
-
declare
|
|
11
|
-
export default
|
|
10
|
+
declare const _default: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export default _default;
|
|
@@ -19,14 +19,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
22
|
+
var react_1 = require("react");
|
|
22
23
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
23
24
|
var Navigations_1 = require("../../../../common/components/Navigations");
|
|
24
25
|
var hybrid_1 = require("../../../../hybrid");
|
|
25
|
-
function UserProfile(_a) {
|
|
26
|
+
function UserProfile(_a, ref) {
|
|
26
27
|
var src = _a.src, to = _a.to, overrideUserProfile = _a.overrideUserProfile, leftIconButton = _a.leftIconButton, style = _a.style;
|
|
27
|
-
return ((0, jsx_runtime_1.jsx)(S_UserProfile, __assign({ style: style }, { children: overrideUserProfile ? (overrideUserProfile) : ((0, jsx_runtime_1.jsxs)(S_ImageViewWrapper, { children: [leftIconButton && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [leftIconButton, (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_b", spacingType: "width" })] })), (0, jsx_runtime_1.jsx)(Navigations_1.NavLink, __assign({ to: to }, { children: (0, jsx_runtime_1.jsx)(hybrid_1.ImageView, { width: 32, ratio: "1_1", scaleType: "cover", shapeType: "circular", src: src, borderMode: "use" }) }))] })) })));
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(S_UserProfile, __assign({ style: style, ref: ref }, { children: overrideUserProfile ? ((0, jsx_runtime_1.jsx)(S_OverrideUserProfile, { children: overrideUserProfile })) : ((0, jsx_runtime_1.jsxs)(S_ImageViewWrapper, { children: [leftIconButton && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [leftIconButton, (0, jsx_runtime_1.jsx)(hybrid_1.Spacing, { size: "spacing_b", spacingType: "width" })] })), (0, jsx_runtime_1.jsx)(Navigations_1.NavLink, __assign({ to: to }, { children: (0, jsx_runtime_1.jsx)(hybrid_1.ImageView, { width: 32, ratio: "1_1", scaleType: "cover", shapeType: "circular", src: src, borderMode: "use" }) }))] })) })));
|
|
28
29
|
}
|
|
29
30
|
var S_UserProfile = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n grid-area: USER_PROFILE;\n justify-content: flex-end;\n"], ["\n display: flex;\n grid-area: USER_PROFILE;\n justify-content: flex-end;\n"])));
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
var S_OverrideUserProfile = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: max-content;\n"], ["\n width: max-content;\n"])));
|
|
32
|
+
var S_ImageViewWrapper = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n"], ["\n align-items: center;\n display: flex;\n"])));
|
|
33
|
+
exports.default = (0, react_1.forwardRef)(UserProfile);
|
|
34
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -3,6 +3,7 @@ type Props = {
|
|
|
3
3
|
to: string;
|
|
4
4
|
logoSrc: string;
|
|
5
5
|
fallbackText: string;
|
|
6
|
+
isCenteredLogo: boolean;
|
|
6
7
|
};
|
|
7
|
-
declare function LogoNav({ to, logoSrc, fallbackText }: Props): JSX.Element;
|
|
8
|
+
declare function LogoNav({ to, logoSrc, fallbackText, isCenteredLogo }: Props): JSX.Element;
|
|
8
9
|
export default LogoNav;
|
|
@@ -23,10 +23,19 @@ var styled_components_1 = __importDefault(require("styled-components"));
|
|
|
23
23
|
var __1 = require("../../..");
|
|
24
24
|
var NavLink_1 = __importDefault(require("../../../../common/components/Navigations/NavLink"));
|
|
25
25
|
function LogoNav(_a) {
|
|
26
|
-
var to = _a.to, logoSrc = _a.logoSrc, fallbackText = _a.fallbackText;
|
|
27
|
-
return ((0, jsx_runtime_1.jsx)(NavLink_1.default, __assign({ to: to }, { children: (0, jsx_runtime_1.jsx)(S_Box, { children: logoSrc ? ((0, jsx_runtime_1.jsx)(S_Logo, { src: logoSrc })) : ((0, jsx_runtime_1.jsx)(__1.D_TextLabel, { text: fallbackText, styleTheme: "headingBold", ellipsisMode: "use", lineLimit: 1 })) }) })));
|
|
26
|
+
var to = _a.to, logoSrc = _a.logoSrc, fallbackText = _a.fallbackText, isCenteredLogo = _a.isCenteredLogo;
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(NavLink_1.default, __assign({ to: to }, { children: (0, jsx_runtime_1.jsx)(S_Box, __assign({ isCenteredLogo: isCenteredLogo }, { children: logoSrc ? ((0, jsx_runtime_1.jsx)(S_Logo, { src: logoSrc })) : ((0, jsx_runtime_1.jsx)(__1.D_TextLabel, { text: fallbackText, styleTheme: "headingBold", ellipsisMode: "use", lineLimit: 1 })) })) })));
|
|
28
28
|
}
|
|
29
|
-
var S_Box = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n height: 48px;\n width:
|
|
29
|
+
var S_Box = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n height: 48px;\n justify-content: ", ";\n max-width: ", ";\n width: ", ";\n"], ["\n align-items: center;\n display: flex;\n height: 48px;\n justify-content: ", ";\n max-width: ", ";\n width: ", ";\n"])), function (_a) {
|
|
30
|
+
var isCenteredLogo = _a.isCenteredLogo;
|
|
31
|
+
return isCenteredLogo && 'center';
|
|
32
|
+
}, function (_a) {
|
|
33
|
+
var isCenteredLogo = _a.isCenteredLogo;
|
|
34
|
+
return isCenteredLogo && '180px';
|
|
35
|
+
}, function (_a) {
|
|
36
|
+
var isCenteredLogo = _a.isCenteredLogo;
|
|
37
|
+
return (isCenteredLogo ? 'max-content' : '180px');
|
|
38
|
+
});
|
|
30
39
|
var S_Logo = styled_components_1.default.img(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n max-height: 100%;\n max-width: 100%;\n object-fit: contain;\n object-position: left;\n"], ["\n max-height: 100%;\n max-width: 100%;\n object-fit: contain;\n object-position: left;\n"])));
|
|
31
40
|
exports.default = LogoNav;
|
|
32
41
|
var templateObject_1, templateObject_2;
|