| 1 |
"use strict"; |
| 2 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 3 |
exports.Droppable = void 0; |
| 4 |
const tslib_1 = require("tslib"); |
| 5 |
const jsx_runtime_1 = require("react/jsx-runtime"); |
| 6 |
const react_1 = require("react"); |
| 7 |
const react_styles_1 = require("@patternfly/react-styles"); |
| 8 |
const drag_drop_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/DragDrop/drag-drop")); |
| 9 |
const DroppableContext_1 = require("./DroppableContext"); |
| 10 |
const Droppable = (_a) => { |
| 11 |
var { className, children, zone = 'defaultZone', droppableId = 'defaultId', hasNoWrapper = false } = _a, props = tslib_1.__rest(_a, ["className", "children", "zone", "droppableId", "hasNoWrapper"]); |
| 12 |
const childProps = Object.assign({ 'data-pf-droppable': zone, 'data-pf-droppableid': droppableId, |
| 13 |
// if has no wrapper is set, don't overwrite children className with the className prop |
| 14 |
className: hasNoWrapper && react_1.Children.count(children) === 1 |
| 15 |
? (0, react_styles_1.css)(drag_drop_1.default.droppable, className, children.props.className) |
| 16 |
: (0, react_styles_1.css)(drag_drop_1.default.droppable, className) }, props); |
| 17 |
return ((0, jsx_runtime_1.jsx)(DroppableContext_1.DroppableContext.Provider, { value: { zone, droppableId }, children: hasNoWrapper ? ((0, react_1.cloneElement)(children, childProps)) : ((0, jsx_runtime_1.jsx)("div", Object.assign({}, childProps, { children: children }))) })); |
| 18 |
}; |
| 19 |
exports.Droppable = Droppable; |
| 20 |
exports.Droppable.displayName = 'Droppable'; |
| 21 |
//# sourceMappingURL=Droppable.js.map |