pds-dev-kit-web 2.2.143 → 2.2.144

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.
@@ -27,12 +27,6 @@ function FlexGridItem(_a) {
27
27
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
28
28
  var defaultHeight = getMaxHeight(cb.jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT, device, rowHeight);
29
29
  var gridArea = getGridAreaFromCB(cb.jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT, device);
30
- // const zIndex =
31
- // device === 'DESKTOP'
32
- // ? cb.jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT.CB_PLACEMENT_PROP_PLACEMENT_SPEC_ZINDEX
33
- // : cb.jsonProperties.data.CB_PLACEMENT_PROP_PLACEMENT[
34
- // 'CB_PLACEMENT_PROP_PLACEMENT_SPEC_ZINDEX:MOBILE'
35
- // ];
36
30
  return ((0, jsx_runtime_1.jsx)(GridItem, __assign({ "data-cb-id": cb.id, style: {
37
31
  zIndex: zIndex,
38
32
  gridArea: gridArea
@@ -51,24 +45,26 @@ function getMaxHeight(props, device, rowHeight) {
51
45
  var height = rowsMobile * rowHeight + (rowsMobile - 1) * gap;
52
46
  return height;
53
47
  }
48
+ function clamp(num, min, max) {
49
+ return Math.max(Math.min(num, max), min);
50
+ }
54
51
  function getGridAreaFromCB(props, device) {
55
52
  var CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX = props.CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX, CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTY = props.CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTY, cols = props.CB_PLACEMENT_PROP_PLACEMENT_SPEC_COLS, rows = props.CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS;
56
53
  if (device === 'DESKTOP') {
57
- var colStart_1 = CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX + 1;
58
- var rowStart_1 = CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTY + 1;
59
- var rowEnd_1 = rows + rowStart_1;
60
- var colEnd_1 = cols + colStart_1;
61
- // <grid-row-start> / <grid-column-start> / <grid-row-end> / <grid-column-end>;
54
+ var colStart_1 = clamp(CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX + 1, 1, Math.max(1, 25 - cols));
55
+ var rowStart_1 = clamp(CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTY + 1, 1, Infinity);
56
+ var rowEnd_1 = clamp(rows + rowStart_1, rowStart_1 + 1, Infinity);
57
+ var colEnd_1 = clamp(colStart_1 + cols, colStart_1 + 1, 25);
62
58
  return "".concat(rowStart_1, " / ").concat(colStart_1, " / ").concat(rowEnd_1, " / ").concat(colEnd_1);
63
59
  }
64
60
  var startXMobile = props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTX:MOBILE'];
65
61
  var startYMobile = props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_STARTY:MOBILE'];
66
62
  var colsMobile = props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_COLS:MOBILE'];
67
63
  var rowsMobile = props['CB_PLACEMENT_PROP_PLACEMENT_SPEC_ROWS:MOBILE'];
68
- var colStart = startXMobile + 1;
69
- var rowStart = startYMobile + 1;
70
- var rowEnd = rowsMobile + rowStart;
71
- var colEnd = colsMobile + colStart;
64
+ var colStart = clamp(startXMobile + 1, 1, Math.max(1, 9 - colsMobile));
65
+ var rowStart = clamp(startYMobile + 1, 1, Infinity);
66
+ var rowEnd = clamp(rowsMobile + rowStart, rowStart + 1, Infinity);
67
+ var colEnd = clamp(colStart + colsMobile, colStart + 1, 9);
72
68
  return "".concat(rowStart, " / ").concat(colStart, " / ").concat(rowEnd, " / ").concat(colEnd);
73
69
  }
74
70
  exports.default = FlexGridItem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web",
3
- "version": "2.2.143",
3
+ "version": "2.2.144",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",
package/release-note.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # PDS-DEV-KIT-WEB Release Notes
2
- ## [v2.2.143]
2
+ ## [v2.2.144]
3
3
  ## daily|https://design.storybook.publ.biz/
4
4
 
5
5
  ### 업데이트 사항
6
- * [PDS-1283] 선택되지 않은 섹션의 CB가 선택될 수 있는 상황 픽스
6
+ * [PDS-1284] 커스텀 섹션 렌더러에 clamp 기능 추가