import "../styles/reset.css";
import "./dropdown.less";
import { PropTypes as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__, classes as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_classes__, placementType as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_placementType__, triggerType as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_triggerType__, withInstallProps as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_withInstallProps__ } from "../shared";
import { computed as __WEBPACK_EXTERNAL_MODULE_vue_computed__, createVNode as __WEBPACK_EXTERNAL_MODULE_vue_createVNode__, defineComponent as __WEBPACK_EXTERNAL_MODULE_vue_defineComponent__, mergeProps as __WEBPACK_EXTERNAL_MODULE_vue_mergeProps__, ref as __WEBPACK_EXTERNAL_MODULE_vue_ref__ } from "vue";
import { usePrefix as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__ } from "../config-provider";
import { default as __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d_default__ } from "../popover";
import "../popover/popover.less";
import { default as __WEBPACK_EXTERNAL_MODULE_lodash_merge_cf99375a_default__ } from "lodash/merge";

;// external "../shared"

;// external "vue"

;// ../../node_modules/@babel/runtime/helpers/esm/typeof.js
function _typeof(o) {
  "@babel/helpers - typeof";

  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
    return typeof o;
  } : function (o) {
    return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
  }, _typeof(o);
}

;// ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js

function toPrimitive(t, r) {
  if ("object" != _typeof(t) || !t) return t;
  var e = t[Symbol.toPrimitive];
  if (void 0 !== e) {
    var i = e.call(t, r || "default");
    if ("object" != _typeof(i)) return i;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r ? String : Number)(t);
}

;// ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js


function toPropertyKey(t) {
  var i = toPrimitive(t, "string");
  return "symbol" == _typeof(i) ? i : i + "";
}

;// ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js

function _defineProperty(e, r, t) {
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
    value: t,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : e[r] = t, e;
}

;// external "../config-provider"

;// external "../popover"

;// external "../popover/popover.less"

;// external "lodash/merge"

;// ../../packages/dropdown/src/dropdown.tsx


/*
 * Tencent is pleased to support the open source community by making
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
 *
 * Copyright (C) 2025 Tencent.  All rights reserved.
 *
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
 *
 * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
 *
 * ---------------------------------------------------
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
 * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
 * the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
 * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */






/* harmony default export */ const dropdown = (__WEBPACK_EXTERNAL_MODULE_vue_defineComponent__({
  name: 'Dropdown',
  props: {
    /** trigger = manual时候控制显隐藏  */
    isShow: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.bool.def(false),
    /** 弹层出现位置 */
    placement: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_placementType__(),
    /** 触发方式 */
    trigger: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_triggerType__(),
    /** 是否禁用 */
    disabled: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.bool.def(false),
    /** popover属性 */
    popoverOptions: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.object.def({}),
    /** 外部设置的 class name */
    extCls: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string
  },
  emits: ['showChange', 'show', 'hide'],
  setup: function setup(_props, _ref) {
    var emit = _ref.emit;
    var popoverRef = __WEBPACK_EXTERNAL_MODULE_vue_ref__(null);
    var isPopoverShow = __WEBPACK_EXTERNAL_MODULE_vue_ref__(false);
    var _usePrefix = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__(),
      resolveClassName = _usePrefix.resolveClassName;
    /** 弹层显示值变更 */
    var handleShowChagne = function handleShowChagne(val) {
      isPopoverShow.value = val;
      emit('showChange', val);
    };
    /** 显示后回调 */
    var afterShow = function afterShow() {
      emit('show');
      handleShowChagne(true);
    };
    /** 隐藏后回调 */
    var afterHidden = function afterHidden() {
      emit('hide');
      handleShowChagne(false);
    };
    return {
      isPopoverShow: isPopoverShow,
      afterShow: afterShow,
      afterHidden: afterHidden,
      popoverRef: popoverRef,
      resolveClassName: resolveClassName
    };
  },
  render: function render() {
    var _this = this;
    var wrapperClasses = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_classes__(_defineProperty({}, "".concat(this.resolveClassName('dropdown')), true), this.$props.extCls);
    /** popover 基础配置 */
    var basePopoverOptions = {
      theme: "light ".concat(this.resolveClassName('dropdown-popover')),
      trigger: this.trigger,
      arrow: false,
      placement: this.placement,
      isShow: this.isShow,
      disabled: this.disabled
    };
    var popoverOptions = __WEBPACK_EXTERNAL_MODULE_lodash_merge_cf99375a_default__(basePopoverOptions, this.popoverOptions);
    return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
      "class": wrapperClasses
    }, [__WEBPACK_EXTERNAL_MODULE_vue_createVNode__(__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d_default__, __WEBPACK_EXTERNAL_MODULE_vue_mergeProps__({
      "ref": "popoverRef"
    }, popoverOptions, {
      "onAfterHidden": this.afterHidden,
      "onAfterShow": this.afterShow
    }), {
      "default": function _default() {
        var _this$$slots$default, _this$$slots;
        return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
          "class": ["".concat(_this.resolveClassName('dropdown-reference')), _this.disabled ? 'disabled' : '']
        }, [(_this$$slots$default = (_this$$slots = _this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots, {
          popoverShow: _this.isPopoverShow
        })]);
      },
      content: function content() {
        var _this$$slots$content, _this$$slots2;
        return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("div", {
          "class": "".concat(_this.resolveClassName('dropdown-content'))
        }, [(_this$$slots$content = (_this$$slots2 = _this.$slots).content) === null || _this$$slots$content === void 0 ? void 0 : _this$$slots$content.call(_this$$slots2)]);
      }
    })]);
  }
}));
;// ../../packages/dropdown/src/dropdown-item.tsx
/*
 * Tencent is pleased to support the open source community by making
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
 *
 * Copyright (C) 2025 Tencent.  All rights reserved.
 *
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
 *
 * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
 *
 * ---------------------------------------------------
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
 * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
 * the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
 * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */



/* harmony default export */ const dropdown_item = (__WEBPACK_EXTERNAL_MODULE_vue_defineComponent__({
  name: 'DropdownItem',
  props: {
    /** 外部设置的 class name */
    extCls: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string
  },
  emits: ['click'],
  setup: function setup(props, _ref) {
    var emit = _ref.emit;
    var handleClick = function handleClick(evt) {
      // 取消冒泡是为了 popover 那边能检测到 content 被点击了，实现按需 content 点击后隐藏面板的功能
      // content 那边会阻止冒泡，这里取消应该没啥影响
      // evt.stopPropagation();
      emit('click', evt);
    };
    var _usePrefix = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__(),
      resolveClassName = _usePrefix.resolveClassName;
    var wrapperCLasses = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
      return [resolveClassName('dropdown-item'), props.extCls];
    });
    return {
      wrapperCLasses: wrapperCLasses,
      handleClick: handleClick
    };
  },
  render: function render() {
    var _this$$slots$default, _this$$slots;
    return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("li", {
      "class": this.wrapperCLasses,
      "onClick": this.handleClick
    }, [(_this$$slots$default = (_this$$slots = this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots)]);
  }
}));
;// ../../packages/dropdown/src/dropdown-menu.tsx
/*
 * Tencent is pleased to support the open source community by making
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
 *
 * Copyright (C) 2025 Tencent.  All rights reserved.
 *
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
 *
 * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
 *
 * ---------------------------------------------------
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
 * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
 * the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
 * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */



/* harmony default export */ const dropdown_menu = (__WEBPACK_EXTERNAL_MODULE_vue_defineComponent__({
  name: 'DropdownMenu',
  props: {
    /** 外部设置的 class name */
    extCls: __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_PropTypes__.string
  },
  setup: function setup(props) {
    var _usePrefix = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3_usePrefix__(),
      resolveClassName = _usePrefix.resolveClassName;
    var wrapperCLasses = __WEBPACK_EXTERNAL_MODULE_vue_computed__(function () {
      return [resolveClassName('dropdown-menu'), props.extCls];
    });
    return {
      wrapperCLasses: wrapperCLasses
    };
  },
  render: function render() {
    var _this$$slots$default, _this$$slots;
    return __WEBPACK_EXTERNAL_MODULE_vue_createVNode__("ul", {
      "class": this.wrapperCLasses
    }, [(_this$$slots$default = (_this$$slots = this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots)]);
  }
}));
;// ../../packages/dropdown/src/index.ts
/*
 * Tencent is pleased to support the open source community by making
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
 *
 * Copyright (C) 2025 Tencent.  All rights reserved.
 *
 * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
 *
 * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
 *
 * ---------------------------------------------------
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
 * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
 * the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
 * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */




var BkDropdown = __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03_withInstallProps__(dropdown, {
  DropdownMenu: dropdown_menu,
  DropdownItem: dropdown_item
});
/* harmony default export */ const src = (BkDropdown);

export { BkDropdown, dropdown_item as BkDropdownItem, dropdown_menu as BkDropdownMenu, src as default };
