@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
133 lines (132 loc) • 6.66 kB
JavaScript
;
var __webpack_require__ = {};
(()=>{
__webpack_require__.n = (module)=>{
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
__webpack_require__.d(getter, {
a: getter
});
return getter;
};
})();
(()=>{
__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: ()=>AdvancedSearchTreeItem
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
const outline_namespaceObject = require("@heroicons/react/24/outline");
const external_dnd_kit_sortable_tree_namespaceObject = require("dnd-kit-sortable-tree");
const external_react_namespaceObject = require("react");
const Button_js_namespaceObject = require("../radix/Button.js");
var Button_js_default = /*#__PURE__*/ __webpack_require__.n(Button_js_namespaceObject);
const external_AdvancedSearchContext_js_namespaceObject = require("./AdvancedSearchContext.js");
const external_AdvancedSearchDropdown_js_namespaceObject = require("./AdvancedSearchDropdown.js");
var external_AdvancedSearchDropdown_js_default = /*#__PURE__*/ __webpack_require__.n(external_AdvancedSearchDropdown_js_namespaceObject);
const external_AdvancedSearchFieldCondition_js_namespaceObject = require("./AdvancedSearchFieldCondition.js");
var external_AdvancedSearchFieldCondition_js_default = /*#__PURE__*/ __webpack_require__.n(external_AdvancedSearchFieldCondition_js_namespaceObject);
const external_AdvancedSearchInput_js_namespaceObject = require("./AdvancedSearchInput.js");
var external_AdvancedSearchInput_js_default = /*#__PURE__*/ __webpack_require__.n(external_AdvancedSearchInput_js_namespaceObject);
const AdvancedSearchTree = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((props, ref)=>{
const { updateUiBlock, removeUiBlock, resource, schema } = (0, external_AdvancedSearchContext_js_namespaceObject.useAdvancedSearchContext)();
const onSwitchBranchType = (evt)=>{
evt.stopPropagation();
updateUiBlock({
...props.item,
type: "and" === props.item.type ? "or" : "and"
});
};
const onRemove = (evt)=>{
evt.stopPropagation();
removeUiBlock(props.item.internalPath);
};
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_dnd_kit_sortable_tree_namespaceObject.SimpleTreeItemWrapper, {
...props,
showDragHandle: false,
hideCollapseButton: true,
ref: ref,
disableCollapseOnItemClick: true,
className: "flex max-w-full flex-col",
contentClassName: "max-w-full text-nextadmin-content-default dark:text-dark-nextadmin-content-default bg-nextadmin-background-muted dark:bg-dark-nextadmin-background-emphasis relative flex cursor-default gap-2 rounded-md !px-3 !py-1 text-sm !border-none",
children: [
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
className: "flex max-w-full flex-1 items-center gap-2",
children: [
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
...props.handleProps,
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(outline_namespaceObject.Bars2Icon, {
className: "h-4 w-4 cursor-grab"
})
}),
"filter" === props.item.type && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_AdvancedSearchDropdown_js_default(), {
trigger: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Button_js_default(), {
variant: "ghost",
size: "sm",
className: "block max-w-[100px] overflow-x-hidden truncate text-left md:max-w-[200px]",
title: props.item.displayPath,
children: props.item.displayPath
}),
resource: resource,
schema: schema,
showBranching: false,
onAddBlock: (uiBlock)=>{
updateUiBlock({
...uiBlock,
internalPath: props.item.internalPath
});
}
}),
"filter" !== props.item.type && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Button_js_default(), {
variant: "ghost",
size: "sm",
onClick: onSwitchBranchType,
children: "and" === props.item.type ? "AND" : "OR"
}),
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_AdvancedSearchFieldCondition_js_default(), {
uiBlock: props.item
}),
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_AdvancedSearchInput_js_default(), {
uiBlock: props.item
})
]
}),
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Button_js_default(), {
variant: "ghost",
size: "sm",
onClick: onRemove,
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(outline_namespaceObject.XMarkIcon, {
className: "h-4 w-4"
})
})
]
});
});
const AdvancedSearchTreeItem = AdvancedSearchTree;
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
});