@getflip/swirl-components 0.140.1 → 0.142.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 +46 -3
- package/dist/cjs/{floating-ui.dom.esm-39236b6a.js → floating-ui.dom.esm-d4123549.js} +72 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/swirl-action-list_3.cjs.entry.js +1 -1
- package/dist/cjs/swirl-autocomplete.cjs.entry.js +1 -1
- package/dist/cjs/swirl-components.cjs.js +1 -1
- package/dist/cjs/swirl-date-input.cjs.entry.js +2 -1
- package/dist/cjs/swirl-date-picker_2.cjs.entry.js +2 -1
- package/dist/cjs/swirl-description-list-item.cjs.entry.js +1 -1
- package/dist/cjs/swirl-menu.cjs.entry.js +1 -1
- package/dist/cjs/swirl-popover_2.cjs.entry.js +2 -2
- package/dist/cjs/swirl-tooltip.cjs.entry.js +31 -38
- package/dist/cjs/wc-datepicker.cjs.entry.js +2 -0
- package/dist/collection/assets/pdfjs/pdf.worker.min.js +22 -0
- package/dist/collection/components/swirl-action-list/swirl-action-list.js +1 -1
- package/dist/collection/components/swirl-action-list/swirl-action-list.spec.js +1 -1
- package/dist/collection/components/swirl-date-input/swirl-date-input.js +20 -1
- package/dist/collection/components/swirl-date-input/swirl-date-input.spec.js +1 -1
- package/dist/collection/components/swirl-date-picker/swirl-date-picker.js +20 -1
- package/dist/collection/components/swirl-date-picker/swirl-date-picker.spec.js +1 -1
- package/dist/collection/components/swirl-description-list-item/swirl-description-list-item.js +1 -1
- package/dist/collection/components/swirl-popover/swirl-popover.css +15 -1
- package/dist/collection/components/swirl-popover/swirl-popover.js +1 -1
- package/dist/collection/components/swirl-tooltip/swirl-tooltip.css +36 -10
- package/dist/collection/components/swirl-tooltip/swirl-tooltip.js +32 -38
- package/dist/collection/components/swirl-tooltip/swirl-tooltip.spec.js +14 -12
- package/dist/collection/components/swirl-tooltip/swirl-tooltip.stories.js +2 -2
- package/dist/components/assets/pdfjs/pdf.worker.min.js +22 -0
- package/dist/components/floating-ui.dom.esm.js +72 -1
- package/dist/components/swirl-action-list2.js +1 -1
- package/dist/components/swirl-date-input.js +3 -1
- package/dist/components/swirl-date-picker2.js +3 -1
- package/dist/components/swirl-description-list-item.js +1 -1
- package/dist/components/swirl-popover2.js +1 -1
- package/dist/components/swirl-tooltip2.js +32 -38
- package/dist/components/wc-datepicker2.js +2 -0
- package/dist/esm/{floating-ui.dom.esm-ac7cc24e.js → floating-ui.dom.esm-b73e243b.js} +72 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/swirl-action-list_3.entry.js +1 -1
- package/dist/esm/swirl-autocomplete.entry.js +1 -1
- package/dist/esm/swirl-components.js +1 -1
- package/dist/esm/swirl-date-input.entry.js +2 -1
- package/dist/esm/swirl-date-picker_2.entry.js +2 -1
- package/dist/esm/swirl-description-list-item.entry.js +1 -1
- package/dist/esm/swirl-menu.entry.js +1 -1
- package/dist/esm/swirl-popover_2.entry.js +2 -2
- package/dist/esm/swirl-tooltip.entry.js +32 -39
- package/dist/esm/wc-datepicker.entry.js +2 -0
- package/dist/swirl-components/{p-987c3e53.entry.js → p-078fe179.entry.js} +1 -1
- package/dist/swirl-components/p-1cd56d3d.entry.js +1 -0
- package/dist/swirl-components/{p-f7b251f0.entry.js → p-2014f17b.entry.js} +1 -1
- package/dist/swirl-components/p-48d784ee.entry.js +1 -0
- package/dist/swirl-components/p-6ac4b552.js +1 -0
- package/dist/swirl-components/p-85eeb993.entry.js +1 -0
- package/dist/swirl-components/p-a4a1555e.entry.js +1 -0
- package/dist/swirl-components/p-d0be5bf2.entry.js +1 -0
- package/dist/swirl-components/p-ea43de20.entry.js +1 -0
- package/dist/swirl-components/p-edcaa933.entry.js +1 -0
- package/dist/swirl-components/swirl-components.esm.js +1 -1
- package/dist/types/components/swirl-date-input/swirl-date-input.d.ts +1 -0
- package/dist/types/components/swirl-date-picker/swirl-date-picker.d.ts +1 -0
- package/dist/types/components/swirl-popover/swirl-popover.d.ts +1 -1
- package/dist/types/components/swirl-tooltip/swirl-tooltip.d.ts +5 -2
- package/dist/types/components.d.ts +4 -0
- package/package.json +2 -2
- package/vscode-data.json +11 -0
- package/dist/swirl-components/p-03034505.entry.js +0 -1
- package/dist/swirl-components/p-168cf499.entry.js +0 -1
- package/dist/swirl-components/p-1e9e369f.entry.js +0 -1
- package/dist/swirl-components/p-1f4c0d73.entry.js +0 -1
- package/dist/swirl-components/p-4beaf463.entry.js +0 -1
- package/dist/swirl-components/p-562de2fb.entry.js +0 -1
- package/dist/swirl-components/p-77dfa273.entry.js +0 -1
- package/dist/swirl-components/p-ecb8b7f5.js +0 -1
package/vscode-data.json
CHANGED
|
@@ -1832,6 +1832,10 @@
|
|
|
1832
1832
|
"name": "disabled",
|
|
1833
1833
|
"description": ""
|
|
1834
1834
|
},
|
|
1835
|
+
{
|
|
1836
|
+
"name": "first-day-of-week",
|
|
1837
|
+
"description": ""
|
|
1838
|
+
},
|
|
1835
1839
|
{
|
|
1836
1840
|
"name": "format",
|
|
1837
1841
|
"description": ""
|
|
@@ -1873,6 +1877,10 @@
|
|
|
1873
1877
|
"value": ""
|
|
1874
1878
|
},
|
|
1875
1879
|
"attributes": [
|
|
1880
|
+
{
|
|
1881
|
+
"name": "first-day-of-week",
|
|
1882
|
+
"description": ""
|
|
1883
|
+
},
|
|
1876
1884
|
{
|
|
1877
1885
|
"name": "locale",
|
|
1878
1886
|
"description": ""
|
|
@@ -5113,6 +5121,9 @@
|
|
|
5113
5121
|
"name": "animation",
|
|
5114
5122
|
"description": "",
|
|
5115
5123
|
"values": [
|
|
5124
|
+
{
|
|
5125
|
+
"name": "fade-in"
|
|
5126
|
+
},
|
|
5116
5127
|
{
|
|
5117
5128
|
"name": "scale-in-xy"
|
|
5118
5129
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,h as t,H as s,g as e}from"./p-e5528e8a.js";import{c as o}from"./p-b7898321.js";const r=class{constructor(t){i(this,t),this.bordered=!0,this.maxWidth=void 0,this.term=void 0,this.tooltip=void 0}render(){const i=Boolean(this.el.querySelector('[slot="tools"]')),e=o("description-list-item",{"description-list-item--bordered":this.bordered,"description-list-item--has-tools":i});return t(s,{role:"listitem"},t("div",{class:e,part:"description-list-item",role:"group"},t("div",{class:"description-list-item__text-container"},t("div",{class:"description-list-item__term",part:"description-list-item__term",role:"term"},this.term,this.tooltip&&t("span",{class:"description-list-item__tooltip"},t("swirl-tooltip",{content:this.tooltip,position:"right"},t("swirl-icon-info",{size:16})))),t("div",{style:{maxWidth:this.maxWidth},class:"description-list-item__description",role:"definition"},t("slot",null))),t("div",{class:"description-list-item__tools"},t("slot",{name:"tools"}))))}get el(){return e(this)}};r.style=":host{display:block}:host *{box-sizing:border-box}.description-list-item{display:flex;max-width:100%;padding-top:var(--s-space-8);padding-bottom:var(--s-space-8);align-items:center;color:var(--s-text-default);line-height:var(--s-line-height-base);justfiy-content:space-between;gap:var(--s-space-16)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.description-list-item{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.description-list-item--bordered{padding-top:var(--s-space-16);padding-bottom:var(--s-space-16);border-bottom:var(--s-border-width-default) solid var(--s-border-default)}.description-list-item:not(.description-list-item--has-tools) .description-list-item__tools{display:none}.description-list-item__text-container{flex-grow:1}.description-list-item__term{display:block;margin-bottom:var(--s-space-4);font-weight:var(--s-font-weight-semibold);overflow-wrap:break-word}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.description-list-item__term{margin-bottom:var(--s-space-2)}}.description-list-item__tooltip{display:inline-flex;vertical-align:middle;margin-left:var(--s-space-4)}.description-list-item__description{display:block;max-width:40rem;margin:0;overflow-wrap:break-word}.description-list-item__tools{flex-shrink:0}";export{r as swirl_description_list_item}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as r,H as a,g as i,F as o}from"./p-e5528e8a.js";import{r as s}from"./p-6e4e9ae0.js";import{c as n}from"./p-b7898321.js";const c=class{constructor(r){e(this,r),this.valueChange=t(this,"valueChange",3),this.onClick=e=>{e.stopPropagation(),e.preventDefault()},this.onSelectDate=e=>{this.valueChange.emit("string"==typeof e.detail?s(new Date(e.detail)):e.detail.map((e=>s(new Date(e)))))},this.labels=void 0,this.locale="en-US",this.range=void 0,this.startDate=void 0,this.value=void 0}render(){const e=this.startDate instanceof Date?this.startDate.toISOString():void 0;return r(a,{onClick:this.onClick},r("wc-datepicker",{elementClassName:"date-picker",labels:this.labels,locale:this.locale,onSelectDate:this.onSelectDate,range:this.range,startDate:e,value:this.value}))}get el(){return i(this)}};c.style=":host{display:block}:host *{box-sizing:border-box}.date-picker{padding:var(--s-space-8) var(--s-space-16);background-color:var(--s-surface-overlay-default);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{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-surface-overlay-hovered)}.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:var(--s-surface-overlay-default);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;flex-basis:calc(100 / 7 * 1%);justify-content:center;align-items:center;color:var(--s-text-subdued);font-weight:var(--s-font-weight-regular);aspect-ratio:1}.date-picker__date{position:relative;z-index:1;display:inline-flex;min-width:2.25rem;flex-basis:calc(100 / 7 * 1%);justify-content:center;align-items:center;font-weight:var(--s-font-weight-medium);cursor:pointer;aspect-ratio:1}.date-picker__date:before{position:absolute;z-index:-1;border-radius:50%;background-color:transparent;content:\"\";inset:0}.date-picker__date:hover:before{background-color:var(--s-surface-overlay-hovered)}.date-picker__date--current:before{background-color:var(--s-surface-overlay-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--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--overflowing{color:var(--s-text-subdued)}.date-picker__date--today:before{box-shadow:inset 0 0 0 var(--s-border-width-default)\n var(--s-border-highlight)}.date-picker__date--today>em{font-style:normal}";const d=class{constructor(t){e(this,t),this.size=24}render(){const e=20===this.size?24:this.size,t=n("swirl-icon",`swirl-icon--size-${this.size}`);return r("svg",{class:t,fill:"none",height:this.size,part:"icon",viewBox:`0 0 ${e} ${e}`,width:this.size,xmlns:"http://www.w3.org/2000/svg"},16===this.size&&r(o,null,r("path",{d:"M6 11C5.53333 11 5.13889 10.8389 4.81667 10.5167C4.49444 10.1945 4.33333 9.80004 4.33333 9.33337C4.33333 8.86671 4.49444 8.47226 4.81667 8.15004C5.13889 7.82782 5.53333 7.66671 6 7.66671C6.46667 7.66671 6.86111 7.82782 7.18333 8.15004C7.50556 8.47226 7.66667 8.86671 7.66667 9.33337C7.66667 9.80004 7.50556 10.1945 7.18333 10.5167C6.86111 10.8389 6.46667 11 6 11ZM3.33333 14.6667C2.96667 14.6667 2.65267 14.5363 2.39133 14.2754C2.13044 14.014 2 13.7 2 13.3334V4.00004C2 3.63337 2.13044 3.3196 2.39133 3.05871C2.65267 2.79737 2.96667 2.66671 3.33333 2.66671H4V2.00004C4 1.81115 4.06378 1.65271 4.19133 1.52471C4.31933 1.39715 4.47778 1.33337 4.66667 1.33337C4.85556 1.33337 5.014 1.39715 5.142 1.52471C5.26956 1.65271 5.33333 1.81115 5.33333 2.00004V2.66671H10.6667V2.00004C10.6667 1.81115 10.7307 1.65271 10.8587 1.52471C10.9862 1.39715 11.1444 1.33337 11.3333 1.33337C11.5222 1.33337 11.6804 1.39715 11.808 1.52471C11.936 1.65271 12 1.81115 12 2.00004V2.66671H12.6667C13.0333 2.66671 13.3473 2.79737 13.6087 3.05871C13.8696 3.3196 14 3.63337 14 4.00004V13.3334C14 13.7 13.8696 14.014 13.6087 14.2754C13.3473 14.5363 13.0333 14.6667 12.6667 14.6667H3.33333ZM3.33333 13.3334H12.6667V6.66671H3.33333V13.3334Z",fill:"currentColor"})),(20===this.size||24===this.size)&&r(o,null,r("path",{d:"M9 16.5C8.3 16.5 7.70833 16.2583 7.225 15.775C6.74167 15.2917 6.5 14.7 6.5 14C6.5 13.3 6.74167 12.7083 7.225 12.225C7.70833 11.7417 8.3 11.5 9 11.5C9.7 11.5 10.2917 11.7417 10.775 12.225C11.2583 12.7083 11.5 13.3 11.5 14C11.5 14.7 11.2583 15.2917 10.775 15.775C10.2917 16.2583 9.7 16.5 9 16.5ZM5 22C4.45 22 3.979 21.8043 3.587 21.413C3.19567 21.021 3 20.55 3 20V6C3 5.45 3.19567 4.97933 3.587 4.588C3.979 4.196 4.45 4 5 4H6V3C6 2.71667 6.09567 2.479 6.287 2.287C6.479 2.09567 6.71667 2 7 2C7.28333 2 7.521 2.09567 7.713 2.287C7.90433 2.479 8 2.71667 8 3V4H16V3C16 2.71667 16.096 2.479 16.288 2.287C16.4793 2.09567 16.7167 2 17 2C17.2833 2 17.5207 2.09567 17.712 2.287C17.904 2.479 18 2.71667 18 3V4H19C19.55 4 20.021 4.196 20.413 4.588C20.8043 4.97933 21 5.45 21 6V20C21 20.55 20.8043 21.021 20.413 21.413C20.021 21.8043 19.55 22 19 22H5ZM5 20H19V10H5V20Z",fill:"currentColor"})),28===this.size&&r(o,null,r("path",{d:"M10.5 19.25C9.68333 19.25 8.99306 18.9681 8.42917 18.4042C7.86528 17.8403 7.58333 17.15 7.58333 16.3334C7.58333 15.5167 7.86528 14.8264 8.42917 14.2625C8.99306 13.6987 9.68333 13.4167 10.5 13.4167C11.3167 13.4167 12.0069 13.6987 12.5708 14.2625C13.1347 14.8264 13.4167 15.5167 13.4167 16.3334C13.4167 17.15 13.1347 17.8403 12.5708 18.4042C12.0069 18.9681 11.3167 19.25 10.5 19.25ZM5.83333 25.6667C5.19167 25.6667 4.64217 25.4384 4.18483 24.9819C3.72828 24.5245 3.5 23.975 3.5 23.3334V7.00004C3.5 6.35837 3.72828 5.80926 4.18483 5.35271C4.64217 4.89537 5.19167 4.66671 5.83333 4.66671H7V3.50004C7 3.16949 7.11161 2.89221 7.33483 2.66821C7.55883 2.44499 7.83611 2.33337 8.16667 2.33337C8.49722 2.33337 8.7745 2.44499 8.9985 2.66821C9.22172 2.89221 9.33333 3.16949 9.33333 3.50004V4.66671H18.6667V3.50004C18.6667 3.16949 18.7787 2.89221 19.0027 2.66821C19.2259 2.44499 19.5028 2.33337 19.8333 2.33337C20.1639 2.33337 20.4408 2.44499 20.664 2.66821C20.888 2.89221 21 3.16949 21 3.50004V4.66671H22.1667C22.8083 4.66671 23.3578 4.89537 23.8152 5.35271C24.2717 5.80926 24.5 6.35837 24.5 7.00004V23.3334C24.5 23.975 24.2717 24.5245 23.8152 24.9819C23.3578 25.4384 22.8083 25.6667 22.1667 25.6667H5.83333ZM5.83333 23.3334H22.1667V11.6667H5.83333V23.3334Z",fill:"currentColor"})))}};d.style=":host{display:inline-flex}";export{c as swirl_date_picker,d as swirl_icon_today}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as e,g as a}from"./p-e5528e8a.js";import{c as n}from"./p-b7898321.js";import{p as o,i as d,f as r,m as h}from"./p-6339561b.js";import{g as p}from"./p-6e4e9ae0.js";const l="yyyy-MM-dd",u=class{constructor(s){t(this,s),this.invalidInput=i(this,"invalidInput",7),this.valueChange=i(this,"valueChange",7),this.desktopMediaQuery=p(),this.desktopMediaQueryHandler=t=>{this.updateIconSize(t.matches)},this.onChange=t=>{const i=t.target.value;""===i&&(this.value=void 0,this.valueChange.emit(void 0));const s=o(i,this.format,new Date),e=this.format.replace(/\\/g,"\\\\"),a=new RegExp(`^${e.replace(/[ydM]/g,"\\d")}$`);if(!Boolean(i.match(a)))return;if(!d(s))return void this.invalidInput.emit(i);const n=r(s,l);this.value=n,this.valueChange.emit(n)},this.onInput=t=>{this.onChange(t)},this.onClick=t=>{t.preventDefault()},this.onFocus=t=>{this.handleAutoSelect(t)},this.onPickDate=t=>{const i=r(t.detail,l);this.value=i,this.valueChange.emit(i),this.pickerPopover.close()},this.autoFocus=void 0,this.autoSelect=void 0,this.datePickerLabel="Date picker",this.datePickerTriggerLabel="Open date picker",this.disabled=void 0,this.format="yyyy-MM-dd",this.inline=void 0,this.invalid=void 0,this.labels=void 0,this.locale="en-US",this.placeholder="yyyy-mm-dd",this.required=void 0,this.swirlAriaDescribedby=void 0,this.value=void 0,this.iconSize=24}componentWillLoad(){const t=Array.from(document.querySelectorAll("swirl-date-input")).indexOf(this.el);this.id=`swirl-date-input-${t}`}componentDidLoad(){this.setupMask(),this.updateIconSize(this.desktopMediaQuery.matches),this.desktopMediaQuery.onchange=this.desktopMediaQueryHandler,this.autoFocus&&setTimeout((()=>{this.inputEl.focus()}))}disconnectedCallback(){this.mask?.destroy(),this.desktopMediaQuery.removeEventListener?.("change",this.desktopMediaQueryHandler)}watchFormat(){this.setupMask()}updateIconSize(t){this.iconSize=t?20:24}handleAutoSelect(t){this.autoSelect&&t.target.select()}setupMask(){this.mask?.destroy(),this.mask=h.create(`#${this.id}`,{mask:this.format.replace(/[ydM]/g,"#")})}render(){const t=!0===this.invalid||!1===this.invalid?String(this.invalid):void 0,i=Boolean(this.value)?o(this.value,l,new Date):void 0,a=d(i)?r(i,this.format):void 0,h=n("date-input",{"date-input--inline":this.inline});return s(e,null,s("div",{class:h},s("input",{"aria-describedby":this.swirlAriaDescribedby,"aria-disabled":this.disabled?"true":void 0,"aria-invalid":t,autoFocus:this.autoFocus,class:"date-input__input",disabled:this.disabled,id:this.id,onClick:this.onClick,onFocus:this.onFocus,onInput:this.onInput,placeholder:this.placeholder,ref:t=>this.inputEl=t,required:this.required,type:"text",value:a}),s("swirl-popover-trigger",{popover:`popover-${this.id}`},s("button",{"aria-label":this.datePickerTriggerLabel,class:"date-input__date-picker-button",disabled:this.disabled,type:"button"},s("swirl-icon-today",{size:this.iconSize})))),!this.disabled&&s("swirl-popover",{animation:"scale-in-y",id:`popover-${this.id}`,label:this.datePickerLabel,placement:"bottom-end",ref:t=>this.pickerPopover=t},s("swirl-date-picker",{labels:this.labels,locale:this.locale,onValueChange:this.onPickDate,value:i})))}get el(){return a(this)}static get watchers(){return{format:["watchFormat"]}}};u.style=".sc-swirl-date-input-h{display:flex;width:100%}.sc-swirl-date-input-h *.sc-swirl-date-input{box-sizing:border-box}.date-input.sc-swirl-date-input{position:relative;display:flex;width:100%;align-items:center;color:var(--s-text-default);line-height:var(--s-line-height-sm)}.date-input--inline.sc-swirl-date-input .date-input__date-picker-button.sc-swirl-date-input{top:-0.0625rem}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.date-input--inline.sc-swirl-date-input .date-input__date-picker-button.sc-swirl-date-input{top:0}}.date-input__input.sc-swirl-date-input{display:inline-flex;width:calc(100% - 1.25rem - var(--s-space-8));margin:0;padding:0;border:none;color:var(--s-text-default);background-color:transparent;font:inherit;font-size:var(--s-font-size-base);line-height:var(--s-line-height-base);caret-color:var(--s-border-highlight)}.date-input__input.sc-swirl-date-input:focus{outline:none}.date-input__input.sc-swirl-date-input:disabled{color:var(--s-text-disabled);background-color:transparent}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.date-input__input.sc-swirl-date-input{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.date-input__date-picker-button.sc-swirl-date-input{position:absolute;top:calc(-1 * var(--s-space-12));right:0;display:inline-flex;margin:0;padding:0;border:none;color:var(--s-icon-default);background-color:transparent;cursor:pointer}.date-input__date-picker-button.sc-swirl-date-input:focus:not(:focus-visible){outline:none}.date-input__date-picker-button.sc-swirl-date-input:focus-visible{outline-color:var(--s-focus-default);outline-offset:var(--s-space-2)}.date-input__date-picker-button.sc-swirl-date-input:disabled{color:var(--s-icon-disabled);cursor:default}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.date-input__date-picker-button.sc-swirl-date-input{top:-0.625rem}}";export{u as swirl_date_input}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as e,g as n}from"./p-e5528e8a.js";function h(t,i){const s=new Date(t);return s.setDate(s.getDate()+i),s}function o(t){return b(new Date(`${String(g(t)).padStart(4,"0")}-${String(l(t)).padStart(2,"0")}-01`))}function a(t){if(t instanceof Date)return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}function r(t){const i=o(t);return i.setMonth(i.getMonth()+1),i.setDate(i.getDate()-1),i}function l(t){return t.getMonth()+1}function c(t){return h(t,1)}function d(t){const i=new Date(t);return i.setMonth(i.getMonth()+1),i}function u(t){const i=new Date(t);return i.setFullYear(i.getFullYear()+1),i}function v(t){return f(t,1)}function w(t){const i=new Date(t);return i.setMonth(i.getMonth()-1),i}function p(t){const i=new Date(t);return i.setFullYear(i.getFullYear()-1),i}function g(t){return t.getFullYear()}function y(t,i){return!(!t||!i)&&t.getFullYear()===i.getFullYear()&&t.getMonth()===i.getMonth()&&t.getDate()===i.getDate()}function b(t){const i=new Date(t);return i.setMinutes(i.getMinutes()+i.getTimezoneOffset()),i}function f(t,i){const s=new Date(t);return s.setDate(s.getDate()-i),s}const k={clearButton:"Clear value",monthSelect:"Select month",nextMonthButton:"Next month",nextYearButton:"Next year",picker:"Choose date",previousMonthButton:"Previous month",previousYearButton:"Previous year",todayButton:"Show today",yearSelect:"Select year"},D=class{constructor(s){t(this,s),this.selectDate=i(this,"selectDate",7),this.changeMonth=i(this,"changeMonth",7),this.disabled=!1,this.disableDate=()=>!1,this.elementClassName="wc-datepicker",this.firstDayOfWeek=0,this.labels=k,this.locale=(null===navigator||void 0===navigator?void 0:navigator.language)||"en-US",this.showClearButton=!1,this.showMonthStepper=!0,this.showTodayButton=!1,this.showYearStepper=!1,this.startDate=a(new Date),this.init=()=>{this.currentDate=this.startDate?b(new Date(this.startDate)):new Date,this.updateWeekdays()},this.nextMonth=()=>{this.updateCurrentDate(d(this.currentDate))},this.nextYear=()=>{this.updateCurrentDate(u(this.currentDate))},this.previousMonth=()=>{this.updateCurrentDate(w(this.currentDate))},this.previousYear=()=>{this.updateCurrentDate(p(this.currentDate))},this.showToday=()=>{this.updateCurrentDate(new Date)},this.clear=()=>{this.value=void 0,this.selectDate.emit(void 0)},this.onClick=t=>{if(this.disabled)return;const i=t.target.closest("[data-date]");if(!Boolean(i))return;const s=b(new Date(i.dataset.date));this.updateCurrentDate(s),this.onSelectDate(s)},this.onMonthSelect=t=>{const i=+t.target.value-1,s=new Date(this.currentDate);s.setMonth(i),this.updateCurrentDate(s)},this.onYearSelect=t=>{let i=+t.target.value;const s=t.target;isNaN(i)?(i=(new Date).getFullYear(),s.value=String(i)):i<0?(i=0,s.value=String(i)):i>9999&&(i=9999,s.value=String(i));const e=new Date(this.currentDate);e.setFullYear(i),this.updateCurrentDate(e)},this.onKeyDown=t=>{this.disabled||("ArrowLeft"===t.code?(t.preventDefault(),this.updateCurrentDate(v(this.currentDate),!0)):"ArrowRight"===t.code?(t.preventDefault(),this.updateCurrentDate(c(this.currentDate),!0)):"ArrowUp"===t.code?(t.preventDefault(),this.updateCurrentDate(f(this.currentDate,7),!0)):"ArrowDown"===t.code?(t.preventDefault(),this.updateCurrentDate(h(this.currentDate,7),!0)):"PageUp"===t.code?(t.preventDefault(),this.updateCurrentDate(t.shiftKey?p(this.currentDate):w(this.currentDate),!0)):"PageDown"===t.code?(t.preventDefault(),this.updateCurrentDate(t.shiftKey?u(this.currentDate):d(this.currentDate),!0)):"Home"===t.code?(t.preventDefault(),this.updateCurrentDate(o(this.currentDate),!0)):"End"===t.code?(t.preventDefault(),this.updateCurrentDate(r(this.currentDate),!0)):"Space"!==t.code&&"Enter"!==t.code||(t.preventDefault(),this.onSelectDate(this.currentDate)))},this.onMouseEnter=t=>{if(this.disabled)return;const i=b(new Date(t.target.closest("td").dataset.date));this.hoveredDate=i},this.onMouseLeave=()=>{this.hoveredDate=void 0}}componentWillLoad(){this.init()}watchFirstDayOfWeek(){this.updateWeekdays()}watchLocale(){Boolean(this.locale)||(this.locale=(null===navigator||void 0===navigator?void 0:navigator.language)||"en-US"),this.updateWeekdays()}watchRange(){this.value=void 0,this.selectDate.emit(void 0)}watchStartDate(){this.currentDate=this.startDate?b(new Date(this.startDate)):new Date}watchValue(){Boolean(this.value)&&(Array.isArray(this.value)&&this.value.length>=1?this.currentDate=this.value[0]:this.value instanceof Date&&(this.currentDate=this.value))}componentDidRender(){this.moveFocusAfterMonthChanged&&(this.focusDate(this.currentDate),this.moveFocusAfterMonthChanged=!1)}updateWeekdays(){var t,i;this.weekdays=(t=0===this.firstDayOfWeek?7:this.firstDayOfWeek,i=this.locale,new Array(7).fill(void 0).map(((i,s)=>(t+s)%7+1)).map((t=>{const s=b(new Date(`2006-01-0${t}`));return[Intl.DateTimeFormat(i,{weekday:"short"}).format(s),Intl.DateTimeFormat(i,{weekday:"long"}).format(s)]})))}getClassName(t){return Boolean(t)?`${this.elementClassName}__${t}`:this.elementClassName}getCalendarRows(){const t=function(t,i,s){const e=[],n=o(t),h=0===n.getDay()?7:n.getDay(),a=r(t),l=0===a.getDay()?7:a.getDay(),d=1===s?7:s-1,u=[],w=[];{let t=(7-s+h)%7,i=v(n);for(;t>0;)u.push(i),i=v(i),t-=1;u.reverse();let e=(7-l+d)%7,o=c(a);for(;e>0;)w.push(o),o=c(o),e-=1}let p=n;for(;p.getMonth()===t.getMonth();)e.push(p),p=c(p);return[...u,...e,...w]}(this.currentDate,0,0===this.firstDayOfWeek?7:this.firstDayOfWeek),i=[];for(let s=0;s<t.length;s+=7){const e=t.slice(s,s+7);i.push(e)}return i}getTitle(){if(Boolean(this.currentDate))return Intl.DateTimeFormat(this.locale,{day:"numeric",month:"long",year:"numeric"}).format(this.currentDate)}focusDate(t){var i;null===(i=this.el.querySelector(`[data-date="${a(t)}"]`))||void 0===i||i.focus()}updateCurrentDate(t,i){const s=t.getMonth(),e=t.getFullYear();e>9999||e<0||((s!==this.currentDate.getMonth()||e!==this.currentDate.getFullYear())&&(this.changeMonth.emit({month:l(t),year:g(t)}),i&&(this.moveFocusAfterMonthChanged=!0)),this.currentDate=t,i&&this.focusDate(this.currentDate))}onSelectDate(t){var i,s;if(!this.disableDate(t))if(this.isRangeValue(this.value)){const s=void 0===(null===(i=this.value)||void 0===i?void 0:i[0])||2===this.value.length?[t]:[this.value[0],t];2===s.length&&s[0]>s[1]&&s.reverse();const e=void 0===s[1]?[a(s[0])]:[a(s[0]),a(s[1])];this.value=s,this.selectDate.emit(e)}else{if((null===(s=this.value)||void 0===s?void 0:s.getTime())===t.getTime())return;this.value=t,this.selectDate.emit(a(t))}}isRangeValue(t){return this.range}render(){const t=this.showTodayButton||this.showClearButton;return s(e,null,s("div",{"aria-disabled":String(this.disabled),"aria-label":this.labels.picker,class:{[this.getClassName()]:!0,[`${this.getClassName()}--disabled`]:this.disabled},role:"group"},s("div",{class:this.getClassName("header")},s("span",{"aria-atomic":"true","aria-live":"polite",class:"visually-hidden"},this.getTitle()),this.showYearStepper&&s("button",{"aria-label":this.labels.previousYearButton,class:this.getClassName("previous-year-button"),disabled:this.disabled,innerHTML:this.previousYearButtonContent||void 0,onClick:this.previousYear,type:"button"},s("svg",{fill:"none",height:"24","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"24"},s("polyline",{points:"11 17 6 12 11 7"}),s("polyline",{points:"18 17 13 12 18 7"}))),this.showMonthStepper&&s("button",{"aria-label":this.labels.previousMonthButton,class:this.getClassName("previous-month-button"),disabled:this.disabled,innerHTML:this.previousMonthButtonContent||void 0,onClick:this.previousMonth,type:"button"},s("svg",{fill:"none",height:"24","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"24"},s("polyline",{points:"15 18 9 12 15 6"}))),s("span",{class:this.getClassName("current-month")},s("select",{"aria-label":this.labels.monthSelect,class:this.getClassName("month-select"),disabled:this.disabled,name:"month",onChange:this.onMonthSelect},(i=this.locale,new Array(12).fill(void 0).map(((t,s)=>{const e=b(new Date(`2006-${String(s+1).padStart(2,"0")}-01`));return Intl.DateTimeFormat(i,{month:"long"}).format(e)}))).map(((t,i)=>s("option",{key:t,selected:this.currentDate.getMonth()===i,value:i+1},t)))),s("input",{"aria-label":this.labels.yearSelect,class:this.getClassName("year-select"),disabled:this.disabled,max:9999,maxLength:4,min:1,name:"year",onChange:this.onYearSelect,type:"number",value:this.currentDate.getFullYear()})),this.showMonthStepper&&s("button",{"aria-label":this.labels.nextMonthButton,class:this.getClassName("next-month-button"),disabled:this.disabled,innerHTML:this.nextMonthButtonContent||void 0,onClick:this.nextMonth,type:"button"},s("svg",{fill:"none",height:"24","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"24"},s("polyline",{points:"9 18 15 12 9 6"}))),this.showYearStepper&&s("button",{"aria-label":this.labels.nextYearButton,class:this.getClassName("next-year-button"),disabled:this.disabled,innerHTML:this.nextYearButtonContent||void 0,onClick:this.nextYear,type:"button"},s("svg",{fill:"none",height:"24","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",stroke:"currentColor",viewBox:"0 0 24 24",width:"24"},s("polyline",{points:"13 17 18 12 13 7"}),s("polyline",{points:"6 17 11 12 6 7"})))),s("div",{class:this.getClassName("body")},s("table",{class:this.getClassName("calendar"),onKeyDown:this.onKeyDown,role:"grid"},s("thead",{class:this.getClassName("calendar-header")},s("tr",{class:this.getClassName("weekday-row")},this.weekdays.map((t=>s("th",{abbr:t[1],class:this.getClassName("weekday"),key:t[0],scope:"col"},s("span",null,t[0])))))),s("tbody",null,this.getCalendarRows().map((t=>{const i=`row-${t[0].getMonth()}-${t[0].getDate()}`;return s("tr",{class:this.getClassName("calendar-row"),key:i},t.map((t=>{var i,e,n,h,o;const r=y(t,this.currentDate),l=t.getMonth()!==this.currentDate.getMonth(),c=Array.isArray(this.value)?y(t,this.value[0])||y(t,this.value[1]):y(t,this.value),d=!!this.isRangeValue&&(v={from:null===(i=this.value)||void 0===i?void 0:i[0],to:(null===(e=this.value)||void 0===e?void 0:e[1])||this.hoveredDate||this.currentDate},!!((u=t)&&v&&v.from&&v.to)&&u>=(v.from<v.to?v.from:v.to)&&u<=(v.from<v.to?v.to:v.from));var u,v;const w=Boolean(null===(n=this.value)||void 0===n?void 0:n[0])?[null===(h=this.value)||void 0===h?void 0:h[0],(null===(o=this.value)||void 0===o?void 0:o[1])||this.hoveredDate].sort(((t,i)=>t-i)):[],p=this.range&&y(w[0],t),g=this.range&&y(w[1],t),b=y(t,new Date),f=this.disableDate(t),k=`cell-${t.getMonth()}-${t.getDate()}`,D={[this.getClassName("date")]:!0,[this.getClassName("date--current")]:r,[this.getClassName("date--disabled")]:f,[this.getClassName("date--overflowing")]:l,[this.getClassName("date--today")]:b,[this.getClassName("date--selected")]:c,[this.getClassName("date--in-range")]:d,[this.getClassName("date--start")]:p,[this.getClassName("date--end")]:g},m=c?"strong":b?"em":"span";return s("td",{"aria-disabled":String(f),"aria-selected":c?"true":void 0,class:D,"data-date":a(t),key:k,onClick:this.onClick,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave,role:"gridcell",tabIndex:y(t,this.currentDate)&&!this.disabled?0:-1},s(m,{"aria-hidden":"true"},t.getDate()),s("span",{class:"visually-hidden"},Intl.DateTimeFormat(this.locale,{day:"numeric",month:"long"}).format(t)))})))}))))),t&&s("div",{class:this.getClassName("footer")},this.showTodayButton&&s("button",{class:this.getClassName("today-button"),disabled:this.disabled,innerHTML:this.todayButtonContent||void 0,onClick:this.showToday,type:"button"},this.labels.todayButton),this.showClearButton&&s("button",{class:this.getClassName("clear-button"),disabled:this.disabled,innerHTML:this.clearButtonContent||void 0,onClick:this.clear,type:"button"},this.labels.clearButton))));var i}get el(){return n(this)}static get watchers(){return{firstDayOfWeek:["watchFirstDayOfWeek"],locale:["watchLocale"],range:["watchRange"],startDate:["watchStartDate"],value:["watchValue"]}}};D.style=".visually-hidden.sc-wc-datepicker{position:absolute;overflow:hidden;width:1px;height:1px;white-space:nowrap;clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%)}";export{D as wc_datepicker}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as i,H as s}from"./p-e5528e8a.js";import{c as o,a as e,o as a,s as r,f as n}from"./p-ecb8b7f5.js";const l=class{constructor(i){t(this,i),this.onKeydown=t=>{"Escape"===t.code&&this.hide()},this.reposition=async()=>{Boolean(this.referenceEl)&&Boolean(this.popperEl)&&(this.actualPosition=await o(this.referenceEl,this.popperEl,this.options))},this.show=()=>{this.visible=!0,requestAnimationFrame((()=>{this.reposition(),this.disableAutoUpdate=e(this.referenceEl,this.popperEl,this.reposition.bind(this))}))},this.showWithDelay=()=>{Boolean(this.showTimeout)&&(clearTimeout(this.showTimeout),this.showTimeout=void 0),this.showTimeout=setTimeout((()=>{this.show()}),this.delay)},this.hide=()=>{Boolean(this.showTimeout)&&(clearTimeout(this.showTimeout),this.showTimeout=void 0),this.visible=!1,this.disableAutoUpdate?.()},this.updateOptions=()=>{const t=16*+getComputedStyle(document.documentElement).getPropertyValue("--s-space-12").replace("rem","");this.options={middleware:[a(t),r(),n()],placement:this.position,strategy:"absolute"}},this.getArrowStyles=()=>"top"===this.actualPosition?.placement?{top:"100%",left:"50%",transform:"translate3d(-50%, -50%, 0) rotate(45deg)"}:"bottom"===this.actualPosition?.placement?{bottom:"100%",left:"50%",transform:"translate3d(-50%, 50%, 0) rotate(45deg)"}:"right"===this.actualPosition?.placement?{top:"50%",right:"100%",transform:"translate3d(50%, -50%, 0) rotate(45deg)"}:"left"===this.actualPosition?.placement?{top:"50%",left:"100%",transform:"translate3d(-50%, -50%, 0) rotate(45deg)"}:void 0,this.content=void 0,this.delay=300,this.position="top",this.actualPosition=void 0,this.visible=!1}watchPosition(){this.updateOptions()}onMouseEnter(){this.showWithDelay()}onMouseLeave(){this.hide()}onWindowResize(){this.reposition()}onWindowScroll(){this.reposition()}componentWillLoad(){this.reposition()}componentDidLoad(){this.updateOptions()}render(){const t=this.getArrowStyles();return i(s,{onKeydown:this.onKeydown},i("span",{class:"tooltip"},i("span",{class:"tooltip__reference","aria-describedby":"tooltip",onBlur:this.hide,onClick:this.hide,onFocus:this.show,ref:t=>this.referenceEl=t,tabIndex:0},i("slot",null)),i("span",{class:"tooltip__popper",ref:t=>this.popperEl=t,style:{top:Boolean(this.actualPosition)?`${this.actualPosition?.y}px`:"",left:Boolean(this.actualPosition)?`${this.actualPosition?.x}px`:""}},this.visible&&i("span",{class:"tooltip__bubble",id:"tooltip",part:"tooltip__bubble",role:"tooltip"},i("span",{class:"tooltip__content",innerHTML:this.content}),i("span",{class:"tooltip__arrow",style:t})))))}static get watchers(){return{position:["watchPosition"]}}};l.style=":host{display:inline-flex}:host *{box-sizing:border-box}.tooltip{display:inline-flex}.tooltip .tooltip__reference{display:inline-flex}.tooltip__popper{position:absolute;z-index:var(--s-z-40);max-width:17.5rem}.tooltip__bubble{position:relative;display:block;padding-top:var(--s-space-8);padding-right:var(--s-space-12);padding-bottom:var(--s-space-8);padding-left:var(--s-space-12);border-radius:var(--s-border-radius-sm);color:var(--s-text-on-status);background-color:var(--s-surface-neutral-default);line-height:var(--s-line-height-base);animation:tooltip-fade-in 0.2s;animation-delay:0.1s;animation-fill-mode:forwards;opacity:0}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.tooltip__bubble{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.tooltip__arrow{position:absolute;width:0.5rem;height:0.5rem;background-color:var(--s-surface-neutral-default)}@keyframes tooltip-fade-in{from{opacity:0}to{opacity:1}}";export{l as swirl_tooltip}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,h as t,H as s,g as e}from"./p-e5528e8a.js";import{q as o,a,g as r}from"./p-6e4e9ae0.js";import{c as n}from"./p-b7898321.js";const l=class{constructor(t){i(this,t),this.onKeyDown=i=>{"ArrowDown"===i.code||"ArrowRight"===i.code?(i.preventDefault(),this.focusNextItem()):"ArrowUp"!==i.code&&"ArrowLeft"!==i.code||(i.preventDefault(),this.focusPreviousItem())},this.onFocusOut=i=>{if(this.isInsidePopover)return;const t=i.relatedTarget,s=i.target,e="SWIRL-ACTION-LIST-ITEM"===s?.tagName,o=null===t||!this.el.contains(t);!this.isInsidePopover&&o&&e&&this.container.setAttribute("tabindex","0")},this.onFocus=()=>{if(this.isInsidePopover)return;this.container.removeAttribute("tabindex");const i=this.getItems(),t=this.getActiveItemIndex();t>-1?i[t]?.focus():i[0]?.focus()},this.isInsidePopover=void 0}componentDidLoad(){queueMicrotask((()=>{this.isInsidePopover=null!==this.el.closest("swirl-popover"),this.isInsidePopover||this.container.setAttribute("tabindex","0")}))}getItems(){return o(this.el,'[role="menuitem"]')}focusNextItem(){const i=this.getItems();i[(this.getActiveItemIndex()+1)%i.length].focus()}focusPreviousItem(){const i=this.getItems(),t=this.getActiveItemIndex(),s=0===t?i.length-1:t-1;i[s]?.focus()}getActiveItemIndex(){const i=this.getItems(),t=a();return i.findIndex((i=>i===t||i===t?.querySelector('[role="menuitem"]')))}render(){return t(s,null,t("div",{"aria-orientation":"vertical",class:"action-list",onFocusout:this.isInsidePopover?void 0:this.onFocusOut,onFocus:this.isInsidePopover?void 0:this.onFocus,onKeyDown:this.onKeyDown,ref:i=>this.container=i,role:"menu"},t("slot",null)))}get el(){return e(this)}};l.style=":host{display:block;width:100%}:host *{box-sizing:border-box}.action-list{background-color:var(--s-surface-overlay-default)}";const c=class{constructor(t){i(this,t),this.desktopMediaQuery=r(),this.desktopMediaQueryHandler=i=>{this.forceIconProps(i.matches)},this.badge=void 0,this.disabled=void 0,this.description=void 0,this.icon=void 0,this.intent="default",this.label=void 0,this.size="m",this.swirlAriaExpanded=void 0,this.swirlAriaHaspopup=void 0,this.suffix=void 0}componentDidLoad(){this.forceIconProps(this.desktopMediaQuery.matches),this.desktopMediaQuery.onchange=this.desktopMediaQueryHandler}componentDidRender(){this.forceIconProps(this.desktopMediaQuery.matches)}disconnectedCallback(){this.desktopMediaQuery.removeEventListener?.("change",this.desktopMediaQueryHandler)}forceIconProps(i){const t=this.iconEl?.children[0],s=this.suffixEl?.children[0];t?.setAttribute("size",i?"20":"24"),s?.setAttribute("size",i?"20":"24")}render(){const i=Boolean(this.badge),e=Boolean(this.suffix)&&!this.disabled,o=n("action-list-item",`action-list-item--intent-${this.intent}`,`action-list-item--size-${this.size}`);return t(s,null,t("button",{"aria-expanded":this.swirlAriaExpanded,"aria-haspopup":this.swirlAriaHaspopup,class:o,disabled:this.disabled,part:"action-list-item",role:"menuitem",tabIndex:-1,type:"button"},this.icon&&t("span",{class:"action-list-item__icon",innerHTML:this.icon,ref:i=>this.iconEl=i}),t("span",{class:"action-list-item__label-container"},t("span",{class:"action-list-item__label"},this.label),this.description&&t("span",{class:"action-list-item__description"},this.description)),i&&t("span",{class:"action-list-item__badge",innerHTML:this.badge}),e&&t("span",{class:"action-list-item__suffix",innerHTML:this.suffix,ref:i=>this.suffixEl=i})))}};c.style=":host{display:block}:host *{box-sizing:border-box}.action-list-item{display:inline-flex;width:100%;min-width:15rem;margin:0;padding:var(--s-space-12) var(--s-space-16);justify-content:flex-start;align-items:center;border:none;color:var(--s-text-default);background-color:var(--s-surface-overlay-default);font:inherit;line-height:var(--s-line-height-base);text-align:left;cursor:pointer;gap:var(--s-space-12)}.action-list-item:hover{background-color:var(--s-surface-overlay-hovered)}.action-list-item:focus{outline:none}.action-list-item:focus-visible{background-color:var(--s-surface-overlay-hovered)}.action-list-item:active{background-color:var(--s-surface-overlay-pressed)}.action-list-item:disabled{background-color:var(--s-surface-overlay-default);cursor:default}.action-list-item:disabled .action-list-item__label,.action-list-item:disabled .action-list-item__description{color:var(--s-text-disabled)}.action-list-item:disabled .action-list-item__icon{color:var(--s-icon-disabled)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.action-list-item{padding:var(--s-space-8) var(--s-space-12);font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm);gap:var(--s-space-8)}}.action-list-item--size-l{padding:var(--s-space-16)}.action-list-item--intent-critical ::part(icon){color:var(--s-icon-critical)}.action-list-item--intent-critical:not(:disabled) .action-list-item__label{color:var(--s-text-critical)}.action-list-item--intent-critical:not(:disabled) .action-list-item__icon{color:var(--s-icon-critical)}.action-list-item__icon{display:inline-flex;flex-shrink:0;color:var(--s-icon-default)}.action-list-item__label-container{display:inline-flex;min-width:0;flex-grow:1;flex-shrink:1;align-items:flex-start;flex-direction:column}.action-list-item__label{overflow:hidden;max-width:100%;font-weight:var(--s-font-weight-medium);white-space:nowrap;text-overflow:ellipsis}.action-list-item__description{color:var(--s-text-subdued)}.action-list-item__badge{overflow:hidden;min-width:4rem;padding-left:var(--s-space-8);flex-shrink:3;color:var(--s-text-subdued);font-weight:var(--s-font-weight-medium);text-align:right;white-space:nowrap;text-overflow:ellipsis}.action-list-item__suffix{display:inline-flex;flex-shrink:0;color:var(--s-icon-highlight)}";const h=class{constructor(t){i(this,t),this.orientation="horizontal",this.spacing="8"}render(){const i="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})`},e=n("separator",`separator--orientation-${this.orientation}`);return t(s,{"aria-orientation":this.orientation,class:e,role:"separator",style:i},t("span",{class:"separator__line"}))}};h.style=":host{display:flex;width:100%;align-items:center}:host *{box-sizing:border-box}:host(.separator--orientation-vertical){display:inline-flex;width:auto}:host(.separator--orientation-vertical) .separator__line{display:block;width:var(--s-border-width-default);height:100%;min-height:1.125rem;background-color:var(--s-border-default)}.separator__line{display:block;width:100%;height:var(--s-border-width-default);background-color:var(--s-border-default)}";export{l as swirl_action_list,c as swirl_action_list_item,h as swirl_separator}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,c as t,h as e,H as i,g as s}from"./p-e5528e8a.js";import{o as r,s as n,f as a,c as p,a as h}from"./p-ecb8b7f5.js";import{d,e as l}from"./p-33c168b3.js";import{c}from"./p-b7898321.js";import{i as v,q as m,a as f}from"./p-6e4e9ae0.js";const u=class{constructor(e){o(this,e),this.popoverClose=t(this,"popoverClose",7),this.popoverOpen=t(this,"popoverOpen",7),this.toggle=o=>{o.stopPropagation(),this.active?this.close():this.open()},this.onKeydown=o=>{"Escape"===o.code&&this.active&&(o.stopPropagation(),this.close())},this.reposition=async()=>{const o=v();if(!Boolean(this.triggerEl)||!Boolean(this.contentContainer))return;if(o)return void(this.position=void 0);const t="number"==typeof this.offset?{mainAxis:this.offset,crossAxis:0}:{mainAxis:this.offset[0],crossAxis:this.offset[1]},e=this.enableFlip?[r(t),n(),a()]:[r(t),n()];this.position=await p(this.triggerEl,this.contentContainer,{middleware:e,placement:this.placement,strategy:"fixed"})},this.onCloseButtonClick=()=>{this.close()},this.animation="scale-in-xy",this.disableScrollLock=void 0,this.enableFlip=!0,this.fullscreenBottomSheet=void 0,this.label=void 0,this.maxHeight="22rem",this.offset=8,this.popoverId=void 0,this.placement="bottom-start",this.returnFocusToTrigger=!0,this.transparent=void 0,this.trigger=void 0,this.triggerContainer=void 0,this.useContainerWidth=void 0,this.active=!1,this.closing=!1,this.position=void 0}componentDidLoad(){this.connectTrigger(),this.updateTriggerAttributes(),Boolean(this.trigger)&&console.warn('[Swirl] The "trigger" prop of swirl-popover is deprecated and will be removed with the next major release. Please use the swirl-popover-trigger component instead. https://swirl-storybook.flip-app.dev/?path=/docs/components-swirlpopovertrigger--docs')}disconnectedCallback(){this.unlockBodyScroll()}onWindowFocusIn(o){if(!this.active)return;const t=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),e="webkit"in window,i=t||e,s=o.target,r=o.relatedTarget,n=f(),a=!this.el.contains(s)&&!this.el.contains(n),p=s!==this.triggerEl&&!this.triggerEl?.contains(s),h=i&&!this.el.contains(r||s)&&r!==this.el;a&&p&&(!i||h)&&this.close()}onWindowClick(o){if(!this.active||this.closing)return;const t=o.target,e=this.el.contains(t),i=o.composedPath().some((o=>!!(Boolean(o)&&o instanceof Node)&&this.el.contains(o))),s=t===this.triggerEl||this.triggerEl.contains(t)||o.composedPath().includes(this.triggerEl);e||i||s||this.close()}async close(){!this.closing&&this.active&&(this.popoverClose.emit(),this.disableAutoUpdate&&this.disableAutoUpdate(),this.closing=!0,setTimeout((()=>{this.active=!1,this.closing=!1,this.updateTriggerAttributes()}),150),this.unlockBodyScroll(),this.returnFocusToTrigger&&this.getNativeTriggerElement()?.focus())}async open(o){if(this.triggerEl=o||this.triggerEl,this.active||!Boolean(this.triggerEl))return;this.adjustWidth(),this.active=!0,this.updateTriggerAttributes();const t=this.getFocusableChildren();requestAnimationFrame((async()=>{await this.reposition(),this.popoverOpen.emit({position:this.position}),t.length>0?t[0].focus():this.contentContainer.focus(),this.disableAutoUpdate&&this.disableAutoUpdate(),this.disableAutoUpdate=h(this.triggerEl,this.contentContainer,(()=>this.reposition())),this.scrollContainer.scrollTop=0,this.lockBodyScroll()}))}connectTrigger(){Boolean(this.trigger)?(this.triggerEl="string"==typeof this.trigger?m(this.triggerContainer||document.body,`#${this.trigger}`)[0]:this.trigger,Boolean(this.triggerEl)&&this.triggerEl.addEventListener("click",(o=>{this.toggle(o)}))):this.triggerEl=void 0}getNativeTriggerElement(){return this.triggerEl?.tagName.startsWith("SWIRL-")&&(this.triggerEl?.children[0]||this.triggerEl?.shadowRoot?.children[0])||this.triggerEl}updateTriggerAttributes(){if(!Boolean(this.triggerEl))return;const o=this.getNativeTriggerElement();o.setAttribute("aria-controls",this.el.id),o.setAttribute("aria-expanded",String(this.active)),o.setAttribute("aria-haspopup","dialog")}getFocusableChildren(){return m(this.el,'[role="menuitem"], [role="listbox"]')}adjustWidth(){let o=this.useContainerWidth;[!0,"true"].includes(this.useContainerWidth)?o=!0:[!1,"false"].includes(this.useContainerWidth)&&(o=!1);const t=!window.matchMedia("(min-width: 768px)").matches;if(Boolean(o)&&!t){const t="string"==typeof o&&this.el.closest(o)||this.el.parentElement;this.contentContainer.style.maxWidth="none",this.contentContainer.style.width=t.getBoundingClientRect().width+"px"}else this.contentContainer.style.maxWidth="",this.contentContainer.style.width=""}lockBodyScroll(){v()&&!this.disableScrollLock&&Boolean(this.scrollContainer)&&d(this.scrollContainer)}unlockBodyScroll(){v()&&!this.disableScrollLock&&Boolean(this.scrollContainer)&&l(this.scrollContainer)}render(){const o=!window.matchMedia("(min-width: 768px)").matches,t=c("popover",`popover--animation-${this.animation}`,`popover--placement-${this.position?.placement}`,{"popover--active":this.active,"popover--closing":this.closing,"popover--fullscreen-bottom-sheet":this.fullscreenBottomSheet,"popover--inactive":!this.active,"popover--transparent":this.transparent});return e(i,null,e("div",{class:t,onKeyDown:this.onKeydown},e("div",{"aria-hidden":this.active?"false":"true","aria-label":this.label,class:"popover__content",id:this.popoverId,part:"popover__content",role:"dialog",ref:o=>this.contentContainer=o,style:{top:Boolean(this.position)?`${this.position?.y}px`:"",left:Boolean(this.position)?`${this.position?.x}px`:""},tabindex:"-1"},e("span",{class:"popover__handle"}),e("div",{class:"popover__scroll-container",part:"popover__scroll-container",ref:o=>this.scrollContainer=o,style:{maxHeight:!o&&Boolean(this.maxHeight)?this.maxHeight:void 0}},e("slot",null))),this.active&&e("div",{class:"popover__backdrop",onClick:this.onCloseButtonClick})))}get el(){return s(this)}};u.style=":host{position:relative;z-index:var(--s-z-40);display:inline-flex}:host *{box-sizing:border-box}.popover--active:not(.popover--closing) .popover__backdrop{animation:0.15s popover-fade-in}@media (prefers-reduced-motion){.popover--active:not(.popover--closing) .popover__backdrop{animation:none}}.popover--active:not(.popover--closing) .popover__content{animation:0.15s popover-slide-in}@media (min-width: 768px){.popover--active:not(.popover--closing) .popover__content{transform-origin:top left;animation:0.15s popover-fade-scale-in-xy}}@media (prefers-reduced-motion){.popover--active:not(.popover--closing) .popover__content{animation:none}}.popover--closing .popover__backdrop{animation:0.15s popover-fade-out;animation-fill-mode:forwards}@media (prefers-reduced-motion){.popover--closing .popover__backdrop{animation:none}}.popover--closing .popover__content{animation:0.15s popover-slide-out;animation-fill-mode:forwards}@media (min-width: 768px){.popover--closing .popover__content{animation:0.15s popover-fade-out}}@media (prefers-reduced-motion){.popover--closing .popover__content{animation:none}}.popover--inactive .popover__content{display:none}@media (max-width: 767px){.popover--fullscreen-bottom-sheet.popover--active:not(.popover--closing) .popover__content{animation:0.15s popover-fade-in}@media (prefers-reduced-motion){.popover--fullscreen-bottom-sheet.popover--active:not(.popover--closing) .popover__content{animation:none}}.popover--fullscreen-bottom-sheet.popover--closing .popover__content{animation:0.15s popover-fade-out;animation-fill-mode:forwards}@media (prefers-reduced-motion){.popover--fullscreen-bottom-sheet.popover--closing .popover__content{animation:none}}.popover--fullscreen-bottom-sheet .popover__backdrop{display:none}.popover--fullscreen-bottom-sheet .popover__content{top:0;border-top-left-radius:0;border-top-right-radius:0}.popover--fullscreen-bottom-sheet .popover__scroll-container{height:100%;max-height:none;padding-top:0;padding-bottom:0}.popover--fullscreen-bottom-sheet .popover__handle{display:none}}@media (min-width: 768px){.popover--animation-scale-in-y.popover--active:not(.popover--closing) .popover__content{animation:0.15s popover-fade-scale-in-y}}@media (prefers-reduced-motion){.popover--animation-scale-in-y.popover--active:not(.popover--closing) .popover__content{animation:none}}@media (min-width: 768px){.popover--transparent .popover__content{background-color:transparent;box-shadow:none}}@media (min-width: 768px){.popover--transparent .popover__scroll-container{padding:0}}.popover__backdrop{position:fixed;z-index:0;background-color:rgba(0, 0, 0, 0.2);animation:0.15s popover-backdrop-fade-in;inset:0}@media (prefers-reduced-motion){.popover__backdrop{animation:none}}@media (min-width: 768px){.popover__backdrop{display:none}}.popover__content{position:fixed;z-index:2;right:0;bottom:0;left:0;overflow:hidden;border-top-left-radius:var(--s-border-radius-xl);border-top-right-radius:var(--s-border-radius-xl);background-color:var(--s-surface-overlay-default)}@media (min-width: 768px){.popover__content{right:unset;bottom:unset;left:unset;max-width:22.5rem;border-radius:var(--s-border-radius-sm);animation:none;box-shadow:var(--s-shadow-level-1)}}.popover__scroll-container{overflow-x:hidden;overflow-y:auto;width:100%;max-height:90vh;padding-top:var(--s-space-24);padding-bottom:var(--s-space-24);overscroll-behavior:contain}@media (min-width: 768px){.popover__scroll-container{max-height:22rem;padding-top:var(--s-space-8);padding-bottom:var(--s-space-8)}}.popover__handle{position:absolute;top:var(--s-space-8);left:50%;width:2.5rem;height:0.375rem;border-radius:0.1875rem;background-color:var(--s-border-default);transform:translatex(-50%)}@media (min-width: 768px){.popover__handle{display:none}}@keyframes popover-slide-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes popover-slide-out{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes popover-fade-in{from{opacity:0}to{opacity:1}}@keyframes popover-fade-out{from{opacity:1}to{opacity:0}}@keyframes popover-fade-scale-in-xy{from{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}@keyframes popover-fade-scale-in-y{from{transform:scaleY(0);opacity:0}to{transform:scaleY(1);opacity:1}}";const g=class{constructor(t){o(this,t),this.onClick=()=>{const o=this.getPopoverEl();if(!Boolean(o))return;if(this.isPopoverOpen())return void o.close();const t=this.getTriggerEl();Boolean(t)&&(o.open(t),o.addEventListener("popoverOpen",(()=>{this.updateTriggerElAriaAttributes(!0)}),{once:!0}),o.addEventListener("popoverClose",(()=>{this.updateTriggerElAriaAttributes(!1)}),{once:!0}))},this.updateTriggerElAriaAttributes=o=>{if(!this.setAriaAttributes)return;const t=this.getTriggerEl(),e="string"==typeof this.popover?this.popover:this.popover?.id;t.tagName.startsWith("SWIRL-")?(t.setAttribute("swirl-aria-controls",e),t.setAttribute("swirl-aria-expanded",String(o||"false")),t.setAttribute("swirl-aria-haspopup","dialog")):(t.setAttribute("aria-controls",e),t.setAttribute("aria-expanded",String(o||"false")),t.setAttribute("aria-haspopup","dialog"))},this.hidePopoverWhenInvisible=!0,this.parentScrollContainer=void 0,this.popover=void 0,this.setAriaAttributes=!0}componentDidLoad(){if(this.updateTriggerElAriaAttributes(),this.hidePopoverWhenInvisible){this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange.bind(this),{root:this.parentScrollContainer,threshold:1});const o=this.el.querySelector("*");if(!Boolean(o))return;this.intersectionObserver.observe(o)}}disconnectedCallback(){this.intersectionObserver?.disconnect()}watchPopover(){this.updateTriggerElAriaAttributes()}getPopoverEl(){return"string"==typeof this.popover?document.querySelector(`#${this.popover}`):this.popover}getTriggerEl(){return 1!==this.el.children.length&&console.warn('[Swirl] The "swirl-popover-trigger" component expects exactly one child element.'),this.el.children[0]}onVisibilityChange(o){!o[0].isIntersecting&&this.isPopoverOpen()&&this.getPopoverEl()?.close()}isPopoverOpen(){const o=this.getPopoverEl(),t=o?.shadowRoot.firstChild?.classList.contains("popover--active");return t}render(){return e(i,{onClick:this.onClick},e("slot",null))}get el(){return s(this)}static get watchers(){return{popover:["watchPopover"]}}};g.style=".sc-swirl-popover-trigger-h{display:contents}";export{u as swirl_popover,g as swirl_popover_trigger}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(t){return t.split("-")[1]}function n(t){return"y"===t?"height":"width"}function e(t){return t.split("-")[0]}function o(t){return["top","bottom"].includes(e(t))?"x":"y"}function r(r,i,l){let{reference:a,floating:c}=r;const s=a.x+a.width/2-c.width/2,u=a.y+a.height/2-c.height/2,f=o(i),d=n(f),m=a[d]/2-c[d]/2,y="x"===f;let g;switch(e(i)){case"top":g={x:s,y:a.y-c.height};break;case"bottom":g={x:s,y:a.y+a.height};break;case"right":g={x:a.x+a.width,y:u};break;case"left":g={x:a.x-c.width,y:u};break;default:g={x:a.x,y:a.y}}switch(t(i)){case"start":g[f]-=m*(l&&y?-1:1);break;case"end":g[f]+=m*(l&&y?-1:1)}return g}function i(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}async function l(t,n){var e;void 0===n&&(n={});const{x:o,y:r,platform:l,rects:a,elements:c,strategy:s}=t,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:m=!1,padding:y=0}=n,g=function(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}(y),x=c[m?"floating"===d?"reference":"floating":d],h=i(await l.getClippingRect({element:null==(e=await(null==l.isElement?void 0:l.isElement(x)))||e?x:x.contextElement||await(null==l.getDocumentElement?void 0:l.getDocumentElement(c.floating)),boundary:u,rootBoundary:f,strategy:s})),p="floating"===d?{...a.floating,x:o,y:r}:a.reference,w=await(null==l.getOffsetParent?void 0:l.getOffsetParent(c.floating)),v=await(null==l.isElement?void 0:l.isElement(w))&&await(null==l.getScale?void 0:l.getScale(w))||{x:1,y:1},b=i(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({rect:p,offsetParent:w,strategy:s}):p);return{top:(h.top-b.top+g.top)/v.y,bottom:(b.bottom-h.bottom+g.bottom)/v.y,left:(h.left-b.left+g.left)/v.x,right:(b.right-h.right+g.right)/v.x}}const a=Math.min,c=Math.max;function s(t,n,e){return c(t,a(n,e))}const u={left:"right",right:"left",bottom:"top",top:"bottom"};function f(t){return t.replace(/left|right|bottom|top/g,(t=>u[t]))}const d={start:"end",end:"start"};function m(t){return t.replace(/start|end/g,(t=>d[t]))}const y=function(r){return void 0===r&&(r={}),{name:"flip",options:r,async fn(i){var a;const{placement:c,middlewareData:s,rects:u,initialPlacement:d,platform:y,elements:g}=i,{mainAxis:x=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:b=!0,...A}=r,R=e(c),k=e(d)===d,P=await(null==y.isRTL?void 0:y.isRTL(g.floating)),D=p||(k||!b?[f(d)]:function(t){const n=f(t);return[m(t),n,m(n)]}(d));p||"none"===v||D.push(...function(n,o,r,i){const l=t(n);let a=function(t,n,e){const o=["left","right"],r=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(t){case"top":case"bottom":return e?n?r:o:n?o:r;case"left":case"right":return n?i:l;default:return[]}}(e(n),"start"===r,i);return l&&(a=a.map((t=>t+"-"+l)),o&&(a=a.concat(a.map(m)))),a}(d,b,v,P));const S=[d,...D],T=await l(i,A),z=[];let B=(null==(a=s.flip)?void 0:a.overflows)||[];if(x&&z.push(T[R]),h){const{main:e,cross:r}=function(e,r,i){void 0===i&&(i=!1);const l=t(e),a=o(e),c=n(a);let s="x"===a?l===(i?"end":"start")?"right":"left":"start"===l?"bottom":"top";return r.reference[c]>r.floating[c]&&(s=f(s)),{main:s,cross:f(s)}}(c,u,P);z.push(T[e],T[r])}if(B=[...B,{placement:c,overflows:z}],!z.every((t=>t<=0))){var F,L;const t=((null==(F=s.flip)?void 0:F.index)||0)+1,n=S[t];if(n)return{data:{index:t,overflows:B},reset:{placement:n}};let e=null==(L=B.filter((t=>t.overflows[0]<=0)).sort(((t,n)=>t.overflows[1]-n.overflows[1]))[0])?void 0:L.placement;if(!e)switch(w){case"bestFit":{var M;const t=null==(M=B.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,n)=>t+n),0)])).sort(((t,n)=>t[1]-n[1]))[0])?void 0:M[0];t&&(e=t);break}case"initialPlacement":e=d}if(c!==e)return{reset:{placement:e}}}return{}}}},g=function(n){return void 0===n&&(n=0),{name:"offset",options:n,async fn(r){const{x:i,y:l}=r,a=await async function(n,r){const{placement:i,platform:l,elements:a}=n,c=await(null==l.isRTL?void 0:l.isRTL(a.floating)),s=e(i),u=t(i),f="x"===o(i),d=["left","top"].includes(s)?-1:1,m=c&&f?-1:1,y="function"==typeof r?r(n):r;let{mainAxis:g,crossAxis:x,alignmentAxis:h}="number"==typeof y?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...y};return u&&"number"==typeof h&&(x="end"===u?-1*h:h),f?{x:x*m,y:g*d}:{x:g*d,y:x*m}}(r,n);return{x:i+a.x,y:l+a.y,data:a}}}},x=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(n){const{x:r,y:i,placement:a}=n,{mainAxis:c=!0,crossAxis:u=!1,limiter:f={fn:t=>{let{x:n,y:e}=t;return{x:n,y:e}}},...d}=t,m={x:r,y:i},y=await l(n,d),g=o(e(a)),x="x"===g?"y":"x";let h=m[g],p=m[x];c&&(h=s(h+y["y"===g?"top":"left"],h,h-y["y"===g?"bottom":"right"])),u&&(p=s(p+y["y"===x?"top":"left"],p,p-y["y"===x?"bottom":"right"]));const w=f.fn({...n,[g]:h,[x]:p});return{...w,data:{x:w.x-r,y:w.y-i}}}}};function h(t){return t&&t.document&&t.location&&t.alert&&t.setInterval}function p(t){if(null==t)return window;if(!h(t)){const n=t.ownerDocument;return n&&n.defaultView||window}return t}function w(t){return p(t).getComputedStyle(t)}function v(t){return h(t)?"":t?(t.nodeName||"").toLowerCase():""}function b(){const t=navigator.userAgentData;return null!=t&&t.brands?t.brands.map((t=>t.brand+"/"+t.version)).join(" "):navigator.userAgent}function A(t){return t instanceof p(t).HTMLElement}function R(t){return t instanceof p(t).Element}function k(t){return"undefined"!=typeof ShadowRoot&&(t instanceof p(t).ShadowRoot||t instanceof ShadowRoot)}function P(t){const{overflow:n,overflowX:e,overflowY:o}=w(t);return/auto|scroll|overlay|hidden/.test(n+o+e)}function D(t){return["table","td","th"].includes(v(t))}function S(t){const n=/firefox/i.test(b()),e=w(t);return"none"!==e.transform||"none"!==e.perspective||"paint"===e.contain||["transform","perspective"].includes(e.willChange)||n&&"filter"===e.willChange||n&&!!e.filter&&"none"!==e.filter}function T(){return!/^((?!chrome|android).)*safari/i.test(b())}const z=Math.min,B=Math.max,F=Math.round;function L(t,n,e){var o,r,i,l;void 0===n&&(n=!1),void 0===e&&(e=!1);const a=t.getBoundingClientRect();let c=1,s=1;n&&A(t)&&(c=t.offsetWidth>0&&F(a.width)/t.offsetWidth||1,s=t.offsetHeight>0&&F(a.height)/t.offsetHeight||1);const u=R(t)?p(t):window,f=!T()&&e,d=(a.left+(f&&null!=(o=null==(r=u.visualViewport)?void 0:r.offsetLeft)?o:0))/c,m=(a.top+(f&&null!=(i=null==(l=u.visualViewport)?void 0:l.offsetTop)?i:0))/s,y=a.width/c,g=a.height/s;return{width:y,height:g,top:m,right:d+y,bottom:m+g,left:d,x:d,y:m}}function M(t){return(n=t,(n instanceof p(n).Node?t.ownerDocument:t.document)||window.document).documentElement;var n}function C(t){return R(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function E(t){return L(M(t)).left+C(t).scrollLeft}function O(t,n,e){const o=A(n),r=M(n),i=L(t,o&&function(t){const n=L(t);return F(n.width)!==t.offsetWidth||F(n.height)!==t.offsetHeight}(n),"fixed"===e);let l={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(o||!o&&"fixed"!==e)if(("body"!==v(n)||P(r))&&(l=C(n)),A(n)){const t=L(n,!0);a.x=t.x+n.clientLeft,a.y=t.y+n.clientTop}else r&&(a.x=E(r));return{x:i.left+l.scrollLeft-a.x,y:i.top+l.scrollTop-a.y,width:i.width,height:i.height}}function j(t){return"html"===v(t)?t:t.assignedSlot||t.parentNode||(k(t)?t.host:null)||M(t)}function q(t){return A(t)&&"fixed"!==w(t).position?function(t){let{offsetParent:n}=t,e=t,o=!1;for(;e&&e!==n;){const{assignedSlot:t}=e;if(t){let r=t.offsetParent;if("contents"===w(t).display){const n=t.hasAttribute("style"),o=t.style.display;t.style.display=w(e).display,r=t.offsetParent,t.style.display=o,n||t.removeAttribute("style")}e=t,n!==r&&(n=r,o=!0)}else if(k(e)&&e.host&&o)break;e=k(e)&&e.host||e.parentNode}return n}(t):null}function V(t){const n=p(t);let e=q(t);for(;e&&D(e)&&"static"===w(e).position;)e=q(e);return e&&("html"===v(e)||"body"===v(e)&&"static"===w(e).position&&!S(e))?n:e||function(t){let n=j(t);for(k(n)&&(n=n.host);A(n)&&!["html","body"].includes(v(n));){if(S(n))return n;{const t=n.parentNode;n=k(t)?t.host:t}}return null}(t)||n}function X(t){if(A(t))return{width:t.offsetWidth,height:t.offsetHeight};const n=L(t);return{width:n.width,height:n.height}}function Y(t){const n=j(t);return["html","body","#document"].includes(v(n))?t.ownerDocument.body:A(n)&&P(n)?n:Y(n)}function G(t,n){var e;void 0===n&&(n=[]);const o=Y(t),r=o===(null==(e=t.ownerDocument)?void 0:e.body),i=p(o),l=r?[i].concat(i.visualViewport||[],P(o)?o:[]):o,a=n.concat(l);return r?a:a.concat(G(l))}function H(t,n,e){return"viewport"===n?i(function(t,n){const e=p(t),o=M(t),r=e.visualViewport;let i=o.clientWidth,l=o.clientHeight,a=0,c=0;if(r){i=r.width,l=r.height;const t=T();(t||!t&&"fixed"===n)&&(a=r.offsetLeft,c=r.offsetTop)}return{width:i,height:l,x:a,y:c}}(t,e)):R(n)?function(t,n){const e=L(t,!1,"fixed"===n),o=e.top+t.clientTop,r=e.left+t.clientLeft;return{top:o,left:r,x:r,y:o,right:r+t.clientWidth,bottom:o+t.clientHeight,width:t.clientWidth,height:t.clientHeight}}(n,e):i(function(t){var n;const e=M(t),o=C(t),r=null==(n=t.ownerDocument)?void 0:n.body,i=B(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),l=B(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0);let a=-o.scrollLeft+E(t);const c=-o.scrollTop;return"rtl"===w(r||e).direction&&(a+=B(e.clientWidth,r?r.clientWidth:0)-i),{width:i,height:l,x:a,y:c}}(M(t)))}function I(t){const n=G(t),e=["absolute","fixed"].includes(w(t).position)&&A(t)?V(t):t;return R(e)?n.filter((t=>R(t)&&function(t,n){const e=null==n.getRootNode?void 0:n.getRootNode();if(t.contains(n))return!0;if(e&&k(e)){let e=n;do{if(e&&t===e)return!0;e=e.parentNode||e.host}while(e)}return!1}(t,e)&&"body"!==v(t))):[]}const J={getClippingRect:function(t){let{element:n,boundary:e,rootBoundary:o,strategy:r}=t;const i=[..."clippingAncestors"===e?I(n):[].concat(e),o],l=i.reduce(((t,e)=>{const o=H(n,e,r);return t.top=B(o.top,t.top),t.right=z(o.right,t.right),t.bottom=z(o.bottom,t.bottom),t.left=B(o.left,t.left),t}),H(n,i[0],r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:n,offsetParent:e,strategy:o}=t;const r=A(e),i=M(e);if(e===i)return n;let l={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if((r||!r&&"fixed"!==o)&&(("body"!==v(e)||P(i))&&(l=C(e)),A(e))){const t=L(e,!0);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}return{...n,x:n.x-l.scrollLeft+a.x,y:n.y-l.scrollTop+a.y}},isElement:R,getDimensions:X,getOffsetParent:V,getDocumentElement:M,getElementRects:t=>{let{reference:n,floating:e,strategy:o}=t;return{reference:O(n,V(e),o),floating:{...X(e),x:0,y:0}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>"rtl"===w(t).direction};function K(t,n,e,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l=!0,animationFrame:a=!1}=o,c=r&&!a,s=i&&!a,u=c||s?[...R(t)?G(t):[],...G(n)]:[];u.forEach((t=>{c&&t.addEventListener("scroll",e,{passive:!0}),s&&t.addEventListener("resize",e)}));let f,d=null;if(l){let o=!0;d=new ResizeObserver((()=>{o||e(),o=!1})),R(t)&&!a&&d.observe(t),d.observe(n)}let m=a?L(t):null;return a&&function n(){const o=L(t);!m||o.x===m.x&&o.y===m.y&&o.width===m.width&&o.height===m.height||e(),m=o,f=requestAnimationFrame(n)}(),e(),()=>{var t;u.forEach((t=>{c&&t.removeEventListener("scroll",e),s&&t.removeEventListener("resize",e)})),null==(t=d)||t.disconnect(),d=null,a&&cancelAnimationFrame(f)}}const N=(t,n,e)=>(async(t,n,e)=>{const{placement:o="bottom",strategy:i="absolute",middleware:l=[],platform:a}=e,c=l.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(n));let u=await a.getElementRects({reference:t,floating:n,strategy:i}),{x:f,y:d}=r(u,o,s),m=o,y={},g=0;for(let e=0;e<c.length;e++){const{name:l,fn:x}=c[e],{x:h,y:p,data:w,reset:v}=await x({x:f,y:d,initialPlacement:o,placement:m,strategy:i,middlewareData:y,rects:u,platform:a,elements:{reference:t,floating:n}});f=null!=h?h:f,d=null!=p?p:d,y={...y,[l]:{...y[l],...w}},v&&g<=50&&(g++,"object"==typeof v&&(v.placement&&(m=v.placement),v.rects&&(u=!0===v.rects?await a.getElementRects({reference:t,floating:n,strategy:i}):v.rects),({x:f,y:d}=r(u,m,s))),e=-1)}return{x:f,y:d,placement:m,strategy:i,middlewareData:y}})(t,n,{platform:J,...e});export{K as a,N as c,y as f,g as o,x as s}
|