@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,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare type Info = {
|
|
3
|
+
text: string;
|
|
4
|
+
cssStyle: Record<string, any>;
|
|
5
|
+
};
|
|
6
|
+
export declare type Props = {
|
|
7
|
+
/** (Optional) Displays either numeric- or text-based badge in front of the <AccordionItems/> */
|
|
8
|
+
badge?: (number | string | React.ReactNode) | null | undefined;
|
|
9
|
+
/** @ignore */
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
/** (Optional) Displays additional information, which is visible in "closed" state */
|
|
12
|
+
info1?: Info;
|
|
13
|
+
/** If true, expands <AccordionItems/> */
|
|
14
|
+
isOpen?: boolean;
|
|
15
|
+
/** (Optional) Sets additional classes for styling purposes */
|
|
16
|
+
itemClasses?: string;
|
|
17
|
+
/** Title of <AccordionItems/> */
|
|
18
|
+
title: string | React.ReactNode;
|
|
19
|
+
/** (Optional) Tooltip of <AccordionItems/> */
|
|
20
|
+
titleTooltip?: string;
|
|
21
|
+
/** Function which is called to open/close <AccordionItems/> */
|
|
22
|
+
toggle?: () => void;
|
|
23
|
+
/** (Optional) Enables additional handler, e.g., for editing or deleting <AccordionItems/> */
|
|
24
|
+
tools?: Array<React.ReactNode>;
|
|
25
|
+
/** @ignore */
|
|
26
|
+
'data-testid'?: string | undefined;
|
|
27
|
+
};
|
|
28
|
+
export default class AccordionItem extends React.PureComponent<Props> {
|
|
29
|
+
render(): JSX.Element;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=AccordionItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionItem.d.ts","sourceRoot":"","sources":["../../../../src/components/accordionComponents/AccordionItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,aAAK,IAAI,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B,CAAC;AAEF,oBAAY,KAAK,GAAG;IACnB,sGAAsG;IACtG,KAAK,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IAE/D,cAAc;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,qFAAqF;IACrF,KAAK,CAAC,EAAE,IAAI,CAAC;IAEb,+CAA+C;IAC/C,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,uCAAuC;IACvC,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAEhC,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAEpB,mGAAmG;IACnG,KAAK,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAE/B,cAAc;IACd,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC;IACpE,MAAM;CAsCN"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export default class AccordionItem extends React.PureComponent {
|
|
3
|
+
render() {
|
|
4
|
+
const { badge, children, isOpen, info1, itemClasses, title, titleTooltip, toggle, tools, ...rest } = this.props;
|
|
5
|
+
const accordionItemClasses = ['item'];
|
|
6
|
+
if (itemClasses)
|
|
7
|
+
accordionItemClasses.push(itemClasses);
|
|
8
|
+
if (isOpen)
|
|
9
|
+
accordionItemClasses.push('open');
|
|
10
|
+
return (React.createElement("div", { className: accordionItemClasses.join(' ') },
|
|
11
|
+
React.createElement("div", { className: "head" },
|
|
12
|
+
React.createElement("span", { className: "title", onClick: toggle, "data-testid": rest['data-testid'] },
|
|
13
|
+
React.createElement("h1", { title: titleTooltip }, title),
|
|
14
|
+
badge && (React.createElement("span", { className: "di label", style: {
|
|
15
|
+
margin: '0 0 0 10px',
|
|
16
|
+
backgroundColor: '#ddd',
|
|
17
|
+
borderColor: 'transparent'
|
|
18
|
+
} }, badge)),
|
|
19
|
+
info1 && React.createElement("span", { style: info1.cssStyle }, info1.text)),
|
|
20
|
+
React.createElement("span", { className: "tools" }, tools &&
|
|
21
|
+
tools.map((toolComponent, index) => (React.createElement("span", { key: index, className: "tool" }, toolComponent))))),
|
|
22
|
+
React.createElement("div", { className: "cont" }, children)));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PopupDirection } from '../popup/Popup';
|
|
3
|
+
export declare type Props = {
|
|
4
|
+
/** the Bubble content */
|
|
5
|
+
content: React.ReactNode;
|
|
6
|
+
/** inverts the colors */
|
|
7
|
+
inverted?: boolean;
|
|
8
|
+
/** @ignore */
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
/** @ignore */
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
/** @ignore */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** hides the bubble */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** changed the direction */
|
|
17
|
+
direction?: PopupDirection;
|
|
18
|
+
};
|
|
19
|
+
declare type State = {
|
|
20
|
+
active: boolean;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Bubbles are best used to provide some additional information like short instructions or help texts, which are then going to be displayed on Mouse-Over.
|
|
24
|
+
*/
|
|
25
|
+
export default class Bubble extends React.Component<Props, State> {
|
|
26
|
+
static defaultProps: {
|
|
27
|
+
inverted: boolean;
|
|
28
|
+
};
|
|
29
|
+
state: State;
|
|
30
|
+
handleMouseEnter: () => void;
|
|
31
|
+
handleMouseLeave: () => void;
|
|
32
|
+
render(): JSX.Element;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=Bubble.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Bubble.d.ts","sourceRoot":"","sources":["../../../../src/components/bubble/Bubble.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAc,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAErD,oBAAY,KAAK,GAAG;IACnB,yBAAyB;IACzB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,cAAc;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B,cAAc;IACd,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAE5B,cAAc;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,uBAAuB;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,4BAA4B;IAC5B,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,MAAO,SAAQ,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IAChE,MAAM,CAAC,YAAY,EAAE;QACpB,QAAQ,EAAE,OAAO,CAAC;KAClB,CAEC;IAEF,KAAK,EAAE,KAAK,CAEV;IAEF,gBAAgB,aAQd;IAEF,gBAAgB,aAId;IAEF,MAAM;CAmBN"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Popup from '../popup/Popup';
|
|
3
|
+
/**
|
|
4
|
+
* Bubbles are best used to provide some additional information like short instructions or help texts, which are then going to be displayed on Mouse-Over.
|
|
5
|
+
*/
|
|
6
|
+
export default class Bubble extends React.Component {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.state = {
|
|
10
|
+
active: false
|
|
11
|
+
};
|
|
12
|
+
this.handleMouseEnter = () => {
|
|
13
|
+
const { disabled } = this.props;
|
|
14
|
+
if (!disabled) {
|
|
15
|
+
this.setState({
|
|
16
|
+
active: true
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
this.handleMouseLeave = () => {
|
|
21
|
+
this.setState({
|
|
22
|
+
active: false
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
const { content, inverted, children, style, direction, className } = this.props;
|
|
28
|
+
const { active } = this.state;
|
|
29
|
+
return (React.createElement("span", { onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave },
|
|
30
|
+
React.createElement(Popup, { active: active, onHide: () => { }, handler: children, direction: direction ? direction : 'top', onHandlerClick: () => { }, className: `bubble ${inverted ? 'inverted' : ''} ${className ? className : ''}` },
|
|
31
|
+
React.createElement("span", { className: `bubble-content`, style: style }, content))));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
Bubble.defaultProps = {
|
|
35
|
+
inverted: false
|
|
36
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TranslationDescriptor } from '../../types/i18n';
|
|
3
|
+
export declare type Props = {
|
|
4
|
+
/** primary style, mutually exclusive with _danger_ and _naked_ */
|
|
5
|
+
primary?: boolean;
|
|
6
|
+
/** danger style, mutually exclusive with _primary_ and _naked_ */
|
|
7
|
+
danger?: boolean;
|
|
8
|
+
/** render the button without border and background color, mutually exclusive with _primary_ and _danger_ */
|
|
9
|
+
naked?: boolean;
|
|
10
|
+
/** a title tooltip */
|
|
11
|
+
title?: (TranslationDescriptor | null | undefined) | string;
|
|
12
|
+
/** button | submit | reset */
|
|
13
|
+
type?: 'button' | 'submit' | 'reset';
|
|
14
|
+
/** a click handler */
|
|
15
|
+
onClick?: (...args: Array<any>) => any;
|
|
16
|
+
/** a smaller button */
|
|
17
|
+
small?: boolean;
|
|
18
|
+
/** disable the button */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** @ignore */
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
/** @ignore */
|
|
23
|
+
className?: string;
|
|
24
|
+
/** @ignore */
|
|
25
|
+
style?: React.CSSProperties;
|
|
26
|
+
/** @ignore */
|
|
27
|
+
'data-testid'?: string;
|
|
28
|
+
/** @ignore */
|
|
29
|
+
tabIndex?: number;
|
|
30
|
+
};
|
|
31
|
+
declare const _default: React.ComponentType<Props>;
|
|
32
|
+
export default _default;
|
|
33
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAC,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AAEvD,oBAAY,KAAK,GAAG;IACnB,kEAAkE;IAClE,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,kEAAkE;IAClE,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,4GAA4G;IAC5G,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,sBAAsB;IACtB,KAAK,CAAC,EAAE,CAAC,qBAAqB,GAAG,IAAI,GAAG,SAAS,CAAC,GAAG,MAAM,CAAC;IAE5D,8BAA8B;IAC9B,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IAErC,sBAAsB;IACtB,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC;IAEvC,uBAAuB;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,cAAc;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,cAAc;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,cAAc;IACd,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAE5B,cAAc;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,cAAc;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;;AA6CF,wBAAiE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
import { withTranslation } from 'react-i18next';
|
|
4
|
+
/**
|
|
5
|
+
* Buttons are used to inform the user about a potential user interaction, which then on interaction causes an action.
|
|
6
|
+
* To create a standardized look and feel, different props can be passed to the Button.
|
|
7
|
+
*/
|
|
8
|
+
function Button({ children, title, type, disabled, onClick, style, tabIndex, t, primary, danger, naked, className, small, ...rest }) {
|
|
9
|
+
let btnTitle = title;
|
|
10
|
+
if (title && typeof title !== 'string') {
|
|
11
|
+
btnTitle = t(title.id, {
|
|
12
|
+
defaultValue: title.defaultValue
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
return (React.createElement("button", { "data-testid": rest['data-testid'], type: type || 'button', className: cx('di button', className, { small, primary, danger, link: naked }), title: typeof btnTitle === 'string' ? btnTitle : undefined, disabled: disabled, onClick: onClick, style: style, tabIndex: tabIndex }, children));
|
|
16
|
+
}
|
|
17
|
+
export default withTranslation()(Button);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare type Props = {
|
|
3
|
+
/** should contain <Button /> elements */
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/** show a horizontal row above the buttons */
|
|
6
|
+
dividing?: boolean;
|
|
7
|
+
/** @ignore */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** @ignore */
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* ButtonRows align Buttons nicely for all relevant and/or related user actions such as saving or canceling changes.
|
|
14
|
+
* To separate the ButtonRow from the content, the extra property `dividing` can be used.
|
|
15
|
+
*/
|
|
16
|
+
declare const ButtonRow: {
|
|
17
|
+
({ children, dividing, className, style }: Props): JSX.Element;
|
|
18
|
+
defaultProps: {
|
|
19
|
+
dividing: boolean;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export default ButtonRow;
|
|
23
|
+
//# sourceMappingURL=ButtonRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonRow.d.ts","sourceRoot":"","sources":["../../../../src/components/button/ButtonRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,oBAAY,KAAK,GAAG;IACnB,+CAA+C;IAC/C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,cAAc;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,cAAc;IACd,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC5B,CAAC;AAEF;;;GAGG;AACH,QAAA,MAAM,SAAS;+CAA4C,KAAK;;;;CAI/D,CAAC;AAMF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* ButtonRows align Buttons nicely for all relevant and/or related user actions such as saving or canceling changes.
|
|
4
|
+
* To separate the ButtonRow from the content, the extra property `dividing` can be used.
|
|
5
|
+
*/
|
|
6
|
+
const ButtonRow = ({ children, dividing, className, style }) => (React.createElement("div", { style: style, className: `di button-row ${dividing ? 'dividing' : ''} ${className || ''}` }, children));
|
|
7
|
+
ButtonRow.defaultProps = {
|
|
8
|
+
dividing: false
|
|
9
|
+
};
|
|
10
|
+
export default ButtonRow;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TranslationDescriptor } from '../../types/i18n';
|
|
3
|
+
export declare type Props = {
|
|
4
|
+
title: string | TranslationDescriptor;
|
|
5
|
+
message: string | React.ReactElement | TranslationDescriptor;
|
|
6
|
+
/** @ignore */
|
|
7
|
+
onAccept: (...args: Array<any>) => any;
|
|
8
|
+
/** @ignore */
|
|
9
|
+
onDecline: (...args: Array<any>) => any;
|
|
10
|
+
acceptButtonLabel?: string | TranslationDescriptor;
|
|
11
|
+
declineButtonLabel?: string | TranslationDescriptor;
|
|
12
|
+
acceptButtonStyle?: 'primary' | 'danger';
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Confirm enables the possibility to open up a dialog within a modal, requiring additional user actions.
|
|
16
|
+
* This component should not be used directly, instead use `@withConfirm` to inject a promise based confirm method
|
|
17
|
+
*/
|
|
18
|
+
export default function Confirm({ title, message, onAccept, onDecline, acceptButtonLabel, declineButtonLabel, acceptButtonStyle }: Props): JSX.Element;
|
|
19
|
+
//# sourceMappingURL=Confirm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Confirm.d.ts","sourceRoot":"","sources":["../../../../src/components/confirm/Confirm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAC,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AAGvD,oBAAY,KAAK,GAAG;IACnB,KAAK,EAAE,MAAM,GAAG,qBAAqB,CAAC;IACtC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,YAAY,GAAG,qBAAqB,CAAC;IAE7D,cAAc;IACd,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC;IAEvC,cAAc;IACd,SAAS,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC;IACxC,iBAAiB,CAAC,EAAE,MAAM,GAAG,qBAAqB,CAAC;IACnD,kBAAkB,CAAC,EAAE,MAAM,GAAG,qBAAqB,CAAC;IACpD,iBAAiB,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;CACzC,CAAC;AAWF;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAC/B,KAAK,EACL,OAAO,EACP,QAAQ,EACR,SAAS,EACT,iBAAiB,EACjB,kBAAkB,EAClB,iBAA6B,EAC7B,EAAE,KAAK,eA6BP"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Trans } from 'react-i18next';
|
|
3
|
+
import Modal from '../modal/Modal';
|
|
4
|
+
import Button from '../button/Button';
|
|
5
|
+
import { isTranslationDescriptor } from './utils';
|
|
6
|
+
function transformTextToElement(message) {
|
|
7
|
+
if (isTranslationDescriptor(message)) {
|
|
8
|
+
return React.createElement(Trans, { i18nKey: message.id }, message.defaultValue);
|
|
9
|
+
}
|
|
10
|
+
return message;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Confirm enables the possibility to open up a dialog within a modal, requiring additional user actions.
|
|
14
|
+
* This component should not be used directly, instead use `@withConfirm` to inject a promise based confirm method
|
|
15
|
+
*/
|
|
16
|
+
export default function Confirm({ title, message, onAccept, onDecline, acceptButtonLabel, declineButtonLabel, acceptButtonStyle = 'primary' }) {
|
|
17
|
+
return (React.createElement(Modal, { header: transformTextToElement(title), content: transformTextToElement(message), footer: React.createElement("div", null,
|
|
18
|
+
React.createElement(Button, { primary: acceptButtonStyle === 'primary', danger: acceptButtonStyle === 'danger', onClick: onAccept }, acceptButtonLabel ? (transformTextToElement(acceptButtonLabel)) : (React.createElement(Trans, { i18nKey: "form.accept" }, "Accept"))),
|
|
19
|
+
React.createElement(Button, { onClick: onDecline }, declineButtonLabel ? (transformTextToElement(declineButtonLabel)) : (React.createElement(Trans, { i18nKey: "form.decline" }, "Decline")))), width: 500 }));
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type ConfirmOptions = {
|
|
3
|
+
title: string;
|
|
4
|
+
message: string | React.ReactElement;
|
|
5
|
+
acceptButtonLabel?: string;
|
|
6
|
+
declineButtonLabel?: string;
|
|
7
|
+
acceptButtonStyle?: 'primary' | 'danger';
|
|
8
|
+
};
|
|
9
|
+
export declare const ConfirmContext: React.Context<{
|
|
10
|
+
confirm: (options: ConfirmOptions) => Promise<boolean>;
|
|
11
|
+
}>;
|
|
12
|
+
declare function ConfirmProvider({ children }: React.PropsWithChildren<Record<string, unknown>>): JSX.Element;
|
|
13
|
+
export default ConfirmProvider;
|
|
14
|
+
//# sourceMappingURL=ConfirmProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmProvider.d.ts","sourceRoot":"","sources":["../../../../src/components/confirm/ConfirmProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAIrD,aAAK,cAAc,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC;IACrC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,cAAc;uBACP,cAAc,KAAK,QAAQ,OAAO,CAAC;EAGrD,CAAC;AAEH,iBAAS,eAAe,CAAC,EAAC,QAAQ,EAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,eAgCpF;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React, { createContext, useState } from 'react';
|
|
2
|
+
import Confirm from './Confirm';
|
|
3
|
+
export const ConfirmContext = createContext({
|
|
4
|
+
confirm: () => Promise.reject(new Error('ConfirmProvider is missing!'))
|
|
5
|
+
});
|
|
6
|
+
function ConfirmProvider({ children }) {
|
|
7
|
+
const [visible, setVisible] = useState(false);
|
|
8
|
+
const [confirmProps, setConfirmProps] = useState({
|
|
9
|
+
title: '',
|
|
10
|
+
message: '',
|
|
11
|
+
onAccept: () => { },
|
|
12
|
+
onDecline: () => { }
|
|
13
|
+
});
|
|
14
|
+
async function confirm(options) {
|
|
15
|
+
return new Promise((resolve) => {
|
|
16
|
+
setVisible(true);
|
|
17
|
+
setConfirmProps({
|
|
18
|
+
...options,
|
|
19
|
+
onAccept: () => {
|
|
20
|
+
setVisible(false);
|
|
21
|
+
resolve(true);
|
|
22
|
+
},
|
|
23
|
+
onDecline: () => {
|
|
24
|
+
setVisible(false);
|
|
25
|
+
resolve(false);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return (React.createElement(ConfirmContext.Provider, { value: { confirm } },
|
|
31
|
+
children,
|
|
32
|
+
visible && React.createElement(Confirm, { ...confirmProps })));
|
|
33
|
+
}
|
|
34
|
+
export default ConfirmProvider;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export default function useConfirm(): (options: {
|
|
3
|
+
title: string;
|
|
4
|
+
message: string | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
5
|
+
acceptButtonLabel?: string | undefined;
|
|
6
|
+
declineButtonLabel?: string | undefined;
|
|
7
|
+
acceptButtonStyle?: "primary" | "danger" | undefined;
|
|
8
|
+
}) => Promise<boolean>;
|
|
9
|
+
//# sourceMappingURL=useConfirm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConfirm.d.ts","sourceRoot":"","sources":["../../../../src/components/confirm/useConfirm.ts"],"names":[],"mappings":";AAIA,MAAM,CAAC,OAAO,UAAU,UAAU;;;;;;uBAOjC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { ConfirmContext } from './ConfirmProvider';
|
|
3
|
+
export default function useConfirm() {
|
|
4
|
+
const context = useContext(ConfirmContext);
|
|
5
|
+
if (!context) {
|
|
6
|
+
throw new Error('ConfirmProvider is missing');
|
|
7
|
+
}
|
|
8
|
+
const { confirm } = context;
|
|
9
|
+
return confirm;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/confirm/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,uBAAuB,CACtC,GAAG,EAAE,qBAAqB,GAAG,MAAM,GAAG,KAAK,CAAC,YAAY,GACtD,GAAG,IAAI,qBAAqB,CAW9B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function isTranslationDescriptor(arg) {
|
|
2
|
+
const result = typeof arg === 'object' && typeof arg.id === 'string' && typeof arg.defaultValue === 'string';
|
|
3
|
+
if (result) {
|
|
4
|
+
console.warn('Please use strings instead of TranslationDescriptors to initialize the Confirm modal, because TranslationDescriptors are deprecated');
|
|
5
|
+
}
|
|
6
|
+
return result;
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TranslationDescriptor } from '../../types/i18n';
|
|
3
|
+
export declare type ConfirmProps = {
|
|
4
|
+
confirm: (title: string | TranslationDescriptor, message: string | TranslationDescriptor | React.ReactElement, acceptButtonLabel?: string | TranslationDescriptor, declineButtonLabel?: string | TranslationDescriptor, resolveWithConfirmation?: boolean, acceptButtonStyle?: 'primary' | 'danger') => Promise<void | boolean>;
|
|
5
|
+
};
|
|
6
|
+
export default function withConfirm<P>(WrappedComponent: React.ComponentType<P & ConfirmProps>): (props: P) => JSX.Element;
|
|
7
|
+
//# sourceMappingURL=withConfirm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withConfirm.d.ts","sourceRoot":"","sources":["../../../../src/components/confirm/withConfirm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAC,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AAKvD,oBAAY,YAAY,GAAG;IAC1B,OAAO,EAAE,CACR,KAAK,EAAE,MAAM,GAAG,qBAAqB,EACrC,OAAO,EAAE,MAAM,GAAG,qBAAqB,GAAG,KAAK,CAAC,YAAY,EAC5D,iBAAiB,CAAC,EAAE,MAAM,GAAG,qBAAqB,EAClD,kBAAkB,CAAC,EAAE,MAAM,GAAG,qBAAqB,EACnD,uBAAuB,CAAC,EAAE,OAAO,EACjC,iBAAiB,CAAC,EAAE,SAAS,GAAG,QAAQ,KACpC,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC;CAC7B,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,CAAC,EAAE,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,GAAG,YAAY,CAAC,WAsCnD,CAAC,iBAO3C"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import useConfirm from './useConfirm';
|
|
4
|
+
import ConfirmProvider from './ConfirmProvider';
|
|
5
|
+
import { isTranslationDescriptor } from './utils';
|
|
6
|
+
export default function withConfirm(WrappedComponent) {
|
|
7
|
+
function WithConfirm(props) {
|
|
8
|
+
const confirm = useConfirm();
|
|
9
|
+
const { t } = useTranslation();
|
|
10
|
+
function trans(arg) {
|
|
11
|
+
if (isTranslationDescriptor(arg)) {
|
|
12
|
+
return t(arg.id, { defaultValue: arg.defaultValue });
|
|
13
|
+
}
|
|
14
|
+
return arg;
|
|
15
|
+
}
|
|
16
|
+
async function deprecatedConfirm(title, message, acceptButtonLabel, declineButtonLabel, resolveWithConfirmation, acceptButtonStyle) {
|
|
17
|
+
const accepted = await confirm({
|
|
18
|
+
title: trans(title),
|
|
19
|
+
message: isTranslationDescriptor(message) ? trans(message) : message,
|
|
20
|
+
acceptButtonLabel: acceptButtonLabel ? trans(acceptButtonLabel) : undefined,
|
|
21
|
+
declineButtonLabel: declineButtonLabel ? trans(declineButtonLabel) : undefined,
|
|
22
|
+
acceptButtonStyle
|
|
23
|
+
});
|
|
24
|
+
if (resolveWithConfirmation) {
|
|
25
|
+
return accepted;
|
|
26
|
+
}
|
|
27
|
+
else if (!accepted) {
|
|
28
|
+
return new Promise(() => { });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return React.createElement(WrappedComponent, { ...props, confirm: deprecatedConfirm });
|
|
32
|
+
}
|
|
33
|
+
return function WithConfirmWrapper(props) {
|
|
34
|
+
return (React.createElement(ConfirmProvider, null,
|
|
35
|
+
React.createElement(WithConfirm, { ...props })));
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare type Props = {
|
|
3
|
+
add?: boolean;
|
|
4
|
+
del?: boolean;
|
|
5
|
+
edit?: boolean;
|
|
6
|
+
config?: boolean;
|
|
7
|
+
duplicate?: boolean;
|
|
8
|
+
search?: boolean;
|
|
9
|
+
download?: boolean;
|
|
10
|
+
sync?: boolean;
|
|
11
|
+
fullscreen?: boolean;
|
|
12
|
+
star?: boolean;
|
|
13
|
+
/** key is reserved in React */
|
|
14
|
+
iconKey?: boolean;
|
|
15
|
+
documentation?: boolean;
|
|
16
|
+
/** renders a larger version of the icon (24x24) */
|
|
17
|
+
large?: boolean;
|
|
18
|
+
/** inverts the colors of the icon for display on dark background */
|
|
19
|
+
inverted?: boolean;
|
|
20
|
+
/** @ignore */
|
|
21
|
+
className?: string;
|
|
22
|
+
};
|
|
23
|
+
export default function Icon(props: Props): JSX.Element;
|
|
24
|
+
//# sourceMappingURL=Icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../src/components/icon/Icon.tsx"],"names":[],"mappings":";AAeA,oBAAY,KAAK,GAAG;IACnB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,+BAA+B;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,mDAAmD;IACnD,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,cAAc;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAkEF,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,EAAE,KAAK,eAYxC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import iconAdd from '../../assets/svg/icon_add.svg';
|
|
3
|
+
import iconDel from '../../assets/svg/icon_cross.svg';
|
|
4
|
+
import iconEdit from '../../assets/svg/icon_edit.svg';
|
|
5
|
+
import iconConfig from '../../assets/svg/icon_gear.svg';
|
|
6
|
+
import iconDuplicate from '../../assets/svg/icon_duplicate.svg';
|
|
7
|
+
import iconDownload from '../../assets/svg/icon_download.svg';
|
|
8
|
+
import iconSearch from '../../assets/svg/icon_lupe.svg';
|
|
9
|
+
import iconIconKey from '../../assets/svg/icon_key.svg';
|
|
10
|
+
import iconSync from '../../assets/svg/icon_reload.svg';
|
|
11
|
+
import iconFullscreen from '../../assets/svg/icon_fullscreen.svg';
|
|
12
|
+
import iconDocumentation from '../../assets/svg/icon_help_light.svg';
|
|
13
|
+
import iconStar from '../../assets/svg/icon_star.svg';
|
|
14
|
+
function getSrc(props) {
|
|
15
|
+
const { add, del, edit, config, duplicate, search, download, sync, fullscreen, iconKey, documentation, star } = props;
|
|
16
|
+
if (add) {
|
|
17
|
+
return iconAdd;
|
|
18
|
+
}
|
|
19
|
+
else if (del) {
|
|
20
|
+
return iconDel;
|
|
21
|
+
}
|
|
22
|
+
else if (edit) {
|
|
23
|
+
return iconEdit;
|
|
24
|
+
}
|
|
25
|
+
else if (config) {
|
|
26
|
+
return iconConfig;
|
|
27
|
+
}
|
|
28
|
+
else if (duplicate) {
|
|
29
|
+
return iconDuplicate;
|
|
30
|
+
}
|
|
31
|
+
else if (search) {
|
|
32
|
+
return iconSearch;
|
|
33
|
+
}
|
|
34
|
+
else if (download) {
|
|
35
|
+
return iconDownload;
|
|
36
|
+
}
|
|
37
|
+
else if (sync) {
|
|
38
|
+
return iconSync;
|
|
39
|
+
}
|
|
40
|
+
else if (fullscreen) {
|
|
41
|
+
return iconFullscreen;
|
|
42
|
+
}
|
|
43
|
+
else if (iconKey) {
|
|
44
|
+
return iconIconKey;
|
|
45
|
+
}
|
|
46
|
+
else if (documentation) {
|
|
47
|
+
return iconDocumentation;
|
|
48
|
+
}
|
|
49
|
+
else if (star) {
|
|
50
|
+
return iconStar;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
throw Error('getSrc: no icon type specified');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function getAlt(props) {
|
|
57
|
+
const { add, del, edit, config, duplicate, search, download, sync, fullscreen, iconKey, documentation, star } = props;
|
|
58
|
+
if (add) {
|
|
59
|
+
return 'icon add';
|
|
60
|
+
}
|
|
61
|
+
else if (del) {
|
|
62
|
+
return 'icon delete';
|
|
63
|
+
}
|
|
64
|
+
else if (edit) {
|
|
65
|
+
return 'icon edit';
|
|
66
|
+
}
|
|
67
|
+
else if (config) {
|
|
68
|
+
return 'icon config';
|
|
69
|
+
}
|
|
70
|
+
else if (duplicate) {
|
|
71
|
+
return 'icon duplicate';
|
|
72
|
+
}
|
|
73
|
+
else if (search) {
|
|
74
|
+
return 'icon search';
|
|
75
|
+
}
|
|
76
|
+
else if (download) {
|
|
77
|
+
return 'icon download';
|
|
78
|
+
}
|
|
79
|
+
else if (sync) {
|
|
80
|
+
return 'icon sync';
|
|
81
|
+
}
|
|
82
|
+
else if (fullscreen) {
|
|
83
|
+
return 'icon fullscreen';
|
|
84
|
+
}
|
|
85
|
+
else if (iconKey) {
|
|
86
|
+
return 'icon iconKey';
|
|
87
|
+
}
|
|
88
|
+
else if (documentation) {
|
|
89
|
+
return 'icon documentation';
|
|
90
|
+
}
|
|
91
|
+
else if (star) {
|
|
92
|
+
return 'icon star';
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
throw Error('getAlt: no icon type specified');
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
export default function Icon(props) {
|
|
99
|
+
let style;
|
|
100
|
+
if (props.large) {
|
|
101
|
+
style = { width: 24, height: 24 };
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
style = { width: 16, height: 16 };
|
|
105
|
+
}
|
|
106
|
+
if (props.inverted) {
|
|
107
|
+
style = { ...style, filter: 'invert(1)' };
|
|
108
|
+
}
|
|
109
|
+
return React.createElement("img", { src: getSrc(props), className: `di icon ${props.className || ''}`, alt: getAlt(props), style: style });
|
|
110
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TranslationDescriptor } from '../../types/i18n';
|
|
3
|
+
export declare type Props = {
|
|
4
|
+
/** input type selector */
|
|
5
|
+
type?: 'checkbox' | 'radio' | 'toggle';
|
|
6
|
+
/** Flag to preselect the status of the checkbox */
|
|
7
|
+
value: boolean;
|
|
8
|
+
/** Function, executed when toggling the checkbox */
|
|
9
|
+
onChange: (nextStatus: boolean) => void;
|
|
10
|
+
/** Optional input element tooltip */
|
|
11
|
+
title?: TranslationDescriptor;
|
|
12
|
+
/** Optional label for checkbox and radio button*/
|
|
13
|
+
label?: TranslationDescriptor;
|
|
14
|
+
/** visually indicate that the checkbox is disabled and disable onChange handler */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** Optional flag for toggle type: Render a small Toggle */
|
|
17
|
+
toggleSmall?: boolean;
|
|
18
|
+
/** Optional flag for toggle type: Sets the slider color when the Toggle is truthy */
|
|
19
|
+
toggleColor?: string;
|
|
20
|
+
/** @ignore */
|
|
21
|
+
'data-testid'?: string;
|
|
22
|
+
/** @ignore */
|
|
23
|
+
'wrapper-data-testid'?: string;
|
|
24
|
+
/** @ignore */
|
|
25
|
+
'innerdiv-data-testid'?: string;
|
|
26
|
+
};
|
|
27
|
+
declare const _default: React.ComponentType<Props>;
|
|
28
|
+
export default _default;
|
|
29
|
+
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/input/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AAEvD,oBAAY,KAAK,GAAG;IACnB,0BAA0B;IAC1B,IAAI,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;IAEvC,mDAAmD;IACnD,KAAK,EAAE,OAAO,CAAC;IAEf,oDAAoD;IACpD,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAExC,qCAAqC;IACrC,KAAK,CAAC,EAAE,qBAAqB,CAAC;IAE9B,kDAAkD;IAClD,KAAK,CAAC,EAAE,qBAAqB,CAAC;IAE9B,mFAAmF;IACnF,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,qFAAqF;IACrF,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,cAAc;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,cAAc;IACd,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B,cAAc;IACd,sBAAsB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;;AAqFF,wBAAyE"}
|