UNPKG

@premieroctet/next-admin

Version:

Next-Admin provides a customizable and turnkey admin dashboard for applications built with Next.js and powered by the Prisma ORM. It aims to simplify the development process by providing a turnkey admin system that can be easily integrated into your proje

60 lines (59 loc) 2.18 kB
"use strict"; var __webpack_require__ = {}; (()=>{ __webpack_require__.d = (exports1, definition)=>{ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, { enumerable: true, get: definition[key] }); }; })(); (()=>{ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop); })(); (()=>{ __webpack_require__.r = (exports1)=>{ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, { value: 'Module' }); Object.defineProperty(exports1, '__esModule', { value: true }); }; })(); var __webpack_exports__ = {}; __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, { getClientActionsComponents: ()=>getClientActionsComponents, getCustomInputs: ()=>getCustomInputs }); const getCustomInputs = (model, options)=>{ const editFields = options?.model?.[model]?.edit?.fields; const customFields = options?.model?.[model]?.edit?.customFields; const inputs = { ...editFields, ...customFields }; return Object.keys(inputs ?? {}).reduce((acc, field)=>{ const input = inputs?.[field]?.input; if (input) acc[field] = input; return acc; }, {}); }; const getClientActionsComponents = (model, options)=>{ const modelClientActions = options?.model?.[model]?.actions?.filter((action)=>"dialog" === action.type); return modelClientActions?.reduce((acc, val)=>{ const component = val.component; if (component) acc[val.id] = component; return acc; }, {}); }; exports.getClientActionsComponents = __webpack_exports__.getClientActionsComponents; exports.getCustomInputs = __webpack_exports__.getCustomInputs; for(var __webpack_i__ in __webpack_exports__)if (-1 === [ "getClientActionsComponents", "getCustomInputs" ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__]; Object.defineProperty(exports, '__esModule', { value: true });