@owp/core 2.5.14 → 2.5.16
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/OwpDialog/OwpAlertDialog.js +46 -0
- package/dist/components/OwpDialog/OwpAlertDialog.js.map +1 -0
- package/dist/components/OwpDialog/OwpDialog.js +41 -38
- package/dist/components/OwpDialog/OwpDialog.js.map +1 -1
- package/dist/components/OwpQuerySelector/OwpQuerySelector.js +184 -177
- package/dist/components/OwpQuerySelector/OwpQuerySelector.js.map +1 -1
- package/dist/components/OwpTable/internal/treeGridTableStyle.js +16 -21
- package/dist/components/OwpTable/internal/treeGridTableStyle.js.map +1 -1
- package/dist/components/OwpTreeGrid/OwpTreeGrid.js +145 -137
- package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
- package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js +265 -178
- package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js.map +1 -1
- package/dist/components/OwpTreeGrid/internal/treeGridTheme.js +141 -127
- package/dist/components/OwpTreeGrid/internal/treeGridTheme.js.map +1 -1
- package/dist/components/OwpTreeGridResetChangesButton/OwpTreeGridResetChangesButton.js +7 -6
- package/dist/components/OwpTreeGridResetChangesButton/OwpTreeGridResetChangesButton.js.map +1 -1
- package/dist/constants/treeGrid.js +32 -26
- package/dist/constants/treeGrid.js.map +1 -1
- package/dist/features/themePreview/components/ThemePreviewColorField.js +79 -75
- package/dist/features/themePreview/components/ThemePreviewColorField.js.map +1 -1
- package/dist/hooks/useConfirm.js +55 -65
- package/dist/hooks/useConfirm.js.map +1 -1
- package/dist/index.js +69 -67
- package/dist/index.js.map +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/constants.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/constants.js +1 -1
- package/dist/owp-app.css +1 -1
- package/dist/types/components/OwpDialog/OwpAlertDialog.d.ts +25 -0
- package/dist/types/components/OwpDialog/OwpDialog.d.ts +2 -0
- package/dist/types/components/OwpDialog/index.d.ts +1 -0
- package/dist/types/components/OwpQuerySelector/OwpQuerySelector.d.ts +1 -1
- package/dist/types/components/OwpTreeGrid/OwpTreeGrid.d.ts +2 -1
- package/dist/types/components/OwpTreeGrid/internal/treeGridRuntime.d.ts +6 -2
- package/dist/types/constants/treeGrid.d.ts +3 -3
- package/dist/types/hooks/useConfirm.d.ts +7 -14
- package/package.json +1 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var f = Object.defineProperty;
|
|
2
|
+
var i = (t, r) => f(t, "name", { value: r, configurable: !0 });
|
|
3
|
+
import { jsxs as s, jsx as e } from "../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
|
|
4
|
+
import { useOwpTranslation as D } from "../../hooks/useOwpTranslation.js";
|
|
5
|
+
import { DialogActions as T, Button as a, Dialog as k, DialogTitle as v, DialogContentText as B, DialogContent as b } from "@mui/material";
|
|
6
|
+
const p = /* @__PURE__ */ i(({
|
|
7
|
+
payload: t,
|
|
8
|
+
open: r,
|
|
9
|
+
onClose: o
|
|
10
|
+
}) => {
|
|
11
|
+
const { title: n, description: l, okButtonProps: d, cancelButtonProps: g, severity: u, useInfo: x } = t, { t: c } = D(), h = (t == null ? void 0 : t.okText) ?? c("Button.확인"), m = (t == null ? void 0 : t.cancelText) ?? c("Button.취소");
|
|
12
|
+
return /* @__PURE__ */ s(
|
|
13
|
+
k,
|
|
14
|
+
{
|
|
15
|
+
fullWidth: !0,
|
|
16
|
+
maxWidth: "xs",
|
|
17
|
+
open: r,
|
|
18
|
+
onClose: /* @__PURE__ */ i(() => o(!1), "onClose"),
|
|
19
|
+
role: "alertdialog",
|
|
20
|
+
"aria-labelledby": n ? "alert-dialog-title" : void 0,
|
|
21
|
+
"aria-describedby": l ? "alert-dialog-description" : void 0,
|
|
22
|
+
children: [
|
|
23
|
+
n && /* @__PURE__ */ e(v, { id: "alert-dialog-title", children: n }),
|
|
24
|
+
l && /* @__PURE__ */ e(b, { children: /* @__PURE__ */ e(B, { id: "alert-dialog-description", children: l }) }),
|
|
25
|
+
/* @__PURE__ */ s(T, { children: [
|
|
26
|
+
!x && /* @__PURE__ */ e(a, { ...g, variant: "outlined", onClick: /* @__PURE__ */ i(() => o(!1), "onClick"), children: m }),
|
|
27
|
+
/* @__PURE__ */ e(
|
|
28
|
+
a,
|
|
29
|
+
{
|
|
30
|
+
color: u ?? "primary",
|
|
31
|
+
variant: "contained",
|
|
32
|
+
...d,
|
|
33
|
+
onClick: /* @__PURE__ */ i(() => o(!0), "onClick"),
|
|
34
|
+
children: h
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
] })
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}, "OwpAlertDialog");
|
|
42
|
+
p.displayName = "OwpAlertDialog";
|
|
43
|
+
export {
|
|
44
|
+
p as OwpAlertDialog
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=OwpAlertDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OwpAlertDialog.js","sources":["../../../src/components/OwpDialog/OwpAlertDialog.tsx"],"sourcesContent":["import { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport {\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n} from '@mui/material';\nimport type { ButtonProps } from '@mui/material';\nimport type { DialogProps } from '@toolpad/core/useDialogs';\nimport type { ReactNode } from 'react';\n\nexport type OwpAlertDialogSeverity =\n | 'primary'\n | 'secondary'\n | 'error'\n | 'info'\n | 'success'\n | 'warning';\n\nexport interface OwpAlertDialogPayload {\n title?: ReactNode | string;\n description?: ReactNode | string;\n okText?: string;\n cancelText?: string;\n severity?: OwpAlertDialogSeverity;\n useInfo?: boolean;\n okButtonProps?: ButtonProps;\n cancelButtonProps?: ButtonProps;\n}\n\n/**\n * 경고성 확인 대화상자 컴포넌트\n * @param payload 대화상자 표시 속성\n * @param open 열림 여부\n * @param onClose 닫힘 핸들러\n */\nconst OwpAlertDialog = ({\n payload,\n open,\n onClose,\n}: DialogProps<OwpAlertDialogPayload, boolean>) => {\n const { title, description, okButtonProps, cancelButtonProps, severity, useInfo } = payload;\n const { t } = useOwpTranslation();\n\n const okText = payload?.okText ?? t('Button.확인');\n const cancelText = payload?.cancelText ?? t('Button.취소');\n\n return (\n <Dialog\n fullWidth\n maxWidth=\"xs\"\n open={open}\n onClose={() => onClose(false)}\n role=\"alertdialog\"\n aria-labelledby={title ? 'alert-dialog-title' : undefined}\n aria-describedby={description ? 'alert-dialog-description' : undefined}\n >\n {title && <DialogTitle id=\"alert-dialog-title\">{title}</DialogTitle>}\n {description && (\n <DialogContent>\n <DialogContentText id=\"alert-dialog-description\">{description}</DialogContentText>\n </DialogContent>\n )}\n <DialogActions>\n {!useInfo && (\n <Button {...cancelButtonProps} variant=\"outlined\" onClick={() => onClose(false)}>\n {cancelText}\n </Button>\n )}\n <Button\n color={severity ?? 'primary'}\n variant=\"contained\"\n {...okButtonProps}\n onClick={() => onClose(true)}\n >\n {okText}\n </Button>\n </DialogActions>\n </Dialog>\n );\n};\n\nOwpAlertDialog.displayName = 'OwpAlertDialog';\n\nexport { OwpAlertDialog };\n"],"names":["OwpAlertDialog","__name","payload","open","onClose","title","description","okButtonProps","cancelButtonProps","severity","useInfo","t","useOwpTranslation","okText","cancelText","jsxs","Dialog","jsx","DialogTitle","DialogContent","DialogContentText","DialogActions","Button"],"mappings":";;;;;AAsCA,MAAMA,IAAiB,gBAAAC,EAAA,CAAC;AAAA,EACtB,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,SAAAC;AACF,MAAmD;AACjD,QAAM,EAAE,OAAAC,GAAO,aAAAC,GAAa,eAAAC,GAAe,mBAAAC,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as
|
|
6
|
-
import { forwardRef as
|
|
7
|
-
const
|
|
1
|
+
var K = Object.defineProperty;
|
|
2
|
+
var n = (e, c) => K(e, "name", { value: c, configurable: !0 });
|
|
3
|
+
import { jsxs as l, jsx as r } from "../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
|
|
4
|
+
import { useOwpTranslation as N } from "../../hooks/useOwpTranslation.js";
|
|
5
|
+
import { DialogContent as P, DialogActions as z, Dialog as H, DialogTitle as R, CircularProgress as W, Box as m, Button as y } from "@mui/material";
|
|
6
|
+
import { forwardRef as q } from "react";
|
|
7
|
+
const E = q(
|
|
8
8
|
({
|
|
9
9
|
title: e,
|
|
10
10
|
children: c,
|
|
11
11
|
loading: o = !1,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
alertDialog: h = !1,
|
|
13
|
+
canCancel: g = !0,
|
|
14
|
+
canConfirm: s = !0,
|
|
14
15
|
confirmText: D,
|
|
15
|
-
cancelText:
|
|
16
|
-
onConfirm:
|
|
17
|
-
onCancel:
|
|
16
|
+
cancelText: v,
|
|
17
|
+
onConfirm: d,
|
|
18
|
+
onCancel: f,
|
|
18
19
|
onClose: t,
|
|
19
20
|
useSubmit: a,
|
|
20
|
-
actions:
|
|
21
|
-
contentProps:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
actions: u,
|
|
22
|
+
contentProps: w,
|
|
23
|
+
role: T,
|
|
24
|
+
...B
|
|
25
|
+
}, k) => {
|
|
26
|
+
const { t: p } = N(), b = D ?? p("Button.저장"), j = v ?? p(s ? "Button.취소" : "Button.닫기"), { sx: i, ...A } = w ?? {}, O = [
|
|
25
27
|
{ position: "relative", minHeight: o ? 120 : void 0 },
|
|
26
28
|
...Array.isArray(i) ? i : i ? [i] : []
|
|
27
29
|
];
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
|
|
30
|
+
return /* @__PURE__ */ l(
|
|
31
|
+
H,
|
|
30
32
|
{
|
|
31
|
-
ref:
|
|
33
|
+
ref: k,
|
|
32
34
|
fullWidth: !0,
|
|
33
35
|
component: a ? "form" : void 0,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
role: h ? "alertdialog" : T,
|
|
37
|
+
onClose: /* @__PURE__ */ n((I, x) => {
|
|
38
|
+
x !== "backdropClick" && (t == null || t(I, x));
|
|
36
39
|
}, "onClose"),
|
|
37
|
-
...
|
|
40
|
+
...B,
|
|
38
41
|
children: [
|
|
39
|
-
e && /* @__PURE__ */ r(
|
|
40
|
-
/* @__PURE__ */
|
|
42
|
+
e && /* @__PURE__ */ r(R, { children: e }),
|
|
43
|
+
/* @__PURE__ */ l(P, { dividers: !0, "aria-busy": o, ...A, sx: O, children: [
|
|
41
44
|
c,
|
|
42
45
|
o && /* @__PURE__ */ r(
|
|
43
46
|
m,
|
|
@@ -51,27 +54,27 @@ const W = R(
|
|
|
51
54
|
alignItems: "center",
|
|
52
55
|
justifyContent: "center"
|
|
53
56
|
},
|
|
54
|
-
children: /* @__PURE__ */ r(
|
|
57
|
+
children: /* @__PURE__ */ r(W, { color: "secondary" })
|
|
55
58
|
}
|
|
56
59
|
)
|
|
57
60
|
] }),
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
/* @__PURE__ */ l(z, { children: [
|
|
62
|
+
u && /* @__PURE__ */ r(m, { className: "flex w-full items-start", children: u }),
|
|
63
|
+
g && /* @__PURE__ */ r(
|
|
61
64
|
y,
|
|
62
65
|
{
|
|
63
66
|
variant: "outlined",
|
|
64
67
|
onClick: /* @__PURE__ */ n(() => {
|
|
65
|
-
if (typeof
|
|
66
|
-
|
|
68
|
+
if (typeof f == "function") {
|
|
69
|
+
f();
|
|
67
70
|
return;
|
|
68
71
|
}
|
|
69
72
|
t == null || t({}, "escapeKeyDown");
|
|
70
73
|
}, "onClick"),
|
|
71
|
-
children:
|
|
74
|
+
children: j
|
|
72
75
|
}
|
|
73
76
|
),
|
|
74
|
-
|
|
77
|
+
s && /* @__PURE__ */ r(
|
|
75
78
|
y,
|
|
76
79
|
{
|
|
77
80
|
variant: "contained",
|
|
@@ -79,14 +82,14 @@ const W = R(
|
|
|
79
82
|
type: a ? "submit" : "button",
|
|
80
83
|
onClick: /* @__PURE__ */ n(() => {
|
|
81
84
|
if (!a) {
|
|
82
|
-
if (typeof
|
|
83
|
-
|
|
85
|
+
if (typeof d == "function") {
|
|
86
|
+
d();
|
|
84
87
|
return;
|
|
85
88
|
}
|
|
86
89
|
t == null || t({}, "escapeKeyDown");
|
|
87
90
|
}
|
|
88
91
|
}, "onClick"),
|
|
89
|
-
children:
|
|
92
|
+
children: b
|
|
90
93
|
}
|
|
91
94
|
)
|
|
92
95
|
] })
|
|
@@ -95,8 +98,8 @@ const W = R(
|
|
|
95
98
|
);
|
|
96
99
|
}
|
|
97
100
|
);
|
|
98
|
-
|
|
101
|
+
E.displayName = "OwpDialog";
|
|
99
102
|
export {
|
|
100
|
-
|
|
103
|
+
E as OwpDialog
|
|
101
104
|
};
|
|
102
105
|
//# sourceMappingURL=OwpDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OwpDialog.js","sources":["../../../src/components/OwpDialog/OwpDialog.tsx"],"sourcesContent":["import { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport {\n Box,\n Button,\n CircularProgress,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentProps,\n DialogProps,\n DialogTitle,\n} from '@mui/material';\nimport { forwardRef, ReactNode } from 'react';\n\nexport interface OwpDialogProps extends Omit<DialogProps, 'title'> {\n title?: ReactNode;\n children?: ReactNode;\n loading?: boolean;\n canConfirm?: boolean;\n canCancel?: boolean;\n confirmText?: string;\n cancelText?: string;\n useSubmit?: boolean;\n actions?: ReactNode;\n contentProps?: DialogContentProps;\n onConfirm?: () => void;\n onCancel?: () => void;\n}\n\n/**\n * OwpDialog 컴포넌트\n * @param title 제목\n * @param children 하위 콘텐츠\n * @param loading 본문 로딩 여부\n * @param canCancel canCancel 값\n * @param canConfirm canConfirm 값\n * @param onConfirm onConfirm 핸들러\n * @param onCancel onCancel 핸들러\n */\nconst OwpDialog = forwardRef<HTMLDivElement, OwpDialogProps>(\n (\n {\n title,\n children,\n loading = false,\n canCancel = true,\n canConfirm = true,\n confirmText: confirmTextProp,\n cancelText: cancelTextProp,\n onConfirm,\n onCancel,\n onClose,\n useSubmit,\n actions,\n contentProps,\n ...dialogProps\n },\n ref,\n ) => {\n const { t } = useOwpTranslation();\n const confirmText = confirmTextProp ?? t('Button.저장');\n const cancelText = cancelTextProp ?? t(canConfirm ? 'Button.취소' : 'Button.닫기');\n const { sx: contentSx, ...restContentProps } = contentProps ?? {};\n const resolvedContentSx = [\n { position: 'relative', minHeight: loading ? 120 : undefined },\n ...(Array.isArray(contentSx) ? contentSx : contentSx ? [contentSx] : []),\n ];\n\n return (\n <Dialog\n ref={ref}\n fullWidth\n component={useSubmit ? 'form' : undefined}\n onClose={(event, reason) => {\n if (reason === 'backdropClick') {\n return;\n }\n\n onClose?.(event, reason);\n }}\n {...dialogProps}\n >\n {title && <DialogTitle>{title}</DialogTitle>}\n <DialogContent dividers aria-busy={loading} {...restContentProps} sx={resolvedContentSx}>\n {children}\n {loading && (\n <Box\n aria-hidden=\"true\"\n sx={{\n position: 'absolute',\n inset: 0,\n zIndex: 1,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }}\n >\n <CircularProgress color=\"secondary\" />\n </Box>\n )}\n </DialogContent>\n <DialogActions>\n {actions && <Box className=\"flex w-full items-start\">{actions}</Box>}\n {canCancel && (\n <Button\n variant=\"outlined\"\n onClick={() => {\n if (typeof onCancel === 'function') {\n onCancel();\n return;\n }\n\n onClose?.({}, 'escapeKeyDown');\n }}\n >\n {cancelText}\n </Button>\n )}\n {canConfirm && (\n <Button\n variant=\"contained\"\n color=\"secondary\"\n type={useSubmit ? 'submit' : 'button'}\n onClick={() => {\n if (useSubmit) {\n return;\n }\n\n if (typeof onConfirm === 'function') {\n onConfirm();\n return;\n }\n\n onClose?.({}, 'escapeKeyDown');\n }}\n >\n {confirmText}\n </Button>\n )}\n </DialogActions>\n </Dialog>\n );\n },\n);\n\nOwpDialog.displayName = 'OwpDialog';\nexport { OwpDialog };\n"],"names":["OwpDialog","forwardRef","title","children","loading","canCancel","canConfirm","confirmTextProp","cancelTextProp","onConfirm","onCancel","onClose","useSubmit","actions","contentProps","dialogProps","ref","t","useOwpTranslation","confirmText","cancelText","contentSx","restContentProps","resolvedContentSx","jsxs","Dialog","__name","event","reason","jsx","DialogTitle","DialogContent","Box","CircularProgress","DialogActions","Button"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"OwpDialog.js","sources":["../../../src/components/OwpDialog/OwpDialog.tsx"],"sourcesContent":["import { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport {\n Box,\n Button,\n CircularProgress,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentProps,\n DialogProps,\n DialogTitle,\n} from '@mui/material';\nimport { forwardRef, ReactNode } from 'react';\n\nexport interface OwpDialogProps extends Omit<DialogProps, 'title'> {\n title?: ReactNode;\n children?: ReactNode;\n loading?: boolean;\n alertDialog?: boolean;\n canConfirm?: boolean;\n canCancel?: boolean;\n confirmText?: string;\n cancelText?: string;\n useSubmit?: boolean;\n actions?: ReactNode;\n contentProps?: DialogContentProps;\n onConfirm?: () => void;\n onCancel?: () => void;\n}\n\n/**\n * OwpDialog 컴포넌트\n * @param title 제목\n * @param children 하위 콘텐츠\n * @param loading 본문 로딩 여부\n * @param alertDialog alertdialog role 적용 여부\n * @param canCancel canCancel 값\n * @param canConfirm canConfirm 값\n * @param onConfirm onConfirm 핸들러\n * @param onCancel onCancel 핸들러\n */\nconst OwpDialog = forwardRef<HTMLDivElement, OwpDialogProps>(\n (\n {\n title,\n children,\n loading = false,\n alertDialog = false,\n canCancel = true,\n canConfirm = true,\n confirmText: confirmTextProp,\n cancelText: cancelTextProp,\n onConfirm,\n onCancel,\n onClose,\n useSubmit,\n actions,\n contentProps,\n role: roleProp,\n ...dialogProps\n },\n ref,\n ) => {\n const { t } = useOwpTranslation();\n const confirmText = confirmTextProp ?? t('Button.저장');\n const cancelText = cancelTextProp ?? t(canConfirm ? 'Button.취소' : 'Button.닫기');\n const { sx: contentSx, ...restContentProps } = contentProps ?? {};\n const resolvedContentSx = [\n { position: 'relative', minHeight: loading ? 120 : undefined },\n ...(Array.isArray(contentSx) ? contentSx : contentSx ? [contentSx] : []),\n ];\n\n return (\n <Dialog\n ref={ref}\n fullWidth\n component={useSubmit ? 'form' : undefined}\n role={alertDialog ? 'alertdialog' : roleProp}\n onClose={(event, reason) => {\n if (reason === 'backdropClick') {\n return;\n }\n\n onClose?.(event, reason);\n }}\n {...dialogProps}\n >\n {title && <DialogTitle>{title}</DialogTitle>}\n <DialogContent dividers aria-busy={loading} {...restContentProps} sx={resolvedContentSx}>\n {children}\n {loading && (\n <Box\n aria-hidden=\"true\"\n sx={{\n position: 'absolute',\n inset: 0,\n zIndex: 1,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }}\n >\n <CircularProgress color=\"secondary\" />\n </Box>\n )}\n </DialogContent>\n <DialogActions>\n {actions && <Box className=\"flex w-full items-start\">{actions}</Box>}\n {canCancel && (\n <Button\n variant=\"outlined\"\n onClick={() => {\n if (typeof onCancel === 'function') {\n onCancel();\n return;\n }\n\n onClose?.({}, 'escapeKeyDown');\n }}\n >\n {cancelText}\n </Button>\n )}\n {canConfirm && (\n <Button\n variant=\"contained\"\n color=\"secondary\"\n type={useSubmit ? 'submit' : 'button'}\n onClick={() => {\n if (useSubmit) {\n return;\n }\n\n if (typeof onConfirm === 'function') {\n onConfirm();\n return;\n }\n\n onClose?.({}, 'escapeKeyDown');\n }}\n >\n {confirmText}\n </Button>\n )}\n </DialogActions>\n </Dialog>\n );\n },\n);\n\nOwpDialog.displayName = 'OwpDialog';\nexport { OwpDialog };\n"],"names":["OwpDialog","forwardRef","title","children","loading","alertDialog","canCancel","canConfirm","confirmTextProp","cancelTextProp","onConfirm","onCancel","onClose","useSubmit","actions","contentProps","roleProp","dialogProps","ref","t","useOwpTranslation","confirmText","cancelText","contentSx","restContentProps","resolvedContentSx","jsxs","Dialog","__name","event","reason","jsx","DialogTitle","DialogContent","Box","CircularProgress","DialogActions","Button"],"mappings":";;;;;;AAyCA,MAAMA,IAAYC;AAAA,EAChB,CACE;AAAA,IACE,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC,IAAU;AAAA,IACV,aAAAC,IAAc;AAAA,IACd,WAAAC,IAAY;AAAA,IACZ,YAAAC,IAAa;AAAA,IACb,aAAaC;AAAA,IACb,YAAYC;AAAA,IACZ,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,cAAAC;AAAA,IACA,MAAMC;AAAA,IACN,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA,GACRC,IAAcb,KAAmBW,EAAE,WAAW,GAC9CG,IAAab,KAAkBU,EAAEZ,IAAa,cAAc,WAAW,GACvE,EAAE,IAAIgB,GAAW,GAAGC,EAAA,IAAqBT,KAAgB,CAAA,GACzDU,IAAoB;AAAA,MACxB,EAAE,UAAU,YAAY,WAAWrB,IAAU,MAAM,OAAA;AAAA,MACnD,GAAI,MAAM,QAAQmB,CAAS,IAAIA,IAAYA,IAAY,CAACA,CAAS,IAAI,CAAA;AAAA,IAAC;AAGxE,WACE,gBAAAG;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,KAAAT;AAAA,QACA,WAAS;AAAA,QACT,WAAWL,IAAY,SAAS;AAAA,QAChC,MAAMR,IAAc,gBAAgBW;AAAA,QACpC,SAAS,gBAAAY,EAAA,CAACC,GAAOC,MAAW;AAC1B,UAAIA,MAAW,oBAIflB,KAAA,QAAAA,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