/**
 * ldesign v0.2.2
 * (c) 2022年9月20日 swimly
 * @license MIT
 */

'use strict';

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

var helper = require('../../chunks/helper.js');
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
var VueCompositionAPI = require('@vue/composition-api');
var isFunction = require('lodash/isFunction');
var debounce = require('lodash/debounce');
var lodashGet = require('lodash/get');
var cloneDeep = require('lodash/cloneDeep');
var isArray = require('lodash/isArray');
var hooks_useDefaultValue = require('../../hooks/use-default-value.js');
var hooks_useVmodel = require('../../hooks/use-vmodel.js');
var hooks_lnode = require('../../hooks/lnode.js');
var components_configProvider_useConfig = require('../config-provider/useConfig.js');
var components_select_props = require('./props.js');
var components_loading_index = require('../loading/index.js');
var components_popup_index = require('../popup/index.js');
var components_input_index = require('../input/index.js');
var components_tag_index = require('../tag/index.js');
var components_selectInput_index = require('../select-input/index.js');
var components_common_fakeArrow = require('../common/fake-arrow.js');
var components_select_option = require('./option.js');
var components_select_selectPanel = require('./select-panel.js');
var components_select_utils = require('./utils.js');
var components_select_hooks_useSelectOptions = require('./hooks/use-select-options.js');
require('lodash/isEmpty');
require('lodash/camelCase');
require('lodash/kebabCase');
require('../../hooks/render-lnode.js');
require('lodash/isString');
require('lodash/isObject');
require('../config-provider/context.js');
require('lodash');
require('../../chunks/zh_CN.js');
require('../loading/loading.js');
require('../loading/icon/gradient.js');
require('vue');
require('../../chunks/defineProperty-28395935.js');
require('../../chunks/set-style.js');
require('../../chunks/helper2.js');
require('@babel/runtime/helpers/toConsumableArray');
require('../../config.js');
require('../../utils/dom.js');
require('raf');
require('../../utils/easing.js');
require('../../utils/render-node.js');
require('@babel/runtime/helpers/typeof');
require('../../utils/transfer-dom.js');
require('../loading/props.js');
require('../config-provider/config-receiver.js');
require('lodash/mergeWith');
require('../../utils/mixins.js');
require('../../utils/with-install.js');
require('../loading/plugin.js');
require('../popup/popup.js');
require('@popperjs/core');
require('../../utils/helper.js');
require('../popup/props.js');
require('../popup/container.js');
require('../../utils/map-props.js');
require('../input/input.js');
require('@ldesign/icons-vue');
require('../../utils/event.js');
require('../input/props.js');
require('../input/group.js');
require('../tag/tag.js');
require('../tag/props.js');
require('../tag/check-tag.js');
require('../select-input/select-input.js');
require('../select-input/props.js');
require('../select-input/hooks/use-single.js');
require('lodash/pick');
require('../../hooks/use-config.js');
require('../select-input/hooks/use-multiple.js');
require('../select-input/hooks/use-overlay-innerstyle.js');
require('../../utils/ripple.js');
require('../checkbox/index.js');
require('../checkbox/group.js');
require('lodash/intersection');
require('../checkbox/checkbox.js');
require('../checkbox/props.js');
require('../../hooks/use-lazy-load.js');
require('../../chunks/observe.js');
require('../../hooks/use-common-classname.js');
require('../../hooks/use-virtual-scroll.js');

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

var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
var isFunction__default = /*#__PURE__*/_interopDefaultLegacy(isFunction);
var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce);
var lodashGet__default = /*#__PURE__*/_interopDefaultLegacy(lodashGet);
var cloneDeep__default = /*#__PURE__*/_interopDefaultLegacy(cloneDeep);
var isArray__default = /*#__PURE__*/_interopDefaultLegacy(isArray);

var _excluded = ["overlayClassName"];

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__default["default"](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 TSelect = VueCompositionAPI.defineComponent({
  name: "LSelect",
  props: _objectSpread({}, components_select_props.SelectProps),
  components: {
    TInput: components_input_index.Input,
    TLoading: components_loading_index.Loading,
    Tag: components_tag_index.Tag,
    Popup: components_popup_index.Popup,
    TOption: components_select_option["default"],
    FakeArrow: components_common_fakeArrow["default"],
    SelectPanel: components_select_selectPanel["default"]
  },
  setup: function setup(props2, context) {
    var _useConfig = components_configProvider_useConfig.useConfig("select"),
        t = _useConfig.t,
        global = _useConfig.global;

    var renderTNode = hooks_lnode.useLNodeJSX();
    var instance = VueCompositionAPI.getCurrentInstance();
    console.log(instance);
    var selectInputRef = VueCompositionAPI.ref(null);
    var selectPanelRef = VueCompositionAPI.ref();
    var popupOpenTime = VueCompositionAPI.ref(250);
    var formDisabled = VueCompositionAPI.ref();
    var COMPONENT_NAME = components_configProvider_useConfig.usePrefixClass("select");

    var _useConfig2 = components_configProvider_useConfig.useConfig("classPrefix"),
        classPrefix = _useConfig2.classPrefix;

    var _toRefs = VueCompositionAPI.toRefs(props2),
        valueType = _toRefs.valueType,
        disabled = _toRefs.disabled,
        size = _toRefs.size,
        valueProps = _toRefs.value,
        multiple = _toRefs.multiple,
        placeholder = _toRefs.placeholder,
        loading = _toRefs.loading,
        max = _toRefs.max,
        reserveKeyword = _toRefs.reserveKeyword,
        inputValue = _toRefs.inputValue,
        popupVisible = _toRefs.popupVisible,
        minCollapsedNum = _toRefs.minCollapsedNum,
        creatable = _toRefs.creatable;

    var keys = VueCompositionAPI.computed(function () {
      var _props2$keys, _props2$keys2;

      return {
        label: ((_props2$keys = props2.keys) === null || _props2$keys === void 0 ? void 0 : _props2$keys.label) || "label",
        value: ((_props2$keys2 = props2.keys) === null || _props2$keys2 === void 0 ? void 0 : _props2$keys2.value) || "value"
      };
    });

    var _useSelectOptions = components_select_hooks_useSelectOptions["default"](props2, instance, keys),
        innerOptions = _useSelectOptions.options,
        optionsMap = _useSelectOptions.optionsMap,
        optionsList = _useSelectOptions.optionsList;

    var _useVModel = hooks_useVmodel["default"](valueProps, props2.defaultValue, props2.onChange, "change"),
        _useVModel2 = _slicedToArray__default["default"](_useVModel, 2),
        value = _useVModel2[0],
        setValue = _useVModel2[1];

    var innerValue = VueCompositionAPI.computed(function () {
      if (valueType.value === "object") {
        return multiple.value ? value.value.map(function (option) {
          return option[keys.value.value];
        }) : value.value[keys.value.value];
      }

      return value.value;
    });

    var setInnerValue = function setInnerValue(newVal, e) {
      if (valueType.value === "object") {
        var _keys$value = keys.value,
            valueOfKeys = _keys$value.value,
            labelOfKeys = _keys$value.label;
        var oldValueMap = /* @__PURE__ */new Map();

        if (multiple.value) {
          value.value.forEach(function (option) {
            oldValueMap.set(option[valueOfKeys], option);
          });
        }

        var getOption = function getOption(val) {
          var _ref;

          var option = optionsMap.value.get(val) || oldValueMap.get(val);
          return _ref = {}, _defineProperty__default["default"](_ref, valueOfKeys, lodashGet__default["default"](option, valueOfKeys)), _defineProperty__default["default"](_ref, labelOfKeys, lodashGet__default["default"](option, labelOfKeys)), _ref;
        };

        newVal = multiple.value ? newVal.map(function (val) {
          return getOption(val);
        }) : getOption(newVal);
      }

      if (newVal === value.value) return;
      setValue(newVal, e);
    };

    var _useDefaultValue = hooks_useDefaultValue["default"](inputValue, props2.defaultInputValue || "", props2.onInputChange, "inputValue", "input-change"),
        _useDefaultValue2 = _slicedToArray__default["default"](_useDefaultValue, 2),
        tInputValue = _useDefaultValue2[0],
        setTInputValue = _useDefaultValue2[1];

    var _useDefaultValue3 = hooks_useDefaultValue["default"](popupVisible, false, function (visible, context2) {
      var _props2$onPopupVisibl, _props2$onVisibleChan;

      (_props2$onPopupVisibl = props2.onPopupVisibleChange) === null || _props2$onPopupVisibl === void 0 ? void 0 : _props2$onPopupVisibl.call(props2, visible, context2);
      (_props2$onVisibleChan = props2.onVisibleChange) === null || _props2$onVisibleChan === void 0 ? void 0 : _props2$onVisibleChan.call(props2, visible);
      instance.emit("visible-change", visible);
    }, "popupVisible", "popup-visible-change"),
        _useDefaultValue4 = _slicedToArray__default["default"](_useDefaultValue3, 2),
        innerPopupVisible = _useDefaultValue4[0],
        setInnerPopupVisible = _useDefaultValue4[1];

    var isDisabled = VueCompositionAPI.computed(function () {
      return formDisabled.value || disabled.value;
    });
    var isLoading = VueCompositionAPI.computed(function () {
      return loading.value && !isDisabled.value;
    });
    var isFilterable = VueCompositionAPI.computed(function () {
      return Boolean(props2.filterable || global.value.filterable || isFunction__default["default"](props2.filter));
    });
    var isReachMaxLimit = VueCompositionAPI.computed(function () {
      return multiple.value && max.value !== 0 && max.value <= innerValue.value.length;
    });
    var placeholderText = VueCompositionAPI.computed(function () {
      var _ref2;

      return (_ref2 = !multiple.value && innerPopupVisible.value && (valueType.value === "object" && value.value[keys.value.label] || components_select_utils.getSingleContent(innerValue.value, optionsList.value)) || placeholder.value) !== null && _ref2 !== void 0 ? _ref2 : t(global.value.placeholder);
    });
    var displayText = VueCompositionAPI.computed(function () {
      if (multiple.value) {
        if (valueType.value === "object") {
          return value.value.map(function (v) {
            return v[keys.value.label];
          });
        }

        return components_select_utils.getMultipleContent(innerValue.value, optionsList.value);
      }

      if (valueType.value === "object" && value.value[keys.value.label]) {
        return value.value[keys.value.label];
      }

      return components_select_utils.getSingleContent(innerValue.value, optionsList.value);
    });
    var valueDisplayParams = VueCompositionAPI.computed(function () {
      var val = multiple.value ? innerValue.value.map(function (value2) {
        var _optionsMap$value$get;

        return {
          value: value2,
          label: (_optionsMap$value$get = optionsMap.value.get(value2)) === null || _optionsMap$value$get === void 0 ? void 0 : _optionsMap$value$get.label
        };
      }) : innerValue.value;
      return {
        value: val,
        onClose: multiple.value ? function (index) {
          return removeTag(index);
        } : function () {}
      };
    });
    var collapsedItemsParams = VueCompositionAPI.computed(function () {
      return multiple.value ? {
        value: innerValue.value,
        collapsedSelectedItems: innerValue.value.slice(minCollapsedNum.value),
        count: innerValue.value.length - minCollapsedNum.value
      } : {};
    });

    var removeTag = function removeTag(index, context2) {
      var _props2$onRemove;

      var _ref3 = context2 || {},
          e = _ref3.e;

      e === null || e === void 0 ? void 0 : e.stopPropagation();

      if (isDisabled.value) {
        return;
      }

      var selectValue = cloneDeep__default["default"](innerValue.value);
      var value2 = selectValue[index];
      selectValue.splice(index, 1);
      setInnerValue(selectValue, {
        e: e,
        trigger: "tag-remove"
      });
      var evtObj = {
        value: value2,
        data: optionsMap.value.get(value2),
        e: e
      };
      instance.emit("remove", evtObj);
      (_props2$onRemove = props2.onRemove) === null || _props2$onRemove === void 0 ? void 0 : _props2$onRemove.call(props2, evtObj);
    };

    var handleCreate = function handleCreate() {
      var _props2$onCreate;

      if (!tInputValue.value) return;
      var createVal = tInputValue.value;
      setTInputValue("");
      instance.emit("create", createVal);
      (_props2$onCreate = props2.onCreate) === null || _props2$onCreate === void 0 ? void 0 : _props2$onCreate.call(props2, createVal);
    };

    var handleClear = function handleClear(_ref4) {
      var _props2$onClear;

      var e = _ref4.e;
      e === null || e === void 0 ? void 0 : e.stopPropagation();

      if (multiple.value) {
        setInnerValue([], {
          trigger: "clear",
          e: e
        });
      } else {
        setInnerValue("", {
          trigger: "clear",
          e: e
        });
      }

      instance.emit("clear", {
        e: e
      });
      (_props2$onClear = props2.onClear) === null || _props2$onClear === void 0 ? void 0 : _props2$onClear.call(props2, {
        e: e
      });
    };

    var handleTInputValueChange = function handleTInputValueChange(val, context2) {
      if (context2.trigger === "blur" || !innerPopupVisible.value) return;
      setTInputValue(val);
      debounceSearch();
    };

    var handleTagChange = function handleTagChange(currentTags, context2) {
      var trigger = context2.trigger,
          index = context2.index,
          e = context2.e;

      if (trigger === "clear") {
        setInnerValue([], {
          trigger: "tag-remove",
          e: e
        });
      }

      if (["tag-remove", "backspace"].includes(trigger)) {
        removeTag(index);
      }
    };

    var handleFocus = function handleFocus(value2, context2) {
      var _props2$onFocus;

      instance.emit("focus", {
        value: value2,
        e: context2 === null || context2 === void 0 ? void 0 : context2.e
      });
      (_props2$onFocus = props2.onFocus) === null || _props2$onFocus === void 0 ? void 0 : _props2$onFocus.call(props2, {
        value: value2,
        e: context2 === null || context2 === void 0 ? void 0 : context2.e
      });
    };

    var handleBlur = function handleBlur(value2, context2) {
      var _props2$onBlur;

      instance.emit("blur", {
        value: value2,
        e: context2 === null || context2 === void 0 ? void 0 : context2.e
      });
      (_props2$onBlur = props2.onBlur) === null || _props2$onBlur === void 0 ? void 0 : _props2$onBlur.call(props2, {
        value: value2,
        e: context2 === null || context2 === void 0 ? void 0 : context2.e
      });
    };

    var handleEnter = function handleEnter(value2, context2) {
      var _props2$onEnter;

      instance.emit("enter", {
        value: value2,
        e: context2 === null || context2 === void 0 ? void 0 : context2.e,
        inputValue: tInputValue.value
      });
      (_props2$onEnter = props2.onEnter) === null || _props2$onEnter === void 0 ? void 0 : _props2$onEnter.call(props2, {
        value: value2,
        e: context2 === null || context2 === void 0 ? void 0 : context2.e,
        inputValue: tInputValue.value.toString()
      });
      creatable.value && handleCreate();
    };

    var debounceSearch = debounce__default["default"](function () {
      var _props2$onSearch;

      instance.emit("search", tInputValue.value);
      (_props2$onSearch = props2.onSearch) === null || _props2$onSearch === void 0 ? void 0 : _props2$onSearch.call(props2, tInputValue.value.toString());
    }, 300);

    var getOverlayElm = function getOverlayElm() {
      var r;

      try {
        var popupRefs = context.refs.selectInputRef.$refs.selectInputRef.$refs;
        r = popupRefs.overlay || popupRefs.component.$refs.overlay;
      } catch (e) {
        console.warn("TDesign Warn:", e);
      }

      return r;
    };

    var updateScrollTop = function updateScrollTop(content) {
      var _props2$scroll;

      if (((_props2$scroll = props2.scroll) === null || _props2$scroll === void 0 ? void 0 : _props2$scroll.type) === "virtual") return;
      var overlayEl = getOverlayElm();
      if (!overlayEl) return;
      var firstSelectedNode = overlayEl === null || overlayEl === void 0 ? void 0 : overlayEl.querySelector(".".concat(classPrefix.value, "-is-selected"));
      VueCompositionAPI.nextTick(function () {
        if (firstSelectedNode && content) {
          var _getComputedStyle = getComputedStyle(firstSelectedNode),
              paddingBottom = _getComputedStyle.paddingBottom;

          var _getComputedStyle2 = getComputedStyle(content),
              marginBottom = _getComputedStyle2.marginBottom;

          var elementBottomHeight = parseInt(paddingBottom, 10) + parseInt(marginBottom, 10);
          var updateValue = firstSelectedNode.offsetTop - content.offsetTop - (content.clientHeight - firstSelectedNode.clientHeight) + elementBottomHeight;
          content.scrollTop = updateValue;
        }
      });
    };

    var hoverIndex = VueCompositionAPI.ref(-1);

    var keydownEvent = function keydownEvent(e) {
      var _selectPanelRef$value;

      var displayOptions = [];

      var getCurrentOptionsList = function getCurrentOptionsList(options) {
        options.forEach(function (option) {
          if (option.group) {
            getCurrentOptionsList(option.children);
          } else {
            displayOptions.push(option);
          }
        });
      };

      getCurrentOptionsList((_selectPanelRef$value = selectPanelRef.value) === null || _selectPanelRef$value === void 0 ? void 0 : _selectPanelRef$value.getDisplayOptions());
      var displayOptionsLength = displayOptions.length;

      var arrowDownOption = function arrowDownOption() {
        var count = 0;

        while (hoverIndex.value < displayOptionsLength) {
          var _displayOptions$hover;

          if (!((_displayOptions$hover = displayOptions[hoverIndex.value]) !== null && _displayOptions$hover !== void 0 && _displayOptions$hover.disabled)) {
            break;
          }

          if (hoverIndex.value === displayOptionsLength - 1) {
            hoverIndex.value = 0;
          } else {
            hoverIndex.value += 1;
          }

          count += 1;
          if (count >= displayOptionsLength) break;
        }
      };

      var arrowUpOption = function arrowUpOption() {
        var count = 0;

        while (hoverIndex.value > -1) {
          var _displayOptions$hover2;

          if (!((_displayOptions$hover2 = displayOptions[hoverIndex.value]) !== null && _displayOptions$hover2 !== void 0 && _displayOptions$hover2.disabled)) {
            break;
          }

          if (hoverIndex.value === 0) {
            hoverIndex.value = displayOptionsLength - 1;
          } else {
            hoverIndex.value -= 1;
          }

          count += 1;
          if (count >= displayOptionsLength) break;
        }
      };

      if (displayOptionsLength === 0) return;
      var preventKeys = ["ArrowDown", "ArrowUp", "Enter", "Escape", "Tab"];

      if (preventKeys.includes(e.code)) {
        e.preventDefault();
      }

      switch (e.code) {
        case "ArrowDown":
          if (hoverIndex.value === -1) {
            hoverIndex.value = 0;
            return;
          }

          if (hoverIndex.value < displayOptionsLength - 1) {
            hoverIndex.value += 1;
            arrowDownOption();
          } else {
            hoverIndex.value = 0;
            arrowDownOption();
          }

          break;

        case "ArrowUp":
          if (hoverIndex.value === -1) {
            hoverIndex.value = 0;
            return;
          }

          if (hoverIndex.value > 0) {
            hoverIndex.value -= 1;
            arrowUpOption();
          } else {
            hoverIndex.value = displayOptionsLength - 1;
            arrowUpOption();
          }

          break;

        case "Enter":
          if (hoverIndex.value === -1) return;

          if (!multiple.value) {
            setInnerValue(displayOptions[hoverIndex.value].value, {
              e: e,
              trigger: "check"
            });
            setInnerPopupVisible(false, {
              e: e
            });
          } else {
            var _displayOptions$hover3;

            if (hoverIndex.value === -1) return;
            var optionValue = (_displayOptions$hover3 = displayOptions[hoverIndex.value]) === null || _displayOptions$hover3 === void 0 ? void 0 : _displayOptions$hover3.value;
            if (!optionValue) return;
            var newValue = components_select_utils.getNewMultipleValue(innerValue.value, optionValue);
            setInnerValue(newValue.value, {
              e: e,
              trigger: newValue.isCheck ? "check" : "uncheck"
            });
          }

          break;

        case "Escape":
        case "Tab":
          setInnerPopupVisible(false, {
            trigger: "keydown-esc",
            e: e
          });
          setTInputValue("");
          break;
      }
    };

    var checkValueInvalid = function checkValueInvalid() {
      if (!multiple.value && isArray__default["default"](value.value)) {
        value.value = "";
      }

      if (multiple.value && !isArray__default["default"](value.value)) {
        value.value = [];
      }
    };

    VueCompositionAPI.watch(value, function () {
      checkValueInvalid();
    }, {
      immediate: true
    });
    VueCompositionAPI.watch(innerPopupVisible, function (val) {
      val && document.addEventListener("keydown", keydownEvent);
      !val && document.removeEventListener("keydown", keydownEvent);
    }, {
      flush: "sync"
    });
    VueCompositionAPI.watch(innerPopupVisible, function (value2) {
      if (value2) {
        hoverIndex.value = -1;
      } else {
        tInputValue.value && setTInputValue("");
      }
    });
    VueCompositionAPI.provide("tSelect", {
      size: size,
      multiple: multiple,
      popupOpenTime: popupOpenTime,
      hoverIndex: hoverIndex,
      selectValue: innerValue,
      reserveKeyword: reserveKeyword,
      isReachMaxLimit: isReachMaxLimit,
      getOverlayElm: getOverlayElm,
      handleCreate: handleCreate,
      handleValueChange: setInnerValue,
      handlerInputChange: setTInputValue,
      handlePopupVisibleChange: setInnerPopupVisible
    });
    return {
      isFilterable: isFilterable,
      isDisabled: isDisabled,
      isLoading: isLoading,
      innerOptions: innerOptions,
      placeholderText: placeholderText,
      selectInputRef: selectInputRef,
      selectPanelRef: selectPanelRef,
      innerPopupVisible: innerPopupVisible,
      displayText: displayText,
      tInputValue: tInputValue,
      collapsedItemsParams: collapsedItemsParams,
      valueDisplayParams: valueDisplayParams,
      handleFocus: handleFocus,
      handleBlur: handleBlur,
      handleEnter: handleEnter,
      handleClear: handleClear,
      handleTagChange: handleTagChange,
      handleTInputValueChange: handleTInputValueChange,
      setInnerPopupVisible: setInnerPopupVisible,
      removeTag: removeTag,
      renderTNode: renderTNode,
      updateScrollTop: updateScrollTop,
      componentName: COMPONENT_NAME
    };
  },
  methods: {
    renderSuffixIcon: function renderSuffixIcon() {
      var h = this.$createElement;
      var isLoading = this.isLoading,
          showArrow = this.showArrow,
          innerPopupVisible = this.innerPopupVisible,
          isDisabled = this.isDisabled;

      if (isLoading) {
        return h("t-loading", {
          "class": ["".concat(this.componentName, "__right-icon"), "".concat(this.componentName, "__active-icon")],
          "attrs": {
            "size": "small"
          }
        });
      }

      return showArrow ? h("fake-arrow", {
        "attrs": {
          "overlayClassName": "".concat(this.componentName, "__right-icon"),
          "isActive": innerPopupVisible && !isDisabled
        }
      }) : null;
    }
  },
  render: function render() {
    var _this = this;

    var h = arguments[0];
    var renderTNode = this.renderTNode;

    var prefixIcon = function prefixIcon() {
      return renderTNode("prefixIcon");
    };

    var valueDisplay = function valueDisplay() {
      return renderTNode("valueDisplay", {
        params: _this.valueDisplayParams
      });
    };

    var collapsedItems = function collapsedItems() {
      return renderTNode("collapsedItems", {
        params: _this.collapsedItemsParams
      });
    };

    var _ref5 = this.popupProps || {},
        overlayClassName = _ref5.overlayClassName,
        restPopupProps = _objectWithoutProperties__default["default"](_ref5, _excluded);

    return h("div", {
      "ref": "select",
      "class": "".concat(this.componentName, "__wrap")
    }, [h(components_selectInput_index.SelectInput, helper.helper([{
      "ref": "selectInputRef",
      "class": this.componentName,
      "attrs": {
        "autoWidth": this.autoWidth,
        "borderless": this.borderless || !this.bordered,
        "readonly": this.readonly,
        "allowInput": this.isFilterable,
        "multiple": this.multiple,
        "keys": this.keys,
        "status": this.status,
        "tips": this.tips,
        "value": this.displayText,
        "valueDisplay": valueDisplay,
        "clearable": this.clearable,
        "disabled": this.isDisabled,
        "label": prefixIcon,
        "suffixIcon": this.renderSuffixIcon,
        "placeholder": this.placeholderText,
        "inputValue": this.tInputValue,
        "inputProps": _objectSpread({
          size: this.size
        }, this.inputProps),
        "tagInputProps": _objectSpread({
          autoWidth: true
        }, this.tagInputProps),
        "tagProps": this.tagProps,
        "minCollapsedNum": this.minCollapsedNum,
        "collapsedItems": collapsedItems,
        "popupVisible": this.innerPopupVisible,
        "popupProps": _objectSpread({
          overlayClassName: ["".concat(this.componentName, "__dropdown"), overlayClassName]
        }, restPopupProps)
      }
    }, {
      "on": {
        focus: this.handleFocus,
        blur: this.handleBlur,
        enter: this.handleEnter,
        clear: this.handleClear,
        "input-change": this.handleTInputValueChange,
        "popup-visible-change": this.setInnerPopupVisible,
        "tag-change": this.handleTagChange
      }
    }, {}, this.selectInputProps, {
      "attrs": {
        "updateScrollTop": this.updateScrollTop
      }
    }]), [h("select-panel", {
      "ref": "selectPanelRef",
      "slot": "panel",
      "scopedSlots": this.$scopedSlots,
      "attrs": {
        "size": this.size,
        "options": this.innerOptions,
        "inputValue": this.tInputValue,
        "multiple": this.multiple,
        "empty": this.empty,
        "filter": this.filter,
        "filterable": this.isFilterable,
        "creatable": this.creatable,
        "scroll": this.scroll,
        "loading": this.isLoading,
        "loadingText": this.loadingText,
        "panelTopContent": this.panelTopContent,
        "panelBottomContent": this.panelBottomContent
      }
    })])]);
  }
});

exports["default"] = TSelect;
//# sourceMappingURL=select.js.map
