@acvl/frontend-components 0.0.7 → 0.0.9

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.
@@ -1,4 +1,4 @@
1
1
  export { default as Base } from './Base';
2
2
  export * from './cells';
3
3
  export * from './columns';
4
- export { GridColDefPropsOverrides } from './types';
4
+ export { GridColDefPropsOverrides, GridArgs, MyDataGridProps, MyGridFilterModel } from './types';
@@ -1,4 +1,5 @@
1
1
  import { JSX } from "react";
2
+ import { JSONParserProps } from "../../forms";
2
3
  import { GridColDefPropsOverrides } from "../types";
3
4
  import { BaseGridProps } from "../Base";
4
5
  import { EditGridColumnsProps } from "../columns";
@@ -9,14 +10,7 @@ export interface EditGridAPIProps {
9
10
  options?: {
10
11
  [key: string]: unknown[] | undefined;
11
12
  };
12
- parser?: {
13
- [key: string]: {
14
- ignore?: boolean;
15
- format?: string;
16
- extra_validation?: (value: string) => boolean;
17
- alter_key?: (key: string) => string;
18
- };
19
- };
13
+ parser?: JSONParserProps;
20
14
  dnd?: {
21
15
  field: string;
22
16
  args?: {
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { ButtonProps, ButtonGroupProps, AlertProps, AutocompleteProps, SliderPro
3
3
  import * as React from 'react';
4
4
  import React__default, { ReactNode, Dispatch, SetStateAction, JSX, RefObject } from 'react';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
- import { GridRowId, GridRowSelectionModel, GridRowModesModel, GridRenderEditCellParams, DataGridProps as DataGridProps$1 } from '@mui/x-data-grid';
6
+ import { GridRowId, GridRowSelectionModel, GridSortModel, GridFilterModel, GridRowModesModel, GridRenderEditCellParams, DataGridProps as DataGridProps$1 } from '@mui/x-data-grid';
7
7
  import { DataGridProps, GridBaseColDef } from '@mui/x-data-grid/internals';
8
8
  import * as zod_v4_core from 'zod/v4/core';
9
9
  import * as zod from 'zod';
@@ -113,6 +113,13 @@ interface ComoOpcionesProps {
113
113
  variation?: string;
114
114
  }
115
115
 
116
+ interface GridArgs {
117
+ page?: number;
118
+ pageSize?: number;
119
+ sortModel: GridSortModel;
120
+ filterModel: GridFilterModel;
121
+ ignoreSort?: boolean;
122
+ }
116
123
  interface GridColDefPropsOverrides extends GridBaseColDef {
117
124
  extra?: {
118
125
  queryArgs?: ComoOpcionesProps;
@@ -141,6 +148,38 @@ interface MyDataGridProps extends DataGridProps {
141
148
  loadingParams?: any[];
142
149
  }
143
150
 
151
+ interface JSONParserProps {
152
+ [key: string]: {
153
+ ignore?: boolean;
154
+ format?: string;
155
+ extra_validation?: (value: any) => boolean;
156
+ alter_key?: (key: string) => string;
157
+ alter_value?: (value: any, row: any) => string;
158
+ };
159
+ }
160
+ interface JSONFormProps {
161
+ submitData: any;
162
+ data?: any;
163
+ useLabel?: boolean;
164
+ props?: JSONParserProps;
165
+ }
166
+ declare const jsonForm: ({ submitData, data, useLabel, props }: JSONFormProps) => any;
167
+ declare const formDataForm: (object: any) => FormData;
168
+ declare const setErrors: (form: any, error: any) => void;
169
+
170
+ declare const valueLabel: zod.ZodObject<{
171
+ value: coerce.ZodCoercedString<unknown>;
172
+ label: zod.ZodString;
173
+ }, zod_v4_core.$strip>;
174
+
175
+ interface CSVUploadProps {
176
+ postAction?: (response: any) => void;
177
+ open: boolean;
178
+ drawerToggle: () => void;
179
+ data?: CSVMenuOptionProps$1;
180
+ }
181
+ declare const CSVUpload: React__default.FC<CSVUploadProps>;
182
+
144
183
  interface EditGridColumnsProps {
145
184
  displayEdit?: boolean;
146
185
  rowModesModel: GridRowModesModel;
@@ -165,14 +204,7 @@ interface EditGridAPIProps {
165
204
  options?: {
166
205
  [key: string]: unknown[] | undefined;
167
206
  };
168
- parser?: {
169
- [key: string]: {
170
- ignore?: boolean;
171
- format?: string;
172
- extra_validation?: (value: string) => boolean;
173
- alter_key?: (key: string) => string;
174
- };
175
- };
207
+ parser?: JSONParserProps;
176
208
  dnd?: {
177
209
  field: string;
178
210
  args?: {
@@ -240,38 +272,6 @@ declare function renderEditCellWithErrorTooltip(params: GridRenderEditCellParams
240
272
 
241
273
  declare const MyGridEditSingleSelect: React__default.FC<GridRenderEditCellParams>;
242
274
 
243
- interface JSONParserProps {
244
- [key: string]: {
245
- ignore?: boolean;
246
- format?: string;
247
- extra_validation?: (value: any) => boolean;
248
- alter_key?: (key: string) => string;
249
- alter_value?: (value: any, row: any) => string;
250
- };
251
- }
252
- interface JSONFormProps {
253
- submitData: any;
254
- data?: any;
255
- useLabel?: boolean;
256
- props?: JSONParserProps;
257
- }
258
- declare const jsonForm: ({ submitData, data, useLabel, props }: JSONFormProps) => any;
259
- declare const formDataForm: (object: any) => FormData;
260
- declare const setErrors: (form: any, error: any) => void;
261
-
262
- declare const valueLabel: zod.ZodObject<{
263
- value: coerce.ZodCoercedString<unknown>;
264
- label: zod.ZodString;
265
- }, zod_v4_core.$strip>;
266
-
267
- interface CSVUploadProps {
268
- postAction?: (response: any) => void;
269
- open: boolean;
270
- drawerToggle: () => void;
271
- data?: CSVMenuOptionProps$1;
272
- }
273
- declare const CSVUpload: React__default.FC<CSVUploadProps>;
274
-
275
275
  interface BaseControlledFieldProps {
276
276
  name: string;
277
277
  label?: string;
@@ -764,4 +764,4 @@ declare module '@mui/material/styles' {
764
764
  declare const theme: () => _mui_material.Theme;
765
765
 
766
766
  export { APIContext, APIProvider, ActiveCell, Base, ButtonWithDrawer, CSVUpload, ContentLayout, ControlledDate, ControlledDropdown, FileUploadBox as ControlledFileUploadBox, ControlledNumber, ControlledPhoneNumber, ControlledSelect, ControlledSlider, ControlledSwitch, ControlledText, ControlledTimePicker, ControlledToggleButtons, CoverPage, CreateButtonBase, CreateButtonWithMenuOptions, DeleteButton, DeleteConfirmationDialog, DetailPage, EditButton, HistorialDrawer, ListPage, Loadable, LoadingComponent, Logo, MainDrawer, MenuItemWithLoading, ModuleCard, MyGridEditSingleSelect, NavigationContext, NavigationProvider, NormalOrIcon, NotAllowed, NotFound, ObjectProgressStack, SaveCancelButton, StatusBadge, StyledMenu, Tabs, Transitions, UncontrolledText, changeTitle, closeProgressSnack, deleteColumn, editColumn, filterQuery, formDataForm, _default as headerReducer, jsonForm, manualCacheRefresh, mergeSettings, openProgressSnack, query, renderEditCellWithErrorTooltip, setErrors, _default$1 as snackProgressReducer, tags, theme, updateProgressSnackData, useAPI, useHasPermission, useNavigation, valueLabel };
767
- export type { APIcontextProps, ComoOpcionesProps, DeleteGridColumnsProps, EditGridColumnsProps, GridColDefPropsOverrides, JSONFormProps, JSONParserProps, MyTab, MyTabProps, PageType };
767
+ export type { APIcontextProps, ComoOpcionesProps, DeleteGridColumnsProps, EditGridColumnsProps, GridArgs, GridColDefPropsOverrides, JSONFormProps, JSONParserProps, MyDataGridProps, MyGridFilterModel, MyTab, MyTabProps, PageType };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acvl/frontend-components",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "Component library for ACV frontend projects.",
5
5
  "homepage": "https://github.com/ACV-Logistics/acv-frontend-components#readme",
6
6
  "access": "public",