@luscii-healthtech/web-ui 30.0.4 → 30.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ConfirmationDialog/types/ConfirmationDialog.types.d.ts +5 -1
- package/dist/index.development.js +4 -2
- package/dist/index.development.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/web-ui.esm.js +1 -1
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
import type { IconKey, IconProps } from "../../Icons/types/IconProps.type";
|
|
3
3
|
import type { NotificationBannerColor } from "../../NotificationBanner/NotificationBanner";
|
|
4
4
|
interface ConfirmationDialogTexts {
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* You can also use the `children` prop for this.
|
|
7
|
+
*/
|
|
8
|
+
message?: string | string[];
|
|
6
9
|
confirmLabel: string;
|
|
7
10
|
cancelLabel: string;
|
|
8
11
|
}
|
|
@@ -16,6 +19,7 @@ export interface ConfirmationDialogChoice<T extends string = string> {
|
|
|
16
19
|
};
|
|
17
20
|
}
|
|
18
21
|
export interface ConfirmationDialogProps {
|
|
22
|
+
children?: React.ReactNode;
|
|
19
23
|
texts: ConfirmationDialogTexts;
|
|
20
24
|
isOpen: boolean;
|
|
21
25
|
onCancel: () => void;
|
|
@@ -2929,7 +2929,8 @@ const ConfirmationDialogMessage = (props) => {
|
|
|
2929
2929
|
|
|
2930
2930
|
const ConfirmationDialog = (_a) => {
|
|
2931
2931
|
var { dataTestId = "confirmation-dialog-modal" } = _a, props = __rest(_a, ["dataTestId"]);
|
|
2932
|
-
const { choices } = props;
|
|
2932
|
+
const { children, choices } = props;
|
|
2933
|
+
const { message } = props.texts;
|
|
2933
2934
|
const [selectedChoice, setSelectedChoice] = React.useState(choices === null || choices === void 0 ? void 0 : choices.options.find((choice) => choice.value === choices.defaultChoice));
|
|
2934
2935
|
const handleOnCloseClick = () => {
|
|
2935
2936
|
if (!props.isProcessing) {
|
|
@@ -2964,7 +2965,8 @@ const ConfirmationDialog = (_a) => {
|
|
|
2964
2965
|
"div",
|
|
2965
2966
|
{ className: "ui-min-h-13 ui-space-y-4" },
|
|
2966
2967
|
React__namespace.default.createElement(ConfirmationDialogTitle, { title: props.withTitle }),
|
|
2967
|
-
|
|
2968
|
+
children,
|
|
2969
|
+
message && React__namespace.default.createElement(ConfirmationDialogMessage, { message }),
|
|
2968
2970
|
React__namespace.default.createElement(ConfirmationDialogChoices, { choices: props.choices, onChoiceChangeCallback: onChoiceChange, selectedChoice })
|
|
2969
2971
|
)
|
|
2970
2972
|
);
|