@acvl/frontend-components 0.0.76 → 0.0.78

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
@@ -2478,6 +2478,22 @@ interface DetailFormDrawerProps {
2478
2478
  permissionsPath?: string;
2479
2479
  /** Runs after a successful mutation, before the drawer closes. Receives the response. */
2480
2480
  onSuccess?: (response: any) => void;
2481
+ /**
2482
+ * Guardar deja el cajón abierto —y editando— en vez de cerrarlo. El usuario lo cierra
2483
+ * cuando termina, con la X o con Cancelar.
2484
+ *
2485
+ * Para registros que se capturan de a poco, o que llevan dentro su propia grilla editable:
2486
+ * ahí cerrar al guardar cuesta reabrir el registro, volver a entrar a editar y volver a
2487
+ * bajar hasta donde se iba. El caso que lo pide es un cajón anidado —una orden de envío
2488
+ * abierta desde la pestaña de su embarque, con la grilla de sus recibos adentro—, donde el
2489
+ * cierre además se lleva la grilla de en medio.
2490
+ *
2491
+ * Un guardado que **no** guardó igual cierra: `useMutationHandler` corre su `onSuccess` sin
2492
+ * respuesta ante un 403 para quitar la pantalla de en medio, y eso no es algo en lo que
2493
+ * quedarse. Tampoco compite con "Guardar ↓" — ése ya se queda abierto por su cuenta, y
2494
+ * cuando los dos aplican gana el paso al siguiente registro, que es lo que se pidió.
2495
+ */
2496
+ keepOpenOnSave?: boolean;
2481
2497
  /**
2482
2498
  * Acciones propias del registro —cerrar, revertir, descargar su PDF—, las mismas que
2483
2499
  * `DetailPage_v2` recibe en `slots.extraButtons` y con la misma forma, para que un registro
@@ -2579,8 +2595,12 @@ interface DetailFormDrawerProps {
2579
2595
  * captured down a list in one pass without the hands leaving the keyboard. Rename it with
2580
2596
  * `labels.saveAndNext`. Guardar sits outside the `<form>` and submits via the native
2581
2597
  * `form={formId}` attribute; Guardar ↓ submits by hand, so the implicit Enter stays Guardar.
2598
+ *
2599
+ * `keepOpenOnSave` cambia lo que hace Guardar cuando no hay a dónde avanzar: en vez de cerrar,
2600
+ * deja el registro en pantalla y editando — para formularios que se capturan de a poco o que
2601
+ * llevan una grilla adentro.
2582
2602
  */
2583
- declare function DetailFormDrawer({ open, onClose, title, api, form, sections, pageType, startInEdit, recordKey, permissionsPath, onSuccess, extraButtons, navigation, width, anchor, variant, resizable, minWidth, maxWidth, widthStorageKey, onWidthChange, responsiveTo, containerBreakpoints, labels, slots, slotProps, }: DetailFormDrawerProps): react_jsx_runtime.JSX.Element;
2603
+ declare function DetailFormDrawer({ open, onClose, title, api, form, sections, pageType, startInEdit, recordKey, permissionsPath, onSuccess, keepOpenOnSave, extraButtons, navigation, width, anchor, variant, resizable, minWidth, maxWidth, widthStorageKey, onWidthChange, responsiveTo, containerBreakpoints, labels, slots, slotProps, }: DetailFormDrawerProps): react_jsx_runtime.JSX.Element;
2584
2604
 
2585
2605
  interface DrawerGridDrawerConfig {
2586
2606
  /** Shared field layout, used by every mode. Same shape as `DetailPage_v2`'s `form`/`sections`. */
@@ -2697,6 +2717,14 @@ interface DrawerGridDrawerConfig {
2697
2717
  * without a list to walk there is nothing to continue to.
2698
2718
  */
2699
2719
  showNavigator?: boolean;
2720
+ /**
2721
+ * Guardar deja el cajón abierto y editando en vez de cerrarlo; se cierra con la X o con
2722
+ * Cancelar. Para registros que se capturan de a poco, o que llevan su propia grilla
2723
+ * editable adentro y perderían el lugar al cerrarse.
2724
+ *
2725
+ * @see DetailFormDrawerProps.keepOpenOnSave
2726
+ */
2727
+ keepOpenOnSave?: boolean;
2700
2728
  /** Rótulos del pie del cajón. `saveAndNext` por defecto es `"Guardar ↓"`. */
2701
2729
  labels?: {
2702
2730
  save?: string;
@@ -2756,6 +2784,10 @@ interface DrawerGridProps {
2756
2784
  * open-edit-save-reopen per row — and with the shortcut, without leaving the keyboard. It
2757
2785
  * rides on the navigator — no navigator, or last row, and there is just Guardar.
2758
2786
  *
2787
+ * `drawer.keepOpenOnSave` hace que Guardar no cierre: el registro se queda en pantalla y
2788
+ * editando. Vale la pena donde el cajón lleva su propia grilla adentro —cerrarlo se lleva
2789
+ * también lo que se estaba capturando ahí— o donde el registro se llena en varias pasadas.
2790
+ *
2759
2791
  * Edit mode is opt-in with `api.edit: {}` and adds nothing to the grid but a toolbar toggle —
2760
2792
  * no mutation, no actions column, no in-grid editing. While it's on, a row click opens the
2761
2793
  * record drawer already editing, provided the record allows it; the drawer form is the only
@@ -3109,11 +3141,29 @@ interface DetachedPage {
3109
3141
  title: string;
3110
3142
  path: string;
3111
3143
  breadcrumbs: Breadcrumb[];
3144
+ /**
3145
+ * El título en singular, para cuando la heurística no dé con él.
3146
+ * @see MainLayoutPageHeaderProps.singularTitles
3147
+ */
3148
+ singularTitle?: string;
3112
3149
  }
3113
3150
  interface MainLayoutPageHeaderProps extends PageHeaderProps {
3114
3151
  fullScreen?: boolean;
3115
3152
  detachedPages?: DetachedPage[];
3116
3153
  documentTitleSuffix?: string;
3154
+ /**
3155
+ * Títulos en singular declarados a mano, indexados por la ruta de la página
3156
+ * (`{ "/cobranza/ordenes-de-envio": "Orden de envío" }`).
3157
+ *
3158
+ * El singular se deduce del título de la navegación —"Embarques" nombra a sus
3159
+ * registros "Embarque 1234" y a su formulario "Crear embarque"—, y deducirlo es una
3160
+ * heurística: acierta en los plurales regulares y se queda corta en los que la
3161
+ * morfología española no deja resolver ("Meses" y "Bases" se escriben igual y se
3162
+ * singularizan distinto), en los títulos con dos núcleos ("Órdenes de envíos") y en
3163
+ * los que no son un plural en absoluto. Aquí se declara el que haga falta.
3164
+ * @see singularizarTitulo
3165
+ */
3166
+ singularTitles?: Record<string, string>;
3117
3167
  /**
3118
3168
  * El padding horizontal del panel de contenido, que el `MainLayout` le pasa tal cual.
3119
3169
  *
@@ -3201,6 +3251,16 @@ interface MainLayoutProps {
3201
3251
  detachedPages?: DetachedPage[];
3202
3252
  /** Sufijo del `document.title` (ej. "Embarques" => "Título | Embarques"). */
3203
3253
  documentTitleSuffix?: string;
3254
+ /**
3255
+ * Títulos en singular declarados a mano, indexados por la ruta de la página
3256
+ * (`{ "/cobranza/ordenes-de-envio": "Orden de envío" }`).
3257
+ *
3258
+ * El `PageHeader` nombra los registros con el título de su página puesto en singular
3259
+ * ("Embarques" → "Embarque 1234", "Crear embarque"), y lo deduce con una heurística
3260
+ * de plurales españoles. Aquí se corrige la que no acierte.
3261
+ * @see MainLayoutPageHeaderProps.singularTitles
3262
+ */
3263
+ singularTitles?: Record<string, string>;
3204
3264
  /**
3205
3265
  * Configuración del pie del sidebar por defecto: versión, copyright, aviso de
3206
3266
  * privacidad y enlace a las novedades. Cada pieza se pinta sólo si se pasa.
@@ -3324,6 +3384,18 @@ interface MainLayoutProps {
3324
3384
  declare const SIDE_PANEL_WIDTH_VAR = "--acv-side-panel-width";
3325
3385
  declare const MainLayout: (props: MainLayoutProps) => react_jsx_runtime.JSX.Element;
3326
3386
 
3387
+ /**
3388
+ * Pasa a singular una palabra suelta. Devuelve la palabra tal cual cuando no reconoce un
3389
+ * plural, que es el modo seguro de fallar: un título sin tocar se lee bien igual.
3390
+ */
3391
+ declare function singularizarPalabra(palabra: string): string;
3392
+ /**
3393
+ * Pasa a singular un título completo, que es pasar a singular su núcleo: todas las
3394
+ * palabras hasta el primer conector —"Notas rojas" → "Nota roja"— y ninguna después
3395
+ * —"Órdenes de envío" → "Orden de envío"—.
3396
+ */
3397
+ declare function singularizarTitulo(titulo: string): string;
3398
+
3327
3399
  interface PageInfoProps {
3328
3400
  /**
3329
3401
  * La nota. Admite marcado —negritas, listas, enlaces—, así que puede ser lo mismo
@@ -3729,5 +3801,5 @@ interface UseColorModeResult {
3729
3801
  }
3730
3802
  declare function useColorMode(): UseColorModeResult;
3731
3803
 
3732
- export { APIContext, APIProvider, AccountMenuContent, ActiveCell, ActiveIcon, Base, ButtonWithDrawer, COLOR_SCHEME_SELECTOR, CSVUpload, ChipCell, ConfirmDialog, ContentLayout, ControlledAddressAutocomplete, ControlledAmountWithCurrency, ControlledAutocomplete, ControlledColor, ControlledDate$1 as ControlledDate, ControlledDate as ControlledDate_v2, ControlledDropdown, ControlledFileField$1 as ControlledFileField, ControlledFileField as ControlledFileField_v2, FileUploadBox as ControlledFileUploadBox, ControlledNumber, ControlledPhoneNumber, ControlledSelect$1 as ControlledSelect, ControlledSelect as ControlledSelect_v2, ControlledSlider as ControlledSimpleSlider, ControlledSlider$1 as ControlledSlider, ControlledSwitch, ControlledText, ControlledTimePicker, ControlledToggleButtons, CoverPage, CreateButtonBase, CreateButtonWithMenuOptions, CrudDropdown, CustomNoRows, DEFAULT_FORM_BREAKPOINTS, DEFAULT_PAGINATION, DeleteButton, DeleteConfirmationDialog, DetailFormDialog as DetailFormDialog_v2, DetailFormDrawer as DetailFormDrawer_v2, DetailForm as DetailForm_v2, DetailPage$1 as DetailPage, DetailPage as DetailPage_v2, DrawerGrid as DrawerGrid_v2, EditButton, ExportCSV$1 as ExportCSV, ExportCSV as ExportCSV_v2, ExtraButtons, FORM_CONTAINER_NAME, GlobalSearch, HEADER_CONTAINER, HEADER_NARROW, HistorialDrawer, KpiCard, LAYER_ORDER, ListPage, Loadable, LoadingComponent, Logo, MainDrawer, MainDrawer$1 as MainDrawer_v2, MainLayout, MenuItemWithLoading, ModuleCard, MoreOptions, MyGridEditSingleSelect, NavigationContext, NavigationProvider, NormalOrIcon, NotAllowed, NotFound, NotificationItem, NotificationsBell, ObjectProgressStack, PAGE_SIZE_OPTIONS, PageActionsHostContext, PageBadgeHostContext, PageInfo, PageInfoHostContext, Panel, PollingCountdownChip, PulseDot, RESPONSIVE_ACTION_MODES, ResponsiveActions, SIDE_PANEL_WIDTH_VAR, SaveCancelButton, ServerGrid as ServerGrid_v2, SidePanelHostContext, StatusBadge, StickyPageHeaderContext, StyledMenu, Tabs, Transitions, TrueFalse, UncontrolledText, changeTitle, closeProgressSnack, composeGridProps, deleteColumn$1 as deleteColumn, deleteColumn as deleteColumn_v2, editColumn, filterQuery, formContainerSx, formGridSx, formParser, headerContainerSx, _default as headerReducer, manualCacheRefresh, mergeSettings, openProgressSnack, query, renderChipCell, renderEditCellWithErrorTooltip, resolveChipOption, resolveInitialState, resolveStatusColor, setErrors, _default$1 as snackProgressReducer, statusColors, tags, theme, togglableFields, updateProgressSnackData, useAPI, useColorMode, useDetailForm, useHasPermission, useHasPermission_v2, useKeyboardShortcut, useMutationHandler, useNavigation, usePageActionsHost, usePageBadgeHost, usePageInfoHost, useServerGrid, useSidePanelHost, useStickyPageHeader, useStickyPageHeaderHost, valueLabel };
3804
+ export { APIContext, APIProvider, AccountMenuContent, ActiveCell, ActiveIcon, Base, ButtonWithDrawer, COLOR_SCHEME_SELECTOR, CSVUpload, ChipCell, ConfirmDialog, ContentLayout, ControlledAddressAutocomplete, ControlledAmountWithCurrency, ControlledAutocomplete, ControlledColor, ControlledDate$1 as ControlledDate, ControlledDate as ControlledDate_v2, ControlledDropdown, ControlledFileField$1 as ControlledFileField, ControlledFileField as ControlledFileField_v2, FileUploadBox as ControlledFileUploadBox, ControlledNumber, ControlledPhoneNumber, ControlledSelect$1 as ControlledSelect, ControlledSelect as ControlledSelect_v2, ControlledSlider as ControlledSimpleSlider, ControlledSlider$1 as ControlledSlider, ControlledSwitch, ControlledText, ControlledTimePicker, ControlledToggleButtons, CoverPage, CreateButtonBase, CreateButtonWithMenuOptions, CrudDropdown, CustomNoRows, DEFAULT_FORM_BREAKPOINTS, DEFAULT_PAGINATION, DeleteButton, DeleteConfirmationDialog, DetailFormDialog as DetailFormDialog_v2, DetailFormDrawer as DetailFormDrawer_v2, DetailForm as DetailForm_v2, DetailPage$1 as DetailPage, DetailPage as DetailPage_v2, DrawerGrid as DrawerGrid_v2, EditButton, ExportCSV$1 as ExportCSV, ExportCSV as ExportCSV_v2, ExtraButtons, FORM_CONTAINER_NAME, GlobalSearch, HEADER_CONTAINER, HEADER_NARROW, HistorialDrawer, KpiCard, LAYER_ORDER, ListPage, Loadable, LoadingComponent, Logo, MainDrawer, MainDrawer$1 as MainDrawer_v2, MainLayout, MenuItemWithLoading, ModuleCard, MoreOptions, MyGridEditSingleSelect, NavigationContext, NavigationProvider, NormalOrIcon, NotAllowed, NotFound, NotificationItem, NotificationsBell, ObjectProgressStack, PAGE_SIZE_OPTIONS, PageActionsHostContext, PageBadgeHostContext, PageInfo, PageInfoHostContext, Panel, PollingCountdownChip, PulseDot, RESPONSIVE_ACTION_MODES, ResponsiveActions, SIDE_PANEL_WIDTH_VAR, SaveCancelButton, ServerGrid as ServerGrid_v2, SidePanelHostContext, StatusBadge, StickyPageHeaderContext, StyledMenu, Tabs, Transitions, TrueFalse, UncontrolledText, changeTitle, closeProgressSnack, composeGridProps, deleteColumn$1 as deleteColumn, deleteColumn as deleteColumn_v2, editColumn, filterQuery, formContainerSx, formGridSx, formParser, headerContainerSx, _default as headerReducer, manualCacheRefresh, mergeSettings, openProgressSnack, query, renderChipCell, renderEditCellWithErrorTooltip, resolveChipOption, resolveInitialState, resolveStatusColor, setErrors, singularizarPalabra, singularizarTitulo, _default$1 as snackProgressReducer, statusColors, tags, theme, togglableFields, updateProgressSnackData, useAPI, useColorMode, useDetailForm, useHasPermission, useHasPermission_v2, useKeyboardShortcut, useMutationHandler, useNavigation, usePageActionsHost, usePageBadgeHost, usePageInfoHost, useServerGrid, useSidePanelHost, useStickyPageHeader, useStickyPageHeaderHost, valueLabel };
3733
3805
  export type { APIcontextProps, AccountMenuContentProps, AccountMenuItem, AddressValue, AppTheme, AutocompleteOption, ChipCellProps, ChipColor, ChipOption, ColorMode, ComoOpcionesProps, ConfirmDialogProps, ControlledAutocompleteProps, ControlledInput, CustomFilterDef, CustomToolbarProps, DeleteGridColumnsProps$1 as DeleteGridColumnsProps, DetachedPage, DetailExtraButton, DetailFormApi, DetailFormConfig, DetailFormController, DetailFormDialogProps, DetailFormDrawerNavigation, DetailFormDrawerProps, DetailFormProps, DetailFormStatus, DetailPageV2Props, DetailRenderProps, DrawerGridDrawerConfig, DrawerGridEditConfig, DrawerGridProps, EditGridColumnsProps, EditReadOnlyFields, ExportCSVProps as ExportCSVProps_v2, FieldFilter, FieldProps$1 as FieldProps, FieldValidationProps, FilterInput, FormBreakpoint, FormGridSxOptions, GlobalSearchOption, GlobalSearchProps, GridArgs, GridColDefPropsOverrides, GridLayerContribution, GridLayerId, GridLayerMap, JSONFormProps, JSONParserProps, KeyboardShortcut, KpiCardProps, MainDrawerV2Props, MainLayoutFooterConfig, MainLayoutPageHeaderProps, MainLayoutProps, MainLayoutSidebarFooterProps, MyDataGridProps, MyGridFilterModel, MyTab, MyTabProps, NotificationItemProps, NotificationsApi, NotificationsBellProps, PageActionsHost, PageBadgeHost, PageInfoHost, PageInfoProps, PageType, PanelProps, PollingCountdownChipProps, ProgressStatusProps, PulseDotProps, ResponsiveAction, ResponsiveActionsMode, ResponsiveActionsProps, RowsSnapshot, ServerGridArgs, ServerGridCreateApi, ServerGridDataApi, ServerGridDeleteApi, ServerGridEditApi, ServerGridEditToggleApi, ServerGridHandle, ServerGridProps, ServerGridSnapshot, ServerGridState, SidePanelHost, StatusColor, StickyPageHeaderHost, UseColorModeResult, UseServerGridOptions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acvl/frontend-components",
3
- "version": "0.0.76",
3
+ "version": "0.0.78",
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",