@apia/components 4.0.43 → 4.0.45

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,15 +1,15 @@
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, PropsWithChildren, FunctionComponent, ForwardedRef, ComponentType, ReactElement } 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';
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
5
  import { BoxProps, TPalette, InputProps, ThemeUIStyleObject, IconButtonProps, ButtonProps, ThemeUICSSObject, SelectProps, LabelProps } from '@apia/theme';
6
6
  import { TIconName, TIconType } from '@apia/icons';
7
- import { MenuItemProps, ControlledMenuProps } from '@szhsin/react-menu';
8
- export { ControlledMenuProps, MenuItemProps } from '@szhsin/react-menu';
9
7
  import { Args } from 'react-cool-portal';
10
8
  import * as _apia_notifications from '@apia/notifications';
11
9
  import { TNotificationId, INotification, TDispatchedNotification, TNotificationSelector } from '@apia/notifications';
12
10
  export { INotification, TDispatchedNotification } from '@apia/notifications';
11
+ import { MenuItemProps, ControlledMenuProps } from '@szhsin/react-menu';
12
+ export { ControlledMenuProps, MenuItemProps } from '@szhsin/react-menu';
13
13
 
14
14
  type TModalSize = 'editGrid' | 'sm' | 'md' | 'md-fixed' | 'lg' | 'lg-fixed' | 'xl' | 'xl-fixed' | 'xxl' | 'xxxl' | 'xxxl-fixed' | 'flex' | 'cal' | 'finder' | 'fileModal';
15
15
  type TApiaButtonType = 'primary' | 'primary-sm' | 'secondary' | 'light-secondary' | 'secondary-sm' | 'danger' | 'danger-sm' | 'outline' | 'outline-sm' | 'warning' | 'warning-sm' | 'link';
@@ -232,7 +232,10 @@ type TOpenModal = Pick<TModal, 'NavBar' | 'Portal' | 'children' | 'className' |
232
232
 
233
233
  declare class ApiaUtilModalHandler {
234
234
  close: () => void;
235
- constructor(close: () => void);
235
+ setProperties: (props: Partial<TOpenModal>) => unknown;
236
+ getProperties: () => TOpenModal;
237
+ constructor(close: () => void, setProperties: (props: Partial<TOpenModal>) => unknown, getProperties: () => TOpenModal);
238
+ setConfirmProps(props: Partial<TOpenModal['confirmProps']>): void;
236
239
  }
237
240
  declare class ApiaUtilModals {
238
241
  #private;
@@ -410,6 +413,7 @@ type TTab = {
410
413
  * Es el texto que se va a mostrar en el tab
411
414
  */
412
415
  label: string;
416
+ labelIcon?: React__default.ReactElement;
413
417
  labelRenderer?: TTabLabelRenderer;
414
418
  /**
415
419
  * Se pueden pasar propiedades adicionales que serán recibidas en cada
@@ -417,7 +421,6 @@ type TTab = {
417
421
  * distintas partes de la aplicación.
418
422
  */
419
423
  additionalProps?: any;
420
- tabId: string;
421
424
  title?: string;
422
425
  };
423
426
  type TTabLabelRenderer = (props: {
@@ -495,6 +498,7 @@ type TApiaUtilInnerConfirm = TApiaUtilConfirm & {
495
498
  type TAlert = {
496
499
  children: ReactNode;
497
500
  title: string;
501
+ confirmButtonText?: string;
498
502
  };
499
503
  type TApiaUtilInnerAlert = TAlert & {
500
504
  onClose: () => unknown;
@@ -915,6 +919,7 @@ declare class AutocompleteController {
915
919
  selectFocused(): void;
916
920
  setValue(value: string, props?: {
917
921
  fireOnChange?: boolean;
922
+ force?: true;
918
923
  }): Promise<void>;
919
924
  tooltipRef: ApiaUtilTooltip | null;
920
925
  }
@@ -1320,135 +1325,6 @@ interface ILabelBox {
1320
1325
  type TLabelBox = ILabelBox & BoxProps;
1321
1326
  declare const LabelBox: ({ className, label, tooltip, closeTooltip, onClose, variant, ...props }: TLabelBox) => React$1.JSX.Element;
1322
1327
 
1323
- declare class ChatMessage {
1324
- message: ReactNode;
1325
- messageType: TMessageType;
1326
- attachments: IAttachment[];
1327
- reference: ReactNode;
1328
- id: number;
1329
- constructor(message?: ReactNode, messageType?: TMessageType, attachments?: IAttachment[], reference?: ReactNode);
1330
- clone: () => ChatMessage;
1331
- removeAttachment(attachment: IAttachment): void;
1332
- addAttachmentDescription(attachment: IAttachment, description: string): void;
1333
- }
1334
-
1335
- type TMessageType = 'user' | 'system' | 'warning' | 'error' | 'information' | 'response' | 'multipleChoice' | 'customMessage';
1336
- interface IAttachment {
1337
- name: string;
1338
- id: string;
1339
- base64: string;
1340
- description?: string;
1341
- }
1342
- type TChatControllerState = {
1343
- isLoading: boolean;
1344
- canRecord: boolean;
1345
- canAttach: boolean;
1346
- canAddUserMessage: boolean;
1347
- canAddSystemMessage: boolean;
1348
- maxAttachmentsSize: number;
1349
- messages: ChatMessage[];
1350
- currentMessage: ChatMessage;
1351
- };
1352
- interface MessageCallbackProps {
1353
- message: ChatMessage;
1354
- }
1355
- type MessageSubmitCallback = (props: MessageCallbackProps) => unknown;
1356
- type TComponentRender = {
1357
- path: string;
1358
- args: Record<any, any>;
1359
- };
1360
-
1361
- declare const _default$2: React$1.MemoExoticComponent<({ componentData, }: {
1362
- componentData: TComponentRender;
1363
- }) => React$1.JSX.Element>;
1364
-
1365
- declare const _default$1: React$1.MemoExoticComponent<({ str }: {
1366
- str: string;
1367
- }) => React$1.JSX.Element[]>;
1368
-
1369
- interface AutoscrollContainerProps {
1370
- /** How close (in px) to the bottom you have to be *when scrolling down*
1371
- * for auto-scroll to kick back in. */
1372
- threshold?: number;
1373
- className?: string;
1374
- }
1375
- declare const AutoscrollContainer: React__default.FC<PropsWithChildren<AutoscrollContainerProps>>;
1376
-
1377
- declare class ChatController<T extends Record<string, unknown> = Record<string, unknown>> {
1378
- private onMessageSubmit;
1379
- private additionalOptions?;
1380
- private classNames?;
1381
- currentIndex: number;
1382
- state: TChatControllerState & T;
1383
- private internalAudioRecorder;
1384
- private internalCameraRecorder;
1385
- private maxId;
1386
- audioRecorder: {
1387
- cancelOnStop: boolean;
1388
- start: () => void;
1389
- stop: () => Promise<void>;
1390
- record: number;
1391
- state: _apia_util.AudioRecorderState;
1392
- };
1393
- constructor(props: Partial<TChatControllerState & T>, onMessageSubmit: MessageSubmitCallback, additionalOptions?: TMenuItem[] | undefined, classNames?: {
1394
- history?: string;
1395
- textarea?: string;
1396
- attachments?: string;
1397
- } | undefined);
1398
- removeMessage(idx: number): void;
1399
- addMessage(message: ChatMessage): void;
1400
- clearHistory(): void;
1401
- clearMessage(): void;
1402
- removeAttachment(attachment: IAttachment): void;
1403
- private handleSubmit;
1404
- private isForHistory;
1405
- private canGoNext;
1406
- private canGoPrev;
1407
- nextMessage(): void;
1408
- prevMessage(): void;
1409
- protected getAdditionalProps(): Partial<MessageCallbackProps>;
1410
- History: (() => React$1.JSX.Element) & {
1411
- displayName: string;
1412
- };
1413
- Attachments: (() => React$1.JSX.Element) & {
1414
- displayName: string;
1415
- };
1416
- TextArea: (() => React$1.JSX.Element) & {
1417
- displayName: string;
1418
- };
1419
- Renderer: () => React$1.JSX.Element;
1420
- }
1421
-
1422
- declare class FloatingChatController extends ChatController<{
1423
- isWindowOpen: boolean;
1424
- }> {
1425
- private modalTitle;
1426
- constructor(props: {
1427
- props: Partial<TChatControllerState & {
1428
- isWindowOpen: boolean;
1429
- }>;
1430
- onMessageSubmit: MessageSubmitCallback;
1431
- modalTitle?: string;
1432
- additionalOptions?: TMenuItem[];
1433
- classNames?: {
1434
- history?: string;
1435
- textarea?: string;
1436
- attachments?: string;
1437
- };
1438
- });
1439
- getModalTitle(): string | undefined;
1440
- setModalTitle(title: string): void;
1441
- open(): void;
1442
- Window: (() => React$1.JSX.Element | null) & {
1443
- displayName: string;
1444
- };
1445
- }
1446
-
1447
- declare function getBase64FromFile(f: File): Promise<string>;
1448
- declare function getBase64FromBlob(b: Blob): Promise<string>;
1449
- declare function getFileExtension(name: string): string | undefined;
1450
- declare function isImage(base64: string): boolean;
1451
-
1452
1328
  declare const ContainerWithHeader: ({ title, children, footerChildren, onClose, additionalButtons, }: {
1453
1329
  title: string;
1454
1330
  children: ReactNode;
@@ -1481,10 +1357,11 @@ declare const CollapsiblePanel: React__default.ForwardRefExoticComponent<ICollap
1481
1357
 
1482
1358
  interface IAlert {
1483
1359
  children: React.ReactNode;
1360
+ confirmButtonText?: string;
1484
1361
  onClose: () => void;
1485
1362
  title?: string;
1486
1363
  }
1487
- declare const AlertModal: ({ children, onClose, title }: IAlert) => React$1.JSX.Element;
1364
+ declare const AlertModal: ({ children, confirmButtonText, onClose, title, }: IAlert) => React$1.JSX.Element;
1488
1365
 
1489
1366
  type TListboxItem = {
1490
1367
  children?: ReactNode;
@@ -2685,5 +2562,5 @@ declare class Templater {
2685
2562
  parseString(content: string, options?: IAlterDefaultOptions): string | JSX.Element | JSX.Element[];
2686
2563
  }
2687
2564
 
2688
- 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, AutoscrollContainer, BaseButton, BodyAside, CalendarModal, Captcha, CenteredHeaderButtons, ChatController, ChatMessage, Checkbox, CollapsiblePanel, Confirm, ConfirmModal, ContainerWithHeader, DateInput, DeadSessionModal, DefaultAccordionItemButton, DefaultIconRenderer, DefaultTabsLabelRenderer, DialogButtonBar, Dropzone, FavoriteIcon, FieldErrorMessage, FieldLabel, FileCard, FilterConditionDTO, FilterDTO, FiltersStore, FloatingAside, FloatingChatController, FooterButtons, FooterResponsiveButtons, HamburguerMenu, Header, HeaderButtons, type IAccordionItemButton, type IAccordionItemProps, type IAccordionProps, type IAlert, type IApiaFilter, type IAsidePanel, type IAttachment, 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, _default$2 as MessageBlock, _default$1 as MessageBlocks, type MessageCallbackProps, type MessageSubmitCallback, 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 TChatControllerState, type TCheckbox, type TComponentRender, 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 TMessageType, 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, getBase64FromBlob, getBase64FromFile, getFieldErrorStyles, getFieldTouchedStyles, getFileExtension, importComponent, isFavoriteIcon, isImage, isParametersGroup, makeResponsiveComponent, menuController, parseNumberInputValueToNumber, parseNumberValueToNumberInput, useAccordionContext, useCurrentTab, useMenu, useModal, useModalContext, useOtherTagButton, useTabsContext };
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 };
2689
2566
  //# sourceMappingURL=index.d.ts.map