Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
renderedEl = _renderItem.renderedEl;
if (filter && filter.trim() && !_this4.matchFilter(renderedText, item)) {
return null;
}
// all show items
totalDataSource.push(item);
if (!item.disabled) {
filteredDataSource.push(item);
}
var checked = checkedKeys.indexOf(item.key) >= 0;
return _react2["default"].createElement(
_reactBeautifulDnd.Draggable,
{ key: item.key, index: index, draggableId: '' + item.key, isDragDisabled: draggable ? item.disabled : !draggable },
function (provided, snapshot) {
return _react2["default"].createElement(
'div',
_extends({
ref: provided.innerRef
}, provided.draggableProps, provided.dragHandleProps, {
// onClick={(event) =>this.handleDrag(event, provided, snapshot, item)}
onKeyDown: function onKeyDown(event) {
return _this4.onKeyDown(event, provided, snapshot, item);
}
// className={classnames({
// ...getClass(this.props,snapshot.isDragging).drag
// })}
, style: _extends({}, provided.draggableProps.style) }),
_react2["default"].createElement(_item2["default"]
exports.default = function (_ref) {
var children = _ref.children,
id = _ref.id,
onClick = _ref.onClick,
props = _objectWithoutProperties(_ref, ['children', 'id', 'onClick']);
return _react2.default.createElement(
_reactBeautifulDnd.Draggable,
{ draggableId: id },
function (provided, snapshot) {
var onClickNew = onClick ? function () {
// dragHandleProps might be null
if (!provided.dragHandleProps) {
return onClick;
}
return function (event) {
provided.dragHandleProps.onClick(event);
onClick(event);
};
}() : provided.dragHandleProps.onClickDrag;
return _react2.default.createElement(
'div',
null,
_react2.default.createElement(
rightDataSource = _state3.rightDataSource,
droppableId = _state3.droppableId;
// const { leftDataSource, rightDataSource } = this.splitDataSource(this.props);
var leftActive = targetSelectedKeys.length > 0;
var rightActive = sourceSelectedKeys.length > 0;
var cls = (0, _classnames2["default"])(className, prefixCls);
var titles = this.getTitles();
return _react2["default"].createElement(
'div',
{ className: cls },
_react2["default"].createElement(
_reactBeautifulDnd.DragDropContext,
{ onDragEnd: this.onDragEnd, onDragStart: this.onDragStart },
_react2["default"].createElement(_list2["default"], {
titleText: titles[0] //ๅทฆไพงๆ ้ข
, dataSource: leftDataSource //ๅทฆไพงๆฐๆฎๆบ
, filter: leftFilter //ๆ็ดขๆกไธญ่พๅ
ฅ็ๅ
ๅฎน
, filterOption: filterOption //ๆ็ดข่ฟๆปคๆนๆณ ๅๆฐ(inputValue, option)
, style: listStyle //่ชๅฎไน็columns็ๆ ทๅผ่กจ
, checkedKeys: sourceSelectedKeys //ๅทฆไพงๅทฒๅพ้็item็keys
, handleFilter: this.handleLeftFilter //ๅทฆไพงๆ็ดขๆกๅผๆดๆนไบไปถ
, handleClear: this.handleLeftClear //ๆธ
็ฉบๅทฆไพงๆ็ดขๆกๅ
ๅฎน
, handleSelect: this.handleLeftSelect //็นๅปๅทฆไพงๅ่กจไธญ็item๏ผๆนๅ้ไธญๆๅๆถ้ไธญ็ถๆ
, handleSelectAll: this.handleLeftSelectAll //็นๅปๅทฆไพงๅ
จ้
, render: render,
showSearch: showSearch //ๆฏๅฆๆพ็คบๆ็ดขๆก
, searchPlaceholder: searchPlaceholder //ๆ็ดขๆกplaceholder
, notFoundContent: notFoundContent //ๅฝๆฒกๆ็ธๅ
ณๅ
ๅฎน็ๆพ็คบๅ
ๅฎน
data.map(function (item, index) {
return _react2.default.createElement(
_reactBeautifulDnd.Draggable,
{ key: item.id, draggableId: item.id, type: listType },
function (dragProvided, dragSnapshot) {
return _react2.default.createElement(
'div',
null,
_react2.default.createElement(_Item2.default, {
key: item.id,
index: index,
item: item,
isDragging: dragSnapshot.isDragging,
provided: dragProvided,
autoFocus: _this.props.autoFocusId === item.id,
selected: selectedId && selectedId === item.id,
onClick: function onClick() {
return onClickItem(item, index);
},
_this2.state.items.map(function (item, index) {
return _react2["default"].createElement(
_reactBeautifulDnd.Draggable,
{
key: '1' + index,
draggableId: '1' + index,
index: index },
function (provided, snapshot) {
return _react2["default"].createElement(
'div',
_extends({
ref: provided.innerRef
}, provided.draggableProps, provided.dragHandleProps, {
className: (0, _classnames2["default"])(_extends({}, (0, _util.getClass)(_this2.props, snapshot.isDragging).drag)),
style: _extends({}, provided.draggableProps.style) }),
showKey ? item[showKey] : item
);
}
);
_this2.state.selected.map(function (item, index) {
return _react2["default"].createElement(
_reactBeautifulDnd.Draggable,
{
key: '2' + index,
draggableId: '2' + index,
index: index },
function (provided, snapshot) {
return _react2["default"].createElement(
'div',
_extends({
ref: provided.innerRef
}, provided.draggableProps, provided.dragHandleProps, {
className: (0, _classnames2["default"])(_extends({}, (0, _util.getClass)(_this2.props, snapshot.isDragging).drag)),
style: _extends({}, provided.draggableProps.style) }),
showKey ? item[showKey] : item
);
}
);
_this2.state.items.map(function (item, index) {
return _react2["default"].createElement(
_reactBeautifulDnd.Draggable,
{ key: index, draggableId: '' + index, index: index },
function (provided, snapshot) {
return _react2["default"].createElement(
'div',
_extends({
ref: provided.innerRef
}, provided.draggableProps, provided.dragHandleProps, {
className: (0, _classnames2["default"])(_extends({}, (0, _util.getClass)(_this2.props, snapshot.isDragging).drag)),
style: _extends({}, provided.draggableProps.style)
}),
showKey ? item[showKey] : item
);
}
);
}),
provided.placeholder
defaultClassNameDragged: this.props.draggedClass
}, this.props),
self.props.children
)
);
};
return Dnd;
}(_react.Component);
Dnd.propTypes = propTypes;
Dnd.defaultProps = defaultProps;
Dnd.Drag = _reactDraggable2["default"];
Dnd.DragDropContext = _reactBeautifulDnd.DragDropContext;
Dnd.Droppable = _reactBeautifulDnd.Droppable;
Dnd.Draggable = _reactBeautifulDnd.Draggable;
Dnd.GridLayout = _GridLayout2["default"];
exports["default"] = Dnd;
module.exports = exports['default'];
const DND = require('react-beautiful-dnd');
exports.dragDropContextClass = DND.DragDropContext;
exports.draggableClass = DND.Draggable;
exports.droppableClass = DND.Droppable;
onDrag = _props.onDrag,
onStop = _props.onStop,
onDragUpdate = _props.onDragUpdate,
dropClass = _props.dropClass,
dropOverClass = _props.dropOverClass,
dragClass = _props.dragClass,
dragingClass = _props.dragingClass,
showKey = _props.showKey,
type = _props.type;
return _react2["default"].createElement(
_reactBeautifulDnd.DragDropContext,
{ onDragEnd: this.onDragEnd, onDragStart: this.onDragStart, onDragUpdate: onDragUpdate },
_react2["default"].createElement(
_reactBeautifulDnd.Droppable,
{ droppableId: 'droppable', direction: type },
function (provided, snapshot) {
return _react2["default"].createElement(
'div',
{
ref: provided.innerRef,
className: (0, _classnames2["default"])(_extends({}, (0, _util.getClass)(_this2.props, snapshot.isDraggingOver).drop))
},
_this2.state.items.map(function (item, index) {
return _react2["default"].createElement(
_reactBeautifulDnd.Draggable,
{ key: index, draggableId: '' + index, index: index },
function (provided, snapshot) {
return _react2["default"].createElement(
'div',
_extends({