Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/beximco/mrp_process/node_modules/sweetalert2-react-content/dist/ drwxr-xr-x | |
| Viewing file: Select action/file-type: // sweetalert2-react-content v5.0.4
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react'), require('react-dom/client')) :
typeof define === 'function' && define.amd ? define(['react', 'react-dom/client'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.sweetalert2ReactContent = factory(global.React, global.ReactDOM));
})(this, (function (React, client) { 'use strict';
const mounts = [{
key: 'title',
getter: swal => swal.getTitle()
}, {
key: 'html',
getter: swal => swal.getHtmlContainer()
}, {
key: 'confirmButtonText',
getter: swal => swal.getConfirmButton()
}, {
key: 'denyButtonText',
getter: swal => swal.getDenyButton()
}, {
key: 'cancelButtonText',
getter: swal => swal.getCancelButton()
}, {
key: 'footer',
getter: swal => swal.getFooter()
}, {
key: 'closeButtonHtml',
getter: swal => swal.getCloseButton()
}, {
key: 'iconHtml',
getter: swal => swal.getIconContent()
}, {
key: 'loaderHtml',
getter: swal => swal.getLoader()
}];
const noop = () => {}; // eslint-disable-line @typescript-eslint/no-empty-function
function withReactContent(ParentSwal) {
/* Returns `params` separated into a tuple of `reactParams` (the React params that need to be rendered)
and`otherParams` (all the other parameters, with any React params replaced with a space ' ') */
function extractReactParams(params) {
const reactParams = {};
const otherParams = {};
const mountKeys = mounts.map(mount => mount.key);
Object.entries(params).forEach(_ref => {
let [key, value] = _ref;
if (mountKeys.includes(key) && /*#__PURE__*/React.isValidElement(value)) {
reactParams[key] = value;
otherParams[key] = ' ';
} else {
otherParams[key] = value;
}
});
return [reactParams, otherParams];
}
function render(swal, reactParams) {
Object.entries(reactParams).forEach(_ref2 => {
let [key, value] = _ref2;
const mount = mounts.find(mount => mount.key === key);
const domElement = mount.getter(ParentSwal);
const root = client.createRoot(domElement);
root.render(value);
swal.__roots.push(root);
});
}
function unrender(swal) {
swal.__roots.forEach(root => {
root.unmount();
});
swal.__roots = [];
}
return class extends ParentSwal {
static argsToParams(args) {
if ( /*#__PURE__*/React.isValidElement(args[0]) || /*#__PURE__*/React.isValidElement(args[1])) {
const params = {};
['title', 'html', 'icon'].forEach((name, index) => {
if (args[index] !== undefined) {
params[name] = args[index];
}
});
return params;
} else {
return ParentSwal.argsToParams(args);
}
}
_main(params, mixinParams) {
this.__roots = [];
this.__params = Object.assign({}, mixinParams, params);
const [reactParams, otherParams] = extractReactParams(this.__params);
const superWillOpen = otherParams.willOpen || noop;
const superDidOpen = otherParams.didOpen || noop;
const superDidDestroy = otherParams.didDestroy || noop;
return super._main(Object.assign({}, otherParams, {
willOpen: popup => {
render(this, reactParams);
superWillOpen(popup);
},
didOpen: popup => {
// read more about why this setTimeout is needed here:
// https://github.com/reactwg/react-18/discussions/5 (What about the render callback?)
setTimeout(() => {
superDidOpen(popup);
});
},
didDestroy: popup => {
superDidDestroy(popup);
unrender(this);
}
}));
}
update(params) {
Object.assign(this.__params, params);
unrender(this);
const [reactParams, otherParams] = extractReactParams(this.__params);
super.update(otherParams);
render(this, reactParams);
}
};
}
return withReactContent;
}));
//# sourceMappingURL=sweetalert2-react-content.umd.js.map
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0057 ]-- |