UNPKG

fomantic-ui-react

Version:

Fomantic-UI React -- A React Component Library.

101 lines (83 loc) 3.24 kB
/** * fomantic-ui-react v0.0.1-alpha.10 * (c) 2022 FireLoong <fireloong@foxmail.com> * @license MIT */ import { _ as _defineProperty, a as _objectWithoutProperties } from '../_chunks/dep-9f1126c1.js'; import React from 'react'; import ListItem from './ListItem.js'; import ListContent from './ListContent.js'; import ListHeader from './ListHeader.js'; import ListDescription from './ListDescription.js'; import ListIcon from './ListIcon.js'; import ListList from './ListList.js'; import '../icon/index.js'; import '../icon/Icon.js'; import './style/css.js'; import '../icon/type.js'; var _excluded = ["as", "className", "items", "relaxed", "divided", "bulleted", "horizontal", "ordered", "suffixed", "link", "content", "children"]; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } var List = function List(_ref) { var _ref$as = _ref.as, as = _ref$as === void 0 ? "div" : _ref$as, className = _ref.className, items = _ref.items, relaxed = _ref.relaxed, divided = _ref.divided, bulleted = _ref.bulleted, horizontal = _ref.horizontal, ordered = _ref.ordered, suffixed = _ref.suffixed, link = _ref.link, content = _ref.content, children = _ref.children, props = _objectWithoutProperties(_ref, _excluded); var classNames = ["ui", "list"]; if (relaxed) { classNames.push("relaxed"); } if (divided) { classNames.push("divided"); } if (bulleted) { classNames.push("bulleted"); } if (horizontal) { classNames.push("horizontal"); } if (ordered) { classNames.push("ordered"); } if (suffixed) { classNames.push("suffixed"); } if (link) { classNames.push("link"); } if (className) { classNames.push(className); } if (items) { return /*#__PURE__*/React.createElement(as, _objectSpread({ className: classNames.join(" ") }, props), items.map(function (item, index) { return /* @__PURE__ */React.createElement(ListItem, { key: index }, item); })); } else { return /*#__PURE__*/React.createElement(as, _objectSpread({ className: classNames.join(" ") }, props), children || content); } }; List.displayName = "List"; List.Item = ListItem; List.Content = ListContent; List.Description = ListDescription; List.Header = ListHeader; List.Icon = ListIcon; List.List = ListList; export { List as default }; //# sourceMappingURL=List.js.map