@m4l/components 9.3.10 → 9.3.12

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.
@@ -166,7 +166,7 @@ function DataGridProvider(props) {
166
166
  });
167
167
  useEffect(() => {
168
168
  const keys = new Set(columns.map((c) => c.key));
169
- if (sortSettings?.sortsColumns && !sortSettings.skipColumnValidation) {
169
+ if (sortSettings?.sortsColumns) {
170
170
  for (const sort of sortSettings.sortsColumns) {
171
171
  if (!keys.has(sort)) {
172
172
  throw new Error(
@@ -175,9 +175,9 @@ function DataGridProvider(props) {
175
175
  }
176
176
  }
177
177
  }
178
- if (filterSettings?.filterColumns && !filterSettings.skipColumnValidation) {
178
+ if (filterSettings?.filterColumns) {
179
179
  for (const filterField of filterSettings.filterColumns) {
180
- if (!keys.has(filterField.name)) {
180
+ if (!filterField.skipColumnValidation && !keys.has(filterField.name)) {
181
181
  throw new Error(
182
182
  `DataGridProvider: Fields incluye "${filterField.name}", pero no existe ninguna columna con key="${filterField.name}".`
183
183
  );
@@ -88,7 +88,6 @@ export interface SortSettings {
88
88
  sortsColumns: string[];
89
89
  sortsApplied: SortApplied[];
90
90
  onChange: (event: SortChangeEvent) => void;
91
- skipColumnValidation?: boolean;
92
91
  }
93
92
  /**---------------------------------------------------------------- */
94
93
  export type FilterChangeAdd = {
@@ -102,6 +101,7 @@ export type FilterChangeEvent = FilterChangeAdd | FilterChangeOpenPopover;
102
101
  interface FilterColumn {
103
102
  name: string;
104
103
  multiple: boolean;
104
+ skipColumnValidation?: boolean;
105
105
  }
106
106
  export type FilterApplied = {
107
107
  columnKey: string;
@@ -111,7 +111,6 @@ export interface FilterSettings {
111
111
  filterColumns: FilterColumn[];
112
112
  filtersApplied: FilterApplied[];
113
113
  onChange: (event: FilterChangeEvent) => void;
114
- skipColumnValidation?: boolean;
115
114
  }
116
115
  /**--------------------Termina tipado de filtros-------------------------------------------- */
117
116
  export interface GridProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> extends Omit<NativeDataGridProps<TRow, TSummaryRow>, 'rowKeyGetter' | 'rows' | 'columns' | 'onRowsChange' | 'selectedRows' | 'onSelectedRowsChange' | 'renderers'> {
@@ -46,6 +46,7 @@ export interface FieldBase<T extends FieldType = FieldType, TOption = any> {
46
46
  defaultOperandsArray?: Maybe<FieldTypeOperandsArray<T>>;
47
47
  selectOptions?: SelectOptions;
48
48
  selectAsyncOptions?: SelectAsyncOptions<TOption>;
49
+ skipColumnValidation?: boolean;
49
50
  }
50
51
  export interface FieldWithSelectAsync<T extends 'selectAsync', TOption = any> extends FieldBase<T, TOption> {
51
52
  selectAsyncOptions: SelectAsyncOptions<TOption>;
@@ -176,6 +176,7 @@ const Select = forwardRef(
176
176
  paddingBottom: theme.vars.size.baseSpacings.sp3,
177
177
  paddingLeft: 0,
178
178
  paddingRight: 0,
179
+ maxHeight: "200px",
179
180
  "& .MuiList-root": {
180
181
  padding: 0,
181
182
  display: "flex",
@@ -35,7 +35,12 @@ const selectStyles = {
35
35
  },
36
36
  "& .MuiSelect-select": {
37
37
  padding: `${theme.vars.size.baseSpacings.sp1}!important`,
38
- minHeight: "unset"
38
+ minHeight: "unset",
39
+ maxHeight: "80px",
40
+ overflow: "auto",
41
+ boxSizing: "border-box",
42
+ display: "flex",
43
+ flexDirection: "column"
39
44
  },
40
45
  // Estilos para la variante text
41
46
  [`&.${SELECT_CLASSES.text}`]: {
@@ -69,7 +74,8 @@ const selectStyles = {
69
74
  (height) => {
70
75
  return {
71
76
  minHeight: height,
72
- maxHeight: height
77
+ height: "fit-content",
78
+ maxHeight: "80px"
73
79
  };
74
80
  }
75
81
  )
@@ -88,7 +94,9 @@ const selectStyles = {
88
94
  display: "flex",
89
95
  alignItems: "center",
90
96
  gap: theme.vars.size.baseSpacings.sp1,
91
- flexWrap: "wrap"
97
+ flexWrap: "wrap",
98
+ overflow: "auto",
99
+ flexShrink: 1
92
100
  }),
93
101
  arrowDown: {},
94
102
  renderValueTypography: () => ({
@@ -389,7 +389,8 @@ const useDynamicFilterAndSort = (props) => {
389
389
  return {
390
390
  filterColumns: fields.map((filter) => ({
391
391
  name: filter.name,
392
- multiple: filter.multiple || false
392
+ multiple: filter.multiple || false,
393
+ skipColumnValidation: filter.skipColumnValidation || false
393
394
  })),
394
395
  filtersApplied: getCurrentFilters().map((filter) => ({
395
396
  columnKey: filter.field.name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
- "version": "9.3.10",
3
+ "version": "9.3.12",
4
4
  "license": "UNLICENSED",
5
5
  "description": "M4L Components",
6
6
  "lint-staged": {
@@ -10,8 +10,6 @@ interface DataGridRenderProps<TRow, TSummaryRow, TKey extends RowKey = RowKey> {
10
10
  visibleRefreshFilterSort?: boolean;
11
11
  withExternalSortSettings?: boolean;
12
12
  withExternalFilterSettings?: boolean;
13
- skipSortValidation?: boolean;
14
- skipFilterValidation?: boolean;
15
13
  }
16
14
  /**
17
15
  * Componente que renderiza el DataGrid para el storybook