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

68 lines (67 loc) 2.83 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__, { default: ()=>CheckboxWidget }); const jsx_runtime_namespaceObject = require("react/jsx-runtime"); const FormStateContext_js_namespaceObject = require("../../context/FormStateContext.js"); const Switch_js_namespaceObject = require("../radix/Switch.js"); const CheckboxWidget_CheckboxWidget = ({ options, onChange, value, disabled, ...props })=>{ const { setFieldDirty } = (0, FormStateContext_js_namespaceObject.useFormState)(); return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", { className: "relative flex items-start py-1", children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", { className: "flex h-5 items-center", children: [ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("input", { id: props.name, value: value ? "on" : "off", name: props.name, className: "absolute inset-0 -z-10 h-full w-full opacity-0", readOnly: true }), /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Switch_js_namespaceObject.SwitchRoot, { id: props.name, checked: value, onCheckedChange: (value)=>{ setFieldDirty(props.name); onChange(value); }, disabled: disabled, children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Switch_js_namespaceObject.SwitchThumb, {}) }) ] }) }); }; const CheckboxWidget = CheckboxWidget_CheckboxWidget; exports["default"] = __webpack_exports__["default"]; for(var __webpack_i__ in __webpack_exports__)if (-1 === [ "default" ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__]; Object.defineProperty(exports, '__esModule', { value: true });