@ventum-digital/widget-helper
Version:
Helper functions for SailPoint IdentityIQ widgets
70 lines (68 loc) • 2.81 kB
JavaScript
/******/ // The require scope
/******/ var __webpack_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
/*!************************!*\
!*** ./build/index.js ***!
\************************/
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ registerWidget: () => (/* binding */ registerWidget)
/* harmony export */ });
// noinspection JSUnusedGlobalSymbols
/**
* Registers a widget with a given name and widget function to be used within the application.
*
* @param {string} name - The name of the widget to register. Use the name used in the Widgets XML file.
* @param {WidgetFunction} widgetFunction - The function that creates the widgets body. This function is called when the widget is created.
* @return {void} - This method does not return any value.
*/
function registerWidget(name, widgetFunction) {
let capitalizedName = name.charAt(0).toUpperCase() + name.slice(1);
let widgetName = `sp${capitalizedName}Widget`;
// @ts-ignore
PluginHelper.addWidgetFunction(() => {
// @ts-ignore
angular.module('sailpoint.home.desktop.app')
.directive(widgetName, () => {
return {
restrict: 'E',
scope: {},
link: widgetFunction
};
});
});
}
const __webpack_exports__registerWidget = __webpack_exports__.registerWidget;
export { __webpack_exports__registerWidget as registerWidget };
//# sourceMappingURL=index.js.map