@six-group/ui-library 0.0.0-insider.e148618 → 0.0.0-insider.f058d60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/cjs/six-input.cjs.entry.js +1 -1
  2. package/dist/cjs/six-input.cjs.entry.js.map +1 -1
  3. package/dist/cjs/six-select.cjs.entry.js +3 -3
  4. package/dist/cjs/six-select.cjs.entry.js.map +1 -1
  5. package/dist/cjs/six-tag.cjs.entry.js +1 -1
  6. package/dist/cjs/six-tag.cjs.entry.js.map +1 -1
  7. package/dist/collection/components/six-input/six-input.css +1 -1
  8. package/dist/collection/components/six-select/six-select.css +6 -9
  9. package/dist/collection/components/six-select/six-select.js +2 -2
  10. package/dist/collection/components/six-select/six-select.js.map +1 -1
  11. package/dist/collection/components/six-select/test/six-select.spec.js +2 -2
  12. package/dist/collection/components/six-select/test/six-select.spec.js.map +1 -1
  13. package/dist/collection/components/six-tag/six-tag.css +6 -0
  14. package/dist/components/six-input2.js +1 -1
  15. package/dist/components/six-input2.js.map +1 -1
  16. package/dist/components/six-select.js +3 -3
  17. package/dist/components/six-select.js.map +1 -1
  18. package/dist/components/six-tag2.js +1 -1
  19. package/dist/components/six-tag2.js.map +1 -1
  20. package/dist/components.json +1 -1
  21. package/dist/esm/six-input.entry.js +1 -1
  22. package/dist/esm/six-input.entry.js.map +1 -1
  23. package/dist/esm/six-select.entry.js +3 -3
  24. package/dist/esm/six-select.entry.js.map +1 -1
  25. package/dist/esm/six-tag.entry.js +1 -1
  26. package/dist/esm/six-tag.entry.js.map +1 -1
  27. package/dist/ui-library/p-02981b91.entry.js +2 -0
  28. package/dist/ui-library/p-02981b91.entry.js.map +1 -0
  29. package/dist/ui-library/p-9f0b43f9.entry.js +2 -0
  30. package/dist/ui-library/p-9f0b43f9.entry.js.map +1 -0
  31. package/dist/ui-library/p-b550a258.entry.js +2 -0
  32. package/dist/ui-library/p-b550a258.entry.js.map +1 -0
  33. package/dist/ui-library/ui-library.esm.js +1 -1
  34. package/package.json +1 -1
  35. package/dist/ui-library/p-1d0bee53.entry.js +0 -2
  36. package/dist/ui-library/p-1d0bee53.entry.js.map +0 -1
  37. package/dist/ui-library/p-2451cfdc.entry.js +0 -2
  38. package/dist/ui-library/p-2451cfdc.entry.js.map +0 -1
  39. package/dist/ui-library/p-6eb24bcb.entry.js +0 -2
  40. package/dist/ui-library/p-6eb24bcb.entry.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ import{r as e,c as t,h as s,g as i}from"./p-6153045b.js";import{h as l,a as o}from"./p-15559d38.js";import{F as r}from"./p-d42c2025.js";import{E as a}from"./p-7d95def3.js";import{D as n,a as h}from"./p-698bb2c8.js";function c(e){if(Array.isArray(e)){return e.length===0}return e===""}const d=':host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control .form-control__error-text{display:none}.form-control--has-label .form-control__label{display:inline-block;color:var(--six-input-label-color);font-weight:var(--six-font-weight-bold);margin-bottom:var(--six-spacing-x-small)}.form-control--has-label .form-control__label__required::after{color:var(--six-color-danger-800);content:"*"}.form-control--has-label.form-control--small .form-control__label{font-size:var(--six-input-label-font-size-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--six-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control_label{font-size:var(--six-input-label-font-size-large)}.form-control--has-help-text .form-control__help-text{display:block;color:var(--six-input-help-text-color);margin-top:var(--six-spacing-x-small)}.form-control--has-help-text .form-control__help-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--has-error-text .form-control__error-text{display:block;color:var(--six-color-danger-800);margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text .form-control__error-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text.form-control--small .form-control__error-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-error-text.form-control--medium .form-control__error-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-error-text.form-control--large .form-control__error-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--disabled .form-control__help-text{color:var(--six-input-help-text-color-disabled)}.form-control--disabled .form-control__label{color:var(--six-input-label-color-disabled)}.form-control--invalid:not(.form-control--disabled) .form-control__label{color:var(--six-input-label-color)}:host{display:block}.select{display:block}.select__box{display:inline-flex;align-items:center;justify-content:start;position:relative;width:100%;font-family:var(--six-font-family);font-weight:var(--six-input-font-weight);font-size:var(--six-input-font-size-medium);letter-spacing:var(--six-input-letter-spacing);background-color:var(--six-input-background-color);border:solid var(--six-border-width) var(--six-input-border-color);vertical-align:middle;transition:var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;cursor:pointer}.select__box--line{border:none;border-bottom:solid var(--six-border-width) var(--six-input-border-color)}.select__box--autocomplete{border:none;overflow:initial}.select:not(.select--disabled) .select__box:hover{background-color:var(--six-input-background-color-hover);color:var(--six-input-color-hover);border-bottom-color:var(--six-input-border-color-hover)}.select:not(.select--disabled) .select__box:hover:not(.select__box--line){border-color:var(--six-input-border-color-hover)}.select:not(.select--disabled) .select__box:focus{background-color:var(--six-input-background-color-focus);outline:none;color:var(--six-input-color-focus);border-bottom-color:var(--six-input-border-color-focus);box-shadow:0 1px 0 0 var(--six-input-border-color-focus)}.select:not(.select--disabled) .select__box:focus:not(.select__box--line){border-color:var(--six-input-border-color-focus);box-shadow:var(--six-input-focus-shadow)}.select--disabled .select__box{background-color:var(--six-input-background-color-disabled);color:var(--six-input-color-disabled);cursor:not-allowed;outline:none}.select--disabled .select__box:not(.select__box--line){border-color:var(--six-input-border-color-disabled)}.select--disabled .select__tags,.select--disabled .select__clear{pointer-events:none}.select--invalid:not(.select--disabled):not(.select--focused) .select__box{border-bottom-color:var(--six-input-border-color-danger)}.select--invalid:not(.select--disabled):not(.select--focused) .select__box:not(.input--line){border-color:var(--six-input-border-color-danger)}.select__label{flex-shrink:1;flex-grow:1;align-items:center;user-select:none;width:0;scrollbar-width:none;-ms-overflow-style:none;overflow-x:auto;overflow-y:hidden;text-overflow:ellipsis}.select__label::-webkit-scrollbar{width:0;height:0}.select__label--single{white-space:nowrap}.select__clear{flex-shrink:0;flex-grow:0;display:inline}.select__icon{flex-shrink:0;flex-grow:0;display:inline;transition:var(--six-transition-medium) transform ease}.select--open .select__icon{transform:rotate(-180deg)}.select--placeholder-visible .select__label{color:var(--six-input-placeholder-color)}.select--disabled.select--placeholder-visible .select__label{color:var(--six-input-placeholder-color-disabled)}.select__tags{display:flex;align-items:center;flex-wrap:wrap;justify-content:left;margin-left:var(--six-spacing-xx-small)}.select__hidden-select{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}.select__input{position:absolute;top:0;left:0;width:100%;height:100%}.select--small .select__box{border-radius:var(--six-input-border-radius-small);font-size:var(--six-input-font-size-small);min-height:var(--six-height-small)}.select--small .select__box--line{border:none;border-bottom:solid var(--six-border-width) var(--six-input-border-color)}.select--small .select__label{margin:0 var(--six-input-spacing-small)}.select--small .select__clear{margin-right:var(--six-spacing-xxx-small)}.select--small .select__icon{margin-right:var(--six-spacing-x-small)}.select--small .select__tags{padding-bottom:2px}.select--small .select__tags six-tag{padding-top:2px;margin-right:var(--six-spacing-xx-small)}.select--small.select--has-tags .select__label{margin-left:0}.select--medium .select__box{border-radius:var(--six-input-border-radius-medium);font-size:var(--six-input-font-size-medium);min-height:var(--six-height-medium)}.select--medium .select__box--line{border:none;border-bottom:solid var(--six-border-width) var(--six-input-border-color)}.select--medium .select__label{margin:0 var(--six-input-spacing-medium)}.select--medium .select__clear{margin-right:var(--six-spacing-xxx-small)}.select--medium .select__icon{margin-right:var(--six-spacing-x-small)}.select--medium .select__tags{padding-bottom:3px}.select--medium .select__tags six-tag{padding-top:3px;margin-right:var(--six-spacing-xx-small)}.select--medium.select--has-tags .select__label{margin-left:0}.select--large .select__box{border-radius:var(--six-input-border-radius-large);font-size:var(--six-input-font-size-large);min-height:var(--six-height-large)}.select--large .select__box--line{border:none;border-bottom:solid var(--six-border-width) var(--six-input-border-color)}.select--large .select__label{margin:0 var(--six-input-spacing-large)}.select--large .select__clear{margin-right:var(--six-spacing-xxx-small)}.select--large .select__icon{margin-right:var(--six-spacing-x-small)}.select--large .select__tags{padding-bottom:4px}.select--large .select__tags six-tag{padding-top:4px;margin-right:var(--six-spacing-xx-small)}.select--large.select--has-tags .select__label{margin-left:0}.select--pill.select--small .select__box{border-radius:var(--six-height-small)}.select--pill.select--medium .select__box{border-radius:var(--six-height-medium)}.select--pill.select--large .select__box{border-radius:var(--six-height-large)}.select__menu{max-width:50vw;width:fit-content}.select__menu--filtered{width:100% !important}.select__menu--hidden{display:none}six-icon-button::part(base){padding-top:0;padding-bottom:0}';let u=0;const x=class{constructor(s){e(this,s);this.sixChange=t(this,"six-select-change",7);this.sixFocus=t(this,"six-select-focus",7);this.sixBlur=t(this,"six-select-blur",7);this.inputId=`select-${++u}`;this.labelId=`select-label-${u}`;this.helpTextId=`select-help-text-${u}`;this.errorTextId=`select-error-text-${u}`;this.touched=false;this.eventListeners=new a;this.handleBlur=()=>{this.hasFocus=false;this.sixBlur.emit()};this.handleFocus=()=>{this.hasFocus=true;this.sixFocus.emit()};this.handleClearClick=e=>{e.stopPropagation();this.clearValues();this.sixChange.emit({value:this.value,isSelected:true})};this.handleSelectAll=e=>{const t=this.getItems().filter((e=>e.style.display!=="none"));const s=e.key;const i=e.code;if(s==="Control"){return}if(this.isOpen&&this.multiple&&i==="KeyA"&&e.ctrlKey){e.preventDefault();const s=t.some((e=>!e.disabled&&!e.checked));t.filter((e=>!e.disabled)).forEach((e=>e.checked=s));const i=t.filter((e=>e.checked)).map((e=>e.value));this.value=s?i:[];this.sixChange.emit({value:this.value,isSelected:true})}};this.handleKeyDown=e=>{var t,s,i,l;const o=e.target;const r=this.getItems();const a=r[0];const n=r[r.length-1];if(o.tagName.toLowerCase()==="six-tag"){return}if(e.key==="Tab"){if(this.isOpen){(t=this.dropdown)===null||t===void 0?void 0:t.hide()}return}if(["ArrowDown","ArrowUp"].includes(e.key)){e.preventDefault();if(!this.isOpen){(s=this.dropdown)===null||s===void 0?void 0:s.show()}if(e.key==="ArrowDown"&&a){a.setFocus();return}if(e.key==="ArrowUp"&&n){n.setFocus();return}}if(!this.isOpen){e.stopPropagation();e.preventDefault();(i=this.dropdown)===null||i===void 0?void 0:i.show();(l=this.menu)===null||l===void 0?void 0:l.typeToSelect(e.key)}};this.handleLabelClick=()=>{var e;(e=this.box)===null||e===void 0?void 0:e.focus()};this.handleMenuSelect=e=>{const t=e.detail.item;const s=()=>{if(this.multiple){return this.value.includes(t.value)?this.value.filter((e=>e!==t.value)):[...this.value,t.value]}else{return t.value}};this.value=s();this.syncItemsFromValue();this.sixChange.emit({value:this.value,isSelected:true})};this.handleMenuShow=e=>{var t;if(this.disabled){e.preventDefault();return}this.resizeMenu();(t=this.resizeObserver)===null||t===void 0?void 0:t.observe(this.host);this.isOpen=true};this.handleMenuHide=()=>{var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.unobserve(this.host);this.isOpen=false};this.handleSlotChange=()=>{this.hasHelpTextSlot=l(this.host,"help-text");this.hasLabelSlot=l(this.host,"label");this.syncItemsFromValue()};this.handleTagInteraction=e=>{const t=e.composedPath();const s=t.find((e=>{if(e instanceof HTMLElement){const t=e;return t.classList.contains("tag__clear")}}));if(s){e.stopPropagation();this.sixChange.emit({value:this.value,isSelected:true})}};this.hasFocus=false;this.hasHelpTextSlot=false;this.hasLabelSlot=false;this.isOpen=false;this.displayLabel="";this.displayTags=[];this.multiple=false;this.maxTagsVisible=3;this.disabled=false;this.name="";this.placeholder="";this.filterPlaceholder=undefined;this.filterDebounce=n;this.size="medium";this.hoist=false;this.value="";this.pill=false;this.helpText="";this.required=false;this.clearable=false;this.label="";this.errorText="";this.invalid=false;this.line=false;this.filter=false;this.asyncFilter=false;this.autocomplete=false;this.inputDebounce=n;this.options=null;this.virtualScroll=false}handleDisabledChange(){var e;if(this.disabled&&this.isOpen){(e=this.dropdown)===null||e===void 0?void 0:e.hide()}}handleLabelChange(){this.handleSlotChange()}handleMultipleChange(){const e=this.getValueAsArray();this.value=this.multiple?e:e[0]||"";this.syncItemsFromValue()}async handleValueChange(){if(this.multiple&&!Array.isArray(this.value)){this.value=[]}if(!this.multiple&&typeof this.value!=="string"){this.value=""}await this.syncItemsFromValue()}connectedCallback(){var e;if(this.virtualScroll&&this.options===null){console.error("Options must be defined when using virtual scrolling")}(e=this.host.shadowRoot)===null||e===void 0?void 0:e.addEventListener("slotchange",this.handleSlotChange);this.eventListeners.forward("six-select-change","change",this.host);this.eventListeners.forward("six-select-blur","blur",this.host);this.eventListeners.forward("six-select-focus","focus",this.host)}componentWillLoad(){this.handleSlotChange();if(this.multiple&&this.value!=null){this.value=this.getValueAsArray()}}componentDidLoad(){if(this.input==null)return;const e=this.input;this.resizeObserver=new ResizeObserver((()=>this.resizeMenu()));requestAnimationFrame((()=>this.syncItemsFromValue()));this.eventListeners.add(e,"six-input-input",h((t=>{const s=e.value;this.clearValues();this.sixChange.emit({value:s,isSelected:false});t.stopPropagation()}),this.inputDebounce));e.value=this.hasSelection()?this.displayLabel:""}disconnectedCallback(){var e;(e=this.host.shadowRoot)===null||e===void 0?void 0:e.removeEventListener("slotchange",this.handleSlotChange);this.eventListeners.removeAll()}async setFocus(e){var t;this.hasFocus=true;(t=this.box)===null||t===void 0?void 0:t.focus(e)}getItemLabel(e){var t,s;const i=(t=e.shadowRoot)===null||t===void 0?void 0:t.querySelector("slot:not([name])");if(i!=null){return o(i)}else{return(s=e.textContent)!==null&&s!==void 0?s:""}}getItems(){if(this.options!==null){return this.options.map((e=>s("six-menu-item",{value:e.value},e.label)))}return[...this.host.querySelectorAll("six-menu-item")]}hasMenuItems(){return this.getItems().length>0}getValueAsArray(){const e=Array.isArray(this.value)?this.value:this.value===""?[]:[this.value];return e.map(String)}clearValues(){this.value=this.multiple?[]:"";this.syncItemsFromValue()}resizeMenu(){if(this.menu==null||this.box==null)return;this.menu.style.minWidth=`${this.box.clientWidth}px`;if(this.dropdown){this.dropdown.reposition()}}async syncItemsFromValue(){const e=this.getItems();const t=this.getValueAsArray();e.forEach((e=>e.checked=t.includes(e.value)));if(this.multiple){const i=[];t.forEach((t=>e.map((e=>e.value===t?i.push(e):null))));this.displayTags=i.map((e=>s("six-tag",{exportparts:"base:tag",type:"primary",size:this.size,pill:this.pill,clearable:true,onClick:this.handleTagInteraction,onKeyDown:this.handleTagInteraction,"onSix-tag-clear":t=>{t.stopPropagation();if(!this.disabled){e.checked=false;this.syncValueFromItems()}}},this.getItemLabel(e))));if(this.maxTagsVisible>0&&this.displayTags.length>this.maxTagsVisible){const e=this.displayTags.length;this.displayLabel="";this.displayTags=this.displayTags.slice(0,this.maxTagsVisible);this.displayTags.push(s("six-tag",{exportparts:"base:tag",type:"info",size:this.size},"+",e-this.maxTagsVisible))}}else{this.displayLabel=this.extractLabelForSelectedItem(t,e);this.displayTags=[]}if(!c(this.value)){this.touched=true}if(this.touched&&this.input!=null){this.input.value=Array.isArray(this.value)?this.value.join(","):this.value}}extractLabelForSelectedItem(e,t){if(e.length===0||e.length===1&&e[0]===""){return""}if(this.options!==null){const t=this.options.find((t=>t.value===e[0]));return(t===null||t===void 0?void 0:t.value)||""}const s=t.find((t=>t.value===e[0]));return s?this.getItemLabel(s):""}syncValueFromItems(){const e=this.getItems();const t=e.filter((e=>e.checked));const s=t.map((e=>e.value));this.value=this.multiple?this.getValueAsArray().filter((e=>s.includes(e))):s.length>0?s[0]:""}render(){var e;const t=this.hasSelection();return s(r,{inputId:this.inputId,label:this.label,labelId:this.labelId,hasLabelSlot:this.hasLabelSlot,helpTextId:this.helpTextId,helpText:this.helpText,hasHelpTextSlot:this.hasHelpTextSlot,errorTextId:this.errorTextId,errorText:this.errorText,size:this.size,onLabelClick:this.handleLabelClick,disabled:this.disabled,required:this.required,displayError:this.invalid},s("six-dropdown",{part:"base",ref:e=>this.dropdown=e,hoist:this.hoist,closeOnSelect:!this.multiple,containingElement:this.host,disableHideOnEnterAndSpace:this.autocomplete,class:{select:true,"select--open":this.isOpen,"select--empty":((e=this.value)===null||e===void 0?void 0:e.length)===0,"select--focused":this.hasFocus,"select--clearable":this.clearable,"select--disabled":this.disabled,"select--multiple":this.multiple,"select--has-tags":this.multiple&&t,"select--placeholder-visible":this.displayLabel==="","select--small":this.size==="small","select--medium":this.size==="medium","select--large":this.size==="large","select--pill":this.pill,"select--invalid":this.invalid},onKeyDown:this.handleSelectAll,"onSix-dropdown-show":this.handleMenuShow,"onSix-dropdown-hide":this.handleMenuHide,filterPlaceholder:this.filterPlaceholder,filterDebounce:this.filterDebounce,filter:this.filter,asyncFilter:this.asyncFilter},s("div",{slot:"trigger",ref:e=>this.box=e,id:this.inputId,class:{select__box:true,"select__box--line":this.line,"select__box--autocomplete":this.autocomplete},role:"combobox","aria-labelledby":this.labelId,"aria-describedby":this.helpTextId,"aria-haspopup":"true","aria-expanded":this.isOpen?"true":"false",tabIndex:this.disabled?-1:0,onBlur:this.handleBlur,onFocus:this.handleFocus,onKeyDown:this.handleKeyDown},s("span",{class:{select__label:true,"select__label--single":!this.displayTags.length}},this.displayTags.length>0?s("span",{part:"tags",class:"select__tags"},this.displayTags):this.displayLabel||this.placeholder),this.clearable&&t&&s("six-icon-button",{exportparts:"base:clear-button",class:"select__clear",name:"clear",size:"small",onClick:this.handleClearClick,tabindex:"-1"}),this.hasMenuItems()&&s("span",{part:"icon",class:"select__icon"},s("six-icon",{size:"medium"},"expand_more")),s("six-input",{ref:e=>this.input=e,class:{select__input:true,"select__hidden-select":!this.autocomplete},"aria-hidden":"true",required:this.required,onFocus:this.handleFocus,clearable:this.clearable,placeholder:this.placeholder,pill:this.pill,disabled:this.disabled,size:this.size,tabIndex:-1})),s("six-menu",{ref:e=>this.menu=e,part:"menu",class:{select__menu:true,"select__menu--filtered":this.filter||this.asyncFilter,"select__menu--hidden":!this.hasMenuItems()},"onSix-menu-item-selected":this.handleMenuSelect,items:this.options,virtualScroll:this.virtualScroll,"remove-box-shadow":true},s("slot",{onSlotchange:this.handleSlotChange}))))}hasSelection(){return this.multiple?this.value.length>0:this.value!==""}get host(){return i(this)}static get watchers(){return{disabled:["handleDisabledChange"],helpText:["handleLabelChange"],errorText:["handleLabelChange"],label:["handleLabelChange"],multiple:["handleMultipleChange"],value:["handleValueChange"]}}};x.style=d;export{x as six_select};
2
+ //# sourceMappingURL=p-02981b91.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isValueEmpty","value","Array","isArray","length","sixSelectCss","id","SixSelect","this","inputId","labelId","helpTextId","errorTextId","touched","eventListeners","EventListeners","handleBlur","hasFocus","sixBlur","emit","handleFocus","sixFocus","handleClearClick","event","stopPropagation","clearValues","sixChange","isSelected","handleSelectAll","nonFilteredItems","getItems","filter","item","style","display","keyName","key","keyCode","code","isOpen","multiple","ctrlKey","preventDefault","hasDeselectedOptions","some","opt","disabled","checked","option","forEach","checkedItems","map","handleKeyDown","target","items","firstItem","lastItem","tagName","toLowerCase","_a","dropdown","hide","includes","_b","show","setFocus","_c","_d","menu","typeToSelect","handleLabelClick","box","focus","handleMenuSelect","detail","getValue","v","syncItemsFromValue","handleMenuShow","resizeMenu","resizeObserver","observe","host","handleMenuHide","unobserve","handleSlotChange","hasHelpTextSlot","hasSlot","hasLabelSlot","handleTagInteraction","path","composedPath","clearButton","find","el","HTMLElement","element","classList","contains","DEFAULT_DEBOUNCE_FAST","handleDisabledChange","handleLabelChange","handleMultipleChange","getValueAsArray","handleValueChange","connectedCallback","virtualScroll","options","console","error","shadowRoot","addEventListener","forward","componentWillLoad","componentDidLoad","input","ResizeObserver","requestAnimationFrame","add","debounce","enteredValue","inputDebounce","hasSelection","displayLabel","disconnectedCallback","removeEventListener","removeAll","getItemLabel","slot","querySelector","getTextContent","textContent","h","label","querySelectorAll","hasMenuItems","values","String","minWidth","clientWidth","reposition","val","push","displayTags","exportparts","type","size","pill","clearable","onClick","onKeyDown","syncValueFromItems","maxTagsVisible","total","slice","extractLabelForSelectedItem","join","selectedOption","checkedItem","checkedValues","render","FormControl","helpText","errorText","onLabelClick","required","displayError","invalid","part","ref","hoist","closeOnSelect","containingElement","disableHideOnEnterAndSpace","autocomplete","class","select","filterPlaceholder","filterDebounce","asyncFilter","select__box","line","role","tabIndex","onBlur","onFocus","select__label","placeholder","name","tabindex","select__input","select__menu","onSlotchange"],"sources":["src/components/six-select/util.ts","src/components/six-select/six-select.scss?tag=six-select&encapsulation=shadow","src/components/six-select/six-select.tsx"],"sourcesContent":["export interface MenuItem {\n value: string;\n}\n\nexport function getValue(value: unknown, multiple: boolean, menuItems: MenuItem[]): string | string[] {\n if (multiple) {\n if (Array.isArray(value)) {\n return getSelectedValues(value, menuItems);\n } else {\n return getSelectedValuesFromString(value, menuItems);\n }\n }\n\n return getSelectedMenuItem(value, menuItems)?.value ?? '';\n}\n\nexport function isValidValue(value: unknown, multiple: boolean, menuItems: MenuItem[]): boolean {\n if (value === '') {\n return true;\n }\n\n if (multiple) {\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return true;\n }\n return getSelectedValues(value, menuItems).length === value.length;\n }\n return getSelectedValuesFromString(value, menuItems).length > 0;\n }\n\n return getSelectedMenuItem(value, menuItems) != null;\n}\n\nexport function valueEquals(a: string | string[], b: string | string[]): boolean {\n if (Array.isArray(a) && Array.isArray(b)) {\n return a.length === b.length && a.every((element, index) => element === b[index]);\n } else if (typeof a === 'string' && typeof b === 'string') {\n return a === b;\n }\n return false;\n}\n\nexport function isValueEmpty(value: string | string[]): boolean {\n if (Array.isArray(value)) {\n return value.length === 0;\n }\n return value === '';\n}\n\nfunction getSelectedValues(values: unknown[], menuItems: MenuItem[]): string[] {\n return menuItems.filter((menuItem) => values.includes(menuItem.value)).map((menuItem) => menuItem.value);\n}\n\nfunction getSelectedValuesFromString(value: unknown, menuItems: MenuItem[]): string[] {\n return menuItems.filter((menuItem) => value === menuItem.value).map((menuItem) => menuItem.value);\n}\n\nfunction getSelectedMenuItem(value: unknown, menuItems: MenuItem[]): MenuItem | undefined {\n return menuItems.find((item) => value === item.value);\n}\n","@import 'src/global/component';\n@import '../../functional-components/form-control/form-control';\n@import 'src/global/mixins/hidden';\n@import 'src/global/mixins/hide-scrollbar';\n\n:host {\n display: block;\n}\n\n.select {\n display: block;\n}\n\n.select__box {\n display: inline-flex;\n align-items: center;\n justify-content: start;\n position: relative;\n width: 100%;\n font-family: var(--six-font-family);\n font-weight: var(--six-input-font-weight);\n font-size: var(--six-input-font-size-medium);\n letter-spacing: var(--six-input-letter-spacing);\n background-color: var(--six-input-background-color);\n border: solid var(--six-border-width) var(--six-input-border-color);\n vertical-align: middle;\n transition: var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;\n cursor: pointer;\n\n &--line {\n border: none;\n border-bottom: solid var(--six-border-width) var(--six-input-border-color);\n }\n\n &--autocomplete {\n border: none;\n overflow: initial;\n }\n}\n\n.select:not(.select--disabled) .select__box:hover {\n background-color: var(--six-input-background-color-hover);\n color: var(--six-input-color-hover);\n\n border-bottom-color: var(--six-input-border-color-hover);\n\n &:not(.select__box--line) {\n border-color: var(--six-input-border-color-hover);\n }\n}\n\n.select:not(.select--disabled) .select__box:focus {\n background-color: var(--six-input-background-color-focus);\n outline: none;\n color: var(--six-input-color-focus);\n\n border-bottom-color: var(--six-input-border-color-focus);\n box-shadow: 0 1px 0 0 var(--six-input-border-color-focus);\n\n &:not(.select__box--line) {\n border-color: var(--six-input-border-color-focus);\n box-shadow: var(--six-input-focus-shadow);\n }\n}\n\n.select--disabled {\n .select__box {\n background-color: var(--six-input-background-color-disabled);\n color: var(--six-input-color-disabled);\n cursor: not-allowed;\n outline: none;\n\n &:not(.select__box--line) {\n border-color: var(--six-input-border-color-disabled);\n }\n }\n\n .select__tags,\n .select__clear {\n pointer-events: none;\n }\n}\n\n.select--invalid:not(.select--disabled):not(.select--focused) {\n .select__box {\n border-bottom-color: var(--six-input-border-color-danger);\n\n &:not(.input--line) {\n border-color: var(--six-input-border-color-danger);\n }\n }\n}\n\n.select__label {\n flex-shrink: 1;\n flex-grow: 1;\n align-items: center;\n user-select: none;\n width: 0; /* needed for firefox because due to \"white-space: nowrap\" the default is set to max-content */\n\n @include hide-scrollbar;\n overflow-x: auto;\n overflow-y: hidden;\n text-overflow: ellipsis;\n}\n\n.select__label--single {\n white-space: nowrap;\n}\n\n.select__clear {\n flex-shrink: 0;\n flex-grow: 0;\n display: inline;\n}\n\n.select__icon {\n flex-shrink: 0;\n flex-grow: 0;\n display: inline;\n transition: var(--six-transition-medium) transform ease;\n}\n\n.select--open .select__icon {\n transform: rotate(-180deg);\n}\n\n// Placeholder\n.select--placeholder-visible .select__label {\n color: var(--six-input-placeholder-color);\n}\n\n.select--disabled.select--placeholder-visible .select__label {\n color: var(--six-input-placeholder-color-disabled);\n}\n\n// Tags\n.select__tags {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n justify-content: left;\n margin-left: var(--six-spacing-xx-small);\n}\n\n// Hidden input (for form control validation to show)\n.select__hidden-select {\n @include visually-hidden();\n}\n\n.select__input {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Size modifiers\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.select--small {\n .select__box {\n border-radius: var(--six-input-border-radius-small);\n font-size: var(--six-input-font-size-small);\n min-height: var(--six-height-small);\n\n &--line {\n border: none;\n border-bottom: solid var(--six-border-width) var(--six-input-border-color);\n }\n }\n\n .select__label {\n margin: 0 var(--six-input-spacing-small);\n }\n\n .select__clear {\n margin-right: var(--six-spacing-xxx-small);\n }\n\n .select__icon {\n margin-right: var(--six-spacing-x-small);\n }\n\n .select__tags {\n padding-bottom: 2px;\n\n six-tag {\n padding-top: 2px;\n margin-right: var(--six-spacing-xx-small);\n }\n }\n\n &.select--has-tags .select__label {\n margin-left: 0;\n }\n}\n\n.select--medium {\n .select__box {\n border-radius: var(--six-input-border-radius-medium);\n font-size: var(--six-input-font-size-medium);\n min-height: var(--six-height-medium);\n\n &--line {\n border: none;\n border-bottom: solid var(--six-border-width) var(--six-input-border-color);\n }\n }\n\n .select__label {\n margin: 0 var(--six-input-spacing-medium);\n }\n\n .select__clear {\n margin-right: var(--six-spacing-xxx-small);\n }\n\n .select__icon {\n margin-right: var(--six-spacing-x-small);\n }\n\n .select__tags {\n padding-bottom: 3px;\n\n six-tag {\n padding-top: 3px;\n margin-right: var(--six-spacing-xx-small);\n }\n }\n\n &.select--has-tags .select__label {\n margin-left: 0;\n }\n}\n\n.select--large {\n .select__box {\n border-radius: var(--six-input-border-radius-large);\n font-size: var(--six-input-font-size-large);\n min-height: var(--six-height-large);\n\n &--line {\n border: none;\n border-bottom: solid var(--six-border-width) var(--six-input-border-color);\n }\n }\n\n .select__label {\n margin: 0 var(--six-input-spacing-large);\n }\n\n .select__clear {\n margin-right: var(--six-spacing-xxx-small);\n }\n\n .select__icon {\n margin-right: var(--six-spacing-x-small);\n }\n\n .select__tags {\n padding-bottom: 4px;\n\n six-tag {\n padding-top: 4px;\n margin-right: var(--six-spacing-xx-small);\n }\n }\n\n &.select--has-tags .select__label {\n margin-left: 0;\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Pill modifier\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.select--pill {\n &.select--small .select__box {\n border-radius: var(--six-height-small);\n }\n\n &.select--medium .select__box {\n border-radius: var(--six-height-medium);\n }\n\n &.select--large .select__box {\n border-radius: var(--six-height-large);\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Menu\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n.select {\n &__menu {\n max-width: 50vw;\n width: fit-content;\n\n &--filtered {\n // fixes problem where when filter is enabled the popup has the width of the input field but the menu has the width\n // of the trigger element and we thus get weird UI glitches when trigger is narrower than filter input field\n width: 100% !important;\n }\n\n &--hidden {\n // hide the menu panel if there are no menu items\n display: none;\n }\n }\n}\n\n// fixes problem where six-select height changes when size=\"small\" and clearing button is visible\nsix-icon-button::part(base) {\n padding-top: 0;\n padding-bottom: 0;\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport { getTextContent, hasSlot } from '../../utils/slot';\nimport FormControl from '../../functional-components/form-control/form-control';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\nimport { debounce, DEFAULT_DEBOUNCE_FAST } from '../../utils/execution-control';\nimport { SixMenuItemData } from '../six-menu/six-menu';\nimport { isValueEmpty } from './util';\n\nexport interface SixSelectChangePayload {\n value: string | string[];\n isSelected: boolean;\n}\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The select's options in the form of menu items.\n * @slot label - The select's label. Alternatively, you can use the label prop.\n * @slot help-text - Help text that describes how to use the select.\n * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.\n *\n * @part base - The component's base wrapper.\n * @part clear-button - The input's clear button, exported from six-input.\n * @part form-control - The form control that wraps the label, input, and help text.\n * @part help-text - The select's help text.\n * @part icon - The select's icon.\n * @part label - The select's label.\n * @part menu - The select menu, a six-menu element.\n * @part tag - The multiselect option, a six-tag element.\n * @part tags - The container in which multiselect options are rendered.\n */\n\n@Component({\n tag: 'six-select',\n styleUrl: 'six-select.scss',\n shadow: true,\n})\nexport class SixSelect {\n private box?: HTMLElement;\n private dropdown?: HTMLSixDropdownElement;\n private input?: HTMLSixInputElement;\n private inputId = `select-${++id}`;\n private labelId = `select-label-${id}`;\n private helpTextId = `select-help-text-${id}`;\n private errorTextId = `select-error-text-${id}`;\n private menu?: HTMLSixMenuElement;\n private resizeObserver?: ResizeObserver;\n private touched = false;\n private eventListeners = new EventListeners();\n\n @Element() host!: HTMLSixSelectElement;\n\n @State() hasFocus = false;\n @State() hasHelpTextSlot = false;\n @State() hasLabelSlot = false;\n @State() isOpen = false;\n @State() displayLabel = '';\n @State() displayTags: HTMLSixTagElement[] = [];\n\n /** Set to true to enable multiselect. */\n @Prop() multiple = false;\n\n /**\n * The maximum number of tags to show when `multiple` is true. After the maximum, \"+n\" will be shown to indicate the\n * number of additional items that are selected. Set to -1 to remove the limit.\n */\n @Prop() maxTagsVisible = 3;\n\n /** Set to true to disable the select control. */\n @Prop() disabled = false;\n\n /** The select's name. */\n @Prop() name = '';\n\n /** The select's placeholder text. */\n @Prop() placeholder = '';\n\n /** The filter's placeholder text. */\n @Prop() filterPlaceholder?: string;\n\n /** The debounce for the filter callbacks. */\n @Prop() filterDebounce = DEFAULT_DEBOUNCE_FAST;\n\n /** The select's size. */\n @Prop() size: 'small' | 'medium' | 'large' = 'medium';\n\n /**\n * Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n * `overflow: auto|scroll`.\n */\n @Prop() hoist = false;\n\n /** The value of the control. This will be a string or an array depending on `multiple`. */\n @Prop({ mutable: true }) value: string | string[] = '';\n\n /** Set to true to draw a pill-style select with rounded edges. */\n @Prop() pill = false;\n\n /** The select's help text. Alternatively, you can use the help-text slot. */\n @Prop() helpText = '';\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /** Set to true to add a clear button when the select is populated. */\n @Prop() clearable = false;\n\n /** The label text. */\n @Prop() label = '';\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText = '';\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** Set to render as line */\n @Prop() line = false;\n\n /** Set to true to allow filtering for entries in the dropdown */\n @Prop() filter = false;\n\n /**\n * Set to true to allow async filtering.\n * When you enter something in the search field the component will only emit an event but not filter any elements itself.\n * You can then simply listen to the 'six-async-filter-fired' event to manage the shown menu-items yourself\n */\n @Prop() asyncFilter = false;\n\n /**\n * Set to true to turn the six-select into an autocomplete.\n */\n @Prop() autocomplete = false;\n\n /** The debounce for when the input changes for autocompletes should be emitted */\n @Prop() inputDebounce = DEFAULT_DEBOUNCE_FAST;\n\n /** Set the options to be shown in the dropdown (alternative to setting the elements via html) */\n @Prop() options: SixMenuItemData[] | null = null;\n\n /** Defines whether the menu list will be rendered virtually i.e. only the elements actually shown (and a couple around)\n * are actually rendered in the DOM. If you use virtual scrolling pass the elements via prop instead of via slot. */\n @Prop() virtualScroll = false;\n\n @Watch('disabled')\n handleDisabledChange() {\n if (this.disabled && this.isOpen) {\n this.dropdown?.hide();\n }\n }\n\n @Watch('helpText')\n @Watch('errorText')\n @Watch('label')\n handleLabelChange() {\n this.handleSlotChange();\n }\n\n @Watch('multiple')\n handleMultipleChange() {\n // Cast to array | string based on `this.multiple`\n const value = this.getValueAsArray();\n this.value = this.multiple ? value : value[0] || '';\n this.syncItemsFromValue();\n }\n\n @Watch('value')\n async handleValueChange() {\n if (this.multiple && !Array.isArray(this.value)) {\n this.value = [];\n }\n\n if (!this.multiple && typeof this.value !== 'string') {\n this.value = '';\n }\n\n await this.syncItemsFromValue();\n }\n\n /** Emitted when the control's value changes. */\n @Event({ eventName: 'six-select-change' }) sixChange!: EventEmitter<SixSelectChangePayload>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-select-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control loses focus. */\n @Event({ eventName: 'six-select-blur' }) sixBlur!: EventEmitter<EmptyPayload>;\n\n connectedCallback() {\n if (this.virtualScroll && this.options === null) {\n console.error('Options must be defined when using virtual scrolling');\n }\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.forward('six-select-change', 'change', this.host);\n this.eventListeners.forward('six-select-blur', 'blur', this.host);\n this.eventListeners.forward('six-select-focus', 'focus', this.host);\n }\n\n componentWillLoad() {\n this.handleSlotChange();\n if (this.multiple && this.value != null) {\n this.value = this.getValueAsArray();\n }\n }\n\n componentDidLoad() {\n if (this.input == null) return;\n const input = this.input;\n this.resizeObserver = new ResizeObserver(() => this.resizeMenu());\n\n // We need to do an initial sync after the component has rendered, so this will suppress the re-render warning\n requestAnimationFrame(() => this.syncItemsFromValue());\n\n this.eventListeners.add(\n input,\n 'six-input-input',\n debounce((event) => {\n const enteredValue = input.value;\n this.clearValues();\n this.sixChange.emit({ value: enteredValue, isSelected: false });\n event.stopPropagation();\n }, this.inputDebounce)\n );\n\n input.value = this.hasSelection() ? this.displayLabel : '';\n }\n\n disconnectedCallback() {\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.removeAll();\n }\n\n /** Sets focus on the select. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.hasFocus = true;\n this.box?.focus(options);\n }\n\n private getItemLabel(item: HTMLSixMenuItemElement): string {\n const slot = item.shadowRoot?.querySelector('slot:not([name])') as HTMLSlotElement;\n if (slot != null) {\n return getTextContent(slot);\n } else {\n // bugfix/COMSLI-203-six-select-value-is-not-updated-if-the-slot-is-changed\n return item.textContent ?? '';\n }\n }\n\n private getItems(): HTMLSixMenuItemElement[] {\n if (this.options !== null) {\n return this.options.map((option) => <six-menu-item value={option.value}>{option.label}</six-menu-item>);\n }\n\n return [...this.host.querySelectorAll('six-menu-item')];\n }\n\n private hasMenuItems() {\n return this.getItems().length > 0;\n }\n\n private getValueAsArray() {\n const values = Array.isArray(this.value) ? this.value : this.value === '' ? [] : [this.value];\n // enforce that the values are converted to 'string' before the value is compared\n return values.map(String);\n }\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.sixBlur.emit();\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.sixFocus.emit();\n };\n\n private handleClearClick = (event: MouseEvent) => {\n event.stopPropagation();\n this.clearValues();\n this.sixChange.emit({ value: this.value, isSelected: true });\n };\n\n private clearValues() {\n this.value = this.multiple ? [] : '';\n this.syncItemsFromValue();\n }\n\n private handleSelectAll = (event: KeyboardEvent) => {\n const nonFilteredItems = this.getItems().filter((item) => item.style.display !== 'none');\n const keyName = event.key;\n const keyCode = event.code;\n\n if (keyName === 'Control') {\n return;\n }\n\n if (this.isOpen && this.multiple && keyCode === 'KeyA' && event.ctrlKey) {\n event.preventDefault();\n const hasDeselectedOptions = nonFilteredItems.some((opt) => !opt.disabled && !opt.checked);\n\n nonFilteredItems\n .filter((option) => !option.disabled)\n .forEach((option) => (option.checked = hasDeselectedOptions));\n const checkedItems = nonFilteredItems.filter((option) => option.checked).map((option) => option.value);\n this.value = hasDeselectedOptions ? checkedItems : [];\n this.sixChange.emit({ value: this.value, isSelected: true });\n }\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n const target = event.target as HTMLElement;\n\n const items = this.getItems();\n const firstItem = items[0];\n const lastItem = items[items.length - 1];\n\n // Ignore key presses on tags\n if (target.tagName.toLowerCase() === 'six-tag') {\n return;\n }\n\n // Tabbing out of the control closes it\n if (event.key === 'Tab') {\n if (this.isOpen) {\n this.dropdown?.hide();\n }\n return;\n }\n\n // Up/down opens the menu\n if (['ArrowDown', 'ArrowUp'].includes(event.key)) {\n event.preventDefault();\n\n // Show the menu if it's not already open\n if (!this.isOpen) {\n this.dropdown?.show();\n }\n\n // Focus on a menu item\n if (event.key === 'ArrowDown' && firstItem) {\n firstItem.setFocus();\n return;\n }\n\n if (event.key === 'ArrowUp' && lastItem) {\n lastItem.setFocus();\n return;\n }\n }\n\n // All other keys open the menu and initiate type to select\n if (!this.isOpen) {\n event.stopPropagation();\n event.preventDefault();\n this.dropdown?.show();\n this.menu?.typeToSelect(event.key);\n }\n };\n\n private handleLabelClick = () => {\n this.box?.focus();\n };\n\n private handleMenuSelect = (event: CustomEvent) => {\n const item = event.detail.item;\n\n const getValue = () => {\n if (this.multiple) {\n return this.value.includes(item.value)\n ? (this.value as []).filter((v) => v !== item.value)\n : [...this.value, item.value];\n } else {\n return item.value;\n }\n };\n\n this.value = getValue();\n\n this.syncItemsFromValue();\n this.sixChange.emit({ value: this.value, isSelected: true });\n };\n\n private handleMenuShow = (event: CustomEvent) => {\n if (this.disabled) {\n event.preventDefault();\n return;\n }\n\n this.resizeMenu();\n this.resizeObserver?.observe(this.host);\n this.isOpen = true;\n };\n\n private handleMenuHide = () => {\n this.resizeObserver?.unobserve(this.host);\n this.isOpen = false;\n };\n\n private handleSlotChange = () => {\n this.hasHelpTextSlot = hasSlot(this.host, 'help-text');\n this.hasLabelSlot = hasSlot(this.host, 'label');\n this.syncItemsFromValue();\n };\n\n private handleTagInteraction = (event: KeyboardEvent | MouseEvent) => {\n // Don't toggle the menu when a tag's clear button is activated\n const path = event.composedPath() as EventTarget[];\n const clearButton = path.find((el) => {\n if (el instanceof HTMLElement) {\n const element = el as HTMLElement;\n return element.classList.contains('tag__clear');\n }\n });\n\n if (clearButton) {\n event.stopPropagation();\n this.sixChange.emit({ value: this.value, isSelected: true });\n }\n };\n\n private resizeMenu() {\n if (this.menu == null || this.box == null) return;\n this.menu.style.minWidth = `${this.box.clientWidth}px`;\n\n if (this.dropdown) {\n this.dropdown.reposition();\n }\n }\n\n private async syncItemsFromValue() {\n const items = this.getItems();\n const value = this.getValueAsArray();\n\n // Sync checked states\n items.forEach((item) => (item.checked = value.includes(item.value)));\n\n // Sync display label\n if (this.multiple) {\n const checkedItems: HTMLSixMenuItemElement[] = [];\n value.forEach((val) => items.map((item) => (item.value === val ? checkedItems.push(item) : null)));\n\n this.displayTags = checkedItems.map((item) => {\n return (\n <six-tag\n exportparts=\"base:tag\"\n type=\"primary\"\n size={this.size}\n pill={this.pill}\n clearable\n onClick={this.handleTagInteraction}\n onKeyDown={this.handleTagInteraction}\n onSix-tag-clear={(event) => {\n event.stopPropagation();\n if (!this.disabled) {\n item.checked = false;\n this.syncValueFromItems();\n }\n }}\n >\n {this.getItemLabel(item)}\n </six-tag>\n );\n });\n\n if (this.maxTagsVisible > 0 && this.displayTags.length > this.maxTagsVisible) {\n const total = this.displayTags.length;\n this.displayLabel = '';\n this.displayTags = this.displayTags.slice(0, this.maxTagsVisible);\n this.displayTags.push(\n <six-tag exportparts=\"base:tag\" type=\"info\" size={this.size}>\n +{total - this.maxTagsVisible}\n </six-tag>\n );\n }\n } else {\n this.displayLabel = this.extractLabelForSelectedItem(value, items);\n this.displayTags = [];\n }\n\n if (!isValueEmpty(this.value)) {\n this.touched = true;\n }\n if (this.touched && this.input != null) {\n this.input.value = Array.isArray(this.value) ? this.value.join(',') : this.value;\n }\n }\n\n private extractLabelForSelectedItem(value: string[], items: HTMLSixMenuItemElement[]): string {\n if (value.length === 0 || (value.length === 1 && value[0] === '')) {\n return '';\n }\n\n if (this.options !== null) {\n const selectedOption = this.options.find((item) => item.value === value[0]);\n return selectedOption?.value || '';\n }\n\n const checkedItem = items.find((item) => item.value === value[0]);\n return checkedItem ? this.getItemLabel(checkedItem) : '';\n }\n\n private syncValueFromItems() {\n const items = this.getItems();\n const checkedItems = items.filter((item) => item.checked);\n const checkedValues = checkedItems.map((item) => item.value);\n this.value = this.multiple\n ? this.getValueAsArray().filter((val) => checkedValues.includes(val))\n : checkedValues.length > 0\n ? checkedValues[0]\n : '';\n }\n\n render() {\n const hasSelection = this.hasSelection();\n\n return (\n <FormControl\n inputId={this.inputId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={this.hasLabelSlot}\n helpTextId={this.helpTextId}\n helpText={this.helpText}\n hasHelpTextSlot={this.hasHelpTextSlot}\n errorTextId={this.errorTextId}\n errorText={this.errorText}\n size={this.size}\n onLabelClick={this.handleLabelClick}\n disabled={this.disabled}\n required={this.required}\n displayError={this.invalid}\n >\n <six-dropdown\n part=\"base\"\n ref={(el) => (this.dropdown = el)}\n hoist={this.hoist}\n closeOnSelect={!this.multiple}\n containingElement={this.host}\n disableHideOnEnterAndSpace={this.autocomplete}\n class={{\n select: true,\n 'select--open': this.isOpen,\n 'select--empty': this.value?.length === 0,\n 'select--focused': this.hasFocus,\n 'select--clearable': this.clearable,\n 'select--disabled': this.disabled,\n 'select--multiple': this.multiple,\n 'select--has-tags': this.multiple && hasSelection,\n 'select--placeholder-visible': this.displayLabel === '',\n 'select--small': this.size === 'small',\n 'select--medium': this.size === 'medium',\n 'select--large': this.size === 'large',\n 'select--pill': this.pill,\n 'select--invalid': this.invalid,\n }}\n onKeyDown={this.handleSelectAll}\n onSix-dropdown-show={this.handleMenuShow}\n onSix-dropdown-hide={this.handleMenuHide}\n filterPlaceholder={this.filterPlaceholder}\n filterDebounce={this.filterDebounce}\n filter={this.filter}\n asyncFilter={this.asyncFilter}\n >\n <div\n slot=\"trigger\"\n ref={(el) => (this.box = el)}\n id={this.inputId}\n class={{\n select__box: true,\n 'select__box--line': this.line,\n 'select__box--autocomplete': this.autocomplete,\n }}\n role=\"combobox\"\n aria-labelledby={this.labelId}\n aria-describedby={this.helpTextId}\n aria-haspopup=\"true\"\n aria-expanded={this.isOpen ? 'true' : 'false'}\n tabIndex={this.disabled ? -1 : 0}\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n onKeyDown={this.handleKeyDown}\n >\n <span class={{ select__label: true, 'select__label--single': !this.displayTags.length }}>\n {this.displayTags.length > 0 ? (\n <span part=\"tags\" class=\"select__tags\">\n {this.displayTags}\n </span>\n ) : (\n this.displayLabel || this.placeholder\n )}\n </span>\n\n {this.clearable && hasSelection && (\n <six-icon-button\n exportparts=\"base:clear-button\"\n class=\"select__clear\"\n name=\"clear\"\n size=\"small\"\n onClick={this.handleClearClick}\n tabindex=\"-1\"\n />\n )}\n\n {this.hasMenuItems() && (\n <span part=\"icon\" class=\"select__icon\">\n <six-icon size=\"medium\">expand_more</six-icon>\n </span>\n )}\n\n {/*\n The hidden input tricks the browser's built-in validation so it works as expected. We use an input instead\n of a select because, otherwise, iOS will show a list of options during validation.\n */}\n <six-input\n ref={(el) => (this.input = el)}\n class={{\n select__input: true,\n 'select__hidden-select': !this.autocomplete,\n }}\n aria-hidden=\"true\"\n required={this.required}\n onFocus={this.handleFocus}\n clearable={this.clearable}\n placeholder={this.placeholder}\n pill={this.pill}\n disabled={this.disabled}\n size={this.size}\n tabIndex={-1}\n />\n </div>\n\n <six-menu\n ref={(el) => (this.menu = el)}\n part=\"menu\"\n class={{\n select__menu: true,\n 'select__menu--filtered': this.filter || this.asyncFilter,\n 'select__menu--hidden': !this.hasMenuItems(),\n }}\n onSix-menu-item-selected={this.handleMenuSelect}\n items={this.options}\n virtualScroll={this.virtualScroll}\n remove-box-shadow\n >\n <slot onSlotchange={this.handleSlotChange} />\n </six-menu>\n </six-dropdown>\n </FormControl>\n );\n }\n\n private hasSelection() {\n return this.multiple ? this.value.length > 0 : this.value !== '';\n }\n}\n"],"mappings":"gOA2CgBA,EAAaC,GAC3B,GAAIC,MAAMC,QAAQF,GAAQ,CACxB,OAAOA,EAAMG,SAAW,C,CAE1B,OAAOH,IAAU,EACnB,CChDA,MAAMI,EAAe,i8PCcrB,IAAIC,EAAK,E,MA6BIC,EAAS,M,0JAIZC,KAAAC,QAAU,YAAYH,IACtBE,KAAAE,QAAU,gBAAgBJ,IAC1BE,KAAAG,WAAa,oBAAoBL,IACjCE,KAAAI,YAAc,qBAAqBN,IAGnCE,KAAAK,QAAU,MACVL,KAAAM,eAAiB,IAAIC,EA2NrBP,KAAAQ,WAAa,KACnBR,KAAKS,SAAW,MAChBT,KAAKU,QAAQC,MAAM,EAGbX,KAAAY,YAAc,KACpBZ,KAAKS,SAAW,KAChBT,KAAKa,SAASF,MAAM,EAGdX,KAAAc,iBAAoBC,IAC1BA,EAAMC,kBACNhB,KAAKiB,cACLjB,KAAKkB,UAAUP,KAAK,CAAElB,MAAOO,KAAKP,MAAO0B,WAAY,MAAO,EAQtDnB,KAAAoB,gBAAmBL,IACzB,MAAMM,EAAmBrB,KAAKsB,WAAWC,Q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vL,KAAKuB,QAAUvB,KAAK2K,YAC9C,wBAAyB3K,KAAK+H,gBAC/B,2BACyB/H,KAAKiE,iBAC/BnB,MAAO9C,KAAKmG,QACZD,cAAelG,KAAKkG,cAAa,0BAGjC0B,EAAA,QAAM4D,aAAcxL,KAAK6E,qB,CAO3B,YAAAqC,GACN,OAAOlH,KAAKgC,SAAWhC,KAAKP,MAAMG,OAAS,EAAII,KAAKP,QAAU,E"}
@@ -0,0 +1,2 @@
1
+ import{r as i,c as t,h as o,g as r}from"./p-6153045b.js";import{F as s}from"./p-d42c2025.js";import{h as e}from"./p-15559d38.js";import{E as n}from"./p-7d95def3.js";import{s as l}from"./p-8c0971e0.js";const a=':host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control .form-control__error-text{display:none}.form-control--has-label .form-control__label{display:inline-block;color:var(--six-input-label-color);font-weight:var(--six-font-weight-bold);margin-bottom:var(--six-spacing-x-small)}.form-control--has-label .form-control__label__required::after{color:var(--six-color-danger-800);content:"*"}.form-control--has-label.form-control--small .form-control__label{font-size:var(--six-input-label-font-size-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--six-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control_label{font-size:var(--six-input-label-font-size-large)}.form-control--has-help-text .form-control__help-text{display:block;color:var(--six-input-help-text-color);margin-top:var(--six-spacing-x-small)}.form-control--has-help-text .form-control__help-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--has-error-text .form-control__error-text{display:block;color:var(--six-color-danger-800);margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text .form-control__error-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text.form-control--small .form-control__error-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-error-text.form-control--medium .form-control__error-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-error-text.form-control--large .form-control__error-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--disabled .form-control__help-text{color:var(--six-input-help-text-color-disabled)}.form-control--disabled .form-control__label{color:var(--six-input-label-color-disabled)}.form-control--invalid:not(.form-control--disabled) .form-control__label{color:var(--six-input-label-color)}:host{display:block}.input{display:inline-flex;align-items:stretch;justify-content:start;position:relative;width:100%;font-family:var(--six-font-family);font-weight:var(--six-input-font-weight);letter-spacing:var(--six-input-letter-spacing);background-color:var(--six-input-background-color);border:solid var(--six-border-width) var(--six-input-border-color);vertical-align:middle;overflow:hidden;transition:var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;cursor:text}.input--line{border:none;border-bottom:solid var(--six-border-width) var(--six-input-border-color)}.input:hover:not(.input--disabled){background-color:var(--six-input-background-color-hover);border-color:var(--six-input-border-color-hover)}.input:hover:not(.input--disabled) .input__control{color:var(--six-input-color-hover)}.input.input--focused:not(.input--disabled){background-color:var(--six-input-background-color-focus);border-bottom-color:var(--six-input-border-color-focus);box-shadow:0 1px 0 0 var(--six-input-border-color-focus)}.input.input--focused:not(.input--disabled):not(.input--line){border-color:var(--six-input-border-color-focus);box-shadow:var(--six-input-focus-shadow)}.input.input--focused:not(.input--disabled) .input__control{color:var(--six-input-color-focus)}.input.input--disabled{background-color:var(--six-input-background-color-disabled);border-color:var(--six-input-border-color-disabled);cursor:not-allowed}.input.input--disabled .input__control{color:var(--six-input-color-disabled)}.input.input--disabled .input__control::placeholder{color:var(--six-input-placeholder-color-disabled)}.input.input--invalid:not(.input--disabled):not(.input--focused){border-bottom-color:var(--six-input-border-color-danger)}.input.input--invalid:not(.input--disabled):not(.input--focused):not(.input--line){border-color:var(--six-input-border-color-danger)}.input__control{flex:1 1 auto;font-family:inherit;font-size:inherit;font-weight:inherit;min-width:0;color:var(--six-input-color);border:none;background:none;box-shadow:none;padding:0;margin:0;cursor:inherit;-webkit-appearance:none}.input__control::-webkit-search-decoration,.input__control::-webkit-search-cancel-button,.input__control::-webkit-search-results-button,.input__control::-webkit-search-results-decoration{-webkit-appearance:none}.input__control:-webkit-autofill,.input__control:-webkit-autofill:hover,.input__control:-webkit-autofill:focus,.input__control:-webkit-autofill:active{box-shadow:0 0 0 var(--six-height-large) var(--six-input-background-color-hover) inset !important;-webkit-text-fill-color:var(--six-color-primary-500)}.input__control::placeholder{color:var(--six-input-placeholder-color);user-select:none}.input__control:focus{outline:none}.input__control::-ms-reveal{display:none}.input__prefix,.input__suffix{display:inline-flex;flex:0 0 auto;align-items:center;cursor:default}.input__prefix ::slotted(six-icon),.input__suffix ::slotted(six-icon){color:var(--six-input-icon-color)}.input.input--disabled ::slotted(six-icon){cursor:not-allowed}.input--small{border-radius:var(--six-input-border-radius-small);font-size:var(--six-input-font-size-small);height:var(--six-height-small)}.input--small .input__control{height:calc(var(--six-height-small) - var(--six-border-width) * 2);margin:0 var(--six-input-spacing-small)}.input--small .input__control__prefix{margin:0 var(--six-input-prefix-spacing-small)}.input--small .input__clear,.input--small .input__password-toggle{margin-right:var(--six-input-spacing-small)}.input--small .input__prefix ::slotted(*){margin-left:var(--six-input-prefix-spacing-small)}.input--small .input__suffix ::slotted(*){margin-right:var(--six-input-prefix-spacing-small)}.input--medium{border-radius:var(--six-input-border-radius-medium);font-size:var(--six-input-font-size-medium);height:var(--six-height-medium)}.input--medium .input__control{height:calc(var(--six-height-medium) - var(--six-border-width) * 2);margin:0 var(--six-input-spacing-medium)}.input--medium .input__control__prefix{margin:0 var(--six-input-prefix-spacing-medium)}.input--medium .input__clear,.input--medium .input__password-toggle{margin-right:var(--six-input-spacing-medium)}.input--medium .input__prefix ::slotted(*){margin-left:var(--six-input-prefix-spacing-medium)}.input--medium .input__suffix ::slotted(*){margin-right:var(--six-input-prefix-spacing-medium)}.input--large{border-radius:var(--six-input-border-radius-large);font-size:var(--six-input-font-size-large);height:var(--six-height-large)}.input--large .input__control{height:calc(var(--six-height-large) - var(--six-border-width) * 2);margin:0 var(--six-input-spacing-large)}.input--large .input__control__prefix{margin:0 var(--six-input-prefix-spacing-large)}.input--large .input__clear,.input--large .input__password-toggle{margin-right:var(--six-input-spacing-large)}.input--large .input__prefix ::slotted(*){margin-left:var(--six-input-prefix-spacing-large)}.input--large .input__suffix ::slotted(*){margin-right:var(--six-input-prefix-spacing-large)}.input--pill.input--small{border-radius:var(--six-height-small)}.input--pill.input--medium{border-radius:var(--six-height-medium)}.input--pill.input--large{border-radius:var(--six-height-large)}.input__clear,.input__password-toggle{display:inline-flex;align-items:center;font-size:inherit;color:var(--six-input-icon-color);border:none;background:none;padding:0;transition:var(--six-transition-fast) color;cursor:pointer}.input__clear:hover,.input__password-toggle:hover{color:var(--six-input-icon-color-hover)}.input__clear:focus,.input__password-toggle:focus{outline:none}.input--empty .input__clear{visibility:hidden}';const u={large:"medium",medium:"small",small:"xSmall"};let p=0;const h=class{constructor(o){i(this,o);this.sixChange=t(this,"six-input-change",7);this.sixClear=t(this,"six-input-clear",7);this.sixInput=t(this,"six-input-input",7);this.sixFocus=t(this,"six-input-focus",7);this.sixBlur=t(this,"six-input-blur",7);this.inputId=`input-${++p}`;this.labelId=`input-label-${p}`;this.helpTextId=`input-help-text-${p}`;this.errorTextId=`input-error-text-${p}`;this.eventListeners=new n;this.handleChange=i=>{i.stopPropagation();if(this.nativeInput!=null){this.value=this.nativeInput.value;this.sixChange.emit()}};this.handleInput=i=>{i.stopPropagation();if(this.nativeInput!=null){this.value=this.nativeInput.value;this.sixInput.emit()}};this.handleBlur=()=>{this.hasFocus=false;this.sixBlur.emit()};this.handleFocus=()=>{this.hasFocus=true;this.sixFocus.emit()};this.handleClearClick=i=>{this.value="";this.sixClear.emit();this.sixInput.emit();this.sixChange.emit();if(this.nativeInput!=null){this.nativeInput.focus()}i.stopPropagation()};this.handleKeyDown=i=>{const t=i.metaKey||i.ctrlKey||i.shiftKey||i.altKey;if(i.key==="Enter"&&!t){setTimeout((()=>{if(!i.defaultPrevented&&!i.isComposing){l(this.host)}}))}};this.handlePasswordToggle=()=>{this.isPasswordVisible=!this.isPasswordVisible};this.handleSlotChange=()=>{this.hasHelpTextSlot=e(this.host,"help-text");this.hasLabelSlot=e(this.host,"label")};this.hasFocus=false;this.hasHelpTextSlot=false;this.hasLabelSlot=false;this.isPasswordVisible=false;this.type="text";this.size="medium";this.name="";this.value="";this.pill=false;this.helpText="";this.placeholder=undefined;this.disabled=false;this.readonly=false;this.minlength=undefined;this.maxlength=undefined;this.min=undefined;this.max=undefined;this.step=undefined;this.pattern=undefined;this.required=false;this.autocapitalize="off";this.autocorrect="off";this.autocomplete="off";this.autofocus=false;this.spellcheck=false;this.label="";this.errorText="";this.invalid=false;this.clearable=false;this.togglePassword=false;this.inputmode=undefined;this.line=false}handleLabelChange(){this.handleSlotChange()}handleValueChange(){this.value=this.getValue();if(this.nativeInput!=null&&this.nativeInput.value!==this.value){this.nativeInput.value=this.value}}connectedCallback(){var i;(i=this.host.shadowRoot)===null||i===void 0?void 0:i.addEventListener("slotchange",this.handleSlotChange);this.eventListeners.forward("six-input-input","input",this.host);this.eventListeners.forward("six-input-change","change",this.host);this.eventListeners.forward("six-input-focus","focus",this.host);this.eventListeners.forward("six-input-blur","blur",this.host)}componentWillLoad(){this.handleSlotChange()}disconnectedCallback(){var i;(i=this.host.shadowRoot)===null||i===void 0?void 0:i.removeEventListener("slotchange",this.handleSlotChange);this.eventListeners.removeAll()}async setFocus(i){var t;(t=this.nativeInput)===null||t===void 0?void 0:t.focus(i)}async removeFocus(){var i;(i=this.nativeInput)===null||i===void 0?void 0:i.blur()}async select(){var i;return(i=this.nativeInput)===null||i===void 0?void 0:i.select()}async setSelectionRange(i,t,o="none"){var r;return(r=this.nativeInput)===null||r===void 0?void 0:r.setSelectionRange(i,t,o)}async setRangeText(i,t,o,r="preserve"){if(this.nativeInput==null){return}this.nativeInput.setRangeText(i,t,o,r);if(this.getValue()!==this.nativeInput.value){this.value=this.nativeInput.value;this.sixChange.emit();this.sixInput.emit()}}getValue(){var i;return((i=this.value)!==null&&i!==void 0?i:"").toString()}render(){return o(s,{inputId:this.inputId,label:this.label,labelId:this.labelId,hasLabelSlot:this.hasLabelSlot,helpTextId:this.helpTextId,helpText:this.helpText,hasHelpTextSlot:this.hasHelpTextSlot,errorTextId:this.errorTextId,errorText:this.errorText,size:this.size,disabled:this.disabled,required:this.required,displayError:this.invalid},o("div",{part:"base",class:{input:true,"input--small":this.size==="small","input--medium":this.size==="medium","input--large":this.size==="large","input--line":this.line,"input--pill":this.pill,"input--disabled":this.disabled,"input--focused":this.hasFocus,"input--empty":this.getValue().length===0,"input--invalid":this.invalid}},o("span",{part:"prefix",class:"input__prefix"},o("slot",{name:"prefix"})),o("input",{part:"input",ref:i=>this.nativeInput=i,id:this.inputId,size:1,class:{input__control:true,input__control__prefix:e(this.host,"prefix")},type:this.type==="password"&&this.isPasswordVisible?"text":this.type,name:this.name,placeholder:this.placeholder,disabled:this.disabled,readonly:this.readonly,minLength:this.minlength,maxLength:this.maxlength,min:this.min,max:this.max,step:this.step,value:this.getValue(),autoCapitalize:this.autocapitalize,autoComplete:this.autocomplete,autoCorrect:this.autocorrect,autoFocus:this.autofocus,spellcheck:this.spellcheck,pattern:this.pattern,required:this.required,inputMode:this.inputmode,"aria-labelledby":this.labelId,"aria-describedby":this.helpTextId,"aria-invalid":this.invalid?"true":"false",onChange:this.handleChange,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,"data-testid":"input-control"}),this.clearable&&o("button",{part:"clear-button",class:"input__clear",type:"button",onClick:this.handleClearClick,tabindex:"-1","data-testid":"input-clear-button"},o("slot",{name:"clear-icon"},o("six-icon",{size:u[this.size]},"clear"))),this.togglePassword&&o("button",{part:"password-toggle-button",class:"input__password-toggle",type:"button",onClick:this.handlePasswordToggle,tabindex:"-1"},this.isPasswordVisible?o("slot",{name:"show-password-icon"},o("six-icon",{size:u[this.size]},"visibility_off")):o("slot",{name:"hide-password-icon"},o("six-icon",{size:u[this.size]},"visibility"))),o("span",{part:"suffix",class:"input__suffix"},o("slot",{name:"suffix"}))))}get host(){return r(this)}static get watchers(){return{helpText:["handleLabelChange"],errorText:["handleLabelChange"],label:["handleLabelChange"],value:["handleValueChange"]}}};h.style=a;export{h as six_input};
2
+ //# sourceMappingURL=p-9f0b43f9.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["sixInputCss","ICON_SIZES","large","medium","small","id","SixInput","this","inputId","labelId","helpTextId","errorTextId","eventListeners","EventListeners","handleChange","event","stopPropagation","nativeInput","value","sixChange","emit","handleInput","sixInput","handleBlur","hasFocus","sixBlur","handleFocus","sixFocus","handleClearClick","sixClear","focus","handleKeyDown","hasModifier","metaKey","ctrlKey","shiftKey","altKey","key","setTimeout","defaultPrevented","isComposing","submitForm","host","handlePasswordToggle","isPasswordVisible","handleSlotChange","hasHelpTextSlot","hasSlot","hasLabelSlot","handleLabelChange","handleValueChange","getValue","connectedCallback","_a","shadowRoot","addEventListener","forward","componentWillLoad","disconnectedCallback","removeEventListener","removeAll","setFocus","options","removeFocus","blur","select","setSelectionRange","selectionStart","selectionEnd","selectionDirection","setRangeText","replacement","start","end","selectMode","toString","render","h","FormControl","label","helpText","errorText","size","disabled","required","displayError","invalid","part","class","input","line","pill","length","name","ref","el","input__control","input__control__prefix","type","placeholder","readonly","minLength","minlength","maxLength","maxlength","min","max","step","autoCapitalize","autocapitalize","autoComplete","autocomplete","autoCorrect","autocorrect","autoFocus","autofocus","spellcheck","pattern","inputMode","inputmode","onChange","onInput","onFocus","onBlur","onKeyDown","clearable","onClick","tabindex","togglePassword"],"sources":["src/components/six-input/six-input.scss?tag=six-input&encapsulation=shadow","src/components/six-input/six-input.tsx"],"sourcesContent":["@import 'src/global/component';\n@import '../../functional-components/form-control/form-control';\n\n:host {\n display: block;\n}\n\n.input {\n display: inline-flex;\n align-items: stretch;\n justify-content: start;\n position: relative;\n width: 100%;\n font-family: var(--six-font-family);\n font-weight: var(--six-input-font-weight);\n letter-spacing: var(--six-input-letter-spacing);\n background-color: var(--six-input-background-color);\n border: solid var(--six-border-width) var(--six-input-border-color);\n vertical-align: middle;\n overflow: hidden;\n transition: var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;\n cursor: text;\n\n &--line {\n border: none;\n border-bottom: solid var(--six-border-width) var(--six-input-border-color);\n }\n\n &:hover:not(.input--disabled) {\n background-color: var(--six-input-background-color-hover);\n border-color: var(--six-input-border-color-hover);\n\n .input__control {\n color: var(--six-input-color-hover);\n }\n }\n\n &.input--focused:not(.input--disabled) {\n background-color: var(--six-input-background-color-focus);\n\n border-bottom-color: var(--six-input-border-color-focus);\n box-shadow: 0 1px 0 0 var(--six-input-border-color-focus);\n\n &:not(.input--line) {\n border-color: var(--six-input-border-color-focus);\n box-shadow: var(--six-input-focus-shadow);\n }\n\n .input__control {\n color: var(--six-input-color-focus);\n }\n }\n\n &.input--disabled {\n background-color: var(--six-input-background-color-disabled);\n border-color: var(--six-input-border-color-disabled);\n cursor: not-allowed;\n\n .input__control {\n color: var(--six-input-color-disabled);\n\n &::placeholder {\n color: var(--six-input-placeholder-color-disabled);\n }\n }\n }\n\n &.input--invalid:not(.input--disabled):not(.input--focused) {\n border-bottom-color: var(--six-input-border-color-danger);\n\n &:not(.input--line) {\n border-color: var(--six-input-border-color-danger);\n }\n }\n}\n\n.input__control {\n flex: 1 1 auto;\n font-family: inherit;\n font-size: inherit;\n font-weight: inherit;\n min-width: 0;\n color: var(--six-input-color);\n border: none;\n background: none;\n box-shadow: none;\n padding: 0;\n margin: 0;\n cursor: inherit;\n -webkit-appearance: none;\n\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n -webkit-appearance: none;\n }\n\n &:-webkit-autofill,\n &:-webkit-autofill:hover,\n &:-webkit-autofill:focus,\n &:-webkit-autofill:active {\n box-shadow: 0 0 0 var(--six-height-large) var(--six-input-background-color-hover) inset !important;\n -webkit-text-fill-color: var(--six-color-primary-500);\n }\n\n &::placeholder {\n color: var(--six-input-placeholder-color);\n user-select: none;\n }\n\n &:focus {\n outline: none;\n }\n\n &::-ms-reveal {\n display: none;\n }\n}\n\n.input__prefix,\n.input__suffix {\n display: inline-flex;\n flex: 0 0 auto;\n align-items: center;\n cursor: default;\n\n ::slotted(six-icon) {\n color: var(--six-input-icon-color);\n }\n}\n\n.input {\n &.input--disabled {\n ::slotted(six-icon) {\n cursor: not-allowed;\n }\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Size modifiers\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.input--small {\n border-radius: var(--six-input-border-radius-small);\n font-size: var(--six-input-font-size-small);\n height: var(--six-height-small);\n\n .input__control {\n height: calc(var(--six-height-small) - var(--six-border-width) * 2);\n margin: 0 var(--six-input-spacing-small);\n }\n\n .input__control__prefix {\n margin: 0 var(--six-input-prefix-spacing-small);\n }\n\n .input__clear,\n .input__password-toggle {\n margin-right: var(--six-input-spacing-small);\n }\n\n .input__prefix ::slotted(*) {\n margin-left: var(--six-input-prefix-spacing-small);\n }\n\n .input__suffix ::slotted(*) {\n margin-right: var(--six-input-prefix-spacing-small);\n }\n}\n\n.input--medium {\n border-radius: var(--six-input-border-radius-medium);\n font-size: var(--six-input-font-size-medium);\n height: var(--six-height-medium);\n\n .input__control {\n height: calc(var(--six-height-medium) - var(--six-border-width) * 2);\n margin: 0 var(--six-input-spacing-medium);\n }\n\n .input__control__prefix {\n margin: 0 var(--six-input-prefix-spacing-medium);\n }\n\n .input__clear,\n .input__password-toggle {\n margin-right: var(--six-input-spacing-medium);\n }\n\n .input__prefix ::slotted(*) {\n margin-left: var(--six-input-prefix-spacing-medium);\n }\n\n .input__suffix ::slotted(*) {\n margin-right: var(--six-input-prefix-spacing-medium);\n }\n}\n\n.input--large {\n border-radius: var(--six-input-border-radius-large);\n font-size: var(--six-input-font-size-large);\n height: var(--six-height-large);\n\n .input__control {\n height: calc(var(--six-height-large) - var(--six-border-width) * 2);\n margin: 0 var(--six-input-spacing-large);\n }\n\n .input__control__prefix {\n margin: 0 var(--six-input-prefix-spacing-large);\n }\n\n .input__clear,\n .input__password-toggle {\n margin-right: var(--six-input-spacing-large);\n }\n\n .input__prefix ::slotted(*) {\n margin-left: var(--six-input-prefix-spacing-large);\n }\n\n .input__suffix ::slotted(*) {\n margin-right: var(--six-input-prefix-spacing-large);\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Pill modifier\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.input--pill {\n &.input--small {\n border-radius: var(--six-height-small);\n }\n\n &.input--medium {\n border-radius: var(--six-height-medium);\n }\n\n &.input--large {\n border-radius: var(--six-height-large);\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Clearable + Password Toggle\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.input__clear,\n.input__password-toggle {\n display: inline-flex;\n align-items: center;\n font-size: inherit;\n color: var(--six-input-icon-color);\n border: none;\n background: none;\n padding: 0;\n transition: var(--six-transition-fast) color;\n cursor: pointer;\n\n &:hover {\n color: var(--six-input-icon-color-hover);\n }\n\n &:focus {\n outline: none;\n }\n}\n\n.input--empty .input__clear {\n visibility: hidden;\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport FormControl from '../../functional-components/form-control/form-control';\nimport { hasSlot } from '../../utils/slot';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\nimport { submitForm } from '../../utils/form';\n\nconst ICON_SIZES: Record<'small' | 'medium' | 'large', 'xSmall' | 'small' | 'medium'> = {\n large: 'medium',\n medium: 'small',\n small: 'xSmall',\n};\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot label - The input's label. Alternatively, you can use the label prop.\n * @slot prefix - Used to prepend an icon or similar element to the input.\n * @slot suffix - Used to append an icon or similar element to the input.\n * @slot clear-icon - An icon to use in lieu of the default clear icon.\n * @slot show-password-icon - An icon to use in lieu of the default show password icon.\n * @slot hide-password-icon - An icon to use in lieu of the default hide password icon.\n * @slot help-text - Help text that describes how to use the input. Alternatively, you can use the help-text prop.\n *\n * @part base - The component's base wrapper.\n * @part form-control - The form control that wraps the label, input, and help-text.\n * @part label - The input label.\n * @part input - The input control.\n * @part prefix - The input prefix container.\n * @part clear-button - The clear button.\n * @part password-toggle-button - The password toggle button.\n * @part suffix - The input suffix container.\n * @part help-text - The input help text.\n */\n\n@Component({\n tag: 'six-input',\n styleUrl: 'six-input.scss',\n shadow: true,\n})\nexport class SixInput {\n private inputId = `input-${++id}`;\n private labelId = `input-label-${id}`;\n private helpTextId = `input-help-text-${id}`;\n private errorTextId = `input-error-text-${id}`;\n private nativeInput?: HTMLInputElement;\n private eventListeners = new EventListeners();\n\n @Element() host!: HTMLSixInputElement;\n\n @State() hasFocus = false;\n @State() hasHelpTextSlot = false;\n @State() hasLabelSlot = false;\n @State() isPasswordVisible = false;\n\n /** The input's type. */\n @Prop({ reflect: true }) type: 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url' = 'text';\n\n /** The input's size. */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** The input's name attribute. */\n @Prop({ reflect: true }) name = '';\n\n /** The input's value attribute. */\n @Prop({ mutable: true, reflect: true }) value = '';\n\n /** Set to true to draw a pill-style input with rounded edges. */\n @Prop({ reflect: true }) pill = false;\n\n /** The input's help text. Alternatively, you can use the help-text slot. */\n @Prop() helpText = '';\n\n /** The input's placeholder text. */\n @Prop() placeholder?: string;\n\n /** Set to true to disable the input. */\n @Prop({ reflect: true }) disabled = false;\n\n /** Set to true to make the input readonly. */\n @Prop({ reflect: true }) readonly = false;\n\n /** The minimum length of input that will be considered valid. */\n @Prop({ reflect: true }) minlength?: number;\n\n /** The maximum length of input that will be considered valid. */\n @Prop({ reflect: true }) maxlength?: number;\n\n /** The input's minimum value. */\n @Prop({ reflect: true }) min?: number;\n\n /** The input's maximum value. */\n @Prop({ reflect: true }) max?: number;\n\n /** The input's step attribute. */\n @Prop({ reflect: true }) step?: number;\n\n /** A pattern to validate input against. */\n @Prop({ reflect: true }) pattern?: string;\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /** The input's autocaptialize attribute. */\n @Prop() autocapitalize = 'off';\n\n /** The input's autocorrect attribute. */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /** The input's autocomplete attribute. */\n @Prop() autocomplete = 'off';\n\n /** The input's autofocus attribute. */\n @Prop() autofocus = false;\n\n /** Enables spell checking on the input. */\n @Prop() spellcheck = false;\n\n /** The label text. */\n @Prop() label = '';\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText = '';\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** Set to true to add a clear button when the input is populated. */\n @Prop() clearable = false;\n\n /** Set to true to add a password toggle button for password inputs. */\n @Prop() togglePassword = false;\n\n /** The input's inputmode attribute. */\n @Prop() inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n\n /** Set to render as line */\n @Prop() line = false;\n\n @Watch('helpText')\n @Watch('errorText')\n @Watch('label')\n handleLabelChange() {\n this.handleSlotChange();\n }\n\n @Watch('value')\n handleValueChange() {\n this.value = this.getValue();\n if (this.nativeInput != null && this.nativeInput.value !== this.value) {\n this.nativeInput.value = this.value;\n }\n }\n\n /** Emitted when the control's value changes. Access the new value via event.target.value. */\n @Event({ eventName: 'six-input-change' }) sixChange!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the clear button is activated. */\n @Event({ eventName: 'six-input-clear' }) sixClear!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control receives input. Access the new value via event.target.value. */\n @Event({ eventName: 'six-input-input' }) sixInput!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-input-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control loses focus. Access the new value via event.target.value. */\n @Event({ eventName: 'six-input-blur' }) sixBlur!: EventEmitter<EmptyPayload>;\n\n connectedCallback() {\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.forward('six-input-input', 'input', this.host);\n this.eventListeners.forward('six-input-change', 'change', this.host);\n this.eventListeners.forward('six-input-focus', 'focus', this.host);\n this.eventListeners.forward('six-input-blur', 'blur', this.host);\n }\n\n componentWillLoad() {\n this.handleSlotChange();\n }\n\n disconnectedCallback() {\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.removeAll();\n }\n\n /** Sets focus on the input. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.nativeInput?.focus(options);\n }\n\n /** Removes focus from the input. */\n @Method()\n async removeFocus() {\n this.nativeInput?.blur();\n }\n\n /** Selects all the text in the input. */\n @Method()\n async select() {\n return this.nativeInput?.select();\n }\n\n /** Sets the start and end positions of the text selection (0-based). */\n @Method()\n async setSelectionRange(\n selectionStart: number,\n selectionEnd: number,\n selectionDirection: 'forward' | 'backward' | 'none' = 'none'\n ) {\n return this.nativeInput?.setSelectionRange(selectionStart, selectionEnd, selectionDirection);\n }\n\n /** Replaces a range of text with a new string. */\n @Method()\n async setRangeText(\n replacement: string,\n start: number,\n end: number,\n selectMode: 'select' | 'start' | 'end' | 'preserve' = 'preserve'\n ) {\n if (this.nativeInput == null) {\n return;\n }\n this.nativeInput.setRangeText(replacement, start, end, selectMode);\n if (this.getValue() !== this.nativeInput.value) {\n this.value = this.nativeInput.value;\n this.sixChange.emit();\n this.sixInput.emit();\n }\n }\n\n private handleChange = (event: Event) => {\n event.stopPropagation();\n if (this.nativeInput != null) {\n this.value = this.nativeInput.value;\n this.sixChange.emit();\n }\n };\n\n private handleInput = (event: Event) => {\n event.stopPropagation();\n if (this.nativeInput != null) {\n this.value = this.nativeInput.value;\n this.sixInput.emit();\n }\n };\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.sixBlur.emit();\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.sixFocus.emit();\n };\n\n private handleClearClick = (event: MouseEvent) => {\n this.value = '';\n this.sixClear.emit();\n this.sixInput.emit();\n this.sixChange.emit();\n if (this.nativeInput != null) {\n this.nativeInput.focus();\n }\n event.stopPropagation();\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n const hasModifier = event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;\n if (event.key === 'Enter' && !hasModifier) {\n setTimeout(() => {\n if (!event.defaultPrevented && !event.isComposing) {\n submitForm(this.host);\n }\n });\n }\n };\n\n private handlePasswordToggle = () => {\n this.isPasswordVisible = !this.isPasswordVisible;\n };\n\n private handleSlotChange = () => {\n this.hasHelpTextSlot = hasSlot(this.host, 'help-text');\n this.hasLabelSlot = hasSlot(this.host, 'label');\n };\n\n private getValue(): string {\n return (this.value ?? '').toString();\n }\n\n render() {\n return (\n <FormControl\n inputId={this.inputId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={this.hasLabelSlot}\n helpTextId={this.helpTextId}\n helpText={this.helpText}\n hasHelpTextSlot={this.hasHelpTextSlot}\n errorTextId={this.errorTextId}\n errorText={this.errorText}\n size={this.size}\n disabled={this.disabled}\n required={this.required}\n displayError={this.invalid}\n >\n <div\n part=\"base\"\n class={{\n input: true,\n\n // Sizes\n 'input--small': this.size === 'small',\n 'input--medium': this.size === 'medium',\n 'input--large': this.size === 'large',\n\n // States\n 'input--line': this.line,\n 'input--pill': this.pill,\n 'input--disabled': this.disabled,\n 'input--focused': this.hasFocus,\n 'input--empty': this.getValue().length === 0,\n 'input--invalid': this.invalid,\n }}\n >\n <span part=\"prefix\" class=\"input__prefix\">\n <slot name=\"prefix\" />\n </span>\n\n <input\n part=\"input\"\n ref={(el) => (this.nativeInput = el)}\n id={this.inputId}\n size={1} // needed for firefox to overrule the default of 20\n class={{\n input__control: true,\n input__control__prefix: hasSlot(this.host, 'prefix'),\n }}\n type={this.type === 'password' && this.isPasswordVisible ? 'text' : this.type}\n name={this.name}\n placeholder={this.placeholder}\n disabled={this.disabled}\n readonly={this.readonly}\n minLength={this.minlength}\n maxLength={this.maxlength}\n min={this.min}\n max={this.max}\n step={this.step}\n value={this.getValue()}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n spellcheck={this.spellcheck}\n pattern={this.pattern}\n required={this.required}\n inputMode={this.inputmode}\n aria-labelledby={this.labelId}\n aria-describedby={this.helpTextId}\n aria-invalid={this.invalid ? 'true' : 'false'}\n onChange={this.handleChange}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n onKeyDown={this.handleKeyDown}\n data-testid=\"input-control\"\n />\n\n {this.clearable && (\n <button\n part=\"clear-button\"\n class=\"input__clear\"\n type=\"button\"\n onClick={this.handleClearClick}\n tabindex=\"-1\"\n data-testid=\"input-clear-button\"\n >\n <slot name=\"clear-icon\">\n <six-icon size={ICON_SIZES[this.size]}>clear</six-icon>\n </slot>\n </button>\n )}\n\n {this.togglePassword && (\n <button\n part=\"password-toggle-button\"\n class=\"input__password-toggle\"\n type=\"button\"\n onClick={this.handlePasswordToggle}\n tabindex=\"-1\"\n >\n {this.isPasswordVisible ? (\n <slot name=\"show-password-icon\">\n <six-icon size={ICON_SIZES[this.size]}>visibility_off</six-icon>\n </slot>\n ) : (\n <slot name=\"hide-password-icon\">\n <six-icon size={ICON_SIZES[this.size]}>visibility</six-icon>\n </slot>\n )}\n </button>\n )}\n\n <span part=\"suffix\" class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vH,KAAKoC,qBACdoF,SAAS,MAERxH,KAAKqC,kBACJiC,EAAA,QAAMgB,KAAK,sBACThB,EAAA,YAAUK,KAAMjF,EAAWM,KAAK2E,OAAK,mBAGvCL,EAAA,QAAMgB,KAAK,sBACThB,EAAA,YAAUK,KAAMjF,EAAWM,KAAK2E,OAAK,gBAM7CL,EAAA,QAAMU,KAAK,SAASC,MAAM,iBACxBX,EAAA,QAAMgB,KAAK,a"}
@@ -0,0 +1,2 @@
1
+ import{r,c as a,h as i}from"./p-6153045b.js";const s=":host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}:host{display:inline-block;overflow:hidden}.tag{display:flex;align-items:center;border:solid 1px;font-family:var(--six-font-family);line-height:1;white-space:nowrap;user-select:none;cursor:default}.tag__content{text-overflow:ellipsis;overflow:hidden}.tag__clear::part(base){color:inherit;padding:0}.tag--info{color:var(--six-color-white);background-color:var(--six-color-web-rock-900);border-color:var(--six-color-web-rock-900)}.tag--success{color:var(--six-color-web-rock-900);border-color:var(--six-color-success-500);background-color:var(--six-color-success-500)}.tag--primary{color:var(--six-color-web-rock-900);border-color:var(--six-color-clay-50);background-color:var(--six-color-clay-50)}.tag--warning{color:var(--six-color-web-rock-900);border-color:var(--six-color-warning-700);background-color:var(--six-color-warning-700)}.tag--danger{color:var(--six-color-white);border-color:var(--six-color-danger-800);background-color:var(--six-color-danger-800)}.tag--action{color:var(--six-color-white);border-color:var(--six-color-action-500);background-color:var(--six-color-action-500)}.tag--small{font-size:var(--six-button-font-size-small);height:calc(var(--six-height-small) * 0.8);line-height:calc(var(--six-height-small) - var(--six-border-width) * 2);border-radius:var(--six-input-border-radius-small);padding:0 var(--six-spacing-x-small)}.tag--small .tag__clear{margin-left:var(--six-spacing-xx-small);margin-right:calc(-1 * var(--six-spacing-xxx-small))}.tag--medium{font-size:var(--six-button-font-size-medium);height:calc(var(--six-height-medium) * 0.8);line-height:calc(var(--six-height-medium) - var(--six-border-width) * 2);border-radius:var(--six-input-border-radius-medium);padding:0 var(--six-spacing-small)}.tag--medium .tag__clear{margin-left:var(--six-spacing-xx-small);margin-right:calc(-1 * var(--six-spacing-xx-small))}.tag--large{font-size:var(--six-button-font-size-large);height:calc(var(--six-height-large) * 0.8);line-height:calc(var(--six-height-large) - var(--six-border-width) * 2);border-radius:var(--six-input-border-radius-large);padding:0 var(--six-spacing-medium)}.tag--large .tag__clear{margin-left:var(--six-spacing-xx-small);margin-right:calc(-1 * var(--six-spacing-x-small))}.tag--pill{border-radius:var(--six-border-radius-pill)}";const o=class{constructor(i){r(this,i);this.sixClear=a(this,"six-tag-clear",7);this.handleClearClick=()=>{this.sixClear.emit()};this.type="primary";this.size="medium";this.pill=false;this.clearable=false}render(){return i("span",{part:"base",class:{tag:true,"tag--primary":this.type==="primary","tag--success":this.type==="success","tag--info":this.type==="info","tag--warning":this.type==="warning","tag--danger":this.type==="danger","tag--action":this.type==="action","tag--text":this.type==="text","tag--small":this.size==="small","tag--medium":this.size==="medium","tag--large":this.size==="large","tag--pill":this.pill,"tag--clear":this.clearable}},i("span",{part:"content",class:"tag__content"},i("slot",null)),this.clearable&&i("six-icon-button",{exportparts:"base:clear-button",size:"xSmall",name:"clear",class:"tag__clear",onClick:this.handleClearClick}))}};o.style=s;export{o as six_tag};
2
+ //# sourceMappingURL=p-b550a258.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["sixTagCss","SixTag","this","handleClearClick","sixClear","emit","render","h","part","class","tag","type","size","pill","clearable","exportparts","name","onClick"],"sources":["src/components/six-tag/six-tag.scss?tag=six-tag&encapsulation=shadow","src/components/six-tag/six-tag.tsx"],"sourcesContent":["@import 'src/global/component';\n\n:host {\n display: inline-block;\n overflow: hidden;\n}\n\n.tag {\n display: flex;\n align-items: center;\n border: solid 1px;\n font-family: var(--six-font-family);\n line-height: 1;\n white-space: nowrap;\n user-select: none;\n cursor: default;\n}\n\n.tag__content {\n text-overflow: ellipsis;\n overflow: hidden;\n}\n\n.tag__clear::part(base) {\n color: inherit;\n padding: 0;\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Type modifiers\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.tag--info {\n color: var(--six-color-white);\n background-color: var(--six-color-web-rock-900);\n border-color: var(--six-color-web-rock-900);\n}\n\n.tag--success {\n color: var(--six-color-web-rock-900);\n border-color: var(--six-color-success-500);\n background-color: var(--six-color-success-500);\n}\n\n.tag--primary {\n color: var(--six-color-web-rock-900);\n border-color: var(--six-color-clay-50);\n background-color: var(--six-color-clay-50);\n}\n\n.tag--warning {\n color: var(--six-color-web-rock-900);\n border-color: var(--six-color-warning-700);\n background-color: var(--six-color-warning-700);\n}\n\n.tag--danger {\n color: var(--six-color-white);\n border-color: var(--six-color-danger-800);\n background-color: var(--six-color-danger-800);\n}\n\n.tag--action {\n color: var(--six-color-white);\n border-color: var(--six-color-action-500);\n background-color: var(--six-color-action-500);\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Size modifiers\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.tag--small {\n font-size: var(--six-button-font-size-small);\n height: calc(var(--six-height-small) * 0.8);\n line-height: calc(var(--six-height-small) - var(--six-border-width) * 2);\n border-radius: var(--six-input-border-radius-small);\n padding: 0 var(--six-spacing-x-small);\n\n .tag__clear {\n margin-left: var(--six-spacing-xx-small);\n margin-right: calc(-1 * var(--six-spacing-xxx-small));\n }\n}\n\n.tag--medium {\n font-size: var(--six-button-font-size-medium);\n height: calc(var(--six-height-medium) * 0.8);\n line-height: calc(var(--six-height-medium) - var(--six-border-width) * 2);\n border-radius: var(--six-input-border-radius-medium);\n padding: 0 var(--six-spacing-small);\n\n .tag__clear {\n margin-left: var(--six-spacing-xx-small);\n margin-right: calc(-1 * var(--six-spacing-xx-small));\n }\n}\n\n.tag--large {\n font-size: var(--six-button-font-size-large);\n height: calc(var(--six-height-large) * 0.8);\n line-height: calc(var(--six-height-large) - var(--six-border-width) * 2);\n border-radius: var(--six-input-border-radius-large);\n padding: 0 var(--six-spacing-medium);\n\n .tag__clear {\n margin-left: var(--six-spacing-xx-small);\n margin-right: calc(-1 * var(--six-spacing-x-small));\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Pill modifier\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.tag--pill {\n border-radius: var(--six-border-radius-pill);\n}\n","import { Component, Event, EventEmitter, h, Prop } from '@stencil/core';\nimport { EmptyPayload } from '../../utils/types';\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The tag's content.\n *\n * @part base - The component's base wrapper.\n * @part content - The tag content.\n * @part clear-button - The clear button.\n */\n\n@Component({\n tag: 'six-tag',\n styleUrl: 'six-tag.scss',\n shadow: true,\n})\nexport class SixTag {\n /** The tag's type. */\n @Prop({ reflect: true }) type: 'primary' | 'success' | 'info' | 'warning' | 'danger' | 'action' | 'text' = 'primary';\n\n /** The tag's size. */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Set to true to draw a pill-style tag with rounded edges. */\n @Prop({ reflect: true }) pill = false;\n\n /** Set to true to make the tag clearable. */\n @Prop({ reflect: true }) clearable = false;\n\n /** Emitted when the clear button is activated. */\n @Event({ eventName: 'six-tag-clear' }) sixClear!: EventEmitter<EmptyPayload>;\n\n private handleClearClick = () => {\n this.sixClear.emit();\n };\n\n render() {\n return (\n <span\n part=\"base\"\n class={{\n tag: true,\n\n // Types\n 'tag--primary': this.type === 'primary',\n 'tag--success': this.type === 'success',\n 'tag--info': this.type === 'info',\n 'tag--warning': this.type === 'warning',\n 'tag--danger': this.type === 'danger',\n 'tag--action': this.type === 'action',\n 'tag--text': this.type === 'text',\n\n // Sizes\n 'tag--small': this.size === 'small',\n 'tag--medium': this.size === 'medium',\n 'tag--large': this.size === 'large',\n\n // Modifers\n 'tag--pill': this.pill,\n 'tag--clear': this.clearable,\n }}\n >\n <span part=\"content\" class=\"tag__content\">\n <slot />\n </span>\n\n {this.clearable && (\n <six-icon-button\n exportparts=\"base:clear-button\"\n size=\"xSmall\"\n name=\"clear\"\n class=\"tag__clear\"\n onClick={this.handleClearClick}\n />\n )}\n </span>\n );\n }\n}\n"],"mappings":"6CAAA,MAAMA,EAAY,00E,MCqBLC,EAAM,M,iEAgBTC,KAAAC,iBAAmB,KACzBD,KAAKE,SAASC,MAAM,E,UAfqF,U,UAG7C,S,UAG9B,M,eAGK,K,CASrC,MAAAC,GACE,OACEC,EAAA,QACEC,KAAK,OACLC,MAAO,CACLC,IAAK,KAGL,eAAgBR,KAAKS,OAAS,UAC9B,eAAgBT,KAAKS,OAAS,UAC9B,YAAaT,KAAKS,OAAS,OAC3B,eAAgBT,KAAKS,OAAS,UAC9B,cAAeT,KAAKS,OAAS,SAC7B,cAAeT,KAAKS,OAAS,SAC7B,YAAaT,KAAKS,OAAS,OAG3B,aAAcT,KAAKU,OAAS,QAC5B,cAAeV,KAAKU,OAAS,SAC7B,aAAcV,KAAKU,OAAS,QAG5B,YAAaV,KAAKW,KAClB,aAAcX,KAAKY,YAGrBP,EAAA,QAAMC,KAAK,UAAUC,MAAM,gBACzBF,EAAA,cAGDL,KAAKY,WACJP,EAAA,mBACEQ,YAAY,oBACZH,KAAK,SACLI,KAAK,QACLP,MAAM,aACNQ,QAASf,KAAKC,mB"}
@@ -1,2 +1,2 @@
1
- import{p as e,b as a}from"./p-6153045b.js";export{s as setNonce}from"./p-6153045b.js";const i=()=>{const a=import.meta.url;const i={};if(a!==""){i.resourcesUrl=new URL(".",a).href}return e(i)};i().then((e=>a(JSON.parse('[["p-2451cfdc",[[1,"six-select",{"multiple":[4],"maxTagsVisible":[2,"max-tags-visible"],"disabled":[4],"name":[1],"placeholder":[1],"filterPlaceholder":[1,"filter-placeholder"],"filterDebounce":[2,"filter-debounce"],"size":[1],"hoist":[4],"value":[1025],"pill":[4],"helpText":[1,"help-text"],"required":[4],"clearable":[4],"label":[1],"errorText":[1,"error-text"],"invalid":[516],"line":[4],"filter":[4],"asyncFilter":[4,"async-filter"],"autocomplete":[4],"inputDebounce":[2,"input-debounce"],"options":[16],"virtualScroll":[4,"virtual-scroll"],"hasFocus":[32],"hasHelpTextSlot":[32],"hasLabelSlot":[32],"isOpen":[32],"displayLabel":[32],"displayTags":[32],"setFocus":[64]}]]],["p-ae601a0f",[[1,"six-header",{"shiftContent":[4,"shift-content"],"openHamburgerMenu":[4,"open-hamburger-menu"],"openSearch":[4,"open-search"],"clickableLogo":[4,"clickable-logo"],"selectedApp":[32],"selectedSection":[32],"setSearchOpenState":[64],"getIsSearchOpen":[64]}]]],["p-ed381ad9",[[1,"six-datepicker",{"type":[1],"locale":[1],"open":[1540],"inline":[516],"readonly":[4],"disabled":[4],"allowedDates":[16],"min":[16],"max":[16],"closeOnSelect":[4,"close-on-select"],"placement":[1],"size":[1],"required":[4],"defaultDate":[1,"default-date"],"placeholder":[1],"value":[1040],"label":[1],"errorText":[1,"error-text"],"invalid":[516],"containingElement":[16],"dateFormat":[1,"date-format"],"debounce":[2],"name":[513],"clearable":[4],"iconPosition":[1,"icon-position"],"hoist":[4],"pointerDate":[32],"selectionMode":[32],"isDropDownContentUp":[32],"setFocus":[64],"select":[64]},[[9,"resize","resizeHandler"],[9,"scroll","scrollHandler"]]]]],["p-a55c7258",[[1,"six-root",{"breakpoint":[2],"padded":[4],"stage":[1],"version":[1],"collapse":[32]}]]],["p-c03ebf7d",[[1,"six-tile",{"label":[1],"iconName":[1,"icon-name"],"closeable":[4],"elevated":[4],"disableTooltip":[4,"disable-tooltip"],"disabled":[516],"size":[513],"visible":[32],"hasIconSlot":[32],"hasLabelSlot":[32],"hide":[64],"show":[64]}]]],["p-411ed539",[[1,"six-alert",{"open":[1540],"closable":[516],"type":[513],"duration":[2],"isVisible":[32],"show":[64],"hide":[64],"toast":[64]}]]],["p-19ed7a4c",[[1,"six-dialog",{"open":[1540],"label":[1],"noHeader":[4,"no-header"],"hasFooter":[32],"isVisible":[32],"show":[64],"hide":[64]}]]],["p-99e24daf",[[1,"six-drawer",{"open":[1540],"label":[1],"placement":[1],"contained":[4],"noHeader":[4,"no-header"],"hasFooter":[32],"isVisible":[32],"show":[64],"hide":[64]}]]],["p-37557787",[[1,"six-search-field",{"placeholder":[1],"debounce":[514],"disabled":[516],"value":[513],"clearable":[4]}]]],["p-83864cfe",[[1,"six-sidebar-item-group",{"name":[1],"icon":[1],"value":[513],"open":[516],"summaryIcon":[1,"summary-icon"],"hasItems":[32],"summaryIconHasContent":[32]}]]],["p-29ac3d7d",[[1,"six-tab",{"panel":[513],"active":[516],"closable":[4],"disabled":[516],"setFocus":[64],"removeFocus":[64]}]]],["p-4705a51e",[[1,"six-tab-group",{"placement":[1],"noScrollControls":[4,"no-scroll-controls"],"hasScrollControls":[32],"show":[64]}]]],["p-878226a0",[[1,"six-avatar",{"image":[1],"alt":[1],"initials":[1],"shape":[1],"hasError":[32]}]]],["p-ee8342e1",[[1,"six-button",{"type":[513],"size":[513],"caret":[4],"disabled":[516],"loading":[516],"pill":[516],"circle":[516],"submit":[516],"reset":[516],"name":[1],"value":[1],"href":[1],"target":[1],"download":[1],"hasFocus":[32],"hasLabel":[32],"hasPrefix":[32],"hasSuffix":[32],"setFocus":[64],"removeFocus":[64]}]]],["p-9b354f5d",[[1,"six-error-page",{"errorCode":[2,"error-code"],"language":[1],"customTitle":[1,"custom-title"],"customDescription":[16],"customIcon":[1,"custom-icon"]}]]],["p-5af44076",[[1,"six-file-list-item",{"identifier":[513],"name":[513],"date":[513],"size":[514],"nodownload":[516],"nodelete":[516]}]]],["p-cdaed936",[[2,"six-file-upload",{"compact":[4],"label":[1],"disabled":[4],"accept":[1],"multiple":[4],"maxFileSize":[2,"max-file-size"],"isOver":[32]},[[1,"dragenter","dragenterHandler"],[1,"dragover","dragoverHandler"],[1,"dragleave","dragleaveHandler"],[1,"drop","dropHandler"]]]]],["p-a0f290d0",[[1,"six-badge",{"type":[1],"pill":[4],"pulse":[4]}]]],["p-613283a7",[[1,"six-card"]]],["p-bf87464b",[[1,"six-checkbox",{"name":[1],"value":[1],"disabled":[4],"required":[4],"label":[1],"errorText":[1,"error-text"],"invalid":[516],"checked":[1540],"indeterminate":[1540],"hasFocus":[32],"hasLabelSlot":[32],"setFocus":[64],"removeFocus":[64]}]]],["p-dfed33c5",[[1,"six-file-list"]]],["p-1d5ee1a0",[[1,"six-footer"]]],["p-d367f4f9",[[1,"six-group-label",{"size":[513],"label":[1],"helpText":[1,"help-text"],"disabled":[516],"required":[4],"hasHelpTextSlot":[32],"hasLabelSlot":[32]}]]],["p-b351f889",[[1,"six-language-switcher",{"selected":[1537],"languages":[16]}]]],["p-91b51800",[[1,"six-layout-grid",{"columns":[1026]}]]],["p-ac099e6b",[[1,"six-main-container",{"padded":[4]}]]],["p-346f9557",[[1,"six-menu-divider"]]],["p-a6a9ee96",[[1,"six-menu-label"]]],["p-3cc5addb",[[1,"six-progress-bar",{"percentage":[2],"indeterminate":[4]}]]],["p-ee950ce2",[[1,"six-progress-ring",{"size":[2],"strokeWidth":[2,"stroke-width"],"percentage":[2]}]]],["p-264d4ea8",[[1,"six-radio",{"name":[1],"value":[513],"disabled":[4],"checked":[1540],"invalid":[516],"hasFocus":[32],"setFocus":[64],"removeFocus":[64]}]]],["p-ff90ffd1",[[1,"six-range",{"name":[1],"value":[1026],"required":[4],"helpText":[1,"help-text"],"disabled":[4],"label":[1],"errorText":[1,"error-text"],"invalid":[516],"min":[2],"max":[2],"step":[2],"tooltip":[1],"tooltipFormatter":[16],"hasFocus":[32],"hasHelpTextSlot":[32],"hasLabelSlot":[32],"hasTooltip":[32],"setFocus":[64],"removeFocus":[64]}]]],["p-330a4988",[[1,"six-sidebar",{"position":[1],"open":[1540],"width":[1],"toggled":[4],"isVisible":[32],"toggle":[64],"show":[64],"hide":[64],"selectItemByIndex":[64],"selectItemByName":[64]}]]],["p-6197fe2f",[[1,"six-sidebar-item",{"value":[513],"selected":[516],"disabled":[516]}]]],["p-3d9de119",[[1,"six-switch",{"name":[1],"value":[1],"disabled":[4],"required":[4],"checked":[1540],"label":[1],"errorText":[1,"error-text"],"invalid":[516],"hasFocus":[32],"setFocus":[64],"removeFocus":[64]}]]],["p-cd67da3d",[[1,"six-tab-panel",{"name":[1],"active":[516]}]]],["p-5d6b7353",[[1,"six-textarea",{"size":[513],"name":[513],"value":[1537],"helpText":[1,"help-text"],"placeholder":[1],"rows":[2],"resize":[1],"disabled":[516],"readonly":[516],"minlength":[514],"maxlength":[514],"required":[4],"label":[1],"errorText":[1,"error-text"],"invalid":[516],"autocapitalize":[1],"autocorrect":[1],"autocomplete":[1],"autofocus":[4],"spellcheck":[4],"inputmode":[1],"hasFocus":[32],"hasHelpTextSlot":[32],"hasLabelSlot":[32],"setFocus":[64],"removeFocus":[64],"select":[64],"setSelectionRange":[64],"setRangeText":[64]}]]],["p-7afafb9d",[[1,"six-icon",{"size":[513],"filled":[4]}]]],["p-4abed9df",[[1,"six-timepicker",{"format":[1],"separator":[1],"value":[1025],"open":[1540],"inline":[516],"readonly":[4],"disabled":[4],"placement":[1],"size":[1],"required":[4],"placeholder":[1],"errorText":[1,"error-text"],"label":[1],"invalid":[516],"name":[513],"clearable":[4],"iconPosition":[1,"icon-position"],"hoist":[4],"timeout":[2],"interval":[2],"defaultTime":[1,"default-time"],"debounce":[2],"isPopupContentUp":[32],"isDropDownContentUp":[32],"popupValue":[32],"setFocus":[64]},[[9,"resize","resizeHandler"],[9,"scroll","scrollHandler"]]]]],["p-1d0bee53",[[1,"six-tag",{"type":[513],"size":[513],"pill":[516],"clearable":[516]}]]],["p-21b3b321",[[1,"six-details",{"open":[1540],"summary":[1],"summaryIcon":[1,"summary-icon"],"summaryIconSize":[513,"summary-icon-size"],"disabled":[4],"inline":[4],"selectableEmpty":[4,"selectable-empty"],"hasContent":[4,"has-content"],"animateSummaryIcon":[32],"show":[64],"hide":[64]}]]],["p-13b43e04",[[1,"six-picto",{"size":[1]}]]],["p-7e3ad38a",[[1,"six-spinner",{"six":[4]}]]],["p-72254eef",[[1,"six-tooltip",{"content":[1],"placement":[1],"disabled":[4],"distance":[2],"open":[1540],"skidding":[2],"trigger":[1],"show":[64],"hide":[64]}]]],["p-724875b0",[[1,"six-stage-indicator",{"stage":[1]}],[4,"set-attributes",{"value":[16]}]]],["p-95fbdd0b",[[1,"six-item-picker",{"value":[1544],"type":[1],"min":[1544],"max":[1544],"roundtrip":[516],"step":[514],"items":[16],"padded":[4],"paddingLength":[2,"padding-length"],"paddingChar":[1,"padding-char"],"paddingDirection":[1,"padding-direction"],"timeout":[2],"interval":[2],"debounce":[2],"_items":[32],"_itemIndexes":[32]}]]],["p-9c1be3fb",[[1,"six-menu-item",{"checked":[516],"value":[513],"disabled":[516],"hasFocus":[32],"setFocus":[64],"removeFocus":[64],"getTextLabel":[64]}]]],["p-6eb24bcb",[[1,"six-input",{"type":[513],"size":[513],"name":[513],"value":[1537],"pill":[516],"helpText":[1,"help-text"],"placeholder":[1],"disabled":[516],"readonly":[516],"minlength":[514],"maxlength":[514],"min":[514],"max":[514],"step":[514],"pattern":[513],"required":[4],"autocapitalize":[1],"autocorrect":[1],"autocomplete":[1],"autofocus":[4],"spellcheck":[4],"label":[1],"errorText":[1,"error-text"],"invalid":[516],"clearable":[4],"togglePassword":[4,"toggle-password"],"inputmode":[1],"line":[4],"hasFocus":[32],"hasHelpTextSlot":[32],"hasLabelSlot":[32],"isPasswordVisible":[32],"setFocus":[64],"removeFocus":[64],"select":[64],"setSelectionRange":[64],"setRangeText":[64]}]]],["p-314b2096",[[1,"six-dropdown",{"open":[1540],"placement":[1],"closeOnSelect":[4,"close-on-select"],"distance":[2],"skidding":[2],"hoist":[4],"containingElement":[16],"filter":[4],"asyncFilter":[4,"async-filter"],"filterPlaceholder":[1,"filter-placeholder"],"autofocusFilter":[4,"autofocus-filter"],"filterDebounce":[2,"filter-debounce"],"disableHideOnEnterAndSpace":[4,"disable-hide-on-enter-and-space"],"options":[16],"virtualScroll":[4,"virtual-scroll"],"filteredOptions":[32],"show":[64],"hide":[64],"reposition":[64]}],[1,"six-menu",{"removeBoxShadow":[4,"remove-box-shadow"],"items":[16],"itemsShown":[2,"items-shown"],"virtualScroll":[4,"virtual-scroll"],"itemSize":[2,"item-size"],"scrollingDebounce":[2,"scrolling-debounce"],"scrollingIndex":[32],"sixMenuItemHeight":[32],"typeToSelect":[64]}]]],["p-1256cc0a",[[1,"six-icon-button",{"name":[513],"size":[513],"label":[513],"disabled":[516],"html":[513]}]]]]'),e)));
1
+ import{p as e,b as a}from"./p-6153045b.js";export{s as setNonce}from"./p-6153045b.js";const i=()=>{const a=import.meta.url;const i={};if(a!==""){i.resourcesUrl=new URL(".",a).href}return e(i)};i().then((e=>a(JSON.parse('[["p-02981b91",[[1,"six-select",{"multiple":[4],"maxTagsVisible":[2,"max-tags-visible"],"disabled":[4],"name":[1],"placeholder":[1],"filterPlaceholder":[1,"filter-placeholder"],"filterDebounce":[2,"filter-debounce"],"size":[1],"hoist":[4],"value":[1025],"pill":[4],"helpText":[1,"help-text"],"required":[4],"clearable":[4],"label":[1],"errorText":[1,"error-text"],"invalid":[516],"line":[4],"filter":[4],"asyncFilter":[4,"async-filter"],"autocomplete":[4],"inputDebounce":[2,"input-debounce"],"options":[16],"virtualScroll":[4,"virtual-scroll"],"hasFocus":[32],"hasHelpTextSlot":[32],"hasLabelSlot":[32],"isOpen":[32],"displayLabel":[32],"displayTags":[32],"setFocus":[64]}]]],["p-ae601a0f",[[1,"six-header",{"shiftContent":[4,"shift-content"],"openHamburgerMenu":[4,"open-hamburger-menu"],"openSearch":[4,"open-search"],"clickableLogo":[4,"clickable-logo"],"selectedApp":[32],"selectedSection":[32],"setSearchOpenState":[64],"getIsSearchOpen":[64]}]]],["p-ed381ad9",[[1,"six-datepicker",{"type":[1],"locale":[1],"open":[1540],"inline":[516],"readonly":[4],"disabled":[4],"allowedDates":[16],"min":[16],"max":[16],"closeOnSelect":[4,"close-on-select"],"placement":[1],"size":[1],"required":[4],"defaultDate":[1,"default-date"],"placeholder":[1],"value":[1040],"label":[1],"errorText":[1,"error-text"],"invalid":[516],"containingElement":[16],"dateFormat":[1,"date-format"],"debounce":[2],"name":[513],"clearable":[4],"iconPosition":[1,"icon-position"],"hoist":[4],"pointerDate":[32],"selectionMode":[32],"isDropDownContentUp":[32],"setFocus":[64],"select":[64]},[[9,"resize","resizeHandler"],[9,"scroll","scrollHandler"]]]]],["p-a55c7258",[[1,"six-root",{"breakpoint":[2],"padded":[4],"stage":[1],"version":[1],"collapse":[32]}]]],["p-c03ebf7d",[[1,"six-tile",{"label":[1],"iconName":[1,"icon-name"],"closeable":[4],"elevated":[4],"disableTooltip":[4,"disable-tooltip"],"disabled":[516],"size":[513],"visible":[32],"hasIconSlot":[32],"hasLabelSlot":[32],"hide":[64],"show":[64]}]]],["p-411ed539",[[1,"six-alert",{"open":[1540],"closable":[516],"type":[513],"duration":[2],"isVisible":[32],"show":[64],"hide":[64],"toast":[64]}]]],["p-19ed7a4c",[[1,"six-dialog",{"open":[1540],"label":[1],"noHeader":[4,"no-header"],"hasFooter":[32],"isVisible":[32],"show":[64],"hide":[64]}]]],["p-99e24daf",[[1,"six-drawer",{"open":[1540],"label":[1],"placement":[1],"contained":[4],"noHeader":[4,"no-header"],"hasFooter":[32],"isVisible":[32],"show":[64],"hide":[64]}]]],["p-37557787",[[1,"six-search-field",{"placeholder":[1],"debounce":[514],"disabled":[516],"value":[513],"clearable":[4]}]]],["p-83864cfe",[[1,"six-sidebar-item-group",{"name":[1],"icon":[1],"value":[513],"open":[516],"summaryIcon":[1,"summary-icon"],"hasItems":[32],"summaryIconHasContent":[32]}]]],["p-29ac3d7d",[[1,"six-tab",{"panel":[513],"active":[516],"closable":[4],"disabled":[516],"setFocus":[64],"removeFocus":[64]}]]],["p-4705a51e",[[1,"six-tab-group",{"placement":[1],"noScrollControls":[4,"no-scroll-controls"],"hasScrollControls":[32],"show":[64]}]]],["p-878226a0",[[1,"six-avatar",{"image":[1],"alt":[1],"initials":[1],"shape":[1],"hasError":[32]}]]],["p-ee8342e1",[[1,"six-button",{"type":[513],"size":[513],"caret":[4],"disabled":[516],"loading":[516],"pill":[516],"circle":[516],"submit":[516],"reset":[516],"name":[1],"value":[1],"href":[1],"target":[1],"download":[1],"hasFocus":[32],"hasLabel":[32],"hasPrefix":[32],"hasSuffix":[32],"setFocus":[64],"removeFocus":[64]}]]],["p-9b354f5d",[[1,"six-error-page",{"errorCode":[2,"error-code"],"language":[1],"customTitle":[1,"custom-title"],"customDescription":[16],"customIcon":[1,"custom-icon"]}]]],["p-5af44076",[[1,"six-file-list-item",{"identifier":[513],"name":[513],"date":[513],"size":[514],"nodownload":[516],"nodelete":[516]}]]],["p-cdaed936",[[2,"six-file-upload",{"compact":[4],"label":[1],"disabled":[4],"accept":[1],"multiple":[4],"maxFileSize":[2,"max-file-size"],"isOver":[32]},[[1,"dragenter","dragenterHandler"],[1,"dragover","dragoverHandler"],[1,"dragleave","dragleaveHandler"],[1,"drop","dropHandler"]]]]],["p-a0f290d0",[[1,"six-badge",{"type":[1],"pill":[4],"pulse":[4]}]]],["p-613283a7",[[1,"six-card"]]],["p-bf87464b",[[1,"six-checkbox",{"name":[1],"value":[1],"disabled":[4],"required":[4],"label":[1],"errorText":[1,"error-text"],"invalid":[516],"checked":[1540],"indeterminate":[1540],"hasFocus":[32],"hasLabelSlot":[32],"setFocus":[64],"removeFocus":[64]}]]],["p-dfed33c5",[[1,"six-file-list"]]],["p-1d5ee1a0",[[1,"six-footer"]]],["p-d367f4f9",[[1,"six-group-label",{"size":[513],"label":[1],"helpText":[1,"help-text"],"disabled":[516],"required":[4],"hasHelpTextSlot":[32],"hasLabelSlot":[32]}]]],["p-b351f889",[[1,"six-language-switcher",{"selected":[1537],"languages":[16]}]]],["p-91b51800",[[1,"six-layout-grid",{"columns":[1026]}]]],["p-ac099e6b",[[1,"six-main-container",{"padded":[4]}]]],["p-346f9557",[[1,"six-menu-divider"]]],["p-a6a9ee96",[[1,"six-menu-label"]]],["p-3cc5addb",[[1,"six-progress-bar",{"percentage":[2],"indeterminate":[4]}]]],["p-ee950ce2",[[1,"six-progress-ring",{"size":[2],"strokeWidth":[2,"stroke-width"],"percentage":[2]}]]],["p-264d4ea8",[[1,"six-radio",{"name":[1],"value":[513],"disabled":[4],"checked":[1540],"invalid":[516],"hasFocus":[32],"setFocus":[64],"removeFocus":[64]}]]],["p-ff90ffd1",[[1,"six-range",{"name":[1],"value":[1026],"required":[4],"helpText":[1,"help-text"],"disabled":[4],"label":[1],"errorText":[1,"error-text"],"invalid":[516],"min":[2],"max":[2],"step":[2],"tooltip":[1],"tooltipFormatter":[16],"hasFocus":[32],"hasHelpTextSlot":[32],"hasLabelSlot":[32],"hasTooltip":[32],"setFocus":[64],"removeFocus":[64]}]]],["p-330a4988",[[1,"six-sidebar",{"position":[1],"open":[1540],"width":[1],"toggled":[4],"isVisible":[32],"toggle":[64],"show":[64],"hide":[64],"selectItemByIndex":[64],"selectItemByName":[64]}]]],["p-6197fe2f",[[1,"six-sidebar-item",{"value":[513],"selected":[516],"disabled":[516]}]]],["p-3d9de119",[[1,"six-switch",{"name":[1],"value":[1],"disabled":[4],"required":[4],"checked":[1540],"label":[1],"errorText":[1,"error-text"],"invalid":[516],"hasFocus":[32],"setFocus":[64],"removeFocus":[64]}]]],["p-cd67da3d",[[1,"six-tab-panel",{"name":[1],"active":[516]}]]],["p-5d6b7353",[[1,"six-textarea",{"size":[513],"name":[513],"value":[1537],"helpText":[1,"help-text"],"placeholder":[1],"rows":[2],"resize":[1],"disabled":[516],"readonly":[516],"minlength":[514],"maxlength":[514],"required":[4],"label":[1],"errorText":[1,"error-text"],"invalid":[516],"autocapitalize":[1],"autocorrect":[1],"autocomplete":[1],"autofocus":[4],"spellcheck":[4],"inputmode":[1],"hasFocus":[32],"hasHelpTextSlot":[32],"hasLabelSlot":[32],"setFocus":[64],"removeFocus":[64],"select":[64],"setSelectionRange":[64],"setRangeText":[64]}]]],["p-7afafb9d",[[1,"six-icon",{"size":[513],"filled":[4]}]]],["p-4abed9df",[[1,"six-timepicker",{"format":[1],"separator":[1],"value":[1025],"open":[1540],"inline":[516],"readonly":[4],"disabled":[4],"placement":[1],"size":[1],"required":[4],"placeholder":[1],"errorText":[1,"error-text"],"label":[1],"invalid":[516],"name":[513],"clearable":[4],"iconPosition":[1,"icon-position"],"hoist":[4],"timeout":[2],"interval":[2],"defaultTime":[1,"default-time"],"debounce":[2],"isPopupContentUp":[32],"isDropDownContentUp":[32],"popupValue":[32],"setFocus":[64]},[[9,"resize","resizeHandler"],[9,"scroll","scrollHandler"]]]]],["p-b550a258",[[1,"six-tag",{"type":[513],"size":[513],"pill":[516],"clearable":[516]}]]],["p-21b3b321",[[1,"six-details",{"open":[1540],"summary":[1],"summaryIcon":[1,"summary-icon"],"summaryIconSize":[513,"summary-icon-size"],"disabled":[4],"inline":[4],"selectableEmpty":[4,"selectable-empty"],"hasContent":[4,"has-content"],"animateSummaryIcon":[32],"show":[64],"hide":[64]}]]],["p-13b43e04",[[1,"six-picto",{"size":[1]}]]],["p-7e3ad38a",[[1,"six-spinner",{"six":[4]}]]],["p-72254eef",[[1,"six-tooltip",{"content":[1],"placement":[1],"disabled":[4],"distance":[2],"open":[1540],"skidding":[2],"trigger":[1],"show":[64],"hide":[64]}]]],["p-724875b0",[[1,"six-stage-indicator",{"stage":[1]}],[4,"set-attributes",{"value":[16]}]]],["p-95fbdd0b",[[1,"six-item-picker",{"value":[1544],"type":[1],"min":[1544],"max":[1544],"roundtrip":[516],"step":[514],"items":[16],"padded":[4],"paddingLength":[2,"padding-length"],"paddingChar":[1,"padding-char"],"paddingDirection":[1,"padding-direction"],"timeout":[2],"interval":[2],"debounce":[2],"_items":[32],"_itemIndexes":[32]}]]],["p-9c1be3fb",[[1,"six-menu-item",{"checked":[516],"value":[513],"disabled":[516],"hasFocus":[32],"setFocus":[64],"removeFocus":[64],"getTextLabel":[64]}]]],["p-9f0b43f9",[[1,"six-input",{"type":[513],"size":[513],"name":[513],"value":[1537],"pill":[516],"helpText":[1,"help-text"],"placeholder":[1],"disabled":[516],"readonly":[516],"minlength":[514],"maxlength":[514],"min":[514],"max":[514],"step":[514],"pattern":[513],"required":[4],"autocapitalize":[1],"autocorrect":[1],"autocomplete":[1],"autofocus":[4],"spellcheck":[4],"label":[1],"errorText":[1,"error-text"],"invalid":[516],"clearable":[4],"togglePassword":[4,"toggle-password"],"inputmode":[1],"line":[4],"hasFocus":[32],"hasHelpTextSlot":[32],"hasLabelSlot":[32],"isPasswordVisible":[32],"setFocus":[64],"removeFocus":[64],"select":[64],"setSelectionRange":[64],"setRangeText":[64]}]]],["p-314b2096",[[1,"six-dropdown",{"open":[1540],"placement":[1],"closeOnSelect":[4,"close-on-select"],"distance":[2],"skidding":[2],"hoist":[4],"containingElement":[16],"filter":[4],"asyncFilter":[4,"async-filter"],"filterPlaceholder":[1,"filter-placeholder"],"autofocusFilter":[4,"autofocus-filter"],"filterDebounce":[2,"filter-debounce"],"disableHideOnEnterAndSpace":[4,"disable-hide-on-enter-and-space"],"options":[16],"virtualScroll":[4,"virtual-scroll"],"filteredOptions":[32],"show":[64],"hide":[64],"reposition":[64]}],[1,"six-menu",{"removeBoxShadow":[4,"remove-box-shadow"],"items":[16],"itemsShown":[2,"items-shown"],"virtualScroll":[4,"virtual-scroll"],"itemSize":[2,"item-size"],"scrollingDebounce":[2,"scrolling-debounce"],"scrollingIndex":[32],"sixMenuItemHeight":[32],"typeToSelect":[64]}]]],["p-1256cc0a",[[1,"six-icon-button",{"name":[513],"size":[513],"label":[513],"disabled":[516],"html":[513]}]]]]'),e)));
2
2
  //# sourceMappingURL=ui-library.esm.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@six-group/ui-library",
3
- "version": "0.0.0-insider.e148618",
3
+ "version": "0.0.0-insider.f058d60",
4
4
  "description": "Stencil Component Library following the SIX style guide",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.cjs.js",
@@ -1,2 +0,0 @@
1
- import{r,c as a,h as i}from"./p-6153045b.js";const s=":host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}:host{display:inline-block}.tag{display:flex;align-items:center;border:solid 1px;font-family:var(--six-font-family);line-height:1;white-space:nowrap;user-select:none;cursor:default}.tag__clear::part(base){color:inherit;padding:0}.tag--info{color:var(--six-color-white);background-color:var(--six-color-web-rock-900);border-color:var(--six-color-web-rock-900)}.tag--success{color:var(--six-color-web-rock-900);border-color:var(--six-color-success-500);background-color:var(--six-color-success-500)}.tag--primary{color:var(--six-color-web-rock-900);border-color:var(--six-color-clay-50);background-color:var(--six-color-clay-50)}.tag--warning{color:var(--six-color-web-rock-900);border-color:var(--six-color-warning-700);background-color:var(--six-color-warning-700)}.tag--danger{color:var(--six-color-white);border-color:var(--six-color-danger-800);background-color:var(--six-color-danger-800)}.tag--action{color:var(--six-color-white);border-color:var(--six-color-action-500);background-color:var(--six-color-action-500)}.tag--small{font-size:var(--six-button-font-size-small);height:calc(var(--six-height-small) * 0.8);line-height:calc(var(--six-height-small) - var(--six-border-width) * 2);border-radius:var(--six-input-border-radius-small);padding:0 var(--six-spacing-x-small)}.tag--small .tag__clear{margin-left:var(--six-spacing-xx-small);margin-right:calc(-1 * var(--six-spacing-xxx-small))}.tag--medium{font-size:var(--six-button-font-size-medium);height:calc(var(--six-height-medium) * 0.8);line-height:calc(var(--six-height-medium) - var(--six-border-width) * 2);border-radius:var(--six-input-border-radius-medium);padding:0 var(--six-spacing-small)}.tag--medium .tag__clear{margin-left:var(--six-spacing-xx-small);margin-right:calc(-1 * var(--six-spacing-xx-small))}.tag--large{font-size:var(--six-button-font-size-large);height:calc(var(--six-height-large) * 0.8);line-height:calc(var(--six-height-large) - var(--six-border-width) * 2);border-radius:var(--six-input-border-radius-large);padding:0 var(--six-spacing-medium)}.tag--large .tag__clear{margin-left:var(--six-spacing-xx-small);margin-right:calc(-1 * var(--six-spacing-x-small))}.tag--pill{border-radius:var(--six-border-radius-pill)}";const o=class{constructor(i){r(this,i);this.sixClear=a(this,"six-tag-clear",7);this.handleClearClick=()=>{this.sixClear.emit()};this.type="primary";this.size="medium";this.pill=false;this.clearable=false}render(){return i("span",{part:"base",class:{tag:true,"tag--primary":this.type==="primary","tag--success":this.type==="success","tag--info":this.type==="info","tag--warning":this.type==="warning","tag--danger":this.type==="danger","tag--action":this.type==="action","tag--text":this.type==="text","tag--small":this.size==="small","tag--medium":this.size==="medium","tag--large":this.size==="large","tag--pill":this.pill,"tag--clear":this.clearable}},i("span",{part:"content",class:"tag__content"},i("slot",null)),this.clearable&&i("six-icon-button",{exportparts:"base:clear-button",size:"xSmall",name:"clear",class:"tag__clear",onClick:this.handleClearClick}))}};o.style=s;export{o as six_tag};
2
- //# sourceMappingURL=p-1d0bee53.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["sixTagCss","SixTag","this","handleClearClick","sixClear","emit","render","h","part","class","tag","type","size","pill","clearable","exportparts","name","onClick"],"sources":["src/components/six-tag/six-tag.scss?tag=six-tag&encapsulation=shadow","src/components/six-tag/six-tag.tsx"],"sourcesContent":["@import 'src/global/component';\n\n:host {\n display: inline-block;\n}\n\n.tag {\n display: flex;\n align-items: center;\n border: solid 1px;\n font-family: var(--six-font-family);\n line-height: 1;\n white-space: nowrap;\n user-select: none;\n cursor: default;\n}\n\n.tag__clear::part(base) {\n color: inherit;\n padding: 0;\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Type modifiers\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.tag--info {\n color: var(--six-color-white);\n background-color: var(--six-color-web-rock-900);\n border-color: var(--six-color-web-rock-900);\n}\n\n.tag--success {\n color: var(--six-color-web-rock-900);\n border-color: var(--six-color-success-500);\n background-color: var(--six-color-success-500);\n}\n\n.tag--primary {\n color: var(--six-color-web-rock-900);\n border-color: var(--six-color-clay-50);\n background-color: var(--six-color-clay-50);\n}\n\n.tag--warning {\n color: var(--six-color-web-rock-900);\n border-color: var(--six-color-warning-700);\n background-color: var(--six-color-warning-700);\n}\n\n.tag--danger {\n color: var(--six-color-white);\n border-color: var(--six-color-danger-800);\n background-color: var(--six-color-danger-800);\n}\n\n.tag--action {\n color: var(--six-color-white);\n border-color: var(--six-color-action-500);\n background-color: var(--six-color-action-500);\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Size modifiers\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.tag--small {\n font-size: var(--six-button-font-size-small);\n height: calc(var(--six-height-small) * 0.8);\n line-height: calc(var(--six-height-small) - var(--six-border-width) * 2);\n border-radius: var(--six-input-border-radius-small);\n padding: 0 var(--six-spacing-x-small);\n\n .tag__clear {\n margin-left: var(--six-spacing-xx-small);\n margin-right: calc(-1 * var(--six-spacing-xxx-small));\n }\n}\n\n.tag--medium {\n font-size: var(--six-button-font-size-medium);\n height: calc(var(--six-height-medium) * 0.8);\n line-height: calc(var(--six-height-medium) - var(--six-border-width) * 2);\n border-radius: var(--six-input-border-radius-medium);\n padding: 0 var(--six-spacing-small);\n\n .tag__clear {\n margin-left: var(--six-spacing-xx-small);\n margin-right: calc(-1 * var(--six-spacing-xx-small));\n }\n}\n\n.tag--large {\n font-size: var(--six-button-font-size-large);\n height: calc(var(--six-height-large) * 0.8);\n line-height: calc(var(--six-height-large) - var(--six-border-width) * 2);\n border-radius: var(--six-input-border-radius-large);\n padding: 0 var(--six-spacing-medium);\n\n .tag__clear {\n margin-left: var(--six-spacing-xx-small);\n margin-right: calc(-1 * var(--six-spacing-x-small));\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Pill modifier\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.tag--pill {\n border-radius: var(--six-border-radius-pill);\n}\n","import { Component, Event, EventEmitter, h, Prop } from '@stencil/core';\nimport { EmptyPayload } from '../../utils/types';\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The tag's content.\n *\n * @part base - The component's base wrapper.\n * @part content - The tag content.\n * @part clear-button - The clear button.\n */\n\n@Component({\n tag: 'six-tag',\n styleUrl: 'six-tag.scss',\n shadow: true,\n})\nexport class SixTag {\n /** The tag's type. */\n @Prop({ reflect: true }) type: 'primary' | 'success' | 'info' | 'warning' | 'danger' | 'action' | 'text' = 'primary';\n\n /** The tag's size. */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Set to true to draw a pill-style tag with rounded edges. */\n @Prop({ reflect: true }) pill = false;\n\n /** Set to true to make the tag clearable. */\n @Prop({ reflect: true }) clearable = false;\n\n /** Emitted when the clear button is activated. */\n @Event({ eventName: 'six-tag-clear' }) sixClear!: EventEmitter<EmptyPayload>;\n\n private handleClearClick = () => {\n this.sixClear.emit();\n };\n\n render() {\n return (\n <span\n part=\"base\"\n class={{\n tag: true,\n\n // Types\n 'tag--primary': this.type === 'primary',\n 'tag--success': this.type === 'success',\n 'tag--info': this.type === 'info',\n 'tag--warning': this.type === 'warning',\n 'tag--danger': this.type === 'danger',\n 'tag--action': this.type === 'action',\n 'tag--text': this.type === 'text',\n\n // Sizes\n 'tag--small': this.size === 'small',\n 'tag--medium': this.size === 'medium',\n 'tag--large': this.size === 'large',\n\n // Modifers\n 'tag--pill': this.pill,\n 'tag--clear': this.clearable,\n }}\n >\n <span part=\"content\" class=\"tag__content\">\n <slot />\n </span>\n\n {this.clearable && (\n <six-icon-button\n exportparts=\"base:clear-button\"\n size=\"xSmall\"\n name=\"clear\"\n class=\"tag__clear\"\n onClick={this.handleClearClick}\n />\n )}\n </span>\n );\n }\n}\n"],"mappings":"6CAAA,MAAMA,EAAY,qwE,MCqBLC,EAAM,M,iEAgBTC,KAAAC,iBAAmB,KACzBD,KAAKE,SAASC,MAAM,E,UAfqF,U,UAG7C,S,UAG9B,M,eAGK,K,CASrC,MAAAC,GACE,OACEC,EAAA,QACEC,KAAK,OACLC,MAAO,CACLC,IAAK,KAGL,eAAgBR,KAAKS,OAAS,UAC9B,eAAgBT,KAAKS,OAAS,UAC9B,YAAaT,KAAKS,OAAS,OAC3B,eAAgBT,KAAKS,OAAS,UAC9B,cAAeT,KAAKS,OAAS,SAC7B,cAAeT,KAAKS,OAAS,SAC7B,YAAaT,KAAKS,OAAS,OAG3B,aAAcT,KAAKU,OAAS,QAC5B,cAAeV,KAAKU,OAAS,SAC7B,aAAcV,KAAKU,OAAS,QAG5B,YAAaV,KAAKW,KAClB,aAAcX,KAAKY,YAGrBP,EAAA,QAAMC,KAAK,UAAUC,MAAM,gBACzBF,EAAA,cAGDL,KAAKY,WACJP,EAAA,mBACEQ,YAAY,oBACZH,KAAK,SACLI,KAAK,QACLP,MAAM,aACNQ,QAASf,KAAKC,mB"}
@@ -1,2 +0,0 @@
1
- import{r as t,c as e,h as s,g as i}from"./p-6153045b.js";import{h as l,a as o}from"./p-15559d38.js";import{F as r}from"./p-d42c2025.js";import{E as a}from"./p-7d95def3.js";import{D as n,a as c}from"./p-698bb2c8.js";function h(t){if(Array.isArray(t)){return t.length===0}return t===""}const d=':host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control .form-control__error-text{display:none}.form-control--has-label .form-control__label{display:inline-block;color:var(--six-input-label-color);font-weight:var(--six-font-weight-bold);margin-bottom:var(--six-spacing-x-small)}.form-control--has-label .form-control__label__required::after{color:var(--six-color-danger-800);content:"*"}.form-control--has-label.form-control--small .form-control__label{font-size:var(--six-input-label-font-size-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--six-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control_label{font-size:var(--six-input-label-font-size-large)}.form-control--has-help-text .form-control__help-text{display:block;color:var(--six-input-help-text-color);margin-top:var(--six-spacing-x-small)}.form-control--has-help-text .form-control__help-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--has-error-text .form-control__error-text{display:block;color:var(--six-color-danger-800);margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text .form-control__error-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text.form-control--small .form-control__error-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-error-text.form-control--medium .form-control__error-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-error-text.form-control--large .form-control__error-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--disabled .form-control__help-text{color:var(--six-input-help-text-color-disabled)}.form-control--disabled .form-control__label{color:var(--six-input-label-color-disabled)}.form-control--invalid:not(.form-control--disabled) .form-control__label{color:var(--six-input-label-color)}:host{display:block}.select{display:block}.select__box{display:inline-flex;align-items:center;justify-content:start;position:relative;width:100%;font-family:var(--six-font-family);font-weight:var(--six-input-font-weight);font-size:var(--six-input-font-size-medium);letter-spacing:var(--six-input-letter-spacing);background-color:var(--six-input-background-color);border:solid var(--six-border-width) var(--six-input-border-color);vertical-align:middle;overflow:hidden;transition:var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;cursor:pointer}.select__box--line{border:none;border-bottom:solid var(--six-border-width) var(--six-input-border-color)}.select__box--autocomplete{border:none;overflow:initial}.select:not(.select--disabled) .select__box:hover{background-color:var(--six-input-background-color-hover);color:var(--six-input-color-hover);border-bottom-color:var(--six-input-border-color-hover)}.select:not(.select--disabled) .select__box:hover:not(.select__box--line){border-color:var(--six-input-border-color-hover)}.select:not(.select--disabled) .select__box:focus{background-color:var(--six-input-background-color-focus);outline:none;color:var(--six-input-color-focus);border-bottom-color:var(--six-input-border-color-focus);box-shadow:0 1px 0 0 var(--six-input-border-color-focus)}.select:not(.select--disabled) .select__box:focus:not(.select__box--line){border-color:var(--six-input-border-color-focus);box-shadow:var(--six-input-focus-shadow)}.select--disabled .select__box{background-color:var(--six-input-background-color-disabled);color:var(--six-input-color-disabled);cursor:not-allowed;outline:none}.select--disabled .select__box:not(.select__box--line){border-color:var(--six-input-border-color-disabled)}.select--disabled .select__tags,.select--disabled .select__clear{pointer-events:none}.select--invalid:not(.select--disabled):not(.select--focused) .select__box{border-bottom-color:var(--six-input-border-color-danger)}.select--invalid:not(.select--disabled):not(.select--focused) .select__box:not(.input--line){border-color:var(--six-input-border-color-danger)}.select__label{flex-shrink:1;flex-grow:1;align-items:center;user-select:none;width:0;scrollbar-width:none;-ms-overflow-style:none;overflow-x:auto;overflow-y:hidden;white-space:nowrap}.select__label::-webkit-scrollbar{width:0;height:0}.select__clear{flex-shrink:0;flex-grow:0;display:inline}.select__icon{flex-shrink:0;flex-grow:0;display:inline;transition:var(--six-transition-medium) transform ease}.select--open .select__icon{transform:rotate(-180deg)}.select--placeholder-visible .select__label{color:var(--six-input-placeholder-color)}.select--disabled.select--placeholder-visible .select__label{color:var(--six-input-placeholder-color-disabled)}.select__tags{display:inline-flex;align-items:center;flex-wrap:wrap;justify-content:left;margin-left:var(--six-spacing-xx-small)}.select__hidden-select{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}.select__input{position:absolute;top:0;left:0;width:100%;height:100%}.select--small .select__box{border-radius:var(--six-input-border-radius-small);font-size:var(--six-input-font-size-small);min-height:var(--six-height-small)}.select--small .select__box--line{border:none;border-bottom:solid var(--six-border-width) var(--six-input-border-color)}.select--small .select__label{margin:0 var(--six-input-spacing-small)}.select--small .select__clear{margin-right:var(--six-spacing-xxx-small)}.select--small .select__icon{margin-right:var(--six-spacing-x-small)}.select--small .select__tags{padding-bottom:2px}.select--small .select__tags six-tag{padding-top:2px}.select--small .select__tags six-tag:not(:last-of-type){margin-right:var(--six-spacing-xx-small)}.select--small.select--has-tags .select__label{margin-left:0}.select--medium .select__box{border-radius:var(--six-input-border-radius-medium);font-size:var(--six-input-font-size-medium);min-height:var(--six-height-medium)}.select--medium .select__box--line{border:none;border-bottom:solid var(--six-border-width) var(--six-input-border-color)}.select--medium .select__label{margin:0 var(--six-input-spacing-medium)}.select--medium .select__clear{margin-right:var(--six-spacing-xxx-small)}.select--medium .select__icon{margin-right:var(--six-spacing-x-small)}.select--medium .select__tags{padding-bottom:3px}.select--medium .select__tags six-tag{padding-top:3px}.select--medium .select__tags six-tag:not(:last-of-type){margin-right:var(--six-spacing-xx-small)}.select--medium.select--has-tags .select__label{margin-left:0}.select--large .select__box{border-radius:var(--six-input-border-radius-large);font-size:var(--six-input-font-size-large);min-height:var(--six-height-large)}.select--large .select__box--line{border:none;border-bottom:solid var(--six-border-width) var(--six-input-border-color)}.select--large .select__label{margin:0 var(--six-input-spacing-large)}.select--large .select__clear{margin-right:var(--six-spacing-xxx-small)}.select--large .select__icon{margin-right:var(--six-spacing-x-small)}.select--large .select__tags{padding-bottom:4px}.select--large .select__tags six-tag{padding-top:4px}.select--large .select__tags six-tag:not(:last-of-type){margin-right:var(--six-spacing-xx-small)}.select--large.select--has-tags .select__label{margin-left:0}.select--pill.select--small .select__box{border-radius:var(--six-height-small)}.select--pill.select--medium .select__box{border-radius:var(--six-height-medium)}.select--pill.select--large .select__box{border-radius:var(--six-height-large)}.select__menu{max-width:50vw;width:fit-content}.select__menu--filtered{width:100% !important}.select__menu--hidden{display:none}six-icon-button::part(base){padding-top:0;padding-bottom:0}';let x=0;const u=class{constructor(s){t(this,s);this.sixChange=e(this,"six-select-change",7);this.sixFocus=e(this,"six-select-focus",7);this.sixBlur=e(this,"six-select-blur",7);this.inputId=`select-${++x}`;this.labelId=`select-label-${x}`;this.helpTextId=`select-help-text-${x}`;this.errorTextId=`select-error-text-${x}`;this.touched=false;this.eventListeners=new a;this.handleBlur=()=>{this.hasFocus=false;this.sixBlur.emit()};this.handleFocus=()=>{this.hasFocus=true;this.sixFocus.emit()};this.handleClearClick=t=>{t.stopPropagation();this.clearValues();this.sixChange.emit({value:this.value,isSelected:true})};this.handleSelectAll=t=>{const e=this.getItems().filter((t=>t.style.display!=="none"));const s=t.key;const i=t.code;if(s==="Control"){return}if(this.isOpen&&this.multiple&&i==="KeyA"&&t.ctrlKey){t.preventDefault();const s=e.some((t=>!t.disabled&&!t.checked));e.filter((t=>!t.disabled)).forEach((t=>t.checked=s));const i=e.filter((t=>t.checked)).map((t=>t.value));this.value=s?i:[];this.sixChange.emit({value:this.value,isSelected:true})}};this.handleKeyDown=t=>{var e,s,i,l;const o=t.target;const r=this.getItems();const a=r[0];const n=r[r.length-1];if(o.tagName.toLowerCase()==="six-tag"){return}if(t.key==="Tab"){if(this.isOpen){(e=this.dropdown)===null||e===void 0?void 0:e.hide()}return}if(["ArrowDown","ArrowUp"].includes(t.key)){t.preventDefault();if(!this.isOpen){(s=this.dropdown)===null||s===void 0?void 0:s.show()}if(t.key==="ArrowDown"&&a){a.setFocus();return}if(t.key==="ArrowUp"&&n){n.setFocus();return}}if(!this.isOpen){t.stopPropagation();t.preventDefault();(i=this.dropdown)===null||i===void 0?void 0:i.show();(l=this.menu)===null||l===void 0?void 0:l.typeToSelect(t.key)}};this.handleLabelClick=()=>{var t;(t=this.box)===null||t===void 0?void 0:t.focus()};this.handleMenuSelect=t=>{const e=t.detail.item;const s=()=>{if(this.multiple){return this.value.includes(e.value)?this.value.filter((t=>t!==e.value)):[...this.value,e.value]}else{return e.value}};this.value=s();this.syncItemsFromValue();this.sixChange.emit({value:this.value,isSelected:true})};this.handleMenuShow=t=>{var e;if(this.disabled){t.preventDefault();return}this.resizeMenu();(e=this.resizeObserver)===null||e===void 0?void 0:e.observe(this.host);this.isOpen=true};this.handleMenuHide=()=>{var t;(t=this.resizeObserver)===null||t===void 0?void 0:t.unobserve(this.host);this.isOpen=false};this.handleSlotChange=()=>{this.hasHelpTextSlot=l(this.host,"help-text");this.hasLabelSlot=l(this.host,"label");this.syncItemsFromValue()};this.handleTagInteraction=t=>{const e=t.composedPath();const s=e.find((t=>{if(t instanceof HTMLElement){const e=t;return e.classList.contains("tag__clear")}}));if(s){t.stopPropagation();this.sixChange.emit({value:this.value,isSelected:true})}};this.hasFocus=false;this.hasHelpTextSlot=false;this.hasLabelSlot=false;this.isOpen=false;this.displayLabel="";this.displayTags=[];this.multiple=false;this.maxTagsVisible=3;this.disabled=false;this.name="";this.placeholder="";this.filterPlaceholder=undefined;this.filterDebounce=n;this.size="medium";this.hoist=false;this.value="";this.pill=false;this.helpText="";this.required=false;this.clearable=false;this.label="";this.errorText="";this.invalid=false;this.line=false;this.filter=false;this.asyncFilter=false;this.autocomplete=false;this.inputDebounce=n;this.options=null;this.virtualScroll=false}handleDisabledChange(){var t;if(this.disabled&&this.isOpen){(t=this.dropdown)===null||t===void 0?void 0:t.hide()}}handleLabelChange(){this.handleSlotChange()}handleMultipleChange(){const t=this.getValueAsArray();this.value=this.multiple?t:t[0]||"";this.syncItemsFromValue()}async handleValueChange(){if(this.multiple&&!Array.isArray(this.value)){this.value=[]}if(!this.multiple&&typeof this.value!=="string"){this.value=""}await this.syncItemsFromValue()}connectedCallback(){var t;if(this.virtualScroll&&this.options===null){console.error("Options must be defined when using virtual scrolling")}(t=this.host.shadowRoot)===null||t===void 0?void 0:t.addEventListener("slotchange",this.handleSlotChange);this.eventListeners.forward("six-select-change","change",this.host);this.eventListeners.forward("six-select-blur","blur",this.host);this.eventListeners.forward("six-select-focus","focus",this.host)}componentWillLoad(){this.handleSlotChange();if(this.multiple&&this.value!=null){this.value=this.getValueAsArray()}}componentDidLoad(){if(this.input==null)return;const t=this.input;this.resizeObserver=new ResizeObserver((()=>this.resizeMenu()));requestAnimationFrame((()=>this.syncItemsFromValue()));this.eventListeners.add(t,"six-input-input",c((e=>{const s=t.value;this.clearValues();this.sixChange.emit({value:s,isSelected:false});e.stopPropagation()}),this.inputDebounce));t.value=this.hasSelection()?this.displayLabel:""}disconnectedCallback(){var t;(t=this.host.shadowRoot)===null||t===void 0?void 0:t.removeEventListener("slotchange",this.handleSlotChange);this.eventListeners.removeAll()}async setFocus(t){var e;this.hasFocus=true;(e=this.box)===null||e===void 0?void 0:e.focus(t)}getItemLabel(t){var e,s;const i=(e=t.shadowRoot)===null||e===void 0?void 0:e.querySelector("slot:not([name])");if(i!=null){return o(i)}else{return(s=t.textContent)!==null&&s!==void 0?s:""}}getItems(){if(this.options!==null){return this.options.map((t=>s("six-menu-item",{value:t.value},t.label)))}return[...this.host.querySelectorAll("six-menu-item")]}hasMenuItems(){return this.getItems().length>0}getValueAsArray(){const t=Array.isArray(this.value)?this.value:[this.value];return t.map(String)}clearValues(){this.value=this.multiple?[]:"";this.syncItemsFromValue()}resizeMenu(){if(this.menu==null||this.box==null)return;this.menu.style.minWidth=`${this.box.clientWidth}px`;if(this.dropdown){this.dropdown.reposition()}}async syncItemsFromValue(){const t=this.getItems();const e=this.getValueAsArray();t.forEach((t=>t.checked=e.includes(t.value)));if(this.multiple){const i=[];e.forEach((e=>t.map((t=>t.value===e?i.push(t):null))));this.displayTags=i.map((t=>s("six-tag",{exportparts:"base:tag",type:"primary",size:this.size,pill:this.pill,clearable:true,onClick:this.handleTagInteraction,onKeyDown:this.handleTagInteraction,"onSix-tag-clear":e=>{e.stopPropagation();if(!this.disabled){t.checked=false;this.syncValueFromItems()}}},this.getItemLabel(t))));if(this.maxTagsVisible>0&&this.displayTags.length>this.maxTagsVisible){const t=this.displayTags.length;this.displayLabel="";this.displayTags=this.displayTags.slice(0,this.maxTagsVisible);this.displayTags.push(s("six-tag",{exportparts:"base:tag",type:"info",size:this.size},"+",t-this.maxTagsVisible))}}else{this.displayLabel=this.extractLabelForSelectedItem(e,t);this.displayTags=[]}if(!h(this.value)){this.touched=true}if(this.touched&&this.input!=null){this.input.value=Array.isArray(this.value)?this.value.join(","):this.value}}extractLabelForSelectedItem(t,e){if(t.length===0||t.length===1&&t[0]===""){return""}if(this.options!==null){const e=this.options.find((e=>e.value===t[0]));return(e===null||e===void 0?void 0:e.value)||""}const s=e.find((e=>e.value===t[0]));return s?this.getItemLabel(s):""}syncValueFromItems(){const t=this.getItems();const e=t.filter((t=>t.checked));const s=e.map((t=>t.value));this.value=this.multiple?this.getValueAsArray().filter((t=>s.includes(t))):s.length>0?s[0]:""}render(){var t;const e=this.hasSelection();return s(r,{inputId:this.inputId,label:this.label,labelId:this.labelId,hasLabelSlot:this.hasLabelSlot,helpTextId:this.helpTextId,helpText:this.helpText,hasHelpTextSlot:this.hasHelpTextSlot,errorTextId:this.errorTextId,errorText:this.errorText,size:this.size,onLabelClick:this.handleLabelClick,disabled:this.disabled,required:this.required,displayError:this.invalid},s("six-dropdown",{part:"base",ref:t=>this.dropdown=t,hoist:this.hoist,closeOnSelect:!this.multiple,containingElement:this.host,disableHideOnEnterAndSpace:this.autocomplete,class:{select:true,"select--open":this.isOpen,"select--empty":((t=this.value)===null||t===void 0?void 0:t.length)===0,"select--focused":this.hasFocus,"select--clearable":this.clearable,"select--disabled":this.disabled,"select--multiple":this.multiple,"select--has-tags":this.multiple&&e,"select--placeholder-visible":this.displayLabel==="","select--small":this.size==="small","select--medium":this.size==="medium","select--large":this.size==="large","select--pill":this.pill,"select--invalid":this.invalid},onKeyDown:this.handleSelectAll,"onSix-dropdown-show":this.handleMenuShow,"onSix-dropdown-hide":this.handleMenuHide,filterPlaceholder:this.filterPlaceholder,filterDebounce:this.filterDebounce,filter:this.filter,asyncFilter:this.asyncFilter},s("div",{slot:"trigger",ref:t=>this.box=t,id:this.inputId,class:{select__box:true,"select__box--line":this.line,"select__box--autocomplete":this.autocomplete},role:"combobox","aria-labelledby":this.labelId,"aria-describedby":this.helpTextId,"aria-haspopup":"true","aria-expanded":this.isOpen?"true":"false",tabIndex:this.disabled?-1:0,onBlur:this.handleBlur,onFocus:this.handleFocus,onKeyDown:this.handleKeyDown},s("span",{class:"select__label"},this.displayTags.length>0?s("span",{part:"tags",class:"select__tags"},this.displayTags):this.displayLabel||this.placeholder),this.clearable&&e&&s("six-icon-button",{exportparts:"base:clear-button",class:"select__clear",name:"clear",size:"small",onClick:this.handleClearClick,tabindex:"-1"}),this.hasMenuItems()&&s("span",{part:"icon",class:"select__icon"},s("six-icon",{size:"medium"},"expand_more")),s("six-input",{ref:t=>this.input=t,class:{select__input:true,"select__hidden-select":!this.autocomplete},"aria-hidden":"true",required:this.required,onFocus:this.handleFocus,clearable:this.clearable,placeholder:this.placeholder,pill:this.pill,disabled:this.disabled,size:this.size,tabIndex:-1})),s("six-menu",{ref:t=>this.menu=t,part:"menu",class:{select__menu:true,"select__menu--filtered":this.filter||this.asyncFilter,"select__menu--hidden":!this.hasMenuItems()},"onSix-menu-item-selected":this.handleMenuSelect,items:this.options,virtualScroll:this.virtualScroll,"remove-box-shadow":true},s("slot",{onSlotchange:this.handleSlotChange}))))}hasSelection(){return this.multiple?this.value.length>0:this.value!==""}get host(){return i(this)}static get watchers(){return{disabled:["handleDisabledChange"],helpText:["handleLabelChange"],errorText:["handleLabelChange"],label:["handleLabelChange"],multiple:["handleMultipleChange"],value:["handleValueChange"]}}};u.style=d;export{u as six_select};
2
- //# sourceMappingURL=p-2451cfdc.entry.js.map