@acvl/frontend-components 0.0.84 → 0.0.85

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.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _mui_material from '@mui/material';
2
2
  import { ButtonProps, ButtonGroupProps, IconButtonProps, MenuItemProps, BoxProps, AutocompleteProps, SliderProps, SwitchProps, GridProps, DrawerProps, SxProps, Theme, StackProps, TypographyProps, MenuProps, PaletteColorOptions, TextFieldProps as TextFieldProps$1, InputBaseProps, DialogProps, DialogContentProps } from '@mui/material';
3
3
  import * as React$1 from 'react';
4
- import React__default, { ReactNode, Dispatch, SetStateAction, JSX, RefObject, ReactElement, FC, BaseSyntheticEvent, JSXElementConstructor, ElementType } from 'react';
4
+ import React__default, { ReactNode, Dispatch, SetStateAction, JSX, RefObject, ReactElement, ComponentType, FC, BaseSyntheticEvent, JSXElementConstructor, ElementType } from 'react';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { GridRowId, GridRowSelectionModel, GridSortModel, GridFilterModel, GridRowModesModel, GridRenderEditCellParams, GridToolbarProps, DataGridProps as DataGridProps$1, GridApi, GridPaginationModel, GridColumnVisibilityModel, useGridApiRef, GridColDef } from '@mui/x-data-grid';
7
7
  import { DataGridProps, GridBaseColDef } from '@mui/x-data-grid/internals';
@@ -2056,11 +2056,40 @@ interface ExtraCreateOptionProps {
2056
2056
  icon: any;
2057
2057
  onClick: () => void;
2058
2058
  }
2059
+ /**
2060
+ * What the CSV upload slot receives — the props of the built-in `CSVUpload`, so a project's own
2061
+ * drawer is a drop-in replacement rather than a different contract.
2062
+ *
2063
+ * The menu, the option list and the open/close state stay with the grid; what a replacement owns
2064
+ * is the drawer's contents and what it does with the file.
2065
+ */
2066
+ interface CSVUploadSlotProps {
2067
+ open: boolean;
2068
+ drawerToggle: () => void;
2069
+ data?: CSVMenuOptionProps;
2070
+ postAction?: (response: any) => void;
2071
+ }
2059
2072
  interface ServerGridCreateApi {
2060
2073
  extraOptions?: ExtraCreateOptionProps[];
2061
2074
  csv_upload?: {
2062
2075
  enable: boolean;
2063
2076
  extraOptions?: CSVMenuOptionProps[];
2077
+ /**
2078
+ * Replaces the built-in `CSVUpload` drawer for this grid, keeping its menu item.
2079
+ *
2080
+ * The import dialog is where a project's own upload policy lives — what a backend
2081
+ * accepts alongside the file, which of those a given user may choose, and what it does
2082
+ * with a job that answers 202 instead of a result. That is not shared between projects
2083
+ * even when the file picker is, so the slot exists instead of the library growing
2084
+ * options for each backend it might face.
2085
+ *
2086
+ * Omitted, the grid renders the built-in drawer exactly as before.
2087
+ *
2088
+ * Pass a **stable** component — hoisted, or memoised at the call site. An arrow defined
2089
+ * inline is a new component type on every render, which unmounts the drawer and loses
2090
+ * the file the user had already chosen.
2091
+ */
2092
+ component?: ComponentType<CSVUploadSlotProps>;
2064
2093
  };
2065
2094
  navigationOptions?: NavigateOptions;
2066
2095
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acvl/frontend-components",
3
- "version": "0.0.84",
3
+ "version": "0.0.85",
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",