@apia/components 4.0.45 → 5.0.0

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,8 +1,8 @@
1
1
  import * as React$1 from 'react';
2
- import React__default, { ReactNode, Ref, RefObject, DetailedHTMLProps, TextareaHTMLAttributes, ChangeEventHandler, FocusEvent, MouseEvent as MouseEvent$1, KeyboardEvent, FC, FunctionComponent, ForwardedRef, ComponentType, ReactElement } from 'react';
2
+ import React__default, { ReactNode, Ref, RefObject, DetailedHTMLProps, TextareaHTMLAttributes, ChangeEventHandler, FocusEvent, MutableRefObject, MouseEvent as MouseEvent$1, KeyboardEvent, FC, FunctionComponent, ForwardedRef, ComponentType, ReactElement } from 'react';
3
3
  import * as _apia_util from '@apia/util';
4
4
  import { IOnFocusConfiguration, TFocusRetriever, TId as TId$1, EventEmitter, StatefulEmitter, TModify, TApiaFilter, TApiaFilterValue } from '@apia/util';
5
- import { BoxProps, TPalette, InputProps, ThemeUIStyleObject, IconButtonProps, ButtonProps, ThemeUICSSObject, SelectProps, LabelProps } from '@apia/theme';
5
+ import { BoxProps, TPalette, InputProps, ThemeUIStyleObject, IconButtonProps, ButtonProps, ThemeUICSSObject, SelectProps, SwitchProps, LabelProps } from '@apia/theme';
6
6
  import { TIconName, TIconType } from '@apia/icons';
7
7
  import { Args } from 'react-cool-portal';
8
8
  import * as _apia_notifications from '@apia/notifications';
@@ -281,6 +281,8 @@ declare class ApiaUtilModals {
281
281
  }
282
282
 
283
283
  declare class ApiaUtilNotifications {
284
+ protected util: ApiaUtil;
285
+ constructor(util: ApiaUtil);
284
286
  close: (id: TNotificationId | INotification) => void;
285
287
  closeAll: () => void;
286
288
  notify: (notification: TDispatchedNotification) => void;
@@ -357,7 +359,7 @@ type TabsControllerProps<TabType extends TTab> = {
357
359
  id: string;
358
360
  initialTabs?: TabType[];
359
361
  getController?: (controller: TabsController) => unknown;
360
- initialState?: Pick<Partial<TTabsListState<TabType>>, 'isMultiple'>;
362
+ initialState?: Pick<Partial<TTabsListState<TabType>>, 'isMultiple' | 'showAtLeastOneTab'>;
361
363
  onCloseTab?: (tan: Tab) => void;
362
364
  orientation: TOrientation;
363
365
  };
@@ -538,6 +540,8 @@ declare class ApiaUtilParsers {
538
540
  * Toma un número en formato Apia y lo devuelve como float en javascript.
539
541
  */
540
542
  jsNumber(value: string): number;
543
+ dateToApiaString(value: Date): string | undefined;
544
+ dateFromApiaString(value: string): Date | null;
541
545
  /**
542
546
  * Hay muchos valores que podrían querer ser interpretados como booleano
543
547
  *
@@ -931,7 +935,7 @@ type AutocompleteCmpProps = {
931
935
  inputProps?: InputProps;
932
936
  boxProps?: React.HTMLAttributes<HTMLDivElement>;
933
937
  };
934
- declare const Autocomplete: (props: AutocompleteCmpProps) => React$1.JSX.Element | null;
938
+ declare const Autocomplete: React$1.ForwardRefExoticComponent<AutocompleteCmpProps & React$1.RefAttributes<unknown>>;
935
939
 
936
940
  declare const AutogrowTextarea: ((props: DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> & {
937
941
  error?: boolean;
@@ -1050,11 +1054,30 @@ type TCheckbox = TModify<ButtonProps, {
1050
1054
  }>;
1051
1055
  declare const Checkbox: React$1.ForwardRefExoticComponent<Omit<TCheckbox, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
1052
1056
 
1053
- interface ICalModal {
1054
- handleClickDay: (date: Date) => void;
1055
- calValue?: Date;
1056
- locale: string;
1057
+ type TDateProps = {
1058
+ className?: string;
1059
+ disabled?: boolean;
1060
+ id?: string;
1061
+ readonly?: boolean;
1062
+ onBlur?: (date: string | null, ev?: FocusEvent<HTMLElement>) => unknown;
1063
+ /**
1064
+ * If a Promise<false> is returned, the value change is not accepted
1065
+ * and a msgInvalidDate error message is emitted.
1066
+ */
1067
+ onChange?: (date: string | null) => void | Promise<string | null>;
1068
+ onError?: (error: string | null) => unknown;
1069
+ value?: string;
1070
+ inputRef?: MutableRefObject<any>;
1071
+ };
1072
+ declare const DateInput: (({ className, disabled, id: outerId, inputRef, onBlur, onChange, onError, readonly, value: outerValue, }: TDateProps) => React$1.JSX.Element) & {
1073
+ displayName: string;
1074
+ };
1075
+
1076
+ interface IFieldErrorMessage {
1077
+ children: React$1.ReactNode | string;
1078
+ name?: string;
1057
1079
  }
1080
+ declare const FieldErrorMessage: ({ children, name }: IFieldErrorMessage) => React$1.JSX.Element | null;
1058
1081
 
1059
1082
  interface IField {
1060
1083
  className?: string;
@@ -1078,46 +1101,6 @@ interface IIconInput extends IField {
1078
1101
  }
1079
1102
  declare const IconInput: ({ additionalButtons, additionalButtonsPosition, buttonProps, buttonRef, className, disabled, hideButton, icon, inputProps, inputRef, isLoading, mask, onClick, onBlur, readOnly, ...rest }: IIconInput) => React__default.JSX.Element;
1080
1103
 
1081
- type TDateProps = TModify<InputProps, {
1082
- allowPickBeforeToday?: boolean;
1083
- avoidErrorMessage?: boolean;
1084
- CalModalRenderer?: (props: ICalModal & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement | null;
1085
- deleteFiltersTimestamp?: number;
1086
- error?: string | null;
1087
- /**
1088
- * Con esta propiedad se puede proveer una función que será utilizada para
1089
- * determinar qué máscara debe utilizar el input
1090
- */
1091
- getCustomMask?: () => string;
1092
- inputClassName?: string;
1093
- isLoading?: boolean;
1094
- onBlur?: (ev: FocusEvent<HTMLInputElement>) => void | boolean | string | Promise<boolean | string>;
1095
- /**
1096
- * Recibe la nueva fecha. En caso de devolver
1097
- * false desde este método, el nuevo valor no
1098
- * se persistirá.
1099
- */
1100
- onChange?: (newValue: string) => boolean | string | void;
1101
- /**
1102
- * Es llamado cada vez que alguien presiona el botón de eliminar fecha.
1103
- */
1104
- onDelete?: () => void;
1105
- onError?: (error: string | null) => unknown;
1106
- /**
1107
- * Con esta propiedad se puede proveer una función que recibirá como
1108
- * parámetro el valor actual del cmapo y debe devolver el valor a mostrar.
1109
- */
1110
- renderLabel?: (value: string) => string;
1111
- value?: string;
1112
- }> & Pick<IIconInput, 'buttonProps'>;
1113
- declare const DateInput: React__default.ForwardRefExoticComponent<Omit<TDateProps, "ref"> & React__default.RefAttributes<HTMLInputElement>>;
1114
-
1115
- interface IFieldErrorMessage {
1116
- children: React$1.ReactNode | string;
1117
- name?: string;
1118
- }
1119
- declare const FieldErrorMessage: ({ children, name }: IFieldErrorMessage) => React$1.JSX.Element | null;
1120
-
1121
1104
  /**
1122
1105
  * El NumberInput respeta los parámetros de ambiente:
1123
1106
  * - AMOUNT_DECIMAL_SEPARATOR
@@ -1171,24 +1154,8 @@ type TFieldLabel = {
1171
1154
  */
1172
1155
  required?: boolean;
1173
1156
  requiredMarkPosition?: 'before' | 'after';
1174
- } & BoxProps;
1175
- declare const FieldLabel: React$1.ForwardRefExoticComponent<{
1176
- avoidSemicolon?: boolean;
1177
- /**
1178
- * Permite mostrar un mensaje de error debajo del campo
1179
- */
1180
- error?: string;
1181
- hideRequiredMark?: boolean;
1182
- label: string;
1183
- /**
1184
- * La propiedad required se utiliza para mostrar el * de requerido.
1185
- *
1186
- * @see requiredMarkPosition
1187
- * @see hideRequiredMark
1188
- */
1189
- required?: boolean;
1190
- requiredMarkPosition?: "before" | "after";
1191
- } & BoxProps & React$1.RefAttributes<HTMLDivElement>>;
1157
+ };
1158
+ declare const FieldLabel: React$1.ForwardRefExoticComponent<TFieldLabel & BoxProps & React$1.RefAttributes<HTMLDivElement>>;
1192
1159
 
1193
1160
  interface IAccordionItemButton {
1194
1161
  ariaLabel: string;
@@ -1743,6 +1710,7 @@ type TIconsList<P = Record<string, unknown>> = {
1743
1710
  * Listado de íconos
1744
1711
  */
1745
1712
  icons: TIcon<P>[];
1713
+ iconsPerRow?: number;
1746
1714
  iconRenderer?: TIconRenderer<P>;
1747
1715
  /**
1748
1716
  * Por defecto se usa iconWidth=100.
@@ -2044,6 +2012,50 @@ declare const _default: React$1.MemoExoticComponent<({ str }: {
2044
2012
  str: string;
2045
2013
  }) => React$1.JSX.Element>;
2046
2014
 
2015
+ interface ISwitchBox {
2016
+ align?: 'right' | 'left';
2017
+ className?: string;
2018
+ disabled?: boolean;
2019
+ icon?: TIconName;
2020
+ label: string;
2021
+ notSwitchedLabel?: boolean;
2022
+ onClose?: () => unknown;
2023
+ onSwitch?: (switched: boolean) => unknown;
2024
+ switchedLabel?: string;
2025
+ switchProps?: SwitchProps;
2026
+ value?: boolean;
2027
+ }
2028
+ declare const SwitchCard: (({ align, icon, label, notSwitchedLabel, onClose, onSwitch, switchedLabel, switchProps, value, disabled, }: ISwitchBox) => React$1.JSX.Element) & {
2029
+ displayName: string;
2030
+ };
2031
+
2032
+ type TPickUserForPermissions = {
2033
+ userId: string;
2034
+ userLogin: string;
2035
+ canUpdate: boolean;
2036
+ };
2037
+ type TPickPoolForPermissions = {
2038
+ poolId: string;
2039
+ poolName: string;
2040
+ canUpdate: boolean;
2041
+ };
2042
+ type TPermissionsContext = {
2043
+ disabled?: boolean;
2044
+ onChangePools: (u: TPickPoolForPermissions[]) => unknown;
2045
+ onChangeUsers: (u: TPickUserForPermissions[]) => unknown;
2046
+ permissions: {
2047
+ pools: TPickPoolForPermissions[];
2048
+ users: TPickUserForPermissions[];
2049
+ };
2050
+ };
2051
+ declare const Permissions: (({ everyonePermissionsValue, collapsePermissions, disabled, onChangeEveryonePermissions, onChangeUsers, onChangePools, permissions, }: TPermissionsContext & {
2052
+ everyonePermissionsValue: "R" | "M" | "";
2053
+ collapsePermissions?: boolean;
2054
+ onChangeEveryonePermissions: (value: "R" | "M" | "") => unknown;
2055
+ }) => React$1.JSX.Element) & {
2056
+ displayName: string;
2057
+ };
2058
+
2047
2059
  interface IAsidePanel {
2048
2060
  title?: string;
2049
2061
  toolTip?: string;
@@ -2109,6 +2121,8 @@ declare function useMenu(breakPoints?: number[], initialMenu?: IMenuDefinition):
2109
2121
  */
2110
2122
  declare const FooterButtons: (props: BoxProps) => React$1.JSX.Element;
2111
2123
 
2124
+ declare const TwoColumns: ({ atVeryTop, upperAside, overHeadAside, image, title, subTitle, description, underHeadAside, mainContent, footer, asideContent, footerButtons, }: Partial<Record<"atVeryTop" | "upperAside" | "overHeadAside" | "image" | "title" | "subTitle" | "description" | "underHeadAside" | "mainContent" | "footer" | "asideContent" | "footerButtons", ReactNode>>) => React$1.JSX.Element;
2125
+
2112
2126
  /**
2113
2127
  * Este aside aparece en la vista twoColumnList en los
2114
2128
  * breakpoints de vista móvil.
@@ -2176,6 +2190,8 @@ declare const ShowResponsive: ({ show, children, display, }: {
2176
2190
 
2177
2191
  declare const CenteredHeaderButtons: () => React__default.JSX.Element;
2178
2192
 
2193
+ declare const TwoColumnsList: ({ image, subTitle, title, description, favoriteIcon, content, headerBottom, contentFooter, footer, asideContent, footerButtons, }: Partial<Record<"image" | "title" | "subTitle" | "description" | "favoriteIcon" | "headerBottom" | "content" | "contentFooter" | "footer" | "asideContent" | "footerButtons", ReactNode>>) => React$1.JSX.Element;
2194
+
2179
2195
  declare class TableParameter extends Parameter<ITableParameterProps> {
2180
2196
  constructor(params: ITableParameterProps);
2181
2197
  }
@@ -2562,5 +2578,5 @@ declare class Templater {
2562
2578
  parseString(content: string, options?: IAlterDefaultOptions): string | JSX.Element | JSX.Element[];
2563
2579
  }
2564
2580
 
2565
- export { Accordion, AccordionAside, AccordionContext, AccordionItem, AccordionItemButton, AccordionItemContent, AccordionItemContext, AlertModal, ApiaFilter, ApiaUtil, ApiaUtilModalHandler, ApiaUtilTooltip, Aside, AsideLoader, AsidePanel, AutoEllipsis, Autocomplete, type AutocompleteCmpProps, AutocompleteController, type AutocompleteOption, type AutocompleteProps, AutogrowTextarea, BaseButton, BodyAside, CalendarModal, Captcha, CenteredHeaderButtons, Checkbox, CollapsiblePanel, Confirm, ConfirmModal, ContainerWithHeader, DateInput, DeadSessionModal, DefaultAccordionItemButton, DefaultIconRenderer, DefaultTabsLabelRenderer, DialogButtonBar, Dropzone, FavoriteIcon, FieldErrorMessage, FieldLabel, FileCard, FilterConditionDTO, FilterDTO, FiltersStore, FloatingAside, FooterButtons, FooterResponsiveButtons, HamburguerMenu, Header, HeaderButtons, type IAccordionItemButton, type IAccordionItemProps, type IAccordionProps, type IAlert, type IApiaFilter, type IAsidePanel, type ICalendarModal, type IConfirm, type IDialogButtonBar, type IDialogHeader, type IField, type IFieldErrorMessage, type IFilterCondition, type IFilterDTOState, type IFilterValue, type IIconInput, type IMenuDefinition, type IOverlay, type IPagination, type IParameter, type IParametersGroup, type IRequiredMark, type IResponsiveComponent, type ISimpleButton, type ITableParameterProps, IconButton, IconInput, IconsList, Label, LabelBox, LinearLoader, LinearSpinnerLock, ListSkeletonLoader, Listbox, ListboxItem, LoaderSpinner, _default as MDRenderer, Modal, ModalContext, NumberInput, Overlay, Pagination, Parameter, type ParameterObject, type ParameterPossibleValue, ParameterRender, type ParameterRenderer, type ParameterRendererProps, type ParameterType, Parameters, type ParametersDefinition, ParametersGroup, type ParametersGroupRenderer, ParametersStore, ParametersTable, type Payload, ProgressBar, RequiredMark, ScreenLocker, ShowResponsive, SimpleButton, SortableList, SortableListItem, type TAccordionHandler, type TAccordionItemButton, type TApiaButtonType, type TApiaIconButton, type TCheckbox, type TCssProps, type TDateProps, type TFieldLabel, type TFilterOp, type TFilterPayload, type TFilterType, type TFilterValue, type TFilterValueType, type TGetTabsController, type TIcon, type TIconButton, type TIconRenderer, type TIconSize, type TIconsList, type TListbox, type TMenuItem, type TModal, type TModalSize, type TNumberInput, type TNumberInputChangeEvent, type TOnClickNode, type TOnConfirmSelection, type TOnSelectionChange, type TOpenModal, type TParameterType, type TSubmenu, type TTab, type TTabLabelRenderer as TTabRenderer, type TToolbarIconButton as TToolDefinition, type TTooltip, type TUploadHandlerProps, type TUploadInProgress, type TUploadedFile, type TUseModalConfiguration, type TVisualizationType, Tab, Tabs, TabsContent, TabsController, TabsList, Templater, Toolbar, ToolbarController, ToolbarIconButton, ToolbarInput, ToolbarSelect, ToolbarSeparator, ToolbarTextButton, UnstyledSortableList, UploadHandler, Uploader, WaiTypeAhead, getFieldErrorStyles, getFieldTouchedStyles, importComponent, isFavoriteIcon, isParametersGroup, makeResponsiveComponent, menuController, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useCurrentTab, useMenu, useModal, useModalContext, useOtherTagButton, useTabsContext };
2581
+ export { Accordion, AccordionAside, AccordionContext, AccordionItem, AccordionItemButton, AccordionItemContent, AccordionItemContext, AlertModal, ApiaFilter, ApiaUtil, ApiaUtilModalHandler, ApiaUtilTooltip, Aside, AsideLoader, AsidePanel, AutoEllipsis, Autocomplete, type AutocompleteCmpProps, AutocompleteController, type AutocompleteOption, type AutocompleteProps, AutogrowTextarea, BaseButton, BodyAside, CalendarModal, Captcha, CenteredHeaderButtons, Checkbox, CollapsiblePanel, Confirm, ConfirmModal, ContainerWithHeader, DateInput, DeadSessionModal, DefaultAccordionItemButton, DefaultIconRenderer, DefaultTabsLabelRenderer, DialogButtonBar, Dropzone, FavoriteIcon, FieldErrorMessage, FieldLabel, FileCard, FilterConditionDTO, FilterDTO, FiltersStore, FloatingAside, FooterButtons, FooterResponsiveButtons, HamburguerMenu, Header, HeaderButtons, type IAccordionItemButton, type IAccordionItemProps, type IAccordionProps, type IAlert, type IApiaFilter, type IAsidePanel, type ICalendarModal, type IConfirm, type IDialogButtonBar, type IDialogHeader, type IField, type IFieldErrorMessage, type IFilterCondition, type IFilterDTOState, type IFilterValue, type IIconInput, type IMenuDefinition, type IOverlay, type IPagination, type IParameter, type IParametersGroup, type IRequiredMark, type IResponsiveComponent, type ISimpleButton, type ITableParameterProps, IconButton, IconInput, IconsList, Label, LabelBox, LinearLoader, LinearSpinnerLock, ListSkeletonLoader, Listbox, ListboxItem, LoaderSpinner, _default as MDRenderer, Modal, ModalContext, NumberInput, Overlay, Pagination, Parameter, type ParameterObject, type ParameterPossibleValue, ParameterRender, type ParameterRenderer, type ParameterRendererProps, type ParameterType, Parameters, type ParametersDefinition, ParametersGroup, type ParametersGroupRenderer, ParametersStore, ParametersTable, type Payload, Permissions, ProgressBar, RequiredMark, ScreenLocker, ShowResponsive, SimpleButton, SortableList, SortableListItem, SwitchCard, type TAccordionHandler, type TAccordionItemButton, type TApiaButtonType, type TApiaIconButton, type TCheckbox, type TCssProps, type TDateProps, type TFieldLabel, type TFilterOp, type TFilterPayload, type TFilterType, type TFilterValue, type TFilterValueType, type TGetTabsController, type TIcon, type TIconButton, type TIconRenderer, type TIconSize, type TIconsList, type TListbox, type TMenuItem, type TModal, type TModalSize, type TNumberInput, type TNumberInputChangeEvent, type TOnClickNode, type TOnConfirmSelection, type TOnSelectionChange, type TOpenModal, type TParameterType, type TPickPoolForPermissions, type TPickUserForPermissions, type TSubmenu, type TTab, type TTabLabelRenderer as TTabRenderer, type TToolbarIconButton as TToolDefinition, type TTooltip, type TUploadHandlerProps, type TUploadInProgress, type TUploadedFile, type TUseModalConfiguration, type TVisualizationType, Tab, Tabs, TabsContent, TabsController, TabsList, Templater, Toolbar, ToolbarController, ToolbarIconButton, ToolbarInput, ToolbarSelect, ToolbarSeparator, ToolbarTextButton, TwoColumns, TwoColumnsList, UnstyledSortableList, UploadHandler, Uploader, WaiTypeAhead, getFieldErrorStyles, getFieldTouchedStyles, importComponent, isFavoriteIcon, isParametersGroup, makeResponsiveComponent, menuController, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useCurrentTab, useMenu, useModal, useModalContext, useOtherTagButton, useTabsContext };
2566
2582
  //# sourceMappingURL=index.d.ts.map