plataforma-fundacao-componentes 2.20.27 → 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/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.d.ts +3 -1
- package/dist/index.js +240 -42
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +239 -43
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
|
@@ -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.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
|
@@ -2329,7 +2329,7 @@ function BannerPesquisaCpfCnpj(props) {
|
|
|
2329
2329
|
}, props.subtitle), props.inputProps ? React__default.createElement("div", {
|
|
2330
2330
|
className: rootClassName$n + "-input"
|
|
2331
2331
|
}, React__default.createElement(Input$1, Object.assign({}, props.inputProps))) : undefined, props.captcha ? React__default.createElement("div", {
|
|
2332
|
-
className:
|
|
2332
|
+
className: rootClassName$n + "-captcha"
|
|
2333
2333
|
}, props.captcha) : undefined), React__default.createElement("div", {
|
|
2334
2334
|
className: getMergedClassNames([rootClassName$n + "-image", props.captcha ? 'plus' : '']),
|
|
2335
2335
|
style: {
|
|
@@ -2737,11 +2737,7 @@ function BreadCrumb(props) {
|
|
|
2737
2737
|
return React__default.createElement("div", {
|
|
2738
2738
|
key: index,
|
|
2739
2739
|
className: getMergedClassNames([rootClassName$z + "-path", p.onClick && typeof p.onClick === 'function' ? rootClassName$z + "-active" : '']),
|
|
2740
|
-
onClick:
|
|
2741
|
-
if (typeof p.onClick === 'function') {
|
|
2742
|
-
p.onClick();
|
|
2743
|
-
}
|
|
2744
|
-
}
|
|
2740
|
+
onClick: p.onClick
|
|
2745
2741
|
}, index > 0 ? React__default.createElement("div", {
|
|
2746
2742
|
className: rootClassName$z + "-arrow"
|
|
2747
2743
|
}, React__default.createElement(ChevronArrowRightIcon, null)) : undefined, React__default.createElement("div", {
|
|
@@ -11266,6 +11262,234 @@ VideoModal.defaultProps = {
|
|
|
11266
11262
|
size: 'md'
|
|
11267
11263
|
};
|
|
11268
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
|
+
|
|
11269
11493
|
function AlertModal(props) {
|
|
11270
11494
|
var getProps = function getProps() {
|
|
11271
11495
|
var p = _extends({
|
|
@@ -11273,7 +11497,7 @@ function AlertModal(props) {
|
|
|
11273
11497
|
children: !props.language || !props.language.confirm ? languageValues.components.modals.alertModal.confirm : props.language.confirm,
|
|
11274
11498
|
onClick: props.onConfirm,
|
|
11275
11499
|
theme: 'primary',
|
|
11276
|
-
leftIcon: props.showIcons ?
|
|
11500
|
+
leftIcon: props.showIcons ? React__default.createElement(CheckCircleIcon, null) : undefined
|
|
11277
11501
|
}]
|
|
11278
11502
|
}, props);
|
|
11279
11503
|
|
|
@@ -11281,16 +11505,8 @@ function AlertModal(props) {
|
|
|
11281
11505
|
return p;
|
|
11282
11506
|
};
|
|
11283
11507
|
|
|
11284
|
-
return
|
|
11508
|
+
return React__default.createElement(Modal, Object.assign({}, getProps()));
|
|
11285
11509
|
}
|
|
11286
|
-
AlertModal.propTypes = _extends({}, Modal.propTypes, {
|
|
11287
|
-
language: propTypes.shape({
|
|
11288
|
-
confirm: propTypes.string
|
|
11289
|
-
}),
|
|
11290
|
-
onConfirm: propTypes.func,
|
|
11291
|
-
onClose: propTypes.func,
|
|
11292
|
-
showIcons: propTypes.bool
|
|
11293
|
-
});
|
|
11294
11510
|
AlertModal.defaultProps = {
|
|
11295
11511
|
showIcons: true
|
|
11296
11512
|
};
|
|
@@ -11301,12 +11517,12 @@ function ConfirmModal(props) {
|
|
|
11301
11517
|
children: !props.language || !props.language.cancel ? languageValues.components.modals.confirmModal.cancel : props.language.cancel,
|
|
11302
11518
|
onClick: props.onCancel,
|
|
11303
11519
|
theme: BUTTON_STYLE_SECONDARY,
|
|
11304
|
-
leftIcon: props.showIcons ?
|
|
11520
|
+
leftIcon: props.showIcons ? React__default.createElement(TimesCircleIcon, null) : undefined
|
|
11305
11521
|
}, {
|
|
11306
11522
|
children: !props.language || !props.language.confirm ? languageValues.components.modals.confirmModal.confirm : props.language.confirm,
|
|
11307
11523
|
onClick: props.onConfirm,
|
|
11308
11524
|
theme: BUTTON_STYLE_PRIMARY,
|
|
11309
|
-
leftIcon: props.showIcons ?
|
|
11525
|
+
leftIcon: props.showIcons ? React__default.createElement(CheckCircleIcon, null) : undefined
|
|
11310
11526
|
}]
|
|
11311
11527
|
}, props);
|
|
11312
11528
|
|
|
@@ -11314,18 +11530,8 @@ function ConfirmModal(props) {
|
|
|
11314
11530
|
return p;
|
|
11315
11531
|
};
|
|
11316
11532
|
|
|
11317
|
-
return
|
|
11533
|
+
return React__default.createElement(Modal, Object.assign({}, getProps()));
|
|
11318
11534
|
}
|
|
11319
|
-
ConfirmModal.propTypes = _extends({}, Modal.propTypes, {
|
|
11320
|
-
language: propTypes.shape({
|
|
11321
|
-
confirm: propTypes.string,
|
|
11322
|
-
cancel: propTypes.string
|
|
11323
|
-
}),
|
|
11324
|
-
onConfirm: propTypes.func,
|
|
11325
|
-
onClose: propTypes.func,
|
|
11326
|
-
onCancel: propTypes.func,
|
|
11327
|
-
showIcons: propTypes.bool
|
|
11328
|
-
});
|
|
11329
11535
|
ConfirmModal.defaultProps = {
|
|
11330
11536
|
showIcons: true
|
|
11331
11537
|
};
|
|
@@ -11336,12 +11542,12 @@ function DestructiveModal(props) {
|
|
|
11336
11542
|
children: !props.language || !props.language.cancel ? languageValues.components.modals.destructiveModal.cancel : props.language.cancel,
|
|
11337
11543
|
onClick: props.onCancel,
|
|
11338
11544
|
theme: BUTTON_STYLE_DEFAULT,
|
|
11339
|
-
leftIcon: props.showIcons ?
|
|
11545
|
+
leftIcon: props.showIcons ? React__default.createElement(TimesCircleIcon, null) : undefined
|
|
11340
11546
|
}, {
|
|
11341
11547
|
children: !props.language || !props.language.confirm ? languageValues.components.modals.destructiveModal.confirm : props.language.confirm,
|
|
11342
11548
|
onClick: props.onConfirm,
|
|
11343
11549
|
theme: BUTTON_STYLE_DANGER,
|
|
11344
|
-
leftIcon: props.showIcons ?
|
|
11550
|
+
leftIcon: props.showIcons ? React__default.createElement(TrashIcon, null) : undefined
|
|
11345
11551
|
}]
|
|
11346
11552
|
}, props);
|
|
11347
11553
|
|
|
@@ -11349,18 +11555,8 @@ function DestructiveModal(props) {
|
|
|
11349
11555
|
return p;
|
|
11350
11556
|
};
|
|
11351
11557
|
|
|
11352
|
-
return
|
|
11558
|
+
return React__default.createElement(Modal, Object.assign({}, getProps()));
|
|
11353
11559
|
}
|
|
11354
|
-
DestructiveModal.propTypes = _extends({}, Modal.propTypes, {
|
|
11355
|
-
language: propTypes.shape({
|
|
11356
|
-
confirm: propTypes.string,
|
|
11357
|
-
cancel: propTypes.string
|
|
11358
|
-
}),
|
|
11359
|
-
onConfirm: propTypes.func,
|
|
11360
|
-
onClose: propTypes.func,
|
|
11361
|
-
onCancel: propTypes.func,
|
|
11362
|
-
showIcons: propTypes.bool
|
|
11363
|
-
});
|
|
11364
11560
|
DestructiveModal.defaultProps = {
|
|
11365
11561
|
showIcons: true
|
|
11366
11562
|
};
|
|
@@ -11549,6 +11745,8 @@ exports.VideoPlayer = VideoPlayer;
|
|
|
11549
11745
|
exports.getStatusClassName = getStatusClassName;
|
|
11550
11746
|
exports.useCarouselBehaviour = useCarouselBehaviour;
|
|
11551
11747
|
exports.useDraggableContainer = useDraggableContainer;
|
|
11748
|
+
exports.useModalManager = useModalManager;
|
|
11552
11749
|
exports.useProgressiveCount = useProgressiveCount;
|
|
11553
11750
|
exports.useTimeElapsed = useTimeElapsed;
|
|
11751
|
+
exports.useToastManager = useToastManager;
|
|
11554
11752
|
//# sourceMappingURL=index.js.map
|