rmwc
Version:
A thin React wrapper for Material Design (Web) Components
91 lines (67 loc) • 4.88 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ImageListLabel = exports.ImageListSupporting = exports.ImageListImage = exports.ImageListImageAspectContainer = exports.ImageListItem = exports.ImageList = undefined;
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; }; }();
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
var _react = require('react');
var React = _interopRequireWildcard(_react);
var _Base = require('../Base');
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
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; }
// eslint-disable-next-line no-unused-vars
/** Indicates the root Image List element. */
var ImageList = exports.ImageList = function (_simpleTag) {
_inherits(ImageList, _simpleTag);
function ImageList() {
_classCallCheck(this, ImageList);
return _possibleConstructorReturn(this, (ImageList.__proto__ || Object.getPrototypeOf(ImageList)).apply(this, arguments));
}
_createClass(ImageList, [{
key: 'render',
value: function render() {
return _get(ImageList.prototype.__proto__ || Object.getPrototypeOf(ImageList.prototype), 'render', this).call(this);
}
}]);
return ImageList;
}((0, _Base.simpleTag)({
displayName: 'ImageList',
tag: 'ul',
classNames: function classNames(props) {
return ['mdc-image-list', {
'mdc-image-list--masonry': props.masonry,
'mdc-image-list--with-text-protection': props.withTextProtection
}];
},
consumeProps: ['masonry', 'withTextProtection']
}));
/** Indicates each item in an Image List. */
var ImageListItem = exports.ImageListItem = (0, _Base.simpleTag)({
displayName: 'ImageListItem',
tag: 'li',
classNames: 'mdc-image-list__item'
});
/** Optional. Parent of each item’s image element, responsible for constraining aspect ratio. This element may be omitted entirely if images are already sized to the correct aspect ratio. */
var ImageListImageAspectContainer = exports.ImageListImageAspectContainer = (0, _Base.simpleTag)({
displayName: 'ImageListImageAspectContainer',
classNames: 'mdc-image-list__image-aspect-container'
});
/** Indicates the image element in each item. */
var ImageListImage = exports.ImageListImage = (0, _Base.simpleTag)({
displayName: 'ImageListImage',
tag: 'img',
classNames: 'mdc-image-list__image'
});
/** Optional. Indicates the area within each item containing the supporting text label, if the Image List contains text labels. */
var ImageListSupporting = exports.ImageListSupporting = (0, _Base.simpleTag)({
displayName: 'ImageListSupporting',
classNames: 'mdc-image-list__supporting'
});
/** Optional. Indicates the text label in each item, if the Image List contains text labels. */
var ImageListLabel = exports.ImageListLabel = (0, _Base.simpleTag)({
displayName: 'ImageListLabel',
classNames: 'mdc-image-list__label'
});
;