wix-style-react
Version:
wix-style-react
100 lines (87 loc) • 4.1 kB
JavaScript
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
import React from 'react';
import { TableToolbar, ItemGroup, Item, Label, Title } from 'wix-style-react/TableToolbar';
import Card from 'wix-style-react/Card';
import Search from 'wix-style-react/Search';
import Dropdown from 'wix-style-react/Dropdown';
var MainExample = function (_React$Component) {
_inherits(MainExample, _React$Component);
function MainExample() {
_classCallCheck(this, MainExample);
return _possibleConstructorReturn(this, (MainExample.__proto__ || Object.getPrototypeOf(MainExample)).apply(this, arguments));
}
_createClass(MainExample, [{
key: 'render',
value: function render() {
var collectionOptions = [{ id: 0, value: 'All Products' }, { id: 1, value: 'Towels' }, { id: 2, value: 'Slippers' }];
var filterOptions = [{ id: 0, value: 'All' }, { id: 1, value: 'Red' }, { id: 2, value: 'Cyan' }];
return React.createElement(
Card,
null,
React.createElement(
TableToolbar,
null,
React.createElement(
ItemGroup,
{ position: 'start' },
React.createElement(
Item,
null,
React.createElement(
Title,
null,
'My Table'
)
),
React.createElement(
Item,
null,
React.createElement(
Label,
null,
'Collection',
React.createElement(
'span',
{ style: { width: '150px' } },
React.createElement(Dropdown, {
options: collectionOptions,
selectedId: 0,
roundInput: true
})
)
)
),
React.createElement(
Item,
null,
React.createElement(
Label,
null,
'Filter By',
React.createElement(
'span',
{ style: { width: '86px' } },
React.createElement(Dropdown, { options: filterOptions, selectedId: 0, roundInput: true })
)
)
)
),
React.createElement(
ItemGroup,
{ position: 'end' },
React.createElement(
Item,
null,
React.createElement(Search, null)
)
)
)
);
}
}]);
return MainExample;
}(React.Component);
export { MainExample as default };