@deviceinsight/ng-ui-basic-components 3.13.0-SNAPSHOT
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/LICENSE +1 -0
- package/README.md +102 -0
- package/lib/cjs/__mocks__/react-i18next.d.ts +2 -0
- package/lib/cjs/__mocks__/react-i18next.d.ts.map +1 -0
- package/lib/cjs/__mocks__/react-i18next.js +18 -0
- package/lib/cjs/assets/img/icon-arrow-back.png +0 -0
- package/lib/cjs/assets/img/icon_folder_closed.png +0 -0
- package/lib/cjs/assets/img/icon_folder_closed_light.png +0 -0
- package/lib/cjs/assets/img/icon_folder_open.png +0 -0
- package/lib/cjs/assets/img/icon_folder_open_light.png +0 -0
- package/lib/cjs/assets/img/icon_help_light_24.png +0 -0
- package/lib/cjs/assets/img/icon_variablenode.png +0 -0
- package/lib/cjs/assets/img/icon_variablenode_light.png +0 -0
- package/lib/cjs/assets/img/toastify_msg_error_24.png +0 -0
- package/lib/cjs/assets/img/toastify_msg_success_24.png +0 -0
- package/lib/cjs/assets/search-box.css +29 -0
- package/lib/cjs/assets/style.css +219 -0
- package/lib/cjs/assets/svg/icon_add.svg +3 -0
- package/lib/cjs/assets/svg/icon_calendar.svg +50 -0
- package/lib/cjs/assets/svg/icon_chevron_left.svg +6 -0
- package/lib/cjs/assets/svg/icon_chevron_right.svg +6 -0
- package/lib/cjs/assets/svg/icon_cross.svg +3 -0
- package/lib/cjs/assets/svg/icon_download.svg +5 -0
- package/lib/cjs/assets/svg/icon_duplicate.svg +10 -0
- package/lib/cjs/assets/svg/icon_edit.svg +6 -0
- package/lib/cjs/assets/svg/icon_folder_loading.svg +21 -0
- package/lib/cjs/assets/svg/icon_fullscreen.svg +6 -0
- package/lib/cjs/assets/svg/icon_gear.svg +5 -0
- package/lib/cjs/assets/svg/icon_help_light.svg +3 -0
- package/lib/cjs/assets/svg/icon_key.svg +3 -0
- package/lib/cjs/assets/svg/icon_lupe.svg +14 -0
- package/lib/cjs/assets/svg/icon_menu_horizontal.svg +5 -0
- package/lib/cjs/assets/svg/icon_menu_vertical.svg +5 -0
- package/lib/cjs/assets/svg/icon_reload.svg +6 -0
- package/lib/cjs/assets/svg/icon_star.svg +4 -0
- package/lib/cjs/assets/svg/icon_upload.svg +7 -0
- package/lib/cjs/assets/svg/icon_warning_triangle.svg +12 -0
- package/lib/cjs/assets/svg/triangle_down.svg +3 -0
- package/lib/cjs/assets/svg/triangle_left.svg +3 -0
- package/lib/cjs/assets/svg/triangle_right.svg +3 -0
- package/lib/cjs/assets/svg/triangle_up.svg +3 -0
- package/lib/cjs/assets/svg/triangle_up_and_down.svg +4 -0
- package/lib/cjs/components/accordion/Accordion.d.ts +25 -0
- package/lib/cjs/components/accordion/Accordion.d.ts.map +1 -0
- package/lib/cjs/components/accordion/Accordion.js +60 -0
- package/lib/cjs/components/accordionComponents/AccordionItem.d.ts +32 -0
- package/lib/cjs/components/accordionComponents/AccordionItem.d.ts.map +1 -0
- package/lib/cjs/components/accordionComponents/AccordionItem.js +50 -0
- package/lib/cjs/components/bubble/Bubble.d.ts +35 -0
- package/lib/cjs/components/bubble/Bubble.d.ts.map +1 -0
- package/lib/cjs/components/bubble/Bubble.js +42 -0
- package/lib/cjs/components/button/Button.d.ts +33 -0
- package/lib/cjs/components/button/Button.d.ts.map +1 -0
- package/lib/cjs/components/button/Button.js +22 -0
- package/lib/cjs/components/button/ButtonRow.d.ts +23 -0
- package/lib/cjs/components/button/ButtonRow.d.ts.map +1 -0
- package/lib/cjs/components/button/ButtonRow.js +35 -0
- package/lib/cjs/components/confirm/Confirm.d.ts +19 -0
- package/lib/cjs/components/confirm/Confirm.d.ts.map +1 -0
- package/lib/cjs/components/confirm/Confirm.js +49 -0
- package/lib/cjs/components/confirm/ConfirmProvider.d.ts +14 -0
- package/lib/cjs/components/confirm/ConfirmProvider.d.ts.map +1 -0
- package/lib/cjs/components/confirm/ConfirmProvider.js +63 -0
- package/lib/cjs/components/confirm/useConfirm.d.ts +9 -0
- package/lib/cjs/components/confirm/useConfirm.d.ts.map +1 -0
- package/lib/cjs/components/confirm/useConfirm.js +13 -0
- package/lib/cjs/components/confirm/utils.d.ts +4 -0
- package/lib/cjs/components/confirm/utils.d.ts.map +1 -0
- package/lib/cjs/components/confirm/utils.js +11 -0
- package/lib/cjs/components/confirm/withConfirm.d.ts +7 -0
- package/lib/cjs/components/confirm/withConfirm.d.ts.map +1 -0
- package/lib/cjs/components/confirm/withConfirm.js +43 -0
- package/lib/cjs/components/icon/Icon.d.ts +24 -0
- package/lib/cjs/components/icon/Icon.d.ts.map +1 -0
- package/lib/cjs/components/icon/Icon.js +116 -0
- package/lib/cjs/components/input/Checkbox.d.ts +29 -0
- package/lib/cjs/components/input/Checkbox.d.ts.map +1 -0
- package/lib/cjs/components/input/Checkbox.js +75 -0
- package/lib/cjs/components/input/SearchBox.d.ts +21 -0
- package/lib/cjs/components/input/SearchBox.d.ts.map +1 -0
- package/lib/cjs/components/input/SearchBox.js +90 -0
- package/lib/cjs/components/label/Label.d.ts +23 -0
- package/lib/cjs/components/label/Label.d.ts.map +1 -0
- package/lib/cjs/components/label/Label.js +24 -0
- package/lib/cjs/components/modal/Modal.d.ts +29 -0
- package/lib/cjs/components/modal/Modal.d.ts.map +1 -0
- package/lib/cjs/components/modal/Modal.js +65 -0
- package/lib/cjs/components/modalComponents/ModalContainer.d.ts +6 -0
- package/lib/cjs/components/modalComponents/ModalContainer.d.ts.map +1 -0
- package/lib/cjs/components/modalComponents/ModalContainer.js +12 -0
- package/lib/cjs/components/modalComponents/ModalWindow.d.ts +4 -0
- package/lib/cjs/components/modalComponents/ModalWindow.d.ts.map +1 -0
- package/lib/cjs/components/modalComponents/ModalWindow.js +50 -0
- package/lib/cjs/components/popup/Popup.d.ts +38 -0
- package/lib/cjs/components/popup/Popup.d.ts.map +1 -0
- package/lib/cjs/components/popup/Popup.js +78 -0
- package/lib/cjs/components/popupComponents/PopupArea.d.ts +18 -0
- package/lib/cjs/components/popupComponents/PopupArea.d.ts.map +1 -0
- package/lib/cjs/components/popupComponents/PopupArea.js +46 -0
- package/lib/cjs/components/spinner/Spinner.d.ts +20 -0
- package/lib/cjs/components/spinner/Spinner.d.ts.map +1 -0
- package/lib/cjs/components/spinner/Spinner.js +34 -0
- package/lib/cjs/components/spinner/SpinnerContainer.d.ts +23 -0
- package/lib/cjs/components/spinner/SpinnerContainer.d.ts.map +1 -0
- package/lib/cjs/components/spinner/SpinnerContainer.js +24 -0
- package/lib/cjs/components/tabs/Tabs.d.ts +34 -0
- package/lib/cjs/components/tabs/Tabs.d.ts.map +1 -0
- package/lib/cjs/components/tabs/Tabs.js +75 -0
- package/lib/cjs/components/tooltip/Tooltip.d.ts +28 -0
- package/lib/cjs/components/tooltip/Tooltip.d.ts.map +1 -0
- package/lib/cjs/components/tooltip/Tooltip.js +39 -0
- package/lib/cjs/hooks/useOutsideClick.d.ts +3 -0
- package/lib/cjs/hooks/useOutsideClick.d.ts.map +1 -0
- package/lib/cjs/hooks/useOutsideClick.js +42 -0
- package/lib/cjs/index.d.ts +22 -0
- package/lib/cjs/index.d.ts.map +1 -0
- package/lib/cjs/index.js +46 -0
- package/lib/cjs/types/i18n.d.ts +5 -0
- package/lib/cjs/types/i18n.d.ts.map +1 -0
- package/lib/cjs/types/i18n.js +2 -0
- package/lib/esm/__mocks__/react-i18next.d.ts +2 -0
- package/lib/esm/__mocks__/react-i18next.d.ts.map +1 -0
- package/lib/esm/__mocks__/react-i18next.js +17 -0
- package/lib/esm/assets/img/icon-arrow-back.png +0 -0
- package/lib/esm/assets/img/icon_folder_closed.png +0 -0
- package/lib/esm/assets/img/icon_folder_closed_light.png +0 -0
- package/lib/esm/assets/img/icon_folder_open.png +0 -0
- package/lib/esm/assets/img/icon_folder_open_light.png +0 -0
- package/lib/esm/assets/img/icon_help_light_24.png +0 -0
- package/lib/esm/assets/img/icon_variablenode.png +0 -0
- package/lib/esm/assets/img/icon_variablenode_light.png +0 -0
- package/lib/esm/assets/img/toastify_msg_error_24.png +0 -0
- package/lib/esm/assets/img/toastify_msg_success_24.png +0 -0
- package/lib/esm/assets/search-box.css +29 -0
- package/lib/esm/assets/style.css +219 -0
- package/lib/esm/assets/svg/icon_add.svg +3 -0
- package/lib/esm/assets/svg/icon_calendar.svg +50 -0
- package/lib/esm/assets/svg/icon_chevron_left.svg +6 -0
- package/lib/esm/assets/svg/icon_chevron_right.svg +6 -0
- package/lib/esm/assets/svg/icon_cross.svg +3 -0
- package/lib/esm/assets/svg/icon_download.svg +5 -0
- package/lib/esm/assets/svg/icon_duplicate.svg +10 -0
- package/lib/esm/assets/svg/icon_edit.svg +6 -0
- package/lib/esm/assets/svg/icon_folder_loading.svg +21 -0
- package/lib/esm/assets/svg/icon_fullscreen.svg +6 -0
- package/lib/esm/assets/svg/icon_gear.svg +5 -0
- package/lib/esm/assets/svg/icon_help_light.svg +3 -0
- package/lib/esm/assets/svg/icon_key.svg +3 -0
- package/lib/esm/assets/svg/icon_lupe.svg +14 -0
- package/lib/esm/assets/svg/icon_menu_horizontal.svg +5 -0
- package/lib/esm/assets/svg/icon_menu_vertical.svg +5 -0
- package/lib/esm/assets/svg/icon_reload.svg +6 -0
- package/lib/esm/assets/svg/icon_star.svg +4 -0
- package/lib/esm/assets/svg/icon_upload.svg +7 -0
- package/lib/esm/assets/svg/icon_warning_triangle.svg +12 -0
- package/lib/esm/assets/svg/triangle_down.svg +3 -0
- package/lib/esm/assets/svg/triangle_left.svg +3 -0
- package/lib/esm/assets/svg/triangle_right.svg +3 -0
- package/lib/esm/assets/svg/triangle_up.svg +3 -0
- package/lib/esm/assets/svg/triangle_up_and_down.svg +4 -0
- package/lib/esm/components/accordion/Accordion.d.ts +25 -0
- package/lib/esm/components/accordion/Accordion.d.ts.map +1 -0
- package/lib/esm/components/accordion/Accordion.js +34 -0
- package/lib/esm/components/accordionComponents/AccordionItem.d.ts +32 -0
- package/lib/esm/components/accordionComponents/AccordionItem.d.ts.map +1 -0
- package/lib/esm/components/accordionComponents/AccordionItem.js +24 -0
- package/lib/esm/components/bubble/Bubble.d.ts +35 -0
- package/lib/esm/components/bubble/Bubble.d.ts.map +1 -0
- package/lib/esm/components/bubble/Bubble.js +36 -0
- package/lib/esm/components/button/Button.d.ts +33 -0
- package/lib/esm/components/button/Button.d.ts.map +1 -0
- package/lib/esm/components/button/Button.js +17 -0
- package/lib/esm/components/button/ButtonRow.d.ts +23 -0
- package/lib/esm/components/button/ButtonRow.d.ts.map +1 -0
- package/lib/esm/components/button/ButtonRow.js +10 -0
- package/lib/esm/components/confirm/Confirm.d.ts +19 -0
- package/lib/esm/components/confirm/Confirm.d.ts.map +1 -0
- package/lib/esm/components/confirm/Confirm.js +20 -0
- package/lib/esm/components/confirm/ConfirmProvider.d.ts +14 -0
- package/lib/esm/components/confirm/ConfirmProvider.d.ts.map +1 -0
- package/lib/esm/components/confirm/ConfirmProvider.js +34 -0
- package/lib/esm/components/confirm/useConfirm.d.ts +9 -0
- package/lib/esm/components/confirm/useConfirm.d.ts.map +1 -0
- package/lib/esm/components/confirm/useConfirm.js +10 -0
- package/lib/esm/components/confirm/utils.d.ts +4 -0
- package/lib/esm/components/confirm/utils.d.ts.map +1 -0
- package/lib/esm/components/confirm/utils.js +7 -0
- package/lib/esm/components/confirm/withConfirm.d.ts +7 -0
- package/lib/esm/components/confirm/withConfirm.d.ts.map +1 -0
- package/lib/esm/components/confirm/withConfirm.js +37 -0
- package/lib/esm/components/icon/Icon.d.ts +24 -0
- package/lib/esm/components/icon/Icon.d.ts.map +1 -0
- package/lib/esm/components/icon/Icon.js +110 -0
- package/lib/esm/components/input/Checkbox.d.ts +29 -0
- package/lib/esm/components/input/Checkbox.d.ts.map +1 -0
- package/lib/esm/components/input/Checkbox.js +50 -0
- package/lib/esm/components/input/SearchBox.d.ts +21 -0
- package/lib/esm/components/input/SearchBox.d.ts.map +1 -0
- package/lib/esm/components/input/SearchBox.js +62 -0
- package/lib/esm/components/label/Label.d.ts +23 -0
- package/lib/esm/components/label/Label.d.ts.map +1 -0
- package/lib/esm/components/label/Label.js +18 -0
- package/lib/esm/components/modal/Modal.d.ts +29 -0
- package/lib/esm/components/modal/Modal.d.ts.map +1 -0
- package/lib/esm/components/modal/Modal.js +59 -0
- package/lib/esm/components/modalComponents/ModalContainer.d.ts +6 -0
- package/lib/esm/components/modalComponents/ModalContainer.d.ts.map +1 -0
- package/lib/esm/components/modalComponents/ModalContainer.js +6 -0
- package/lib/esm/components/modalComponents/ModalWindow.d.ts +4 -0
- package/lib/esm/components/modalComponents/ModalWindow.d.ts.map +1 -0
- package/lib/esm/components/modalComponents/ModalWindow.js +21 -0
- package/lib/esm/components/popup/Popup.d.ts +38 -0
- package/lib/esm/components/popup/Popup.d.ts.map +1 -0
- package/lib/esm/components/popup/Popup.js +49 -0
- package/lib/esm/components/popupComponents/PopupArea.d.ts +18 -0
- package/lib/esm/components/popupComponents/PopupArea.d.ts.map +1 -0
- package/lib/esm/components/popupComponents/PopupArea.js +17 -0
- package/lib/esm/components/spinner/Spinner.d.ts +20 -0
- package/lib/esm/components/spinner/Spinner.d.ts.map +1 -0
- package/lib/esm/components/spinner/Spinner.js +28 -0
- package/lib/esm/components/spinner/SpinnerContainer.d.ts +23 -0
- package/lib/esm/components/spinner/SpinnerContainer.d.ts.map +1 -0
- package/lib/esm/components/spinner/SpinnerContainer.js +18 -0
- package/lib/esm/components/tabs/Tabs.d.ts +34 -0
- package/lib/esm/components/tabs/Tabs.d.ts.map +1 -0
- package/lib/esm/components/tabs/Tabs.js +46 -0
- package/lib/esm/components/tooltip/Tooltip.d.ts +28 -0
- package/lib/esm/components/tooltip/Tooltip.d.ts.map +1 -0
- package/lib/esm/components/tooltip/Tooltip.js +33 -0
- package/lib/esm/hooks/useOutsideClick.d.ts +3 -0
- package/lib/esm/hooks/useOutsideClick.d.ts.map +1 -0
- package/lib/esm/hooks/useOutsideClick.js +40 -0
- package/lib/esm/index.d.ts +22 -0
- package/lib/esm/index.d.ts.map +1 -0
- package/lib/esm/index.js +21 -0
- package/lib/esm/types/i18n.d.ts +5 -0
- package/lib/esm/types/i18n.d.ts.map +1 -0
- package/lib/esm/types/i18n.js +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Modifier } from 'react-popper';
|
|
3
|
+
export declare type PopupDirection = 'auto-start' | 'auto' | 'auto-end' | 'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-end' | 'bottom' | 'bottom-start' | 'left-end' | 'left' | 'left-start';
|
|
4
|
+
export declare type Props = {
|
|
5
|
+
/** Element to toggle the Popup */
|
|
6
|
+
handler: React.ReactNode;
|
|
7
|
+
/** Content to be displayed */
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
/** If true, displays the Popup's content */
|
|
10
|
+
active: boolean;
|
|
11
|
+
/** Function, executed when the Popup gets closed */
|
|
12
|
+
onHide: (event: MouseEvent) => void;
|
|
13
|
+
ignoredElements?: HTMLElement[];
|
|
14
|
+
/** (Optional) if set, sets the direction in which the content should be displayed */
|
|
15
|
+
direction?: PopupDirection;
|
|
16
|
+
/** (Optional) function, executed if the handler gets clicked */
|
|
17
|
+
onHandlerClick?: (event: React.SyntheticEvent<HTMLSpanElement>) => any;
|
|
18
|
+
/** @ignore */
|
|
19
|
+
className?: string;
|
|
20
|
+
/** (Optional) https://popper.js.org/popper-documentation.html#modifiers..preventOverflow */
|
|
21
|
+
modifiers?: Modifier<any>[];
|
|
22
|
+
/** (Optional) If set to true, the content is hidden via styles, but still exists in the DOM tree */
|
|
23
|
+
preventDestroyContentOnHide?: boolean;
|
|
24
|
+
/** (Optional) Class name of the handler wrapping element */
|
|
25
|
+
handlerWrapperClassName?: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Popup displays content within a small modal.
|
|
29
|
+
* Its usage is highly flexible and used in several other components.
|
|
30
|
+
*/
|
|
31
|
+
export default class Popup extends React.Component<Props> {
|
|
32
|
+
container: HTMLDivElement | undefined;
|
|
33
|
+
referenceHandler: React.RefObject<HTMLSpanElement>;
|
|
34
|
+
componentDidMount(): void;
|
|
35
|
+
componentWillUnmount(): void;
|
|
36
|
+
render(): JSX.Element;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=Popup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Popup.d.ts","sourceRoot":"","sources":["../../../../src/components/popup/Popup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAU,QAAQ,EAAoB,MAAM,cAAc,CAAC;AAGlE,oBAAY,cAAc,GACvB,YAAY,GACZ,MAAM,GACN,UAAU,GACV,WAAW,GACX,KAAK,GACL,SAAS,GACT,aAAa,GACb,OAAO,GACP,WAAW,GACX,YAAY,GACZ,QAAQ,GACR,cAAc,GACd,UAAU,GACV,MAAM,GACN,YAAY,CAAC;AAEhB,oBAAY,KAAK,GAAG;IACnB,kCAAkC;IAClC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB,8BAA8B;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B,4CAA4C;IAC5C,MAAM,EAAE,OAAO,CAAC;IAEhB,oDAAoD;IACpD,MAAM,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAEpC,eAAe,CAAC,EAAE,WAAW,EAAE,CAAC;IAEhC,qFAAqF;IACrF,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B,gEAAgE;IAChE,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,KAAK,GAAG,CAAC;IAEvE,cAAc;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,4FAA4F;IAC5F,SAAS,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;IAE5B,oGAAoG;IACpG,2BAA2B,CAAC,EAAE,OAAO,CAAC;IAEtC,4DAA4D;IAC5D,uBAAuB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC;IACxD,SAAS,EAAE,cAAc,GAAG,SAAS,CAAC;IACtC,gBAAgB,mCAAsC;IAEtD,iBAAiB;IASjB,oBAAoB;IAMpB,MAAM;CAwEN"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const React = __importStar(require("react"));
|
|
30
|
+
const react_dom_1 = __importDefault(require("react-dom"));
|
|
31
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
32
|
+
const react_popper_1 = require("react-popper");
|
|
33
|
+
const PopupArea_1 = __importDefault(require("../popupComponents/PopupArea"));
|
|
34
|
+
/**
|
|
35
|
+
* Popup displays content within a small modal.
|
|
36
|
+
* Its usage is highly flexible and used in several other components.
|
|
37
|
+
*/
|
|
38
|
+
class Popup extends React.Component {
|
|
39
|
+
constructor() {
|
|
40
|
+
super(...arguments);
|
|
41
|
+
this.referenceHandler = React.createRef();
|
|
42
|
+
}
|
|
43
|
+
componentDidMount() {
|
|
44
|
+
const container = document.createElement('div');
|
|
45
|
+
if (document.body) {
|
|
46
|
+
document.body.appendChild(container);
|
|
47
|
+
this.container = container;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
componentWillUnmount() {
|
|
51
|
+
if (document.body && this.container) {
|
|
52
|
+
document.body.removeChild(this.container);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
render() {
|
|
56
|
+
const { handler, children, active, onHide, direction, className, onHandlerClick, modifiers, preventDestroyContentOnHide, handlerWrapperClassName, ...otherProps } = this.props;
|
|
57
|
+
const placement = direction ? direction : 'bottom';
|
|
58
|
+
return (React.createElement(react_popper_1.Manager, null,
|
|
59
|
+
React.createElement(react_popper_1.Reference, null, ({ ref }) => (React.createElement("span", { ref: ref, style: {
|
|
60
|
+
display: 'inline-block'
|
|
61
|
+
}, className: handlerWrapperClassName },
|
|
62
|
+
React.createElement("span", { ref: this.referenceHandler, style: {
|
|
63
|
+
display: 'inline-block',
|
|
64
|
+
verticalAlign: 'bottom'
|
|
65
|
+
}, onClick: onHandlerClick, className: handlerWrapperClassName }, handler)))),
|
|
66
|
+
(active || preventDestroyContentOnHide) &&
|
|
67
|
+
this.container &&
|
|
68
|
+
react_dom_1.default.createPortal(React.createElement(react_popper_1.Popper, { ...otherProps, placement: placement, modifiers: modifiers }, ({ ref, style, placement, arrowProps }) => {
|
|
69
|
+
return (React.createElement("span", { className: (0, classnames_1.default)('di popup-wrapper', {
|
|
70
|
+
hidden: preventDestroyContentOnHide && !active
|
|
71
|
+
}) },
|
|
72
|
+
React.createElement(PopupArea_1.default, { ...(this.props.ignoredElements
|
|
73
|
+
? { ignoredElements: this.props.ignoredElements }
|
|
74
|
+
: {}), referenceHandler: this.referenceHandler.current, popupAreaHandler: ref, placement: placement, style: style, onHide: onHide, visible: active, arrowProps: arrowProps, className: className }, children)));
|
|
75
|
+
}), this.container)));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.default = Popup;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PropsWithChildren, ReactNode, Ref } from 'react';
|
|
2
|
+
import { PopperArrowProps } from 'react-popper';
|
|
3
|
+
import { PopupDirection } from '../popup/Popup';
|
|
4
|
+
declare type Props = {
|
|
5
|
+
referenceHandler: HTMLElement | null;
|
|
6
|
+
popupAreaHandler: Ref<any>;
|
|
7
|
+
ignoredElements?: HTMLElement[];
|
|
8
|
+
style: Record<string, any>;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
placement: PopupDirection;
|
|
11
|
+
onHide: (event: MouseEvent) => void;
|
|
12
|
+
visible: boolean;
|
|
13
|
+
arrowProps: PopperArrowProps;
|
|
14
|
+
className?: string;
|
|
15
|
+
};
|
|
16
|
+
export default function PopupArea({ popupAreaHandler, ignoredElements, style, placement, className, arrowProps, children, visible, onHide }: PropsWithChildren<Props>): JSX.Element;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=PopupArea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PopupArea.d.ts","sourceRoot":"","sources":["../../../../src/components/popupComponents/PopupArea.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAC,iBAAiB,EAAE,SAAS,EAAE,GAAG,EAAW,MAAM,OAAO,CAAC;AACzE,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAG9C,aAAK,KAAK,GAAG;IACZ,gBAAgB,EAAE,WAAW,GAAG,IAAI,CAAC;IACrC,gBAAgB,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IAC3B,eAAe,CAAC,EAAE,WAAW,EAAE,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,EAAE,cAAc,CAAC;IAC1B,MAAM,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EACjC,gBAAgB,EAChB,eAAoB,EACpB,KAAK,EACL,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EACR,OAAO,EACP,MAAM,EACN,EAAE,iBAAiB,CAAC,KAAK,CAAC,eAqB1B"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const useOutsideClick_1 = __importDefault(require("../../hooks/useOutsideClick"));
|
|
31
|
+
function PopupArea({ popupAreaHandler, ignoredElements = [], style, placement, className, arrowProps, children, visible, onHide }) {
|
|
32
|
+
const [rootElement, setRootElement] = (0, react_1.useState)(null);
|
|
33
|
+
(0, useOutsideClick_1.default)([rootElement, ...ignoredElements], (event) => {
|
|
34
|
+
if (visible) {
|
|
35
|
+
onHide(event);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
return (react_1.default.createElement("div", { ref: (div) => {
|
|
39
|
+
setRootElement(div);
|
|
40
|
+
if (typeof popupAreaHandler === 'function')
|
|
41
|
+
popupAreaHandler(div);
|
|
42
|
+
}, style: style, className: `di popup ${placement} ${className ? className : ''}` },
|
|
43
|
+
react_1.default.createElement("div", { className: `popup-arrow ${placement}`, ref: arrowProps.ref, style: arrowProps.style }),
|
|
44
|
+
react_1.default.createElement("div", { className: "popup-content" }, children)));
|
|
45
|
+
}
|
|
46
|
+
exports.default = PopupArea;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare type Props = {
|
|
3
|
+
/** the size of the Spinner in px */
|
|
4
|
+
size?: number;
|
|
5
|
+
/** @ignore */
|
|
6
|
+
center?: boolean;
|
|
7
|
+
/** @ignore */
|
|
8
|
+
'data-testid'?: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Spinners usually show a loading indication.
|
|
12
|
+
*/
|
|
13
|
+
export default class Spinner extends React.Component<Props> {
|
|
14
|
+
static defaultProps: {
|
|
15
|
+
size: number;
|
|
16
|
+
center: boolean;
|
|
17
|
+
};
|
|
18
|
+
render(): JSX.Element;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=Spinner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../../../src/components/spinner/Spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,oBAAY,KAAK,GAAG;IACnB,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,cAAc;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,cAAc;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC;IAC1D,MAAM,CAAC,YAAY;;;MAGjB;IAEF,MAAM;CAoBN"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
/**
|
|
8
|
+
* Spinners usually show a loading indication.
|
|
9
|
+
*/
|
|
10
|
+
class Spinner extends react_1.default.Component {
|
|
11
|
+
render() {
|
|
12
|
+
const { size = 56, center, ...dataAttrs } = this.props;
|
|
13
|
+
let style = {
|
|
14
|
+
width: size,
|
|
15
|
+
height: size
|
|
16
|
+
};
|
|
17
|
+
if (center) {
|
|
18
|
+
style = {
|
|
19
|
+
...style,
|
|
20
|
+
position: 'absolute',
|
|
21
|
+
top: '50%',
|
|
22
|
+
left: '50%',
|
|
23
|
+
marginTop: -size / 2,
|
|
24
|
+
marginLeft: -size / 2
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
return react_1.default.createElement("div", { className: "di spinner", style: style, ...dataAttrs });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.default = Spinner;
|
|
31
|
+
Spinner.defaultProps = {
|
|
32
|
+
size: 56,
|
|
33
|
+
center: false
|
|
34
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare type Props = {
|
|
3
|
+
/** controls the display of the Spinner */
|
|
4
|
+
show: boolean;
|
|
5
|
+
/** the size of the Spinner in px */
|
|
6
|
+
size?: number;
|
|
7
|
+
/** content to be rendered once the loading is done */
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
/** @ignore */
|
|
10
|
+
className?: string;
|
|
11
|
+
/** @ignore */
|
|
12
|
+
'data-testid'?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* SpinnerContainer wraps the entire content and displays a loading indicator until the loading is done.
|
|
16
|
+
*/
|
|
17
|
+
export default class SpinnerContainer extends React.Component<Props> {
|
|
18
|
+
static defaultProps: {
|
|
19
|
+
size: number;
|
|
20
|
+
};
|
|
21
|
+
render(): JSX.Element;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=SpinnerContainer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpinnerContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/spinner/SpinnerContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,oBAAY,KAAK,GAAG;IACnB,0CAA0C;IAC1C,IAAI,EAAE,OAAO,CAAC;IAEd,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,sDAAsD;IACtD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,cAAc;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,cAAc;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC;IACnE,MAAM,CAAC,YAAY,EAAE;QACpB,IAAI,EAAE,MAAM,CAAC;KACb,CAEC;IAEF,MAAM;CAcN"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const Spinner_1 = __importDefault(require("./Spinner"));
|
|
8
|
+
/**
|
|
9
|
+
* SpinnerContainer wraps the entire content and displays a loading indicator until the loading is done.
|
|
10
|
+
*/
|
|
11
|
+
class SpinnerContainer extends react_1.default.Component {
|
|
12
|
+
render() {
|
|
13
|
+
const { show, size, children, className } = this.props;
|
|
14
|
+
const classNames = `di spinner-wrapper ${className ? className : ''}`;
|
|
15
|
+
return (react_1.default.createElement("div", { className: classNames },
|
|
16
|
+
react_1.default.createElement("div", { className: `di spinner-container ${show ? 'visible' : ''}`, "data-testid": this.props['data-testid'] },
|
|
17
|
+
react_1.default.createElement(Spinner_1.default, { size: size, center: true })),
|
|
18
|
+
children));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.default = SpinnerContainer;
|
|
22
|
+
SpinnerContainer.defaultProps = {
|
|
23
|
+
size: 56
|
|
24
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare type Page = {
|
|
3
|
+
name: string;
|
|
4
|
+
renderHeading: () => React.ReactNode;
|
|
5
|
+
renderBody?: () => React.ReactNode;
|
|
6
|
+
tabDescription?: string;
|
|
7
|
+
};
|
|
8
|
+
declare type State = {
|
|
9
|
+
currentTab: string | null | undefined;
|
|
10
|
+
};
|
|
11
|
+
export declare type Props = {
|
|
12
|
+
/** Array of pages to be displayed */
|
|
13
|
+
pages: Array<Page>;
|
|
14
|
+
/** (Optional) if set, disables tab */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** (Optional) function, executed if tabs change */
|
|
17
|
+
onChange?: (tab: string) => void;
|
|
18
|
+
/** (Optional) sets the current tab */
|
|
19
|
+
currentTab?: string | null | undefined;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Tabs add the possibility to unite several homogeneous pages into one.
|
|
23
|
+
* Unlike RouteTabs, Tabs cannot be accessed directly via the browser's history
|
|
24
|
+
*/
|
|
25
|
+
export default class Tabs extends React.Component<Props, State> {
|
|
26
|
+
state: State;
|
|
27
|
+
handleClick: (tab: string) => void;
|
|
28
|
+
currentTabPage: () => Page | null | undefined;
|
|
29
|
+
isCurrentTab: (tab: string) => boolean;
|
|
30
|
+
renderBody: () => React.ReactNode;
|
|
31
|
+
render(): JSX.Element;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=Tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../../src/components/tabs/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,aAAK,IAAI,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IACrC,UAAU,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,aAAK,KAAK,GAAG;IACZ,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,oBAAY,KAAK,GAAG;IACnB,qCAAqC;IACrC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAEnB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAEjC,sCAAsC;IACtC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACvC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IAC9D,KAAK,EAAE,KAAK,CAEV;IAEF,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAQhC;IAEF,cAAc,EAAE,MAAM,IAAI,GAAG,IAAI,GAAG,SAAS,CAG3C;IAEF,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAGpC;IAEF,UAAU,wBAQR;IAEF,MAAM;CAkCN"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const React = __importStar(require("react"));
|
|
30
|
+
const Bubble_1 = __importDefault(require("../bubble/Bubble"));
|
|
31
|
+
/**
|
|
32
|
+
* Tabs add the possibility to unite several homogeneous pages into one.
|
|
33
|
+
* Unlike RouteTabs, Tabs cannot be accessed directly via the browser's history
|
|
34
|
+
*/
|
|
35
|
+
class Tabs extends React.Component {
|
|
36
|
+
constructor() {
|
|
37
|
+
super(...arguments);
|
|
38
|
+
this.state = {
|
|
39
|
+
currentTab: this.props.pages.length ? this.props.pages[0].name : null
|
|
40
|
+
};
|
|
41
|
+
this.handleClick = (tab) => {
|
|
42
|
+
if (this.props.onChange) {
|
|
43
|
+
this.props.onChange(tab);
|
|
44
|
+
}
|
|
45
|
+
else if (typeof this.props.currentTab === 'undefined') {
|
|
46
|
+
this.setState({
|
|
47
|
+
currentTab: tab
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
this.currentTabPage = () => {
|
|
52
|
+
const currentTab = typeof this.props.currentTab === 'string' ? this.props.currentTab : this.state.currentTab;
|
|
53
|
+
return this.props.pages.find(({ name }) => currentTab === name);
|
|
54
|
+
};
|
|
55
|
+
this.isCurrentTab = (tab) => {
|
|
56
|
+
const currentTab = typeof this.props.currentTab === 'string' ? this.props.currentTab : this.state.currentTab;
|
|
57
|
+
return currentTab === tab;
|
|
58
|
+
};
|
|
59
|
+
this.renderBody = () => {
|
|
60
|
+
const page = this.currentTabPage();
|
|
61
|
+
if (page && typeof page.renderBody === 'function') {
|
|
62
|
+
return page.renderBody();
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
render() {
|
|
68
|
+
const { pages, disabled } = this.props;
|
|
69
|
+
return (React.createElement("div", null,
|
|
70
|
+
React.createElement("div", { className: "di tabs" }, pages.map(({ name, renderHeading, tabDescription }) => tabDescription ? (React.createElement(Bubble_1.default, { inverted: true, key: name, content: tabDescription, className: "bubble-tab-description" },
|
|
71
|
+
React.createElement("button", { "data-testid": "tab-button", className: `item ${disabled ? 'disabled' : ''} ${this.isCurrentTab(name) ? 'active' : ''}`, onClick: () => !disabled && this.handleClick(name) }, renderHeading()))) : (React.createElement("button", { "data-testid": "tab-button", key: name, className: `item ${disabled ? 'disabled' : ''} ${this.isCurrentTab(name) ? 'active' : ''}`, onClick: () => !disabled && this.handleClick(name) }, renderHeading())))),
|
|
72
|
+
this.renderBody()));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.default = Tabs;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PopupDirection } from '../popup/Popup';
|
|
3
|
+
export declare type Props = {
|
|
4
|
+
/** Content of the Tooltip */
|
|
5
|
+
content: React.ReactNode;
|
|
6
|
+
/** Enabler of the Tooltip */
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/** @ignore */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** (Optional) if set, disables the <Tooltip/> from opening */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** (Optional) if set, opens <Tooltip/> in given direction, defaults to 'right' */
|
|
13
|
+
direction?: PopupDirection;
|
|
14
|
+
};
|
|
15
|
+
declare type State = {
|
|
16
|
+
active: boolean;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Tooltip is best used to display some short additional information or description
|
|
20
|
+
*/
|
|
21
|
+
export default class Tooltip extends React.Component<Props, State> {
|
|
22
|
+
state: State;
|
|
23
|
+
handleMouseEnter: () => void;
|
|
24
|
+
handleMouseLeave: () => void;
|
|
25
|
+
render(): JSX.Element;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=Tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/tooltip/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAc,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAErD,oBAAY,KAAK,GAAG;IACnB,6BAA6B;IAC7B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB,6BAA6B;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B,cAAc;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,wFAAwF;IACxF,SAAS,CAAC,EAAE,cAAc,CAAC;CAC3B,CAAC;AAEF,aAAK,KAAK,GAAG;IACZ,MAAM,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IACjE,KAAK,EAAE,KAAK,CAEV;IAEF,gBAAgB,EAAE,MAAM,IAAI,CAQ1B;IAEF,gBAAgB,EAAE,MAAM,IAAI,CAI1B;IAEF,MAAM;CAmBN"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const Popup_1 = __importDefault(require("../popup/Popup"));
|
|
8
|
+
/**
|
|
9
|
+
* Tooltip is best used to display some short additional information or description
|
|
10
|
+
*/
|
|
11
|
+
class Tooltip extends react_1.default.Component {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.state = {
|
|
15
|
+
active: false
|
|
16
|
+
};
|
|
17
|
+
this.handleMouseEnter = () => {
|
|
18
|
+
const { disabled } = this.props;
|
|
19
|
+
if (!disabled) {
|
|
20
|
+
this.setState({
|
|
21
|
+
active: true
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
this.handleMouseLeave = () => {
|
|
26
|
+
this.setState({
|
|
27
|
+
active: false
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
const { content, children, className, direction, ...otherProps } = this.props;
|
|
33
|
+
const { active } = this.state;
|
|
34
|
+
return (react_1.default.createElement("span", { onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave },
|
|
35
|
+
react_1.default.createElement(Popup_1.default, { ...otherProps, active: active, onHide: () => { }, handler: children, direction: direction ? direction : 'right', onHandlerClick: () => { }, className: `tooltip inverted ${className ? className : ''}` },
|
|
36
|
+
react_1.default.createElement("span", { className: "tooltip-content" }, content))));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.default = Tooltip;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOutsideClick.d.ts","sourceRoot":"","sources":["../../../src/hooks/useOutsideClick.ts"],"names":[],"mappings":"AAqBA,QAAA,MAAM,eAAe,aACV,MAAM,WAAW,GAAG,IAAI,CAAC,kBACnB,UAAU,GAAG,UAAU,GAAG,SAAS,KAAK,IAAI,SA6B5D,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
const isTouchEvent = (event) => {
|
|
5
|
+
return !!event.touches;
|
|
6
|
+
};
|
|
7
|
+
const isInsideBoundingRect = (element, event) => {
|
|
8
|
+
const rect = element.getBoundingClientRect();
|
|
9
|
+
let x, y;
|
|
10
|
+
if (isTouchEvent(event)) {
|
|
11
|
+
x = event.touches[0].pageX;
|
|
12
|
+
y = event.touches[0].pageY;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
x = event.pageX;
|
|
16
|
+
y = event.pageY;
|
|
17
|
+
}
|
|
18
|
+
return rect.left <= x && rect.right >= x && rect.top <= y && rect.bottom >= y;
|
|
19
|
+
};
|
|
20
|
+
const useOutsideClick = (elements, callback) => {
|
|
21
|
+
const callbackRef = (0, react_1.useRef)(callback);
|
|
22
|
+
(0, react_1.useEffect)(() => {
|
|
23
|
+
callbackRef.current = callback;
|
|
24
|
+
}, [callback]);
|
|
25
|
+
(0, react_1.useEffect)(() => {
|
|
26
|
+
const listener = (event) => {
|
|
27
|
+
const elementsNonNull = elements.filter((element) => element != null);
|
|
28
|
+
if (elementsNonNull.every((element) => element !== event.target &&
|
|
29
|
+
!element.contains(event.target) &&
|
|
30
|
+
!isInsideBoundingRect(element, event))) {
|
|
31
|
+
callbackRef.current(event);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
document.addEventListener('mousedown', listener, true);
|
|
35
|
+
document.addEventListener('touchstart', listener, true);
|
|
36
|
+
return () => {
|
|
37
|
+
document.removeEventListener('mousedown', listener, true);
|
|
38
|
+
document.removeEventListener('touchstart', listener, true);
|
|
39
|
+
};
|
|
40
|
+
}, [elements]);
|
|
41
|
+
};
|
|
42
|
+
exports.default = useOutsideClick;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import './assets/style.css';
|
|
2
|
+
export { default as Accordion } from './components/accordion/Accordion';
|
|
3
|
+
export { default as AccordionItem } from './components/accordionComponents/AccordionItem';
|
|
4
|
+
export { default as Button } from './components/button/Button';
|
|
5
|
+
export { default as ButtonRow } from './components/button/ButtonRow';
|
|
6
|
+
export { default as Modal } from './components/modal/Modal';
|
|
7
|
+
export { default as ModalContainer } from './components/modalComponents/ModalContainer';
|
|
8
|
+
export { default as Spinner } from './components/spinner/Spinner';
|
|
9
|
+
export { default as SpinnerContainer } from './components/spinner/SpinnerContainer';
|
|
10
|
+
export { default as Checkbox } from './components/input/Checkbox';
|
|
11
|
+
export { default as ConfirmProvider } from './components/confirm/ConfirmProvider';
|
|
12
|
+
export { default as withConfirm } from './components/confirm/withConfirm';
|
|
13
|
+
export { default as useConfirm } from './components/confirm/useConfirm';
|
|
14
|
+
export { default as Icon } from './components/icon/Icon';
|
|
15
|
+
export { default as Label } from './components/label/Label';
|
|
16
|
+
export { default as Bubble } from './components/bubble/Bubble';
|
|
17
|
+
export { default as Tooltip } from './components/tooltip/Tooltip';
|
|
18
|
+
export { default as Tabs } from './components/tabs/Tabs';
|
|
19
|
+
export { default as SearchBox } from './components/input/SearchBox';
|
|
20
|
+
export { default as Popup } from './components/popup/Popup';
|
|
21
|
+
export type { ConfirmProps } from './components/confirm/withConfirm';
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,gDAAgD,CAAC;AACxF,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAC,OAAO,IAAI,KAAK,EAAC,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAC,OAAO,IAAI,OAAO,EAAC,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAC,OAAO,IAAI,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAC,OAAO,IAAI,IAAI,EAAC,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAC,OAAO,IAAI,KAAK,EAAC,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAC,OAAO,IAAI,OAAO,EAAC,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAC,OAAO,IAAI,IAAI,EAAC,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAC,OAAO,IAAI,KAAK,EAAC,MAAM,0BAA0B,CAAC;AAG1D,YAAY,EAAC,YAAY,EAAC,MAAM,kCAAkC,CAAC"}
|
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Popup = exports.SearchBox = exports.Tabs = exports.Tooltip = exports.Bubble = exports.Label = exports.Icon = exports.useConfirm = exports.withConfirm = exports.ConfirmProvider = exports.Checkbox = exports.SpinnerContainer = exports.Spinner = exports.ModalContainer = exports.Modal = exports.ButtonRow = exports.Button = exports.AccordionItem = exports.Accordion = void 0;
|
|
7
|
+
require("./assets/style.css");
|
|
8
|
+
// Components
|
|
9
|
+
var Accordion_1 = require("./components/accordion/Accordion");
|
|
10
|
+
Object.defineProperty(exports, "Accordion", { enumerable: true, get: function () { return __importDefault(Accordion_1).default; } });
|
|
11
|
+
var AccordionItem_1 = require("./components/accordionComponents/AccordionItem");
|
|
12
|
+
Object.defineProperty(exports, "AccordionItem", { enumerable: true, get: function () { return __importDefault(AccordionItem_1).default; } });
|
|
13
|
+
var Button_1 = require("./components/button/Button");
|
|
14
|
+
Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return __importDefault(Button_1).default; } });
|
|
15
|
+
var ButtonRow_1 = require("./components/button/ButtonRow");
|
|
16
|
+
Object.defineProperty(exports, "ButtonRow", { enumerable: true, get: function () { return __importDefault(ButtonRow_1).default; } });
|
|
17
|
+
var Modal_1 = require("./components/modal/Modal");
|
|
18
|
+
Object.defineProperty(exports, "Modal", { enumerable: true, get: function () { return __importDefault(Modal_1).default; } });
|
|
19
|
+
var ModalContainer_1 = require("./components/modalComponents/ModalContainer");
|
|
20
|
+
Object.defineProperty(exports, "ModalContainer", { enumerable: true, get: function () { return __importDefault(ModalContainer_1).default; } });
|
|
21
|
+
var Spinner_1 = require("./components/spinner/Spinner");
|
|
22
|
+
Object.defineProperty(exports, "Spinner", { enumerable: true, get: function () { return __importDefault(Spinner_1).default; } });
|
|
23
|
+
var SpinnerContainer_1 = require("./components/spinner/SpinnerContainer");
|
|
24
|
+
Object.defineProperty(exports, "SpinnerContainer", { enumerable: true, get: function () { return __importDefault(SpinnerContainer_1).default; } });
|
|
25
|
+
var Checkbox_1 = require("./components/input/Checkbox");
|
|
26
|
+
Object.defineProperty(exports, "Checkbox", { enumerable: true, get: function () { return __importDefault(Checkbox_1).default; } });
|
|
27
|
+
var ConfirmProvider_1 = require("./components/confirm/ConfirmProvider");
|
|
28
|
+
Object.defineProperty(exports, "ConfirmProvider", { enumerable: true, get: function () { return __importDefault(ConfirmProvider_1).default; } });
|
|
29
|
+
var withConfirm_1 = require("./components/confirm/withConfirm");
|
|
30
|
+
Object.defineProperty(exports, "withConfirm", { enumerable: true, get: function () { return __importDefault(withConfirm_1).default; } });
|
|
31
|
+
var useConfirm_1 = require("./components/confirm/useConfirm");
|
|
32
|
+
Object.defineProperty(exports, "useConfirm", { enumerable: true, get: function () { return __importDefault(useConfirm_1).default; } });
|
|
33
|
+
var Icon_1 = require("./components/icon/Icon");
|
|
34
|
+
Object.defineProperty(exports, "Icon", { enumerable: true, get: function () { return __importDefault(Icon_1).default; } });
|
|
35
|
+
var Label_1 = require("./components/label/Label");
|
|
36
|
+
Object.defineProperty(exports, "Label", { enumerable: true, get: function () { return __importDefault(Label_1).default; } });
|
|
37
|
+
var Bubble_1 = require("./components/bubble/Bubble");
|
|
38
|
+
Object.defineProperty(exports, "Bubble", { enumerable: true, get: function () { return __importDefault(Bubble_1).default; } });
|
|
39
|
+
var Tooltip_1 = require("./components/tooltip/Tooltip");
|
|
40
|
+
Object.defineProperty(exports, "Tooltip", { enumerable: true, get: function () { return __importDefault(Tooltip_1).default; } });
|
|
41
|
+
var Tabs_1 = require("./components/tabs/Tabs");
|
|
42
|
+
Object.defineProperty(exports, "Tabs", { enumerable: true, get: function () { return __importDefault(Tabs_1).default; } });
|
|
43
|
+
var SearchBox_1 = require("./components/input/SearchBox");
|
|
44
|
+
Object.defineProperty(exports, "SearchBox", { enumerable: true, get: function () { return __importDefault(SearchBox_1).default; } });
|
|
45
|
+
var Popup_1 = require("./components/popup/Popup");
|
|
46
|
+
Object.defineProperty(exports, "Popup", { enumerable: true, get: function () { return __importDefault(Popup_1).default; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../src/types/i18n.ts"],"names":[],"mappings":"AAAA,oBAAY,qBAAqB,GAAG;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;CACrB,CAAC"}
|