/**
 * amis-ui v6.14.0-beta.1
 * Copyright 2018-2025 fex
 */

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var tslib = require('tslib');
var amisCore = require('amis-core');
var React = require('react');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);

var __react_jsx__ = require('react');
var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
(__react_jsx__["default"] || __react_jsx__).Fragment;
var ListGroup = /** @class */ (function (_super) {
    tslib.__extends(ListGroup, _super);
    function ListGroup() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    ListGroup.prototype.render = function () {
        var _a = this.props, cx = _a.classnames, className = _a.className, expand = _a.expand, placeholder = _a.placeholder, items = _a.items, children = _a.children, itemClassName = _a.itemClassName, itemRender = _a.itemRender, getItemProps = _a.getItemProps; _a.classPrefix; var rest = tslib.__rest(_a, ["classnames", "className", "expand", "placeholder", "items", "children", "itemClassName", "itemRender", "getItemProps", "classPrefix"]);
        return (_J$X_("div", tslib.__assign({}, rest, { className: cx('ListGroup', className, expand ? 'ListGroup--expanded' : '') }),
            Array.isArray(items) && items.length ? (items.map(function (item, index) {
                var itemProps = (getItemProps === null || getItemProps === void 0 ? void 0 : getItemProps({ item: item, index: index })) || {};
                return (_J$X_("div", tslib.__assign({ key: index }, itemProps, { className: cx('ListGroup-item', itemClassName, itemProps.className) }), itemRender(item, index)));
            })) : placeholder ? (_J$X_("div", { className: cx('Placeholder ListGroup-placeholder') })) : null,
            children));
    };
    ListGroup.defaultProps = {
        itemRender: function (item) { return _J$X_(React__default["default"].Fragment, null, "".concat(item)); }
    };
    return ListGroup;
}(React__default["default"].Component));
var ListGroup$1 = amisCore.themeable(ListGroup);

exports.ListGroup = ListGroup;
exports["default"] = ListGroup$1;
