awing-library 2.1.2-dev.72 → 2.1.2-dev.73

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.
@@ -92,5 +92,8 @@ export interface TableRowEditableProps<T> {
92
92
  export interface TableCellEditableProps<T extends object> {
93
93
  cellDefinition: CellDefinition<T>;
94
94
  isContainer?: boolean;
95
+ isShowCollapsible?: boolean;
96
+ isCollapsed?: boolean;
95
97
  numOfRowSpan?: number;
98
+ onToggleCollapsible?: () => void;
96
99
  }
package/dist/esm/index.js CHANGED
@@ -177625,7 +177625,10 @@ function TableCellEditable(props) {
177625
177625
  const {
177626
177626
  isContainer,
177627
177627
  cellDefinition,
177628
- numOfRowSpan
177628
+ numOfRowSpan,
177629
+ isShowCollapsible,
177630
+ isCollapsed,
177631
+ onToggleCollapsible
177629
177632
  } = props;
177630
177633
  const {
177631
177634
  TableCellProps,
@@ -177657,20 +177660,27 @@ function TableCellEditable(props) {
177657
177660
  children: renderDataInput()
177658
177661
  })
177659
177662
  }) : renderDataInput()
177660
- }) : jsxRuntimeExports.jsx(TableCell, Object.assign({
177663
+ }) : jsxRuntimeExports.jsxs(TableCell, Object.assign({
177661
177664
  sx: {
177662
177665
  p: 1,
177663
177666
  border: error ? '2px solid #ED1D25' : '1px solid rgb(224, 224, 224)'
177664
177667
  },
177665
177668
  rowSpan: numOfRowSpan
177666
177669
  }, TableCellProps, {
177667
- children: isTooltip ? jsxRuntimeExports.jsx(StyleTooltip$1, {
177670
+ children: [!!isShowCollapsible &&
177671
+ // Hiển thị icon mở rộng, ở cột đầu tiên
177672
+ jsxRuntimeExports.jsx(IconButton$1, {
177673
+ "aria-label": "expand row",
177674
+ size: "small",
177675
+ onClick: onToggleCollapsible,
177676
+ children: isCollapsed ? jsxRuntimeExports.jsx(KeyboardArrowDown, {}) : jsxRuntimeExports.jsx(KeyboardArrowRight, {})
177677
+ }), isTooltip ? jsxRuntimeExports.jsx(StyleTooltip$1, {
177668
177678
  title: getTitleTooltip && getTitleTooltip(value) || '',
177669
177679
  placement: "top-start",
177670
177680
  children: jsxRuntimeExports.jsx(Stack, {
177671
177681
  children: renderDataInput()
177672
177682
  })
177673
- }) : renderDataInput()
177683
+ }) : renderDataInput()]
177674
177684
  }));
177675
177685
  }
177676
177686
 
@@ -177777,6 +177787,9 @@ function TableRowEditable(props) {
177777
177787
  const numOfRowSpan = isMergeColumn ? convertItems.filter(c => c[fieldName] === row[fieldName]).length : 1;
177778
177788
  const error = ((_c = dataValidation === null || dataValidation === void 0 ? void 0 : dataValidation[rowIdx]) === null || _c === void 0 ? void 0 : _c[fieldName]) !== undefined && !((_d = dataValidation === null || dataValidation === void 0 ? void 0 : dataValidation[rowIdx]) === null || _d === void 0 ? void 0 : _d[fieldName]);
177779
177789
  return isDisplay && jsxRuntimeExports.jsx(TableCellEditable, {
177790
+ isShowCollapsible: idx === 0,
177791
+ isCollapsed: open,
177792
+ onToggleCollapsible: () => setOpen(!open),
177780
177793
  cellDefinition: Object.assign(Object.assign({}, colDef.editFieldDefinition), {
177781
177794
  row,
177782
177795
  TableCellProps: colDef.TableCellProps,
package/dist/index.d.ts CHANGED
@@ -1875,7 +1875,10 @@ interface TableEditableBodyProps<T> {
1875
1875
  interface TableCellEditableProps<T extends object> {
1876
1876
  cellDefinition: CellDefinition<T>;
1877
1877
  isContainer?: boolean;
1878
+ isShowCollapsible?: boolean;
1879
+ isCollapsed?: boolean;
1878
1880
  numOfRowSpan?: number;
1881
+ onToggleCollapsible?: () => void;
1879
1882
  }
1880
1883
 
1881
1884
  declare function TableEditable<T>(props: TableEditableProps<T>): react_jsx_runtime.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.2-dev.72",
3
+ "version": "2.1.2-dev.73",
4
4
  "main": "dist/esm/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/index.d.ts",