import { createVNode } from 'vue';
import '../../../utils/index.mjs';
import ResizeObserver from '../../vc-resize-observer/src/index.mjs';
import { classNames } from '../../../utils/dom/class.mjs';

const Filter = ({
  height,
  offset,
  prefixCls,
  onInnerResize
}, {
  slots
}) => {
  let outerStyle = {};
  let innerStyle = {
    display: "flex",
    flexDirection: "column"
  };
  if (offset !== void 0) {
    outerStyle = {
      height: `${height}px`,
      position: "relative",
      overflow: "hidden"
    };
    innerStyle = {
      ...innerStyle,
      transform: `translateY(${offset}px)`,
      position: "absolute",
      left: 0,
      right: 0,
      top: 0
    };
  }
  return createVNode("div", {
    "style": outerStyle
  }, [createVNode(ResizeObserver, {
    "onResize": ({
      offsetHeight
    }) => {
      if (offsetHeight && onInnerResize)
        onInnerResize();
    }
  }, {
    default: () => {
      var _a;
      return [createVNode("div", {
        "style": innerStyle,
        "class": classNames({
          [`${prefixCls}-holder-inner`]: prefixCls
        })
      }, [(_a = slots.default) == null ? void 0 : _a.call(slots)])];
    }
  })]);
};
Filter.displayName = "Filter";
Filter.inheritAttrs = false;
Filter.props = {
  prefixCls: String,
  /** Virtual filler height. Should be `count * itemMinHeight` */
  height: Number,
  /** Set offset of visible items. Should be the top of start item position */
  offset: Number,
  onInnerResize: Function
};

export { Filter as default };
//# sourceMappingURL=Filler.mjs.map
