@apia/components 0.3.6 → 1.0.1
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/cleanDist.json +1 -1
- package/dist/index.d.ts +375 -44
- package/dist/index.js +7337 -4717
- package/dist/index.js.map +1 -1
- package/package.json +8 -9
package/cleanDist.json
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
import { ThemeUIStyleObject, IconButtonProps, ButtonProps, ThemeUICSSObject, InputProps, BoxProps } from '@apia/theme';
|
|
2
|
-
import { TModify, TId, TApiaFilter, TApiaFilterValue, IOnFocusConfiguration, TFocusRetriever, EventEmitter } from '@apia/util';
|
|
3
1
|
import * as React$1 from 'react';
|
|
4
|
-
import React__default, { ChangeEventHandler, MouseEvent, KeyboardEvent, ReactNode, FC, Ref, FunctionComponent, ForwardedRef, ComponentType, RefObject } from 'react';
|
|
2
|
+
import React__default, { ChangeEventHandler, MouseEvent as MouseEvent$1, KeyboardEvent, ReactNode, FC, Ref, FunctionComponent, ForwardedRef, ComponentType, RefObject } from 'react';
|
|
3
|
+
import { ThemeUIStyleObject, IconButtonProps, ButtonProps, ThemeUICSSObject, InputProps, BoxProps } from '@apia/theme';
|
|
4
|
+
import { TModify, TId, TApiaFilter, TApiaFilterValue, IOnFocusConfiguration, TFocusRetriever, EventEmitter, PropsStore } from '@apia/util';
|
|
5
5
|
import { TIconType, TIconName } from '@apia/icons';
|
|
6
6
|
import { Args } from 'react-cool-portal';
|
|
7
|
+
import * as _apia_notifications from '@apia/notifications';
|
|
8
|
+
import { TNotificationId, INotification, TDispatchedNotification, TNotificationSelector } from '@apia/notifications';
|
|
9
|
+
export { INotification, TDispatchedNotification } from '@apia/notifications';
|
|
10
|
+
import * as _apia_components from '@apia/components';
|
|
11
|
+
import { MenuItemProps, ControlledMenuProps } from '@szhsin/react-menu';
|
|
12
|
+
export { ControlledMenuProps, MenuItemProps } from '@szhsin/react-menu';
|
|
13
|
+
|
|
14
|
+
declare const ApiaChat: ((props: object) => React$1.JSX.Element) & {
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
7
17
|
|
|
8
18
|
type TModalSize = 'editGrid' | 'sm' | 'md' | 'md-fixed' | 'lg' | 'lg-fixed' | 'xl' | 'xl-fixed' | 'xxl' | 'xxxl' | 'xxxl-fixed' | 'flex' | 'cal' | 'finder';
|
|
9
19
|
type TApiaButtonType = 'primary' | 'primary-sm' | 'secondary' | 'light-secondary' | 'secondary-sm' | 'danger' | 'danger-sm' | 'outline' | 'outline-sm' | 'warning' | 'warning-sm' | 'link';
|
|
@@ -207,7 +217,7 @@ declare global {
|
|
|
207
217
|
AMOUNT_DECIMAL_ZEROS: string;
|
|
208
218
|
CHAR_DECIMAL_SEPARATOR: string;
|
|
209
219
|
CHAR_THOUS_SEPARATOR: string;
|
|
210
|
-
ADD_THOUSAND_SEPARATOR:
|
|
220
|
+
ADD_THOUSAND_SEPARATOR: boolean;
|
|
211
221
|
}
|
|
212
222
|
}
|
|
213
223
|
declare function parseNumberInputValueToNumber(value: string): number;
|
|
@@ -281,7 +291,7 @@ interface IAccordionItemButton {
|
|
|
281
291
|
* presiona espacio sobre el botón del acordeón.
|
|
282
292
|
*/
|
|
283
293
|
onChange?: (checked: boolean) => unknown;
|
|
284
|
-
onClick?: (ev: MouseEvent) => unknown;
|
|
294
|
+
onClick?: (ev: MouseEvent$1) => unknown;
|
|
285
295
|
onUserPressEnter?: (ev: KeyboardEvent) => unknown;
|
|
286
296
|
rightButtons?: ReactNode;
|
|
287
297
|
rightIcons?: TIconName[] | TIconName;
|
|
@@ -381,6 +391,7 @@ interface IApiaFilter {
|
|
|
381
391
|
declare const ApiaFilter: React$1.MemoExoticComponent<React$1.ForwardRefExoticComponent<IApiaFilter & React$1.RefAttributes<HTMLInputElement | HTMLSelectElement>>>;
|
|
382
392
|
|
|
383
393
|
interface ICollapsiblePanel {
|
|
394
|
+
'aria-hidden'?: boolean;
|
|
384
395
|
children: React.ReactNode;
|
|
385
396
|
className?: string;
|
|
386
397
|
closedIcon?: TIconType | TIconName;
|
|
@@ -394,6 +405,7 @@ interface ICollapsiblePanel {
|
|
|
394
405
|
onOpen?: (ev?: React.MouseEvent) => void | Promise<boolean>;
|
|
395
406
|
openIcon?: TIconType | TIconName;
|
|
396
407
|
label: React.ReactNode;
|
|
408
|
+
rememberCollapsedState?: boolean;
|
|
397
409
|
titleButtons?: React.ReactNode;
|
|
398
410
|
}
|
|
399
411
|
|
|
@@ -490,8 +502,8 @@ type TListbox = {
|
|
|
490
502
|
* su aspecto
|
|
491
503
|
*/
|
|
492
504
|
unstyled?: boolean;
|
|
493
|
-
onClickNode?: (ev: MouseEvent<HTMLElement>) => unknown;
|
|
494
|
-
onDoubleClickNode?: (ev: MouseEvent<HTMLElement>) => unknown;
|
|
505
|
+
onClickNode?: (ev: MouseEvent$1<HTMLElement>) => unknown;
|
|
506
|
+
onDoubleClickNode?: (ev: MouseEvent$1<HTMLElement>) => unknown;
|
|
495
507
|
/**
|
|
496
508
|
* Este evento es lanzado cuando el usuario estando en foco en la lista
|
|
497
509
|
* presiona:
|
|
@@ -519,7 +531,7 @@ type TOnSelectionChange = {
|
|
|
519
531
|
focusedElement: HTMLElement;
|
|
520
532
|
selectedElements: HTMLElement[];
|
|
521
533
|
};
|
|
522
|
-
type TOnClickNode = MouseEvent;
|
|
534
|
+
type TOnClickNode = MouseEvent$1;
|
|
523
535
|
|
|
524
536
|
declare const Listbox: React$1.MemoExoticComponent<((props: TListbox) => React$1.JSX.Element) & {
|
|
525
537
|
displayName: string;
|
|
@@ -967,11 +979,11 @@ type TIconsList<P = Record<string, unknown>> = {
|
|
|
967
979
|
/**
|
|
968
980
|
* Este callback es llamado cuando se hace click en un ícono
|
|
969
981
|
*/
|
|
970
|
-
onIconClick?: (ev: MouseEvent<HTMLElement>, icon: TIcon<P>) => unknown;
|
|
982
|
+
onIconClick?: (ev: MouseEvent$1<HTMLElement>, icon: TIcon<P>) => unknown;
|
|
971
983
|
/**
|
|
972
984
|
* Este callback es llamado cuando se hace doble click en un ícono
|
|
973
985
|
*/
|
|
974
|
-
onIconDoubleClick?: (ev: MouseEvent<HTMLElement>, icon: TIcon<P>) => unknown;
|
|
986
|
+
onIconDoubleClick?: (ev: MouseEvent$1<HTMLElement>, icon: TIcon<P>) => unknown;
|
|
975
987
|
/**
|
|
976
988
|
* Este método se usa para obtener detalles de un ícono. Es llamado cuando se
|
|
977
989
|
* hace foco o cuando se posiciona el mouse en un ícono. Si no está declarado
|
|
@@ -1018,8 +1030,29 @@ declare const IconsList: {
|
|
|
1018
1030
|
displayName: string;
|
|
1019
1031
|
};
|
|
1020
1032
|
|
|
1033
|
+
/**
|
|
1034
|
+
* Permite importar un componente en forma dinámica con ruta relativa a
|
|
1035
|
+
* /customComponents
|
|
1036
|
+
*/
|
|
1021
1037
|
declare function importComponent<T = unknown>(path: string): React$1.LazyExoticComponent<ComponentType<T>>;
|
|
1022
1038
|
|
|
1039
|
+
type TClickListener = () => unknown;
|
|
1040
|
+
type TItemState = Pick<TToolDefinition, 'disabled' | 'toggled'>;
|
|
1041
|
+
declare class ToolbarController extends EventEmitter<{
|
|
1042
|
+
pressEnter: string;
|
|
1043
|
+
updateItemState: string;
|
|
1044
|
+
}> {
|
|
1045
|
+
eventListeners: Record<string, TClickListener[]>;
|
|
1046
|
+
itemsState: Record<string, TItemState>;
|
|
1047
|
+
hooks: {
|
|
1048
|
+
useItemState: (id: string, initialState: TItemState) => TItemState;
|
|
1049
|
+
};
|
|
1050
|
+
setItemState: (id: string, newState: Partial<TItemState>) => void;
|
|
1051
|
+
Context: ({ children }: {
|
|
1052
|
+
children: ReactNode;
|
|
1053
|
+
}) => React$1.JSX.Element;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1023
1056
|
type TToolEventState = {
|
|
1024
1057
|
isToggled: boolean;
|
|
1025
1058
|
};
|
|
@@ -1027,7 +1060,7 @@ type TSeparator = {
|
|
|
1027
1060
|
separator: true;
|
|
1028
1061
|
};
|
|
1029
1062
|
type TToolDefinition = {
|
|
1030
|
-
action: (props: TToolEventState) => unknown;
|
|
1063
|
+
action: (props: TToolEventState, controller: ToolbarController) => unknown;
|
|
1031
1064
|
/**
|
|
1032
1065
|
* Si se pasa allowToggle y no se pasa toggled ( ni en true ni en false ),
|
|
1033
1066
|
* entonces el estado de toggle será controlado internamente en el toolbar
|
|
@@ -1049,24 +1082,12 @@ type TToolDefinition = {
|
|
|
1049
1082
|
*/
|
|
1050
1083
|
toggled?: boolean;
|
|
1051
1084
|
};
|
|
1052
|
-
type
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
type
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
updateItemState: string;
|
|
1059
|
-
}> {
|
|
1060
|
-
eventListeners: Record<string, TClickListener[]>;
|
|
1061
|
-
itemsState: Record<string, TItemState>;
|
|
1062
|
-
hooks: {
|
|
1063
|
-
useItemState: (id: string, initialState: TItemState) => TItemState;
|
|
1064
|
-
};
|
|
1065
|
-
setItemState: (id: string, newState: Partial<TItemState>) => void;
|
|
1066
|
-
Context: ({ children }: {
|
|
1067
|
-
children: ReactNode;
|
|
1068
|
-
}) => React$1.JSX.Element;
|
|
1069
|
-
}
|
|
1085
|
+
type TToolInput = {
|
|
1086
|
+
inputProps?: InputProps;
|
|
1087
|
+
label?: string;
|
|
1088
|
+
type: 'input';
|
|
1089
|
+
};
|
|
1090
|
+
type TTool = TToolDefinition | TSeparator | TToolInput;
|
|
1070
1091
|
|
|
1071
1092
|
declare const ToolbarItem: (props: TTool) => React$1.JSX.Element;
|
|
1072
1093
|
|
|
@@ -1081,6 +1102,250 @@ declare const Toolbar: ((props: {
|
|
|
1081
1102
|
displayName: string;
|
|
1082
1103
|
};
|
|
1083
1104
|
|
|
1105
|
+
declare const TabsList: ({ arrowsBehavior, }: {
|
|
1106
|
+
arrowsBehavior?: "open" | "focus" | undefined;
|
|
1107
|
+
}) => React__default.JSX.Element;
|
|
1108
|
+
|
|
1109
|
+
declare class TabsController<AdditionalPropsType extends Record<string, unknown> = Record<string, unknown>, TabType extends TTab<AdditionalPropsType> = TTab<AdditionalPropsType>> {
|
|
1110
|
+
#private;
|
|
1111
|
+
private props;
|
|
1112
|
+
propsStore: PropsStore<TTab<AdditionalPropsType>>;
|
|
1113
|
+
stateKey: string;
|
|
1114
|
+
get stateStore(): PropsStore<TTabsListState>;
|
|
1115
|
+
get activeTabs(): TId[];
|
|
1116
|
+
get tabsList(): TId[];
|
|
1117
|
+
constructor(name: string, props: TTabs<AdditionalPropsType>, initialTabs?: TabType[]);
|
|
1118
|
+
/**
|
|
1119
|
+
* Obviamente agrega un tab al listado de tabs
|
|
1120
|
+
*/
|
|
1121
|
+
append(tab: Omit<TabType, 'tabAdditionalProps'> & Partial<Pick<TabType, 'tabAdditionalProps'>>): void;
|
|
1122
|
+
closeAll(closeFixedTabsAsWell?: boolean, force?: boolean): Promise<void>;
|
|
1123
|
+
closeToRight(targetId: TId): Promise<void>;
|
|
1124
|
+
closeToLeft(targetId: TId): Promise<void>;
|
|
1125
|
+
closeOthers(targetId: TId): Promise<void>;
|
|
1126
|
+
closeTab(tabId: TId, force?: boolean): Promise<boolean>;
|
|
1127
|
+
focusNextTab(): TId | null;
|
|
1128
|
+
focusPreviousTab(): TId | null;
|
|
1129
|
+
focusTab(tabId: TId): void;
|
|
1130
|
+
getTabById(tabId: TId): TTab<AdditionalPropsType>;
|
|
1131
|
+
getTabElement(tabId: TId): Element | null;
|
|
1132
|
+
handleKeyDown(ev: React__default.KeyboardEvent): void;
|
|
1133
|
+
openNextTab(): TId | null;
|
|
1134
|
+
openPreviousTab(): TId | null;
|
|
1135
|
+
get state(): TTabsListState;
|
|
1136
|
+
/**
|
|
1137
|
+
* Se utiliza para hacer que el tab aparezca visible en el listado
|
|
1138
|
+
*
|
|
1139
|
+
* @param justThis Normalmente las tabs se abren de a una, pero si este parámetro se pasa en false, es posible abrir más de una a la vez.
|
|
1140
|
+
*/
|
|
1141
|
+
openTab(tabId: TId, justThis?: boolean): void;
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
type TTab<AdditionalPropsType extends Record<string, unknown> = Record<string, unknown>> = {
|
|
1145
|
+
addEvent?: (ev: 'onFocusTab', cb: (ev: {
|
|
1146
|
+
stop: () => void;
|
|
1147
|
+
}) => unknown) => unknown;
|
|
1148
|
+
content: React__default.FunctionComponent<{
|
|
1149
|
+
tab: TTab<AdditionalPropsType>;
|
|
1150
|
+
}>;
|
|
1151
|
+
icon?: TIconName | TIconType;
|
|
1152
|
+
/**
|
|
1153
|
+
* El id es importante ya que se utiliza por temas de accesibilidad. Es
|
|
1154
|
+
* importante asegurarse de que sea único.
|
|
1155
|
+
*/
|
|
1156
|
+
id: TId;
|
|
1157
|
+
isClosable?: boolean;
|
|
1158
|
+
isDisabled?: boolean;
|
|
1159
|
+
/**
|
|
1160
|
+
* Los tabs que estén marcados como fixed aparecerán al inicio del listado.
|
|
1161
|
+
*/
|
|
1162
|
+
isFixed?: boolean;
|
|
1163
|
+
isFocused?: boolean;
|
|
1164
|
+
/**
|
|
1165
|
+
* Si se marca como iconTab, se oculta el label y solamente se muestra el
|
|
1166
|
+
* ícono.
|
|
1167
|
+
*/
|
|
1168
|
+
isIconTab?: boolean;
|
|
1169
|
+
isLoading?: boolean;
|
|
1170
|
+
isOpen?: boolean;
|
|
1171
|
+
/**
|
|
1172
|
+
* Cuando se cierra un tab que tiene un método onBeforeClose, el mismo será
|
|
1173
|
+
* llamado y deberá devolver un boolean o un string. Si devuelve true, se
|
|
1174
|
+
* cierra. Si devuelve false, se muestra un cartel de confirmación genérico y
|
|
1175
|
+
* si se devuelve un string, se muestra un cartel de confirmación con el
|
|
1176
|
+
* string devuelto. En caso de que el usuario confirme el cuadro de diálogo,
|
|
1177
|
+
* el tab será cerrado de todas formas. Es decir, no hay forma de evitar que
|
|
1178
|
+
* el tab sea cerrado si el usuario decide continuar con la acción. Para
|
|
1179
|
+
* evitar que un tab sea cerrado, debe pasarse isClosable=false
|
|
1180
|
+
*/
|
|
1181
|
+
onBeforeClose?: () => boolean | string | Promise<boolean | string>;
|
|
1182
|
+
/**
|
|
1183
|
+
* Este callback será llamado cada vez que el tab sea abierto
|
|
1184
|
+
*/
|
|
1185
|
+
onFocus?: (ev: TTab<AdditionalPropsType>) => unknown;
|
|
1186
|
+
/**
|
|
1187
|
+
* Es el texto que se va a mostrar en el tab
|
|
1188
|
+
*/
|
|
1189
|
+
label: string;
|
|
1190
|
+
labelRenderer?: TTabRenderer;
|
|
1191
|
+
/**
|
|
1192
|
+
* Se pueden pasar propiedades adicionales que serán recibidas en cada
|
|
1193
|
+
* evento, de forma de poder compartir piezas de información útiles en las
|
|
1194
|
+
* distintas partes de la aplicación.
|
|
1195
|
+
*/
|
|
1196
|
+
tabAdditionalProps: AdditionalPropsType;
|
|
1197
|
+
tabId: TId;
|
|
1198
|
+
title?: string;
|
|
1199
|
+
};
|
|
1200
|
+
type TTabs<AdditionalPropsType extends Record<string, unknown> = Record<string, unknown>> = {
|
|
1201
|
+
getHandler?: (handler: TabsController<AdditionalPropsType>) => unknown;
|
|
1202
|
+
/**
|
|
1203
|
+
* Este id se utiliza para asignar un prefijo a los ids de los distintos
|
|
1204
|
+
* grupos de tabs, de forma que aún habiendo dos tabs con mismo id en
|
|
1205
|
+
* distintos grupos, el id generado sea distinto.
|
|
1206
|
+
*/
|
|
1207
|
+
id: TId;
|
|
1208
|
+
/**
|
|
1209
|
+
* Permite abrir varias tabs al mismo tiempo
|
|
1210
|
+
*/
|
|
1211
|
+
isMultiple?: boolean;
|
|
1212
|
+
/**
|
|
1213
|
+
* Este evento es llamado cada vez que un tab fue cerrado. En caso de que el
|
|
1214
|
+
* callback onRequestClose haya sido provisto, el orden de llamado es:
|
|
1215
|
+
* onRequestClose === true ? onCloseTab : doNothing
|
|
1216
|
+
*/
|
|
1217
|
+
onCloseTab?: (tab: TTab<AdditionalPropsType>) => unknown;
|
|
1218
|
+
/**
|
|
1219
|
+
* Este evento es llamado cada vez que un tab es abierto por acción del
|
|
1220
|
+
* usuario, es decir, cuando se hace click en su label y éste es mostrado.
|
|
1221
|
+
*/
|
|
1222
|
+
onOpenTab?: (tab: TTab<AdditionalPropsType>) => unknown;
|
|
1223
|
+
/**
|
|
1224
|
+
* Este callback es llamado cada vez que se hace click en el botón cerrar. Se
|
|
1225
|
+
* utiliza para permitir o denegar el cierre del tab, por lo que debe
|
|
1226
|
+
* retornar un boolean o una promesa de booleano. Es útil por ejemplo para
|
|
1227
|
+
* abrir un cuadro de diálogo de confirmación antes de continuar.
|
|
1228
|
+
*/
|
|
1229
|
+
onRequestClose?: (tab: TTab<AdditionalPropsType>) => boolean | Promise<boolean>;
|
|
1230
|
+
orientation?: 'horizontal' | 'vertical';
|
|
1231
|
+
/**
|
|
1232
|
+
* Esta prop solo será tomada en cuenta al montar. Para agregar tabs luego,
|
|
1233
|
+
* es necesario hacer uso de getHandler.
|
|
1234
|
+
*/
|
|
1235
|
+
initialTabs?: TTab<AdditionalPropsType>[];
|
|
1236
|
+
};
|
|
1237
|
+
type TTabRenderer<AdditionalPropsType extends Record<string, unknown> = Record<string, unknown>> = (props: {
|
|
1238
|
+
tab: TTab<AdditionalPropsType>;
|
|
1239
|
+
}) => React__default.ReactElement;
|
|
1240
|
+
type TTabsListState = {
|
|
1241
|
+
focusedTab: TId | null;
|
|
1242
|
+
openTabs: TId[];
|
|
1243
|
+
tabs: TId[];
|
|
1244
|
+
timestamp: number;
|
|
1245
|
+
};
|
|
1246
|
+
|
|
1247
|
+
declare const DefaultTabsLabelRenderer: TTabRenderer;
|
|
1248
|
+
|
|
1249
|
+
declare const TabsContent: (props: Omit<BoxProps, 'children'>) => React__default.JSX.Element;
|
|
1250
|
+
|
|
1251
|
+
declare const Tabs: <AdditionalPropsType extends Record<string, unknown> = Record<string, unknown>>({ id, onCloseTab, onOpenTab, onRequestClose, className, orientation, getHandler, initialTabs, isMultiple, onKeyDown, ...props }: TTabs<AdditionalPropsType> & Omit<BoxProps, "id" | "role" | "as">, ref: React__default.ForwardedRef<HTMLDivElement>) => React__default.JSX.Element;
|
|
1252
|
+
|
|
1253
|
+
type TOpenModal = Pick<TModal, 'NavBar' | 'Portal' | 'children' | 'className' | 'hideCloseButton' | 'initialFocusGetter' | 'initialFocusConfiguration' | 'maxWidth' | 'noHeader' | 'onExited' | 'shouldCloseOnEsc' | 'shouldCloseOnOverlayClick' | 'size' | 'stretch' | 'title' | 'variant'> & {
|
|
1254
|
+
id?: string;
|
|
1255
|
+
};
|
|
1256
|
+
|
|
1257
|
+
declare class ApiaUtilModalHandler {
|
|
1258
|
+
private id;
|
|
1259
|
+
private modals;
|
|
1260
|
+
constructor(id: string, modals: ApiaUtilModals);
|
|
1261
|
+
close(): void;
|
|
1262
|
+
}
|
|
1263
|
+
declare class ApiaUtilModals extends EventEmitter<{
|
|
1264
|
+
close: string;
|
|
1265
|
+
closeAll: boolean;
|
|
1266
|
+
open: TOpenModal;
|
|
1267
|
+
}> {
|
|
1268
|
+
#private;
|
|
1269
|
+
constructor();
|
|
1270
|
+
open(props: TOpenModal): ApiaUtilModalHandler;
|
|
1271
|
+
Component: () => React$1.JSX.Element;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
declare class ApiaUtilNotifications {
|
|
1275
|
+
close: (id: TNotificationId | INotification) => void;
|
|
1276
|
+
closeAll: () => void;
|
|
1277
|
+
notify: (notification: TDispatchedNotification) => void;
|
|
1278
|
+
useSelector: (selector: TNotificationSelector<any>) => INotification<_apia_notifications.TNotificationType>[];
|
|
1279
|
+
Component: () => React$1.JSX.Element;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
declare global {
|
|
1283
|
+
interface Window {
|
|
1284
|
+
TAB_ID: string;
|
|
1285
|
+
}
|
|
1286
|
+
interface HTMLIFrameElement {
|
|
1287
|
+
tabId: TId;
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
declare class ApiaUtilCurrentTab {
|
|
1291
|
+
/**
|
|
1292
|
+
* Este método se usa para establecer un callback que será llamado al momento
|
|
1293
|
+
* de cerrar la pestaña. Este callback podrá devolver false indicando que hay
|
|
1294
|
+
* cambios no guardados, en cuyo caso el sistema alertará al usuario acerca de
|
|
1295
|
+
* ello con un cartel de confirmación.
|
|
1296
|
+
*/
|
|
1297
|
+
canClose(cb: () => boolean): void;
|
|
1298
|
+
changeTitle(newTitle: string): void;
|
|
1299
|
+
/**
|
|
1300
|
+
* El parámetro force sirve para las situaciones en las que el tab podría
|
|
1301
|
+
* preguntar si se desean perder los cambios. En caso de que se pase en true,
|
|
1302
|
+
* no se preguntará nada y se cerrará la pestaña.
|
|
1303
|
+
*/
|
|
1304
|
+
close(force?: boolean): void;
|
|
1305
|
+
getId(): TId;
|
|
1306
|
+
getProps(): _apia_components.TTab<Record<string, unknown>>;
|
|
1307
|
+
udpate(props: Partial<Partial<TTab>>): void;
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
declare class ApiaUtilTabsController {
|
|
1311
|
+
currentTab: ApiaUtilCurrentTab;
|
|
1312
|
+
closeTab(tabId: string, force?: boolean): void;
|
|
1313
|
+
getHandler(): _apia_components.TabsController<Record<string, unknown>, _apia_components.TTab<Record<string, unknown>>>;
|
|
1314
|
+
/**
|
|
1315
|
+
* openApiaTab y openTab son sinónimos.
|
|
1316
|
+
*/
|
|
1317
|
+
openTab(title: string, url: string): void;
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
type TApiaUtilConfirm = Pick<IConfirm, 'additionalButtons' | 'additionalButtonsOnRight' | 'cancelButtonText' | 'children' | 'className' | 'confirmButtonText' | 'confirmButtonVariant' | 'contentRef' | 'hideCancelButton' | 'hideConfirmButton' | 'title' | 'variant'>;
|
|
1321
|
+
type TApiaUtilInnerConfirm = TApiaUtilConfirm & {
|
|
1322
|
+
id: string;
|
|
1323
|
+
} & Pick<IConfirm, 'onCancel' | 'onConfirm'>;
|
|
1324
|
+
type TAlert = {
|
|
1325
|
+
children: ReactNode;
|
|
1326
|
+
title: string;
|
|
1327
|
+
};
|
|
1328
|
+
type TApiaUtilInnerAlert = TAlert & {
|
|
1329
|
+
onClose: () => unknown;
|
|
1330
|
+
id: string;
|
|
1331
|
+
};
|
|
1332
|
+
declare class ApiaUtilDialogs extends EventEmitter<{
|
|
1333
|
+
alert: TApiaUtilInnerAlert;
|
|
1334
|
+
confirm: TApiaUtilInnerConfirm;
|
|
1335
|
+
}> {
|
|
1336
|
+
#private;
|
|
1337
|
+
alert(props: TAlert): Promise<void>;
|
|
1338
|
+
confirm(props: TApiaUtilConfirm): Promise<boolean>;
|
|
1339
|
+
Component: () => React$1.JSX.Element;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
declare class ApiaUtilParsers {
|
|
1343
|
+
addThousSeparator(nStr: string | number): string;
|
|
1344
|
+
apiaNumber(pValue: number): number | string;
|
|
1345
|
+
jsNumber(value: string): number | string;
|
|
1346
|
+
parseBool(val: string): boolean;
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1084
1349
|
type TAttachToElement = (() => HTMLElement) | RefObject<HTMLElement>;
|
|
1085
1350
|
type TPreferredOrientationX = 'left' | 'right';
|
|
1086
1351
|
type TPreferredOrientationY = 'top' | 'bottom';
|
|
@@ -1108,12 +1373,12 @@ type TTooltip = {
|
|
|
1108
1373
|
* Indica si el tooltip se cierra al desplazar el puntero del mouse fuera del
|
|
1109
1374
|
* tooltip. Valor por defecto: true.
|
|
1110
1375
|
*/
|
|
1111
|
-
closeOnMouseLeaveTooltip?: boolean;
|
|
1376
|
+
closeOnMouseLeaveTooltip?: boolean | ((ev: MouseEvent) => boolean);
|
|
1112
1377
|
/**
|
|
1113
1378
|
* Indica si el tooltip se cierra al desplazar el puntero del mouse fuera del
|
|
1114
1379
|
* elemento al que el tooltip está anclado. Valor por defecto: true.
|
|
1115
1380
|
*/
|
|
1116
|
-
closeOnMouseLeaveAttachedElement?: boolean;
|
|
1381
|
+
closeOnMouseLeaveAttachedElement?: boolean | ((ev: MouseEvent) => boolean);
|
|
1117
1382
|
/**
|
|
1118
1383
|
* Indica si el tooltip se cierra al hacerle click. Valor por defecto: false.
|
|
1119
1384
|
*/
|
|
@@ -1122,12 +1387,16 @@ type TTooltip = {
|
|
|
1122
1387
|
* Indica si el tooltip se cierra al hacer click fuera de él. Valor por
|
|
1123
1388
|
* defecto: true.
|
|
1124
1389
|
*/
|
|
1125
|
-
closeOnClickOut?: boolean;
|
|
1390
|
+
closeOnClickOut?: boolean | ((ev: MouseEvent) => boolean);
|
|
1126
1391
|
/**
|
|
1127
1392
|
* Indica si el tooltip se cierra al hacer scroll en un elemento externo al
|
|
1128
1393
|
* tooltip. Valor por defecto: true.
|
|
1129
1394
|
*/
|
|
1130
1395
|
closeOnScrollOut?: boolean;
|
|
1396
|
+
/**
|
|
1397
|
+
* Por defecto está en true. Cierra los demás tooltips al abrirse
|
|
1398
|
+
*/
|
|
1399
|
+
closeOthers?: boolean;
|
|
1131
1400
|
/**
|
|
1132
1401
|
* Permite determinar sobre qué elemento se abre el tooltip
|
|
1133
1402
|
*/
|
|
@@ -1143,6 +1412,7 @@ type TTooltip = {
|
|
|
1143
1412
|
* parámetros preferredOrientationX y preferredOrientationY.
|
|
1144
1413
|
*/
|
|
1145
1414
|
attachToElementAnchorPoint?: TAttachToElementAnchorPoint;
|
|
1415
|
+
attachToMousePosition?: boolean;
|
|
1146
1416
|
/**
|
|
1147
1417
|
* Permite indicar que el tooltip se abrirá en un punto específico. En caso
|
|
1148
1418
|
* de no indicar anchorPoint ni attachToElement se abrirá en {0,0}
|
|
@@ -1189,18 +1459,79 @@ type TTooltip = {
|
|
|
1189
1459
|
variant?: string;
|
|
1190
1460
|
};
|
|
1191
1461
|
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1462
|
+
declare class ApiaUtilTooltip {
|
|
1463
|
+
props: TTooltip;
|
|
1464
|
+
id: string;
|
|
1465
|
+
constructor(props: TTooltip);
|
|
1466
|
+
close(): void;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
declare class AutomaticTooltip {
|
|
1470
|
+
#private;
|
|
1471
|
+
ref: (el: HTMLElement | null) => void;
|
|
1472
|
+
constructor(tooltip?: Partial<TTooltip> | null);
|
|
1473
|
+
update: (tooltip: Partial<TTooltip>) => void;
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
declare class ApiaUtilTooltips extends EventEmitter<{
|
|
1477
|
+
changedList: ApiaUtilTooltip[];
|
|
1478
|
+
}> {
|
|
1479
|
+
#private;
|
|
1480
|
+
tooltips: ApiaUtilTooltip[];
|
|
1481
|
+
constructor();
|
|
1482
|
+
/**
|
|
1483
|
+
* Permite crear un tooltip que se abrirá automáticamente al estar parado
|
|
1484
|
+
* sobre un elemento durante 300ms
|
|
1485
|
+
*/
|
|
1486
|
+
useHover: (tooltip?: Partial<TTooltip>) => AutomaticTooltip;
|
|
1487
|
+
close: (id: string) => void;
|
|
1488
|
+
closeAll: () => void;
|
|
1489
|
+
open: (tooltip: TTooltip) => ApiaUtilTooltip;
|
|
1490
|
+
Component: () => React$1.JSX.Element;
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
type TSubmenu = {
|
|
1494
|
+
label: string;
|
|
1495
|
+
items: TMenuItems;
|
|
1195
1496
|
};
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
toggle:
|
|
1202
|
-
}
|
|
1497
|
+
type TMenuItem = (MenuItemProps & {
|
|
1498
|
+
key: string;
|
|
1499
|
+
}) | 'separator' | TSubmenu;
|
|
1500
|
+
type TMenuItems = TMenuItem[];
|
|
1501
|
+
declare class ApiaUtilMenu extends EventEmitter<{
|
|
1502
|
+
toggle: boolean;
|
|
1503
|
+
}> {
|
|
1504
|
+
#private;
|
|
1505
|
+
open: ({ menuProps, items, }: {
|
|
1506
|
+
menuProps: ControlledMenuProps;
|
|
1507
|
+
items: TMenuItems;
|
|
1508
|
+
}) => void;
|
|
1509
|
+
Component: () => React$1.JSX.Element;
|
|
1510
|
+
}
|
|
1203
1511
|
|
|
1204
|
-
declare
|
|
1512
|
+
declare class ApiaUtilMouse extends EventEmitter<{
|
|
1513
|
+
updatePosition: {
|
|
1514
|
+
x: number;
|
|
1515
|
+
y: number;
|
|
1516
|
+
};
|
|
1517
|
+
}> {
|
|
1518
|
+
x: number;
|
|
1519
|
+
y: number;
|
|
1520
|
+
constructor();
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
declare class ApiaUtil {
|
|
1524
|
+
#private;
|
|
1525
|
+
constructor();
|
|
1526
|
+
dialogs: ApiaUtilDialogs;
|
|
1527
|
+
menu: ApiaUtilMenu;
|
|
1528
|
+
modals: ApiaUtilModals;
|
|
1529
|
+
mouse: ApiaUtilMouse;
|
|
1530
|
+
notifications: ApiaUtilNotifications;
|
|
1531
|
+
parsers: ApiaUtilParsers;
|
|
1532
|
+
tabs: ApiaUtilTabsController;
|
|
1533
|
+
tooltips: ApiaUtilTooltips;
|
|
1534
|
+
Component: () => React$1.JSX.Element;
|
|
1535
|
+
}
|
|
1205
1536
|
|
|
1206
|
-
export { Accordion, AccordionContext, AccordionItem, AccordionItemButton, AccordionItemContent, AccordionItemContext, AlertModal, ApiaFilter, AutoEllipsis, BaseButton, CalendarModal, Captcha, Checkbox, CollapsiblePanel, Confirm, ConfirmModal, DateInput, DefaultAccordionItemButton, DefaultIconRenderer, DialogButtonBar, FieldErrorMessage, FieldLabel, IAccordionItemButton, IAccordionItemProps, IAccordionProps, IAlert, IApiaFilter, ICalendarModal, IConfirm, IDialogButtonBar, IDialogHeader, IField, IFieldErrorMessage, IIconInput, IOverlay, IRequiredMark, IResponsiveComponent, ISimpleButton, IconButton, IconInput, IconsList, LinearLoader, Listbox, ListboxItem, LoaderSpinner, Modal, NumberInput, Overlay, ProgressBar, RequiredMark, ScreenLock, SimpleButton, TAccordionHandler, TAccordionItemButton, TApiaButtonType, TApiaIconButton, TCheckbox, TDateProps, TFieldLabel, TIcon, TIconButton, TIconRenderer, TIconSize, TIconsList, TListbox, TModal, TModalSize, TNumberInput, TNumberInputChangeEvent, TOnClickNode, TOnConfirmSelection, TOnSelectionChange,
|
|
1537
|
+
export { Accordion, AccordionContext, AccordionItem, AccordionItemButton, AccordionItemContent, AccordionItemContext, AlertModal, ApiaChat, ApiaFilter, ApiaUtil, ApiaUtilModalHandler, ApiaUtilTooltip, AutoEllipsis, BaseButton, CalendarModal, Captcha, Checkbox, CollapsiblePanel, Confirm, ConfirmModal, DateInput, DefaultAccordionItemButton, DefaultIconRenderer, DefaultTabsLabelRenderer, DialogButtonBar, FieldErrorMessage, FieldLabel, IAccordionItemButton, IAccordionItemProps, IAccordionProps, IAlert, IApiaFilter, ICalendarModal, IConfirm, IDialogButtonBar, IDialogHeader, IField, IFieldErrorMessage, IIconInput, IOverlay, IRequiredMark, IResponsiveComponent, ISimpleButton, IconButton, IconInput, IconsList, LinearLoader, Listbox, ListboxItem, LoaderSpinner, Modal, NumberInput, Overlay, ProgressBar, RequiredMark, ScreenLock, SimpleButton, TAccordionHandler, TAccordionItemButton, TApiaButtonType, TApiaIconButton, TCheckbox, TDateProps, TFieldLabel, TIcon, TIconButton, TIconRenderer, TIconSize, TIconsList, TListbox, TMenuItem, TModal, TModalSize, TNumberInput, TNumberInputChangeEvent, TOnClickNode, TOnConfirmSelection, TOnSelectionChange, TOpenModal, TSubmenu, TTab, TTabRenderer, TTool, TToolDefinition, TUseModalConfiguration, Tabs, TabsContent, TabsController, TabsList, Toolbar, ToolbarController, ToolbarItem, WaiTypeAhead, getFieldErrorStyles, getFieldTouchedStyles, importComponent, makeResponsiveComponent, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useModal, useModalContext, useOtherTagButton };
|