text: "use strict";
  var __assign = (this && this.__assign) || function () {
      __assign = Object.assign || function(t) {
          for (var s, i = 1, n = arguments.length; i < n; i++) {
              s = arguments[i];
              for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                  t[p] = s[p];
          }
          return t;
      };
      return __assign.apply(this, arguments);
  };
  var __rest = (this && this.__rest) || function (s, e) {
      var t = {};
      for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
          t[p] = s[p];
      if (s != null && typeof Object.getOwnPropertySymbols === "function")
          for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
              if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                  t[p[i]] = s[p[i]];
          }
      return t;
  };
  var __importStar = (this && this.__importStar) || function (mod) {
      if (mod && mod.__esModule) return mod;
      var result = {};
      if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
      result["default"] = mod;
      return result;
  };
  var __importDefault = (this && this.__importDefault) || function (mod) {
      return (mod && mod.__esModule) ? mod : { "default": mod };
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  var prop_types_1 = require("prop-types");
  var react_1 = __importStar(require("react"));
  var convertListToArray_1 = __importDefault(require("../___utils/convertListToArray"));
  var isType_1 = require("../___utils/isType");
  var DefaultBlank_1 = __importDefault(require("./DefaultBlank"));
  var ScrollRenderer_1 = __importDefault(require("./ScrollRenderer"));
  var uiFunctions_1 = require("./uiFunctions");
  var PlainList = function (props) {
      var list = props.list, renderItem = props.renderItem, renderWhenEmpty = props.renderWhenEmpty, renderOnScroll = props.renderOnScroll, wrapperHtmlTag = props.wrapperHtmlTag, __forwarededRef = props.__forwarededRef, tagProps = __rest(props, ["list", "renderItem", "renderWhenEmpty", "renderOnScroll", "wrapperHtmlTag", "__forwarededRef"]);
      var dataList = convertListToArray_1.default(list);
      if (dataList.length === 0) {
          return uiFunctions_1.renderBlank(renderWhenEmpty);
      }
      var WrapperElement = "" + (isType_1.isString(wrapperHtmlTag) && wrapperHtmlTag ? wrapperHtmlTag : '');
      var content = (react_1.default.createElement(react_1.default.Fragment, null, renderOnScroll
          ? react_1.default.createElement(ScrollRenderer_1.default, { list: dataList, renderItem: renderItem })
          : dataList.map(uiFunctions_1.handleRenderItem(renderItem))));
      return (react_1.default.createElement(react_1.default.Fragment, null, WrapperElement
          // @ts-ignore
          ? react_1.default.createElement(WrapperElement, __assign({}, tagProps, { ref: __forwarededRef }), content)
          : content));
  };
  PlainList.propTypes = {
      /**
       * a list of anything to be displayed
       */
      list: prop_types_1.oneOfType([prop_types_1.array, prop_types_1.object]).isRequired,
      /**
       * a jsx element or a function that it is called for every item on the list and returns a jsx element
       */
      renderItem: prop_types_1.oneOfType([prop_types_1.func, prop_types_1.node]).isRequired,
      /**
       * the function that gets called when the list is empty or was filtered to the point it became empty
       */
      renderWhenEmpty: prop_types_1.func,
      /**
       * a optional html tag to use to wrap the list items
       */
      wrapperHtmlTag: prop_types_1.string,
      // eslint-disable-next-line react/forbid-prop-types
      __forwarededRef: prop_types_1.object,
      renderOnScroll: prop_types_1.bool
  };
  PlainList.defaultProps = {
      wrapperHtmlTag: '',
      renderWhenEmpty: DefaultBlank_1.default,
      renderOnScroll: false,
      __forwarededRef: { current: null }
  };
  exports.default = react_1.forwardRef(function (props, ref) { return (react_1.default.createElement(PlainList, __assign({ __forwarededRef: ref }, props))); });
  //# sourceMappingURL=PlainList.js.map