pds-dev-kit-web 2.2.54 → 2.2.56

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.
@@ -19,12 +19,77 @@ 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");
23
+ var smoothscroll_polyfill_1 = __importDefault(require("smoothscroll-polyfill"));
22
24
  var styled_components_1 = __importDefault(require("styled-components"));
25
+ var __1 = require("../../..");
26
+ var hooks_1 = require("../../../../common/hooks");
23
27
  var MenuItemNav_1 = require("../components/MenuItemNav");
28
+ // NOTE: safari-scroll-behavior-smooth polyfill
29
+ smoothscroll_polyfill_1.default.polyfill();
30
+ var DESKTOP_SCROLL_LEFT = 320;
24
31
  function SecondaryMenu(_a) {
25
32
  var menus = _a.menus, showMenuAsIcon = _a.showMenuAsIcon, style = _a.style;
26
- return ((0, jsx_runtime_1.jsx)(S_Main_SecondaryMenu, __assign({ style: style }, { children: menus.map(function (menu, index) { return ((0, jsx_runtime_1.jsx)(MenuItemNav_1.MenuItemNav, { menu: menu, showMenuAsIcon: showMenuAsIcon }, index)); }) })));
33
+ var _b = (0, react_1.useState)({ node: null }), primaryRef = _b[0], setPrimaryRef = _b[1];
34
+ var primaryCallbackRef = (0, react_1.useCallback)(function (node) {
35
+ if (!node) {
36
+ return;
37
+ }
38
+ setPrimaryRef({ node: node });
39
+ }, [menus]);
40
+ (0, react_1.useEffect)(function () {
41
+ if (!primaryRef.node) {
42
+ return;
43
+ }
44
+ primaryRef.node.addEventListener('wheel', handleScroll);
45
+ function handleScroll(e) {
46
+ if (primaryRef.node) {
47
+ primaryRef.node.scrollTo({ left: primaryRef.node.scrollLeft + e.deltaY });
48
+ }
49
+ }
50
+ return function () {
51
+ if (!primaryRef.node) {
52
+ return;
53
+ }
54
+ primaryRef.node.removeEventListener('scroll', handleScroll);
55
+ };
56
+ }, [primaryRef]);
57
+ var _c = (0, hooks_1.useDetectOverflow)(primaryRef, true), trigger = _c.trigger, isOverflow = _c.isOverflow, isScrollBoxStart = _c.isScrollBoxStart, isScrollBoxEnd = _c.isScrollBoxEnd;
58
+ var onClickLeftButton = function () {
59
+ primaryRef.node &&
60
+ primaryRef.node.scroll({
61
+ left: primaryRef.node.scrollLeft - DESKTOP_SCROLL_LEFT,
62
+ behavior: 'smooth'
63
+ });
64
+ };
65
+ var onClickRightButton = function () {
66
+ primaryRef.node &&
67
+ primaryRef.node.scroll({
68
+ left: primaryRef.node.scrollLeft + DESKTOP_SCROLL_LEFT,
69
+ behavior: 'smooth'
70
+ });
71
+ };
72
+ return ((0, jsx_runtime_1.jsxs)(S_SecondaryMenu, __assign({ style: style }, { children: [isOverflow && !isScrollBoxStart && ((0, jsx_runtime_1.jsx)(S_LeftButtonWrapper, { children: (0, jsx_runtime_1.jsx)(S_ButtonWrapper, { children: (0, jsx_runtime_1.jsx)(__1.D_IconButton, { fillType: "fill", baseSize: "medium", baseColorKey: "ui_menu_background", iconName: "ic_arrow_left", iconFillType: "line", iconColorKey: "ui_cpnt_button_icon_default", shapeType: "circular", iconSize: 20, onClick: onClickLeftButton }) }) })), (0, jsx_runtime_1.jsx)(S_Main_SecondaryMenu, __assign({ style: style, onScroll: function () { return trigger(); }, ref: primaryCallbackRef }, { children: menus.map(function (menu, index) { return ((0, jsx_runtime_1.jsx)(MenuItemNav_1.MenuItemNav, { menu: menu, showMenuAsIcon: showMenuAsIcon }, index)); }) })), isOverflow && !isScrollBoxEnd && ((0, jsx_runtime_1.jsx)(S_RightButtonWrapper, { children: (0, jsx_runtime_1.jsx)(S_ButtonWrapper, { children: (0, jsx_runtime_1.jsx)(__1.D_IconButton, { fillType: "fill", baseSize: "medium", baseColorKey: "ui_menu_background", iconName: "ic_arrow_right", iconFillType: "line", iconColorKey: "ui_cpnt_button_icon_default", shapeType: "circular", iconSize: 20, onClick: onClickRightButton }) }) }))] })));
27
73
  }
28
- var S_Main_SecondaryMenu = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n grid-area: SECONDARY_MENU;\n"], ["\n display: flex;\n grid-area: SECONDARY_MENU;\n"])));
74
+ var S_Main_SecondaryMenu = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n grid-area: SECONDARY_MENU;\n overflow-x: auto;\n overscroll-behavior-y: none;\n width: max-content;\n\n & > div:first-child {\n margin-left: 32px;\n }\n"], ["\n display: flex;\n grid-area: SECONDARY_MENU;\n overflow-x: auto;\n overscroll-behavior-y: none;\n width: max-content;\n\n & > div:first-child {\n margin-left: 32px;\n }\n"])));
75
+ var S_SecondaryMenu = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n height: 48px;\n max-height: 100%;\n max-width: 100%;\n overflow-x: hidden;\n overflow-y: hidden;\n position: relative;\n width: 100%;\n"], ["\n display: flex;\n height: 48px;\n max-height: 100%;\n max-width: 100%;\n overflow-x: hidden;\n overflow-y: hidden;\n position: relative;\n width: 100%;\n"])));
76
+ var S_RightButtonWrapper = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n height: 100%;\n position: absolute;\n right: 0;\n\n &::before {\n background: ", ";\n content: '';\n display: block;\n height: 100%;\n pointer-events: none;\n width: 50px;\n }\n"], ["\n align-items: center;\n display: flex;\n height: 100%;\n position: absolute;\n right: 0;\n\n &::before {\n background: ", ";\n content: '';\n display: block;\n height: 100%;\n pointer-events: none;\n width: 50px;\n }\n"])), function (_a) {
77
+ var theme = _a.theme;
78
+ return "linear-gradient(to left, ".concat(theme.ui_menu_background, " 10%, ").concat(theme.ui_cpnt_pg_gradient_02, " 90%)");
79
+ });
80
+ var S_LeftButtonWrapper = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n align-items: center;\n display: flex;\n height: 100%;\n left: 0;\n position: absolute;\n\n &::after {\n background: ", ";\n content: '';\n display: block;\n height: 100%;\n pointer-events: none;\n width: 50px;\n }\n"], ["\n align-items: center;\n display: flex;\n height: 100%;\n left: 0;\n position: absolute;\n\n &::after {\n background: ", ";\n content: '';\n display: block;\n height: 100%;\n pointer-events: none;\n width: 50px;\n }\n"])), function (_a) {
81
+ var theme = _a.theme;
82
+ return "linear-gradient(to right, ".concat(theme.ui_menu_background, " 20%, ").concat(theme.ui_cpnt_pg_gradient_02, " 80%)");
83
+ });
84
+ var S_ButtonWrapper = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n display: flex;\n height: 50px;\n\n & > button {\n background-color: ", ";\n\n * path {\n stroke: ", ";\n }\n }\n"], ["\n align-items: center;\n background-color: ", ";\n display: flex;\n height: 50px;\n\n & > button {\n background-color: ", ";\n\n * path {\n stroke: ", ";\n }\n }\n"])), function (_a) {
85
+ var theme = _a.theme;
86
+ return theme.ui_menu_background;
87
+ }, function (_a) {
88
+ var theme = _a.theme;
89
+ return theme.ui_menu_button_base;
90
+ }, function (_a) {
91
+ var theme = _a.theme;
92
+ return theme.ui_temp_grey_02;
93
+ });
29
94
  exports.default = SecondaryMenu;
30
- var templateObject_1;
95
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
@@ -237,7 +237,6 @@ declare class DynamicDesktopNavBarTemplates {
237
237
  style: {
238
238
  width: string;
239
239
  justifyContent: string;
240
- paddingLeft: string;
241
240
  };
242
241
  };
243
242
  userProfileOptions: {
@@ -243,7 +243,6 @@ export declare const TEMPLATES_DATA: {
243
243
  style: {
244
244
  width: string;
245
245
  justifyContent: string;
246
- paddingLeft: string;
247
246
  };
248
247
  };
249
248
  userProfileOptions: {
@@ -74,7 +74,7 @@ exports.TEMPLATES_DATA = {
74
74
  showSecondaryMenu: false,
75
75
  primaryMenuOptions: {
76
76
  showMenuAsIcon: false,
77
- maxLength: 5,
77
+ maxLength: 99,
78
78
  style: {
79
79
  justifyContent: 'flex-end'
80
80
  }
@@ -188,7 +188,7 @@ exports.TEMPLATES_DATA = {
188
188
  showSecondaryMenu: false,
189
189
  primaryMenuOptions: {
190
190
  showMenuAsIcon: false,
191
- maxLength: 5,
191
+ maxLength: 99,
192
192
  style: {
193
193
  justifyContent: 'flex-end'
194
194
  }
@@ -235,18 +235,17 @@ exports.TEMPLATES_DATA = {
235
235
  showSecondaryMenu: true,
236
236
  primaryMenuOptions: {
237
237
  showMenuAsIcon: false,
238
- maxLength: 3,
238
+ maxLength: 99,
239
239
  style: {
240
240
  justifyContent: 'right'
241
241
  }
242
242
  },
243
243
  secondaryMenuOptions: {
244
244
  showMenuAsIcon: false,
245
- maxLength: 2,
245
+ maxLength: 99,
246
246
  style: {
247
247
  width: '100%',
248
- justifyContent: 'left',
249
- paddingLeft: '32px'
248
+ justifyContent: 'left'
250
249
  }
251
250
  },
252
251
  userProfileOptions: {
@@ -239,7 +239,9 @@ var CustomSection = (0, react_1.forwardRef)(function CustomSection(props, ref) {
239
239
  return;
240
240
  }
241
241
  if (!['COLLISION_SELECT', 'BULK_SELECT'].includes(shortcutKeyMode !== null && shortcutKeyMode !== void 0 ? shortcutKeyMode : '')) {
242
- breakGroupCB();
242
+ if (id !== selectedCB) {
243
+ breakGroupCB();
244
+ }
243
245
  }
244
246
  setSelectedCB(id);
245
247
  if (sectionActionHandler) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web",
3
- "version": "2.2.54",
3
+ "version": "2.2.56",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
package/release-note.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # PDS-DEV-KIT-WEB Release Notes
2
- ## [v2.2.54]
2
+ ## [v2.2.56]
3
3
  ## urgent|https://design.storybook.publ.biz/
4
4
 
5
- ### component
6
- * DesktopHeaderBar
7
- * type_b일때 아이콘 변경 (ic_light_bulb -> ic_question)
8
- * Icon
9
- * ic_shoppingbag 모양 수정
5
+ ### sub
6
+ * component
7
+ - SecondaryMenu
8
+ - primaryMenu 처럼 스크롤 추가
9
+ - primaryMenuOptions, secondaryMenuOptions max length 수정
@@ -1,3 +0,0 @@
1
- {
2
- "presets": ["es2015"]
3
- }