import e from"react";import t from"../MultiSelectedValues/MultiSelectedValues.js";import r from"./DropdownInput.js";import{useDropdownContext as l}from"../../context/DropdownContext.js";import i from"./TriggerActions.js";import a from"./Trigger.module.scss.js";import{getStyle as n}from"../../../../../helpers/typesciptCssModulesHelper.js";import o from"classnames";import s from"./DropdownChip.js";import m from"../../../../../../components/layout/dist/Flex/Flex.js";var d=function(){var d,p=l(),u=p.selectedItems,c=void 0===u?[]:u,v=p.contextOnOptionRemove,f=p.multiline,g=p.disabled,b=p.readOnly,E=p.error,j=p.searchable,y=p.getToggleButtonProps,x=p.label,h=p.getLabelProps,O=p.ariaLabel,w=p.minVisibleCount;return e.createElement(m,{justify:"space-between",align:"center"},e.createElement("div",Object.assign({className:o(a.triggerWrapper,n(a,p.size))},j?{}:y({"aria-haspopup":"dialog","aria-labelledby":x?h().id:void 0,"aria-label":O||(x||null===(d=h())||void 0===d?void 0:d.id),"aria-disabled":g?"true":void 0,"aria-invalid":E?"true":void 0,"aria-readonly":b?"true":void 0})),c.length>0?e.createElement("div",{className:a.multiWrapper},f?e.createElement(m,{gap:"xs",wrap:!0},c.map((function(t,l){var i,a;return e.createElement(m,{key:(null!==(a=null!==(i=t.id)&&void 0!==i?i:t.value)&&void 0!==a?a:l)+""},e.createElement("div",{style:{flexShrink:0}},e.createElement(s,{item:t,onDelete:function(){null==v||v(t)},readOnly:b,disabled:g})),l===c.length-1&&e.createElement(r,{inputSize:"small"}))}))):e.createElement(t,{disabled:g,readOnly:b,selectedItems:c,onRemove:function(e){null==v||v(e)},renderInput:function(){return e.createElement(r,{inputSize:"small"})},minVisibleCount:w})):e.createElement(r,null)),e.createElement(i,null))};export{d as default};
//# sourceMappingURL=MultiSelectTrigger.js.map
