plataforma-fundacao-componentes 2.20.24 → 2.20.28
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/README.md +11 -5
- package/dist/components/bannerPesquisaCpfCnpj/BannerPesquisaCpfCnpj.d.ts +1 -0
- package/dist/components/bannerPesquisaCpfCnpj/BannerPesquisaCpfCnpj.stories.d.ts +1 -0
- package/dist/components/bottomNavigation/BottomNavigation.d.ts +1 -1
- package/dist/components/breadCrumb/BreadCrumb.d.ts +1 -1
- package/dist/components/fullHeightContainer/FullHeightContainer.d.ts +3 -3
- package/dist/components/header/Header.d.ts +1 -1
- package/dist/components/modal/ModalTypes.d.ts +43 -24
- package/dist/components/modalManager/ModalManager.d.ts +1 -1
- package/dist/components/notification/Notification.d.ts +1 -1
- package/dist/components/toastManager/ToastManager.d.ts +1 -1
- package/dist/hooks/useCarouselBehaviour/useCarouselBehaviour.d.ts +1 -1
- package/dist/hooks/useModalManager/useModalManager.d.ts +4 -0
- package/dist/hooks/useModalManager/useModalManager.stories.d.ts +8 -0
- package/dist/hooks/usePosition/usePosition.d.ts +0 -0
- package/dist/hooks/useToastManager/useToastManager.d.ts +13 -0
- package/dist/hooks/useToastManager/useToastManager.stories.d.ts +8 -0
- package/dist/index.css +4 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +245 -45
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +244 -46
- package/dist/index.modern.js.map +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -25,13 +25,19 @@ import 'plataforma-fundacao-componentes/dist/index.css'
|
|
|
25
25
|
## 2) Importar o componente e utilizar :P
|
|
26
26
|
|
|
27
27
|
```tsx
|
|
28
|
-
import React
|
|
28
|
+
import React from 'react'
|
|
29
29
|
import { Button } from 'plataforma-fundacao-componentes'
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
export default function Example() {
|
|
32
|
+
return (
|
|
33
|
+
<Button
|
|
34
|
+
onClick={() => {
|
|
35
|
+
console.log('clicou')
|
|
36
|
+
}}
|
|
37
|
+
>
|
|
38
|
+
Clique
|
|
39
|
+
</Button>
|
|
40
|
+
)
|
|
35
41
|
}
|
|
36
42
|
```
|
|
37
43
|
|
|
@@ -7,6 +7,7 @@ interface BannerPesquisaCpfCnpjProps {
|
|
|
7
7
|
inputProps?: InputProps;
|
|
8
8
|
urlImg?: string;
|
|
9
9
|
theme?: 'white' | 'secondary-light' | 'secondary-lighter';
|
|
10
|
+
captcha?: React.ReactNode;
|
|
10
11
|
}
|
|
11
12
|
declare function BannerPesquisaCpfCnpj(props: BannerPesquisaCpfCnpjProps): JSX.Element;
|
|
12
13
|
declare namespace BannerPesquisaCpfCnpj {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './FullHeightContainer.scss';
|
|
3
3
|
interface FullHeightContainerProps {
|
|
4
|
-
header?: React.
|
|
5
|
-
fixedFooter?: React.
|
|
4
|
+
header?: React.ReactNode;
|
|
5
|
+
fixedFooter?: React.ReactNode;
|
|
6
6
|
verticalPadding?: boolean;
|
|
7
7
|
horizontalPadding?: boolean;
|
|
8
|
-
children?: React.
|
|
8
|
+
children?: React.ReactNode;
|
|
9
9
|
}
|
|
10
10
|
declare function FullHeightContainer(props: FullHeightContainerProps): JSX.Element;
|
|
11
11
|
declare namespace FullHeightContainer {
|
|
@@ -1,27 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ModalProps } from './Modal';
|
|
3
|
+
interface AlertModalProps extends ModalProps {
|
|
4
|
+
language?: {
|
|
5
|
+
confirm: string;
|
|
6
|
+
};
|
|
7
|
+
onConfirm: () => void;
|
|
8
|
+
showIcons?: boolean;
|
|
7
9
|
}
|
|
8
|
-
export function
|
|
9
|
-
export namespace
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const showIcons_1: boolean;
|
|
14
|
-
export { showIcons_1 as showIcons };
|
|
15
|
-
}
|
|
16
|
-
export { defaultProps_1 as defaultProps };
|
|
10
|
+
export declare function AlertModal(props: AlertModalProps): JSX.Element;
|
|
11
|
+
export declare namespace AlertModal {
|
|
12
|
+
var defaultProps: {
|
|
13
|
+
showIcons: boolean;
|
|
14
|
+
};
|
|
17
15
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export { defaultProps_2 as defaultProps };
|
|
16
|
+
interface ConfirmModalProps extends ModalProps {
|
|
17
|
+
language?: {
|
|
18
|
+
confirm: string;
|
|
19
|
+
cancel: string;
|
|
20
|
+
};
|
|
21
|
+
onConfirm: () => void;
|
|
22
|
+
onCancel: () => void;
|
|
23
|
+
showIcons?: boolean;
|
|
27
24
|
}
|
|
25
|
+
export declare function ConfirmModal(props: ConfirmModalProps): JSX.Element;
|
|
26
|
+
export declare namespace ConfirmModal {
|
|
27
|
+
var defaultProps: {
|
|
28
|
+
showIcons: boolean;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
interface DestructiveModalProps extends ModalProps {
|
|
32
|
+
language?: {
|
|
33
|
+
confirm: string;
|
|
34
|
+
cancel: string;
|
|
35
|
+
};
|
|
36
|
+
onConfirm: () => void;
|
|
37
|
+
onCancel: () => void;
|
|
38
|
+
showIcons?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export declare function DestructiveModal(props: DestructiveModalProps): JSX.Element;
|
|
41
|
+
export declare namespace DestructiveModal {
|
|
42
|
+
var defaultProps: {
|
|
43
|
+
showIcons: boolean;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
@@ -8,7 +8,7 @@ interface NotificationProps {
|
|
|
8
8
|
verticalOuter?: number;
|
|
9
9
|
horizontalOuter?: number;
|
|
10
10
|
className?: string;
|
|
11
|
-
children: React.
|
|
11
|
+
children: React.ReactNode;
|
|
12
12
|
}
|
|
13
13
|
declare function Notification(props: NotificationProps): JSX.Element;
|
|
14
14
|
declare namespace Notification {
|
|
@@ -7,5 +7,5 @@ interface CarouselBehaviourProps {
|
|
|
7
7
|
slides: any[];
|
|
8
8
|
draggable?: boolean;
|
|
9
9
|
}
|
|
10
|
-
declare function useCarouselBehaviour(props: CarouselBehaviourProps): [React.
|
|
10
|
+
declare function useCarouselBehaviour(props: CarouselBehaviourProps): [React.ReactNode, (newAtual: number, onScroll: boolean) => void];
|
|
11
11
|
export default useCarouselBehaviour;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './../../components/modal/Modal.scss';
|
|
3
|
+
import './useModalManager.scss';
|
|
4
|
+
export default function useModalManager(): [React.ReactNode, <C extends React.ElementType, P extends React.ComponentProps<C>>(component: C, modalProps: P) => void, (modalKey: string | number) => void];
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ToastProps } from '../../components/toast/Toast';
|
|
3
|
+
interface ToastManagerProps {
|
|
4
|
+
max?: string | number;
|
|
5
|
+
marginTop?: string | number;
|
|
6
|
+
verticalPosition?: 'top' | 'bottom';
|
|
7
|
+
horizontalPosition?: 'left' | 'right' | 'center';
|
|
8
|
+
reverse?: boolean;
|
|
9
|
+
animateSize?: boolean;
|
|
10
|
+
pauseOnFocusLoss?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export default function useToastManager(props: ToastManagerProps): [React.ReactNode, (toast: ToastProps) => void, () => void];
|
|
13
|
+
export {};
|
package/dist/index.css
CHANGED
|
@@ -3553,6 +3553,8 @@ h5 {
|
|
|
3553
3553
|
padding: 3%;
|
|
3554
3554
|
height: 412px;
|
|
3555
3555
|
width: 50%; }
|
|
3556
|
+
.banner-pesquisa-cpf-cnpj .banner-pesquisa-cpf-cnpj-left.plus {
|
|
3557
|
+
height: 500px; }
|
|
3556
3558
|
@media screen and (max-width: 767.98px) {
|
|
3557
3559
|
.banner-pesquisa-cpf-cnpj .banner-pesquisa-cpf-cnpj-left {
|
|
3558
3560
|
width: 100%;
|
|
@@ -3579,6 +3581,8 @@ h5 {
|
|
|
3579
3581
|
width: 50%;
|
|
3580
3582
|
background-size: cover;
|
|
3581
3583
|
background-position: center; }
|
|
3584
|
+
.banner-pesquisa-cpf-cnpj .banner-pesquisa-cpf-cnpj-image.plus {
|
|
3585
|
+
height: 500px; }
|
|
3582
3586
|
.banner-pesquisa-cpf-cnpj .banner-pesquisa-cpf-cnpj-image img {
|
|
3583
3587
|
display: none; }
|
|
3584
3588
|
@media screen and (max-width: 767.98px) {
|
package/dist/index.d.ts
CHANGED
|
@@ -81,8 +81,10 @@ import VideoModal from './components/videoModal/VideoModal';
|
|
|
81
81
|
import VideoPlayer from './components/videoPlayer/VideoPlayer';
|
|
82
82
|
import useCarouselBehaviour from './hooks/useCarouselBehaviour/useCarouselBehaviour';
|
|
83
83
|
import useDraggableContainer from './hooks/useDraggableContainer/useDraggableContainer';
|
|
84
|
+
import useModalManager from './hooks/useModalManager/useModalManager';
|
|
84
85
|
import useProgressiveCount from './hooks/useProgressiveCount/useProgressiveCount';
|
|
85
86
|
import useTimeElapsed from './hooks/useTimeElapsed/useTimeElapsed';
|
|
87
|
+
import useToastManager from './hooks/useToastManager/useToastManager';
|
|
86
88
|
export * from './components/modal/ModalTypes';
|
|
87
89
|
export * from './libraries/BlobFileTypes';
|
|
88
90
|
export * from './libraries/ButtonTheme';
|
|
@@ -98,4 +100,4 @@ export * from './libraries/RadioButtonTheme';
|
|
|
98
100
|
export * from './libraries/SicrediLogoThemes';
|
|
99
101
|
export * from './libraries/Toast';
|
|
100
102
|
export * from './libraries/Tooltips';
|
|
101
|
-
export { Accordion, AdvancedSemiHeader, AssembleiaItem, AssembleiaPauta, Aconteceu, AnimatedLink, Banner, BannerAssembleia, BannerPesquisaCpfCnpj, BigBlockButton, BlocoDeNotas, BreadCrumb, Button, ButtonFileUpload, BlocoMinhasAssembleias, BottomNavigation, Card, Carousel, CarouselPersona, CarouselTouchFrendly, Checkbox, Col, Collapse, Container, DatePicker, Doughnut, DoughnutSquare, DropdownItem, DropdownMenu, EditableVideoItem, ElementPaginator, Etapas, Etiqueta, FileLoader, FileUpload, FooterSicredi, FullHeightContainer, Header, HeaderSeparator, HeaderSearchField, IconButton, IconButtonWithLabel, Information, Input, InputArea, ItemDropdownDownload, InformativoAssembleiasComImagem, InformativoAssembleiasComVideo, Menu, MenuItem, Modal, ModalManager, ModulosTitle, MoneyByMonth, MoneyMonthLineChart, NotaEdit, Notification, PageSubTitle, PageTitle, Paginator, PreviaVideo, ProgressBar, RadioButton, Row, SearchBlocoDeNotas, Select, Switch, Table, TableFileNameAndAction, TableActions, TableWithOverflow, TextEditor, LeftCheckboxWithLabel, ActionsColumn, Toast, ToastManager, Tooltip, TooltipManager, TopLoader, VideoItem, VideoPlayer, VideoModal, useProgressiveCount, useCarouselBehaviour, useDraggableContainer, useTimeElapsed };
|
|
103
|
+
export { Accordion, AdvancedSemiHeader, AssembleiaItem, AssembleiaPauta, Aconteceu, AnimatedLink, Banner, BannerAssembleia, BannerPesquisaCpfCnpj, BigBlockButton, BlocoDeNotas, BreadCrumb, Button, ButtonFileUpload, BlocoMinhasAssembleias, BottomNavigation, Card, Carousel, CarouselPersona, CarouselTouchFrendly, Checkbox, Col, Collapse, Container, DatePicker, Doughnut, DoughnutSquare, DropdownItem, DropdownMenu, EditableVideoItem, ElementPaginator, Etapas, Etiqueta, FileLoader, FileUpload, FooterSicredi, FullHeightContainer, Header, HeaderSeparator, HeaderSearchField, IconButton, IconButtonWithLabel, Information, Input, InputArea, ItemDropdownDownload, InformativoAssembleiasComImagem, InformativoAssembleiasComVideo, Menu, MenuItem, Modal, ModalManager, ModulosTitle, MoneyByMonth, MoneyMonthLineChart, NotaEdit, Notification, PageSubTitle, PageTitle, Paginator, PreviaVideo, ProgressBar, RadioButton, Row, SearchBlocoDeNotas, Select, Switch, Table, TableFileNameAndAction, TableActions, TableWithOverflow, TextEditor, LeftCheckboxWithLabel, ActionsColumn, Toast, ToastManager, Tooltip, TooltipManager, TopLoader, VideoItem, VideoPlayer, VideoModal, useProgressiveCount, useCarouselBehaviour, useDraggableContainer, useTimeElapsed, useModalManager, useToastManager };
|
package/dist/index.js
CHANGED
|
@@ -2321,15 +2321,17 @@ function BannerPesquisaCpfCnpj(props) {
|
|
|
2321
2321
|
return React__default.createElement("div", {
|
|
2322
2322
|
className: getMergedClassNames([rootClassName$n, props.theme])
|
|
2323
2323
|
}, React__default.createElement("div", {
|
|
2324
|
-
className: rootClassName$n + "-left"
|
|
2324
|
+
className: getMergedClassNames([rootClassName$n + "-left", props.captcha ? 'plus' : ''])
|
|
2325
2325
|
}, React__default.createElement("div", {
|
|
2326
2326
|
className: rootClassName$n + "-title"
|
|
2327
2327
|
}, props.title), React__default.createElement("div", {
|
|
2328
2328
|
className: rootClassName$n + "-sub-title nunito"
|
|
2329
|
-
}, props.subtitle), React__default.createElement("div", {
|
|
2329
|
+
}, props.subtitle), props.inputProps ? React__default.createElement("div", {
|
|
2330
2330
|
className: rootClassName$n + "-input"
|
|
2331
|
-
}, React__default.createElement(Input$1, Object.assign({}, props.inputProps)))
|
|
2332
|
-
className: rootClassName$n + "-
|
|
2331
|
+
}, React__default.createElement(Input$1, Object.assign({}, props.inputProps))) : undefined, props.captcha ? React__default.createElement("div", {
|
|
2332
|
+
className: rootClassName$n + "-captcha"
|
|
2333
|
+
}, props.captcha) : undefined), React__default.createElement("div", {
|
|
2334
|
+
className: getMergedClassNames([rootClassName$n + "-image", props.captcha ? 'plus' : '']),
|
|
2333
2335
|
style: {
|
|
2334
2336
|
backgroundImage: "url(" + props.urlImg + ")"
|
|
2335
2337
|
}
|
|
@@ -2735,11 +2737,7 @@ function BreadCrumb(props) {
|
|
|
2735
2737
|
return React__default.createElement("div", {
|
|
2736
2738
|
key: index,
|
|
2737
2739
|
className: getMergedClassNames([rootClassName$z + "-path", p.onClick && typeof p.onClick === 'function' ? rootClassName$z + "-active" : '']),
|
|
2738
|
-
onClick:
|
|
2739
|
-
if (typeof p.onClick === 'function') {
|
|
2740
|
-
p.onClick();
|
|
2741
|
-
}
|
|
2742
|
-
}
|
|
2740
|
+
onClick: p.onClick
|
|
2743
2741
|
}, index > 0 ? React__default.createElement("div", {
|
|
2744
2742
|
className: rootClassName$z + "-arrow"
|
|
2745
2743
|
}, React__default.createElement(ChevronArrowRightIcon, null)) : undefined, React__default.createElement("div", {
|
|
@@ -11264,6 +11262,234 @@ VideoModal.defaultProps = {
|
|
|
11264
11262
|
size: 'md'
|
|
11265
11263
|
};
|
|
11266
11264
|
|
|
11265
|
+
var rootClassName$1$ = 'comp-modal-manager';
|
|
11266
|
+
var maskRootClassName$1 = 'component-modal-mask';
|
|
11267
|
+
|
|
11268
|
+
var hackFocus$1 = function hackFocus() {
|
|
11269
|
+
var tmp = document.createElement('input');
|
|
11270
|
+
document.body.appendChild(tmp);
|
|
11271
|
+
tmp.focus();
|
|
11272
|
+
document.body.removeChild(tmp);
|
|
11273
|
+
};
|
|
11274
|
+
|
|
11275
|
+
function useModalManager() {
|
|
11276
|
+
var _useState = React.useState([]),
|
|
11277
|
+
arrayOfModal = _useState[0],
|
|
11278
|
+
setArrayOfModal = _useState[1];
|
|
11279
|
+
|
|
11280
|
+
var refModals = React.useRef(arrayOfModal);
|
|
11281
|
+
refModals.current = arrayOfModal;
|
|
11282
|
+
React.useEffect(function () {
|
|
11283
|
+
var escapeCall = function escapeCall(evt) {
|
|
11284
|
+
if (evt.key === 'Escape' && refModals.current.length) {
|
|
11285
|
+
var mprops = refModals.current[refModals.current.length - 1].props;
|
|
11286
|
+
|
|
11287
|
+
if (!(mprops !== null && mprops !== void 0 && mprops.preventEscExit)) {
|
|
11288
|
+
closeModalByKey(mprops === null || mprops === void 0 ? void 0 : mprops.modalKey);
|
|
11289
|
+
|
|
11290
|
+
if (typeof (mprops === null || mprops === void 0 ? void 0 : mprops.onClose) === 'function') {
|
|
11291
|
+
mprops === null || mprops === void 0 ? void 0 : mprops.onClose(mprops === null || mprops === void 0 ? void 0 : mprops.modalKey);
|
|
11292
|
+
}
|
|
11293
|
+
}
|
|
11294
|
+
}
|
|
11295
|
+
};
|
|
11296
|
+
|
|
11297
|
+
document.addEventListener('keydown', escapeCall);
|
|
11298
|
+
return function () {
|
|
11299
|
+
document.removeEventListener('keydown', escapeCall);
|
|
11300
|
+
};
|
|
11301
|
+
}, []);
|
|
11302
|
+
|
|
11303
|
+
var closeModalByKey = function closeModalByKey(modalKey) {
|
|
11304
|
+
var arr = refModals.current.slice();
|
|
11305
|
+
arr = arr.filter(function (obj) {
|
|
11306
|
+
return String(obj.props.modalKey) !== String(modalKey);
|
|
11307
|
+
});
|
|
11308
|
+
setArrayOfModal(arr);
|
|
11309
|
+
};
|
|
11310
|
+
|
|
11311
|
+
var openModal = function openModal(component, modalProps) {
|
|
11312
|
+
var modalKey = modalProps.modalKey ? modalProps.modalKey : getUniqueKey();
|
|
11313
|
+
|
|
11314
|
+
if (typeof component === 'function') {
|
|
11315
|
+
var arr = refModals.current.slice();
|
|
11316
|
+
|
|
11317
|
+
var p = _extends({}, modalProps, {
|
|
11318
|
+
modalKey: modalKey,
|
|
11319
|
+
onClose: function onClose(modalKey) {
|
|
11320
|
+
closeModalByKey(modalKey);
|
|
11321
|
+
|
|
11322
|
+
if (typeof modalProps.onClose === 'function') {
|
|
11323
|
+
modalProps.onClose(modalKey);
|
|
11324
|
+
}
|
|
11325
|
+
}
|
|
11326
|
+
});
|
|
11327
|
+
|
|
11328
|
+
arr.push({
|
|
11329
|
+
component: component,
|
|
11330
|
+
props: p
|
|
11331
|
+
});
|
|
11332
|
+
setArrayOfModal(arr);
|
|
11333
|
+
hackFocus$1();
|
|
11334
|
+
return modalKey;
|
|
11335
|
+
}
|
|
11336
|
+
|
|
11337
|
+
return '';
|
|
11338
|
+
};
|
|
11339
|
+
|
|
11340
|
+
var closeModal = function closeModal(modalKey) {
|
|
11341
|
+
if (modalKey) {
|
|
11342
|
+
closeModalByKey(modalKey);
|
|
11343
|
+
} else if (refModals.current.length) {
|
|
11344
|
+
var _refModals$current, _refModals$current$pr;
|
|
11345
|
+
|
|
11346
|
+
closeModalByKey((_refModals$current = refModals.current[refModals.current.length - 1]) === null || _refModals$current === void 0 ? void 0 : (_refModals$current$pr = _refModals$current.props) === null || _refModals$current$pr === void 0 ? void 0 : _refModals$current$pr.modalKey);
|
|
11347
|
+
}
|
|
11348
|
+
};
|
|
11349
|
+
|
|
11350
|
+
return [React__default.createElement(React__default.Fragment, null, React__default.createElement(reactTransitionGroup.TransitionGroup, {
|
|
11351
|
+
className: rootClassName$1$ + "-modals"
|
|
11352
|
+
}, arrayOfModal.map(function (obj) {
|
|
11353
|
+
var _obj$props, _obj$props2, _obj$props3;
|
|
11354
|
+
|
|
11355
|
+
var M = obj.component;
|
|
11356
|
+
return React__default.createElement(reactTransitionGroup.CSSTransition, {
|
|
11357
|
+
timeout: 300,
|
|
11358
|
+
classNames: (_obj$props = obj.props) !== null && _obj$props !== void 0 && _obj$props.mobileOnXS ? rootClassName$1$ + "-mask-mobile-on-xs" : rootClassName$1$ + "-mask",
|
|
11359
|
+
key: (_obj$props2 = obj.props) === null || _obj$props2 === void 0 ? void 0 : _obj$props2.modalKey,
|
|
11360
|
+
unmountOnExit: true
|
|
11361
|
+
}, React__default.createElement(ModalMask, {
|
|
11362
|
+
mobileOnXS: Boolean((_obj$props3 = obj.props) === null || _obj$props3 === void 0 ? void 0 : _obj$props3.mobileOnXS),
|
|
11363
|
+
onClick: function onClick(evt) {
|
|
11364
|
+
if (evt.target.classList.contains(maskRootClassName$1)) {
|
|
11365
|
+
var _obj$props4, _obj$props5;
|
|
11366
|
+
|
|
11367
|
+
if (typeof ((_obj$props4 = obj.props) === null || _obj$props4 === void 0 ? void 0 : _obj$props4.onClose) === 'function' && !((_obj$props5 = obj.props) !== null && _obj$props5 !== void 0 && _obj$props5.preventMaskExit)) {
|
|
11368
|
+
var _obj$props6, _obj$props7;
|
|
11369
|
+
|
|
11370
|
+
(_obj$props6 = obj.props) === null || _obj$props6 === void 0 ? void 0 : _obj$props6.onClose((_obj$props7 = obj.props) === null || _obj$props7 === void 0 ? void 0 : _obj$props7.modalKey);
|
|
11371
|
+
}
|
|
11372
|
+
}
|
|
11373
|
+
}
|
|
11374
|
+
}, React__default.createElement(M, Object.assign({}, obj.props))));
|
|
11375
|
+
}))), openModal, closeModal];
|
|
11376
|
+
}
|
|
11377
|
+
|
|
11378
|
+
var rootClassName$20 = 'comp-toast-manager';
|
|
11379
|
+
var count$1 = 0;
|
|
11380
|
+
function useToastManager(props) {
|
|
11381
|
+
var _useState = React.useState([]),
|
|
11382
|
+
arrayOfToast = _useState[0],
|
|
11383
|
+
setArrayOfToast = _useState[1];
|
|
11384
|
+
|
|
11385
|
+
var closeById = React.useCallback(function (id) {
|
|
11386
|
+
var arr = arrayOfToast.filter(function (a) {
|
|
11387
|
+
return a.id !== id;
|
|
11388
|
+
});
|
|
11389
|
+
setArrayOfToast(arr);
|
|
11390
|
+
}, [arrayOfToast]);
|
|
11391
|
+
var showToast = React.useCallback(function (toast) {
|
|
11392
|
+
var id = "toaster-" + count$1;
|
|
11393
|
+
var arr = arrayOfToast.slice();
|
|
11394
|
+
var obj = {};
|
|
11395
|
+
|
|
11396
|
+
if (toast.prevent && arrayOfToast.some(function (t) {
|
|
11397
|
+
return t.label === toast.label;
|
|
11398
|
+
})) {
|
|
11399
|
+
return;
|
|
11400
|
+
}
|
|
11401
|
+
|
|
11402
|
+
obj = _extends({
|
|
11403
|
+
id: id
|
|
11404
|
+
}, toast);
|
|
11405
|
+
|
|
11406
|
+
if (!props.max || arrayOfToast.length < props.max) {
|
|
11407
|
+
arr.push(obj);
|
|
11408
|
+
setArrayOfToast(arr);
|
|
11409
|
+
count$1++;
|
|
11410
|
+
}
|
|
11411
|
+
}, [props.max, arrayOfToast]);
|
|
11412
|
+
var clearToast = React.useCallback(function () {
|
|
11413
|
+
setArrayOfToast([]);
|
|
11414
|
+
}, []);
|
|
11415
|
+
var classNames = React.useMemo(function () {
|
|
11416
|
+
return getMergedClassNames([rootClassName$20 + "-toasts", rootClassName$20 + "-" + props.verticalPosition, rootClassName$20 + "-" + props.horizontalPosition, props.reverse ? rootClassName$20 + "-reverse" : '', props.animateSize ? rootClassName$20 + "-animate-size" : '']);
|
|
11417
|
+
}, [props.reverse, props.animateSize, props.horizontalPosition, props.verticalPosition]);
|
|
11418
|
+
React.useLayoutEffect(function () {
|
|
11419
|
+
var wrapper = document.querySelector("." + rootClassName$20 + "-toasts");
|
|
11420
|
+
|
|
11421
|
+
if (wrapper && wrapper.childElementCount > 0) {
|
|
11422
|
+
var somaDasAlturas = 0;
|
|
11423
|
+
|
|
11424
|
+
if (props.verticalPosition === 'top' && !props.reverse) {
|
|
11425
|
+
somaDasAlturas = 12;
|
|
11426
|
+
|
|
11427
|
+
for (var i = 0; i < wrapper.children.length; i++) {
|
|
11428
|
+
var el = wrapper.children[i];
|
|
11429
|
+
|
|
11430
|
+
if (!el.classList.contains(rootClassName$20 + "-toast-exit")) {
|
|
11431
|
+
el.style.transform = "translateY(" + somaDasAlturas + "px)";
|
|
11432
|
+
somaDasAlturas += el.getBoundingClientRect().height + 12;
|
|
11433
|
+
}
|
|
11434
|
+
}
|
|
11435
|
+
} else if (props.verticalPosition === 'top') {
|
|
11436
|
+
for (var _i = wrapper.children.length - 1; _i >= 0; _i--) {
|
|
11437
|
+
var _el = wrapper.children[_i];
|
|
11438
|
+
|
|
11439
|
+
if (!_el.classList.contains(rootClassName$20 + "-toast-exit")) {
|
|
11440
|
+
somaDasAlturas += _el.getBoundingClientRect().height + 12;
|
|
11441
|
+
_el.style.transform = "translateY(" + somaDasAlturas + "px)";
|
|
11442
|
+
}
|
|
11443
|
+
}
|
|
11444
|
+
} else if (props.verticalPosition === 'bottom' && !props.reverse) {
|
|
11445
|
+
for (var _i2 = 0; _i2 < wrapper.children.length; _i2++) {
|
|
11446
|
+
var _el2 = wrapper.children[_i2];
|
|
11447
|
+
|
|
11448
|
+
if (!_el2.classList.contains(rootClassName$20 + "-toast-exit")) {
|
|
11449
|
+
somaDasAlturas += _el2.getBoundingClientRect().height + 12;
|
|
11450
|
+
_el2.style.transform = "translateY(-" + somaDasAlturas + "px)";
|
|
11451
|
+
}
|
|
11452
|
+
}
|
|
11453
|
+
} else {
|
|
11454
|
+
somaDasAlturas = 12;
|
|
11455
|
+
|
|
11456
|
+
for (var _i3 = wrapper.children.length - 1; _i3 >= 0; _i3--) {
|
|
11457
|
+
var _el3 = wrapper.children[_i3];
|
|
11458
|
+
|
|
11459
|
+
if (!_el3.classList.contains(rootClassName$20 + "-toast-exit")) {
|
|
11460
|
+
_el3.style.transform = "translateY(-" + somaDasAlturas + "px)";
|
|
11461
|
+
somaDasAlturas += _el3.getBoundingClientRect().height + 12;
|
|
11462
|
+
}
|
|
11463
|
+
}
|
|
11464
|
+
}
|
|
11465
|
+
}
|
|
11466
|
+
}, [arrayOfToast, props.reverse, props.verticalPosition]);
|
|
11467
|
+
return [React__default.createElement(React__default.Fragment, null, React__default.createElement(reactTransitionGroup.TransitionGroup, {
|
|
11468
|
+
className: classNames
|
|
11469
|
+
}, arrayOfToast.map(function (toast) {
|
|
11470
|
+
return React__default.createElement(reactTransitionGroup.CSSTransition, {
|
|
11471
|
+
timeout: 300,
|
|
11472
|
+
classNames: rootClassName$20 + "-toast",
|
|
11473
|
+
key: toast.id,
|
|
11474
|
+
unmountOnExit: true
|
|
11475
|
+
}, React__default.createElement("div", {
|
|
11476
|
+
className: rootClassName$20 + "-toastzin"
|
|
11477
|
+
}, React__default.createElement(Toast, {
|
|
11478
|
+
theme: toast.theme,
|
|
11479
|
+
label: toast.label,
|
|
11480
|
+
onClose: function onClose() {
|
|
11481
|
+
return closeById(toast.id);
|
|
11482
|
+
},
|
|
11483
|
+
timeout: toast.timeout,
|
|
11484
|
+
showStatusBar: toast.showStatusBar,
|
|
11485
|
+
showActionButton: toast.showActionButton,
|
|
11486
|
+
onActionButtonClick: toast.onActionButtonClick,
|
|
11487
|
+
actionButtonText: toast.actionButtonText,
|
|
11488
|
+
pauseOnFocusLoss: props.pauseOnFocusLoss
|
|
11489
|
+
})));
|
|
11490
|
+
}))), showToast, clearToast];
|
|
11491
|
+
}
|
|
11492
|
+
|
|
11267
11493
|
function AlertModal(props) {
|
|
11268
11494
|
var getProps = function getProps() {
|
|
11269
11495
|
var p = _extends({
|
|
@@ -11271,7 +11497,7 @@ function AlertModal(props) {
|
|
|
11271
11497
|
children: !props.language || !props.language.confirm ? languageValues.components.modals.alertModal.confirm : props.language.confirm,
|
|
11272
11498
|
onClick: props.onConfirm,
|
|
11273
11499
|
theme: 'primary',
|
|
11274
|
-
leftIcon: props.showIcons ?
|
|
11500
|
+
leftIcon: props.showIcons ? React__default.createElement(CheckCircleIcon, null) : undefined
|
|
11275
11501
|
}]
|
|
11276
11502
|
}, props);
|
|
11277
11503
|
|
|
@@ -11279,16 +11505,8 @@ function AlertModal(props) {
|
|
|
11279
11505
|
return p;
|
|
11280
11506
|
};
|
|
11281
11507
|
|
|
11282
|
-
return
|
|
11508
|
+
return React__default.createElement(Modal, Object.assign({}, getProps()));
|
|
11283
11509
|
}
|
|
11284
|
-
AlertModal.propTypes = _extends({}, Modal.propTypes, {
|
|
11285
|
-
language: propTypes.shape({
|
|
11286
|
-
confirm: propTypes.string
|
|
11287
|
-
}),
|
|
11288
|
-
onConfirm: propTypes.func,
|
|
11289
|
-
onClose: propTypes.func,
|
|
11290
|
-
showIcons: propTypes.bool
|
|
11291
|
-
});
|
|
11292
11510
|
AlertModal.defaultProps = {
|
|
11293
11511
|
showIcons: true
|
|
11294
11512
|
};
|
|
@@ -11299,12 +11517,12 @@ function ConfirmModal(props) {
|
|
|
11299
11517
|
children: !props.language || !props.language.cancel ? languageValues.components.modals.confirmModal.cancel : props.language.cancel,
|
|
11300
11518
|
onClick: props.onCancel,
|
|
11301
11519
|
theme: BUTTON_STYLE_SECONDARY,
|
|
11302
|
-
leftIcon: props.showIcons ?
|
|
11520
|
+
leftIcon: props.showIcons ? React__default.createElement(TimesCircleIcon, null) : undefined
|
|
11303
11521
|
}, {
|
|
11304
11522
|
children: !props.language || !props.language.confirm ? languageValues.components.modals.confirmModal.confirm : props.language.confirm,
|
|
11305
11523
|
onClick: props.onConfirm,
|
|
11306
11524
|
theme: BUTTON_STYLE_PRIMARY,
|
|
11307
|
-
leftIcon: props.showIcons ?
|
|
11525
|
+
leftIcon: props.showIcons ? React__default.createElement(CheckCircleIcon, null) : undefined
|
|
11308
11526
|
}]
|
|
11309
11527
|
}, props);
|
|
11310
11528
|
|
|
@@ -11312,18 +11530,8 @@ function ConfirmModal(props) {
|
|
|
11312
11530
|
return p;
|
|
11313
11531
|
};
|
|
11314
11532
|
|
|
11315
|
-
return
|
|
11533
|
+
return React__default.createElement(Modal, Object.assign({}, getProps()));
|
|
11316
11534
|
}
|
|
11317
|
-
ConfirmModal.propTypes = _extends({}, Modal.propTypes, {
|
|
11318
|
-
language: propTypes.shape({
|
|
11319
|
-
confirm: propTypes.string,
|
|
11320
|
-
cancel: propTypes.string
|
|
11321
|
-
}),
|
|
11322
|
-
onConfirm: propTypes.func,
|
|
11323
|
-
onClose: propTypes.func,
|
|
11324
|
-
onCancel: propTypes.func,
|
|
11325
|
-
showIcons: propTypes.bool
|
|
11326
|
-
});
|
|
11327
11535
|
ConfirmModal.defaultProps = {
|
|
11328
11536
|
showIcons: true
|
|
11329
11537
|
};
|
|
@@ -11334,12 +11542,12 @@ function DestructiveModal(props) {
|
|
|
11334
11542
|
children: !props.language || !props.language.cancel ? languageValues.components.modals.destructiveModal.cancel : props.language.cancel,
|
|
11335
11543
|
onClick: props.onCancel,
|
|
11336
11544
|
theme: BUTTON_STYLE_DEFAULT,
|
|
11337
|
-
leftIcon: props.showIcons ?
|
|
11545
|
+
leftIcon: props.showIcons ? React__default.createElement(TimesCircleIcon, null) : undefined
|
|
11338
11546
|
}, {
|
|
11339
11547
|
children: !props.language || !props.language.confirm ? languageValues.components.modals.destructiveModal.confirm : props.language.confirm,
|
|
11340
11548
|
onClick: props.onConfirm,
|
|
11341
11549
|
theme: BUTTON_STYLE_DANGER,
|
|
11342
|
-
leftIcon: props.showIcons ?
|
|
11550
|
+
leftIcon: props.showIcons ? React__default.createElement(TrashIcon, null) : undefined
|
|
11343
11551
|
}]
|
|
11344
11552
|
}, props);
|
|
11345
11553
|
|
|
@@ -11347,18 +11555,8 @@ function DestructiveModal(props) {
|
|
|
11347
11555
|
return p;
|
|
11348
11556
|
};
|
|
11349
11557
|
|
|
11350
|
-
return
|
|
11558
|
+
return React__default.createElement(Modal, Object.assign({}, getProps()));
|
|
11351
11559
|
}
|
|
11352
|
-
DestructiveModal.propTypes = _extends({}, Modal.propTypes, {
|
|
11353
|
-
language: propTypes.shape({
|
|
11354
|
-
confirm: propTypes.string,
|
|
11355
|
-
cancel: propTypes.string
|
|
11356
|
-
}),
|
|
11357
|
-
onConfirm: propTypes.func,
|
|
11358
|
-
onClose: propTypes.func,
|
|
11359
|
-
onCancel: propTypes.func,
|
|
11360
|
-
showIcons: propTypes.bool
|
|
11361
|
-
});
|
|
11362
11560
|
DestructiveModal.defaultProps = {
|
|
11363
11561
|
showIcons: true
|
|
11364
11562
|
};
|
|
@@ -11547,6 +11745,8 @@ exports.VideoPlayer = VideoPlayer;
|
|
|
11547
11745
|
exports.getStatusClassName = getStatusClassName;
|
|
11548
11746
|
exports.useCarouselBehaviour = useCarouselBehaviour;
|
|
11549
11747
|
exports.useDraggableContainer = useDraggableContainer;
|
|
11748
|
+
exports.useModalManager = useModalManager;
|
|
11550
11749
|
exports.useProgressiveCount = useProgressiveCount;
|
|
11551
11750
|
exports.useTimeElapsed = useTimeElapsed;
|
|
11751
|
+
exports.useToastManager = useToastManager;
|
|
11552
11752
|
//# sourceMappingURL=index.js.map
|