@acvl/frontend-components 0.0.6 → 0.0.8

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,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?: {
@@ -4,6 +4,7 @@ export interface JSONParserProps {
4
4
  format?: string;
5
5
  extra_validation?: (value: any) => boolean;
6
6
  alter_key?: (key: string) => string;
7
+ alter_value?: (value: any, row: any) => string;
7
8
  };
8
9
  }
9
10
  export interface JSONFormProps {
@@ -0,0 +1,11 @@
1
+ interface Props {
2
+ name: string;
3
+ label?: string;
4
+ control: any;
5
+ fieldProps?: any;
6
+ extraProps?: {
7
+ disableHT?: boolean;
8
+ };
9
+ }
10
+ declare const ControlledTimePicker: (props: Props) => import("react/jsx-runtime").JSX.Element;
11
+ export default ControlledTimePicker;
@@ -0,0 +1,2 @@
1
+ export declare const convertValueToDayjs: (value: any, type: "datetime" | "date" | "time") => {} | null;
2
+ export declare const handleChange: (value: any, type: "datetime" | "date" | "time", onChange: (newVal: any) => void) => void;
@@ -8,3 +8,4 @@ export { default as ControlledSlider } from './ControlledSlider';
8
8
  export { default as ControlledSwitch } from './ControlledSwitch';
9
9
  export { default as ControlledText } from './ControlledText';
10
10
  export { default as ControlledToggleButtons } from './ControlledToggleButtons';
11
+ export { default as ControlledTimePicker } from './ControlledTimePicker';
@@ -12,7 +12,7 @@ export interface SectionProps {
12
12
  description?: string;
13
13
  fields?: FieldProps[];
14
14
  arrayFields?: ArrayFieldProps[];
15
- content?: ReactNode;
15
+ content?: (data: any) => ReactNode;
16
16
  pageType?: PageType;
17
17
  edit?: {
18
18
  readOnlyFields?: EditReadOnlyFields;
package/dist/index.d.ts CHANGED
@@ -141,6 +141,38 @@ interface MyDataGridProps extends DataGridProps {
141
141
  loadingParams?: any[];
142
142
  }
143
143
 
144
+ interface JSONParserProps {
145
+ [key: string]: {
146
+ ignore?: boolean;
147
+ format?: string;
148
+ extra_validation?: (value: any) => boolean;
149
+ alter_key?: (key: string) => string;
150
+ alter_value?: (value: any, row: any) => string;
151
+ };
152
+ }
153
+ interface JSONFormProps {
154
+ submitData: any;
155
+ data?: any;
156
+ useLabel?: boolean;
157
+ props?: JSONParserProps;
158
+ }
159
+ declare const jsonForm: ({ submitData, data, useLabel, props }: JSONFormProps) => any;
160
+ declare const formDataForm: (object: any) => FormData;
161
+ declare const setErrors: (form: any, error: any) => void;
162
+
163
+ declare const valueLabel: zod.ZodObject<{
164
+ value: coerce.ZodCoercedString<unknown>;
165
+ label: zod.ZodString;
166
+ }, zod_v4_core.$strip>;
167
+
168
+ interface CSVUploadProps {
169
+ postAction?: (response: any) => void;
170
+ open: boolean;
171
+ drawerToggle: () => void;
172
+ data?: CSVMenuOptionProps$1;
173
+ }
174
+ declare const CSVUpload: React__default.FC<CSVUploadProps>;
175
+
144
176
  interface EditGridColumnsProps {
145
177
  displayEdit?: boolean;
146
178
  rowModesModel: GridRowModesModel;
@@ -165,14 +197,7 @@ interface EditGridAPIProps {
165
197
  options?: {
166
198
  [key: string]: unknown[] | undefined;
167
199
  };
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
- };
200
+ parser?: JSONParserProps;
176
201
  dnd?: {
177
202
  field: string;
178
203
  args?: {
@@ -240,37 +265,6 @@ declare function renderEditCellWithErrorTooltip(params: GridRenderEditCellParams
240
265
 
241
266
  declare const MyGridEditSingleSelect: React__default.FC<GridRenderEditCellParams>;
242
267
 
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
- };
250
- }
251
- interface JSONFormProps {
252
- submitData: any;
253
- data?: any;
254
- useLabel?: boolean;
255
- props?: JSONParserProps;
256
- }
257
- declare const jsonForm: ({ submitData, data, useLabel, props }: JSONFormProps) => any;
258
- declare const formDataForm: (object: any) => FormData;
259
- declare const setErrors: (form: any, error: any) => void;
260
-
261
- declare const valueLabel: zod.ZodObject<{
262
- value: coerce.ZodCoercedString<unknown>;
263
- label: zod.ZodString;
264
- }, zod_v4_core.$strip>;
265
-
266
- interface CSVUploadProps {
267
- postAction?: (response: any) => void;
268
- open: boolean;
269
- drawerToggle: () => void;
270
- data?: CSVMenuOptionProps$1;
271
- }
272
- declare const CSVUpload: React__default.FC<CSVUploadProps>;
273
-
274
268
  interface BaseControlledFieldProps {
275
269
  name: string;
276
270
  label?: string;
@@ -299,13 +293,13 @@ interface ControlledDropdownProps extends BaseControlledFieldProps {
299
293
  }
300
294
  declare const ControlledDropdown: React__default.FC<ControlledDropdownProps>;
301
295
 
302
- interface Props$3 {
296
+ interface Props$4 {
303
297
  name: string;
304
298
  control: any;
305
299
  setValid: (value: boolean) => void;
306
300
  csvProps: any;
307
301
  }
308
- declare const FileUploadBox: (props: Props$3) => react_jsx_runtime.JSX.Element;
302
+ declare const FileUploadBox: (props: Props$4) => react_jsx_runtime.JSX.Element;
309
303
 
310
304
  interface ControlledNumberProps extends BaseControlledFieldProps {
311
305
  fieldProps?: Partial<NumericFormatProps<any>>;
@@ -363,6 +357,17 @@ interface ControlledToggleButtonsProps extends BaseControlledFieldProps {
363
357
  }
364
358
  declare const ControlledToggleButtons: React__default.FC<ControlledToggleButtonsProps>;
365
359
 
360
+ interface Props$3 {
361
+ name: string;
362
+ label?: string;
363
+ control: any;
364
+ fieldProps?: any;
365
+ extraProps?: {
366
+ disableHT?: boolean;
367
+ };
368
+ }
369
+ declare const ControlledTimePicker: (props: Props$3) => react_jsx_runtime.JSX.Element;
370
+
366
371
  interface UncontrolledTextProps {
367
372
  name: string;
368
373
  label: string;
@@ -457,7 +462,7 @@ interface SectionProps {
457
462
  description?: string;
458
463
  fields?: FieldProps[];
459
464
  arrayFields?: ArrayFieldProps[];
460
- content?: ReactNode;
465
+ content?: (data: any) => ReactNode;
461
466
  pageType?: PageType;
462
467
  edit?: {
463
468
  readOnlyFields?: EditReadOnlyFields;
@@ -751,5 +756,5 @@ declare module '@mui/material/styles' {
751
756
  }
752
757
  declare const theme: () => _mui_material.Theme;
753
758
 
754
- export { APIContext, APIProvider, ActiveCell, Base, ButtonWithDrawer, CSVUpload, ContentLayout, ControlledDate, ControlledDropdown, FileUploadBox as ControlledFileUploadBox, ControlledNumber, ControlledPhoneNumber, ControlledSelect, ControlledSlider, ControlledSwitch, ControlledText, 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 };
759
+ 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 };
755
760
  export type { APIcontextProps, ComoOpcionesProps, DeleteGridColumnsProps, EditGridColumnsProps, GridColDefPropsOverrides, JSONFormProps, JSONParserProps, MyTab, MyTabProps, PageType };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acvl/frontend-components",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
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",