awing-library 2.1.2-dev.80 → 2.1.2-dev.82

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.
@@ -7,6 +7,7 @@ export type CellDefinition<T extends object> = FieldDefinitionProps<T> & {
7
7
  isTooltip?: boolean;
8
8
  row?: Partial<T>;
9
9
  getTitleTooltip?: (value: T[keyof T]) => NonNullable<ReactNode>;
10
+ maxWidth?: string | number;
10
11
  };
11
12
  export interface ColumnDefinition<T extends object> {
12
13
  headerName: ReactNode;
@@ -97,4 +98,5 @@ export interface TableCellEditableProps<T extends object> {
97
98
  isCollapsed?: boolean;
98
99
  numOfRowSpan?: number;
99
100
  onToggleCollapsible?: () => void;
101
+ maxWidth?: string | number;
100
102
  }
package/dist/esm/index.js CHANGED
@@ -123438,6 +123438,7 @@ function SelectInput(fieldDefinition) {
123438
123438
  onValidateCustom
123439
123439
  } = fieldDefinition,
123440
123440
  other = __rest$1(fieldDefinition, ["name", "multiple", "value", "onChange", "error", "disableHelperText", "helperText", "options", "row", "onDisabledSelectItem", "required", "onValidateCustom"]);
123441
+ console.log("111 fieldDefinition", fieldDefinition, other);
123441
123442
  const onValidate = val => {
123442
123443
  const newValue = val;
123443
123444
  if (onValidateCustom) {
@@ -123603,6 +123604,7 @@ function InputFactory(fieldDefinition) {
123603
123604
  const {
123604
123605
  type
123605
123606
  } = fieldDefinition;
123607
+ console.log("fieldDefinition", fieldDefinition);
123606
123608
  switch (type) {
123607
123609
  case FIELD_TYPE.LOGIC_EXPRESSION:
123608
123610
  {
@@ -177628,7 +177630,8 @@ function TableCellEditable(props) {
177628
177630
  numOfRowSpan,
177629
177631
  isShowCollapsible,
177630
177632
  isCollapsed,
177631
- onToggleCollapsible
177633
+ onToggleCollapsible,
177634
+ maxWidth
177632
177635
  } = props;
177633
177636
  const {
177634
177637
  TableCellProps,
@@ -177652,6 +177655,7 @@ function TableCellEditable(props) {
177652
177655
  });
177653
177656
  return jsxRuntimeExports.jsx(InputFactory, Object.assign({}, inputProps, {
177654
177657
  sx: {
177658
+ maxWidth,
177655
177659
  '& .MuiInput-input': {
177656
177660
  textAlign: isContainer ? 'left' : undefined
177657
177661
  }
@@ -177766,7 +177770,6 @@ function TableRowEditable(props) {
177766
177770
  const isMergeColumn = fieldName === mergeRowsBy;
177767
177771
  const isDisplay = isMergeColumn ? itemIndex === 0 || convertItems[itemIndex - 1][fieldName] !== row[fieldName] : true;
177768
177772
  const numOfRowSpan = isMergeColumn ? convertItems.filter(c => c[fieldName] === row[fieldName]).length : 1;
177769
- console.log('colDef', colDef);
177770
177773
  return isDisplay && jsxRuntimeExports.jsx(TableCell, Object.assign({
177771
177774
  sx: {
177772
177775
  border: '1px solid rgb(224, 224, 224)'
@@ -177774,7 +177777,8 @@ function TableRowEditable(props) {
177774
177777
  }, colDef.TableCellProps, {
177775
177778
  rowSpan: numOfRowSpan
177776
177779
  }, idx === 0 ? {
177777
- width: '15%'
177780
+ width: '15%',
177781
+ maxWidth: "200px"
177778
177782
  } : {}, {
177779
177783
  children: jsxRuntimeExports.jsxs(Box$1, {
177780
177784
  display: "flex",
@@ -177802,7 +177806,8 @@ function TableRowEditable(props) {
177802
177806
  }
177803
177807
  if (colDef.editFieldDefinition) {
177804
177808
  const {
177805
- fieldName
177809
+ fieldName,
177810
+ maxWidth
177806
177811
  } = colDef.editFieldDefinition;
177807
177812
  const currentValue = (_b = row[fieldName]) !== null && _b !== void 0 ? _b : '';
177808
177813
  const isMergeColumn = fieldName === mergeRowsBy;
@@ -177810,6 +177815,7 @@ function TableRowEditable(props) {
177810
177815
  const numOfRowSpan = isMergeColumn ? convertItems.filter(c => c[fieldName] === row[fieldName]).length : 1;
177811
177816
  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]);
177812
177817
  return isDisplay && jsxRuntimeExports.jsx(TableCellEditable, {
177818
+ maxWidth: maxWidth,
177813
177819
  isShowCollapsible: idx === 0,
177814
177820
  isCollapsed: open,
177815
177821
  onToggleCollapsible: () => setOpen(!open),
@@ -178337,7 +178343,9 @@ function TableEditable(props) {
178337
178343
  children: [jsxRuntimeExports.jsxs(TableContainer, {
178338
178344
  component: Paper$1,
178339
178345
  sx: {
178340
- // overflow: 'hidden',
178346
+ overflow: 'hidden',
178347
+ width: 'fit-content',
178348
+ maxWidth: '100%'
178341
178349
  },
178342
178350
  children: [selected && onSelectedChange && selected.length > 0 && selectionActions && jsxRuntimeExports.jsx(TopBarActions, {
178343
178351
  selected: selected,
package/dist/index.d.ts CHANGED
@@ -1809,6 +1809,7 @@ type CellDefinition<T extends object> = FieldDefinitionProps$1<T> & {
1809
1809
  isTooltip?: boolean;
1810
1810
  row?: Partial<T>;
1811
1811
  getTitleTooltip?: (value: T[keyof T]) => NonNullable<ReactNode>;
1812
+ maxWidth?: string | number;
1812
1813
  };
1813
1814
  interface ColumnDefinition<T extends object> {
1814
1815
  headerName: ReactNode;
@@ -1880,6 +1881,7 @@ interface TableCellEditableProps<T extends object> {
1880
1881
  isCollapsed?: boolean;
1881
1882
  numOfRowSpan?: number;
1882
1883
  onToggleCollapsible?: () => void;
1884
+ maxWidth?: string | number;
1883
1885
  }
1884
1886
 
1885
1887
  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.80",
3
+ "version": "2.1.2-dev.82",
4
4
  "main": "dist/esm/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/index.d.ts",