@rolster/react-components 18.17.2 → 18.17.3
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/cjs/index.js +8 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/index.js +8 -6
- package/dist/es/index.js.map +1 -1
- package/dist/esm/components/organisms/Confirmation/Confirmation.d.ts +11 -7
- package/dist/esm/components/organisms/Confirmation/Confirmation.js +8 -6
- package/dist/esm/components/organisms/Confirmation/Confirmation.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -1994,28 +1994,30 @@ function useConfirmationService() {
|
|
|
1994
1994
|
const [config, setConfig] = require$$0.useState({});
|
|
1995
1995
|
const [visible, setVisible] = require$$0.useState(false);
|
|
1996
1996
|
const rlsConfirmation = ReactDOM.createPortal(jsxRuntimeExports.jsx(RlsConfirmation, { ...config, visible: visible }), document.body);
|
|
1997
|
-
function confirmation(
|
|
1997
|
+
function confirmation(options) {
|
|
1998
1998
|
return new Promise((resolve) => {
|
|
1999
|
-
const { content, rlsTheme, subtitle, title, approved, reject } =
|
|
1999
|
+
const { content, rlsTheme, subtitle, title, approved, reject } = options;
|
|
2000
2000
|
setConfig({
|
|
2001
2001
|
content,
|
|
2002
2002
|
rlsTheme,
|
|
2003
2003
|
subtitle,
|
|
2004
2004
|
title,
|
|
2005
2005
|
approved: {
|
|
2006
|
-
label: approved
|
|
2006
|
+
label: approved?.label ?? reactI18n('confirmationActionApproved'),
|
|
2007
2007
|
onClick: () => {
|
|
2008
2008
|
setVisible(false);
|
|
2009
2009
|
resolve(ConfirmationResult.approved());
|
|
2010
|
-
}
|
|
2010
|
+
},
|
|
2011
|
+
identifier: approved?.identifier
|
|
2011
2012
|
},
|
|
2012
2013
|
reject: reject
|
|
2013
2014
|
? {
|
|
2014
|
-
label: reject,
|
|
2015
|
+
label: reject.label,
|
|
2015
2016
|
onClick: () => {
|
|
2016
2017
|
setVisible(false);
|
|
2017
2018
|
resolve(ConfirmationResult.reject());
|
|
2018
|
-
}
|
|
2019
|
+
},
|
|
2020
|
+
identifier: reject.identifier
|
|
2019
2021
|
}
|
|
2020
2022
|
: undefined
|
|
2021
2023
|
});
|