@wix/design-system
Version:
@wix/design-system
106 lines (105 loc) • 3.86 kB
JavaScript
var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
var _createClass = require("@babel/runtime/helpers/createClass");
var _possibleConstructorReturn = require("@babel/runtime/helpers/possibleConstructorReturn");
var _getPrototypeOf = require("@babel/runtime/helpers/getPrototypeOf");
var _inherits = require("@babel/runtime/helpers/inherits");
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/TimeTable/docs/examples/multipleActions.jsx";
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
/* eslint-disable */
var TimeTableExample = /*#__PURE__*/function (_React$Component) {
"use strict";
function TimeTableExample() {
var _this;
_classCallCheck(this, TimeTableExample);
for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
_args[_key] = arguments[_key];
}
_this = _callSuper(this, TimeTableExample, [].concat(_args));
_this.state = {
columns: [{
title: '1',
subtitle: 'Group',
actions: [{
label: 'Action 1',
prefixIcon: /*#__PURE__*/React.createElement(Icons.Duplicate, {
__self: _this,
__source: {
fileName: _jsxFileName,
lineNumber: 12,
columnNumber: 25
}
}),
onClick: function onClick() {
var _console;
(_console = console).info.apply(_console, arguments);
}
}, {
label: 'Action 2',
prefixIcon: /*#__PURE__*/React.createElement(Icons.Download, {
__self: _this,
__source: {
fileName: _jsxFileName,
lineNumber: 19,
columnNumber: 25
}
}),
onClick: function onClick() {
var _console2;
(_console2 = console).info.apply(_console2, arguments);
}
}, {
label: 'Action 3',
onClick: function onClick() {
var _console3;
(_console3 = console).info.apply(_console3, arguments);
}
}, {
label: 'Action 4 with very long label. Action 4 with very long label. Action 4 with very long label.',
onClick: function onClick() {
var _console4;
(_console4 = console).info.apply(_console4, arguments);
}
}],
items: [{
content: 'Item 1'
}]
}, {
title: '2',
subtitle: 'Group',
items: [{
content: 'Item 2'
}, {
content: 'Item 3'
}],
active: true
}]
};
_this.handleOnChange = function (columns, _ref) {
var addedToColumnIndex = _ref.addedToColumnIndex,
removedFromColumnIndex = _ref.removedFromColumnIndex,
addedItemIndex = _ref.addedItemIndex,
removedItemIndex = _ref.removedItemIndex;
_this.setState({
columns: columns
});
};
return _this;
}
_inherits(TimeTableExample, _React$Component);
return _createClass(TimeTableExample, [{
key: "render",
value: function render() {
return /*#__PURE__*/React.createElement(TimeTable, {
columns: this.state.columns,
onChange: this.handleOnChange,
__self: this,
__source: {
fileName: _jsxFileName,
lineNumber: 63,
columnNumber: 7
}
});
}
}]);
}(React.Component);