awing-library 2.1.2-dev.75 → 2.1.2-dev.77
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)'
|
|
@@ -177864,7 +177865,7 @@ function TableRowEditable(props) {
|
|
|
177864
177865
|
},
|
|
177865
177866
|
display: "flex",
|
|
177866
177867
|
flexWrap: "wrap",
|
|
177867
|
-
gap:
|
|
177868
|
+
gap: 1,
|
|
177868
177869
|
children: fieldDefinitions === null || fieldDefinitions === void 0 ? void 0 : fieldDefinitions.map((colDef, idx) => {
|
|
177869
177870
|
var _a, _b, _c, _d;
|
|
177870
177871
|
if (colDef.contentGetter) {
|
|
@@ -177872,20 +177873,32 @@ 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(
|
|
177876
|
-
|
|
177877
|
-
|
|
177878
|
-
|
|
177879
|
-
|
|
177880
|
-
|
|
177881
|
-
|
|
177882
|
-
|
|
177883
|
-
|
|
177884
|
-
|
|
177885
|
-
|
|
177886
|
-
|
|
177887
|
-
|
|
177888
|
-
|
|
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
|
+
sx: {
|
|
177890
|
+
textAlign: "left"
|
|
177891
|
+
},
|
|
177892
|
+
children: colDef.isTooltip ? jsxRuntimeExports.jsx(StyleTooltip, {
|
|
177893
|
+
title: colDef.getTitleTooltip && colDef.getTitleTooltip(content),
|
|
177894
|
+
placement: "top-start",
|
|
177895
|
+
children: jsxRuntimeExports.jsx("div", {
|
|
177896
|
+
children: content
|
|
177897
|
+
})
|
|
177898
|
+
}) : colDef.contentGetter(row, rowIdx)
|
|
177899
|
+
})]
|
|
177900
|
+
}, idx)
|
|
177901
|
+
});
|
|
177889
177902
|
}
|
|
177890
177903
|
if (colDef.editFieldDefinition) {
|
|
177891
177904
|
const {
|
|
@@ -177900,7 +177913,8 @@ function TableRowEditable(props) {
|
|
|
177900
177913
|
sx: {
|
|
177901
177914
|
flex: '0 1 calc(33.333% - 16px)',
|
|
177902
177915
|
boxSizing: 'border-box',
|
|
177903
|
-
p: 2
|
|
177916
|
+
p: 2,
|
|
177917
|
+
textAlign: "left!important"
|
|
177904
177918
|
},
|
|
177905
177919
|
children: jsxRuntimeExports.jsx(TableCellEditable, {
|
|
177906
177920
|
isContainer: true,
|
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> = {
|