awing-library 2.1.2-dev.75 → 2.1.2-dev.76

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.
@@ -20,6 +20,7 @@ export interface ColumnDefinition<T extends object> {
20
20
  contentGetter?: (obj: T, idx?: number) => ReactNode;
21
21
  fieldName?: string;
22
22
  isTooltip?: boolean;
23
+ label?: string;
23
24
  getTitleTooltip?: (value: T[keyof T]) => NonNullable<ReactNode>;
24
25
  }
25
26
  export type TableEditableProps<T> = {
package/dist/esm/index.js CHANGED
@@ -177760,6 +177760,7 @@ function TableRowEditable(props) {
177760
177760
  const isMergeColumn = fieldName === mergeRowsBy;
177761
177761
  const isDisplay = isMergeColumn ? itemIndex === 0 || convertItems[itemIndex - 1][fieldName] !== row[fieldName] : true;
177762
177762
  const numOfRowSpan = isMergeColumn ? convertItems.filter(c => c[fieldName] === row[fieldName]).length : 1;
177763
+ console.log('colDef', colDef);
177763
177764
  return isDisplay && jsxRuntimeExports.jsx(TableCell, Object.assign({
177764
177765
  sx: {
177765
177766
  border: '1px solid rgb(224, 224, 224)'
@@ -177872,20 +177873,29 @@ function TableRowEditable(props) {
177872
177873
  const fieldName = (_a = colDef.fieldName) !== null && _a !== void 0 ? _a : '';
177873
177874
  const isMergeColumn = fieldName === mergeRowsBy;
177874
177875
  const isDisplay = isMergeColumn ? itemIndex === 0 || convertItems[itemIndex - 1][fieldName] !== row[fieldName] : true;
177875
- return isDisplay && jsxRuntimeExports.jsx(Box$1, {
177876
- sx: {
177877
- flex: '0 1 calc(33.333% - 16px)',
177878
- boxSizing: 'border-box',
177879
- p: 2
177880
- },
177881
- children: colDef.isTooltip ? jsxRuntimeExports.jsx(StyleTooltip, {
177882
- title: colDef.getTitleTooltip && colDef.getTitleTooltip(content),
177883
- placement: "top-start",
177884
- children: jsxRuntimeExports.jsx("div", {
177885
- children: content
177886
- })
177887
- }) : colDef.contentGetter(row, rowIdx)
177888
- }, idx);
177876
+ return isDisplay && jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
177877
+ children: jsxRuntimeExports.jsxs(Box$1, {
177878
+ sx: {
177879
+ flex: '0 1 calc(33.333% - 16px)',
177880
+ boxSizing: 'border-box',
177881
+ p: 2
177882
+ },
177883
+ children: [!!colDef.label && jsxRuntimeExports.jsx(FormLabel$1, {
177884
+ sx: {
177885
+ fontSize: '0.7rem'
177886
+ },
177887
+ children: colDef.label
177888
+ }), jsxRuntimeExports.jsx(Stack, {
177889
+ children: colDef.isTooltip ? jsxRuntimeExports.jsx(StyleTooltip, {
177890
+ title: colDef.getTitleTooltip && colDef.getTitleTooltip(content),
177891
+ placement: "top-start",
177892
+ children: jsxRuntimeExports.jsx("div", {
177893
+ children: content
177894
+ })
177895
+ }) : colDef.contentGetter(row, rowIdx)
177896
+ })]
177897
+ }, idx)
177898
+ });
177889
177899
  }
177890
177900
  if (colDef.editFieldDefinition) {
177891
177901
  const {
package/dist/index.d.ts CHANGED
@@ -1822,6 +1822,7 @@ interface ColumnDefinition<T extends object> {
1822
1822
  contentGetter?: (obj: T, idx?: number) => ReactNode;
1823
1823
  fieldName?: string;
1824
1824
  isTooltip?: boolean;
1825
+ label?: string;
1825
1826
  getTitleTooltip?: (value: T[keyof T]) => NonNullable<ReactNode>;
1826
1827
  }
1827
1828
  type TableEditableProps<T> = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.2-dev.75",
3
+ "version": "2.1.2-dev.76",
4
4
  "main": "dist/esm/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/index.d.ts",