@getflip/swirl-components 0.508.0 → 0.509.0
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.
- package/components.json +23 -3
- package/dist/cjs/swirl-accordion-item.cjs.entry.js +3 -4
- package/dist/cjs/swirl-card.cjs.entry.js +1 -1
- package/dist/cjs/swirl-color-input.cjs.entry.js +3 -4
- package/dist/cjs/swirl-console-layout.cjs.entry.js +1 -1
- package/dist/cjs/swirl-data-cell-stack.cjs.entry.js +2 -3
- package/dist/cjs/swirl-data-cell.cjs.entry.js +3 -4
- package/dist/cjs/swirl-date-picker_2.cjs.entry.js +1 -1
- package/dist/cjs/swirl-file-chip.cjs.entry.js +1 -1
- package/dist/cjs/swirl-file-uploader.cjs.entry.js +1 -1
- package/dist/cjs/swirl-file-viewer-audio_7.cjs.entry.js +6 -2
- package/dist/cjs/swirl-icon-check-small_2.cjs.entry.js +3 -4
- package/dist/cjs/swirl-icon-error_3.cjs.entry.js +1 -1
- package/dist/cjs/swirl-image-grid-item.cjs.entry.js +1 -1
- package/dist/cjs/swirl-inline-status.cjs.entry.js +1 -1
- package/dist/cjs/swirl-option-list.cjs.entry.js +2 -3
- package/dist/cjs/swirl-pagination.cjs.entry.js +1 -1
- package/dist/cjs/swirl-resource-list-item.cjs.entry.js +4 -5
- package/dist/cjs/swirl-resource-list.cjs.entry.js +2 -3
- package/dist/cjs/swirl-select.cjs.entry.js +1 -1
- package/dist/cjs/swirl-separator.cjs.entry.js +1 -1
- package/dist/cjs/swirl-tab-bar.cjs.entry.js +1 -1
- package/dist/cjs/swirl-table-cell.cjs.entry.js +1 -1
- package/dist/cjs/swirl-table.cjs.entry.js +1 -1
- package/dist/collection/components/swirl-accordion-item/swirl-accordion-item.js +4 -5
- package/dist/collection/components/swirl-card/swirl-card.css +0 -1
- package/dist/collection/components/swirl-color-input/swirl-color-input.js +3 -4
- package/dist/collection/components/swirl-console-layout/swirl-console-layout.css +0 -3
- package/dist/collection/components/swirl-data-cell/swirl-data-cell.js +3 -4
- package/dist/collection/components/swirl-data-cell-stack/swirl-data-cell-stack.js +2 -3
- package/dist/collection/components/swirl-date-picker/swirl-date-picker.css +0 -1
- package/dist/collection/components/swirl-file-chip/swirl-file-chip.css +0 -1
- package/dist/collection/components/swirl-file-uploader/swirl-file-uploader.css +0 -4
- package/dist/collection/components/swirl-file-viewer/viewers/swirl-file-viewer-image/swirl-file-viewer-image.css +0 -2
- package/dist/collection/components/swirl-file-viewer/viewers/swirl-file-viewer-video/swirl-file-viewer-video.js +25 -1
- package/dist/collection/components/swirl-image-grid-item/swirl-image-grid-item.css +0 -2
- package/dist/collection/components/swirl-inline-error/swirl-inline-error.css +0 -1
- package/dist/collection/components/swirl-inline-status/swirl-inline-status.css +0 -1
- package/dist/collection/components/swirl-option-list/swirl-option-list.js +2 -3
- package/dist/collection/components/swirl-option-list-item/swirl-option-list-item.js +3 -4
- package/dist/collection/components/swirl-pagination/swirl-pagination.css +0 -1
- package/dist/collection/components/swirl-resource-list/swirl-resource-list.js +2 -3
- package/dist/collection/components/swirl-resource-list-item/swirl-resource-list-item.css +0 -1
- package/dist/collection/components/swirl-resource-list-item/swirl-resource-list-item.js +3 -4
- package/dist/collection/components/swirl-select/swirl-select.css +0 -2
- package/dist/collection/components/swirl-separator/swirl-separator.css +0 -1
- package/dist/collection/components/swirl-tab-bar/swirl-tab-bar.css +0 -1
- package/dist/collection/components/swirl-table/swirl-table.css +0 -1
- package/dist/collection/components/swirl-table-cell/swirl-table-cell.css +1 -2
- package/dist/components/swirl-accordion-item.js +1 -1
- package/dist/components/swirl-card.js +1 -1
- package/dist/components/swirl-color-input.js +1 -1
- package/dist/components/swirl-console-layout.js +1 -1
- package/dist/components/swirl-data-cell-stack.js +1 -1
- package/dist/components/swirl-data-cell.js +1 -1
- package/dist/components/swirl-date-picker2.js +1 -1
- package/dist/components/swirl-file-chip.js +1 -1
- package/dist/components/swirl-file-uploader.js +1 -1
- package/dist/components/swirl-file-viewer-image2.js +1 -1
- package/dist/components/swirl-file-viewer-video2.js +1 -1
- package/dist/components/swirl-image-grid-item.js +1 -1
- package/dist/components/swirl-inline-error2.js +1 -1
- package/dist/components/swirl-inline-status.js +1 -1
- package/dist/components/swirl-option-list-item2.js +1 -1
- package/dist/components/swirl-option-list2.js +1 -1
- package/dist/components/swirl-pagination.js +1 -1
- package/dist/components/swirl-resource-list-item.js +1 -1
- package/dist/components/swirl-resource-list.js +1 -1
- package/dist/components/swirl-select.js +1 -1
- package/dist/components/swirl-separator2.js +1 -1
- package/dist/components/swirl-tab-bar2.js +1 -1
- package/dist/components/swirl-table-cell.js +1 -1
- package/dist/components/swirl-table.js +1 -1
- package/dist/esm/swirl-accordion-item.entry.js +3 -4
- package/dist/esm/swirl-card.entry.js +1 -1
- package/dist/esm/swirl-color-input.entry.js +3 -4
- package/dist/esm/swirl-console-layout.entry.js +1 -1
- package/dist/esm/swirl-data-cell-stack.entry.js +2 -3
- package/dist/esm/swirl-data-cell.entry.js +3 -4
- package/dist/esm/swirl-date-picker_2.entry.js +1 -1
- package/dist/esm/swirl-file-chip.entry.js +1 -1
- package/dist/esm/swirl-file-uploader.entry.js +1 -1
- package/dist/esm/swirl-file-viewer-audio_7.entry.js +6 -2
- package/dist/esm/swirl-icon-check-small_2.entry.js +3 -4
- package/dist/esm/swirl-icon-error_3.entry.js +1 -1
- package/dist/esm/swirl-image-grid-item.entry.js +1 -1
- package/dist/esm/swirl-inline-status.entry.js +1 -1
- package/dist/esm/swirl-option-list.entry.js +2 -3
- package/dist/esm/swirl-pagination.entry.js +1 -1
- package/dist/esm/swirl-resource-list-item.entry.js +4 -5
- package/dist/esm/swirl-resource-list.entry.js +2 -3
- package/dist/esm/swirl-select.entry.js +1 -1
- package/dist/esm/swirl-separator.entry.js +1 -1
- package/dist/esm/swirl-tab-bar.entry.js +1 -1
- package/dist/esm/swirl-table-cell.entry.js +1 -1
- package/dist/esm/swirl-table.entry.js +1 -1
- package/dist/swirl-components/p-1ad388ee.entry.js +1 -0
- package/dist/swirl-components/{p-bf758fa6.entry.js → p-210445a5.entry.js} +1 -1
- package/dist/swirl-components/{p-f9d6c569.entry.js → p-39d77af2.entry.js} +1 -1
- package/dist/swirl-components/{p-3dbc3b2b.entry.js → p-3bfb288a.entry.js} +1 -1
- package/dist/swirl-components/p-49832cd4.entry.js +1 -0
- package/dist/swirl-components/p-64903416.entry.js +1 -0
- package/dist/swirl-components/p-76e08c22.entry.js +1 -0
- package/dist/swirl-components/{p-1d922b34.entry.js → p-8588b8cc.entry.js} +1 -1
- package/dist/swirl-components/{p-169ca57a.entry.js → p-8f9f7875.entry.js} +1 -1
- package/dist/swirl-components/{p-e7ca6409.entry.js → p-960bf4e2.entry.js} +2 -2
- package/dist/swirl-components/p-98c12f65.entry.js +1 -0
- package/dist/swirl-components/{p-7a165e77.entry.js → p-a28fcb04.entry.js} +1 -1
- package/dist/swirl-components/{p-07b4d869.entry.js → p-a72ee233.entry.js} +1 -1
- package/dist/swirl-components/{p-afbf4b33.entry.js → p-aa397b45.entry.js} +1 -1
- package/dist/swirl-components/{p-0adbfed0.entry.js → p-c2dc914c.entry.js} +1 -1
- package/dist/swirl-components/p-cea23645.entry.js +1 -0
- package/dist/swirl-components/p-cf6fbcee.entry.js +1 -0
- package/dist/swirl-components/{p-358d9e37.entry.js → p-d311b952.entry.js} +1 -1
- package/dist/swirl-components/p-dbd9fcd9.entry.js +1 -0
- package/dist/swirl-components/p-e03007f2.entry.js +1 -0
- package/dist/swirl-components/{p-18b88415.entry.js → p-ea5709c4.entry.js} +1 -1
- package/dist/swirl-components/p-f3e2ce62.entry.js +1 -0
- package/dist/swirl-components/p-ffcb308d.entry.js +1 -0
- package/dist/swirl-components/swirl-components.esm.js +1 -1
- package/dist/types/components/swirl-file-viewer/viewers/swirl-file-viewer-video/swirl-file-viewer-video.d.ts +2 -0
- package/dist/types/components/swirl-resource-list/swirl-resource-list.d.ts +1 -1
- package/dist/types/components.d.ts +4 -2
- package/package.json +1 -1
- package/dist/cjs/v4-Bq3ldsQe.js +0 -58
- package/dist/components/v4.js +0 -1
- package/dist/esm/v4-DD3477fe.js +0 -56
- package/dist/swirl-components/p-014d64ac.entry.js +0 -1
- package/dist/swirl-components/p-02146e6a.entry.js +0 -1
- package/dist/swirl-components/p-0becd3e6.entry.js +0 -1
- package/dist/swirl-components/p-1861a24d.entry.js +0 -1
- package/dist/swirl-components/p-417819b1.entry.js +0 -1
- package/dist/swirl-components/p-78704082.entry.js +0 -1
- package/dist/swirl-components/p-7a90a64c.entry.js +0 -1
- package/dist/swirl-components/p-DD3477fe.js +0 -1
- package/dist/swirl-components/p-b96b6445.entry.js +0 -1
- package/dist/swirl-components/p-cbabb9fe.entry.js +0 -1
- package/dist/swirl-components/p-d5c9217e.entry.js +0 -1
- package/dist/swirl-components/p-fff2a98f.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as s,createEvent as i,h as e,Host as r,transformTag as h}from"@stencil/core/internal/client";import{S as
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as s,createEvent as i,h as e,Host as r,transformTag as h}from"@stencil/core/internal/client";import{S as o}from"./sortable.esm.js";import{d as a}from"./swirl-box2.js";import{d as l}from"./swirl-stack2.js";import{d as n}from"./swirl-visually-hidden2.js";const d=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.itemDrop=i(this,"itemDrop",7),this.assistiveTextItemGrabbed="Item grabbed. Use arrow keys to move item up or down. Use spacebar to save position.",this.assistiveTextItemMoving="Current position:",this.assistiveTextItemMoved="Item moved. New position:",this.semantics="grid",this.spacing="0",this.listId=crypto.randomUUID(),this.focusedIndex=0,this.componentLoaded=!1,this.toggleDrag=t=>{const s=t.detail;this.dragging?this.stopDrag(s):this.startDrag(s)},this.startDrag=t=>{this.dragging=t,this.draggingStartIndex=this.getItemIndex(this.dragging),t.setAttribute("dragging","true");const s=this.getItemIndex(this.dragging);this.focusItemAtIndex(s),this.assistiveText=this.assistiveTextItemGrabbed},this.stopDrag=t=>{const s=this.getItemIndex(this.dragging);this.dragging=void 0,t.removeAttribute("dragging"),this.assistiveText=`${this.assistiveTextItemMoved} ${s+1}`,this.itemDrop.emit({item:t,oldIndex:this.draggingStartIndex,newIndex:s}),this.draggingStartIndex=void 0},this.onKeyDown=t=>{if("grid"===this.semantics&&!this.dragging)if("ArrowDown"===t.code)t.preventDefault(),this.focusItemAtIndex((this.focusedIndex+1)%this.items.length);else if("ArrowUp"===t.code)t.preventDefault(),this.focusItemAtIndex(0===this.focusedIndex?this.items.length-1:this.focusedIndex-1);else if("Enter"===t.code&&this.controllingElement){const s=this.items[this.focusedIndex];if(!s||!s.isConnected)return;t.stopPropagation(),t.preventDefault(),s.click()}else"Home"===t.code?(t.preventDefault(),this.focusItemAtIndex(0)):"End"===t.code&&(t.preventDefault(),this.focusItemAtIndex(this.items.length-1));if(this.dragging)if("ArrowDown"===t.code)t.preventDefault(),this.moveDraggedItemDown();else if("ArrowUp"===t.code)t.preventDefault(),this.moveDraggedItemUp();else if("Space"===t.code||"Enter"===t.code){const s=t.composedPath()[0];s?.classList.contains("resource-list-item__drag-handle")||(t.preventDefault(),this.stopDrag(this.dragging))}}}connectedCallback(){this.componentLoaded&&(this.observeSlotChanges(),this.collectItems(),this.setupControllingElement(),this.setItemAllowDragState())}componentDidLoad(){this.observeSlotChanges(),this.collectItems(),this.setupControllingElement(),this.setItemAllowDragState(),this.setupDragDrop(),this.setSectionSpacingAndSeparator(),this.componentLoaded=!0}componentDidRender(){this.setupDragDrop()}disconnectedCallback(){this.sortable?.destroy(),this.observer?.disconnect(),this.controllingElement?.removeEventListener("keydown",this.onKeyDown),this.removeToggleDragListeners()}observeSlotChanges(){this.observer?.disconnect(),this.observer=new MutationObserver((()=>{this.collectItems(),this.setItemAllowDragState(),this.setSectionSpacingAndSeparator()})),this.observer.observe(this.el,{childList:!0,characterData:!0,subtree:!0})}watchAllowDrag(){this.setItemAllowDragState(),this.setupDragDrop()}async resetFocus(){this.focusedIndex=0,this.removeItemsFromTabOrder(),this.enableItemFocus(this.items[0]),this.controllingElement&&this.items[0]?.setAttribute("aria-selected","true")}collectItems(){this.removeToggleDragListeners(),this.items=Array.from(this.el.querySelectorAll("swirl-resource-list-item, swirl-resource-list-file-item, [data-resource-list-item]")).filter((t=>t.isConnected)),this.sections=Array.from(this.el.querySelectorAll("swirl-resource-list-section")).filter((t=>t.isConnected)),this.removeItemsFromTabOrder(),this.enableItemFocus(this.items[this.focusedIndex]),this.controllingElement&&this.items[0]?.setAttribute("aria-selected","true")}setupControllingElement(){this.controllingElement&&(this.controllingElement.setAttribute("aria-controls",this.listId),this.controllingElement.setAttribute("role","combobox"),this.controllingElement.setAttribute("aria-autocomplete","list"),this.controllingElement.addEventListener("keydown",this.onKeyDown))}getItemIndex(t){return this.items.map((t=>t)).findIndex((s=>s===t))}removeItemsFromTabOrder(){"grid"===this.semantics&&this.items.forEach((t=>{const s=t?.querySelector(".resource-list-item__content, .resource-list-file-item, [data-resource-list-item-button]"),i=t?.querySelector(".resource-list-item__drag-handle");this.controllingElement&&t.setAttribute("aria-selected","false"),s?.setAttribute("tabIndex","-1"),i?.setAttribute("tabIndex","-1")}))}removeToggleDragListeners(){this.items?.forEach((t=>{t.removeEventListener("toggleDrag",this.toggleDrag)}))}setItemAllowDragState(){this.allowDrag?this.items.filter((t=>this.sections.every((s=>!s.contains(t))))).forEach((t=>{t.setAttribute("allow-drag","true"),t.addEventListener("toggleDrag",this.toggleDrag)})):this.items.forEach((t=>{t.removeAttribute("allow-drag"),t.removeEventListener("toggleDrag",this.toggleDrag)}))}setupDragDrop(){this.sortable&&this.sortable.destroy(),this.allowDrag&&(this.sortable=o.create(this.gridEl,{animation:150,draggable:"swirl-resource-list-item",dragClass:"swirl-resource-list-item--drag",handle:".resource-list-item__drag-handle",onEnd:t=>{this.itemDrop.emit({item:t.item,oldIndex:t.oldDraggableIndex,newIndex:t.newDraggableIndex})}}))}enableItemFocus(t,s){if(!t||this.controllingElement)return;const i=t.querySelector(".resource-list-item__content, .resource-list-file-item, [data-resource-list-item-button]"),e=t.querySelector(".resource-list-item__drag-handle");e&&e.setAttribute("tabIndex","0"),i&&(i.setAttribute("tabIndex","0"),s&&!this.controllingElement&&i.focus())}focusItemAtIndex(t){this.removeItemsFromTabOrder();const s=this.items[t];s&&s.isConnected&&(this.enableItemFocus(s,!this.controllingElement),this.controllingElement&&(s.setAttribute("aria-selected","true"),s.scrollIntoView({block:"nearest"})),this.focusedIndex=t)}moveDraggedItemDown(){const t=this.dragging.nextElementSibling;t&&(t.after(this.dragging),this.collectItems(),this.focusItemAtIndex(this.getItemIndex(this.dragging)),this.assistiveText=`${this.assistiveTextItemMoving} ${this.getItemIndex(this.dragging)+1}`)}moveDraggedItemUp(){const t=this.dragging.previousElementSibling;t&&(t.before(this.dragging),this.collectItems(),this.focusItemAtIndex(this.getItemIndex(this.dragging)),this.assistiveText=`${this.assistiveTextItemMoving} ${this.getItemIndex(this.dragging)+1}`)}setSectionSpacingAndSeparator(){this.sections.forEach(((t,s)=>{0===s&&"SWIRL-RESOURCE-LIST-ITEM"!==t.previousElementSibling?.tagName&&(t.hasSeparator=!1),t.spacing=this.spacing}))}render(){return e(r,{key:"b5e4d53782d0d41c43d81f7222201f03d28cc282",onKeyDown:this.onKeyDown},e("swirl-visually-hidden",{key:"1b9112ef866b5095c1c9f47f96cd0b7c61db8e04",role:"alert"},this.assistiveText),e("swirl-box",{key:"cf1605239d7a736f924ee3bef04180a5d49d1d25",paddingBlockEnd:this.paddingBlockEnd??this.padding,paddingBlockStart:this.paddingBlockStart??this.padding,paddingInlineEnd:this.paddingInlineEnd??this.padding??"8",paddingInlineStart:this.paddingInlineStart??this.padding??"8"},e("swirl-stack",{key:"a9176dd03792be73814a33cc9d3eab7740702f2b","aria-label":this.label,class:"resource-list",id:this.listId,ref:t=>this.gridEl=t,role:this.semantics,spacing:this.spacing},e("slot",{key:"0c1335249b5e423ffd422591573ec08a5cf53f74"}))))}get el(){return this}static get watchers(){return{allowDrag:[{watchAllowDrag:0}]}}static get style(){return".sc-swirl-resource-list-h{display:block;width:100%}.sc-swirl-resource-list-h *.sc-swirl-resource-list{box-sizing:border-box}"}},[262,"swirl-resource-list",{allowDrag:[4,"allow-drag"],assistiveTextItemGrabbed:[1,"assistive-text-item-grabbed"],assistiveTextItemMoving:[1,"assistive-text-item-moving"],assistiveTextItemMoved:[1,"assistive-text-item-moved"],controllingElement:[16],label:[1],padding:[1],paddingBlockEnd:[1,"padding-block-end"],paddingBlockStart:[1,"padding-block-start"],paddingInlineEnd:[1,"padding-inline-end"],paddingInlineStart:[1,"padding-inline-start"],semantics:[1],spacing:[1],assistiveText:[32],listId:[32],resetFocus:[64]},void 0,{allowDrag:[{watchAllowDrag:0}]}]),c=d,m=function(){"undefined"!=typeof customElements&&["swirl-resource-list","swirl-box","swirl-stack","swirl-visually-hidden"].forEach((t=>{switch(t){case"swirl-resource-list":customElements.get(h(t))||customElements.define(h(t),d);break;case"swirl-box":customElements.get(h(t))||a();break;case"swirl-stack":customElements.get(h(t))||l();break;case"swirl-visually-hidden":customElements.get(h(t))||n()}}))};export{c as SwirlResourceList,m as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as s,createEvent as t,h as i,Host as l,transformTag as c}from"@stencil/core/internal/client";import{c as r}from"./index2.js";import{q as a}from"./utils.js";import{d as o}from"./swirl-icon-check-small2.js";import{d as n}from"./swirl-icon-check-strong2.js";import{d as h}from"./swirl-icon-close2.js";import{d}from"./swirl-icon-drag-handle2.js";import{d as p}from"./swirl-icon-expand-less2.js";import{d as w}from"./swirl-icon-expand-more2.js";import{d as m}from"./swirl-icon-search2.js";import{d as u}from"./swirl-option-list2.js";import{d as b}from"./swirl-option-list-item2.js";import{d as f}from"./swirl-popover2.js";import{d as _}from"./swirl-popover-trigger2.js";import{d as v}from"./swirl-spinner2.js";import{d as g}from"./swirl-stack2.js";import{d as k}from"./swirl-tag2.js";import{d as y}from"./swirl-text2.js";import{d as x}from"./swirl-visually-hidden2.js";const E=e(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.searchChange=t(this,"searchChange",7),this.valueChange=t(this,"valueChange",7),this.allowDeselect=!0,this.emptyListLabel="No results found.",this.searchInputLabel="Search options",this.selectId=""+Math.round(1e6*Math.random()),this.options=[],this.typeaheadBuffer="",this.select=e=>{e.stopPropagation(),this.value=e.detail,this.multiSelect||this.swirlPopover.close()},this.unselectOption=e=>{this.allowDeselect&&(this.value=this.value.filter((s=>s!==e)))},this.onSlotChange=()=>{this.updateOptions()},this.onOpen=e=>{this.placement=e.detail.position?.placement,this.open=!0,this.typeaheadBuffer="",clearTimeout(this.typeaheadTimeout),this.withSearch&&this.searchInput?this.searchInput.focus():this.optionList.querySelector('[tabIndex="0"]')?.focus()},this.onClose=()=>{this.searchInput&&(this.searchInput.value="",this.searchChange.emit("")),this.typeaheadBuffer="",clearTimeout(this.typeaheadTimeout),this.open=!1,this.input.focus()},this.onKeyDown=e=>{if("Space"===e.code||"Enter"===e.code){if(e.target===this.searchInput)return;e.preventDefault(),this.swirlPopover.open(this.el)}else"ArrowDown"===e.code&&e.target===this.searchInput?this.optionList.querySelector('[tabIndex="0"]')?.focus():this.isTypeaheadKey(e)&&(e.preventDefault(),e.stopPropagation(),this.handleTypeahead(e.key))},this.onSearchInput=e=>{this.searchChange.emit(e.target.value)}}componentWillLoad(){queueMicrotask((()=>{this.updateOptions(),this.observeSlotChanges()}))}disconnectedCallback(){this.observer?.disconnect(),clearTimeout(this.typeaheadTimeout)}onWindowFocusIn(e){e.target===this.el.querySelector("input")&&e.stopImmediatePropagation()}onValueChange(e,s){e?.length===s?.length&&e?.every((e=>s?.includes(e)))||this.valueChange.emit(this.value)}observeSlotChanges(){this.observer=new MutationObserver((()=>{this.updateOptions()})),this.observer.observe(this.el,{childList:!0,subtree:!0})}updateOptions(){this.options=a(this.el,"swirl-option-list-item")}isTypeaheadKey(e){return e.target!==this.searchInput&&!(e.metaKey||e.ctrlKey||e.altKey)&&1===e.key.length&&" "!==e.key}handleTypeahead(e){const s=e.toLowerCase();if(clearTimeout(this.typeaheadTimeout),this.typeaheadBuffer.length>0&&[...this.typeaheadBuffer].every((e=>e===s)))this.typeaheadBuffer+=s,this.cycleTypeahead(s);else{const e=this.typeaheadBuffer.length>1&&1===new Set(this.typeaheadBuffer).size;this.typeaheadBuffer=e?s:this.typeaheadBuffer+s,this.prefixMatchTypeahead(this.typeaheadBuffer)||(this.typeaheadBuffer=s,this.prefixMatchTypeahead(this.typeaheadBuffer))}this.typeaheadTimeout=setTimeout((()=>{this.typeaheadBuffer=""}),500)}cycleTypeahead(e){const s=this.options.filter((e=>!e.disabled)).filter((s=>s.label?.toLowerCase().startsWith(e)));if(0===s.length)return;const t=this.getTypeaheadAnchorValue(),i=s.findIndex((e=>e.value===t));this.applyTypeaheadMatch(s[(i+1)%s.length])}prefixMatchTypeahead(e){const s=this.options.filter((e=>!e.disabled)).find((s=>s.label?.toLowerCase().startsWith(e)));return!!s&&(this.applyTypeaheadMatch(s),!0)}getTypeaheadAnchorValue(){if(this.open){const e=this.options.find((e=>e.querySelector('[role="option"][tabindex="0"]')));return e?.value}return this.value?.[this.value.length-1]}applyTypeaheadMatch(e){this.open&&this.optionList.focusItemWithValue(e.value)}getValueLabel(){return this.value?this.value?.map((e=>this.options.find((s=>s.value===e))?.label)).join(", "):""}render(){const e=this.getValueLabel(),s=!0===this.invalid||!1===this.invalid?this.invalid+"":void 0,t=this.el.closest("swirl-form-control"),c=this.standalone?[-8,0]:t?.inline||"outside"===t?.labelPosition?[0,-12]:[0,-16],a=r("select","select--placement-"+this.placement,{"select--disabled":this.disabled,"select--inline":this.inline,"select--multi":this.multiSelect,"select--search-loading":this.searchLoading,"select--standalone":this.standalone});return i(l,{key:"e4a6fa7de3193ae7d61dc89834ef14a3b44fe894",onKeyDown:this.onKeyDown},i("div",{key:"30f125d65dce3ab7bb23f9c3ac2d4fc55b705e44",class:a},i("swirl-popover-trigger",{key:"490a51de7ab9732e17af4af85ba841720901b267",swirlPopover:this.swirlPopover,setAriaAttributes:!1},i("swirl-stack",{key:"df411b8e162a81cbae6a38cd01953888ba4453e2",class:"select__value-container"},this.standalone&&i("span",{key:"d55389bdc33aabaf6f8e3504461af470bd6fa666","aria-hidden":"true",class:"select__resize-helper"},e),i("input",{key:"2c6bbcd3df6775a3214933d53c78b9121480d65e","aria-describedby":this.swirlAriaDescribedby,"aria-disabled":this.disabled?"true":void 0,"aria-invalid":s,class:"select__input",disabled:this.disabled,readOnly:!0,ref:e=>this.input=e,type:"text",value:e}))),i("span",{key:"b12133de92aa5b817cac468845f1c6fa75cc67a0",class:"select__multi-select-values"},this.value?.map((e=>this.options.find((s=>s.value===e))))?.map((e=>i("swirl-tag",{"aria-hidden":"true",label:e?.label,onRemove:()=>this.unselectOption(e?.value),removable:!this.disabled&&this.allowDeselect&&!e?.disabled})))),i("span",{key:"5da46914a0889a687145e62d229cb1f82f94700c",class:"select__indicator"},i(this.open?"swirl-icon-expand-less":"swirl-icon-expand-more",{size:this.standalone?20:24})),i("swirl-popover",{key:"760ebfe41559a4bfafe2aa2c26bbb9411b096af5",animation:"scale-in-y",class:"select__popover",id:"select-options-"+this.selectId,label:this.label,offset:c,onPopoverClose:this.onClose,onPopoverOpen:this.onOpen,ref:e=>this.swirlPopover=e,useContainerWidth:!this.standalone&&"swirl-form-control"},this.withSearch&&i("div",{key:"b01b9a37d675f1b60ab96b1f88f6bcbed06f37f1",class:"select__search"},i("swirl-icon-search",{key:"b0f521287bcde062b46e899e12661709921cec9e",class:"select__search-icon",size:20}),i("input",{key:"be2083ce2005a980c9080e704fbf12b566e614e3","aria-label":this.searchInputLabel,class:"select__search-input",onInput:this.onSearchInput,placeholder:this.searchPlaceholder,ref:e=>this.searchInput=e,type:"search"}),this.searchLoading&&i("swirl-spinner",{key:"dfce2ab48e5dbd8df789362f6c87d7dc44bd319f",class:"select__search-spinner",size:"s"})),i("swirl-option-list",{key:"092a4a432faf043c588ba46d29b5e22790c0e0d0",class:"select__option-list",allowDeselect:this.allowDeselect,onValueChange:this.select,multiSelect:this.multiSelect,ref:e=>this.optionList=e,value:this.value},!this.searchLoading&&i("div",{key:"19a514a5e8df3e43239bde257e22a09ccd1e223b","aria-disabled":"true",class:"select__empty-list-label",role:"option"},i("swirl-text",{key:"60885f37512ae9974a002aa4ef15494ae58ed8da",color:"subdued",weight:"medium"},this.emptyListLabel)),i("slot",{key:"0c6568db5d7a811a4aca8d97864df2973eabd3a9",onSlotchange:this.onSlotChange})))))}get el(){return this}static get watchers(){return{value:[{onValueChange:0}]}}static get style(){return'.sc-swirl-select-h{display:block;width:100%}.sc-swirl-select-h *.sc-swirl-select{box-sizing:border-box}.select.sc-swirl-select{position:relative;display:flex;width:100%}.select.sc-swirl-select .sc-swirl-select::part(popover__content),.select.sc-swirl-select .sc-swirl-select [part~="popover__content"]{margin-top:var(--s-space-16)}@media (min-width: 768px){.select.sc-swirl-select .sc-swirl-select::part(popover__scroll-container){padding-top:0}}.select--placement-top-start.sc-swirl-select .sc-swirl-select::part(popover__content),.select--placement-top-start.sc-swirl-select .sc-swirl-select [part~="popover__content"]{margin-top:-2.25rem}.select--multi.sc-swirl-select .select__input.sc-swirl-select{position:absolute;width:100%;height:100%;pointer-events:none;opacity:0}.select--multi.sc-swirl-select .select__multi-select-values.sc-swirl-select{display:flex}.select--disabled.sc-swirl-select .select__input.sc-swirl-select{color:var(--s-text-disabled)}.select--disabled.sc-swirl-select .select__indicator.sc-swirl-select{color:var(--s-icon-disabled)}.select--inline.sc-swirl-select .select__indicator.sc-swirl-select{transform:translateY(-50%)}.select--standalone.sc-swirl-select{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.select--standalone.sc-swirl-select .select__indicator.sc-swirl-select{position:relative;top:auto;right:auto;cursor:pointer;transform:none}.select--standalone.sc-swirl-select .select__input.sc-swirl-select{padding-right:var(--s-space-8);font-weight:var(--s-font-weight-medium);cursor:pointer}.select--standalone.sc-swirl-select .select__value-container.sc-swirl-select{width:-webkit-min-content;width:-moz-min-content;width:min-content}.select--search-loading.sc-swirl-select .select__search-input.sc-swirl-select{padding-right:calc(var(--s-space-12) + 1.5rem + var(--s-space-8))}.select__resize-helper.sc-swirl-select{display:block;width:auto;height:0;margin:0;padding:0;padding-right:calc(1.5rem + var(--s-space-8));padding-right:var(--s-space-8);font:inherit;font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-base);text-align:left;white-space:pre;white-space:pre;vertical-align:top;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;opacity:0}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.select__resize-helper.sc-swirl-select{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.select__input.sc-swirl-select{display:block;overflow:hidden;width:100%;height:1.25rem;margin:0;padding:0;padding-right:calc(1.5rem + var(--s-space-8));border:none;background-color:transparent;font:inherit;line-height:var(--s-line-height-base);text-align:left;white-space:nowrap;text-overflow:ellipsis;cursor:default}.select__input.sc-swirl-select:focus{outline:none}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.select__input.sc-swirl-select{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.select__multi-select-values.sc-swirl-select{display:none;overflow:hidden;width:100%;min-height:1.25rem;padding-right:calc(1.5rem + var(--s-space-8));flex-wrap:wrap;flex-shrink:0;gap:var(--s-space-8)}.select__multi-select-values.sc-swirl-select .sc-swirl-select::part(tag),.select__multi-select-values.sc-swirl-select .sc-swirl-select [part~="tag"]{height:1.25rem;padding:0 var(--s-space-4)}.select__indicator.sc-swirl-select{position:absolute;top:50%;right:0;display:inline-flex;color:var(--s-icon-default);transform:translateY(calc(-50% - var(--s-space-8)));pointer-events:none}.select__search.sc-swirl-select{position:relative;display:flex;width:100%;padding:0.0625rem var(--s-space-8);border-bottom:0.0625rem solid var(--s-border-default)}@media (min-width: 768px){.select__search.sc-swirl-select{position:sticky;z-index:1;top:0;padding-top:var(--s-space-8);padding-right:0.0625rem;padding-left:0.0625rem}}.select__search-icon.sc-swirl-select{position:absolute;top:50%;left:calc(var(--s-space-8) * 2);display:inline-flex;color:var(--s-icon-default);transform:translateY(-50%)}@media (min-width: 768px){.select__search-icon.sc-swirl-select{left:var(--s-space-12);margin-top:var(--s-space-4);padding:0.0625rem}}.select__search-input.sc-swirl-select{width:100%;height:2.5rem;padding-right:var(--s-space-12);padding-left:calc(var(--s-space-12) + 1.25rem + var(--s-space-8));align-items:center;border:none;color:var(--s-text-default);background-color:transparent;font:inherit;line-height:var(--s-line-height-base);caret-color:var(--s-border-highlight)}.select__search-input.sc-swirl-select:focus:not(:focus-visible){outline:none}.select__search-input.sc-swirl-select:focus-visible{outline-color:var(--s-focus-default)}.select__search-input.sc-swirl-select::-moz-placeholder{color:var(--s-text-subdued)}.select__search-input.sc-swirl-select::placeholder{color:var(--s-text-subdued)}.select__search-input.sc-swirl-select::-webkit-search-decoration,.select__search-input.sc-swirl-select::-webkit-search-cancel-button,.select__search-input.sc-swirl-select::-webkit-search-results-button,.select__search-input.sc-swirl-select::-webkit-search-results-decoration{-webkit-appearance:none;appearance:none}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.select__search-input.sc-swirl-select{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.select__popover.sc-swirl-select::part(popover__scroll-container),.select__popover.sc-swirl-select [part~="popover__scroll-container"]{padding:0;overflow:hidden;display:flex;flex-direction:column}.select__popover.sc-swirl-select .select__search.sc-swirl-select{flex-shrink:0}.select__popover.sc-swirl-select .select__option-list.sc-swirl-select{padding:var(--s-space-4);overflow:auto;min-height:0}.select__search-spinner.sc-swirl-select{position:absolute;top:50%;right:var(--s-space-12);display:inline-flex;transform:translateY(-50%)}@media (min-width: 768px){.select__search-spinner.sc-swirl-select{margin-top:var(--s-space-4)}}.select__empty-list-label.sc-swirl-select{padding:var(--s-space-12) var(--s-space-12) 0}.select__empty-list-label.sc-swirl-select:not(:only-child){display:none}@media (min-width: 768px){.select__empty-list-label.sc-swirl-select{padding:var(--s-space-12) var(--s-space-12) var(--s-space-8)}}'}},[262,"swirl-select",{allowDeselect:[4,"allow-deselect"],disabled:[4],emptyListLabel:[1,"empty-list-label"],inline:[4],invalid:[4],label:[1],multiSelect:[4,"multi-select"],required:[4],searchInputLabel:[1,"search-input-label"],searchLoading:[4,"search-loading"],searchPlaceholder:[1,"search-placeholder"],selectId:[1,"select-id"],standalone:[4],swirlAriaDescribedby:[1,"swirl-aria-describedby"],value:[1040],withSearch:[4,"with-search"],options:[32],open:[32],placement:[32]},[[8,"focusin","onWindowFocusIn"]],{value:[{onValueChange:0}]}]),j=E,z=function(){"undefined"!=typeof customElements&&["swirl-select","swirl-icon-check-small","swirl-icon-check-strong","swirl-icon-close","swirl-icon-drag-handle","swirl-icon-expand-less","swirl-icon-expand-more","swirl-icon-search","swirl-option-list","swirl-option-list-item","swirl-popover","swirl-popover-trigger","swirl-spinner","swirl-stack","swirl-tag","swirl-text","swirl-visually-hidden"].forEach((e=>{switch(e){case"swirl-select":customElements.get(c(e))||customElements.define(c(e),E);break;case"swirl-icon-check-small":customElements.get(c(e))||o();break;case"swirl-icon-check-strong":customElements.get(c(e))||n();break;case"swirl-icon-close":customElements.get(c(e))||h();break;case"swirl-icon-drag-handle":customElements.get(c(e))||d();break;case"swirl-icon-expand-less":customElements.get(c(e))||p();break;case"swirl-icon-expand-more":customElements.get(c(e))||w();break;case"swirl-icon-search":customElements.get(c(e))||m();break;case"swirl-option-list":customElements.get(c(e))||u();break;case"swirl-option-list-item":customElements.get(c(e))||b();break;case"swirl-popover":customElements.get(c(e))||f();break;case"swirl-popover-trigger":customElements.get(c(e))||_();break;case"swirl-spinner":customElements.get(c(e))||v();break;case"swirl-stack":customElements.get(c(e))||g();break;case"swirl-tag":customElements.get(c(e))||k();break;case"swirl-text":customElements.get(c(e))||y();break;case"swirl-visually-hidden":customElements.get(c(e))||x()}}))};export{j as SwirlSelect,z as defineCustomElement}
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as s,createEvent as t,h as i,Host as l,transformTag as c}from"@stencil/core/internal/client";import{c as r}from"./index2.js";import{q as a}from"./utils.js";import{d as o}from"./swirl-icon-check-small2.js";import{d as n}from"./swirl-icon-check-strong2.js";import{d as h}from"./swirl-icon-close2.js";import{d}from"./swirl-icon-drag-handle2.js";import{d as p}from"./swirl-icon-expand-less2.js";import{d as w}from"./swirl-icon-expand-more2.js";import{d as m}from"./swirl-icon-search2.js";import{d as u}from"./swirl-option-list2.js";import{d as b}from"./swirl-option-list-item2.js";import{d as f}from"./swirl-popover2.js";import{d as _}from"./swirl-popover-trigger2.js";import{d as v}from"./swirl-spinner2.js";import{d as g}from"./swirl-stack2.js";import{d as y}from"./swirl-tag2.js";import{d as k}from"./swirl-text2.js";import{d as x}from"./swirl-visually-hidden2.js";const E=e(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.searchChange=t(this,"searchChange",7),this.valueChange=t(this,"valueChange",7),this.allowDeselect=!0,this.emptyListLabel="No results found.",this.searchInputLabel="Search options",this.selectId=""+Math.round(1e6*Math.random()),this.options=[],this.typeaheadBuffer="",this.select=e=>{e.stopPropagation(),this.value=e.detail,this.multiSelect||this.swirlPopover.close()},this.unselectOption=e=>{this.allowDeselect&&(this.value=this.value.filter((s=>s!==e)))},this.onSlotChange=()=>{this.updateOptions()},this.onOpen=e=>{this.placement=e.detail.position?.placement,this.open=!0,this.typeaheadBuffer="",clearTimeout(this.typeaheadTimeout),this.withSearch&&this.searchInput?this.searchInput.focus():this.optionList.querySelector('[tabIndex="0"]')?.focus()},this.onClose=()=>{this.searchInput&&(this.searchInput.value="",this.searchChange.emit("")),this.typeaheadBuffer="",clearTimeout(this.typeaheadTimeout),this.open=!1,this.input.focus()},this.onKeyDown=e=>{if("Space"===e.code||"Enter"===e.code){if(e.target===this.searchInput)return;e.preventDefault(),this.swirlPopover.open(this.el)}else"ArrowDown"===e.code&&e.target===this.searchInput?this.optionList.querySelector('[tabIndex="0"]')?.focus():this.isTypeaheadKey(e)&&(e.preventDefault(),e.stopPropagation(),this.handleTypeahead(e.key))},this.onSearchInput=e=>{this.searchChange.emit(e.target.value)}}componentWillLoad(){queueMicrotask((()=>{this.updateOptions(),this.observeSlotChanges()}))}disconnectedCallback(){this.observer?.disconnect(),clearTimeout(this.typeaheadTimeout)}onWindowFocusIn(e){e.target===this.el.querySelector("input")&&e.stopImmediatePropagation()}onValueChange(e,s){e?.length===s?.length&&e?.every((e=>s?.includes(e)))||this.valueChange.emit(this.value)}observeSlotChanges(){this.observer=new MutationObserver((()=>{this.updateOptions()})),this.observer.observe(this.el,{childList:!0,subtree:!0})}updateOptions(){this.options=a(this.el,"swirl-option-list-item")}isTypeaheadKey(e){return e.target!==this.searchInput&&!(e.metaKey||e.ctrlKey||e.altKey)&&1===e.key.length&&" "!==e.key}handleTypeahead(e){const s=e.toLowerCase();if(clearTimeout(this.typeaheadTimeout),this.typeaheadBuffer.length>0&&[...this.typeaheadBuffer].every((e=>e===s)))this.typeaheadBuffer+=s,this.cycleTypeahead(s);else{const e=this.typeaheadBuffer.length>1&&1===new Set(this.typeaheadBuffer).size;this.typeaheadBuffer=e?s:this.typeaheadBuffer+s,this.prefixMatchTypeahead(this.typeaheadBuffer)||(this.typeaheadBuffer=s,this.prefixMatchTypeahead(this.typeaheadBuffer))}this.typeaheadTimeout=setTimeout((()=>{this.typeaheadBuffer=""}),500)}cycleTypeahead(e){const s=this.options.filter((e=>!e.disabled)).filter((s=>s.label?.toLowerCase().startsWith(e)));if(0===s.length)return;const t=this.getTypeaheadAnchorValue(),i=s.findIndex((e=>e.value===t));this.applyTypeaheadMatch(s[(i+1)%s.length])}prefixMatchTypeahead(e){const s=this.options.filter((e=>!e.disabled)).find((s=>s.label?.toLowerCase().startsWith(e)));return!!s&&(this.applyTypeaheadMatch(s),!0)}getTypeaheadAnchorValue(){if(this.open){const e=this.options.find((e=>e.querySelector('[role="option"][tabindex="0"]')));return e?.value}return this.value?.[this.value.length-1]}applyTypeaheadMatch(e){this.open&&this.optionList.focusItemWithValue(e.value)}getValueLabel(){return this.value?this.value?.map((e=>this.options.find((s=>s.value===e))?.label)).join(", "):""}render(){const e=this.getValueLabel(),s=!0===this.invalid||!1===this.invalid?this.invalid+"":void 0,t=this.el.closest("swirl-form-control"),c=this.standalone?[-8,0]:t?.inline||"outside"===t?.labelPosition?[0,-12]:[0,-16],a=r("select","select--placement-"+this.placement,{"select--disabled":this.disabled,"select--inline":this.inline,"select--multi":this.multiSelect,"select--search-loading":this.searchLoading,"select--standalone":this.standalone});return i(l,{key:"e4a6fa7de3193ae7d61dc89834ef14a3b44fe894",onKeyDown:this.onKeyDown},i("div",{key:"30f125d65dce3ab7bb23f9c3ac2d4fc55b705e44",class:a},i("swirl-popover-trigger",{key:"490a51de7ab9732e17af4af85ba841720901b267",swirlPopover:this.swirlPopover,setAriaAttributes:!1},i("swirl-stack",{key:"df411b8e162a81cbae6a38cd01953888ba4453e2",class:"select__value-container"},this.standalone&&i("span",{key:"d55389bdc33aabaf6f8e3504461af470bd6fa666","aria-hidden":"true",class:"select__resize-helper"},e),i("input",{key:"2c6bbcd3df6775a3214933d53c78b9121480d65e","aria-describedby":this.swirlAriaDescribedby,"aria-disabled":this.disabled?"true":void 0,"aria-invalid":s,class:"select__input",disabled:this.disabled,readOnly:!0,ref:e=>this.input=e,type:"text",value:e}))),i("span",{key:"b12133de92aa5b817cac468845f1c6fa75cc67a0",class:"select__multi-select-values"},this.value?.map((e=>this.options.find((s=>s.value===e))))?.map((e=>i("swirl-tag",{"aria-hidden":"true",label:e?.label,onRemove:()=>this.unselectOption(e?.value),removable:!this.disabled&&this.allowDeselect&&!e?.disabled})))),i("span",{key:"5da46914a0889a687145e62d229cb1f82f94700c",class:"select__indicator"},i(this.open?"swirl-icon-expand-less":"swirl-icon-expand-more",{size:this.standalone?20:24})),i("swirl-popover",{key:"760ebfe41559a4bfafe2aa2c26bbb9411b096af5",animation:"scale-in-y",class:"select__popover",id:"select-options-"+this.selectId,label:this.label,offset:c,onPopoverClose:this.onClose,onPopoverOpen:this.onOpen,ref:e=>this.swirlPopover=e,useContainerWidth:!this.standalone&&"swirl-form-control"},this.withSearch&&i("div",{key:"b01b9a37d675f1b60ab96b1f88f6bcbed06f37f1",class:"select__search"},i("swirl-icon-search",{key:"b0f521287bcde062b46e899e12661709921cec9e",class:"select__search-icon",size:20}),i("input",{key:"be2083ce2005a980c9080e704fbf12b566e614e3","aria-label":this.searchInputLabel,class:"select__search-input",onInput:this.onSearchInput,placeholder:this.searchPlaceholder,ref:e=>this.searchInput=e,type:"search"}),this.searchLoading&&i("swirl-spinner",{key:"dfce2ab48e5dbd8df789362f6c87d7dc44bd319f",class:"select__search-spinner",size:"s"})),i("swirl-option-list",{key:"092a4a432faf043c588ba46d29b5e22790c0e0d0",class:"select__option-list",allowDeselect:this.allowDeselect,onValueChange:this.select,multiSelect:this.multiSelect,ref:e=>this.optionList=e,value:this.value},!this.searchLoading&&i("div",{key:"19a514a5e8df3e43239bde257e22a09ccd1e223b","aria-disabled":"true",class:"select__empty-list-label",role:"option"},i("swirl-text",{key:"60885f37512ae9974a002aa4ef15494ae58ed8da",color:"subdued",weight:"medium"},this.emptyListLabel)),i("slot",{key:"0c6568db5d7a811a4aca8d97864df2973eabd3a9",onSlotchange:this.onSlotChange})))))}get el(){return this}static get watchers(){return{value:[{onValueChange:0}]}}static get style(){return'.sc-swirl-select-h{display:block;width:100%}.sc-swirl-select-h *.sc-swirl-select{box-sizing:border-box}.select.sc-swirl-select{position:relative;display:flex;width:100%}.select.sc-swirl-select .sc-swirl-select::part(popover__content),.select.sc-swirl-select .sc-swirl-select [part~="popover__content"]{margin-top:var(--s-space-16)}@media (min-width: 768px){.select.sc-swirl-select .sc-swirl-select::part(popover__scroll-container){padding-top:0}}.select--placement-top-start.sc-swirl-select .sc-swirl-select::part(popover__content),.select--placement-top-start.sc-swirl-select .sc-swirl-select [part~="popover__content"]{margin-top:-2.25rem}.select--multi.sc-swirl-select .select__input.sc-swirl-select{position:absolute;width:100%;height:100%;pointer-events:none;opacity:0}.select--multi.sc-swirl-select .select__multi-select-values.sc-swirl-select{display:flex}.select--disabled.sc-swirl-select .select__input.sc-swirl-select{color:var(--s-text-disabled)}.select--disabled.sc-swirl-select .select__indicator.sc-swirl-select{color:var(--s-icon-disabled)}.select--inline.sc-swirl-select .select__indicator.sc-swirl-select{transform:translateY(-50%)}.select--standalone.sc-swirl-select{width:-moz-fit-content;width:fit-content}.select--standalone.sc-swirl-select .select__indicator.sc-swirl-select{position:relative;top:auto;right:auto;cursor:pointer;transform:none}.select--standalone.sc-swirl-select .select__input.sc-swirl-select{padding-right:var(--s-space-8);font-weight:var(--s-font-weight-medium);cursor:pointer}.select--standalone.sc-swirl-select .select__value-container.sc-swirl-select{width:-moz-min-content;width:min-content}.select--search-loading.sc-swirl-select .select__search-input.sc-swirl-select{padding-right:calc(var(--s-space-12) + 1.5rem + var(--s-space-8))}.select__resize-helper.sc-swirl-select{display:block;width:auto;height:0;margin:0;padding:0;padding-right:calc(1.5rem + var(--s-space-8));padding-right:var(--s-space-8);font:inherit;font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-base);text-align:left;white-space:pre;white-space:pre;vertical-align:top;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;opacity:0}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.select__resize-helper.sc-swirl-select{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.select__input.sc-swirl-select{display:block;overflow:hidden;width:100%;height:1.25rem;margin:0;padding:0;padding-right:calc(1.5rem + var(--s-space-8));border:none;background-color:transparent;font:inherit;line-height:var(--s-line-height-base);text-align:left;white-space:nowrap;text-overflow:ellipsis;cursor:default}.select__input.sc-swirl-select:focus{outline:none}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.select__input.sc-swirl-select{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.select__multi-select-values.sc-swirl-select{display:none;overflow:hidden;width:100%;min-height:1.25rem;padding-right:calc(1.5rem + var(--s-space-8));flex-wrap:wrap;flex-shrink:0;gap:var(--s-space-8)}.select__multi-select-values.sc-swirl-select .sc-swirl-select::part(tag),.select__multi-select-values.sc-swirl-select .sc-swirl-select [part~="tag"]{height:1.25rem;padding:0 var(--s-space-4)}.select__indicator.sc-swirl-select{position:absolute;top:50%;right:0;display:inline-flex;color:var(--s-icon-default);transform:translateY(calc(-50% - var(--s-space-8)));pointer-events:none}.select__search.sc-swirl-select{position:relative;display:flex;width:100%;padding:0.0625rem var(--s-space-8);border-bottom:0.0625rem solid var(--s-border-default)}@media (min-width: 768px){.select__search.sc-swirl-select{position:sticky;z-index:1;top:0;padding-top:var(--s-space-8);padding-right:0.0625rem;padding-left:0.0625rem}}.select__search-icon.sc-swirl-select{position:absolute;top:50%;left:calc(var(--s-space-8) * 2);display:inline-flex;color:var(--s-icon-default);transform:translateY(-50%)}@media (min-width: 768px){.select__search-icon.sc-swirl-select{left:var(--s-space-12);margin-top:var(--s-space-4);padding:0.0625rem}}.select__search-input.sc-swirl-select{width:100%;height:2.5rem;padding-right:var(--s-space-12);padding-left:calc(var(--s-space-12) + 1.25rem + var(--s-space-8));align-items:center;border:none;color:var(--s-text-default);background-color:transparent;font:inherit;line-height:var(--s-line-height-base);caret-color:var(--s-border-highlight)}.select__search-input.sc-swirl-select:focus:not(:focus-visible){outline:none}.select__search-input.sc-swirl-select:focus-visible{outline-color:var(--s-focus-default)}.select__search-input.sc-swirl-select::-moz-placeholder{color:var(--s-text-subdued)}.select__search-input.sc-swirl-select::placeholder{color:var(--s-text-subdued)}.select__search-input.sc-swirl-select::-webkit-search-decoration,.select__search-input.sc-swirl-select::-webkit-search-cancel-button,.select__search-input.sc-swirl-select::-webkit-search-results-button,.select__search-input.sc-swirl-select::-webkit-search-results-decoration{-webkit-appearance:none;appearance:none}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.select__search-input.sc-swirl-select{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.select__popover.sc-swirl-select::part(popover__scroll-container),.select__popover.sc-swirl-select [part~="popover__scroll-container"]{padding:0;overflow:hidden;display:flex;flex-direction:column}.select__popover.sc-swirl-select .select__search.sc-swirl-select{flex-shrink:0}.select__popover.sc-swirl-select .select__option-list.sc-swirl-select{padding:var(--s-space-4);overflow:auto;min-height:0}.select__search-spinner.sc-swirl-select{position:absolute;top:50%;right:var(--s-space-12);display:inline-flex;transform:translateY(-50%)}@media (min-width: 768px){.select__search-spinner.sc-swirl-select{margin-top:var(--s-space-4)}}.select__empty-list-label.sc-swirl-select{padding:var(--s-space-12) var(--s-space-12) 0}.select__empty-list-label.sc-swirl-select:not(:only-child){display:none}@media (min-width: 768px){.select__empty-list-label.sc-swirl-select{padding:var(--s-space-12) var(--s-space-12) var(--s-space-8)}}'}},[262,"swirl-select",{allowDeselect:[4,"allow-deselect"],disabled:[4],emptyListLabel:[1,"empty-list-label"],inline:[4],invalid:[4],label:[1],multiSelect:[4,"multi-select"],required:[4],searchInputLabel:[1,"search-input-label"],searchLoading:[4,"search-loading"],searchPlaceholder:[1,"search-placeholder"],selectId:[1,"select-id"],standalone:[4],swirlAriaDescribedby:[1,"swirl-aria-describedby"],value:[1040],withSearch:[4,"with-search"],options:[32],open:[32],placement:[32]},[[8,"focusin","onWindowFocusIn"]],{value:[{onValueChange:0}]}]),j=E,z=function(){"undefined"!=typeof customElements&&["swirl-select","swirl-icon-check-small","swirl-icon-check-strong","swirl-icon-close","swirl-icon-drag-handle","swirl-icon-expand-less","swirl-icon-expand-more","swirl-icon-search","swirl-option-list","swirl-option-list-item","swirl-popover","swirl-popover-trigger","swirl-spinner","swirl-stack","swirl-tag","swirl-text","swirl-visually-hidden"].forEach((e=>{switch(e){case"swirl-select":customElements.get(c(e))||customElements.define(c(e),E);break;case"swirl-icon-check-small":customElements.get(c(e))||o();break;case"swirl-icon-check-strong":customElements.get(c(e))||n();break;case"swirl-icon-close":customElements.get(c(e))||h();break;case"swirl-icon-drag-handle":customElements.get(c(e))||d();break;case"swirl-icon-expand-less":customElements.get(c(e))||p();break;case"swirl-icon-expand-more":customElements.get(c(e))||w();break;case"swirl-icon-search":customElements.get(c(e))||m();break;case"swirl-option-list":customElements.get(c(e))||u();break;case"swirl-option-list-item":customElements.get(c(e))||b();break;case"swirl-popover":customElements.get(c(e))||f();break;case"swirl-popover-trigger":customElements.get(c(e))||_();break;case"swirl-spinner":customElements.get(c(e))||v();break;case"swirl-stack":customElements.get(c(e))||g();break;case"swirl-tag":customElements.get(c(e))||y();break;case"swirl-text":customElements.get(c(e))||k();break;case"swirl-visually-hidden":customElements.get(c(e))||x()}}))};export{j as SwirlSelect,z as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as r,HTMLElement as t,h as e,Host as a,Fragment as o,transformTag as s}from"@stencil/core/internal/client";import{c as i}from"./index2.js";const l=r(class extends t{constructor(r){super(),!1!==r&&this.__registerHost(),this.__attachShadow(),this.borderColor="default",this.color="default",this.orientation="horizontal",this.semantics="separator",this.spacing="8"}componentWillLoad(){this.forceColor()}forceColor(){"default"!==this.borderColor&&(console.warn('[Swirl] The "borderColor" prop of swirl-separator is deprecated and will be removed with the next major release. Please use the "color" prop to achieve the same result.'),this.color=this.borderColor)}render(){const r="horizontal"===this.orientation?{paddingTop:`var(--s-space-${this.spacing})`,paddingBottom:`var(--s-space-${this.spacing})`}:{paddingRight:`var(--s-space-${this.spacing})`,paddingLeft:`var(--s-space-${this.spacing})`},t=i("separator",`separator--color-${this.color}`,`separator--orientation-${this.orientation}`);return e(a,{key:"23acb3a29638b92737838e75a54d7616e6c9150e",..."separator"===this.semantics?{"aria-orientation":this.orientation}:{},class:t,role:this.semantics,style:r},e("span",{key:"3ebf80f47fb36438403551f560db91ecf7d7e559",class:"separator__line"}),this.label&&e(o,{key:"84ac7960ba714ab27559751c11bd7c4b56ac3176"},e("span",{key:"6f8dc3ad3bde938789e28ad05c67da657262a4d1",class:"separator__label"},this.label),e("span",{key:"63ddb77ea887a890bb1731d12a939783b592e21a",class:"separator__line"})))}static get style(){return":host{display:flex;width:100%;align-items:center;gap:var(--s-space-8)}:host *{box-sizing:border-box}:host(.separator--orientation-vertical){display:inline-flex;width:auto;flex-direction:column}:host(.separator--orientation-vertical) .separator__line{width:var(--s-border-width-default);height:100%;min-height:1.125rem}:host(.separator--color-critical) .separator__line{background-color:var(--s-border-critical)}:host(.separator--color-critical) .separator__label{color:var(--s-text-subdued)}:host(.separator--color-strong) .separator__line{background-color:var(--s-border-strong)}:host(.separator--color-strong) .separator__label{color:var(--s-text-subdued)}:host(.separator--color-highlight) .separator__line{background-color:var(--s-border-highlight)}:host(.separator--color-highlight) .separator__label{color:var(--s-text-highlight)}.separator__line{display:block;width:100%;height:var(--s-border-width-default);background-color:var(--s-border-on-translucent)}.separator__label{flex-shrink:0;width:-
|
|
1
|
+
import{proxyCustomElement as r,HTMLElement as t,h as e,Host as a,Fragment as o,transformTag as s}from"@stencil/core/internal/client";import{c as i}from"./index2.js";const l=r(class extends t{constructor(r){super(),!1!==r&&this.__registerHost(),this.__attachShadow(),this.borderColor="default",this.color="default",this.orientation="horizontal",this.semantics="separator",this.spacing="8"}componentWillLoad(){this.forceColor()}forceColor(){"default"!==this.borderColor&&(console.warn('[Swirl] The "borderColor" prop of swirl-separator is deprecated and will be removed with the next major release. Please use the "color" prop to achieve the same result.'),this.color=this.borderColor)}render(){const r="horizontal"===this.orientation?{paddingTop:`var(--s-space-${this.spacing})`,paddingBottom:`var(--s-space-${this.spacing})`}:{paddingRight:`var(--s-space-${this.spacing})`,paddingLeft:`var(--s-space-${this.spacing})`},t=i("separator",`separator--color-${this.color}`,`separator--orientation-${this.orientation}`);return e(a,{key:"23acb3a29638b92737838e75a54d7616e6c9150e",..."separator"===this.semantics?{"aria-orientation":this.orientation}:{},class:t,role:this.semantics,style:r},e("span",{key:"3ebf80f47fb36438403551f560db91ecf7d7e559",class:"separator__line"}),this.label&&e(o,{key:"84ac7960ba714ab27559751c11bd7c4b56ac3176"},e("span",{key:"6f8dc3ad3bde938789e28ad05c67da657262a4d1",class:"separator__label"},this.label),e("span",{key:"63ddb77ea887a890bb1731d12a939783b592e21a",class:"separator__line"})))}static get style(){return":host{display:flex;width:100%;align-items:center;gap:var(--s-space-8)}:host *{box-sizing:border-box}:host(.separator--orientation-vertical){display:inline-flex;width:auto;flex-direction:column}:host(.separator--orientation-vertical) .separator__line{width:var(--s-border-width-default);height:100%;min-height:1.125rem}:host(.separator--color-critical) .separator__line{background-color:var(--s-border-critical)}:host(.separator--color-critical) .separator__label{color:var(--s-text-subdued)}:host(.separator--color-strong) .separator__line{background-color:var(--s-border-strong)}:host(.separator--color-strong) .separator__label{color:var(--s-text-subdued)}:host(.separator--color-highlight) .separator__line{background-color:var(--s-border-highlight)}:host(.separator--color-highlight) .separator__label{color:var(--s-text-highlight)}.separator__line{display:block;width:100%;height:var(--s-border-width-default);background-color:var(--s-border-on-translucent)}.separator__label{flex-shrink:0;width:-moz-fit-content;width:fit-content;font-size:var(--s-font-size-sm);color:var(--s-text-disabled)}"}},[1,"swirl-separator",{borderColor:[1,"border-color"],color:[1025],label:[1],orientation:[1],semantics:[1],spacing:[1]}]);function n(){"undefined"!=typeof customElements&&["swirl-separator"].forEach((r=>{"swirl-separator"===r&&(customElements.get(s(r))||customElements.define(s(r),l))}))}export{l as S,n as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as a,HTMLElement as t,createEvent as r,h as b,Host as i,transformTag as s}from"@stencil/core/internal/client";import{c as e}from"./index2.js";import{o as l}from"./utils.js";import{d as n}from"./swirl-tooltip2.js";const o=a(class extends t{constructor(a){super(),!1!==a&&this.__registerHost(),this.activateNextTab=r(this,"activateNextTab",7),this.activatePreviousTab=r(this,"activatePreviousTab",7),this.activateTab=r(this,"activateTab",7),this.justify="start",this.tabs=[],this.variant="default",this.onKeyDown=a=>{"ArrowLeft"===a.code?(a.preventDefault(),this.focusAdjacentTab(!0),this.activatePreviousTab.emit()):"ArrowRight"===a.code&&(a.preventDefault(),this.focusAdjacentTab(!1),this.activateNextTab.emit())}}onTabFocus(a){a.target.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})}focusAdjacentTab(a){const t=this.getTabs(),r=t.findIndex((a=>"true"===a.ariaSelected));t[l(a?r-1:r+1,t.length)].focus()}getTabs(){return Array.from(this.el.querySelectorAll('[role="tab"]'))}render(){const a=e("tab-bar",`tab-bar--justify-${this.justify}`,{"tab-bar--variant-pill":"pill"===this.variant,"tab-bar--variant-default":"default"===this.variant,"tab-bar--wrap":this.wrap}),t={paddingInlineEnd:Boolean(this.paddingInlineEnd)?`var(--s-space-${this.paddingInlineEnd})`:void 0,paddingInlineStart:Boolean(this.paddingInlineStart)?`var(--s-space-${this.paddingInlineStart})`:void 0,paddingBlockEnd:Boolean(this.paddingBlockEnd)?`var(--s-space-${this.paddingBlockEnd})`:void 0,paddingBlockStart:Boolean(this.paddingBlockStart)?`var(--s-space-${this.paddingBlockStart})`:void 0};return b(i,{key:"784c3bd3a61d049d4e3e1a00fd3e77e01506f45c"},b("div",{key:"a08f5098615da85f8a5e7e05679ec2ba6e06fce7","aria-label":this.label,class:a,onKeyDown:this.onKeyDown,role:this.disableTabSemantics?void 0:"tablist",style:t},this.tabs.map((a=>{const t=e("tab-bar__tab",{"tab-bar__tab--active":a.active,"tab-bar__tab--variant-pill":"pill"===this.variant,"tab-bar__tab--variant-default":"default"===this.variant}),r=e("tab-bar__tab-label",{"tab-bar__tab-label--variant-pill":"pill"===this.variant}),i=b("button",{"aria-controls":this.disableTabSemantics?void 0:a.id,"aria-selected":this.disableTabSemantics?void 0:a.active?"true":"false",class:t,id:`tab-${a.id}`,key:a.tooltip?void 0:a.id,onClick:()=>this.activateTab.emit(a.id),onFocus:this.onTabFocus,role:this.disableTabSemantics?void 0:"tab",tabIndex:this.disableTabSemantics?void 0:a.active?0:-1,type:"button"},a.icon&&b("span",{class:"tab-bar__tab-icon",innerHTML:a.icon}),b("span",{class:r},a.label,a.suffix&&b("span",{class:"tab-bar__tab-suffix"},a.suffix)));return a.tooltip?b("swirl-tooltip",{content:a.tooltip,key:a.id},i):i}))))}get el(){return this}static get style(){return'.sc-swirl-tab-bar-h{display:flex;height:var(--swirl-tab-bar-height)}.sc-swirl-tab-bar-h *.sc-swirl-tab-bar{box-sizing:border-box}.tab-bar.sc-swirl-tab-bar{position:relative;display:flex;overflow-x:auto;width:100%;justify-content:flex-start;scrollbar-width:none}.tab-bar.tab-bar--variant-default.sc-swirl-tab-bar{border-bottom:var(--swirl-tab-bar-border-width) solid var(--s-border-default)}.tab-bar.tab-bar--variant-pill.sc-swirl-tab-bar{gap:var(--s-space-8)}.tab-bar--wrap.sc-swirl-tab-bar{flex-wrap:wrap}.tab-bar--justify-evenly.sc-swirl-tab-bar>*.sc-swirl-tab-bar,.tab-bar--justify-evenly.sc-swirl-tab-bar .tab-bar__tab.sc-swirl-tab-bar{flex:1}.tab-bar__tab.sc-swirl-tab-bar{position:relative;display:flex;min-width:-
|
|
1
|
+
import{proxyCustomElement as a,HTMLElement as t,createEvent as r,h as b,Host as i,transformTag as s}from"@stencil/core/internal/client";import{c as e}from"./index2.js";import{o as l}from"./utils.js";import{d as n}from"./swirl-tooltip2.js";const o=a(class extends t{constructor(a){super(),!1!==a&&this.__registerHost(),this.activateNextTab=r(this,"activateNextTab",7),this.activatePreviousTab=r(this,"activatePreviousTab",7),this.activateTab=r(this,"activateTab",7),this.justify="start",this.tabs=[],this.variant="default",this.onKeyDown=a=>{"ArrowLeft"===a.code?(a.preventDefault(),this.focusAdjacentTab(!0),this.activatePreviousTab.emit()):"ArrowRight"===a.code&&(a.preventDefault(),this.focusAdjacentTab(!1),this.activateNextTab.emit())}}onTabFocus(a){a.target.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})}focusAdjacentTab(a){const t=this.getTabs(),r=t.findIndex((a=>"true"===a.ariaSelected));t[l(a?r-1:r+1,t.length)].focus()}getTabs(){return Array.from(this.el.querySelectorAll('[role="tab"]'))}render(){const a=e("tab-bar",`tab-bar--justify-${this.justify}`,{"tab-bar--variant-pill":"pill"===this.variant,"tab-bar--variant-default":"default"===this.variant,"tab-bar--wrap":this.wrap}),t={paddingInlineEnd:Boolean(this.paddingInlineEnd)?`var(--s-space-${this.paddingInlineEnd})`:void 0,paddingInlineStart:Boolean(this.paddingInlineStart)?`var(--s-space-${this.paddingInlineStart})`:void 0,paddingBlockEnd:Boolean(this.paddingBlockEnd)?`var(--s-space-${this.paddingBlockEnd})`:void 0,paddingBlockStart:Boolean(this.paddingBlockStart)?`var(--s-space-${this.paddingBlockStart})`:void 0};return b(i,{key:"784c3bd3a61d049d4e3e1a00fd3e77e01506f45c"},b("div",{key:"a08f5098615da85f8a5e7e05679ec2ba6e06fce7","aria-label":this.label,class:a,onKeyDown:this.onKeyDown,role:this.disableTabSemantics?void 0:"tablist",style:t},this.tabs.map((a=>{const t=e("tab-bar__tab",{"tab-bar__tab--active":a.active,"tab-bar__tab--variant-pill":"pill"===this.variant,"tab-bar__tab--variant-default":"default"===this.variant}),r=e("tab-bar__tab-label",{"tab-bar__tab-label--variant-pill":"pill"===this.variant}),i=b("button",{"aria-controls":this.disableTabSemantics?void 0:a.id,"aria-selected":this.disableTabSemantics?void 0:a.active?"true":"false",class:t,id:`tab-${a.id}`,key:a.tooltip?void 0:a.id,onClick:()=>this.activateTab.emit(a.id),onFocus:this.onTabFocus,role:this.disableTabSemantics?void 0:"tab",tabIndex:this.disableTabSemantics?void 0:a.active?0:-1,type:"button"},a.icon&&b("span",{class:"tab-bar__tab-icon",innerHTML:a.icon}),b("span",{class:r},a.label,a.suffix&&b("span",{class:"tab-bar__tab-suffix"},a.suffix)));return a.tooltip?b("swirl-tooltip",{content:a.tooltip,key:a.id},i):i}))))}get el(){return this}static get style(){return'.sc-swirl-tab-bar-h{display:flex;height:var(--swirl-tab-bar-height)}.sc-swirl-tab-bar-h *.sc-swirl-tab-bar{box-sizing:border-box}.tab-bar.sc-swirl-tab-bar{position:relative;display:flex;overflow-x:auto;width:100%;justify-content:flex-start;scrollbar-width:none}.tab-bar.tab-bar--variant-default.sc-swirl-tab-bar{border-bottom:var(--swirl-tab-bar-border-width) solid var(--s-border-default)}.tab-bar.tab-bar--variant-pill.sc-swirl-tab-bar{gap:var(--s-space-8)}.tab-bar--wrap.sc-swirl-tab-bar{flex-wrap:wrap}.tab-bar--justify-evenly.sc-swirl-tab-bar>*.sc-swirl-tab-bar,.tab-bar--justify-evenly.sc-swirl-tab-bar .tab-bar__tab.sc-swirl-tab-bar{flex:1}.tab-bar__tab.sc-swirl-tab-bar{position:relative;display:flex;min-width:-moz-fit-content;min-width:fit-content;margin:0;justify-content:center;align-items:center;border:none;font:inherit;font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-lg);cursor:pointer}.tab-bar__tab.tab-bar__tab--variant-default.sc-swirl-tab-bar{padding:var(--s-space-4) var(--s-space-8);color:var(--s-interactive-neutral-default);background-color:transparent}.tab-bar__tab.tab-bar__tab--variant-default.sc-swirl-tab-bar:not(.tab-bar__tab--active):hover{color:var(--s-interactive-neutral-hovered)}.tab-bar__tab.tab-bar__tab--variant-default.sc-swirl-tab-bar:not(.tab-bar__tab--active):hover:after{position:absolute;bottom:0;left:50%;width:calc(100% - var(--s-space-8));height:0.1875rem;border-radius:0.125rem;background-color:var(--s-border-default);content:"";transform:translateX(-50%);pointer-events:none}.tab-bar__tab.tab-bar__tab--variant-default.sc-swirl-tab-bar:not(.tab-bar__tab--active):hover .tab-bar__tab-suffix.sc-swirl-tab-bar{color:var(--s-interactive-neutral-hovered)}.tab-bar__tab.tab-bar__tab--variant-default.sc-swirl-tab-bar:not(.tab-bar__tab--active):active{color:var(--s-interactive-neutral-pressed)}.tab-bar__tab.tab-bar__tab--variant-default.sc-swirl-tab-bar:not(.tab-bar__tab--active):active .tab-bar__tab-suffix.sc-swirl-tab-bar{color:var(--s-interactive-neutral-pressed)}.tab-bar__tab.tab-bar__tab--variant-default.tab-bar__tab--active.sc-swirl-tab-bar{color:var(--s-text-highlight)}.tab-bar__tab.tab-bar__tab--variant-default.tab-bar__tab--active.sc-swirl-tab-bar:after{position:absolute;bottom:0;left:50%;width:calc(100% - var(--s-space-8));height:0.1875rem;border-radius:0.125rem;background-color:var(--s-border-highlight);content:"";transform:translateX(-50%);pointer-events:none}.tab-bar__tab.tab-bar__tab--variant-default.tab-bar__tab--active.sc-swirl-tab-bar .tab-bar__tab-suffix.sc-swirl-tab-bar{color:var(--s-text-highlight)}.tab-bar__tab.tab-bar__tab--variant-default.sc-swirl-tab-bar:focus{outline:none}.tab-bar__tab.tab-bar__tab--variant-default.sc-swirl-tab-bar:focus-visible .tab-bar__tab-label.sc-swirl-tab-bar{border-radius:var(--s-border-radius-s);box-shadow:inset 0 0 0 0.125rem var(--s-focus-default)}.tab-bar__tab.tab-bar__tab--variant-pill.sc-swirl-tab-bar{padding:var(--s-space-8) var(--s-space-16);border-radius:var(--s-border-radius-full-round);color:var(--s-text-default);background:var(--s-action-neutral-default);gap:var(--s-space-8)}.tab-bar__tab.tab-bar__tab--variant-pill.sc-swirl-tab-bar:hover{background:var(--s-action-neutral-hovered)}.tab-bar__tab.tab-bar__tab--variant-pill.sc-swirl-tab-bar:active{background:var(--s-action-neutral-pressed)}.tab-bar__tab.tab-bar__tab--variant-pill.tab-bar__tab--active.sc-swirl-tab-bar{color:var(--s-text-on-action-primary);background:var(--s-action-primary-default)}.tab-bar__tab.tab-bar__tab--variant-pill.tab-bar__tab--active.sc-swirl-tab-bar .tab-bar__tab-suffix.sc-swirl-tab-bar{color:var(--s-text-on-action-primary)}.tab-bar__tab.tab-bar__tab--variant-pill.sc-swirl-tab-bar:focus-visible{outline-color:var(--s-focus-default);outline-offset:var(--s-space-2)}.tab-bar__tab.tab-bar__tab--variant-pill.sc-swirl-tab-bar .tab-bar__tab-suffix.sc-swirl-tab-bar{color:var(--s-text-subdued)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.tab-bar__tab.sc-swirl-tab-bar{padding:calc(var(--s-space-4) + var(--s-space-2)) var(--s-space-8);font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.tab-bar__tab-icon.sc-swirl-tab-bar{display:inline-flex}.tab-bar__tab-label.sc-swirl-tab-bar{display:inline-flex;padding:var(--s-space-8) var(--s-space-8);text-align:center;white-space:nowrap;gap:var(--s-space-4)}.tab-bar__tab-label.tab-bar__tab-label--variant-pill.sc-swirl-tab-bar{padding:0}.tab-bar__tab-suffix.sc-swirl-tab-bar{color:var(--s-interactive-neutral-default);font-weight:var(--s-font-weight-normal)}'}},[2,"swirl-tab-bar",{disableTabSemantics:[4,"disable-tab-semantics"],label:[1],justify:[1],paddingBlockEnd:[1,"padding-block-end"],paddingBlockStart:[1,"padding-block-start"],paddingInlineEnd:[1,"padding-inline-end"],paddingInlineStart:[1,"padding-inline-start"],tabs:[16],variant:[1],wrap:[4]}]);function c(){"undefined"!=typeof customElements&&["swirl-tab-bar","swirl-tooltip"].forEach((a=>{switch(a){case"swirl-tab-bar":customElements.get(s(a))||customElements.define(s(a),o);break;case"swirl-tooltip":customElements.get(s(a))||n()}}))}export{o as S,c as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as s,h as t,Host as a,transformTag as l}from"@stencil/core/internal/client";const o=e(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow()}render(){return t(a,{key:"8e44ef9a466787c7a18abe800a0ca4fd531c0837",class:"table-cell",role:"cell"},t("slot",{key:"a7f69bdf8caa1bcb982f6578e25334ab3d53e6f5"}))}static get style(){return":host{display:flex;overflow:auto;padding-top:var(--s-space-8);padding-right:var(--s-space-16);padding-bottom:var(--s-space-8);padding-left:var(--s-space-16);flex-basis:0;flex-grow:1;flex-shrink:1;align-items:center;background-color:var(--s-surface-default);word-break:break-word
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as s,h as t,Host as a,transformTag as l}from"@stencil/core/internal/client";const o=e(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow()}render(){return t(a,{key:"8e44ef9a466787c7a18abe800a0ca4fd531c0837",class:"table-cell",role:"cell"},t("slot",{key:"a7f69bdf8caa1bcb982f6578e25334ab3d53e6f5"}))}static get style(){return":host{display:flex;overflow:auto;padding-top:var(--s-space-8);padding-right:var(--s-space-16);padding-bottom:var(--s-space-8);padding-left:var(--s-space-16);flex-basis:0;flex-grow:1;flex-shrink:1;align-items:center;background-color:var(--s-surface-default);word-break:break-word;hyphens:auto;transition:box-shadow 0.15s}:host(.table-cell--is-sticky){position:sticky;z-index:1}:host(.table-cell--is-sticky-right){position:sticky;z-index:1;right:0;overflow:hidden}:host(.table-cell--has-shadow-right){box-shadow:var(--swirl-table-sticky-right-shadow)}:host(.table-cell--has-shadow-left){box-shadow:var(--swirl-table-sticky-left-shadow)}:host *{box-sizing:border-box}"}},[257,"swirl-table-cell"]),i=o,r=function(){"undefined"!=typeof customElements&&["swirl-table-cell"].forEach((e=>{"swirl-table-cell"===e&&(customElements.get(l(e))||customElements.define(l(e),o))}))};export{i as SwirlTableCell,r as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as e,createEvent as s,h as i,Host as a,transformTag as r}from"@stencil/core/internal/client";import{g as o,c as l}from"./index2.js";import{S as n}from"./sortable.esm.js";import{d as h,i as c,q as d}from"./utils.js";import{d as b}from"./swirl-text2.js";import{d as w}from"./swirl-visually-hidden2.js";var u,p,f=o((p||(p=1,u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=void 0,a=void 0,r=void 0,o=[];return function(){var n=function(t){return"function"==typeof t?t():t}(e),h=(new Date).getTime(),c=!i||h-i>n;i=h;for(var d=arguments.length,b=Array(d),w=0;w<d;w++)b[w]=arguments[w];if(c&&s.leading)return s.accumulate?Promise.resolve(t.call(this,[b])).then((function(t){return t[0]})):Promise.resolve(t.call.apply(t,[this].concat(b)));if(a?clearTimeout(r):a=function(){var t={};return t.promise=new Promise((function(e,s){t.resolve=e,t.reject=s})),t}(),o.push(b),r=setTimeout(l.bind(this),n),s.accumulate){var u=o.length-1;return a.promise.then((function(t){return t[u]}))}return a.promise};function l(){var e=a;clearTimeout(r),Promise.resolve(s.accumulate?t.call(this,o):t.apply(this,o[o.length-1])).then(e.resolve,e.reject),o=[],a=null}}),u));const m={end:"Dropped. Final position in table: {position} of {rowCount}.",initial:"Press space to move the row.",moved:"Current position in table: {position} of {rowCount}.",start:"Row grabbed. Current position in table: {position} of {rowCount}. Press up and down arrow keys to change position, Space to drop."},y=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.dropRow=s(this,"dropRow",7),this.dragDropInstructions=m,this.emptyStateLabel="No results found.",this.liveRegionText="",this.triggerRerender=h((async()=>{await this.updateLayout(),this.updateEmptyState()}),0,!0),this.updateLayout=f((async()=>{this.resetCellStyles(),this.resetColumnStyles(),this.resetEmptyRowStyles(),this.resetRowGroupStyles(),this.layoutEmptyRow(),this.layoutRowGroups(),this.layOutCellsAndColumns(),this.updateScrolledState()}),16,{leading:!0}),this.onScroll=()=>{this.updateScrolledState()},this.onFocus=t=>{if(this.movingViaKeyboard){const t=this.el.querySelector(".table-row--moving");t&&this.focusDragHandleOfRow(t)}const e=!!t.target?.closest(this.dragDropHandle);""===this.liveRegionText&&e&&this.updateLiveRegionText("initial")},this.onBlur=t=>{const e=t.relatedTarget,s=!!e?.closest(this.dragDropHandle);this.el.contains(e)&&s||""!==this.liveRegionText&&this.updateLiveRegionText()},this.onKeyDown=t=>{if(!this.enableDragDrop)return;const e=t.target?.closest("swirl-table-row");t.target?.closest(this.dragDropHandle)&&("Space"===t.code?(t.preventDefault(),t.stopPropagation(),this.toggleKeyboardMove(e)):"ArrowUp"===t.code?(t.preventDefault(),t.stopPropagation(),this.moveRow(e,"up")):"ArrowDown"===t.code?(t.preventDefault(),t.stopPropagation(),this.moveRow(e,"down")):"Escape"===t.code&&(t.preventDefault(),t.stopPropagation(),this.cancelKeyboardMove()))}}async componentDidLoad(){this.setupIntersectionObserver(),this.setupMutationObservers(),queueMicrotask((()=>{this.setupDragDrop()}))}disconnectedCallback(){this.intersectionObserver?.disconnect(),this.columnMutationObserver?.disconnect(),this.rowMutationObserver?.disconnect(),this.sortable?.destroy()}handleEnableDragDropChange(){queueMicrotask((()=>{this.setupDragDrop()}))}setupIntersectionObserver(){this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange.bind(this),{threshold:0}),this.intersectionObserver.observe(this.container)}setupMutationObservers(){this.columnMutationObserver=new MutationObserver((t=>{t.some((t=>t.addedNodes.length||t.removedNodes.length))&&this.updateLayout()})),this.columnMutationObserver.observe(this.headerEl,{childList:!0,subtree:!0}),this.rowMutationObserver=new MutationObserver((t=>{t.some((t=>t.addedNodes.length||t.removedNodes.length))&&(this.updateEmptyState(),this.setupDragDrop())})),this.startRowMutationObserver()}startRowMutationObserver(){this.rowMutationObserver?.observe(this.bodyEl,{childList:!0,subtree:!0})}stopRowMutationObserver(){this.rowMutationObserver?.disconnect()}setupDragDrop(){if(this.sortable&&(this.sortable.destroy(),this.sortable=void 0),this.enableDragDrop){if(this.el.querySelector("swirl-table-row-group"))return void console.warn('[Swirl] Drag & drop is not yet supported for swirl-tables using the "swirl-table-row-group" component.');if(!this.dragDropHandle)return void console.warn('[Swirl] swirl-table required the "dragDropHandle" prop to be set when drag & drop is enabled.');const t=this.el.querySelector('[slot="rows"]');this.dragDropContainer="SWIRL-TABLE-ROW"!==t?.tagName?t??this.bodyEl:this.bodyEl,this.sortable=new n(this.dragDropContainer,{animation:100,direction:"vertical",handle:this.dragDropHandle,fallbackOnBody:!0,group:"swirl-table-"+(""+Math.random()).substring(2),onStart:()=>{this.stopRowMutationObserver()},onEnd:t=>{t.stopPropagation();const{to:e,newIndex:s,oldIndex:i,item:a}=t;this.dropRow.emit({newIndex:s,oldIndex:i,item:a,itemId:a.id??a.querySelector(":scope > swirl-table-row").id,newNextSiblingItemId:s<e.children.length-1?e.children[s+1].id:void 0,newPrevSiblingItemId:s>0?e.children[s-1].id:void 0}),this.startRowMutationObserver()}})}}async onVisibilityChange(t){t.some((t=>t.isIntersecting))&&setTimeout((async()=>{await this.updateLayout()}),100)}async componentDidRender(){await this.updateLayout(),this.updateEmptyState()}async onWindowResize(){await this.updateLayout()}async rerender(){this.triggerRerender()}resetEmptyRowStyles(){const t=this.el.querySelector(".table__empty-row");t&&(t.style.width="")}resetRowGroupStyles(){Array.from(this.el.querySelectorAll("swirl-table-row-group")).forEach((t=>{t.shadowRoot.querySelector(".table-row-group__header-row")&&(t.shadowRoot.querySelector(".table-row-group__header-row").style.width="")}))}resetColumnStyles(){this.getColumns().forEach((t=>{t.classList.remove("table-column--has-shadow","table-column--is-sticky","table-column--is-sticky-right"),t.style.right="",t.style.left="",t.style.position="",t.style.zIndex=""}))}resetCellStyles(){this.getCells().forEach((t=>{t.classList.remove("table-cell--has-shadow","table-cell--is-sticky","table-cell--is-sticky-right"),t.style.flex="",t.style.left="",t.style.right="",t.style.position="",t.style.zIndex=""}))}updateScrolledState(){const t=c();if(void 0===this.container)return;const e=this.container.scrollWidth>this.container.clientWidth,s=this.container.scrollLeft>0,i=Math.ceil(this.container.clientWidth+this.container.scrollLeft)>=Math.floor(this.container.scrollWidth);e!==this.scrollable&&(e&&!t?this.container.classList.add("table__container--scrollable"):this.container.classList.remove("table__container--scrollable")),s!==this.scrolled&&(s&&!t?this.container.classList.add("table__container--scrolled"):this.container.classList.remove("table__container--scrolled")),i!==this.scrolledToEnd&&(i&&!t?this.container.classList.add("table__container--scrolled-to-end"):this.container.classList.remove("table__container--scrolled-to-end"))}getColumns(){return Array.from(this.el.querySelectorAll("swirl-table-column"))}getCells(){return Array.from(this.el.querySelectorAll("swirl-table-cell"))}layoutEmptyRow(){const t=this.el.querySelector(".table__empty-row");if(!t)return;const e=this.el.querySelector(".table__container").scrollWidth+"px";t.style.width=e}layoutRowGroups(){const t=Array.from(this.el.querySelectorAll("swirl-table-row-group")),e=this.el.querySelector(".table__container")?.scrollWidth+"px";t.forEach((t=>{t.shadowRoot.querySelector(".table-row-group__header-row")&&(t.shadowRoot.querySelector(".table-row-group__header-row").style.width=e)}))}layOutCellsAndColumns(){const t=this.getColumns(),e=this.getCells();t.forEach(((s,i)=>{const a=this.getCellsForColumn(e,t,i),r=this.calculateColumnProperties(s,t,i);a.forEach((t=>this.applyCellStyles(t,s,r))),this.applyColumnStyles(s,r)}))}getCellsForColumn(t,e,s){return t.filter(((t,i)=>(s-i)%e.length==0))}calculateColumnProperties(t,e,s){return{leftOffsetForStickyColumn:t.sticky?this.getLeftOffsetForStickyColumn(e,s):0,columnWidth:t.getBoundingClientRect().width+"px",isLastColumnSticky:t.sticky&&e.length===s+1,hasShadowRight:t.sticky&&!this.hasStickyColumnsToRight(e,s)}}applyCellStyles(t,e,s){const{leftOffsetForStickyColumn:i,columnWidth:a,isLastColumnSticky:r,hasShadowRight:o}=s;t.style.flex=a?"0 0 "+a:"",c()||(e.sticky&&!r&&(t.classList.add("table-cell--is-sticky"),t.style.left=i+"px",o&&t.classList.add("table-cell--has-shadow-right")),r&&t.classList.add("table-cell--is-sticky-right","table-cell--has-shadow-left"))}applyColumnStyles(t,e){if(c())return;const{leftOffsetForStickyColumn:s,isLastColumnSticky:i,hasShadowRight:a}=e;t.sticky&&!i&&(t.classList.add("table-column--is-sticky"),t.style.left=s+"px",a&&t.classList.add("table-column--has-shadow-right")),i&&t.classList.add("table-column--is-sticky-right","table-column--has-shadow-left")}getLeftOffsetForStickyColumn(t,e){return t.slice(0,e).reduce(((t,e)=>{if(e.sticky)return t+e.getBoundingClientRect().width}),0)}hasStickyColumnsToRight(t,e){return t.slice(e+1,t.length-1).some((t=>t.sticky))}updateEmptyState(){const t=this.el.querySelector('[slot="rows"]');this.empty=!t||0===t.children.length}updateLiveRegionText(t,e={}){let s=t?this.dragDropInstructions[t]:"";for(const[t,i]of Object.entries(e??{}))s=s.replaceAll(`{${t}}`,i+"");s!==this.liveRegionText&&(this.liveRegionText=s)}toggleKeyboardMove(t){this.movingViaKeyboard?this.endKeyboardMove(t):this.startKeyboardMove(t)}startKeyboardMove(t){this.movingViaKeyboard=!0,this.positionBeforeKeyboardMove=Array.from(this.dragDropContainer.children).indexOf(t),t.classList.add("table-row--moving"),this.updateLiveRegionText("start",{position:Array.from(this.dragDropContainer.children).indexOf(t)+1,rowCount:this.dragDropContainer.children.length})}endKeyboardMove(t){this.movingViaKeyboard=!1,t.classList.remove("table-row--moving"),this.updateLiveRegionText("end",{position:Array.from(this.dragDropContainer.children).indexOf(t)+1,rowCount:this.dragDropContainer.children.length}),this.dropRow.emit({item:t,newIndex:Array.from(this.dragDropContainer.children).indexOf(t),oldIndex:this.positionBeforeKeyboardMove,itemId:t.id,newNextSiblingItemId:Array.from(this.dragDropContainer.children).indexOf(t)<this.dragDropContainer.children.length-1?this.dragDropContainer.children[Array.from(this.dragDropContainer.children).indexOf(t)+1].id:void 0,newPrevSiblingItemId:Array.from(this.dragDropContainer.children).indexOf(t)>0?this.dragDropContainer.children[Array.from(this.dragDropContainer.children).indexOf(t)-1].id:void 0}),this.positionBeforeKeyboardMove=void 0}cancelKeyboardMove(){if(!this.movingViaKeyboard)return;const t=this.el.querySelector(".table-row--moving");t&&(t.classList.remove("table-row--moving"),this.movingViaKeyboard=!1,void 0!==this.positionBeforeKeyboardMove&&this.dragDropContainer.insertBefore(t,this.dragDropContainer.children[this.positionBeforeKeyboardMove]))}moveRow(t,e){if(!this.movingViaKeyboard)return;let s;if("up"===e){const e=Array.from(this.dragDropContainer.children).indexOf(t);s=Math.max(0,e-1),this.dragDropContainer.insertBefore(t,this.dragDropContainer.children[s])}else{const e=Array.from(this.dragDropContainer.children).indexOf(t);s=Math.min(this.dragDropContainer.children.length-1,e+1),this.dragDropContainer.insertBefore(t,this.dragDropContainer.children[s+1])}this.updateLiveRegionText("moved",{position:s+1,rowCount:this.dragDropContainer.children.length}),this.focusDragHandleOfRow(t)}focusDragHandleOfRow(t){const e=d(t,this.dragDropHandle)?.[0];"BUTTON"===e.tagName?e.focus():e.querySelector("button")?.focus()}render(){const t=!!this.el.querySelector('[slot="empty"]'),e=l("table",{"table--show-empty-state":this.empty&&!this.loading,"table--keyboard-move":this.movingViaKeyboard});return i(a,{key:"71acbcbdc039e7b08d567ae733cfccccd025227a"},i("div",{key:"0c2a4dca278dfaabffd7865e7e6ed0e9fc4ac55a",class:e},this.enableDragDrop&&i("swirl-visually-hidden",{key:"007050bbe785b97dab2fcbd81512aac698f7dcd4"},i("span",{key:"f3065cc5b3b553c130a83b827dacbbe72a2ca9a5","aria-live":"assertive"},this.liveRegionText)),i("div",{key:"791e05da9f511fdb1a4439a3e879ef4b9756c258",class:"table__container",onFocusin:this.onFocus,onFocusout:this.onBlur,onKeyDown:this.onKeyDown,onScroll:this.onScroll,ref:t=>this.container=t,tabIndex:-1},i("div",{key:"00f4c7bed1f953e507896a3558bb30a6ffdf7184","aria-describedby":this.caption?"caption":void 0,"aria-label":this.label,role:"table",class:"table__table"},this.caption&&i("swirl-visually-hidden",{key:"8369efdbe24e28f212cb06bd78f40fa1a4b4a5f2"},i("div",{key:"7a7aac1376a41ae68f831f15a19db9f8d662fb59",id:"caption"},this.caption)),i("div",{key:"86abf9d783dbd7b353f3b40efb13b37c7d4cbece",role:"rowgroup"},i("div",{key:"5651f12df3e10571a18c48ff8b27641b4674ef40",class:"table__header",ref:t=>this.headerEl=t,role:"row"},i("slot",{key:"d5f36a58148734d80899e0986cd0726546079720",name:"columns"}))),i("div",{key:"d80ad2723f76f0695f83012c0af664f660bc0467",class:"table__body",ref:t=>this.bodyEl=t},i("slot",{key:"c9d2d172591f765912f165e412bd51dd3e05b52c",name:"rows"}),i("div",{key:"68fc4436378546379402064debc6778beefa8847",class:"table__empty-row",role:"row"},i("div",{key:"a8b84493ab57f740224c806bee61aac9a67be64a","aria-colspan":this.getColumns().length,class:"table__empty-row-cell",role:"cell"},i("slot",{key:"fc2377b95667af8932a2c5cf9af734c3512911b1",name:"empty"}),!t&&i("swirl-text",{key:"bfa4152124785e30d50d1d52a10b0f07f7f57a26",align:"center",size:"sm"},this.emptyStateLabel))))))))}get el(){return this}static get watchers(){return{enableDragDrop:[{handleEnableDragDropChange:0}]}}static get style(){return".sc-swirl-table-h{--swirl-table-shadow-rgba:rgba(23, 23, 23, 0.2);position:relative;display:block}.sc-swirl-table-h *.sc-swirl-table{box-sizing:border-box}html.theme-dark.sc-swirl-table-h,html.theme-dark .sc-swirl-table-h{--swirl-table-shadow-rgba:rgba(0, 0, 0, 0.2)}.table--keyboard-move.sc-swirl-table:focus-within{--swirl-table-moving-row-border:var(--s-border-width-default) solid var(--s-border-highlight)}.table--show-empty-state.sc-swirl-table .table__empty-row.sc-swirl-table{display:flex}.table__container.sc-swirl-table{position:relative;overflow:auto;width:100%}.table__container--scrolled.sc-swirl-table{--swirl-table-sticky-right-shadow:4px 0 16px -4px var(--swirl-table-shadow-rgba), 2px 0 4px -2px var(--swirl-table-shadow-rgba)}.table__container--scrollable.sc-swirl-table:not(.table__container--scrolled-to-end){--swirl-table-sticky-left-shadow:0px 4px 16px 0px var(--swirl-table-shadow-rgba), 0px 1px 4px 0px var(--swirl-table-shadow-rgba)}.table__table.sc-swirl-table{width:-webkit-max-content;width:-moz-max-content;width:max-content;min-width:max(20rem, 100%)}.table__header.sc-swirl-table-s>*,.table__header .sc-swirl-table-s>*{display:flex}.table__empty-row.sc-swirl-table{display:none}.table__empty-row-cell.sc-swirl-table{display:flex;overflow:auto;padding-top:var(--s-space-8);padding-right:var(--s-space-16);padding-bottom:var(--s-space-8);padding-left:var(--s-space-16);flex-basis:0;flex-grow:1;flex-shrink:1;align-items:center;background-color:var(--s-surface-default)}.table__empty-row-cell.sc-swirl-table>*.sc-swirl-table{flex-grow:1}"}},[262,"swirl-table",{caption:[1],dragDropHandle:[1,"drag-drop-handle"],dragDropInstructions:[16],emptyStateLabel:[1,"empty-state-label"],enableDragDrop:[4,"enable-drag-drop"],label:[1],loading:[4],empty:[32],liveRegionText:[32],scrollable:[32],scrolled:[32],scrolledToEnd:[32],rerender:[64]},[[9,"resize","onWindowResize"]],{enableDragDrop:[{handleEnableDragDropChange:0}]}]),g=y,v=function(){"undefined"!=typeof customElements&&["swirl-table","swirl-text","swirl-visually-hidden"].forEach((t=>{switch(t){case"swirl-table":customElements.get(r(t))||customElements.define(r(t),y);break;case"swirl-text":customElements.get(r(t))||b();break;case"swirl-visually-hidden":customElements.get(r(t))||w()}}))};export{g as SwirlTable,v as defineCustomElement}
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as e,createEvent as s,h as i,Host as a,transformTag as r}from"@stencil/core/internal/client";import{g as o,c as l}from"./index2.js";import{S as n}from"./sortable.esm.js";import{d as h,i as c,q as d}from"./utils.js";import{d as b}from"./swirl-text2.js";import{d as w}from"./swirl-visually-hidden2.js";var u,p,f=o((p||(p=1,u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=void 0,a=void 0,r=void 0,o=[];return function(){var n=function(t){return"function"==typeof t?t():t}(e),h=(new Date).getTime(),c=!i||h-i>n;i=h;for(var d=arguments.length,b=Array(d),w=0;w<d;w++)b[w]=arguments[w];if(c&&s.leading)return s.accumulate?Promise.resolve(t.call(this,[b])).then((function(t){return t[0]})):Promise.resolve(t.call.apply(t,[this].concat(b)));if(a?clearTimeout(r):a=function(){var t={};return t.promise=new Promise((function(e,s){t.resolve=e,t.reject=s})),t}(),o.push(b),r=setTimeout(l.bind(this),n),s.accumulate){var u=o.length-1;return a.promise.then((function(t){return t[u]}))}return a.promise};function l(){var e=a;clearTimeout(r),Promise.resolve(s.accumulate?t.call(this,o):t.apply(this,o[o.length-1])).then(e.resolve,e.reject),o=[],a=null}}),u));const m={end:"Dropped. Final position in table: {position} of {rowCount}.",initial:"Press space to move the row.",moved:"Current position in table: {position} of {rowCount}.",start:"Row grabbed. Current position in table: {position} of {rowCount}. Press up and down arrow keys to change position, Space to drop."},y=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.dropRow=s(this,"dropRow",7),this.dragDropInstructions=m,this.emptyStateLabel="No results found.",this.liveRegionText="",this.triggerRerender=h((async()=>{await this.updateLayout(),this.updateEmptyState()}),0,!0),this.updateLayout=f((async()=>{this.resetCellStyles(),this.resetColumnStyles(),this.resetEmptyRowStyles(),this.resetRowGroupStyles(),this.layoutEmptyRow(),this.layoutRowGroups(),this.layOutCellsAndColumns(),this.updateScrolledState()}),16,{leading:!0}),this.onScroll=()=>{this.updateScrolledState()},this.onFocus=t=>{if(this.movingViaKeyboard){const t=this.el.querySelector(".table-row--moving");t&&this.focusDragHandleOfRow(t)}const e=!!t.target?.closest(this.dragDropHandle);""===this.liveRegionText&&e&&this.updateLiveRegionText("initial")},this.onBlur=t=>{const e=t.relatedTarget,s=!!e?.closest(this.dragDropHandle);this.el.contains(e)&&s||""!==this.liveRegionText&&this.updateLiveRegionText()},this.onKeyDown=t=>{if(!this.enableDragDrop)return;const e=t.target?.closest("swirl-table-row");t.target?.closest(this.dragDropHandle)&&("Space"===t.code?(t.preventDefault(),t.stopPropagation(),this.toggleKeyboardMove(e)):"ArrowUp"===t.code?(t.preventDefault(),t.stopPropagation(),this.moveRow(e,"up")):"ArrowDown"===t.code?(t.preventDefault(),t.stopPropagation(),this.moveRow(e,"down")):"Escape"===t.code&&(t.preventDefault(),t.stopPropagation(),this.cancelKeyboardMove()))}}async componentDidLoad(){this.setupIntersectionObserver(),this.setupMutationObservers(),queueMicrotask((()=>{this.setupDragDrop()}))}disconnectedCallback(){this.intersectionObserver?.disconnect(),this.columnMutationObserver?.disconnect(),this.rowMutationObserver?.disconnect(),this.sortable?.destroy()}handleEnableDragDropChange(){queueMicrotask((()=>{this.setupDragDrop()}))}setupIntersectionObserver(){this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange.bind(this),{threshold:0}),this.intersectionObserver.observe(this.container)}setupMutationObservers(){this.columnMutationObserver=new MutationObserver((t=>{t.some((t=>t.addedNodes.length||t.removedNodes.length))&&this.updateLayout()})),this.columnMutationObserver.observe(this.headerEl,{childList:!0,subtree:!0}),this.rowMutationObserver=new MutationObserver((t=>{t.some((t=>t.addedNodes.length||t.removedNodes.length))&&(this.updateEmptyState(),this.setupDragDrop())})),this.startRowMutationObserver()}startRowMutationObserver(){this.rowMutationObserver?.observe(this.bodyEl,{childList:!0,subtree:!0})}stopRowMutationObserver(){this.rowMutationObserver?.disconnect()}setupDragDrop(){if(this.sortable&&(this.sortable.destroy(),this.sortable=void 0),this.enableDragDrop){if(this.el.querySelector("swirl-table-row-group"))return void console.warn('[Swirl] Drag & drop is not yet supported for swirl-tables using the "swirl-table-row-group" component.');if(!this.dragDropHandle)return void console.warn('[Swirl] swirl-table required the "dragDropHandle" prop to be set when drag & drop is enabled.');const t=this.el.querySelector('[slot="rows"]');this.dragDropContainer="SWIRL-TABLE-ROW"!==t?.tagName?t??this.bodyEl:this.bodyEl,this.sortable=new n(this.dragDropContainer,{animation:100,direction:"vertical",handle:this.dragDropHandle,fallbackOnBody:!0,group:"swirl-table-"+(""+Math.random()).substring(2),onStart:()=>{this.stopRowMutationObserver()},onEnd:t=>{t.stopPropagation();const{to:e,newIndex:s,oldIndex:i,item:a}=t;this.dropRow.emit({newIndex:s,oldIndex:i,item:a,itemId:a.id??a.querySelector(":scope > swirl-table-row").id,newNextSiblingItemId:s<e.children.length-1?e.children[s+1].id:void 0,newPrevSiblingItemId:s>0?e.children[s-1].id:void 0}),this.startRowMutationObserver()}})}}async onVisibilityChange(t){t.some((t=>t.isIntersecting))&&setTimeout((async()=>{await this.updateLayout()}),100)}async componentDidRender(){await this.updateLayout(),this.updateEmptyState()}async onWindowResize(){await this.updateLayout()}async rerender(){this.triggerRerender()}resetEmptyRowStyles(){const t=this.el.querySelector(".table__empty-row");t&&(t.style.width="")}resetRowGroupStyles(){Array.from(this.el.querySelectorAll("swirl-table-row-group")).forEach((t=>{t.shadowRoot.querySelector(".table-row-group__header-row")&&(t.shadowRoot.querySelector(".table-row-group__header-row").style.width="")}))}resetColumnStyles(){this.getColumns().forEach((t=>{t.classList.remove("table-column--has-shadow","table-column--is-sticky","table-column--is-sticky-right"),t.style.right="",t.style.left="",t.style.position="",t.style.zIndex=""}))}resetCellStyles(){this.getCells().forEach((t=>{t.classList.remove("table-cell--has-shadow","table-cell--is-sticky","table-cell--is-sticky-right"),t.style.flex="",t.style.left="",t.style.right="",t.style.position="",t.style.zIndex=""}))}updateScrolledState(){const t=c();if(void 0===this.container)return;const e=this.container.scrollWidth>this.container.clientWidth,s=this.container.scrollLeft>0,i=Math.ceil(this.container.clientWidth+this.container.scrollLeft)>=Math.floor(this.container.scrollWidth);e!==this.scrollable&&(e&&!t?this.container.classList.add("table__container--scrollable"):this.container.classList.remove("table__container--scrollable")),s!==this.scrolled&&(s&&!t?this.container.classList.add("table__container--scrolled"):this.container.classList.remove("table__container--scrolled")),i!==this.scrolledToEnd&&(i&&!t?this.container.classList.add("table__container--scrolled-to-end"):this.container.classList.remove("table__container--scrolled-to-end"))}getColumns(){return Array.from(this.el.querySelectorAll("swirl-table-column"))}getCells(){return Array.from(this.el.querySelectorAll("swirl-table-cell"))}layoutEmptyRow(){const t=this.el.querySelector(".table__empty-row");if(!t)return;const e=this.el.querySelector(".table__container").scrollWidth+"px";t.style.width=e}layoutRowGroups(){const t=Array.from(this.el.querySelectorAll("swirl-table-row-group")),e=this.el.querySelector(".table__container")?.scrollWidth+"px";t.forEach((t=>{t.shadowRoot.querySelector(".table-row-group__header-row")&&(t.shadowRoot.querySelector(".table-row-group__header-row").style.width=e)}))}layOutCellsAndColumns(){const t=this.getColumns(),e=this.getCells();t.forEach(((s,i)=>{const a=this.getCellsForColumn(e,t,i),r=this.calculateColumnProperties(s,t,i);a.forEach((t=>this.applyCellStyles(t,s,r))),this.applyColumnStyles(s,r)}))}getCellsForColumn(t,e,s){return t.filter(((t,i)=>(s-i)%e.length==0))}calculateColumnProperties(t,e,s){return{leftOffsetForStickyColumn:t.sticky?this.getLeftOffsetForStickyColumn(e,s):0,columnWidth:t.getBoundingClientRect().width+"px",isLastColumnSticky:t.sticky&&e.length===s+1,hasShadowRight:t.sticky&&!this.hasStickyColumnsToRight(e,s)}}applyCellStyles(t,e,s){const{leftOffsetForStickyColumn:i,columnWidth:a,isLastColumnSticky:r,hasShadowRight:o}=s;t.style.flex=a?"0 0 "+a:"",c()||(e.sticky&&!r&&(t.classList.add("table-cell--is-sticky"),t.style.left=i+"px",o&&t.classList.add("table-cell--has-shadow-right")),r&&t.classList.add("table-cell--is-sticky-right","table-cell--has-shadow-left"))}applyColumnStyles(t,e){if(c())return;const{leftOffsetForStickyColumn:s,isLastColumnSticky:i,hasShadowRight:a}=e;t.sticky&&!i&&(t.classList.add("table-column--is-sticky"),t.style.left=s+"px",a&&t.classList.add("table-column--has-shadow-right")),i&&t.classList.add("table-column--is-sticky-right","table-column--has-shadow-left")}getLeftOffsetForStickyColumn(t,e){return t.slice(0,e).reduce(((t,e)=>{if(e.sticky)return t+e.getBoundingClientRect().width}),0)}hasStickyColumnsToRight(t,e){return t.slice(e+1,t.length-1).some((t=>t.sticky))}updateEmptyState(){const t=this.el.querySelector('[slot="rows"]');this.empty=!t||0===t.children.length}updateLiveRegionText(t,e={}){let s=t?this.dragDropInstructions[t]:"";for(const[t,i]of Object.entries(e??{}))s=s.replaceAll(`{${t}}`,i+"");s!==this.liveRegionText&&(this.liveRegionText=s)}toggleKeyboardMove(t){this.movingViaKeyboard?this.endKeyboardMove(t):this.startKeyboardMove(t)}startKeyboardMove(t){this.movingViaKeyboard=!0,this.positionBeforeKeyboardMove=Array.from(this.dragDropContainer.children).indexOf(t),t.classList.add("table-row--moving"),this.updateLiveRegionText("start",{position:Array.from(this.dragDropContainer.children).indexOf(t)+1,rowCount:this.dragDropContainer.children.length})}endKeyboardMove(t){this.movingViaKeyboard=!1,t.classList.remove("table-row--moving"),this.updateLiveRegionText("end",{position:Array.from(this.dragDropContainer.children).indexOf(t)+1,rowCount:this.dragDropContainer.children.length}),this.dropRow.emit({item:t,newIndex:Array.from(this.dragDropContainer.children).indexOf(t),oldIndex:this.positionBeforeKeyboardMove,itemId:t.id,newNextSiblingItemId:Array.from(this.dragDropContainer.children).indexOf(t)<this.dragDropContainer.children.length-1?this.dragDropContainer.children[Array.from(this.dragDropContainer.children).indexOf(t)+1].id:void 0,newPrevSiblingItemId:Array.from(this.dragDropContainer.children).indexOf(t)>0?this.dragDropContainer.children[Array.from(this.dragDropContainer.children).indexOf(t)-1].id:void 0}),this.positionBeforeKeyboardMove=void 0}cancelKeyboardMove(){if(!this.movingViaKeyboard)return;const t=this.el.querySelector(".table-row--moving");t&&(t.classList.remove("table-row--moving"),this.movingViaKeyboard=!1,void 0!==this.positionBeforeKeyboardMove&&this.dragDropContainer.insertBefore(t,this.dragDropContainer.children[this.positionBeforeKeyboardMove]))}moveRow(t,e){if(!this.movingViaKeyboard)return;let s;if("up"===e){const e=Array.from(this.dragDropContainer.children).indexOf(t);s=Math.max(0,e-1),this.dragDropContainer.insertBefore(t,this.dragDropContainer.children[s])}else{const e=Array.from(this.dragDropContainer.children).indexOf(t);s=Math.min(this.dragDropContainer.children.length-1,e+1),this.dragDropContainer.insertBefore(t,this.dragDropContainer.children[s+1])}this.updateLiveRegionText("moved",{position:s+1,rowCount:this.dragDropContainer.children.length}),this.focusDragHandleOfRow(t)}focusDragHandleOfRow(t){const e=d(t,this.dragDropHandle)?.[0];"BUTTON"===e.tagName?e.focus():e.querySelector("button")?.focus()}render(){const t=!!this.el.querySelector('[slot="empty"]'),e=l("table",{"table--show-empty-state":this.empty&&!this.loading,"table--keyboard-move":this.movingViaKeyboard});return i(a,{key:"71acbcbdc039e7b08d567ae733cfccccd025227a"},i("div",{key:"0c2a4dca278dfaabffd7865e7e6ed0e9fc4ac55a",class:e},this.enableDragDrop&&i("swirl-visually-hidden",{key:"007050bbe785b97dab2fcbd81512aac698f7dcd4"},i("span",{key:"f3065cc5b3b553c130a83b827dacbbe72a2ca9a5","aria-live":"assertive"},this.liveRegionText)),i("div",{key:"791e05da9f511fdb1a4439a3e879ef4b9756c258",class:"table__container",onFocusin:this.onFocus,onFocusout:this.onBlur,onKeyDown:this.onKeyDown,onScroll:this.onScroll,ref:t=>this.container=t,tabIndex:-1},i("div",{key:"00f4c7bed1f953e507896a3558bb30a6ffdf7184","aria-describedby":this.caption?"caption":void 0,"aria-label":this.label,role:"table",class:"table__table"},this.caption&&i("swirl-visually-hidden",{key:"8369efdbe24e28f212cb06bd78f40fa1a4b4a5f2"},i("div",{key:"7a7aac1376a41ae68f831f15a19db9f8d662fb59",id:"caption"},this.caption)),i("div",{key:"86abf9d783dbd7b353f3b40efb13b37c7d4cbece",role:"rowgroup"},i("div",{key:"5651f12df3e10571a18c48ff8b27641b4674ef40",class:"table__header",ref:t=>this.headerEl=t,role:"row"},i("slot",{key:"d5f36a58148734d80899e0986cd0726546079720",name:"columns"}))),i("div",{key:"d80ad2723f76f0695f83012c0af664f660bc0467",class:"table__body",ref:t=>this.bodyEl=t},i("slot",{key:"c9d2d172591f765912f165e412bd51dd3e05b52c",name:"rows"}),i("div",{key:"68fc4436378546379402064debc6778beefa8847",class:"table__empty-row",role:"row"},i("div",{key:"a8b84493ab57f740224c806bee61aac9a67be64a","aria-colspan":this.getColumns().length,class:"table__empty-row-cell",role:"cell"},i("slot",{key:"fc2377b95667af8932a2c5cf9af734c3512911b1",name:"empty"}),!t&&i("swirl-text",{key:"bfa4152124785e30d50d1d52a10b0f07f7f57a26",align:"center",size:"sm"},this.emptyStateLabel))))))))}get el(){return this}static get watchers(){return{enableDragDrop:[{handleEnableDragDropChange:0}]}}static get style(){return".sc-swirl-table-h{--swirl-table-shadow-rgba:rgba(23, 23, 23, 0.2);position:relative;display:block}.sc-swirl-table-h *.sc-swirl-table{box-sizing:border-box}html.theme-dark.sc-swirl-table-h,html.theme-dark .sc-swirl-table-h{--swirl-table-shadow-rgba:rgba(0, 0, 0, 0.2)}.table--keyboard-move.sc-swirl-table:focus-within{--swirl-table-moving-row-border:var(--s-border-width-default) solid var(--s-border-highlight)}.table--show-empty-state.sc-swirl-table .table__empty-row.sc-swirl-table{display:flex}.table__container.sc-swirl-table{position:relative;overflow:auto;width:100%}.table__container--scrolled.sc-swirl-table{--swirl-table-sticky-right-shadow:4px 0 16px -4px var(--swirl-table-shadow-rgba), 2px 0 4px -2px var(--swirl-table-shadow-rgba)}.table__container--scrollable.sc-swirl-table:not(.table__container--scrolled-to-end){--swirl-table-sticky-left-shadow:0px 4px 16px 0px var(--swirl-table-shadow-rgba), 0px 1px 4px 0px var(--swirl-table-shadow-rgba)}.table__table.sc-swirl-table{width:-moz-max-content;width:max-content;min-width:max(20rem, 100%)}.table__header.sc-swirl-table-s>*,.table__header .sc-swirl-table-s>*{display:flex}.table__empty-row.sc-swirl-table{display:none}.table__empty-row-cell.sc-swirl-table{display:flex;overflow:auto;padding-top:var(--s-space-8);padding-right:var(--s-space-16);padding-bottom:var(--s-space-8);padding-left:var(--s-space-16);flex-basis:0;flex-grow:1;flex-shrink:1;align-items:center;background-color:var(--s-surface-default)}.table__empty-row-cell.sc-swirl-table>*.sc-swirl-table{flex-grow:1}"}},[262,"swirl-table",{caption:[1],dragDropHandle:[1,"drag-drop-handle"],dragDropInstructions:[16],emptyStateLabel:[1,"empty-state-label"],enableDragDrop:[4,"enable-drag-drop"],label:[1],loading:[4],empty:[32],liveRegionText:[32],scrollable:[32],scrolled:[32],scrolledToEnd:[32],rerender:[64]},[[9,"resize","onWindowResize"]],{enableDragDrop:[{handleEnableDragDropChange:0}]}]),g=y,v=function(){"undefined"!=typeof customElements&&["swirl-table","swirl-text","swirl-visually-hidden"].forEach((t=>{switch(t){case"swirl-table":customElements.get(r(t))||customElements.define(r(t),y);break;case"swirl-text":customElements.get(r(t))||b();break;case"swirl-visually-hidden":customElements.get(r(t))||w()}}))};export{g as SwirlTable,v as defineCustomElement}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, a as Host, d as getElement } from './index-BdGaOt5L.js';
|
|
2
2
|
import { c as classnames } from './index-orsBiyT_.js';
|
|
3
|
-
import { v as v4 } from './v4-DD3477fe.js';
|
|
4
3
|
|
|
5
4
|
const swirlAccordionItemCss = () => `:host{display:block}:host *{box-sizing:border-box}.accordion-item{display:grid;align-content:start;border-top:0.0625rem solid var(--s-border-default);transition:grid-template-rows 0.15s;grid-template-rows:auto 0fr;will-change:grid-template-rows}@media (prefers-reduced-motion){.accordion-item{transition:none}}.accordion-item--expanded{grid-template-rows:auto 1fr}.accordion-item--expanded .accordion-item__content{padding-top:var(--s-space-16);padding-bottom:var(--s-space-16);animation:accordion-overflow 0.01s;animation-delay:0.15s;animation-fill-mode:forwards}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.accordion-item--expanded .accordion-item__content{padding-top:var(--s-space-8)}}.accordion-item__heading{margin:0;padding:0;font-size:var(--s-font-size-base);font-weight:var(--s-font-weight-semibold)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.accordion-item__heading{font-size:var(--s-font-size-sm)}}.accordion-item__toggle{display:flex;width:100%;padding:0;padding-top:var(--s-space-16);padding-bottom:var(--s-space-16);padding-left:var(--s-space-8);align-items:center;border:none;color:var(--s-text-default);background-color:var(--swirl-accordion-item-toggle-default);font:inherit;line-height:var(--s-line-height-lg);text-align:start;cursor:pointer;gap:var(--s-space-16)}.accordion-item__toggle:hover{background-color:var(--swirl-accordion-item-toggle-hovered)}.accordion-item__toggle:active{background-color:var(--swirl-accordion-item-toggle-pressed)}.accordion-item__toggle:disabled{color:var(--s-text-disabled);background-color:var(--swirl-accordion-item-toggle-default);cursor:default}.accordion-item__toggle:disabled .text{color:var(--s-text-disabled)}.accordion-item__toggle:focus:not(:focus-visible){outline:none}.accordion-item__toggle:focus-visible{outline-color:var(--s-focus-default)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.accordion-item__toggle{line-height:var(--s-line-height-sm)}}.accordion-item__toggle-text{flex-grow:1}.accordion-item__icon{display:inline-flex;padding-right:var(--s-space-8);flex-shrink:0}.accordion-item__content{overflow:hidden;padding-top:0;padding-bottom:0;transition:padding-top 0.15s, padding-bottom 0.15s;animation:accordion-display 0.01s;animation-delay:0.15s;animation-fill-mode:forwards}@media (prefers-reduced-motion){.accordion-item__content{transition:none}}@keyframes accordion-overflow{from{overflow:hidden}to{overflow:visible}}@keyframes accordion-display{from{display:block}to{display:none}}`;
|
|
6
5
|
|
|
@@ -9,9 +8,9 @@ const SwirlAccordionItem = class {
|
|
|
9
8
|
registerInstance(this, hostRef);
|
|
10
9
|
this.expansionChange = createEvent(this, "expansionChange", 7);
|
|
11
10
|
this.headingLevel = 2;
|
|
12
|
-
this.itemId =
|
|
11
|
+
this.itemId = crypto.randomUUID();
|
|
13
12
|
this.expanded = false;
|
|
14
|
-
this.headingId = `${
|
|
13
|
+
this.headingId = `${crypto.randomUUID()}-heading`;
|
|
15
14
|
this.onHeadingClick = () => {
|
|
16
15
|
this.toggle();
|
|
17
16
|
};
|
|
@@ -59,7 +58,7 @@ const SwirlAccordionItem = class {
|
|
|
59
58
|
const className = classnames("accordion-item", {
|
|
60
59
|
"accordion-item--expanded": this.expanded,
|
|
61
60
|
});
|
|
62
|
-
return (h(Host, { key: '
|
|
61
|
+
return (h(Host, { key: 'ed0d988e2fc48f140515cfecc40e543ed40d14cc' }, h("div", { key: 'a1a9bb9a36e5018b0741aa4980659dca503cf128', class: className }, h(HeadingTag, { key: '4919327d90ec3b829aecd9af57601dced379009d', class: "accordion-item__heading" }, h("button", { key: '7d31acbf313e30827703c88027121681f0a0d6b0', "aria-controls": this.itemId, "aria-expanded": String(this.expanded), class: "accordion-item__toggle", disabled: this.disabled, id: this.headingId, onClick: this.onHeadingClick, type: "button" }, h("slot", { key: 'b79a174398448e9fea3407f8d7a4803d5d60d1f5', name: "media" }), h("span", { key: 'f092906ba953c07abdbb1d8159268b92960fdc39', class: "accordion-item__toggle-text" }, this.heading, this.description && (h("swirl-text", { key: '827970a298d728085b6ae63be7c8c9d44859bbda', as: "span", color: "subdued", size: "sm" }, this.description))), h("slot", { key: '6dc7a6efd5948d2954c4e5dce1ccb04475bee77d', name: "trailing" }), h("span", { key: '5626c5d1a6a8ccaa4c3f20deaeea6d169da05f89', class: "accordion-item__icon" }, !this.expanded && (h("swirl-icon", { key: '7656ce9908d12897902ccc81dbb3b9388f46b292', glyph: "chevron-right", size: 20 })), this.expanded && (h("swirl-icon", { key: '5f9ad2f5dcc97d32f30f1981356ac525286ff8d9', glyph: "expand-more", size: 20 }))))), h("div", { key: '5b32ae5da0caacd8891b74451a2f3aff91d640af', "aria-labelledby": this.headingId, class: "accordion-item__content", id: this.itemId, role: "region" }, h("slot", { key: '50ff36caf14b70bcc79fbf91db1e58ceb0c10a60' })))));
|
|
63
62
|
}
|
|
64
63
|
get el() { return getElement(this); }
|
|
65
64
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, a as Host, d as getElement } from './index-BdGaOt5L.js';
|
|
2
2
|
import { c as classnames } from './index-orsBiyT_.js';
|
|
3
3
|
|
|
4
|
-
const swirlCardCss = () => `:host{display:contents}:host *{box-sizing:border-box}.card{position:relative;display:flex;overflow:hidden;width:100%;margin:0;padding:0;border:var(--s-border-width-default) solid var(--s-border-default);border-radius:var(--s-border-radius-base);color:var(--s-text-default);background-color:var(--swirl-card-background-default);font:inherit;text-decoration:none;flex-direction:column;transition:background-color 0.2s}.card:not(.card--has-image) .card__image{overflow:hidden;height:0}a.card,button.card,.card--interactive{cursor:pointer}a.card:hover,button.card:hover,.card--interactive:hover{--swirl-avatar-background-color:var(--s-surface-raised-hovered);background-color:var(--swirl-card-background-hovered)}a.card:active,button.card:active,.card--interactive:active{--swirl-avatar-background-color:var(--s-surface-raised-pressed);background-color:var(--swirl-card-background-pressed)}a.card:focus:not(:focus-visible),button.card:focus:not(:focus-visible),.card--interactive:focus:not(:focus-visible){outline:none}a.card:focus-visible,button.card:focus-visible,.card--interactive:focus-visible{outline-color:var(--s-focus-default);outline-offset:var(--s-space-4)}.card--is--borderless{border:0}.card--elevated.card--elevation-level-1{box-shadow:var(--s-shadow-level-1)}.card--elevated.card--elevation-level-2{box-shadow:var(--s-shadow-level-2)}.card--elevated.card--elevation-level-3{box-shadow:var(--s-shadow-level-3)}.card--flashing{background-color:var(--swirl-card-background-pressed)}.card--flashing.card--intent-default-subdued{background-color:var(--s-surface-raised-pressed)}.card--flashing.card--intent-highlight{background-color:var(--s-surface-highlight-pressed)}.card--highlighted{border-width:0.1875rem;border-color:var(--s-border-highlight)}.card--justify-content-start .card__body{justify-content:flex-start}.card--justify-content-center .card__body{justify-content:center}.card--justify-content-end .card__body{justify-content:flex-end}.card--intent-critical-subdued{background-color:var(--s-surface-critical-subdued)}.card--intent-default-subdued{background-color:var(--s-surface-raised-default)}.card--intent-info-subdued{background-color:var(--s-surface-info-subdued)}.card--intent-success-subdued{background-color:var(--s-surface-success-subdued)}.card--intent-warning-subdued{background-color:var(--s-surface-warning-subdued)}.card--intent-highlight{color:var(--s-text-on-surface-highlight);background-color:var(--s-surface-highlight-default)}.card--translucent{background-color:transparent}.card--translucent:before{content:"";position:absolute;inset:0;z-index:-1;background:var(--s-translucent-low-default);-webkit-backdrop-filter:blur(var(--s-blur-l));backdrop-filter:blur(var(--s-blur-l));border-radius:inherit}.card--has-floating-controls:focus-within .card__floating-controls,.card--has-floating-controls:hover .card__floating-controls{pointer-events:auto;opacity:1}.content-section{padding:0 var(--s-space-16)}.card__image{overflow:hidden;min-height:0}.card__image ::slotted(img){display:inline-flex;width:100%;max-height:100%;-o-object-fit:cover;object-fit:cover}.card__floating-controls{position:absolute;z-index:1;top:0;right:0;padding:var(--s-space-12);transition:opacity 0.2s;pointer-events:none;opacity:0}.card__body{display:flex;min-height:0;padding:var(--s-space-12) var(--s-space-16) var(--s-space-16);flex-grow:1;flex-direction:column;gap:var(--s-space-16)}.card__content{min-height:100%}@media print{.card{overflow:visible;height:auto;min-height:-
|
|
4
|
+
const swirlCardCss = () => `:host{display:contents}:host *{box-sizing:border-box}.card{position:relative;display:flex;overflow:hidden;width:100%;margin:0;padding:0;border:var(--s-border-width-default) solid var(--s-border-default);border-radius:var(--s-border-radius-base);color:var(--s-text-default);background-color:var(--swirl-card-background-default);font:inherit;text-decoration:none;flex-direction:column;transition:background-color 0.2s}.card:not(.card--has-image) .card__image{overflow:hidden;height:0}a.card,button.card,.card--interactive{cursor:pointer}a.card:hover,button.card:hover,.card--interactive:hover{--swirl-avatar-background-color:var(--s-surface-raised-hovered);background-color:var(--swirl-card-background-hovered)}a.card:active,button.card:active,.card--interactive:active{--swirl-avatar-background-color:var(--s-surface-raised-pressed);background-color:var(--swirl-card-background-pressed)}a.card:focus:not(:focus-visible),button.card:focus:not(:focus-visible),.card--interactive:focus:not(:focus-visible){outline:none}a.card:focus-visible,button.card:focus-visible,.card--interactive:focus-visible{outline-color:var(--s-focus-default);outline-offset:var(--s-space-4)}.card--is--borderless{border:0}.card--elevated.card--elevation-level-1{box-shadow:var(--s-shadow-level-1)}.card--elevated.card--elevation-level-2{box-shadow:var(--s-shadow-level-2)}.card--elevated.card--elevation-level-3{box-shadow:var(--s-shadow-level-3)}.card--flashing{background-color:var(--swirl-card-background-pressed)}.card--flashing.card--intent-default-subdued{background-color:var(--s-surface-raised-pressed)}.card--flashing.card--intent-highlight{background-color:var(--s-surface-highlight-pressed)}.card--highlighted{border-width:0.1875rem;border-color:var(--s-border-highlight)}.card--justify-content-start .card__body{justify-content:flex-start}.card--justify-content-center .card__body{justify-content:center}.card--justify-content-end .card__body{justify-content:flex-end}.card--intent-critical-subdued{background-color:var(--s-surface-critical-subdued)}.card--intent-default-subdued{background-color:var(--s-surface-raised-default)}.card--intent-info-subdued{background-color:var(--s-surface-info-subdued)}.card--intent-success-subdued{background-color:var(--s-surface-success-subdued)}.card--intent-warning-subdued{background-color:var(--s-surface-warning-subdued)}.card--intent-highlight{color:var(--s-text-on-surface-highlight);background-color:var(--s-surface-highlight-default)}.card--translucent{background-color:transparent}.card--translucent:before{content:"";position:absolute;inset:0;z-index:-1;background:var(--s-translucent-low-default);-webkit-backdrop-filter:blur(var(--s-blur-l));backdrop-filter:blur(var(--s-blur-l));border-radius:inherit}.card--has-floating-controls:focus-within .card__floating-controls,.card--has-floating-controls:hover .card__floating-controls{pointer-events:auto;opacity:1}.content-section{padding:0 var(--s-space-16)}.card__image{overflow:hidden;min-height:0}.card__image ::slotted(img){display:inline-flex;width:100%;max-height:100%;-o-object-fit:cover;object-fit:cover}.card__floating-controls{position:absolute;z-index:1;top:0;right:0;padding:var(--s-space-12);transition:opacity 0.2s;pointer-events:none;opacity:0}.card__body{display:flex;min-height:0;padding:var(--s-space-12) var(--s-space-16) var(--s-space-16);flex-grow:1;flex-direction:column;gap:var(--s-space-16)}.card__content{min-height:100%}@media print{.card{overflow:visible;height:auto;min-height:-moz-fit-content;min-height:fit-content}.card__body{min-height:auto;flex-grow:0}.card__content{min-height:auto}}`;
|
|
5
5
|
|
|
6
6
|
const swirlCardBorderRadiusTokens = ["xs", "sm", "base", "l", "xl"];
|
|
7
7
|
const SwirlCard = class {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, a as Host } from './index-BdGaOt5L.js';
|
|
2
2
|
import { c as classnames } from './index-orsBiyT_.js';
|
|
3
|
-
import { v as v4 } from './v4-DD3477fe.js';
|
|
4
3
|
|
|
5
4
|
// Clamps a value between an upper and lower bound.
|
|
6
5
|
// We use ternary operators because it makes the minified code
|
|
@@ -395,7 +394,7 @@ const SwirlColorInput = class {
|
|
|
395
394
|
this.valueChange = createEvent(this, "valueChange", 7);
|
|
396
395
|
this.pickerButtonLabel = "Open color picker";
|
|
397
396
|
this.pickerLabel = "Color picker";
|
|
398
|
-
this.pickerId = `color-picker-${
|
|
397
|
+
this.pickerId = `color-picker-${crypto.randomUUID()}`;
|
|
399
398
|
this.onPickerChange = (event) => {
|
|
400
399
|
this.value = event.detail.value;
|
|
401
400
|
};
|
|
@@ -444,11 +443,11 @@ const SwirlColorInput = class {
|
|
|
444
443
|
const className = classnames("color-input", {
|
|
445
444
|
"color-input--inline": this.inline,
|
|
446
445
|
});
|
|
447
|
-
return (h(Host, { key: '
|
|
446
|
+
return (h(Host, { key: '2ee1b42158b3caeb6ab7b0c46192a327ae9a854e' }, h("div", { key: 'c14754cc9fe4d74fd40ec50cb796dd1b7688d823', class: className }, h("input", { key: '4d884de2795ed648a11cda4eaf08e03cf825e443', "aria-describedby": this.swirlAriaDescribedby, "aria-disabled": this.disabled ? "true" : undefined, "aria-invalid": ariaInvalid, autoFocus: this.autoFocus, class: "color-input__input", disabled: this.disabled, maxLength: 7, onBlur: this.onBlur, onFocus: this.onFocus, onInput: this.onInput, placeholder: this.placeholder, ref: (el) => (this.inputEl = el), required: this.required, spellcheck: "false", type: "text", value: this.value, readonly: this.readonly }), h("swirl-popover-trigger", { key: '9d543f84f7831b48af0036fa0062ea98afdbfecf', swirlPopover: this.pickerId }, h("button", { key: 'fe0ffd3db789188beb2c5ca62bfcdd241a932721', disabled: this.readonly, "aria-label": this.pickerButtonLabel, class: "color-input__preview-button", style: {
|
|
448
447
|
backgroundColor: this.disabled
|
|
449
448
|
? "var(--s-border-subdued)"
|
|
450
449
|
: this.value,
|
|
451
|
-
}, type: "button" })), h("swirl-popover", { key: '
|
|
450
|
+
}, type: "button" })), h("swirl-popover", { key: 'c9ac21281b927941dfe43851785c94ac48594c6b', animation: "scale-in-y", id: this.pickerId, label: this.pickerLabel, placement: "bottom-end" }, h("swirl-box", { key: 'c888476cc56718853a644e2b722defa46babd920', centerInline: true, paddingBlockEnd: "8", paddingBlockStart: "8", paddingInlineEnd: "16", paddingInlineStart: "16" }, h("hex-color-picker", { key: 'f5ee44a0661d3c8ae6d076a0817b76e8a646bd5a', color: this.value, ref: (el) => (this.picker = el) }))))));
|
|
452
451
|
}
|
|
453
452
|
static get watchers() { return {
|
|
454
453
|
"value": [{
|
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, a as Host, d as getElement
|
|
|
2
2
|
import { c as classnames } from './index-orsBiyT_.js';
|
|
3
3
|
import { d as debounce, i as isMobileViewport } from './utils-CCck-DTo.js';
|
|
4
4
|
|
|
5
|
-
const swirlConsoleLayoutCss = () => `:host{display:block;width:100%;height:100vh;--console-footer-height:4.25rem;--console-app-bar-height:3.5rem;--console-sidebar-width:18.5rem}:host *{box-sizing:border-box}.console-layout{display:grid;width:100%;height:100%;grid-template-columns:1fr;grid-template-areas:"main"}@media (min-width: 768px){.console-layout{grid-template-columns:var(--console-sidebar-width) 1fr;grid-template-areas:"sidebar main"}}@media (max-width: 767px){.console-layout--sidebar-active .console-layout__sidebar{transform:translate3d(0, 0, 0);box-shadow:0 0 1rem rgba(0, 0, 0, 0.06)}}@media (min-width: 768px){.console-layout--empty-app-bar .console-layout__main{grid-template-areas:"content";grid-template-rows:1fr}}@media (min-width: 768px){.console-layout--empty-app-bar .console-layout__app-bar{display:none}}@media (min-width: 768px){.console-layout--empty-app-bar.console-layout--has-footer .console-layout__main{grid-template-areas:"content" "footer";grid-template-rows:1fr
|
|
5
|
+
const swirlConsoleLayoutCss = () => `:host{display:block;width:100%;height:100vh;--console-footer-height:4.25rem;--console-app-bar-height:3.5rem;--console-sidebar-width:18.5rem}:host *{box-sizing:border-box}.console-layout{display:grid;width:100%;height:100%;grid-template-columns:1fr;grid-template-areas:"main"}@media (min-width: 768px){.console-layout{grid-template-columns:var(--console-sidebar-width) 1fr;grid-template-areas:"sidebar main"}}@media (max-width: 767px){.console-layout--sidebar-active .console-layout__sidebar{transform:translate3d(0, 0, 0);box-shadow:0 0 1rem rgba(0, 0, 0, 0.06)}}@media (min-width: 768px){.console-layout--empty-app-bar .console-layout__main{grid-template-areas:"content";grid-template-rows:1fr}}@media (min-width: 768px){.console-layout--empty-app-bar .console-layout__app-bar{display:none}}@media (min-width: 768px){.console-layout--empty-app-bar.console-layout--has-footer .console-layout__main{grid-template-areas:"content" "footer";grid-template-rows:1fr min-content}}.console-layout__sidebar{position:fixed;z-index:var(--s-z-30);top:4rem;bottom:0;left:0;display:grid;overflow-x:hidden;overflow-y:auto;width:100%;max-width:20rem;border-right:var(--s-border-width-default) solid var(--s-border-default);transition:transform 0.15s, box-shadow 0.15s;transform:translate3d(-100%, 0, 0);grid-template-rows:auto 1fr min-content;grid-template-areas:"header" "navigation" "user"}@media (prefers-reduced-motion){.console-layout__sidebar{transition:none}}@media (min-width: 768px){.console-layout__sidebar{position:static;top:auto;left:auto;max-width:none;height:100%;transform:none;box-shadow:none;grid-area:sidebar}}.console-layout__header{overflow:hidden;min-width:0;padding:var(--s-space-20) var(--s-space-24);background-color:var(--s-background-default);grid-area:header}.console-layout__navigation{overflow-x:hidden;overflow-y:auto;padding-top:var(--s-space-8);padding-bottom:var(--s-space-8);background-color:var(--s-background-default);grid-area:navigation}.console-layout__user{overflow:hidden;padding:var(--s-space-16) var(--s-space-24);border-top:var(--s-border-width-default) solid var(--s-border-default);background-color:var(--s-background-default);grid-area:user;min-height:var(--console-footer-height);box-sizing:border-box}.console-layout__main{display:grid;overflow:hidden;width:100%;height:100%;grid-area:main;gap:var(--s-border-width-default);grid-template-rows:var(--console-app-bar-height) 1fr;grid-template-areas:"app-bar" "content"}.console-layout--has-footer .console-layout__main{grid-template-rows:var(--console-app-bar-height) 1fr min-content;grid-template-areas:"app-bar" "content" "footer"}.console-layout__app-bar{position:sticky;z-index:var(--s-z-30);top:0;display:flex;min-width:0;padding-right:var(--s-space-16);padding-left:var(--s-space-16);align-items:center;border-bottom:var(--s-border-width-default) solid var(--s-border-default);background-color:var(--s-background-default);gap:var(--s-space-12);grid-area:app-bar}@media (min-width: 768px){.console-layout__app-bar{padding-right:2.5rem;padding-left:2.5rem}}@media (min-width: 768px){.console-layout__mobile-navigation-button{display:none}}.console-layout__app-name{min-width:0;flex-grow:1}.console-layout__app-name .heading{overflow:hidden;font-weight:var(--s-font-weight-regular);white-space:nowrap;text-overflow:ellipsis}.console-layout__help-button{flex-shrink:0}.console-layout__content{overflow-x:hidden;overflow-y:auto;scrollbar-gutter:stable;display:flex;min-width:0;padding:0 var(--s-space-16);background-color:var(--s-background-default);flex-direction:column;grid-area:content}@media (min-width: 768px){.console-layout__content{padding:0 2.5rem}}.console-layout__content-container{display:flex;flex-direction:column;align-items:center;height:100%;width:100%}.console-layout__integration{flex-grow:1;padding-bottom:var(--s-space-16)}@media (min-width: 768px){.console-layout__integration{padding-bottom:2.5rem}}.console-layout__integration{width:100%}.console-layout__logo{display:flex;min-width:0;align-items:center;gap:var(--s-space-12)}.console-layout__logo-mark{flex-shrink:0}.console-layout__logo-text{min-width:0}.console-layout__logo-text::part(text){overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.console-layout__content-header{display:flex;margin-bottom:var(--s-space-24);flex-shrink:0;gap:var(--s-space-16);padding-top:var(--s-space-16)}@media (min-width: 768px){.console-layout__content-header{padding-top:2.5rem}}.console-layout__content-header{width:100%}.console-layout--has-custom-app-bar .console-layout__content-header{padding-top:var(--s-space-16)}.console-layout__back-button{position:relative;top:calc(-1 * var(--s-space-2));flex-shrink:0}.console-layout__heading-container{flex-grow:1}.console-layout__subheading{margin-top:var(--s-space-8)}.console-layout__content-header-tools{display:flex;flex-shrink:0}.console-layout__footer{position:sticky;bottom:0;z-index:var(--s-z-20);display:flex;flex-shrink:0;min-width:0;border-top:var(--s-border-width-default) solid var(--s-border-default);background-color:var(--s-background-default);grid-area:footer;width:100%;min-height:var(--console-footer-height);box-sizing:border-box}.console-layout__app-bar--custom{display:flex;min-width:0;align-items:center;padding:0;border-bottom:var(--s-border-width-default) solid transparent;background-color:var(--s-background-default)}.console-layout--main-scrollable:not(.console-layout--main-scrolled-to-top) .console-layout__app-bar--custom{border-bottom-color:var(--s-border-default)}.console-layout:not(.console-layout--has-custom-app-bar) .console-layout__app-bar--custom{display:none}.console-layout:not(.console-layout--has-footer) .console-layout__footer{display:none}.console-layout--has-custom-app-bar .console-layout__app-bar:not(.console-layout__app-bar--custom){display:none}.console-layout--hide-content-header .console-layout__content{padding:0;overflow:hidden;scrollbar-gutter:auto}.console-layout--hide-content-header .console-layout__integration{padding-bottom:0}`;
|
|
6
6
|
|
|
7
7
|
const SwirlConsoleLayout = class {
|
|
8
8
|
constructor(hostRef) {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, a as Host, d as getElement } from './index-BdGaOt5L.js';
|
|
2
2
|
import { c as classnames } from './index-orsBiyT_.js';
|
|
3
|
-
import { v as v4 } from './v4-DD3477fe.js';
|
|
4
3
|
|
|
5
4
|
const swirlDataCellStackCss = () => `:host{display:block;width:100%}:host *{box-sizing:border-box}.data-cell-stack{display:flex;flex-direction:column;width:100%;gap:var(--s-space-16)}.data-cell-stack__header{display:flex;align-items:flex-start;gap:var(--s-space-8);width:100%;justify-content:space-between}.data-cell-stack__header-content{display:flex;flex-direction:column;align-items:flex-start;gap:var(--s-space-4)}.data-cell-stack__label{font-size:var(--s-font-size-base);line-height:var(--s-line-height-base);color:var(--s-text-default);font-weight:var(--s-font-weight-semibold);margin:0}.data-cell-stack__description{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm);color:var(--s-text-subdued);margin:0}.data-cell-stack__cells{display:flex;flex-direction:column;gap:var(--s-space-2)}.data-cell-stack__cells ::slotted(swirl-data-cell:first-of-type:not(:last-of-type)){--swirl-data-cell-border-radius:var(--s-border-radius-l) var(--s-border-radius-l) var(--s-border-radius-s) var(--s-border-radius-s)}.data-cell-stack__cells ::slotted(swirl-data-cell:last-of-type:not(:first-of-type)){--swirl-data-cell-border-radius:var(--s-border-radius-s) var(--s-border-radius-s) var(--s-border-radius-l) var(--s-border-radius-l)}.data-cell-stack__cells ::slotted(swirl-data-cell:not(:first-of-type):not(:last-of-type)){--swirl-data-cell-border-radius:var(--s-border-radius-s)}.data-cell-stack__cells ::slotted(swirl-data-cell:first-of-type:last-of-type){--swirl-data-cell-border-radius:var(--s-border-radius-l)}.data-cell-stack__cta{display:flex;align-items:center;flex-shrink:0}`;
|
|
6
5
|
|
|
@@ -8,7 +7,7 @@ const SwirlDataCellStack = class {
|
|
|
8
7
|
constructor(hostRef) {
|
|
9
8
|
registerInstance(this, hostRef);
|
|
10
9
|
this.hideLabel = false;
|
|
11
|
-
this.headerId = `data-cell-stack-header-${
|
|
10
|
+
this.headerId = `data-cell-stack-header-${crypto.randomUUID()}`;
|
|
12
11
|
this.onSlotChange = (event) => {
|
|
13
12
|
const slot = event.target;
|
|
14
13
|
const elements = slot.assignedElements();
|
|
@@ -28,7 +27,7 @@ const SwirlDataCellStack = class {
|
|
|
28
27
|
const descriptionId = this.description
|
|
29
28
|
? `${this.headerId}-description`
|
|
30
29
|
: undefined;
|
|
31
|
-
return (h(Host, { key: '
|
|
30
|
+
return (h(Host, { key: '042c83c6f2fcbb76810f082487dba327f3cc8309' }, h("div", { key: '07eb0ed861d3051dcffcbaa830ec07e46b1fd624', class: className, part: "data-cell-stack", role: "group" }, (showLabel || this.description || hasCta) && (h("header", { key: 'e664e0c1db6346a7b7680f4b5fa1354ec27af519', class: "data-cell-stack__header", id: this.headerId }, h("div", { key: '6e4e5b99e5cfb6a98375bd6b19cdf8c60ccbe223', class: "data-cell-stack__header-content" }, showLabel && (h("h3", { key: '092b8ac7525b5edf5d0938bd8c8ddb8fe9ef9e1b', class: "data-cell-stack__label", id: labelId }, this.label)), this.description && (h("p", { key: 'abc7d688fadb1248b4c0fabb57f83b004fe0091d', class: "data-cell-stack__description", id: descriptionId }, this.description))), hasCta && (h("div", { key: '5868eff8aa04cd733d7c7d6d029585075739607a', class: "data-cell-stack__cta" }, h("slot", { key: '4b872cac524edaa3ef7fc102554190006fe31a5c', name: "cta" }))))), h("div", { key: '88bba53868d016ee19a79e75dbd3dab4fd6e87c1', class: "data-cell-stack__cells", role: "list", "aria-labelledby": labelId || undefined, "aria-describedby": descriptionId || undefined }, h("slot", { key: '8a7b45a1bb3b648d8fd1848ade56c0c56b5485de', onSlotchange: this.onSlotChange })))));
|
|
32
31
|
}
|
|
33
32
|
get el() { return getElement(this); }
|
|
34
33
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, a as Host, d as getElement } from './index-BdGaOt5L.js';
|
|
2
2
|
import { c as classnames } from './index-orsBiyT_.js';
|
|
3
|
-
import { v as v4 } from './v4-DD3477fe.js';
|
|
4
3
|
|
|
5
4
|
const swirlDataCellCss = () => `:host{display:block;width:100%}:host *{box-sizing:border-box}.data-cell{display:flex;align-items:center;gap:var(--s-space-8);width:100%;padding:var(--s-space-12) var(--s-space-16);border-radius:var(--swirl-data-cell-border-radius, var(--s-border-radius-l))}.data-cell--interactive{cursor:pointer}.data-cell--intent-default{background-color:var(--s-surface-raised-50-default)}.data-cell--intent-info{background-color:var(--s-surface-info-subdued)}.data-cell--intent-critical{background-color:var(--s-surface-critical-subdued)}.data-cell--intent-warning{background-color:var(--s-surface-warning-subdued)}.data-cell--intent-success{background-color:var(--s-surface-success-subdued)}.data-cell--intent-special{background-color:var(--s-decorative-grape-surface-subdued)}.data-cell--intent-translucent{background-color:var(--s-surface-on-image-default)}.data-cell--intent-subdued{background-color:var(--s-surface-raised-default)}.data-cell--vertical{align-items:center}.data-cell__media{flex-shrink:0;display:flex;align-items:center}.data-cell__media ::slotted(swirl-avatar){--swirl-avatar-background-color:var(--s-surface-default)}.data-cell__content{flex:1;min-width:0;display:flex;align-items:center;justify-content:space-between;gap:var(--s-space-24)}.data-cell--no-label .data-cell__content,.data-cell--no-label .data-cell__value-wrapper,.data-cell--no-label .data-cell__input{width:100%}.data-cell--vertical .data-cell__content{flex-direction:column;align-items:flex-start;gap:var(--s-space-4)}.data-cell__label-wrapper{flex-shrink:0;min-width:0}.data-cell:not(.data-cell--vertical) .data-cell__label-wrapper{width:calc(160px + var(--s-space-4) + 16px)}.data-cell__label{display:block;font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm);color:var(--s-text-subdued);font-weight:var(--s-font-weight-normal)}.data-cell:not(.data-cell--vertical) .data-cell__label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:160px}.data-cell__tooltip swirl-icon-info{flex-shrink:0;color:var(--s-text-subdued)}.data-cell__value-wrapper{display:flex;align-items:center;gap:var(--s-space-4);flex-shrink:1;min-width:0}.data-cell--vertical .data-cell__value-wrapper{flex-direction:column;align-items:flex-start}.data-cell__value{flex:1;min-width:0;font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm);color:var(--s-text-default);font-weight:var(--s-font-weight-semibold);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.data-cell--vertical .data-cell__value{white-space:normal;overflow:visible;text-overflow:clip}.data-cell__suffix{flex-shrink:0}.data-cell__input{width:100%;--swirl-form-control-label-background-color:var( --swirl-data-cell-input-background, var(--s-surface-default) )}.data-cell__input ::slotted(swirl-checkbox),.data-cell__input ::slotted(swirl-radio){width:100%}@media (max-width: 767px){.data-cell:not(.data-cell--vertical) .data-cell__content{flex-direction:column;align-items:flex-start;gap:var(--s-space-4)}.data-cell:not(.data-cell--vertical) .data-cell__value-wrapper{flex-direction:column;align-items:flex-start}}`;
|
|
6
5
|
|
|
@@ -10,7 +9,7 @@ const SwirlDataCell = class {
|
|
|
10
9
|
this.valueChange = createEvent(this, "valueChange", 7);
|
|
11
10
|
this.intent = "default";
|
|
12
11
|
this.vertical = false;
|
|
13
|
-
this.elementId = `data-cell-${
|
|
12
|
+
this.elementId = `data-cell-${crypto.randomUUID()}`;
|
|
14
13
|
this.handleRadioClick = (event) => {
|
|
15
14
|
const target = event.target;
|
|
16
15
|
const radio = this.el.querySelector('swirl-radio[slot="content"]');
|
|
@@ -50,8 +49,8 @@ const SwirlDataCell = class {
|
|
|
50
49
|
const hostRole = isInDataCellStack ? "listitem" : "group";
|
|
51
50
|
const contentRole = hasCheckbox || hasRadio ? "button" : undefined;
|
|
52
51
|
const wrapperRole = isInDataCellStack && !contentRole ? "group" : contentRole;
|
|
53
|
-
const labelContent = (h("swirl-stack", { key: '
|
|
54
|
-
return (h(Host, { key: '
|
|
52
|
+
const labelContent = (h("swirl-stack", { key: '7a729ce4b378c034b97979986762a0fa1d641cfb', orientation: "horizontal", align: "center", spacing: "4" }, h("span", { key: '40982cffdceb54b8d24792c7198d0897276f58e3', class: "data-cell__label", id: labelId, role: "term" }, this.label), this.tooltip && (h("swirl-tooltip", { key: 'ea28c9c22c24cbc8693ea289c1dda8a4fb1c20a9', class: "data-cell__tooltip", content: this.tooltip, position: "right" }, h("swirl-icon-info", { key: '9b7e454200efa02d2fa80b8e2af0b11c8b114df2', size: 16, tabIndex: 0 })))));
|
|
53
|
+
return (h(Host, { key: '29deeeca389052e4b8224fa793930260d5626f64', role: hostRole }, h("div", { key: '67714930178503e615e4c57c4fb55a09e668141f', class: className, part: "data-cell", onClick: hasCheckbox || hasRadio ? this.handleClick : undefined, role: wrapperRole, tabIndex: hasCheckbox || hasRadio ? 0 : undefined }, hasMedia && (h("div", { key: 'befe843837b8e860175c1d21d9aba3b09be4abaa', class: "data-cell__media", "aria-hidden": "true" }, h("slot", { key: '04d1d43cea0aa2b597191276361972a542892a25', name: "media" }))), h("div", { key: '67d0e9ff7ccc92ee666b75736c1640f2f5cbfef9', class: "data-cell__content" }, hasLabel && (h("div", { key: 'a9ba713fcaa63c4eef2d37765c7ad709f8f53e1b', class: "data-cell__label-wrapper" }, labelContent)), (hasContent || this.value || hasSuffix) && (h("div", { key: '167aee81080412dcdc4766be480bf8e774a4c0ed', class: "data-cell__value-wrapper", role: "definition", "aria-labelledby": hasLabel ? labelId : undefined, id: valueId }, hasContent ? (h("div", { class: "data-cell__input" }, h("slot", { name: "content" }))) : (this.value && h("div", { class: "data-cell__value" }, this.value))))), hasSuffix && (h("div", { key: '998ac95e5c5a2dbcd1106c39261163d10ee4d538', class: "data-cell__suffix" }, h("slot", { key: 'bf5f0adfd4138d7831d69fbbb94045de95084040', name: "suffix" }))))));
|
|
55
54
|
}
|
|
56
55
|
get el() { return getElement(this); }
|
|
57
56
|
};
|
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, a as Host, d as getElement,
|
|
|
2
2
|
import { s as removeTimezoneOffset, t as getISODateString } from './utils-CCck-DTo.js';
|
|
3
3
|
import { c as classnames } from './index-orsBiyT_.js';
|
|
4
4
|
|
|
5
|
-
const swirlDatePickerCss = () => `:host{display:block}:host *{box-sizing:border-box}.date-picker{padding:var(--s-space-8) var(--s-space-16);background-color:transparent;font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm);letter-spacing:var(--s-letter-spacing-tighter)}@media (min-width: 768px){.date-picker--fixed-max-width .date-picker{max-width:17.5rem}}.date-picker__header{display:flex;margin-bottom:var(--s-space-8);align-items:center}.date-picker__current-month{display:flex;padding:var(--s-space-8);flex-grow:1;align-items:center;order:1;gap:var(--s-space-4)}.date-picker__next-month-button,.date-picker__previous-month-button{position:relative;display:inline-flex;width:2.5rem;height:2.5rem;margin:0;padding:0;flex-shrink:0;justify-content:center;align-items:center;border:none;border-radius:50%;color:var(--s-icon-highlight);background-color:transparent;cursor:pointer}.date-picker__next-month-button:after,.date-picker__previous-month-button:after{position:absolute;background-color:currentColor;content:"";inset:0;-webkit-mask-position:center center;mask-position:center center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}.date-picker__next-month-button:hover,.date-picker__previous-month-button:hover{background-color:var(--s-state-hovered)}.date-picker__next-month-button:active,.date-picker__previous-month-button:active{background-color:var(--s-state-pressed)}.date-picker__next-month-button:focus:not(:focus-visible),.date-picker__previous-month-button:focus:not(:focus-visible){outline:none}.date-picker__next-month-button:focus-visible,.date-picker__previous-month-button:focus-visible{outline-color:var(--s-focus-default);outline-offset:var(--s-space-2)}.date-picker__next-month-button>svg,.date-picker__previous-month-button>svg{display:none}.date-picker__next-month-button{order:3}.date-picker__next-month-button:after{-webkit-mask-image:url("data:image/svg+xml,%3Csvg class='swirl-icon swirl-icon--size-24' fill='none' height='24' part='icon' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.59999 17.4C8.38333 17.1834 8.27499 16.9167 8.27499 16.6C8.27499 16.2834 8.38333 16.0167 8.59999 15.8L12.4 12L8.59999 8.20002C8.38333 7.98336 8.27499 7.71669 8.27499 7.40002C8.27499 7.08336 8.38333 6.81669 8.59999 6.60002C8.81666 6.38336 9.08333 6.27502 9.39999 6.27502C9.71666 6.27502 9.98333 6.38336 10.2 6.60002L14.8 11.2C14.9167 11.3167 15 11.4417 15.05 11.575C15.1 11.7084 15.125 11.85 15.125 12C15.125 12.15 15.1 12.2917 15.05 12.425C15 12.5584 14.9167 12.6834 14.8 12.8L10.2 17.4C9.98333 17.6167 9.71666 17.725 9.39999 17.725C9.08333 17.725 8.81666 17.6167 8.59999 17.4Z' fill='currentColor'%3E%3C/path%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg class='swirl-icon swirl-icon--size-24' fill='none' height='24' part='icon' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.59999 17.4C8.38333 17.1834 8.27499 16.9167 8.27499 16.6C8.27499 16.2834 8.38333 16.0167 8.59999 15.8L12.4 12L8.59999 8.20002C8.38333 7.98336 8.27499 7.71669 8.27499 7.40002C8.27499 7.08336 8.38333 6.81669 8.59999 6.60002C8.81666 6.38336 9.08333 6.27502 9.39999 6.27502C9.71666 6.27502 9.98333 6.38336 10.2 6.60002L14.8 11.2C14.9167 11.3167 15 11.4417 15.05 11.575C15.1 11.7084 15.125 11.85 15.125 12C15.125 12.15 15.1 12.2917 15.05 12.425C15 12.5584 14.9167 12.6834 14.8 12.8L10.2 17.4C9.98333 17.6167 9.71666 17.725 9.39999 17.725C9.08333 17.725 8.81666 17.6167 8.59999 17.4Z' fill='currentColor'%3E%3C/path%3E%3C/svg%3E")}.date-picker__previous-month-button{order:2}.date-picker__previous-month-button:after{-webkit-mask-image:url("data:image/svg+xml,%3Csvg class='swirl-icon swirl-icon--size-24' fill='none' height='24' part='icon' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.2 17.4L8.59999 12.8C8.48333 12.6834 8.39999 12.5584 8.34999 12.425C8.29999 12.2917 8.27499 12.15 8.27499 12C8.27499 11.85 8.29999 11.7084 8.34999 11.575C8.39999 11.4417 8.48333 11.3167 8.59999 11.2L13.2 6.60002C13.4167 6.38336 13.6833 6.27502 14 6.27502C14.3167 6.27502 14.5833 6.38336 14.8 6.60002C15.0167 6.81669 15.125 7.08336 15.125 7.40002C15.125 7.71669 15.0167 7.98336 14.8 8.20002L11 12L14.8 15.8C15.0167 16.0167 15.125 16.2834 15.125 16.6C15.125 16.9167 15.0167 17.1834 14.8 17.4C14.5833 17.6167 14.3167 17.725 14 17.725C13.6833 17.725 13.4167 17.6167 13.2 17.4Z' fill='currentColor'%3E%3C/path%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg class='swirl-icon swirl-icon--size-24' fill='none' height='24' part='icon' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.2 17.4L8.59999 12.8C8.48333 12.6834 8.39999 12.5584 8.34999 12.425C8.29999 12.2917 8.27499 12.15 8.27499 12C8.27499 11.85 8.29999 11.7084 8.34999 11.575C8.39999 11.4417 8.48333 11.3167 8.59999 11.2L13.2 6.60002C13.4167 6.38336 13.6833 6.27502 14 6.27502C14.3167 6.27502 14.5833 6.38336 14.8 6.60002C15.0167 6.81669 15.125 7.08336 15.125 7.40002C15.125 7.71669 15.0167 7.98336 14.8 8.20002L11 12L14.8 15.8C15.0167 16.0167 15.125 16.2834 15.125 16.6C15.125 16.9167 15.0167 17.1834 14.8 17.4C14.5833 17.6167 14.3167 17.725 14 17.725C13.6833 17.725 13.4167 17.6167 13.2 17.4Z' fill='currentColor'%3E%3C/path%3E%3C/svg%3E")}.date-picker__month-select,.date-picker__year-select{margin:0;padding:0;border:none;background-color:transparent;font:inherit;font-size:var(--s-font-size-base);font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-base);text-align:left;cursor:pointer}.date-picker__month-select:focus:not(:focus-visible),.date-picker__year-select:focus:not(:focus-visible){outline:none}.date-picker__month-select:focus-visible,.date-picker__year-select:focus-visible{outline-color:var(--s-focus-default);outline-offset:var(--s-space-2)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.date-picker__month-select,.date-picker__year-select{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.date-picker__month-select{-webkit-appearance:none;-moz-appearance:none;appearance:none}.date-picker__year-select{max-width:4rem}.date-picker__calendar{display:block;width:100%}.date-picker__calendar tbody{display:block}.date-picker__calendar-header{display:block}.date-picker__weekday-row,.date-picker__calendar-row{display:flex}.date-picker__weekday-row{margin-bottom:var(--s-space-8)}.date-picker__weekday{display:inline-flex;min-width:2.25rem;min-height:2.25rem;flex-basis:calc(100 / 7 * 1%);justify-content:center;align-items:center;color:var(--s-text-subdued);font-weight:var(--s-font-weight-regular)}.date-picker--fixed-aspect-ratio .date-picker__weekday{aspect-ratio:1}.date-picker__date{position:relative;z-index:1;display:inline-flex;min-width:2.25rem;min-height:2.25rem;flex-basis:calc(100 / 7 * 1%);justify-content:center;align-items:center;font-weight:var(--s-font-weight-medium);cursor:pointer}.date-picker__date:before{position:absolute;z-index:-1;border-radius:50%;background-color:transparent;content:"";inset:0;aspect-ratio:1;width:-
|
|
5
|
+
const swirlDatePickerCss = () => `:host{display:block}:host *{box-sizing:border-box}.date-picker{padding:var(--s-space-8) var(--s-space-16);background-color:transparent;font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm);letter-spacing:var(--s-letter-spacing-tighter)}@media (min-width: 768px){.date-picker--fixed-max-width .date-picker{max-width:17.5rem}}.date-picker__header{display:flex;margin-bottom:var(--s-space-8);align-items:center}.date-picker__current-month{display:flex;padding:var(--s-space-8);flex-grow:1;align-items:center;order:1;gap:var(--s-space-4)}.date-picker__next-month-button,.date-picker__previous-month-button{position:relative;display:inline-flex;width:2.5rem;height:2.5rem;margin:0;padding:0;flex-shrink:0;justify-content:center;align-items:center;border:none;border-radius:50%;color:var(--s-icon-highlight);background-color:transparent;cursor:pointer}.date-picker__next-month-button:after,.date-picker__previous-month-button:after{position:absolute;background-color:currentColor;content:"";inset:0;-webkit-mask-position:center center;mask-position:center center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}.date-picker__next-month-button:hover,.date-picker__previous-month-button:hover{background-color:var(--s-state-hovered)}.date-picker__next-month-button:active,.date-picker__previous-month-button:active{background-color:var(--s-state-pressed)}.date-picker__next-month-button:focus:not(:focus-visible),.date-picker__previous-month-button:focus:not(:focus-visible){outline:none}.date-picker__next-month-button:focus-visible,.date-picker__previous-month-button:focus-visible{outline-color:var(--s-focus-default);outline-offset:var(--s-space-2)}.date-picker__next-month-button>svg,.date-picker__previous-month-button>svg{display:none}.date-picker__next-month-button{order:3}.date-picker__next-month-button:after{-webkit-mask-image:url("data:image/svg+xml,%3Csvg class='swirl-icon swirl-icon--size-24' fill='none' height='24' part='icon' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.59999 17.4C8.38333 17.1834 8.27499 16.9167 8.27499 16.6C8.27499 16.2834 8.38333 16.0167 8.59999 15.8L12.4 12L8.59999 8.20002C8.38333 7.98336 8.27499 7.71669 8.27499 7.40002C8.27499 7.08336 8.38333 6.81669 8.59999 6.60002C8.81666 6.38336 9.08333 6.27502 9.39999 6.27502C9.71666 6.27502 9.98333 6.38336 10.2 6.60002L14.8 11.2C14.9167 11.3167 15 11.4417 15.05 11.575C15.1 11.7084 15.125 11.85 15.125 12C15.125 12.15 15.1 12.2917 15.05 12.425C15 12.5584 14.9167 12.6834 14.8 12.8L10.2 17.4C9.98333 17.6167 9.71666 17.725 9.39999 17.725C9.08333 17.725 8.81666 17.6167 8.59999 17.4Z' fill='currentColor'%3E%3C/path%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg class='swirl-icon swirl-icon--size-24' fill='none' height='24' part='icon' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8.59999 17.4C8.38333 17.1834 8.27499 16.9167 8.27499 16.6C8.27499 16.2834 8.38333 16.0167 8.59999 15.8L12.4 12L8.59999 8.20002C8.38333 7.98336 8.27499 7.71669 8.27499 7.40002C8.27499 7.08336 8.38333 6.81669 8.59999 6.60002C8.81666 6.38336 9.08333 6.27502 9.39999 6.27502C9.71666 6.27502 9.98333 6.38336 10.2 6.60002L14.8 11.2C14.9167 11.3167 15 11.4417 15.05 11.575C15.1 11.7084 15.125 11.85 15.125 12C15.125 12.15 15.1 12.2917 15.05 12.425C15 12.5584 14.9167 12.6834 14.8 12.8L10.2 17.4C9.98333 17.6167 9.71666 17.725 9.39999 17.725C9.08333 17.725 8.81666 17.6167 8.59999 17.4Z' fill='currentColor'%3E%3C/path%3E%3C/svg%3E")}.date-picker__previous-month-button{order:2}.date-picker__previous-month-button:after{-webkit-mask-image:url("data:image/svg+xml,%3Csvg class='swirl-icon swirl-icon--size-24' fill='none' height='24' part='icon' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.2 17.4L8.59999 12.8C8.48333 12.6834 8.39999 12.5584 8.34999 12.425C8.29999 12.2917 8.27499 12.15 8.27499 12C8.27499 11.85 8.29999 11.7084 8.34999 11.575C8.39999 11.4417 8.48333 11.3167 8.59999 11.2L13.2 6.60002C13.4167 6.38336 13.6833 6.27502 14 6.27502C14.3167 6.27502 14.5833 6.38336 14.8 6.60002C15.0167 6.81669 15.125 7.08336 15.125 7.40002C15.125 7.71669 15.0167 7.98336 14.8 8.20002L11 12L14.8 15.8C15.0167 16.0167 15.125 16.2834 15.125 16.6C15.125 16.9167 15.0167 17.1834 14.8 17.4C14.5833 17.6167 14.3167 17.725 14 17.725C13.6833 17.725 13.4167 17.6167 13.2 17.4Z' fill='currentColor'%3E%3C/path%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg class='swirl-icon swirl-icon--size-24' fill='none' height='24' part='icon' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.2 17.4L8.59999 12.8C8.48333 12.6834 8.39999 12.5584 8.34999 12.425C8.29999 12.2917 8.27499 12.15 8.27499 12C8.27499 11.85 8.29999 11.7084 8.34999 11.575C8.39999 11.4417 8.48333 11.3167 8.59999 11.2L13.2 6.60002C13.4167 6.38336 13.6833 6.27502 14 6.27502C14.3167 6.27502 14.5833 6.38336 14.8 6.60002C15.0167 6.81669 15.125 7.08336 15.125 7.40002C15.125 7.71669 15.0167 7.98336 14.8 8.20002L11 12L14.8 15.8C15.0167 16.0167 15.125 16.2834 15.125 16.6C15.125 16.9167 15.0167 17.1834 14.8 17.4C14.5833 17.6167 14.3167 17.725 14 17.725C13.6833 17.725 13.4167 17.6167 13.2 17.4Z' fill='currentColor'%3E%3C/path%3E%3C/svg%3E")}.date-picker__month-select,.date-picker__year-select{margin:0;padding:0;border:none;background-color:transparent;font:inherit;font-size:var(--s-font-size-base);font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-base);text-align:left;cursor:pointer}.date-picker__month-select:focus:not(:focus-visible),.date-picker__year-select:focus:not(:focus-visible){outline:none}.date-picker__month-select:focus-visible,.date-picker__year-select:focus-visible{outline-color:var(--s-focus-default);outline-offset:var(--s-space-2)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.date-picker__month-select,.date-picker__year-select{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.date-picker__month-select{-webkit-appearance:none;-moz-appearance:none;appearance:none}.date-picker__year-select{max-width:4rem}.date-picker__calendar{display:block;width:100%}.date-picker__calendar tbody{display:block}.date-picker__calendar-header{display:block}.date-picker__weekday-row,.date-picker__calendar-row{display:flex}.date-picker__weekday-row{margin-bottom:var(--s-space-8)}.date-picker__weekday{display:inline-flex;min-width:2.25rem;min-height:2.25rem;flex-basis:calc(100 / 7 * 1%);justify-content:center;align-items:center;color:var(--s-text-subdued);font-weight:var(--s-font-weight-regular)}.date-picker--fixed-aspect-ratio .date-picker__weekday{aspect-ratio:1}.date-picker__date{position:relative;z-index:1;display:inline-flex;min-width:2.25rem;min-height:2.25rem;flex-basis:calc(100 / 7 * 1%);justify-content:center;align-items:center;font-weight:var(--s-font-weight-medium);cursor:pointer}.date-picker__date:before{position:absolute;z-index:-1;border-radius:50%;background-color:transparent;content:"";inset:0;aspect-ratio:1;width:-moz-fit-content;width:fit-content;margin:auto}.date-picker__date:hover:before{background-color:var(--s-state-hovered)}.date-picker--fixed-aspect-ratio .date-picker__date{aspect-ratio:1}.date-picker__date--current:before{background-color:var(--s-state-hovered)}.date-picker__date--current:focus:not(:focus-visible){outline:none}.date-picker__date--current:focus-visible{outline-color:var(--s-focus-default);outline-offset:var(--s-space-2)}.date-picker__date--overflowing{color:var(--s-text-subdued)}.date-picker__date--selected{color:var(--s-text-on-action-primary)}.date-picker__date--selected:before{background-color:var(--s-action-primary-default)}.date-picker__date--selected:hover{color:var(--s-text-on-action-primary)}.date-picker__date--selected:hover:before{background-color:var(--s-action-primary-hovered)}.date-picker__date--selected>strong{font-weight:var(--s-font-weight-medium)}.date-picker__date--in-range:not(.date-picker__date--selected):after{position:absolute;border-radius:0px;background-color:var(--s-action-primary-default);content:"";opacity:0.2;inset:0.0625rem 0px}.date-picker__date--start:not(.date-picker__date--end){color:var(--s-text-on-action-primary)}.date-picker__date--start:not(.date-picker__date--end):before{background-color:var(--s-action-primary-default)}.date-picker__date--start:not(.date-picker__date--end):after{position:absolute;z-index:-1;border-radius:0;background-color:var(--s-action-primary-default);content:"";opacity:0.2;inset:0.0625rem 0 0.0625rem 50%}.date-picker__date--end:not(.date-picker__date--start){color:var(--s-text-on-action-primary)}.date-picker__date--end:not(.date-picker__date--start):before{background-color:var(--s-action-primary-default)}.date-picker__date--end:not(.date-picker__date--start):after{position:absolute;z-index:-1;border-radius:0;background-color:var(--s-action-primary-default);content:"";opacity:0.2;inset:0.0625rem 50% 0.0625rem 0}.date-picker__date--today:before{box-shadow:inset 0 0 0 var(--s-border-width-default) var(--s-border-highlight)}.date-picker__date--today>em{font-style:normal}.date-picker__date--disabled{color:var(--s-text-disabled);cursor:default;pointer-events:none}.date-picker__date--disabled:before{background-color:transparent}.date-picker__date--disabled:hover{color:var(--s-text-disabled)}.date-picker__date--disabled:hover:before{background-color:transparent}`;
|
|
6
6
|
|
|
7
7
|
const SwirlDatePicker = class {
|
|
8
8
|
constructor(hostRef) {
|