@apia/components 4.0.45 → 4.0.46

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;
@@ -1050,11 +1052,30 @@ type TCheckbox = TModify<ButtonProps, {
1050
1052
  }>;
1051
1053
  declare const Checkbox: React$1.ForwardRefExoticComponent<Omit<TCheckbox, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
1052
1054
 
1053
- interface ICalModal {
1054
- handleClickDay: (date: Date) => void;
1055
- calValue?: Date;
1056
- locale: string;
1055
+ type TDateProps = {
1056
+ className?: string;
1057
+ disabled?: boolean;
1058
+ id?: string;
1059
+ readonly?: boolean;
1060
+ onBlur?: (date: string | null, ev?: FocusEvent<HTMLElement>) => unknown;
1061
+ /**
1062
+ * If a Promise<false> is returned, the value change is not accepted
1063
+ * and a msgInvalidDate error message is emitted.
1064
+ */
1065
+ onChange?: (date: string | null) => void | Promise<string | null>;
1066
+ onError?: (error: string) => unknown;
1067
+ value?: string;
1068
+ inputRef?: MutableRefObject<any>;
1069
+ };
1070
+ declare const DateInput: (({ className, disabled, id: outerId, inputRef, onBlur, onChange, onError, readonly, value: outerValue, }: TDateProps) => React$1.JSX.Element) & {
1071
+ displayName: string;
1072
+ };
1073
+
1074
+ interface IFieldErrorMessage {
1075
+ children: React$1.ReactNode | string;
1076
+ name?: string;
1057
1077
  }
1078
+ declare const FieldErrorMessage: ({ children, name }: IFieldErrorMessage) => React$1.JSX.Element | null;
1058
1079
 
1059
1080
  interface IField {
1060
1081
  className?: string;
@@ -1078,46 +1099,6 @@ interface IIconInput extends IField {
1078
1099
  }
1079
1100
  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
1101
 
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
1102
  /**
1122
1103
  * El NumberInput respeta los parámetros de ambiente:
1123
1104
  * - AMOUNT_DECIMAL_SEPARATOR
@@ -2044,6 +2025,50 @@ declare const _default: React$1.MemoExoticComponent<({ str }: {
2044
2025
  str: string;
2045
2026
  }) => React$1.JSX.Element>;
2046
2027
 
2028
+ interface ISwitchBox {
2029
+ align?: 'right' | 'left';
2030
+ className?: string;
2031
+ disabled?: boolean;
2032
+ icon?: TIconName;
2033
+ label: string;
2034
+ notSwitchedLabel?: boolean;
2035
+ onClose?: () => unknown;
2036
+ onSwitch?: (switched: boolean) => unknown;
2037
+ switchedLabel?: string;
2038
+ switchProps?: SwitchProps;
2039
+ value?: boolean;
2040
+ }
2041
+ declare const SwitchCard: (({ align, icon, label, notSwitchedLabel, onClose, onSwitch, switchedLabel, switchProps, value, disabled, }: ISwitchBox) => React$1.JSX.Element) & {
2042
+ displayName: string;
2043
+ };
2044
+
2045
+ type TPickUserForPermissions = {
2046
+ userId: string;
2047
+ userLogin: string;
2048
+ canUpdate: boolean;
2049
+ };
2050
+ type TPickPoolForPermissions = {
2051
+ poolId: string;
2052
+ poolName: string;
2053
+ canUpdate: boolean;
2054
+ };
2055
+ type TPermissionsContext = {
2056
+ disabled?: boolean;
2057
+ onChangePools: (u: TPickPoolForPermissions[]) => unknown;
2058
+ onChangeUsers: (u: TPickUserForPermissions[]) => unknown;
2059
+ permissions: {
2060
+ pools: TPickPoolForPermissions[];
2061
+ users: TPickUserForPermissions[];
2062
+ };
2063
+ };
2064
+ declare const Permissions: (({ everyonePermissionsValue, collapsePermissions, disabled, onChangeEveryonePermissions, onChangeUsers, onChangePools, permissions, }: TPermissionsContext & {
2065
+ everyonePermissionsValue: "R" | "M" | "";
2066
+ collapsePermissions?: boolean;
2067
+ onChangeEveryonePermissions: (value: "R" | "M" | "") => unknown;
2068
+ }) => React$1.JSX.Element) & {
2069
+ displayName: string;
2070
+ };
2071
+
2047
2072
  interface IAsidePanel {
2048
2073
  title?: string;
2049
2074
  toolTip?: string;
@@ -2562,5 +2587,5 @@ declare class Templater {
2562
2587
  parseString(content: string, options?: IAlterDefaultOptions): string | JSX.Element | JSX.Element[];
2563
2588
  }
2564
2589
 
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 };
2590
+ 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, UnstyledSortableList, UploadHandler, Uploader, WaiTypeAhead, getFieldErrorStyles, getFieldTouchedStyles, importComponent, isFavoriteIcon, isParametersGroup, makeResponsiveComponent, menuController, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useCurrentTab, useMenu, useModal, useModalContext, useOtherTagButton, useTabsContext };
2566
2591
  //# sourceMappingURL=index.d.ts.map