@esri/calcite-components 6.0.0-next.36 → 6.0.0-next.38
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/dist/cdn/{ZRJVPMEK.js → 24A75QAE.js} +1 -1
- package/dist/cdn/{4PQBZJ4L.js → 24FXINJO.js} +1 -1
- package/dist/cdn/{FA3KLVWD.js → 2GFB6PCZ.js} +1 -1
- package/dist/cdn/{W2I5OPYF.js → 2HOHM3EH.js} +1 -1
- package/dist/cdn/{XAYJREXM.js → 2PLDLXJN.js} +1 -1
- package/dist/cdn/{BT2MPUDY.js → 2Q3RUIJG.js} +1 -1
- package/dist/cdn/{TN5EWDLR.js → 2UVRLL6B.js} +1 -1
- package/dist/cdn/{5IJ5TJDN.js → 2WLCQV3Y.js} +1 -1
- package/dist/cdn/{B7P6V6MC.js → 3LBX77FV.js} +1 -1
- package/dist/cdn/{S67FGWW3.js → 3WK3A5HN.js} +1 -1
- package/dist/cdn/{FHYN6ZAQ.js → 45UWYTX5.js} +1 -1
- package/dist/cdn/{6M564ADZ.js → 4G2U2LZU.js} +1 -1
- package/dist/cdn/{IJLDLXA4.js → 4G53CVHU.js} +1 -1
- package/dist/cdn/{ESR6X7A7.js → 5KNQ7KLQ.js} +1 -1
- package/dist/cdn/{AOKBE6J7.js → 5MFZ2III.js} +1 -1
- package/dist/cdn/{F6JZXX2K.js → 5VVWG6MS.js} +1 -1
- package/dist/cdn/{FZQCKMTU.js → 626N6BQR.js} +1 -1
- package/dist/cdn/{EPYGGMR4.js → 63W2BGOU.js} +1 -1
- package/dist/cdn/{E26ZRCPF.js → 6QLE3YND.js} +1 -1
- package/dist/cdn/{LQQCLN5H.js → 7BCAO4ZV.js} +1 -1
- package/dist/cdn/{BDWKQYK2.js → 7C5BOOBT.js} +1 -1
- package/dist/cdn/{IU5OBAG7.js → 7EVIOZSJ.js} +1 -1
- package/dist/cdn/{GUITTXZL.js → 7KKWA4OA.js} +1 -1
- package/dist/cdn/{AWI33HUK.js → 7OCV5FNW.js} +1 -1
- package/dist/cdn/{NGLXEB5Z.js → 7QE6XWT2.js} +1 -1
- package/dist/cdn/{SC2HLLOI.js → A6S7YZSR.js} +1 -1
- package/dist/cdn/{MMF742XB.js → APW6NJCW.js} +1 -1
- package/dist/cdn/{E57LYWC5.js → AVLWEWGW.js} +1 -1
- package/dist/cdn/{PIHISGQ4.js → BGV3PKUZ.js} +1 -1
- package/dist/cdn/{ZSUIE3CH.js → BKEIUV33.js} +1 -1
- package/dist/cdn/{LBJMYSBR.js → BXQ56X62.js} +1 -1
- package/dist/cdn/{BHRRFU7Q.js → BY3H6ZLY.js} +1 -1
- package/dist/cdn/{3CG6UUU6.js → BZURRYWO.js} +1 -1
- package/dist/cdn/{WACBLTPH.js → CIQ3T56J.js} +1 -1
- package/dist/cdn/{2CWRWNX3.js → CM2PEXWM.js} +1 -1
- package/dist/cdn/CTKZCFSX.js +2 -0
- package/dist/cdn/{ZG35TWOS.js → DESZAUDW.js} +1 -1
- package/dist/cdn/{36JEMJ4C.js → DKUYXBZH.js} +1 -1
- package/dist/cdn/{E7CSGD77.js → DLWN6OZX.js} +1 -1
- package/dist/cdn/{DHM55VF3.js → DMG7ZR57.js} +1 -1
- package/dist/cdn/{PBHT6ILA.js → DPA3VI2E.js} +1 -1
- package/dist/cdn/{6U7RVRTZ.js → DQATRBX3.js} +1 -1
- package/dist/cdn/{T3JILWL7.js → DV3GJBA5.js} +1 -1
- package/dist/cdn/{TRR67IQN.js → EIHSE32P.js} +1 -1
- package/dist/cdn/{I7LH7HGC.js → EK766TTO.js} +1 -1
- package/dist/cdn/{JGGSIZC2.js → EXLVBDWF.js} +1 -1
- package/dist/cdn/{4DERTMFL.js → FEHZNFRH.js} +1 -1
- package/dist/cdn/{3IOZ4NEX.js → FKHB2VWA.js} +1 -1
- package/dist/cdn/FLTBH3MD.js +2 -0
- package/dist/cdn/{JNNLYUU7.js → FME2BAWB.js} +1 -1
- package/dist/cdn/{WUBEQCPN.js → G67Z5DGI.js} +1 -1
- package/dist/cdn/{ABQMRRNL.js → GGQA652X.js} +1 -1
- package/dist/cdn/{FZVPQVKC.js → GISMH6SL.js} +1 -1
- package/dist/cdn/{EOUBXPNR.js → GUTQ5CPC.js} +1 -1
- package/dist/cdn/{6GTCMZBM.js → HCVFAL64.js} +1 -1
- package/dist/cdn/{B2HQ6AGI.js → HDKULWDO.js} +1 -1
- package/dist/cdn/{EYONO4L4.js → HFS6SLUW.js} +1 -1
- package/dist/cdn/{UWZGRGQT.js → HZ6TR3CO.js} +1 -1
- package/dist/cdn/{B7PGJO5G.js → IAJ5AEB6.js} +1 -1
- package/dist/cdn/{WNC7ECCL.js → IHUVSGGJ.js} +1 -1
- package/dist/cdn/{45PCM4GY.js → ILDVRXW2.js} +1 -1
- package/dist/cdn/{ELQEEWYL.js → IRF6HIML.js} +1 -1
- package/dist/cdn/{AAM4AVON.js → IRU4IDYW.js} +1 -1
- package/dist/cdn/{J6NVKVUR.js → IVZAKK5A.js} +1 -1
- package/dist/cdn/{4RBVTPP7.js → JLYG24RV.js} +1 -1
- package/dist/cdn/{X5QMVYFC.js → JMYKBAMK.js} +1 -1
- package/dist/cdn/{SN5AU46G.js → JTLM663P.js} +1 -1
- package/dist/cdn/{WKLITM2Q.js → K6NURNKM.js} +1 -1
- package/dist/cdn/{4SZCEARC.js → KEYUDB4G.js} +1 -1
- package/dist/cdn/{PRWBFUC6.js → KOOBGNJ4.js} +1 -1
- package/dist/cdn/{KSQGDVHO.js → KQDGRC6H.js} +1 -1
- package/dist/cdn/{GZJDW7TE.js → LFRF57GI.js} +1 -1
- package/dist/cdn/{IT55FXFB.js → LLOZRQFN.js} +1 -1
- package/dist/cdn/{QJNJIE7L.js → LUSCXUQ2.js} +1 -1
- package/dist/cdn/{CFVYBPKF.js → M4S4UEVE.js} +1 -1
- package/dist/cdn/{EVP5QN6L.js → M5PUWCJO.js} +1 -1
- package/dist/cdn/{WO6FE6CZ.js → MHUK6DQI.js} +1 -1
- package/dist/cdn/{KIR2H2WF.js → MLXK3RUI.js} +1 -1
- package/dist/cdn/{V5KRVD63.js → MYA35DL4.js} +1 -1
- package/dist/cdn/{722IELFF.js → N5K5AUWO.js} +1 -1
- package/dist/cdn/{Y3EI5BA6.js → N5TGRVGA.js} +1 -1
- package/dist/cdn/{IJAVR6AX.js → N7M7IMVP.js} +1 -1
- package/dist/cdn/{MGDB7ACM.js → NEO2KHBU.js} +1 -1
- package/dist/cdn/{N6VTGGFA.js → NI6HUWKF.js} +1 -1
- package/dist/cdn/{VZN2JLNB.js → NNEZ63JX.js} +1 -1
- package/dist/cdn/{RVXPSD6Y.js → NOQJJDS5.js} +1 -1
- package/dist/cdn/{6I4CVPNH.js → NRUN42DZ.js} +1 -1
- package/dist/cdn/{Q2JX3IAD.js → OPNH4YZW.js} +1 -1
- package/dist/cdn/{R6EATP4V.js → ORB5WBPK.js} +1 -1
- package/dist/cdn/{X7KT67IZ.js → P4WA3D4R.js} +1 -1
- package/dist/cdn/{RYWRGI24.js → PHEAIAZM.js} +1 -1
- package/dist/cdn/{QHPTLFEW.js → PTY42KSQ.js} +1 -1
- package/dist/cdn/{SM557ZZ7.js → PW7HLGTZ.js} +1 -1
- package/dist/cdn/{MAHQYZPI.js → R2PDJQWG.js} +1 -1
- package/dist/cdn/{HUTPJHUR.js → R7WYHZSO.js} +1 -1
- package/dist/cdn/{YAXXQQ3R.js → RNHNAVFO.js} +1 -1
- package/dist/cdn/{2J454YPO.js → RREWRPJD.js} +1 -1
- package/dist/cdn/{IEFYOPKS.js → RYPPKEW6.js} +1 -1
- package/dist/cdn/S34MVQKV.js +2 -0
- package/dist/cdn/{JUOFZRUA.js → SK3OTLV5.js} +1 -1
- package/dist/cdn/{CFQ3UMKK.js → SKYM7COB.js} +1 -1
- package/dist/cdn/{SRDT5O2G.js → SL2I3VHX.js} +1 -1
- package/dist/cdn/{5UC45SSV.js → STIH2DJ6.js} +1 -1
- package/dist/cdn/{FJ4YXF5O.js → SWZMAXGU.js} +1 -1
- package/dist/cdn/{ZKSLB64S.js → SYZFFYRJ.js} +1 -1
- package/dist/cdn/{Y54DUPZT.js → T2VDMFQ4.js} +1 -1
- package/dist/cdn/{KP3PHVFJ.js → TNIR55X6.js} +1 -1
- package/dist/cdn/{7YKU7HXN.js → TRCVQIOT.js} +1 -1
- package/dist/cdn/{MOIQ2PKL.js → TW3QNIRG.js} +1 -1
- package/dist/cdn/{CAIDEHA5.js → TWFX6XIR.js} +1 -1
- package/dist/cdn/{ZFIHPRH2.js → U4FKFVZR.js} +1 -1
- package/dist/cdn/{ODS4JQRJ.js → U7NT46I2.js} +1 -1
- package/dist/cdn/{UDSLGUXK.js → UCXS4DPB.js} +1 -1
- package/dist/cdn/{HCQZJGCX.js → UE7HYAAT.js} +1 -1
- package/dist/cdn/{H7L3SQI5.js → UQRZHRFT.js} +1 -1
- package/dist/cdn/{V2S4NOCD.js → UWWGFKXL.js} +1 -1
- package/dist/cdn/{W455NS4Q.js → UX7CCFD7.js} +1 -1
- package/dist/cdn/{DJLHTYEJ.js → VFAU5T3C.js} +1 -1
- package/dist/cdn/{WJFEV27K.js → VH3DR77L.js} +1 -1
- package/dist/cdn/{VQF5SUIN.js → VS2ECZNB.js} +1 -1
- package/dist/cdn/{LBJLGDS6.js → WQWYLVX6.js} +1 -1
- package/dist/cdn/{2EHFTETB.js → X2OB5CAQ.js} +1 -1
- package/dist/cdn/{RDNOYSU5.js → X7S4ZDWS.js} +1 -1
- package/dist/cdn/{LGDCXJIH.js → XEL5MWKP.js} +1 -1
- package/dist/cdn/{7WJIFTCU.js → XJCKFOJ2.js} +1 -1
- package/dist/cdn/{FLZQQ7CL.js → XK2L2FDW.js} +1 -1
- package/dist/cdn/{2VSLGFG4.js → YHODE6OP.js} +1 -1
- package/dist/cdn/{ZKTHGICN.js → YL6SUC7O.js} +1 -1
- package/dist/cdn/{AYU6H7NV.js → YUOWOBVQ.js} +1 -1
- package/dist/cdn/{GPTTZ5FT.js → YWGQOLNS.js} +1 -1
- package/dist/cdn/{ECCF2CTZ.js → YYOTR6G4.js} +1 -1
- package/dist/cdn/{B6RTHT4T.js → YZ3IS4FV.js} +1 -1
- package/dist/cdn/{WCFIIJVS.js → Z2MJAV32.js} +1 -1
- package/dist/cdn/{QDIQP3YD.js → Z4MV7FZ2.js} +1 -1
- package/dist/cdn/{D2SDBLE7.js → ZAADWOT6.js} +1 -1
- package/dist/cdn/{KNTOR64F.js → ZC2UI3YG.js} +1 -1
- package/dist/cdn/{TPWMLUEY.js → ZORDTZQB.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/locale.js +11 -14
- package/dist/chunks/runtime.js +4 -4
- package/dist/components/calcite-dialog/customElement.d.ts +4 -2
- package/dist/components/calcite-flow-item/customElement.d.ts +4 -2
- package/dist/components/calcite-panel/customElement.d.ts +4 -2
- package/dist/components/calcite-panel/customElement.js +5 -3
- package/dist/components/calcite-tree-item/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +1 -1
- package/dist/cdn/EW6PQ5IR.js +0 -2
- package/dist/cdn/JPALKDLB.js +0 -2
- package/dist/cdn/NB3J3QYJ.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{d as t}from"./ICVHIOLT.js";import{a as y}from"./
|
|
2
|
+
import{d as t}from"./ICVHIOLT.js";import{a as y}from"./45UWYTX5.js";import{a as v}from"./SKYM7COB.js";import{a as k}from"./5VVWG6MS.js";import{e as w}from"./KQDGRC6H.js";import"./MHUK6DQI.js";import{E as d,F as p,G as m,H as g,T as $,g as u,h as r,l as b,p as a}from"./RREWRPJD.js";var L={backButton:"back-button"},B={backLeft:"chevron-left",backRight:"chevron-right"},o={actionBar:"action-bar",alerts:"alerts",contentTop:"content-top",contentBottom:"content-bottom",headerTop:"header-top",headerActionsStart:"header-actions-start",headerActionsEnd:"header-actions-end",description:"description",heading:"heading",headerMenuActions:"header-menu-actions",headerContent:"header-content",fab:"fab",footer:"footer",footerEnd:"footer-end",footerStart:"footer-start"},A=u`:host{box-sizing:border-box;background-color:var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1));color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){opacity:var(--calcite-opacity-disabled);cursor:default;-webkit-user-select:none;user-select:none}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:none;inline-size:100%;flex:1 1 auto;overflow:hidden}:host([selected]){display:flex}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:var(--calcite-opacity-full)}.interaction-container{display:contents}calcite-panel{--calcite-panel-background-color: var(--calcite-flow-background-color);--calcite-panel-border-color: var(--calcite-flow-border-color, var(--calcite-flow-item-header-border-block-end));--calcite-panel-corner-radius: var(--calcite-flow-corner-radius);--calcite-panel-description-text-color: var(--calcite-flow-description-text-color);--calcite-panel-footer-background-color: var(--calcite-flow-footer-background-color);--calcite-panel-footer-space: var(--calcite-flow-footer-space, var(--calcite-flow-item-footer-padding));--calcite-panel-header-action-background-color-hover: var(--calcite-flow-header-action-background-color-hover);--calcite-panel-header-action-background-color-press: var(--calcite-flow-header-action-background-color-press);--calcite-panel-header-action-background-color: var(--calcite-flow-header-action-background-color);--calcite-panel-header-action-indicator-color: var(--calcite-flow-header-action-indicator-color);--calcite-panel-header-action-text-color-press: var(--calcite-flow-header-action-text-color-press);--calcite-panel-header-action-text-color: var(--calcite-flow-header-action-text-color);--calcite-panel-header-background-color: var(--calcite-flow-header-background-color);--calcite-panel-header-content-space: var(--calcite-flow-header-content-space);--calcite-panel-header-top-space: var(--calcite-flow-header-top-space);--calcite-panel-heading-text-color: var(--calcite-flow-heading-text-color);--calcite-panel-icon-color: var(--calcite-flow-icon-color);--calcite-panel-space: var(--calcite-flow-space);--calcite-panel-content-top-space: var(--calcite-flow-content-top-space);--calcite-panel-content-bottom-space: var(--calcite-flow-content-bottom-space)}:host([hidden]){display:none}[hidden]{display:none}`,h=class extends m{constructor(){super(...arguments),this.backButtonRef=d(),this.containerRef=d(),this.direction=w(),this.messages=k(),this.interactiveContainer=y(this),this.closable=!1,this.closed=!1,this.collapseDirection="down",this.collapsed=!1,this.collapsible=!1,this.disabled=!1,this.iconFlipRtl=!1,this.loading=!1,this.focusTrapDisabled=!1,this.menuOpen=!1,this.overlayPositioning="absolute",this.scale="m",this.selected=!1,this.showBackButton=!1,this.topLayerDisabled=!1,this.calciteFlowItemBack=a(),this.calciteFlowItemClose=a({cancelable:!1}),this.calciteFlowItemCollapse=a({cancelable:!1}),this.calciteFlowItemExpand=a({cancelable:!1}),this.calciteFlowItemScroll=a({cancelable:!1}),this.calciteFlowItemToggle=a({cancelable:!1}),this.calciteInternalFlowItemChange=a({cancelable:!1})}static{this.properties={beforeBack:[0,{},{attribute:!1}],beforeClose:[0,{},{attribute:!1}],closable:[7,{},{reflect:!0,type:Boolean}],closed:[7,{},{reflect:!0,type:Boolean}],collapseDirection:1,collapsed:[7,{},{reflect:!0,type:Boolean}],collapsible:[7,{},{reflect:!0,type:Boolean}],description:1,disabled:[7,{},{reflect:!0,type:Boolean}],heading:1,headingLevel:[11,{},{type:Number,reflect:!0}],icon:[3,{},{reflect:!0}],iconFlipRtl:[7,{},{reflect:!0,type:Boolean}],loading:[7,{},{reflect:!0,type:Boolean}],focusTrapDisabled:[5,{},{type:Boolean}],focusTrapOptions:[0,{},{attribute:!1}],menuOpen:[7,{},{reflect:!0,type:Boolean}],messageOverrides:[0,{},{attribute:!1}],overlayPositioning:[3,{},{reflect:!0}],scale:[3,{},{reflect:!0}],selected:[7,{},{reflect:!0,type:Boolean}],showBackButton:[5,{},{type:Boolean}],topLayerDisabled:[7,{},{reflect:!0,type:Boolean}]}}static{this.styles=A}async scrollContentTo(e){await this.containerRef.value?.scrollContentTo(e)}async setFocus(e){return this.containerRef.value?.setFocus(e)}async updateFocusTrapElements(e){this.containerRef.value?.updateFocusTrapElements(e)}willUpdate(e){e.has("selected")&&(this.hasUpdated||this.selected!==!1)&&this.calciteInternalFlowItemChange.emit(),e.has("collapsed")&&this.hasUpdated&&(this.collapsed?this.calciteFlowItemCollapse.emit():this.calciteFlowItemExpand.emit())}handleInternalPanelScroll(e){e.target===this.containerRef.value&&(e.stopPropagation(),this.calciteFlowItemScroll.emit())}handleInternalPanelClose(e){e.target===this.containerRef.value&&(e.stopPropagation(),this.closed=!0,this.calciteFlowItemClose.emit())}handleInternalPanelToggle(e){e.target===this.containerRef.value&&(e.stopPropagation(),this.collapsed=e.target.collapsed,this.calciteFlowItemToggle.emit())}backButtonClick(){this.calciteFlowItemBack.emit()}renderBackButton(){let e=this.direction==="rtl",{showBackButton:c,backButtonClick:s,messages:i}=this,l=i.back,n=e?B.backRight:B.backLeft;return c?v("flow-back-button",r`<calcite-action class=${g(L.backButton)} .icon=${n} @click=${s} .scale=${this.scale} slot=${o.headerActionsStart} .text=${l} title=${l??b} ${p(this.backButtonRef)}></calcite-action>`):null}render(){let{collapsed:e,collapseDirection:c,collapsible:s,closable:i,closed:l,description:n,disabled:f,heading:T,headingLevel:C,loading:I,menuOpen:F,messageOverrides:x,overlayPositioning:S,beforeClose:R,icon:P,iconFlipRtl:D,focusTrapDisabled:E,focusTrapOptions:O}=this;return this.interactiveContainer({disabled:f,children:r`<calcite-panel .beforeClose=${R} .closable=${i} .closed=${l} .collapsed=${e} .collapseDirection=${c} .collapsible=${s} .description=${n} .disabled=${f} .focusTrapDisabled=${E} focus-trap-enabled-by-parent .focusTrapOptions=${O} .heading=${T} .headingLevel=${C} .icon=${P} .iconFlipRtl=${D} .loading=${I} .menuOpen=${F} .messageOverrides=${x} @calcitePanelClose=${this.handleInternalPanelClose} @calcitePanelScroll=${this.handleInternalPanelScroll} @calcitePanelToggle=${this.handleInternalPanelToggle} .overlayPositioning=${S} .scale=${this.scale} .topLayerDisabled=${this.topLayerDisabled} ${p(this.containerRef)}>${this.renderBackButton()}<slot name=${o.actionBar} slot=${t.actionBar}></slot><slot name=${o.alerts} slot=${t.alerts}></slot><slot name=${o.headerActionsStart} slot=${t.headerActionsStart}></slot><slot name=${o.headerActionsEnd} slot=${t.headerActionsEnd}></slot><slot name=${o.headerTop} slot=${t.headerTop}></slot><slot name=${o.description} slot=${t.description}></slot><slot name=${o.heading} slot=${t.heading}></slot><slot name=${o.headerContent} slot=${t.headerContent}></slot><slot name=${o.headerMenuActions} slot=${t.headerMenuActions}></slot><slot name=${o.fab} slot=${t.fab}></slot><slot name=${o.contentTop} slot=${t.contentTop}></slot><slot name=${o.contentBottom} slot=${t.contentBottom}></slot><slot name=${o.footerStart} slot=${t.footerStart}></slot><slot name=${o.footer} slot=${t.footer}></slot><slot name=${o.footerEnd} slot=${t.footerEnd}></slot><slot></slot></calcite-panel>`})}};$("calcite-flow-item",h);export{h as FlowItem};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{a as s}from"./FDHY2TZA.js";import{G as n,H as o,T as r,g as i,h as c,p as a}from"./
|
|
2
|
+
import{a as s}from"./FDHY2TZA.js";import{G as n,H as o,T as r,g as i,h as c,p as a}from"./RREWRPJD.js";var l={accordion:"accordion",transparent:"accordion--transparent"},d=i`:host{position:relative;display:block;max-inline-size:100%;line-height:var(--calcite-font-line-height-relative-normal)}.accordion{border-width:var(--calcite-border-width-sm);border-style:solid;border-block-end-width:var(--calcite-border-width-none);border-color:var(--calcite-accordion-border-color, var(--calcite-color-border-2));background-color:var(--calcite-accordion-background-color, var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1)))}.accordion--transparent{--calcite-accordion-border-color: transparent;border-color:var(--calcite-color-transparent);background-color:var(--calcite-color-transparent)}:host([scale=s]){--calcite-internal-accordion-item-spacing-unit: .25rem;--calcite-internal-accordion-icon-margin: .5rem;--calcite-internal-accordion-item-padding: var(--calcite-internal-accordion-item-spacing-unit) .5rem;font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm)}:host([scale=m]){--calcite-internal-accordion-item-spacing-unit: .5rem;--calcite-internal-accordion-icon-margin: .75rem;--calcite-internal-accordion-item-padding: var(--calcite-internal-accordion-item-spacing-unit) .75rem;font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base)}:host([scale=l]){--calcite-internal-accordion-item-spacing-unit: .75rem;--calcite-internal-accordion-icon-margin: 1rem;--calcite-internal-accordion-item-padding: var(--calcite-internal-accordion-item-spacing-unit) 1rem;font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md)}:host([hidden]){display:none}[hidden]{display:none}`,t=class extends n{constructor(){super(),this.mutationObserver=s("mutation",()=>this.updateAccordionItems()),this.appearance="solid",this.iconPosition="end",this.iconType="chevron",this.scale="m",this.selectionMode="multiple",this.calciteInternalAccordionChange=a({cancelable:!1}),this.listen("calciteInternalAccordionItemSelect",this.updateActiveItemOnChange)}static{this.properties={appearance:[3,{},{reflect:!0}],iconPosition:[3,{},{reflect:!0}],iconType:[3,{},{reflect:!0}],scale:[3,{},{reflect:!0}],selectionMode:[3,{},{reflect:!0}]}}static{this.styles=d}connectedCallback(){super.connectedCallback(),this.mutationObserver?.observe(this.el,{childList:!0}),this.updateAccordionItems()}willUpdate(e){(e.has("appearance")&&(this.hasUpdated||this.appearance!=="solid")||e.has("iconPosition")&&(this.hasUpdated||this.iconPosition!=="end")||e.has("iconType")&&(this.hasUpdated||this.iconType!=="chevron")||e.has("scale")&&(this.hasUpdated||this.scale!=="m")||e.has("selectionMode")&&(this.hasUpdated||this.selectionMode!=="multiple"))&&this.updateAccordionItems()}loaded(){this.dispatchAccordionItemsSync()}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect()}updateActiveItemOnChange(e){this.calciteInternalAccordionChange.emit({requestedAccordionItem:e.detail.requestedAccordionItem}),e.stopPropagation()}updateAccordionItems(){this.el.querySelectorAll("calcite-accordion-item").forEach(e=>{e.appearance=this.appearance,e.iconPosition=this.iconPosition,e.iconType=this.iconType,e.scale=this.scale}),this.manager.loadedCalled&&this.dispatchAccordionItemsSync()}dispatchAccordionItemsSync(){document.dispatchEvent(new CustomEvent("calciteInternalAccordionItemsSync"))}render(){let e=this.appearance==="transparent";return c`<div class=${o({[l.transparent]:e,[l.accordion]:!e})}><slot></slot></div>`}};r("calcite-accordion",t);export{t as Accordion};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{a as F}from"./
|
|
2
|
+
import{a as F}from"./DQATRBX3.js";import{a as O,b as B}from"./JTLM663P.js";import{c as f,e as z,f as C,g as D,h as L,i as h}from"./JLYG24RV.js";import"./WTNYMVTD.js";import"./5K4OZJAZ.js";import{a as d}from"./6FZVJGKC.js";import{a as E}from"./DMG7ZR57.js";import{a as w}from"./CNNZUX2A.js";import"./JN6YLTUP.js";import{a as k}from"./SKYM7COB.js";import"./2IM7ZZ7U.js";import{e as x}from"./KQDGRC6H.js";import"./MHUK6DQI.js";import"./RRBGCYLX.js";import{E as g,F as p,G as b,H as o,T as y,g as u,h as v,p as t}from"./RREWRPJD.js";var S=u`:host{display:contents;--calcite-internal-tooltip-padding-block: var(--calcite-theme-space-sm, var(--calcite-spacing-sm));--calcite-internal-tooltip-padding-inline: var(--calcite-theme-space-md, var(--calcite-spacing-md))}:host([top-layer-disabled]){--calcite-floating-ui-z-index: var(--calcite-z-index-tooltip)}.position-container{inline-size:max-content;display:none;max-inline-size:100vw;max-block-size:100vh;inset-block-start:0;left:0;z-index:var(--calcite-floating-ui-z-index)}@starting-style{.position-container{opacity:0;inset-block-start:0;left:0}}.position-container{max-inline-size:var(--calcite-tooltip-max-size-x, 20rem);max-block-size:20rem}.position-container[popover]{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;display:none}.position-container:popover-open{display:block}.position-container .calcite-floating-ui-anim{position:relative;transition-duration:var(--calcite-floating-ui-transition);transition-property:inset-block-start,left,opacity,display;transition-behavior:allow-discrete;opacity:0;box-shadow:0 0 16px #00000029;border-radius:var(--calcite-corner-radius-sm);z-index:var(--calcite-z-index)}.position-container[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.position-container[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.position-container[data-placement^=left] .calcite-floating-ui-anim{left:5px}.position-container[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.position-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block-start:0;left:0}@starting-style{.position-container[data-placement] .calcite-floating-ui-anim--active{opacity:0}}.calcite-floating-ui-arrow{z-index:calc(var(--calcite-z-index) * -1);position:absolute;pointer-events:none;fill:var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1))}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-color-border-3)}:host([scale=s]){--calcite-internal-tooltip-padding-block: var(--calcite-theme-space-2xs, var(--calcite-spacing-xxs));--calcite-internal-tooltip-padding-inline: var(--calcite-theme-space-sm, var(--calcite-spacing-sm))}:host([scale=s]) .container{font-size:var(--calcite-font-size-relative-xs);line-height:var(--calcite-font-line-height-relative-snug)}:host([scale=l]) .container{font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-relative-snug)}.container{font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-relative-snug);overflow-wrap:break-word;word-break:break-word;position:relative;overflow:hidden;font-weight:var(--calcite-font-weight-medium);padding-block:var(--calcite-internal-tooltip-padding-block);padding-inline:var(--calcite-internal-tooltip-padding-inline);border-radius:var(--calcite-tooltip-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)));color:var(--calcite-tooltip-text-color, var(--calcite-color-text-1));text-align:start}.position-container .calcite-floating-ui-anim{border-width:var(--calcite-border-width-sm);border-style:solid;box-shadow:var(--calcite-shadow-md);background-color:var(--calcite-tooltip-background-color, var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1)));border-color:var(--calcite-tooltip-border-color, var(--calcite-color-border-3));border-radius:var(--calcite-tooltip-corner-radius, var(--calcite-theme-corner-radius-sm, var(--calcite-corner-radius-round)))}.calcite-floating-ui-arrow{fill:var(--calcite-tooltip-background-color, var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1)))}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-tooltip-border-color, var(--calcite-color-border-3))}:host([hidden]){display:none}[hidden]{display:none}`,T=B({hover:!0}),m=class extends b{constructor(){super(...arguments),this.direction=x(),this.referenceElementType="hover",this.referenceElementController=O({manager:T})(this),this.transitionProp="opacity",this.transitionRef=g(),this.topLayer=E({disabledOverride:()=>this.open&&!this.referenceEl,target:()=>this.floatingEl})(this),this.floatingLayout="vertical",this.closeOnClick=!1,this.offsetDistance=h,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.pointerDisabled=!1,this.scale="m",this.topLayerDisabled=!1,this.calciteTooltipBeforeClose=t({cancelable:!1}),this.calciteTooltipBeforeOpen=t({cancelable:!1}),this.calciteTooltipClose=t({cancelable:!1}),this.calciteTooltipOpen=t({cancelable:!1})}static{this.properties={floatingLayout:[16,{},{state:!0}],referenceEl:[16,{},{state:!0}],closeOnClick:[7,{},{reflect:!0,type:Boolean}],label:1,offsetDistance:[11,{},{type:Number,reflect:!0}],offsetSkidding:[11,{},{reflect:!0,type:Number}],open:[7,{},{reflect:!0,type:Boolean}],overlayPositioning:[3,{},{reflect:!0}],placement:[3,{},{reflect:!0}],pointerDisabled:[7,{},{reflect:!0,type:Boolean}],referenceElement:1,scale:[3,{},{reflect:!0}],topLayerDisabled:[7,{},{reflect:!0,type:Boolean}]}}static{this.styles=S}async reposition(e=!1){let{referenceEl:a,placement:r,overlayPositioning:l,offsetDistance:n,offsetSkidding:i,arrowEl:c,floatingEl:s}=this;return z(this,{direction:this.direction,floatingEl:s,referenceEl:a,overlayPositioning:l,placement:r,offsetDistance:n,offsetSkidding:i,arrowEl:c,type:"tooltip"},e)}willUpdate(e){(e.has("offsetDistance")&&(this.hasUpdated||this.offsetDistance!==h)||e.has("offsetSkidding")&&(this.hasUpdated||this.offsetSkidding!==0)||e.has("overlayPositioning")&&(this.hasUpdated||this.overlayPositioning!=="absolute")||e.has("placement")&&(this.hasUpdated||this.placement!=="auto"))&&this.reposition(!0),e.has("open")&&(this.hasUpdated||this.open!==!1)&&this.openHandler(),e.has("referenceElement")&&!this.referenceElement&&this.open&&this.topLayer.hide()}updated(e){e.has("referenceEl")&&D(this)}disconnectedCallback(){super.disconnectedCallback(),L(this)}openHandler(){w(this),this.reposition(!0)}onBeforeOpen(){this.calciteTooltipBeforeOpen.emit(),this.topLayer.show()}onOpen(){this.calciteTooltipOpen.emit()}onBeforeClose(){this.calciteTooltipBeforeClose.emit()}onClose(){this.calciteTooltipClose.emit(),C(this),this.topLayer.hide()}setFloatingEl(e){this.floatingEl=e}setArrowEl(e){this.arrowEl=e,this.reposition(!0)}render(){let{referenceEl:e,label:a,open:r,pointerDisabled:l,floatingLayout:n}=this,i=e&&r,c=!i,s=l?null:k("floating-arrow",F({floatingLayout:n,ref:this.setArrowEl}));return this.el.inert=c,this.el.ariaLabel=a??null,this.el.role="tooltip",v`<div class=${o(d.positionContainer)} popover=manual ${p(this.setFloatingEl)}><div class=${o({[f.animation]:!0,[f.animationActive]:i})} ${p(this.transitionRef)}>${s}<div class=${o(d.container)}><slot></slot></div></div></div>`}};y("calcite-tooltip",m);export{m as Tooltip};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{b as o,c as r,d as m}from"./
|
|
2
|
+
import{b as o,c as r,d as m}from"./GGQA652X.js";import"./KQDGRC6H.js";import"./MHUK6DQI.js";import"./RRBGCYLX.js";import{G as i,H as c,T as s,g as a,h as l,p as n}from"./RREWRPJD.js";var h={container:"container"},d=a`:host{display:flex}:host([alignment=start]){text-align:start}:host([alignment=end]){text-align:end}:host([alignment=center]){text-align:center}:host([scale=s]) .container{font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);gap:var(--calcite-space-2xs);margin-block-end:var(--calcite-label-margin-bottom, .5rem)}:host([scale=m]) .container{font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base);gap:var(--calcite-space-sm);margin-block-end:var(--calcite-label-margin-bottom, .75rem)}:host([scale=l]) .container{font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);gap:var(--calcite-space-sm);margin-block-end:var(--calcite-label-margin-bottom, 1rem)}:host .container{margin-block-start:var(--calcite-space-none);margin-inline:var(--calcite-space-none);inline-size:100%;line-height:var(--calcite-font-line-height-relative-snug);color:var(--calcite-label-text-color, var(--calcite-color-text-1))}:host([layout=block]) .container{display:flex;flex-direction:column}:host([layout=inline]) .container,:host([layout=inline-space-between]) .container{display:flex;flex-direction:row;align-items:center;gap:var(--calcite-space-sm)}:host([layout=inline][scale=l]) .container{gap:var(--calcite-space-md)}:host([layout=inline-space-between]) .container{justify-content:space-between}:host([hidden]){display:none}[hidden]{display:none}`,t=class extends i{constructor(){super(),this.alignment="start",this.layout="block",this.scale="m",this.calciteInternalLabelClick=n({bubbles:!1,cancelable:!1}),this.listen("click",this.labelClickHandler)}static{this.properties={alignment:[3,{},{reflect:!0}],for:[3,{},{reflect:!0}],layout:[3,{},{reflect:!0}],scale:[3,{},{reflect:!0}]}}static{this.styles=d}connectedCallback(){super.connectedCallback(),document.dispatchEvent(new CustomEvent(o))}willUpdate(e){e.has("for")&&m(this.el)}disconnectedCallback(){super.disconnectedCallback(),document.dispatchEvent(new CustomEvent(r))}labelClickHandler(e){window.getSelection()?.type==="Range"||e.defaultPrevented||this.calciteInternalLabelClick.emit({sourceEvent:e})}render(){return l`<div class=${c(h.container)}><slot></slot></div>`}};s("calcite-label",t);export{t as Label};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{a as v,b as t}from"./IR2A2F5H.js";import{b as u}from"./WTNYMVTD.js";import"./2IM7ZZ7U.js";import{v as g}from"./RRBGCYLX.js";import{G as h,H as n,T as m,g as s,h as l,p as d}from"./
|
|
2
|
+
import{a as v,b as t}from"./IR2A2F5H.js";import{b as u}from"./WTNYMVTD.js";import"./2IM7ZZ7U.js";import{v as g}from"./RRBGCYLX.js";import{G as h,H as n,T as m,g as s,h as l,p as d}from"./RREWRPJD.js";var b=s`:host{display:flex;cursor:pointer;align-self:stretch;font-weight:var(--calcite-theme-font-weight-regular, var(--calcite-font-weight-normal));outline-color:var(--calcite-color-transparent);transition:background-color var(--calcite-internal-animation-timing-fast) ease-in-out}.label{pointer-events:none;margin:var(--calcite-space-base);box-sizing:border-box;display:flex;flex:1 1 0%;align-items:center;color:var(--calcite-segmented-control-color, var(--calcite-color-text-3));background-color:var(--calcite-segmented-control-background-color);box-shadow:var(--calcite-segmented-control-shadow);border-radius:max(0px,var(--calcite-segmented-control-corner-radius, var(--calcite-corner-radius)) - 2px);transition:background-color var(--calcite-internal-animation-timing-fast) ease-in-out,color var(--calcite-internal-animation-timing-fast) ease-in-out}.label--horizontal{justify-content:center}:host(:focus){outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(-1 * var(--calcite-space-base) * (1 - 2 * clamp(0,var(--calcite-offset-invert-focus),1)));outline-offset:-1px;z-index:var(--calcite-z-index);border-radius:var(--calcite-segmented-control-corner-radius, var(--calcite-corner-radius))}.label--scale-s{font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);padding-inline:var(--calcite-space-sm);padding-block:.125rem}.label--scale-m{font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base);padding-inline:var(--calcite-space-md);padding-block:.375rem}.label--scale-l{font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);padding-inline:var(--calcite-space-lg);padding-block:var(--calcite-space-sm-plus)}:host(:hover) .label{background-color:var(--calcite-segmented-control-background-color, var(--calcite-theme-color-surface-3, var(--calcite-color-foreground-2)));color:var(--calcite-segmented-control-color, var(--calcite-color-text-1))}:host(:active) .label{background-color:var(--calcite-segmented-control-background-color, var(--calcite-theme-color-surface-4, var(--calcite-color-foreground-3)))}:host([checked]) .label{cursor:default;background-color:var(--calcite-segmented-control-background-color, var(--calcite-color-brand));color:var(--calcite-segmented-control-color, var(--calcite-color-text-inverse))}:host([checked]) .label--outline,:host([checked]) .label--outline-fill{background-color:var(--calcite-segmented-control-background-color, var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1)));box-shadow:var(--calcite-segmented-control-shadow, inset 0 0 0 1px var(--calcite-color-brand));color:var(--calcite-segmented-control-color, var(--calcite-color-brand))}:host([checked]) .label--outline{background-color:var(--calcite-segmented-control-background-color, transparent)}::slotted(input){display:none}@media(forced-colors:active){:host([checked]) .label{background-color:highlight}:host([checked]) .label--outline,:host([checked]) .label--outline-fill{outline:var(--calcite-border-width-md) solid transparent;outline-offset:var(--calcite-border-width-md)}:host([checked]) .label:not([class~=label--outline]) .icon{color:highlightText}}.icon{position:relative;margin:var(--calcite-space-none);display:inline-flex;line-height:inherit;margin-inline-start:var(--calcite-internal-segmented-control-icon-margin-start);margin-inline-end:var(--calcite-internal-segmented-control-icon-margin-end);--calcite-icon-color: var(--calcite-segmented-control-icon-color)}:host([icon-start]) .label--scale-s{--calcite-internal-segmented-control-icon-margin-end: .5rem}:host([icon-end]) .label--scale-s{--calcite-internal-segmented-control-icon-margin-start: .5rem}:host([icon-start]) .label--scale-m{--calcite-internal-segmented-control-icon-margin-end: .75rem}:host([icon-end]) .label--scale-m{--calcite-internal-segmented-control-icon-margin-start: .75rem}:host([icon-start]) .label--scale-l{--calcite-internal-segmented-control-icon-margin-end: 1rem}:host([icon-end]) .label--scale-l{--calcite-internal-segmented-control-icon-margin-start: 1rem}.label .icon--solo{--calcite-internal-segmented-control-icon-margin-start: 0;--calcite-internal-segmented-control-icon-margin-end: 0}:host([hidden]){display:none}[hidden]{display:none}`,r=class extends h{constructor(){super(...arguments),this.hasSlottedContent=!1,this.appearance="solid",this.checked=!1,this.iconFlipRtl=!1,this.layout="horizontal",this.scale="m",this.calciteInternalSegmentedControlItemChange=d({cancelable:!1})}static{this.properties={hasSlottedContent:[16,{},{state:!0}],appearance:1,checked:[7,{},{reflect:!0,type:Boolean}],iconEnd:[3,{},{reflect:!0}],iconFlipRtl:[7,{},{reflect:!0,type:Boolean}],iconStart:[3,{},{reflect:!0}],layout:1,scale:1,value:1}}static{this.styles=b}willUpdate(e){e.has("checked")&&(this.hasUpdated||this.checked!==!1)&&this.calciteInternalSegmentedControlItemChange.emit()}handleSlotChange(e){this.hasSlottedContent=g(e)}renderIcon(e,a=!1){return e?l`<calcite-icon class=${n({[t.icon]:!0,[t.iconSolo]:a})} .flipRtl=${this.iconFlipRtl} .icon=${e} scale=s></calcite-icon>`:null}render(){let{appearance:e,checked:a,layout:o,scale:c,value:i}=this;return this.el.ariaChecked=u(a),this.el.ariaLabel=i,this.el.role="radio",l`<label class=${n({[t.label]:!0,[t.labelScale(c)]:!0,[t.labelHorizontal]:o==="horizontal",[t.labelOutline]:e==="outline",[t.labelOutlineFill]:e==="outline-fill"})}>${this.renderContent()}</label>`}renderContent(){let{hasSlottedContent:e,iconEnd:a,iconStart:o}=this,c=o||a;return!e&&c?[this.renderIcon(c,!0),l`<slot @slotchange=${this.handleSlotChange}></slot>`]:[this.renderIcon(o),l`<slot @slotchange=${this.handleSlotChange}></slot>`,l`<slot name=${v.input}></slot>`,this.renderIcon(a)]}};m("calcite-segmented-control-item",r);export{r as SegmentedControlItem};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{H as h,h as s}from"./
|
|
2
|
+
import{H as h,h as s}from"./RREWRPJD.js";var i={textMatch:"text-match"};function c({text:r,pattern:a}){if(!a||!r)return r;let t=r.split(a);return t.length>1&&(t[1]=s`<mark class=${h(i.textMatch)}>${t[1]}</mark>`),t}export{c as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{e as g}from"./XY2NGASJ.js";import{a as S}from"./
|
|
2
|
+
import{e as g}from"./XY2NGASJ.js";import{a as S}from"./45UWYTX5.js";import"./2IM7ZZ7U.js";import{a as f}from"./YUOWOBVQ.js";import"./VMHJHFFS.js";import"./KQDGRC6H.js";import"./MHUK6DQI.js";import{A as u,E as a}from"./RRBGCYLX.js";import{E as n,F as h,G as d,H as p,T as m,g as l,h as o,p as r}from"./RREWRPJD.js";var w={container:"container"},b=l`:host([disabled]){opacity:var(--calcite-opacity-disabled);cursor:default;-webkit-user-select:none;user-select:none}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex}.container{display:flex;flex-wrap:wrap;gap:var(--calcite-swatch-group-space, var(--calcite-theme-space-sm, var(--calcite-spacing-sm)))}:host([scale=s]) .container{gap:var(--calcite-swatch-group-space, var(--calcite-theme-space-xs, var(--calcite-spacing-xs)))}:host([hidden]){display:none}[hidden]{display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:var(--calcite-opacity-full)}.interaction-container{display:contents}`,c=class extends d{constructor(){super(),this.items=[],this.slotRef=n(),this.focusSetter=f()(this).setFocus,this.interactiveContainer=S(this),this.disabled=!1,this.scale="m",this.selectedItems=[],this.selectionMode="none",this.calciteSwatchGroupSelect=r({cancelable:!1}),this.listen("keydown",this.keyDownHandler),this.listen("calciteSwatchSelect",this.calciteSwatchSelectListener),this.listen("calciteInternalSwatchSelect",this.calciteInternalSwatchSelectListener),this.listen("calciteInternalSyncSelectedSwatches",this.calciteInternalSyncSelectedSwatches)}static{this.properties={disabled:[7,{},{reflect:!0,type:Boolean}],label:1,scale:[3,{},{reflect:!0}],selectedItems:[0,{},{attribute:!1}],selectionMode:[3,{},{reflect:!0}]}}static{this.styles=b}async setFocus(e){return this.focusSetter(()=>this.el,e)}willUpdate(e){(e.has("scale")||e.has("selectionMode"))&&(this.hasUpdated||this.selectionMode!=="none")&&this.updateItems()}keyDownHandler(e){let t=e.composedPath().find(g);if(e.defaultPrevented||!t||!this.el.contains(t))return;let s=this.items.filter(i=>!i.disabled);if(s.includes(t))switch(e.key){case"ArrowRight":a(s,t,"next"),e.preventDefault();break;case"ArrowLeft":a(s,t,"previous"),e.preventDefault();break;case"Home":a(s,t,"first"),e.preventDefault();break;case"End":a(s,t,"last"),e.preventDefault();break}}calciteSwatchSelectListener(e){e.composedPath().includes(this.el)&&this.setSelectedItems(!0,e.target),e.stopPropagation()}calciteInternalSwatchSelectListener(e){e.composedPath().includes(this.el)&&this.setSelectedItems(!1,e.target),e.stopPropagation()}calciteInternalSyncSelectedSwatches(e){e.composedPath().includes(this.el)&&(this.updateSelectedItems(),this.selectionMode==="single"&&this.selectedItems.length>1&&this.setSelectedItems(!1,e.target)),e.stopPropagation()}handleSlotChange(e){this.updateItems(u(e,"calcite-swatch"))}updateItems(e=this.items){this.items=e,!(this.items.length<1)&&(this.items.forEach(t=>{t.interactive=!0,t.scale=this.scale,t.selectionMode=this.selectionMode,t.parentSwatchGroup=this.el}),this.setSelectedItems(!1))}updateSelectedItems(){this.selectedItems=this.items.filter(e=>e.selected)}setSelectedItems(e,t){t&&this.items.forEach(s=>{let i=t===s;switch(this.selectionMode){case"multiple":i&&(s.selected=!s.selected);break;case"single":s.selected=i?!s.selected:!1;break;case"single-persist":s.selected=!!i;break}}),this.updateSelectedItems(),e&&this.calciteSwatchGroupSelect.emit()}render(){let e=this.selectionMode==="none"||this.selectionMode==="multiple"?"group":"radiogroup",{disabled:t}=this;return this.interactiveContainer({disabled:t,children:o`<div .ariaLabel=${this.label} class=${p(w.container)} .role=${e}><slot @slotchange=${this.handleSlotChange} ${h(this.slotRef)}></slot></div>`})}};m("calcite-swatch-group",c);export{c as SwatchGroup};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{a as e}from"./FR6PIDS2.js";import{a as m}from"./
|
|
2
|
+
import{a as e}from"./FR6PIDS2.js";import{a as m}from"./K6NURNKM.js";import"./IHUVSGGJ.js";import{a as s}from"./SKYM7COB.js";import"./2IM7ZZ7U.js";import{a as u}from"./YUOWOBVQ.js";import"./VMHJHFFS.js";import"./KQDGRC6H.js";import"./MHUK6DQI.js";import"./RRBGCYLX.js";import{G as p,H as a,J as n,T as f,g as h,h as i}from"./RREWRPJD.js";var x=h`:host{display:inline-flex}:host([scale=s]){--calcite-internal-navigation-logo-padding-inline: var(--calcite-space-md);--calcite-internal-navigation-logo-image-size: 1.75rem;--calcite-internal-navigation-logo-heading-font-size: var(--calcite-font-size-relative-base);--calcite-internal-navigation-logo-heading-standalone-font-size: var(--calcite-font-size-1);--calcite-internal-navigation-logo-description-font-size: var(--calcite-font-size-relative-sm);--calcite-internal-navigation-logo-heading-line-height: var(--calcite-space-lg);--calcite-internal-navigation-logo-description-line-height: var(--calcite-space-lg)}:host([scale=m]){--calcite-internal-navigation-logo-padding-inline: var(--calcite-space-lg);--calcite-internal-navigation-logo-image-size: 1.75rem;--calcite-internal-navigation-logo-heading-font-size: var(--calcite-font-size-relative-md);--calcite-internal-navigation-logo-heading-standalone-font-size: var(--calcite-font-size-relative-xl);--calcite-internal-navigation-logo-description-font-size: var(--calcite-font-size-relative-base);--calcite-internal-navigation-logo-heading-line-height: var(--calcite-space-xl);--calcite-internal-navigation-logo-description-line-height: var(--calcite-space-lg)}:host([scale=l]){--calcite-internal-navigation-logo-padding-inline: var(--calcite-space-xl);--calcite-internal-navigation-logo-image-size: 2.75rem;--calcite-internal-navigation-logo-heading-font-size: var(--calcite-font-size-relative-xl);--calcite-internal-navigation-logo-heading-standalone-font-size: var(--calcite-font-size-relative-2xl);--calcite-internal-navigation-logo-description-font-size: var(--calcite-font-size-relative-lg);--calcite-internal-navigation-logo-heading-line-height: var(--calcite-space-2xl);--calcite-internal-navigation-logo-description-line-height: var(--calcite-space-2xl)}.container{font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);display:flex;margin:var(--calcite-space-none);align-items:center;justify-content:center;background-color:var(--calcite-navigation-background-color, var(--calcite-internal-navigation-logo-background-color, var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1))));border-block-end:2px solid var(--calcite-color-transparent)}.container--link{outline-color:var(--calcite-color-transparent);cursor:pointer;text-decoration-line:none}:host(:focus) .container--link{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(-1 * var(--calcite-space-base) * (1 - 2 * clamp(0,var(--calcite-offset-invert-focus),1)))}.image{block-size:var(--calcite-internal-navigation-logo-image-size)}.image,.icon{display:flex;margin:var(--calcite-space-none);color:var(--calcite-navigation-logo-text-color, var(--calcite-icon-color, var(--calcite-internal-navigation-logo-text-color, var(--calcite-ui-icon-color, inherit))));padding-inline:var(--calcite-internal-navigation-logo-padding-inline)}.image~.icon{padding-inline-start:var(--calcite-space-none)}.image~.text-container,.icon~.text-container{padding-inline-start:var(--calcite-space-none)}:host([href]:hover),:host([href]:focus){--calcite-internal-navigation-logo-background-color: var( --calcite-theme-color-surface-3, var(--calcite-color-foreground-2) )}:host([href]:active){--calcite-internal-navigation-logo-background-color: var( --calcite-theme-color-surface-4, var(--calcite-color-foreground-3) )}:host([active]) .container{border-block-end-color:var(--calcite-navigation-accent-color, var(--calcite-color-brand))}:host([active]),:host([href]:active){--calcite-internal-navigation-logo-text-color: var(--calcite-color-brand)}.text-container{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:flex;flex-direction:column;text-align:start;margin-block-start:var(--calcite-space-base);padding-inline:var(--calcite-internal-navigation-logo-padding-inline)}.heading{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-inline-start:var(--calcite-space-none);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-navigation-logo-heading-text-color, var(--calcite-color-text-1));font-size:var(--calcite-internal-navigation-logo-heading-font-size);padding-block-start:var(--calcite-space-2xs);line-height:var(--calcite-internal-navigation-logo-heading-line-height)}.standalone{font-size:var(--calcite-internal-navigation-logo-heading-standalone-font-size);padding-block-start:0}.description{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--calcite-navigation-logo-text-color, var(--calcite-color-text-2));font-size:var(--calcite-internal-navigation-logo-description-font-size);line-height:var(--calcite-internal-navigation-logo-description-line-height)}:host([hidden]){display:none}[hidden]{display:none}`,g=class extends p{constructor(){super(...arguments),this.focusSetter=u()(this).setFocus,this.active=!1,this.iconFlipRtl=!1,this.scale="m"}static{this.properties={active:[7,{},{reflect:!0,type:Boolean}],description:1,heading:1,headingLevel:[11,{},{type:Number,reflect:!0}],href:[3,{},{reflect:!0}],icon:[3,{},{reflect:!0}],iconFlipRtl:[7,{},{reflect:!0,type:Boolean}],label:1,rel:[3,{},{reflect:!0}],target:[3,{},{reflect:!0}],thumbnail:1,scale:[3,{},{reflect:!0}]}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=x}async setFocus(t){return this.focusSetter(()=>this.href?this.el:void 0,t)}renderIcon(){return i`<calcite-icon class=${a(e.icon)} .flipRtl=${this.iconFlipRtl} .icon=${this.icon} .scale=${this.scale==="s"?"m":"l"}></calcite-icon>`}renderHeaderContent(){let{heading:t,headingLevel:o,description:c}=this,l=t?s(e.heading,m({class:{[e.heading]:!0,[e.standalone]:!this.description},level:o,children:t})):null,r=c?s(e.description,i`<span class=${a(e.description)}>${c}</span>`):null;return l||r?s(e.textContainer,i`<div class=${a(e.textContainer)}>${l}${r}</div>`):null}render(){let{icon:t,href:o,label:c,rel:l,target:r,thumbnail:v}=this,d=i`${v&&i`<img alt=${(c||"")??n} class=${a(e.image)} src=${v??n}>`||""}${t&&this.renderIcon()||""}${this.renderHeaderContent()}`;return o?i`<a class=${a({[e.container]:!0,[e.containerLink]:!0})} href=${o??n} rel=${l??n} target=${r??n}>${d}</a>`:i`<div class=${a(e.container)}>${d}</div>`}};f("calcite-navigation-logo",g);export{g as NavigationLogo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{a as t,b as E,c as n,d}from"./XY2NGASJ.js";import{a as M,t as m}from"./QYVKOLJZ.js";import"./6TP6A2OR.js";import{a as k}from"./
|
|
2
|
+
import{a as t,b as E,c as n,d}from"./XY2NGASJ.js";import{a as M,t as m}from"./QYVKOLJZ.js";import"./6TP6A2OR.js";import{a as k}from"./45UWYTX5.js";import"./5K4OZJAZ.js";import{a as I}from"./JN6YLTUP.js";import{a as y}from"./SKYM7COB.js";import"./2IM7ZZ7U.js";import{a as z}from"./YUOWOBVQ.js";import"./VMHJHFFS.js";import"./KQDGRC6H.js";import"./MHUK6DQI.js";import{z as b}from"./RRBGCYLX.js";import{E as S,F as $,G as x,H as s,T as C,g,h as l,i as o,l as i,p as v}from"./RREWRPJD.js";var P=g`:host{display:block;--calcite-internal-swatch-inset: var(--calcite-theme-space-2xs, var(--calcite-spacing-xxs))}:host([scale=s]) .container{--calcite-internal-swatch-size: var(--calcite-theme-space-xl, var(--calcite-spacing-xl))}:host([scale=m]) .container{--calcite-internal-swatch-size: var(--calcite-theme-space-2xl, var(--calcite-spacing-xxl))}:host([scale=l]) .container{--calcite-internal-swatch-size: var(--calcite-theme-space-3xl, var(--calcite-spacing-xxxl))}.container{position:relative;outline-color:var(--calcite-color-transparent);justify-content:center;box-sizing:border-box;overflow:hidden;font-size:var(--calcite-internal-swatch-font-size, var(--calcite-font-size));block-size:var(--calcite-internal-swatch-size, auto);inline-size:var(--calcite-internal-swatch-size, auto);min-inline-size:var(--calcite-internal-swatch-size, auto);border-radius:var(--calcite-swatch-corner-radius, 0)}.container:not(.non-interactive):hover{cursor:pointer;box-shadow:0 0 0 var(--calcite-border-width-md) var(--calcite-color-border-1)}.container.selectable{cursor:pointer}.container:not(.non-interactive):focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(var(--calcite-space-base) * (1 - 2 * clamp(0,var(--calcite-offset-invert-focus),1)))}.swatch{display:inline-flex;overflow:hidden;position:relative;z-index:calc(var(--calcite-z-index) + 1);block-size:var(--calcite-internal-swatch-size, auto);inline-size:var(--calcite-internal-swatch-size, auto);min-inline-size:var(--calcite-internal-swatch-size, auto);border-radius:var(--calcite-swatch-corner-radius, 0)}:host([selected]) .swatch{inset:var(--calcite-internal-swatch-inset);block-size:calc(var(--calcite-internal-swatch-size, auto) - 2 * var(--calcite-internal-swatch-inset));inline-size:calc(var(--calcite-internal-swatch-size, auto) - 2 * var(--calcite-internal-swatch-inset));min-inline-size:calc(var(--calcite-internal-swatch-size, auto) - 2 * var(--calcite-internal-swatch-inset))}:host([selected]) .container{box-shadow:inset 0 0 0 var(--calcite-border-width-md) var(--calcite-color-text-1),inset 0 0 0 var(--calcite-border-width-lg) var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1))}:host([selected]) .image-container{inset:var(--calcite-internal-swatch-inset)}.image-container{overflow:hidden;position:absolute;z-index:calc(var(--calcite-z-index) + 2);inset:var(--calcite-theme-space-px, var(--calcite-spacing-px));display:flex;align-items:center;justify-content:center;pointer-events:none;border-radius:var(--calcite-swatch-corner-radius, 0)}.internal-svg-container{position:absolute;inset:var(--calcite-space-none);display:flex;align-items:center;justify-content:center;z-index:calc(var(--calcite-z-index) + 2)}.swatch{overflow:hidden;block-size:inherit;inline-size:inherit}.swatch--no-color rect{fill:var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1))}:host([selected]) #swatch-rect,:host([selected]) #swatch-solid,:host([selected]) #swatch-transparent{stroke-width:0}#swatch-rect,#swatch-solid,#swatch-transparent{stroke:var(--calcite-color-text-1);stroke-width:var(--calcite-border-width-md);stroke-opacity:.3;rx:var(--calcite-swatch-corner-radius)}.internal-svg-disabled{stroke:#6a6a6a;fill:#fff}.internal-svg-empty{stroke:var(--calcite-color-status-danger);stroke-width:3}.checker{fill:#cacaca}:host([hidden]){display:none}[hidden]{display:none}`,u=class extends x{constructor(){super(),this.containerRef=S(),this.focusSetter=z()(this).setFocus,this.interactiveContainer=k(this),this.hasImage=!1,this.disabled=!1,this.interactive=!1,this.scale="m",this.selected=!1,this.selectionMode="none",this.calciteInternalSwatchSelect=v({cancelable:!1}),this.calciteInternalSyncSelectedSwatches=v({cancelable:!1}),this.calciteSwatchSelect=v({cancelable:!1}),this.listen("keydown",this.keyDownHandler)}static{this.properties={hasImage:[16,{},{state:!0}],color:1,disabled:[7,{},{reflect:!0,type:Boolean}],interactive:[5,{},{type:Boolean}],label:1,parentSwatchGroup:[0,{},{attribute:!1}],scale:[3,{},{reflect:!0}],selected:[7,{},{reflect:!0,type:Boolean}],selectionMode:1,value:1}}static{this.styles=P}async setFocus(e){return this.focusSetter(()=>this.el,e)}async load(){this.handleColorChange(this.color)}willUpdate(e){e.has("selected")&&this.hasUpdated&&this.watchSelected(this.selected),e.has("color")&&this.handleColorChange(this.color)}loaded(){this.selectionMode!=="none"&&this.interactive&&this.selected&&this.handleSelectionPropertyChange(this.selected)}watchSelected(e){this.selectionMode!=="none"&&this.handleSelectionPropertyChange(e)}keyDownHandler(e){e.target===this.el&&I(e.key)&&(this.handleEmittingEvent(),e.preventDefault())}handleSlotImageChange(e){this.hasImage=b(e)}handleEmittingEvent(){this.interactive&&this.calciteSwatchSelect.emit()}handleSelectionPropertyChange(e){this.selectionMode==="single"&&this.calciteInternalSyncSelectedSwatches.emit(),!this.parentSwatchGroup?.selectedItems.includes(this.el)&&e&&this.selectionMode!=="multiple"&&this.calciteInternalSwatchSelect.emit(),this.selectionMode!=="single"&&this.calciteInternalSyncSelectedSwatches.emit()}handleColorChange(e){this.internalColor=e?M(e):void 0}renderSwatchImage(){return l`<div class=${s(t.imageContainer)}><slot name=${E.image} @slotchange=${this.handleSlotImageChange}></slot></div>`}renderEmptyDisplay(){let e=this.scale==="s"?"12":this.scale==="m"?"16":"20";return l`<div class=${s(t.internalSvgContainer)}><svg fill=none height=${e??i} viewBox=${`0 0 ${e} ${e}`} width=${e??i} xmlns=http://www.w3.org/2000/svg>${o`<path class=${s(t.internalSvgEmpty)} d=${`M${e} 0L0 ${e}`} />`}</svg></div>`}renderDisabledDisplay(){let e=l`<svg fill=none height=14 viewBox="0 0 14 14" width=14 xmlns=http://www.w3.org/2000/svg>${o`<path class=${s(t.internalSvgDisabled)} d="M7 0.5C10.5899 0.5 13.5 3.41015 13.5 7C13.5 10.5899 10.5899 13.5 7 13.5C3.41015 13.5 0.5 10.5899 0.5 7C0.5 3.41015 3.41015 0.5 7 0.5ZM4.78906 10.917C5.44221 11.2866 6.19529 11.5 7 11.5C9.48528 11.5 11.5 9.48528 11.5 7C11.5 6.19529 11.2866 5.44221 10.917 4.78906L4.78906 10.917ZM7 2.5C4.51472 2.5 2.5 4.51472 2.5 7C2.5 7.95644 2.79808 8.84235 3.30664 9.57129L9.57129 3.30664C8.84235 2.79808 7.95644 2.5 7 2.5Z" />`}</svg>`,a=l`<svg fill=none height=18 viewBox="0 0 18 18" width=18 xmlns=http://www.w3.org/2000/svg>${o`<path class=${s(t.internalSvgDisabled)} d="M9 0.5C13.6944 0.5 17.5 4.30558 17.5 9C17.5 13.6944 13.6944 17.5 9 17.5C4.30558 17.5 0.5 13.6944 0.5 9C0.5 4.30558 4.30558 0.5 9 0.5ZM5.78125 14.2588C6.71828 14.8337 7.81941 15.167 9 15.167C12.4058 15.167 15.167 12.4058 15.167 9C15.167 7.81941 14.8337 6.71828 14.2588 5.78125L5.78125 14.2588ZM9 2.83301C5.59424 2.83301 2.83301 5.59424 2.83301 9C2.83301 10.3817 3.28731 11.6565 4.05469 12.6846L12.6846 4.05469C11.6565 3.28731 10.3817 2.83301 9 2.83301Z" />`}</svg>`;return l`<div class=${s(t.internalSvgContainer)}>${this.scale==="l"?a:e}</div>`}renderSwatch(){let{internalColor:e}=this,a="0",h=!e,c={height:"100%",rx:a,width:"100%"};if(h)return o`<clipPath id=${d.shape}><rect height=100% rx=${a} width=100% /></clipPath>${this.renderSwatchRect({clipPath:`inset(0 round "${a}")`,...c})}<line clip-path=url(#shape) x1=100% x2=0 y1=0 y2=100% />`;let r=e.alpha(),w=m(e),p=m(e,r<1);return o`<defs><pattern height=${n.size} id=${d.checker} patternUnits=userSpaceOnUse width=${n.size} x=0 y=0><rect class=${s(t.checker)} height=${n.squareSize} width=${n.squareSize} x=0 y=0 /><rect class=${s(t.checker)} height=${n.squareSize} width=${n.squareSize} x=${n.squareSize} y=${n.squareSize} /></pattern></defs>${this.renderSwatchRect({fill:"url(#checker)",rx:c.rx,height:c.height,width:c.width})}${this.renderSwatchRect({clipPath:r<1?"polygon(100% 0, 0 0, 0 100%)":`inset(0 round "${a}")`,fill:w,id:d.swatchSolid,...c})}${r<1?this.renderSwatchRect({clipPath:"polygon(100% 0, 100% 100%, 0 100%)",fill:p,id:d.swatchTransparent,key:"opacity-fill",...c}):null}`}renderSwatchRect({clipPath:e,fill:a,height:h,key:c,rx:r,stroke:w,strokeWidth:p,width:D,id:f}){return y(c,o`<rect clip-path=${e??i} fill=${a??i} height=${h??i} id=${(f||d.swatchRect)??i} rx=${r??i} stroke=${w??i} stroke-width=${p??i} width=${D??i} />`)}render(){let{disabled:e}=this,a=e||!e&&!this.interactive,h=this.selectionMode==="multiple"&&this.interactive?"checkbox":this.selectionMode!=="none"&&this.interactive?"radio":this.interactive?"button":"presentation",c=!this.internalColor,r={[t.swatch]:!0,[t.noColorSwatch]:c||this.hasImage&&!this.internalColor};return this.interactiveContainer({disabled:e,children:l`<div .ariaChecked=${this.selectionMode!=="none"&&this.interactive?this.selected:void 0} .ariaLabel=${h!=="presentation"?this.label:""} class=${s({[t.container]:!0,[t.selectable]:this.selectionMode!=="none",[t.selected]:this.selected,[t.nonInteractive]:!this.interactive})} @click=${this.handleEmittingEvent} .role=${h} .tabIndex=${a?-1:0} title=${this.label??i} ${$(this.containerRef)}>${this.renderSwatchImage()}${!this.internalColor&&!this.hasImage&&this.renderEmptyDisplay()||""}${this.disabled&&this.renderDisabledDisplay()||""}<svg class=${s(r)} role=presentation xmlns=http://www.w3.org/2000/svg>${this.renderSwatch()}</svg></div>`})}};C("calcite-swatch",u);export{u as Swatch};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{b as P}from"./IZOUEOSQ.js";import{a as u,b as g,c as L,d as S,e as p,f as $,h as J}from"./FS4CDB52.js";import{f as I}from"./HBWRRDGG.js";import{a as j}from"./7YKU7HXN.js";import{a as K}from"./MOIQ2PKL.js";import{b as _}from"./WTNYMVTD.js";import{a as W}from"./FHYN6ZAQ.js";import{a as Y}from"./D2SDBLE7.js";import{a as V}from"./5K4OZJAZ.js";import{a as D}from"./FDHY2TZA.js";import{a as q}from"./CASNTUXN.js";import{j as A}from"./EW6PQ5IR.js";import"./JN6YLTUP.js";import{a as E}from"./CFQ3UMKK.js";import{a as B}from"./F6JZXX2K.js";import"./2IM7ZZ7U.js";import{a as z}from"./AYU6H7NV.js";import"./VMHJHFFS.js";import"./KSQGDVHO.js";import"./WO6FE6CZ.js";import{i as N,v as w,z as C}from"./RRBGCYLX.js";import{F as v,G as k,H as h,I as H,M as y,N as T,Q as U,T as G,g as R,h as d,p as m}from"./2J454YPO.js";var Q=R`:host([disabled]){opacity:var(--calcite-opacity-disabled);cursor:default;-webkit-user-select:none;user-select:none}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([scale=s]){--calcite-internal-list-action-spacing: var(--calcite-theme-space-2xs, var(--calcite-spacing-xxs))}:host([scale=m]){--calcite-internal-list-action-spacing: var(--calcite-theme-space-2xs, var(--calcite-spacing-xxs))}:host([scale=l]){--calcite-internal-list-action-spacing: var(--calcite-theme-space-xs, var(--calcite-spacing-xs))}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:var(--calcite-opacity-full)}.interaction-container{display:contents}.container{position:relative;background-color:var(--calcite-list-background-color, var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1)))}.container-height{block-size:100%}.table-container{box-sizing:border-box;display:flex;inline-size:100%;flex-direction:column;background-color:var(--calcite-color-transparent)}.table-container *{box-sizing:border-box}.table{inline-size:100%}.stack{--calcite-stack-padding-inline: 0;--calcite-stack-padding-block: 0}.sticky-pos{position:sticky;inset-block-start:var(--calcite-space-none);z-index:calc(var(--calcite-z-index-sticky) + 1);background-color:var(--calcite-list-background-color, var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1)))}::slotted(:is(calcite-action[slot=filter-actions-start],calcite-action[slot=filter-actions-end])){gap:var(--calcite-internal-list-action-spacing);align-self:center}::slotted(calcite-action[slot=filter-actions-start]){margin-inline-start:var(--calcite-internal-list-action-spacing)}::slotted(calcite-action[slot=filter-actions-end]){margin-inline-end:var(--calcite-internal-list-action-spacing)}:host([hidden]){display:none}[hidden]{display:none}`,X=`${S}, ${p}`,O=class extends k{constructor(){super(),this.dragSelector=p,this.focusableItems=[],this.handleSelector="calcite-sort-handle",this.listItems=[],this.listItemGroups=[],this.mutationObserver=D("mutation",()=>{this.willPerformFilter=!0,this.updateListItemsDebounced()}),this.cancelable=Y()(this),this.sortable=j()(this),this.updateListItemsDebounced=V(this.updateListItems,T.nextTick),this.visibleItems=[],this.willFilterEmit=!1,this.willPerformFilter=!1,this.messages=B({blocking:!0}),this.focusSetter=z()(this).setFocus,this.interactiveContainer=W(this),this.filterRowResizeObserver=D("resize",()=>this.updateFilterRowHeight()),this.setFilterContainerEl=e=>{this.filterContainerEl=e,this.observeFilterRow()},this.dataForFilter=[],this.hasFilterActionsEnd=!1,this.hasFilterActionsStart=!1,this.hasFilterNoResults=!1,this.sortHandleMenuItems=[],this.hasContent=!1,this.hasEmptyContent=!1,this.filterRowHeight=0,this.disabled=!1,this.dragEnabled=!1,this.filterEnabled=!1,this.filterText="",this.filteredData=[],this.filteredItems=[],this.interactionMode="interactive",this.loading=!1,this.displayMode="flat",this.scale="m",this.selectedItems=[],this.selectionAppearance="icon",this.selectionMode="none",this.sortDisabled=!1,this.calciteInternalListDefaultSlotChange=m({cancelable:!1}),this.calciteListChange=m({cancelable:!1}),this.calciteListDragEnd=m({cancelable:!1}),this.calciteListDragStart=m({cancelable:!1}),this.calciteListFilter=m({cancelable:!1}),this.calciteListOrderChange=m({cancelable:!1}),this.listen("calciteInternalListItemToggle",this.handleCalciteListItemToggle),this.listen("calciteInternalFocusPreviousItem",this.handleCalciteInternalFocusPreviousItem),this.listen("calciteInternalListItemActive",this.handleCalciteInternalListItemActive),this.listen("calciteListItemSelect",this.handleCalciteListItemSelect),this.listen("calciteInternalAssistiveTextChange",this.handleCalciteInternalAssistiveTextChange),this.listen("calciteListItemSortHandleBeforeOpen",this.updateListItemsDebounced),this.listen("calciteSortHandleReorder",this.handleSortReorder),this.listen("calciteSortHandleMove",this.handleSortMove),this.listen("calciteSortHandleAdd",this.handleSortAdd),this.listen("calciteInternalListItemSelect",this.handleCalciteInternalListItemSelect),this.listen("calciteInternalListItemSelectMultiple",this.handleCalciteInternalListItemSelectMultiple),this.listen("calciteInternalListItemChange",this.handleCalciteInternalListItemChange),this.listen("calciteInternalListItemGroupDefaultSlotChange",this.handleCalciteInternalListItemGroupDefaultSlotChange),this.listen("calciteInternalListItemGroupChange",this.handleCalciteInternalListItemChange)}static{this.properties={assistiveText:[16,{},{state:!0}],dataForFilter:[16,{},{state:!0}],hasFilterActionsEnd:[16,{},{state:!0}],hasFilterActionsStart:[16,{},{state:!0}],hasFilterNoResults:[16,{},{state:!0}],sortHandleMenuItems:[16,{},{state:!0}],hasContent:[16,{},{state:!0}],hasEmptyContent:[16,{},{state:!0}],filterRowHeight:[16,{},{state:!0}],canPull:[0,{},{attribute:!1}],canPut:[0,{},{attribute:!1}],disabled:[7,{},{reflect:!0,type:Boolean}],dragEnabled:[7,{},{reflect:!0,type:Boolean}],filterEnabled:[7,{},{reflect:!0,type:Boolean}],filterPredicate:[0,{},{attribute:!1}],filterLabel:[3,{},{reflect:!0}],filterPlaceholder:[3,{},{reflect:!0}],filterProps:[0,{},{attribute:!1}],filterText:[3,{},{reflect:!0}],filteredData:[0,{},{attribute:!1}],filteredItems:[0,{},{attribute:!1}],group:[3,{},{reflect:!0}],interactionMode:[3,{},{reflect:!0}],label:1,loading:[7,{},{reflect:!0,type:Boolean}],messageOverrides:[0,{},{attribute:!1}],displayMode:[3,{},{reflect:!0}],numberingSystem:1,scale:[3,{},{reflect:!0}],selectedItems:[0,{},{attribute:!1}],selectionAppearance:[3,{},{reflect:!0}],selectionMode:[3,{},{reflect:!0}],sortDisabled:[7,{},{reflect:!0,type:Boolean}]}}static{this.styles=[Q,K]}get hasActiveFilter(){return!!(this.filterEnabled&&this.filterText&&this.filteredItems.length!==this.visibleItems.length)}get showEmptyContentContainer(){return!this.hasContent&&this.hasEmptyContent}get showNoResultsContainer(){return!!(this.filterEnabled&&this.filterText&&this.hasFilterNoResults&&this.visibleItems.length&&!this.filteredItems.length)}get effectiveFilterProps(){return this.filterProps?this.filterProps.filter(e=>e!=="el"):["description","label","metadata","heading"]}emitOrderChangeEvent(e){this.calciteListOrderChange.emit(e)}async setFocus(e){return this.focusSetter(()=>this.filterEnabled?this.filterEl:this.focusableItems.find(t=>t.active),e)}connectedCallback(){super.connectedCallback(),this.connectObserver(),this.willPerformFilter=!0,this.updateListItemsDebounced(),this.setUpSorting(),this.setParentList(),this.setListItemGroups(),this.cancelable.add(this.updateListItemsDebounced)}async load(){this.handleInteractionModeWarning()}willUpdate(e){(e.has("filterText")||e.has("filterProps")||e.has("filterPredicate"))&&this.performFilter(),(e.has("filterEnabled")&&(this.hasUpdated||this.filterEnabled!==!1)||e.has("group")||e.has("sortDisabled")&&(this.hasUpdated||this.sortDisabled!==!1)||e.has("dragEnabled")&&(this.hasUpdated||this.dragEnabled!==!1)||e.has("selectionMode")&&(this.hasUpdated||this.selectionMode!=="none")||e.has("selectionAppearance")&&(this.hasUpdated||this.selectionAppearance!=="icon")||e.has("displayMode")&&this.hasUpdated||e.has("scale")&&this.hasUpdated||e.has("canPull")&&this.hasUpdated||e.has("canPut")&&this.hasUpdated||e.has("filterPredicate")&&this.hasUpdated)&&this.handleListItemChange()}disconnectedCallback(){super.disconnectedCallback(),this.disconnectObserver(),this.unobserveFilterRow()}updateListItems(){this.updateFilterRowHeight(),this.updateGroupItems();let{selectionAppearance:e,selectionMode:t,interactionMode:i,dragEnabled:a,el:s,filterEl:n,displayMode:l,scale:r,sortDisabled:c,sortHandleMenuItems:f}=this,b=Array.from(this.el.querySelectorAll(p)),F=s,M=Array.from(F.children).filter(I);if(b.forEach(o=>{o.closest(L)===s&&(o.scale=r,o.selectionAppearance=e,o.selectionMode=t,o.interactionMode=i,o.moveToItems=f.filter(x=>this.validateSortMenuItem({type:"move",fromEl:F,toEl:x.element,dragEl:o,newIndex:0,oldIndex:M.indexOf(o)})),o.addToItems=this.sortHandleMenuItems.filter(x=>this.validateSortMenuItem({type:"add",fromEl:F,toEl:x.element,dragEl:o,newIndex:0,oldIndex:M.indexOf(o)})),o.dragHandle=a,o.displayMode=l,o.sortDisabled=c)}),this.parentListEl){this.setUpSorting();return}this.listItems=b,this.filterEnabled&&this.willPerformFilter&&(this.willPerformFilter=!1,this.dataForFilter=this.getItemData(),n&&(n.items=this.dataForFilter,this.filterAndUpdateData())),this.visibleItems=this.listItems.filter(o=>!o.closed&&!o.hidden),this.updateFilteredItems(),this.borderItems(),this.focusableItems=this.filteredItems.filter(o=>!o.disabled),this.setActiveListItem(),this.updateSelectedItems(),this.setUpSorting()}unobserveFilterRow(){this.filterRowResizeObserver?.disconnect()}observeFilterRow(){this.unobserveFilterRow();let e=this.filterContainerEl;e&&this.filterRowResizeObserver?.observe(e)}updateFilterRowHeight(){this.filterRowHeight=this.filterContainerEl?.clientHeight??0}handleListItemChange(){this.willPerformFilter=!0,this.updateListItemsDebounced()}handleCalciteListItemToggle(e){this.parentListEl||(e.stopPropagation(),this.borderItems())}handleCalciteInternalFocusPreviousItem(e){if(this.parentListEl)return;e.stopPropagation();let{focusableItems:t}=this,a=t.findIndex(s=>s.active)-1;t[a]&&this.focusRow(t[a])}handleCalciteInternalListItemActive(e){if(this.parentListEl)return;e.stopPropagation();let t=e.target,{listItems:i}=this;i.forEach(a=>{a.active=a===t})}handleCalciteListItemSelect(){this.parentListEl||this.updateSelectedItems(!0)}handleCalciteInternalAssistiveTextChange(e){this.assistiveText=e.detail.message,e.stopPropagation()}handleSortReorder(e){this.parentListEl||e.defaultPrevented||(e.preventDefault(),this.handleReorder(e))}handleSortAdd(e){this.parentListEl||e.defaultPrevented||(e.preventDefault(),this.handleAdd(e))}handleSortMove(e){this.parentListEl||e.defaultPrevented||(e.preventDefault(),this.handleMove(e))}handleCalciteInternalListItemSelect(e){if(this.parentListEl)return;e.stopPropagation();let t=e.target,{listItems:i,selectionMode:a}=this;t.selected&&(a==="single"||a==="single-persist")&&i.forEach(s=>s.selected=s===t),this.updateSelectedItems()}handleCalciteInternalListItemSelectMultiple(e){if(this.parentListEl)return;e.stopPropagation();let{target:t,detail:i}=e,{focusableItems:a,lastSelectedInfo:s}=this,n=t;if(i.selectMultiple&&s){let l=a.indexOf(n),r=a.indexOf(s.selectedItem),c=Math.min(r,l),f=Math.max(r,l);a.slice(c,f+1).forEach(b=>b.selected=s.selected)}else this.lastSelectedInfo={selectedItem:n,selected:n.selected}}handleCalciteInternalListItemChange(e){this.parentListEl||(e.stopPropagation(),this.handleListItemChange())}handleCalciteInternalListItemGroupDefaultSlotChange(e){this.parentListEl||(e.stopPropagation(),this.handleListItemChange())}connectObserver(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}disconnectObserver(){this.mutationObserver?.disconnect()}setUpSorting(){let{dragEnabled:e,defaultSlotEl:t}=this;e&&t&&J(t),this.sortable.reset()}onGlobalDragStart(){this.disconnectObserver()}onGlobalDragEnd(){this.connectObserver()}onDragEnd(e){this.calciteListDragEnd.emit(e)}onDragStart(e){e.dragEl.sortHandleOpen=!1,this.calciteListDragStart.emit(e)}onDragSort(e){this.setParentList(),this.updateListItemsDebounced(),this.calciteListOrderChange.emit(e)}setParentList(){this.parentListEl=this.el.parentElement?.closest(L)||void 0}handleDefaultSlotChange(e){this.parentListEl&&this.calciteInternalListDefaultSlotChange.emit(),this.hasContent=w(e)}handleEmptyContentSlotChange(e){this.hasEmptyContent=w(e)}setListItemGroups(){this.listItemGroups=Array.from(this.el.querySelectorAll(S))}handleFilterActionsStartSlotChange(e){this.hasFilterActionsStart=C(e)}handleFilterActionsEndSlotChange(e){this.hasFilterActionsEnd=C(e)}handleFilterNoResultsSlotChange(e){this.hasFilterNoResults=C(e)}setActiveListItem(){let{focusableItems:e}=this;e.some(t=>t.active)||e[0]&&(e[0].active=!0)}async updateSelectedItems(e=!1){await this.updateComplete,this.selectedItems=this.visibleItems.filter(t=>t.selected),e&&this.calciteListChange.emit()}filterElements({el:e,filteredItems:t,visibleParents:i}){let a=!i.has(e)&&!t.includes(e);e.filterHidden=a;let s=e.parentElement.closest(X);s&&(a||i.add(s),this.filterElements({el:s,filteredItems:t,visibleParents:i}))}allParentListItemsExpanded(e){let t=e.parentElement?.closest(p);if(t){if(!t.expanded)return!1}else return!0;return this.allParentListItemsExpanded(t)}borderItems(){let e=this.visibleItems.filter(t=>!t.filterHidden&&this.allParentListItemsExpanded(t));e.forEach(t=>t.bordered=t!==e[e.length-1])}updateFilteredItems(){let{visibleItems:e,filteredData:t,filterText:i,filterPredicate:a}=this,s=e?.filter(r=>e.every(c=>c===r||!r.contains(c))),n=a?e.filter(a):i?t.map(r=>r.el):e||[],l=new WeakSet;s.forEach(r=>this.filterElements({el:r,filteredItems:n,visibleParents:l})),this.filteredItems=n,this.willFilterEmit&&(this.willFilterEmit=!1,this.calciteListFilter.emit())}updateFilteredData(){let{filterEl:e}=this;e&&(e.filteredItems&&(this.filteredData=e.filteredItems),this.updateListItemsDebounced())}async filterAndUpdateData(){let e=this.filterEl?.value??this.filterText;await this.filterEl?.filter(e),this.updateFilteredData()}performFilter(){let{filterEl:e,filterText:t,effectiveFilterProps:i}=this;e&&(e.value=t,e.filterProps=i,this.filterAndUpdateData())}setDefaultSlotEl(e){this.defaultSlotEl=e}setFilterEl(e){this.filterEl=e,this.performFilter()}handleFilterChange(e){e.stopPropagation();let{value:t}=e.currentTarget;this.filterText=t,this.willFilterEmit=!0,this.updateFilteredData()}getItemData(){return this.listItems.map(e=>({label:e.label,description:e.description,metadata:e.metadata,heading:this.getGroupHeading(e),el:e}))}getGroupHeading(e){return this.listItemGroups.filter(t=>t.contains(e)&&t.heading).map(t=>t.heading)}updateGroupItems(){let{el:e,group:t,scale:i}=this,a=N(e),s=t?Array.from(a.querySelectorAll(`${L}[group="${t}"]`)).filter(l=>!l.disabled&&l.dragEnabled):[];this.sortHandleMenuItems=s.map(l=>({element:l,label:l.label??l.id,id:q()})),Array.from(this.el.querySelectorAll(S)).forEach(l=>{l.scale=i})}focusRow(e){let{focusableItems:t}=this;e&&(t.forEach(i=>i.active=i===e),e.setFocus())}isNavigable(e){let t=e.parentElement?.closest(p);return t?t.expanded&&this.isNavigable(t):!0}handleListKeydown(e){if(e.defaultPrevented||this.parentListEl)return;let{key:t}=e,i=this.focusableItems.filter(s=>this.isNavigable(s)),a=i.findIndex(s=>s.active);if(t==="ArrowDown"){e.preventDefault();let s=e.target===this.filterEl?0:a+1;i[s]&&this.focusRow(i[s])}else if(t==="ArrowUp"){if(e.preventDefault(),a===0&&this.filterEnabled){this.filterEl.setFocus();return}let s=a-1;i[s]&&this.focusRow(i[s])}else if(t==="Home"){e.preventDefault();let s=i[0];s&&this.focusRow(s)}else if(t==="End"){e.preventDefault();let s=i[i.length-1];s&&this.focusRow(s)}}handleInteractionModeWarning(){this.interactionMode==="static"&&this.selectionMode!=="none"&&this.selectionAppearance==="border"&&U.warn('selection-appearance="border" requires interaction-mode="interactive"')}validateSortMenuItem({fromEl:e,toEl:t,dragEl:i,newIndex:a,oldIndex:s,type:n}){if(!e||!t||t===e||i.contains(t))return!1;let l=e.canPull?.({toEl:t,fromEl:e,dragEl:i,newIndex:a,oldIndex:s})??!0,r=t.canPut?.({toEl:t,fromEl:e,dragEl:i,newIndex:a,oldIndex:s})??!0;return(n==="add"?l==="clone":l===!0)&&r}handleAdd(e){let{addTo:t}=e.detail,i=e.target,a=i?.parentElement,s=t.element,l=Array.from(a.children).filter(I).indexOf(i),r=0;if(!this.validateSortMenuItem({type:"add",fromEl:a,toEl:s,dragEl:i,newIndex:r,oldIndex:l}))return;i.sortHandleOpen=!1,this.disconnectObserver();let c=i.cloneNode();s.prepend(c),$(i),this.updateListItemsDebounced(),this.connectObserver();let f={dragEl:i,fromEl:a,toEl:s,newIndex:r,oldIndex:l};this.calciteListOrderChange.emit(f),s.emitOrderChangeEvent(f)}handleMove(e){let{moveTo:t}=e.detail,i=e.target,a=i?.parentElement,s=t.element,l=Array.from(a.children).filter(I).indexOf(i),r=0;if(!this.validateSortMenuItem({type:"move",fromEl:a,toEl:s,dragEl:i,newIndex:r,oldIndex:l}))return;i.sortHandleOpen=!1,this.disconnectObserver(),s.prepend(i),$(i),this.updateListItemsDebounced(),this.connectObserver();let c={dragEl:i,fromEl:a,toEl:s,newIndex:r,oldIndex:l};this.calciteListOrderChange.emit(c),s.emitOrderChangeEvent(c)}handleReorder(e){let{reorder:t}=e.detail,i=e.target,a=i?.parentElement;if(!a)return;i.sortHandleOpen=!1;let s=Array.from(a.children).filter(I),n=s.length-1,l=s.indexOf(i),r=l;switch(t){case"top":r=0;break;case"bottom":r=n;break;case"up":r=l===0?0:l-1;break;case"down":r=l===n?n:l+1;break}this.disconnectObserver();let c=t==="up"||t==="top"?s[r]:s[r].nextSibling;a.insertBefore(i,c),this.updateListItemsDebounced(),this.connectObserver(),this.calciteListOrderChange.emit({dragEl:i,fromEl:a,toEl:a,newIndex:r,oldIndex:l})}render(){let{loading:e,label:t,disabled:i,dataForFilter:a,filterEnabled:s,filterPlaceholder:n,filterLabel:l,hasFilterActionsStart:r,hasFilterActionsEnd:c,effectiveFilterProps:f}=this;return this.interactiveContainer({disabled:this.disabled,children:d`<div class=${h({[u.container]:!0,[u.containerHeight]:this.listItems.length<1&&e})} style=${H({"--calcite-internal-filter-enabled-offset":`${this.filterRowHeight}px`})}>${this.dragEnabled?d`<span aria-live=assertive class=${h(y.screenReaderText)}>${this.assistiveText}</span>`:null}${this.renderItemAriaLive()}<div .ariaBusy=${_(e,void 0)} .ariaLabel=${t||""} class=${h(u.table)} @keydown=${this.handleListKeydown} role=treegrid>${s||r||c?d`<div class=${h(u.sticky)} role=rowgroup ${v(this.setFilterContainerEl)}><div role=row><div role=columnheader><calcite-stack class=${h(u.stack)}><slot name=${g.filterActionsStart} @slotchange=${this.handleFilterActionsStartSlotChange} slot=${P.actionsStart}></slot><calcite-filter .ariaLabel=${n} .disabled=${i} .filterProps=${f} .items=${a} .label=${l} @calciteFilterChange=${this.handleFilterChange} .placeholder=${n} .scale=${this.scale} ${v(this.setFilterEl)}></calcite-filter><slot name=${g.filterActionsEnd} @slotchange=${this.handleFilterActionsEndSlotChange} slot=${P.actionsEnd}></slot></calcite-stack></div></div></div>`:null}<div class=${h(u.tableContainer)} role=rowgroup><div .hidden=${!this.showEmptyContentContainer}><slot name=${g.emptyContent} @slotchange=${this.handleEmptyContentSlotChange}></slot></div><slot @slotchange=${this.handleDefaultSlotChange} ${v(this.setDefaultSlotEl)}></slot></div></div><div aria-live=polite .hidden=${!this.showNoResultsContainer}><slot name=${g.filterNoResults} @slotchange=${this.handleFilterNoResultsSlotChange}></slot></div>${e?d`<calcite-scrim class=${h(u.scrim)} .loading=${e}></calcite-scrim>`:null}</div>`})}renderItemAriaLive(){let{messages:e,filteredItems:t,parentListEl:i,messages:{_lang:a},numberingSystem:s}=this;return A.numberFormatOptions={locale:a,numberingSystem:s},i?null:d`<div aria-live=polite class=${h(y.screenReaderText)}>${this.hasActiveFilter?E("aria-filter-enabled",d`<div>${e.filterEnabled}</div>`):null}${E("aria-item-count",d`<div>${e.total.replace("{count}",A.localize(t.length.toString()))}</div>`)}${t.length?E("aria-item-list",d`<ol>${t.map(n=>d`<li>${n.label}</li>`)}</ol>`):null}</div>`}};G("calcite-list",O);export{O as List};
|
|
2
|
+
import{b as P}from"./IZOUEOSQ.js";import{a as u,b as g,c as L,d as S,e as p,f as $,h as J}from"./FS4CDB52.js";import{f as I}from"./HBWRRDGG.js";import{a as j}from"./TRCVQIOT.js";import{a as K}from"./TW3QNIRG.js";import{b as _}from"./WTNYMVTD.js";import{a as W}from"./45UWYTX5.js";import{a as Y}from"./ZAADWOT6.js";import{a as V}from"./5K4OZJAZ.js";import{a as D}from"./FDHY2TZA.js";import{a as q}from"./CASNTUXN.js";import{j as A}from"./FLTBH3MD.js";import"./JN6YLTUP.js";import{a as E}from"./SKYM7COB.js";import{a as B}from"./5VVWG6MS.js";import"./2IM7ZZ7U.js";import{a as z}from"./YUOWOBVQ.js";import"./VMHJHFFS.js";import"./KQDGRC6H.js";import"./MHUK6DQI.js";import{i as N,v as w,z as C}from"./RRBGCYLX.js";import{F as v,G as k,H as h,I as H,M as y,N as T,Q as U,T as G,g as R,h as d,p as m}from"./RREWRPJD.js";var Q=R`:host([disabled]){opacity:var(--calcite-opacity-disabled);cursor:default;-webkit-user-select:none;user-select:none}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([scale=s]){--calcite-internal-list-action-spacing: var(--calcite-theme-space-2xs, var(--calcite-spacing-xxs))}:host([scale=m]){--calcite-internal-list-action-spacing: var(--calcite-theme-space-2xs, var(--calcite-spacing-xxs))}:host([scale=l]){--calcite-internal-list-action-spacing: var(--calcite-theme-space-xs, var(--calcite-spacing-xs))}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:var(--calcite-opacity-full)}.interaction-container{display:contents}.container{position:relative;background-color:var(--calcite-list-background-color, var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1)))}.container-height{block-size:100%}.table-container{box-sizing:border-box;display:flex;inline-size:100%;flex-direction:column;background-color:var(--calcite-color-transparent)}.table-container *{box-sizing:border-box}.table{inline-size:100%}.stack{--calcite-stack-padding-inline: 0;--calcite-stack-padding-block: 0}.sticky-pos{position:sticky;inset-block-start:var(--calcite-space-none);z-index:calc(var(--calcite-z-index-sticky) + 1);background-color:var(--calcite-list-background-color, var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1)))}::slotted(:is(calcite-action[slot=filter-actions-start],calcite-action[slot=filter-actions-end])){gap:var(--calcite-internal-list-action-spacing);align-self:center}::slotted(calcite-action[slot=filter-actions-start]){margin-inline-start:var(--calcite-internal-list-action-spacing)}::slotted(calcite-action[slot=filter-actions-end]){margin-inline-end:var(--calcite-internal-list-action-spacing)}:host([hidden]){display:none}[hidden]{display:none}`,X=`${S}, ${p}`,O=class extends k{constructor(){super(),this.dragSelector=p,this.focusableItems=[],this.handleSelector="calcite-sort-handle",this.listItems=[],this.listItemGroups=[],this.mutationObserver=D("mutation",()=>{this.willPerformFilter=!0,this.updateListItemsDebounced()}),this.cancelable=Y()(this),this.sortable=j()(this),this.updateListItemsDebounced=V(this.updateListItems,T.nextTick),this.visibleItems=[],this.willFilterEmit=!1,this.willPerformFilter=!1,this.messages=B({blocking:!0}),this.focusSetter=z()(this).setFocus,this.interactiveContainer=W(this),this.filterRowResizeObserver=D("resize",()=>this.updateFilterRowHeight()),this.setFilterContainerEl=e=>{this.filterContainerEl=e,this.observeFilterRow()},this.dataForFilter=[],this.hasFilterActionsEnd=!1,this.hasFilterActionsStart=!1,this.hasFilterNoResults=!1,this.sortHandleMenuItems=[],this.hasContent=!1,this.hasEmptyContent=!1,this.filterRowHeight=0,this.disabled=!1,this.dragEnabled=!1,this.filterEnabled=!1,this.filterText="",this.filteredData=[],this.filteredItems=[],this.interactionMode="interactive",this.loading=!1,this.displayMode="flat",this.scale="m",this.selectedItems=[],this.selectionAppearance="icon",this.selectionMode="none",this.sortDisabled=!1,this.calciteInternalListDefaultSlotChange=m({cancelable:!1}),this.calciteListChange=m({cancelable:!1}),this.calciteListDragEnd=m({cancelable:!1}),this.calciteListDragStart=m({cancelable:!1}),this.calciteListFilter=m({cancelable:!1}),this.calciteListOrderChange=m({cancelable:!1}),this.listen("calciteInternalListItemToggle",this.handleCalciteListItemToggle),this.listen("calciteInternalFocusPreviousItem",this.handleCalciteInternalFocusPreviousItem),this.listen("calciteInternalListItemActive",this.handleCalciteInternalListItemActive),this.listen("calciteListItemSelect",this.handleCalciteListItemSelect),this.listen("calciteInternalAssistiveTextChange",this.handleCalciteInternalAssistiveTextChange),this.listen("calciteListItemSortHandleBeforeOpen",this.updateListItemsDebounced),this.listen("calciteSortHandleReorder",this.handleSortReorder),this.listen("calciteSortHandleMove",this.handleSortMove),this.listen("calciteSortHandleAdd",this.handleSortAdd),this.listen("calciteInternalListItemSelect",this.handleCalciteInternalListItemSelect),this.listen("calciteInternalListItemSelectMultiple",this.handleCalciteInternalListItemSelectMultiple),this.listen("calciteInternalListItemChange",this.handleCalciteInternalListItemChange),this.listen("calciteInternalListItemGroupDefaultSlotChange",this.handleCalciteInternalListItemGroupDefaultSlotChange),this.listen("calciteInternalListItemGroupChange",this.handleCalciteInternalListItemChange)}static{this.properties={assistiveText:[16,{},{state:!0}],dataForFilter:[16,{},{state:!0}],hasFilterActionsEnd:[16,{},{state:!0}],hasFilterActionsStart:[16,{},{state:!0}],hasFilterNoResults:[16,{},{state:!0}],sortHandleMenuItems:[16,{},{state:!0}],hasContent:[16,{},{state:!0}],hasEmptyContent:[16,{},{state:!0}],filterRowHeight:[16,{},{state:!0}],canPull:[0,{},{attribute:!1}],canPut:[0,{},{attribute:!1}],disabled:[7,{},{reflect:!0,type:Boolean}],dragEnabled:[7,{},{reflect:!0,type:Boolean}],filterEnabled:[7,{},{reflect:!0,type:Boolean}],filterPredicate:[0,{},{attribute:!1}],filterLabel:[3,{},{reflect:!0}],filterPlaceholder:[3,{},{reflect:!0}],filterProps:[0,{},{attribute:!1}],filterText:[3,{},{reflect:!0}],filteredData:[0,{},{attribute:!1}],filteredItems:[0,{},{attribute:!1}],group:[3,{},{reflect:!0}],interactionMode:[3,{},{reflect:!0}],label:1,loading:[7,{},{reflect:!0,type:Boolean}],messageOverrides:[0,{},{attribute:!1}],displayMode:[3,{},{reflect:!0}],numberingSystem:1,scale:[3,{},{reflect:!0}],selectedItems:[0,{},{attribute:!1}],selectionAppearance:[3,{},{reflect:!0}],selectionMode:[3,{},{reflect:!0}],sortDisabled:[7,{},{reflect:!0,type:Boolean}]}}static{this.styles=[Q,K]}get hasActiveFilter(){return!!(this.filterEnabled&&this.filterText&&this.filteredItems.length!==this.visibleItems.length)}get showEmptyContentContainer(){return!this.hasContent&&this.hasEmptyContent}get showNoResultsContainer(){return!!(this.filterEnabled&&this.filterText&&this.hasFilterNoResults&&this.visibleItems.length&&!this.filteredItems.length)}get effectiveFilterProps(){return this.filterProps?this.filterProps.filter(e=>e!=="el"):["description","label","metadata","heading"]}emitOrderChangeEvent(e){this.calciteListOrderChange.emit(e)}async setFocus(e){return this.focusSetter(()=>this.filterEnabled?this.filterEl:this.focusableItems.find(t=>t.active),e)}connectedCallback(){super.connectedCallback(),this.connectObserver(),this.willPerformFilter=!0,this.updateListItemsDebounced(),this.setUpSorting(),this.setParentList(),this.setListItemGroups(),this.cancelable.add(this.updateListItemsDebounced)}async load(){this.handleInteractionModeWarning()}willUpdate(e){(e.has("filterText")||e.has("filterProps")||e.has("filterPredicate"))&&this.performFilter(),(e.has("filterEnabled")&&(this.hasUpdated||this.filterEnabled!==!1)||e.has("group")||e.has("sortDisabled")&&(this.hasUpdated||this.sortDisabled!==!1)||e.has("dragEnabled")&&(this.hasUpdated||this.dragEnabled!==!1)||e.has("selectionMode")&&(this.hasUpdated||this.selectionMode!=="none")||e.has("selectionAppearance")&&(this.hasUpdated||this.selectionAppearance!=="icon")||e.has("displayMode")&&this.hasUpdated||e.has("scale")&&this.hasUpdated||e.has("canPull")&&this.hasUpdated||e.has("canPut")&&this.hasUpdated||e.has("filterPredicate")&&this.hasUpdated)&&this.handleListItemChange()}disconnectedCallback(){super.disconnectedCallback(),this.disconnectObserver(),this.unobserveFilterRow()}updateListItems(){this.updateFilterRowHeight(),this.updateGroupItems();let{selectionAppearance:e,selectionMode:t,interactionMode:i,dragEnabled:a,el:s,filterEl:n,displayMode:l,scale:r,sortDisabled:c,sortHandleMenuItems:f}=this,b=Array.from(this.el.querySelectorAll(p)),F=s,M=Array.from(F.children).filter(I);if(b.forEach(o=>{o.closest(L)===s&&(o.scale=r,o.selectionAppearance=e,o.selectionMode=t,o.interactionMode=i,o.moveToItems=f.filter(x=>this.validateSortMenuItem({type:"move",fromEl:F,toEl:x.element,dragEl:o,newIndex:0,oldIndex:M.indexOf(o)})),o.addToItems=this.sortHandleMenuItems.filter(x=>this.validateSortMenuItem({type:"add",fromEl:F,toEl:x.element,dragEl:o,newIndex:0,oldIndex:M.indexOf(o)})),o.dragHandle=a,o.displayMode=l,o.sortDisabled=c)}),this.parentListEl){this.setUpSorting();return}this.listItems=b,this.filterEnabled&&this.willPerformFilter&&(this.willPerformFilter=!1,this.dataForFilter=this.getItemData(),n&&(n.items=this.dataForFilter,this.filterAndUpdateData())),this.visibleItems=this.listItems.filter(o=>!o.closed&&!o.hidden),this.updateFilteredItems(),this.borderItems(),this.focusableItems=this.filteredItems.filter(o=>!o.disabled),this.setActiveListItem(),this.updateSelectedItems(),this.setUpSorting()}unobserveFilterRow(){this.filterRowResizeObserver?.disconnect()}observeFilterRow(){this.unobserveFilterRow();let e=this.filterContainerEl;e&&this.filterRowResizeObserver?.observe(e)}updateFilterRowHeight(){this.filterRowHeight=this.filterContainerEl?.clientHeight??0}handleListItemChange(){this.willPerformFilter=!0,this.updateListItemsDebounced()}handleCalciteListItemToggle(e){this.parentListEl||(e.stopPropagation(),this.borderItems())}handleCalciteInternalFocusPreviousItem(e){if(this.parentListEl)return;e.stopPropagation();let{focusableItems:t}=this,a=t.findIndex(s=>s.active)-1;t[a]&&this.focusRow(t[a])}handleCalciteInternalListItemActive(e){if(this.parentListEl)return;e.stopPropagation();let t=e.target,{listItems:i}=this;i.forEach(a=>{a.active=a===t})}handleCalciteListItemSelect(){this.parentListEl||this.updateSelectedItems(!0)}handleCalciteInternalAssistiveTextChange(e){this.assistiveText=e.detail.message,e.stopPropagation()}handleSortReorder(e){this.parentListEl||e.defaultPrevented||(e.preventDefault(),this.handleReorder(e))}handleSortAdd(e){this.parentListEl||e.defaultPrevented||(e.preventDefault(),this.handleAdd(e))}handleSortMove(e){this.parentListEl||e.defaultPrevented||(e.preventDefault(),this.handleMove(e))}handleCalciteInternalListItemSelect(e){if(this.parentListEl)return;e.stopPropagation();let t=e.target,{listItems:i,selectionMode:a}=this;t.selected&&(a==="single"||a==="single-persist")&&i.forEach(s=>s.selected=s===t),this.updateSelectedItems()}handleCalciteInternalListItemSelectMultiple(e){if(this.parentListEl)return;e.stopPropagation();let{target:t,detail:i}=e,{focusableItems:a,lastSelectedInfo:s}=this,n=t;if(i.selectMultiple&&s){let l=a.indexOf(n),r=a.indexOf(s.selectedItem),c=Math.min(r,l),f=Math.max(r,l);a.slice(c,f+1).forEach(b=>b.selected=s.selected)}else this.lastSelectedInfo={selectedItem:n,selected:n.selected}}handleCalciteInternalListItemChange(e){this.parentListEl||(e.stopPropagation(),this.handleListItemChange())}handleCalciteInternalListItemGroupDefaultSlotChange(e){this.parentListEl||(e.stopPropagation(),this.handleListItemChange())}connectObserver(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}disconnectObserver(){this.mutationObserver?.disconnect()}setUpSorting(){let{dragEnabled:e,defaultSlotEl:t}=this;e&&t&&J(t),this.sortable.reset()}onGlobalDragStart(){this.disconnectObserver()}onGlobalDragEnd(){this.connectObserver()}onDragEnd(e){this.calciteListDragEnd.emit(e)}onDragStart(e){e.dragEl.sortHandleOpen=!1,this.calciteListDragStart.emit(e)}onDragSort(e){this.setParentList(),this.updateListItemsDebounced(),this.calciteListOrderChange.emit(e)}setParentList(){this.parentListEl=this.el.parentElement?.closest(L)||void 0}handleDefaultSlotChange(e){this.parentListEl&&this.calciteInternalListDefaultSlotChange.emit(),this.hasContent=w(e)}handleEmptyContentSlotChange(e){this.hasEmptyContent=w(e)}setListItemGroups(){this.listItemGroups=Array.from(this.el.querySelectorAll(S))}handleFilterActionsStartSlotChange(e){this.hasFilterActionsStart=C(e)}handleFilterActionsEndSlotChange(e){this.hasFilterActionsEnd=C(e)}handleFilterNoResultsSlotChange(e){this.hasFilterNoResults=C(e)}setActiveListItem(){let{focusableItems:e}=this;e.some(t=>t.active)||e[0]&&(e[0].active=!0)}async updateSelectedItems(e=!1){await this.updateComplete,this.selectedItems=this.visibleItems.filter(t=>t.selected),e&&this.calciteListChange.emit()}filterElements({el:e,filteredItems:t,visibleParents:i}){let a=!i.has(e)&&!t.includes(e);e.filterHidden=a;let s=e.parentElement.closest(X);s&&(a||i.add(s),this.filterElements({el:s,filteredItems:t,visibleParents:i}))}allParentListItemsExpanded(e){let t=e.parentElement?.closest(p);if(t){if(!t.expanded)return!1}else return!0;return this.allParentListItemsExpanded(t)}borderItems(){let e=this.visibleItems.filter(t=>!t.filterHidden&&this.allParentListItemsExpanded(t));e.forEach(t=>t.bordered=t!==e[e.length-1])}updateFilteredItems(){let{visibleItems:e,filteredData:t,filterText:i,filterPredicate:a}=this,s=e?.filter(r=>e.every(c=>c===r||!r.contains(c))),n=a?e.filter(a):i?t.map(r=>r.el):e||[],l=new WeakSet;s.forEach(r=>this.filterElements({el:r,filteredItems:n,visibleParents:l})),this.filteredItems=n,this.willFilterEmit&&(this.willFilterEmit=!1,this.calciteListFilter.emit())}updateFilteredData(){let{filterEl:e}=this;e&&(e.filteredItems&&(this.filteredData=e.filteredItems),this.updateListItemsDebounced())}async filterAndUpdateData(){let e=this.filterEl?.value??this.filterText;await this.filterEl?.filter(e),this.updateFilteredData()}performFilter(){let{filterEl:e,filterText:t,effectiveFilterProps:i}=this;e&&(e.value=t,e.filterProps=i,this.filterAndUpdateData())}setDefaultSlotEl(e){this.defaultSlotEl=e}setFilterEl(e){this.filterEl=e,this.performFilter()}handleFilterChange(e){e.stopPropagation();let{value:t}=e.currentTarget;this.filterText=t,this.willFilterEmit=!0,this.updateFilteredData()}getItemData(){return this.listItems.map(e=>({label:e.label,description:e.description,metadata:e.metadata,heading:this.getGroupHeading(e),el:e}))}getGroupHeading(e){return this.listItemGroups.filter(t=>t.contains(e)&&t.heading).map(t=>t.heading)}updateGroupItems(){let{el:e,group:t,scale:i}=this,a=N(e),s=t?Array.from(a.querySelectorAll(`${L}[group="${t}"]`)).filter(l=>!l.disabled&&l.dragEnabled):[];this.sortHandleMenuItems=s.map(l=>({element:l,label:l.label??l.id,id:q()})),Array.from(this.el.querySelectorAll(S)).forEach(l=>{l.scale=i})}focusRow(e){let{focusableItems:t}=this;e&&(t.forEach(i=>i.active=i===e),e.setFocus())}isNavigable(e){let t=e.parentElement?.closest(p);return t?t.expanded&&this.isNavigable(t):!0}handleListKeydown(e){if(e.defaultPrevented||this.parentListEl)return;let{key:t}=e,i=this.focusableItems.filter(s=>this.isNavigable(s)),a=i.findIndex(s=>s.active);if(t==="ArrowDown"){e.preventDefault();let s=e.target===this.filterEl?0:a+1;i[s]&&this.focusRow(i[s])}else if(t==="ArrowUp"){if(e.preventDefault(),a===0&&this.filterEnabled){this.filterEl.setFocus();return}let s=a-1;i[s]&&this.focusRow(i[s])}else if(t==="Home"){e.preventDefault();let s=i[0];s&&this.focusRow(s)}else if(t==="End"){e.preventDefault();let s=i[i.length-1];s&&this.focusRow(s)}}handleInteractionModeWarning(){this.interactionMode==="static"&&this.selectionMode!=="none"&&this.selectionAppearance==="border"&&U.warn('selection-appearance="border" requires interaction-mode="interactive"')}validateSortMenuItem({fromEl:e,toEl:t,dragEl:i,newIndex:a,oldIndex:s,type:n}){if(!e||!t||t===e||i.contains(t))return!1;let l=e.canPull?.({toEl:t,fromEl:e,dragEl:i,newIndex:a,oldIndex:s})??!0,r=t.canPut?.({toEl:t,fromEl:e,dragEl:i,newIndex:a,oldIndex:s})??!0;return(n==="add"?l==="clone":l===!0)&&r}handleAdd(e){let{addTo:t}=e.detail,i=e.target,a=i?.parentElement,s=t.element,l=Array.from(a.children).filter(I).indexOf(i),r=0;if(!this.validateSortMenuItem({type:"add",fromEl:a,toEl:s,dragEl:i,newIndex:r,oldIndex:l}))return;i.sortHandleOpen=!1,this.disconnectObserver();let c=i.cloneNode();s.prepend(c),$(i),this.updateListItemsDebounced(),this.connectObserver();let f={dragEl:i,fromEl:a,toEl:s,newIndex:r,oldIndex:l};this.calciteListOrderChange.emit(f),s.emitOrderChangeEvent(f)}handleMove(e){let{moveTo:t}=e.detail,i=e.target,a=i?.parentElement,s=t.element,l=Array.from(a.children).filter(I).indexOf(i),r=0;if(!this.validateSortMenuItem({type:"move",fromEl:a,toEl:s,dragEl:i,newIndex:r,oldIndex:l}))return;i.sortHandleOpen=!1,this.disconnectObserver(),s.prepend(i),$(i),this.updateListItemsDebounced(),this.connectObserver();let c={dragEl:i,fromEl:a,toEl:s,newIndex:r,oldIndex:l};this.calciteListOrderChange.emit(c),s.emitOrderChangeEvent(c)}handleReorder(e){let{reorder:t}=e.detail,i=e.target,a=i?.parentElement;if(!a)return;i.sortHandleOpen=!1;let s=Array.from(a.children).filter(I),n=s.length-1,l=s.indexOf(i),r=l;switch(t){case"top":r=0;break;case"bottom":r=n;break;case"up":r=l===0?0:l-1;break;case"down":r=l===n?n:l+1;break}this.disconnectObserver();let c=t==="up"||t==="top"?s[r]:s[r].nextSibling;a.insertBefore(i,c),this.updateListItemsDebounced(),this.connectObserver(),this.calciteListOrderChange.emit({dragEl:i,fromEl:a,toEl:a,newIndex:r,oldIndex:l})}render(){let{loading:e,label:t,disabled:i,dataForFilter:a,filterEnabled:s,filterPlaceholder:n,filterLabel:l,hasFilterActionsStart:r,hasFilterActionsEnd:c,effectiveFilterProps:f}=this;return this.interactiveContainer({disabled:this.disabled,children:d`<div class=${h({[u.container]:!0,[u.containerHeight]:this.listItems.length<1&&e})} style=${H({"--calcite-internal-filter-enabled-offset":`${this.filterRowHeight}px`})}>${this.dragEnabled?d`<span aria-live=assertive class=${h(y.screenReaderText)}>${this.assistiveText}</span>`:null}${this.renderItemAriaLive()}<div .ariaBusy=${_(e,void 0)} .ariaLabel=${t||""} class=${h(u.table)} @keydown=${this.handleListKeydown} role=treegrid>${s||r||c?d`<div class=${h(u.sticky)} role=rowgroup ${v(this.setFilterContainerEl)}><div role=row><div role=columnheader><calcite-stack class=${h(u.stack)}><slot name=${g.filterActionsStart} @slotchange=${this.handleFilterActionsStartSlotChange} slot=${P.actionsStart}></slot><calcite-filter .ariaLabel=${n} .disabled=${i} .filterProps=${f} .items=${a} .label=${l} @calciteFilterChange=${this.handleFilterChange} .placeholder=${n} .scale=${this.scale} ${v(this.setFilterEl)}></calcite-filter><slot name=${g.filterActionsEnd} @slotchange=${this.handleFilterActionsEndSlotChange} slot=${P.actionsEnd}></slot></calcite-stack></div></div></div>`:null}<div class=${h(u.tableContainer)} role=rowgroup><div .hidden=${!this.showEmptyContentContainer}><slot name=${g.emptyContent} @slotchange=${this.handleEmptyContentSlotChange}></slot></div><slot @slotchange=${this.handleDefaultSlotChange} ${v(this.setDefaultSlotEl)}></slot></div></div><div aria-live=polite .hidden=${!this.showNoResultsContainer}><slot name=${g.filterNoResults} @slotchange=${this.handleFilterNoResultsSlotChange}></slot></div>${e?d`<calcite-scrim class=${h(u.scrim)} .loading=${e}></calcite-scrim>`:null}</div>`})}renderItemAriaLive(){let{messages:e,filteredItems:t,parentListEl:i,messages:{_lang:a},numberingSystem:s}=this;return A.numberFormatOptions={locale:a,numberingSystem:s},i?null:d`<div aria-live=polite class=${h(y.screenReaderText)}>${this.hasActiveFilter?E("aria-filter-enabled",d`<div>${e.filterEnabled}</div>`):null}${E("aria-item-count",d`<div>${e.total.replace("{count}",A.localize(t.length.toString()))}</div>`)}${t.length?E("aria-item-list",d`<ol>${t.map(n=>d`<li>${n.label}</li>`)}</ol>`):null}</div>`}};G("calcite-list",O);export{O as List};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{a as p}from"./47WLTGVK.js";import{a as E}from"./FDHY2TZA.js";import{j as b}from"./EW6PQ5IR.js";import"./JN6YLTUP.js";import{a as d}from"./CFQ3UMKK.js";import{a as L}from"./F6JZXX2K.js";import{a as w}from"./AYU6H7NV.js";import{a as u}from"./VMHJHFFS.js";import"./KSQGDVHO.js";import"./WO6FE6CZ.js";import"./RRBGCYLX.js";import{G as P,H as r,T as X,g as $,h as o,l as C,p as y}from"./2J454YPO.js";var s={list:"list",listItem:"list-item",hiddenItem:"hidden-item",page:"page",selected:"selected",chevron:"chevron",disabled:"disabled",ellipsis:"ellipsis"},f={next:"chevron-right",previous:"chevron-left",first:"chevron-start",last:"chevron-end"},O=$`:host{display:flex;writing-mode:horizontal-tb}.list{display:flex;list-style-type:none;margin:var(--calcite-space-none);padding:var(--calcite-space-none);column-gap:var(--calcite-theme-space-base, var(--calcite-spacing-base))}.list-item{display:flex;margin:var(--calcite-space-none);padding:var(--calcite-space-none)}.hidden-item{display:none}:host([scale=s]) .chevron,:host([scale=s]) .page,:host([scale=s]) .ellipsis{font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);block-size:var(--calcite-space-2xl);padding-inline:var(--calcite-space-2xs);min-inline-size:1.5rem}:host([scale=m]) .chevron,:host([scale=m]) .page,:host([scale=m]) .ellipsis{font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base);block-size:var(--calcite-space-3xl);padding-inline:var(--calcite-space-sm);min-inline-size:2rem}:host([scale=l]) .chevron,:host([scale=l]) .page,:host([scale=l]) .ellipsis{font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);block-size:var(--calcite-space-4xl);min-inline-size:2.75rem}:host([scale=l]) .chevron{padding-inline:var(--calcite-space-sm-plus)}:host([scale=l]) .page,:host([scale=l]) .ellipsis{padding-inline:var(--calcite-space-md)}:host button{outline-color:var(--calcite-color-transparent)}:host button:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(-1 * var(--calcite-space-base) * (1 - 2 * clamp(0,var(--calcite-offset-invert-focus),1)))}.chevron,.page,.ellipsis{font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);padding:var(--calcite-space-none);margin:var(--calcite-space-none);font-family:inherit;box-sizing:border-box;display:flex;align-items:center;border-style:none;justify-content:center;vertical-align:baseline;background-color:var(--calcite-color-transparent);border-color:var(--calcite-color-transparent);color:var(--calcite-pagination-color, var(--calcite-color-text-3))}.chevron,.page{cursor:pointer;border-block:2px solid transparent}.chevron:hover,.page:hover{transition-property:background-color,block-size,border-color,box-shadow,color,inset-block-end,inset-block-start,inset-inline-end,inset-inline-start,inset-size,opacity,outline-color,transform;transition-duration:var(--calcite-animation-timing);transition-timing-function:ease-in-out;color:var(--calcite-pagination-color-hover, var(--calcite-color-text-1))}.chevron:active,.page:active{color:var(--calcite-pagination-color-hover, var(--calcite-color-text-1))}.page:hover{border-block-end-color:var(--calcite-pagination-color-border-hover, var(--calcite-color-border-2))}.page:active{background-color:var(--calcite-pagination-background-color, var(--calcite-theme-color-surface-4, var(--calcite-color-foreground-3)))}.page.selected{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-pagination-color-hover, var(--calcite-color-text-1));border-block-end-color:var(--calcite-pagination-color-border-active, var(--calcite-color-brand))}.page.selected:focus{border-block-end-width:var(--calcite-theme-space-2xs, var(--calcite-spacing-xxs));padding-block-start:var(--calcite-theme-space-base, var(--calcite-spacing-base))}.chevron:hover{background-color:var(--calcite-pagination-icon-color-background-hover, var(--calcite-theme-color-surface-3, var(--calcite-color-foreground-2)))}.chevron:active{background-color:var(--calcite-pagination-background-color, var(--calcite-theme-color-surface-4, var(--calcite-color-foreground-3)))}.chevron.disabled{background-color:var(--calcite-color-transparent);pointer-events:none}.chevron.disabled>calcite-icon{opacity:var(--calcite-opacity-disabled)}:host([hidden]){display:none}[hidden]{display:none}`,I=2,M=2,m={large:11,medium:9,small:7,xsmall:5,xxsmall:1},x=class extends P{constructor(){super(...arguments),this.resizeHandler=({contentRect:{width:e}})=>this.setMaxItemsToBreakpoint(e),this.resizeObserver=E("resize",e=>e.forEach(this.resizeHandler)),this.messages=L({blocking:!0}),this.focusSetter=w()(this).setFocus,this.isXXSmall=!1,this.lastStartItem=1,this.maxItems=m.xxsmall,this.totalPages=1,this.groupSeparator=!1,this.pageSize=20,this.scale="m",this.startItem=1,this.totalItems=0,this.calcitePaginationChange=y({cancelable:!1})}static{this.properties={isXXSmall:[16,{},{state:!0}],lastStartItem:[16,{},{state:!0}],maxItems:[16,{},{state:!0}],totalPages:[16,{},{state:!0}],groupSeparator:[7,{},{reflect:!0,type:Boolean}],messageOverrides:[0,{},{attribute:!1}],numberingSystem:1,pageSize:[11,{},{reflect:!0,type:Number}],scale:[3,{},{reflect:!0}],startItem:[11,{},{reflect:!0,type:Number}],totalItems:[11,{},{reflect:!0,type:Number}]}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=O}async goTo(e){switch(e){case"start":this.startItem=1;break;case"end":this.startItem=this.lastStartItem;break;default:e>=Math.ceil(this.totalPages)?this.startItem=this.lastStartItem:e<=0?this.startItem=1:this.startItem=(e-1)*this.pageSize+1}}async nextPage(){this.startItem=Math.min(this.lastStartItem,this.startItem+this.pageSize)}async previousPage(){this.startItem=Math.max(1,this.startItem-this.pageSize)}async setFocus(e){return this.focusSetter(()=>this.el,e)}connectedCallback(){super.connectedCallback(),this.resizeObserver?.observe(this.el)}async load(){this.handleTotalPages(),this.handleLastStartItemChange(),this.handleIsXXSmall()}willUpdate(e){(e.has("totalItems")&&(this.hasUpdated||this.totalItems!==0)||e.has("pageSize")&&(this.hasUpdated||this.pageSize!==20))&&this.handleTotalPages(),(e.has("totalItems")&&(this.hasUpdated||this.totalItems!==0)||e.has("pageSize")&&(this.hasUpdated||this.pageSize!==20)||e.has("totalPages"))&&this.handleLastStartItemChange(),e.has("maxItems")&&(this.hasUpdated||this.maxItems!==m.xxsmall)&&this.handleIsXXSmall(),e.has("messages")&&this.effectiveLocaleChange()}loaded(){this.setMaxItemsToBreakpoint(this.el.clientWidth)}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect()}handleTotalPages(){this.pageSize=Math.max(1,this.pageSize),this.totalPages=Math.max(1,this.totalItems/this.pageSize)}effectiveLocaleChange(){b.numberFormatOptions={locale:this.messages._lang,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator}}handleLastStartItemChange(){let{totalItems:e,pageSize:t}=this;this.lastStartItem=Math.max(1,Math.floor((e-1)/t)*t+1)}handleIsXXSmall(){this.isXXSmall=this.maxItems===m.xxsmall}setMaxItemsToBreakpoint(e){if(!(!p||!e)){if(e>=p.width.medium){this.maxItems=m.large;return}if(e>=p.width.small){this.maxItems=m.medium;return}if(e>=p.width.xsmall){this.maxItems=m.small;return}if(e>=p.width.xxsmall){this.maxItems=m.xsmall;return}this.maxItems=m.xxsmall}}firstClicked(){this.startItem=1,this.emitUpdate()}lastClicked(){this.startItem=this.lastStartItem,this.emitUpdate()}async previousClicked(){await this.previousPage(),this.emitUpdate()}async nextClicked(){await this.nextPage(),this.emitUpdate()}showStartEllipsis(){return this.totalPages>this.maxItems&&Math.floor(this.startItem/this.pageSize)>this.maxItems-I-M}showEndEllipsis(){return this.totalPages>this.maxItems&&(this.totalItems-this.startItem)/this.pageSize>this.maxItems-I-(M-1)}emitUpdate(){this.calcitePaginationChange.emit()}handlePageClick(e){let t=e.target;this.startItem=parseInt(t.value,10),this.emitUpdate()}renderEllipsis(e){return o`<li aria-hidden=true role=presentation>${d(e,o`<span class=${r(s.ellipsis)}>…</span>`)}</li>`}renderItems(){let{totalItems:e,pageSize:t,startItem:a,maxItems:i,totalPages:l,lastStartItem:v,isXXSmall:U}=this,c=[];if(U)return c.push(this.renderPage(a)),c;let F=e>t,S=this.showStartEllipsis(),k=this.showEndEllipsis();F&&c.push(this.renderPage(1)),S&&c.push(this.renderEllipsis("start"));let n=i-I-(k?1:0)-(S?1:0),g,h;l-1<=n?(h=1+t,g=v-t):a/t<n?(h=1+t,g=1+n*t):a+n*t>=e?(h=v-n*t,g=v-t):(h=a-t*((n-1)/2),g=a+t*((n-1)/2));for(let z=0;z<n&&h<=g;z++)c.push(this.renderPage(h)),h=h+t;return k&&c.push(this.renderEllipsis("end")),c.push(this.renderPage(v)),c}renderPage(e){let{pageSize:t}=this,a=Math.floor(e/t)+(t===1?0:1);b.numberFormatOptions={locale:this.messages._lang,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator};let i=b.localize(a.toString()),l=e===this.startItem;return o`<li class=${r(s.listItem)}><button .ariaCurrent=${l?"page":"false"} class=${r({[s.page]:!0,[s.selected]:l})} @click=${this.handlePageClick} value=${e??C}>${i}</button></li>`}renderPreviousChevron(){let{pageSize:e,startItem:t,messages:a}=this,i=e===1?t<=e:t<e;return d("previous",o`<button .ariaLabel=${a.previous} class=${r({[s.chevron]:!0,[s.disabled]:i})} .disabled=${i} @click=${this.previousClicked}><calcite-icon flip-rtl .icon=${f.previous} .scale=${u(this.scale)}></calcite-icon></button>`)}renderNextChevron(){let{totalItems:e,pageSize:t,startItem:a,messages:i}=this,l=a+t>e;return d("next-button",o`<button .ariaLabel=${i.next} class=${r({[s.chevron]:!0,[s.disabled]:l})} .disabled=${l} @click=${this.nextClicked}><calcite-icon flip-rtl .icon=${f.next} .scale=${u(this.scale)}></calcite-icon></button>`)}renderFirstChevron(){let{messages:e,startItem:t,isXXSmall:a}=this,i=t===1;return a?d("first-button",o`<button .ariaLabel=${e.first} class=${r({[s.chevron]:!0,[s.disabled]:i})} .disabled=${i} @click=${this.firstClicked}><calcite-icon flip-rtl .icon=${f.first} .scale=${u(this.scale)}></calcite-icon></button>`):null}renderLastChevron(){let{messages:e,startItem:t,isXXSmall:a,lastStartItem:i}=this,l=t===i;return a?d("last-button",o`<button .ariaLabel=${e.last} class=${r({[s.chevron]:!0,[s.disabled]:l})} .disabled=${l} @click=${this.lastClicked}><calcite-icon flip-rtl .icon=${f.last} .scale=${u(this.scale)}></calcite-icon></button>`):null}render(){let e=this.renderFirstChevron(),t=this.renderLastChevron();return o`<ul class=${r(s.list)}><li class=${r({[s.listItem]:!0,[s.hiddenItem]:!e})}>${e}</li><li class=${r(s.listItem)}>${this.renderPreviousChevron()}</li>${this.renderItems()}<li class=${r(s.listItem)}>${this.renderNextChevron()}</li><li class=${r({[s.listItem]:!0,[s.hiddenItem]:!t})}>${t}</li></ul>`}};X("calcite-pagination",x);export{x as Pagination};
|
|
2
|
+
import{a as p}from"./47WLTGVK.js";import{a as E}from"./FDHY2TZA.js";import{j as b}from"./FLTBH3MD.js";import"./JN6YLTUP.js";import{a as d}from"./SKYM7COB.js";import{a as L}from"./5VVWG6MS.js";import{a as w}from"./YUOWOBVQ.js";import{a as u}from"./VMHJHFFS.js";import"./KQDGRC6H.js";import"./MHUK6DQI.js";import"./RRBGCYLX.js";import{G as P,H as r,T as X,g as $,h as o,l as C,p as y}from"./RREWRPJD.js";var s={list:"list",listItem:"list-item",hiddenItem:"hidden-item",page:"page",selected:"selected",chevron:"chevron",disabled:"disabled",ellipsis:"ellipsis"},f={next:"chevron-right",previous:"chevron-left",first:"chevron-start",last:"chevron-end"},O=$`:host{display:flex;writing-mode:horizontal-tb}.list{display:flex;list-style-type:none;margin:var(--calcite-space-none);padding:var(--calcite-space-none);column-gap:var(--calcite-theme-space-base, var(--calcite-spacing-base))}.list-item{display:flex;margin:var(--calcite-space-none);padding:var(--calcite-space-none)}.hidden-item{display:none}:host([scale=s]) .chevron,:host([scale=s]) .page,:host([scale=s]) .ellipsis{font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);block-size:var(--calcite-space-2xl);padding-inline:var(--calcite-space-2xs);min-inline-size:1.5rem}:host([scale=m]) .chevron,:host([scale=m]) .page,:host([scale=m]) .ellipsis{font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base);block-size:var(--calcite-space-3xl);padding-inline:var(--calcite-space-sm);min-inline-size:2rem}:host([scale=l]) .chevron,:host([scale=l]) .page,:host([scale=l]) .ellipsis{font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);block-size:var(--calcite-space-4xl);min-inline-size:2.75rem}:host([scale=l]) .chevron{padding-inline:var(--calcite-space-sm-plus)}:host([scale=l]) .page,:host([scale=l]) .ellipsis{padding-inline:var(--calcite-space-md)}:host button{outline-color:var(--calcite-color-transparent)}:host button:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(-1 * var(--calcite-space-base) * (1 - 2 * clamp(0,var(--calcite-offset-invert-focus),1)))}.chevron,.page,.ellipsis{font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);padding:var(--calcite-space-none);margin:var(--calcite-space-none);font-family:inherit;box-sizing:border-box;display:flex;align-items:center;border-style:none;justify-content:center;vertical-align:baseline;background-color:var(--calcite-color-transparent);border-color:var(--calcite-color-transparent);color:var(--calcite-pagination-color, var(--calcite-color-text-3))}.chevron,.page{cursor:pointer;border-block:2px solid transparent}.chevron:hover,.page:hover{transition-property:background-color,block-size,border-color,box-shadow,color,inset-block-end,inset-block-start,inset-inline-end,inset-inline-start,inset-size,opacity,outline-color,transform;transition-duration:var(--calcite-animation-timing);transition-timing-function:ease-in-out;color:var(--calcite-pagination-color-hover, var(--calcite-color-text-1))}.chevron:active,.page:active{color:var(--calcite-pagination-color-hover, var(--calcite-color-text-1))}.page:hover{border-block-end-color:var(--calcite-pagination-color-border-hover, var(--calcite-color-border-2))}.page:active{background-color:var(--calcite-pagination-background-color, var(--calcite-theme-color-surface-4, var(--calcite-color-foreground-3)))}.page.selected{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-pagination-color-hover, var(--calcite-color-text-1));border-block-end-color:var(--calcite-pagination-color-border-active, var(--calcite-color-brand))}.page.selected:focus{border-block-end-width:var(--calcite-theme-space-2xs, var(--calcite-spacing-xxs));padding-block-start:var(--calcite-theme-space-base, var(--calcite-spacing-base))}.chevron:hover{background-color:var(--calcite-pagination-icon-color-background-hover, var(--calcite-theme-color-surface-3, var(--calcite-color-foreground-2)))}.chevron:active{background-color:var(--calcite-pagination-background-color, var(--calcite-theme-color-surface-4, var(--calcite-color-foreground-3)))}.chevron.disabled{background-color:var(--calcite-color-transparent);pointer-events:none}.chevron.disabled>calcite-icon{opacity:var(--calcite-opacity-disabled)}:host([hidden]){display:none}[hidden]{display:none}`,I=2,M=2,m={large:11,medium:9,small:7,xsmall:5,xxsmall:1},x=class extends P{constructor(){super(...arguments),this.resizeHandler=({contentRect:{width:e}})=>this.setMaxItemsToBreakpoint(e),this.resizeObserver=E("resize",e=>e.forEach(this.resizeHandler)),this.messages=L({blocking:!0}),this.focusSetter=w()(this).setFocus,this.isXXSmall=!1,this.lastStartItem=1,this.maxItems=m.xxsmall,this.totalPages=1,this.groupSeparator=!1,this.pageSize=20,this.scale="m",this.startItem=1,this.totalItems=0,this.calcitePaginationChange=y({cancelable:!1})}static{this.properties={isXXSmall:[16,{},{state:!0}],lastStartItem:[16,{},{state:!0}],maxItems:[16,{},{state:!0}],totalPages:[16,{},{state:!0}],groupSeparator:[7,{},{reflect:!0,type:Boolean}],messageOverrides:[0,{},{attribute:!1}],numberingSystem:1,pageSize:[11,{},{reflect:!0,type:Number}],scale:[3,{},{reflect:!0}],startItem:[11,{},{reflect:!0,type:Number}],totalItems:[11,{},{reflect:!0,type:Number}]}}static{this.shadowRootOptions={mode:"open",delegatesFocus:!0}}static{this.styles=O}async goTo(e){switch(e){case"start":this.startItem=1;break;case"end":this.startItem=this.lastStartItem;break;default:e>=Math.ceil(this.totalPages)?this.startItem=this.lastStartItem:e<=0?this.startItem=1:this.startItem=(e-1)*this.pageSize+1}}async nextPage(){this.startItem=Math.min(this.lastStartItem,this.startItem+this.pageSize)}async previousPage(){this.startItem=Math.max(1,this.startItem-this.pageSize)}async setFocus(e){return this.focusSetter(()=>this.el,e)}connectedCallback(){super.connectedCallback(),this.resizeObserver?.observe(this.el)}async load(){this.handleTotalPages(),this.handleLastStartItemChange(),this.handleIsXXSmall()}willUpdate(e){(e.has("totalItems")&&(this.hasUpdated||this.totalItems!==0)||e.has("pageSize")&&(this.hasUpdated||this.pageSize!==20))&&this.handleTotalPages(),(e.has("totalItems")&&(this.hasUpdated||this.totalItems!==0)||e.has("pageSize")&&(this.hasUpdated||this.pageSize!==20)||e.has("totalPages"))&&this.handleLastStartItemChange(),e.has("maxItems")&&(this.hasUpdated||this.maxItems!==m.xxsmall)&&this.handleIsXXSmall(),e.has("messages")&&this.effectiveLocaleChange()}loaded(){this.setMaxItemsToBreakpoint(this.el.clientWidth)}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect()}handleTotalPages(){this.pageSize=Math.max(1,this.pageSize),this.totalPages=Math.max(1,this.totalItems/this.pageSize)}effectiveLocaleChange(){b.numberFormatOptions={locale:this.messages._lang,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator}}handleLastStartItemChange(){let{totalItems:e,pageSize:t}=this;this.lastStartItem=Math.max(1,Math.floor((e-1)/t)*t+1)}handleIsXXSmall(){this.isXXSmall=this.maxItems===m.xxsmall}setMaxItemsToBreakpoint(e){if(!(!p||!e)){if(e>=p.width.medium){this.maxItems=m.large;return}if(e>=p.width.small){this.maxItems=m.medium;return}if(e>=p.width.xsmall){this.maxItems=m.small;return}if(e>=p.width.xxsmall){this.maxItems=m.xsmall;return}this.maxItems=m.xxsmall}}firstClicked(){this.startItem=1,this.emitUpdate()}lastClicked(){this.startItem=this.lastStartItem,this.emitUpdate()}async previousClicked(){await this.previousPage(),this.emitUpdate()}async nextClicked(){await this.nextPage(),this.emitUpdate()}showStartEllipsis(){return this.totalPages>this.maxItems&&Math.floor(this.startItem/this.pageSize)>this.maxItems-I-M}showEndEllipsis(){return this.totalPages>this.maxItems&&(this.totalItems-this.startItem)/this.pageSize>this.maxItems-I-(M-1)}emitUpdate(){this.calcitePaginationChange.emit()}handlePageClick(e){let t=e.target;this.startItem=parseInt(t.value,10),this.emitUpdate()}renderEllipsis(e){return o`<li aria-hidden=true role=presentation>${d(e,o`<span class=${r(s.ellipsis)}>…</span>`)}</li>`}renderItems(){let{totalItems:e,pageSize:t,startItem:a,maxItems:i,totalPages:l,lastStartItem:v,isXXSmall:U}=this,c=[];if(U)return c.push(this.renderPage(a)),c;let F=e>t,S=this.showStartEllipsis(),k=this.showEndEllipsis();F&&c.push(this.renderPage(1)),S&&c.push(this.renderEllipsis("start"));let n=i-I-(k?1:0)-(S?1:0),g,h;l-1<=n?(h=1+t,g=v-t):a/t<n?(h=1+t,g=1+n*t):a+n*t>=e?(h=v-n*t,g=v-t):(h=a-t*((n-1)/2),g=a+t*((n-1)/2));for(let z=0;z<n&&h<=g;z++)c.push(this.renderPage(h)),h=h+t;return k&&c.push(this.renderEllipsis("end")),c.push(this.renderPage(v)),c}renderPage(e){let{pageSize:t}=this,a=Math.floor(e/t)+(t===1?0:1);b.numberFormatOptions={locale:this.messages._lang,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator};let i=b.localize(a.toString()),l=e===this.startItem;return o`<li class=${r(s.listItem)}><button .ariaCurrent=${l?"page":"false"} class=${r({[s.page]:!0,[s.selected]:l})} @click=${this.handlePageClick} value=${e??C}>${i}</button></li>`}renderPreviousChevron(){let{pageSize:e,startItem:t,messages:a}=this,i=e===1?t<=e:t<e;return d("previous",o`<button .ariaLabel=${a.previous} class=${r({[s.chevron]:!0,[s.disabled]:i})} .disabled=${i} @click=${this.previousClicked}><calcite-icon flip-rtl .icon=${f.previous} .scale=${u(this.scale)}></calcite-icon></button>`)}renderNextChevron(){let{totalItems:e,pageSize:t,startItem:a,messages:i}=this,l=a+t>e;return d("next-button",o`<button .ariaLabel=${i.next} class=${r({[s.chevron]:!0,[s.disabled]:l})} .disabled=${l} @click=${this.nextClicked}><calcite-icon flip-rtl .icon=${f.next} .scale=${u(this.scale)}></calcite-icon></button>`)}renderFirstChevron(){let{messages:e,startItem:t,isXXSmall:a}=this,i=t===1;return a?d("first-button",o`<button .ariaLabel=${e.first} class=${r({[s.chevron]:!0,[s.disabled]:i})} .disabled=${i} @click=${this.firstClicked}><calcite-icon flip-rtl .icon=${f.first} .scale=${u(this.scale)}></calcite-icon></button>`):null}renderLastChevron(){let{messages:e,startItem:t,isXXSmall:a,lastStartItem:i}=this,l=t===i;return a?d("last-button",o`<button .ariaLabel=${e.last} class=${r({[s.chevron]:!0,[s.disabled]:l})} .disabled=${l} @click=${this.lastClicked}><calcite-icon flip-rtl .icon=${f.last} .scale=${u(this.scale)}></calcite-icon></button>`):null}render(){let e=this.renderFirstChevron(),t=this.renderLastChevron();return o`<ul class=${r(s.list)}><li class=${r({[s.listItem]:!0,[s.hiddenItem]:!e})}>${e}</li><li class=${r(s.listItem)}>${this.renderPreviousChevron()}</li>${this.renderItems()}<li class=${r(s.listItem)}>${this.renderNextChevron()}</li><li class=${r({[s.listItem]:!0,[s.hiddenItem]:!t})}>${t}</li></ul>`}};X("calcite-pagination",x);export{x as Pagination};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{a as O}from"./LBJMYSBR.js";import{a as z}from"./I7LH7HGC.js";import{c as E}from"./EVP5QN6L.js";import{a as F}from"./XN5GTOTE.js";import{a as N}from"./ABQMRRNL.js";import{a as q}from"./MOIQ2PKL.js";import{a as S}from"./FHYN6ZAQ.js";import{a as R}from"./CASNTUXN.js";import{a as T}from"./F6JZXX2K.js";import{a as C}from"./AYU6H7NV.js";import"./VMHJHFFS.js";import{e as I}from"./KSQGDVHO.js";import"./WO6FE6CZ.js";import"./RRBGCYLX.js";import{D as x,G as k,H as s,I as w,J as o,L as V,M as p,T as L,g as y,h as n,p as $}from"./2J454YPO.js";var A=({full:v,scale:e,partial:t})=>n`<calcite-icon class=${s(t?void 0:"icon")} .icon=${v?"star-f":"star"} .scale=${e}></calcite-icon>`,h={fieldSet:"fieldset",star:"star",fraction:"fraction",numberAverage:"number--average",numberCount:"number--count",wrapper:"wrapper"},U="calcite-ratings",g={validationMessage:"validationMessage",host:v=>`${U}-${v}`},_=y`:host([disabled]){opacity:var(--calcite-opacity-disabled);cursor:default;-webkit-user-select:none;user-select:none}:host([read-only]) *,:host([disabled]) *,:host([read-only]) ::slotted(*),:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;align-items:center;inline-size:fit-content}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:var(--calcite-opacity-full)}.interaction-container{display:contents}:host([scale=s]){min-block-size:var(--calcite-space-2xl);--calcite-internal-rating-spacing: .25rem}:host([scale=m]){min-block-size:var(--calcite-space-3xl);--calcite-internal-rating-spacing: .5rem}:host([scale=l]){min-block-size:var(--calcite-space-4xl);--calcite-internal-rating-spacing: .75rem}.fieldset{margin:0;display:flex;border-width:0;padding:0;align-items:center;gap:var(--calcite-rating-spacing, var(--calcite-internal-rating-spacing))}.wrapper{display:inline-block}.star{transition-property:background-color,block-size,border-color,box-shadow,color,inset-block-end,inset-block-start,inset-inline-end,inset-inline-start,inset-size,opacity,outline-color,transform;transition-duration:var(--calcite-animation-timing);transition-timing-function:ease-in-out;position:relative;display:flex;flex-direction:column;cursor:pointer;color:var(--calcite-rating-color, var(--calcite-color-border-input))}.star:hover{color:var(--calcite-rating-color-hover, var(--calcite-color-brand-hover))}.star:active{color:var(--calcite-rating-color-press, var(--calcite-color-brand-press))}.star:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(var(--calcite-space-base) * (1 - 2 * clamp(0,var(--calcite-offset-invert-focus),1)))}.average,.fraction{color:var(--calcite-rating-average-color, var(--calcite-color-status-warning))}.hovered,.selected{color:var(--calcite-rating-color, var(--calcite-color-brand))}.fraction{transition-property:background-color,block-size,border-color,box-shadow,color,inset-block-end,inset-block-start,inset-inline-end,inset-inline-start,inset-size,opacity,outline-color,transform;transition-duration:var(--calcite-animation-timing);transition-timing-function:ease-in-out;position:absolute;pointer-events:none;inset-block-start:0;overflow:hidden;inset-inline-start:0}calcite-chip{pointer-events:none;cursor:default}.number--average{font-weight:700;color:var(--calcite-rating-average-text-color)}.number--count{color:var(--calcite-rating-count-text-color, var(--calcite-color-text-2));font-style:italic}.number--count:not(:first-child){margin-inline-start:var(--calcite-rating-spacing, var(--calcite-internal-rating-spacing))}.internal-label-alignment--center{align-items:center}.internal-label-alignment--end{align-items:end}.internal-label--container{display:flex;justify-content:space-between;color:var(--calcite-color-text-1)}.internal-label-required--indicator{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-status-danger);padding-inline:var(--calcite-theme-space-base, var(--calcite-spacing-base))}.internal-label-required--indicator:hover{cursor:help}.internal-label--text{line-height:1}:host([scale=s]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-theme-space-2xs, var(--calcite-spacing-xxs))}:host([scale=s]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-theme-space-sm, var(--calcite-spacing-sm))}:host([scale=s]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-theme-space-sm, var(--calcite-spacing-sm))}:host([scale=s]) .internal-label--text{font-size:var(--calcite-font-size--2)}:host([scale=m]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-theme-space-sm, var(--calcite-spacing-sm))}:host([scale=m]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-theme-space-sm, var(--calcite-spacing-sm))}:host([scale=m]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-theme-space-sm, var(--calcite-spacing-sm))}:host([scale=m]) .internal-label--text{font-size:var(--calcite-font-size--1)}:host([scale=l]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-theme-space-sm, var(--calcite-spacing-sm))}:host([scale=l]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-theme-space-md, var(--calcite-spacing-md))}:host([scale=l]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-theme-space-md, var(--calcite-spacing-md))}:host([scale=l]) .internal-label--text{font-size:var(--calcite-font-size-0)}.validation-container{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch}:host([scale=m]) .validation-container,:host([scale=l]) .validation-container{padding-block-start:.5rem}:host([scale=s]) .validation-container{padding-block-start:.25rem}:host([hidden]){display:none}[hidden]{display:none}`,b=class extends k{constructor(){super(),this.direction=I(),this.emit=!1,this.formSupport=E({inputType:"number",getValue:()=>this.value===0?"":this.value})(this),this.guid=g.host(R()),this.isKeyboardInteraction=!0,this.labelElements=[],this.max=5,this._value=0,this.messages=T({blocking:!0}),this.focusSetter=C()(this).setFocus,this.interactiveContainer=S(this),this.disabled=!1,this.readOnly=!1,this.required=!1,this.scale="m",this.showChip=!1,this.status="idle",this.calciteRatingChange=$({cancelable:!1}),N(this),this.listen("keydown",this.handleHostKeyDown),this.listen("pointerout",this.handleRatingPointerOut),this.listen("pointerover",this.handleRatingPointerOver)}static{this.properties={hoverValue:[16,{},{state:!0}],average:[11,{},{reflect:!0,type:Number}],count:[11,{},{reflect:!0,type:Number}],disabled:[7,{},{reflect:!0,type:Boolean}],form:[3,{},{reflect:!0}],labelText:1,messageOverrides:[0,{},{attribute:!1}],name:[3,{},{reflect:!0}],readOnly:[7,{},{reflect:!0,type:Boolean}],required:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],showChip:[7,{},{reflect:!0,type:Boolean}],status:[3,{},{reflect:!0}],validationIcon:[3,{converter:V},{reflect:!0}],validationMessage:1,validity:[32,{},{readOnly:!0,attribute:!1}],value:[11,{},{reflect:!0,type:Number}]}}static{this.formAssociated=!0}static{this.styles=[_,q]}get value(){return this._value}set value(e){let t=this._value;e!==t&&(this._value=e,this.hasUpdated&&this.handleValueUpdate(e))}async setFocus(e){return this.focusSetter(()=>this.el,e)}async load(){this.requestUpdate("value")}willUpdate(){this.starsMap=Array.from({length:this.max},(e,t)=>{let a=t+1,i=this.hoverValue??0,l=i>0,r=this.average!=null,c=this.average??0,m=!l&&r&&!this.value&&a<=c,d=a===this.value,u=r?c+1-a:0,f=l&&a<=i,M=`${this.guid}-${a}`,P=!l&&!this.value&&r&&!f&&u>0&&u<1,D=this.value>=a,K=this.getTabIndex(a);return{average:m,checked:d,fraction:u,hovered:f,id:M,partial:P,selected:D,value:a,tabIndex:K}})}loaded(){this.labelElements=Array.from(this.renderRoot.querySelectorAll("label"))}handleValueUpdate(e){this.hoverValue=e,this.emit&&this.calciteRatingChange.emit(),this.emit=!1}onLabelClick(){this.setFocus()}handleRatingPointerOver(){this.isKeyboardInteraction=!1}handleRatingPointerOut(){this.isKeyboardInteraction=!0,this.hoverValue=void 0}handleHostKeyDown(){this.isKeyboardInteraction=!0}handleLabelKeyDown(e){let t=this.getValueFromLabelEvent(e),a=e.key,i=a==" "?NaN:Number(a),l=this.direction==="rtl";if(this.emit=!0,isNaN(i))switch(a){case"Enter":case" ":this.value=!this.required&&this.value===t?0:t;break;case"ArrowLeft":case"ArrowRight":{let c=a==="ArrowLeft"===l;this.value=c?this.getNextRatingValue(t):this.getPreviousRatingValue(t),this.updateFocus(),e.preventDefault();break}case"Tab":this.hoverValue=void 0;break}else!this.required&&i>=0&&i<=this.max?this.value=i:this.required&&i>0&&i<=this.max&&(this.value=i),this.updateFocus()}handleInputChange(e){if(this.isKeyboardInteraction===!0){let t=Number(e.target.value);this.hoverValue=t,this.value=t}}handleLabelPointerOver(e){this.hoverValue=this.getValueFromLabelEvent(e)}handleLabelPointerDown(e){let t=e.currentTarget,a=this.getValueFromLabelEvent(e);this.hoverValue=a,this.emit=!0,this.value=!this.required&&this.value===a?0:a,t.focus()}handleLabelClick(e){e.preventDefault()}handleLabelFocus(e){let t=this.getValueFromLabelEvent(e);this.hoverValue=t}updateFocus(){this.hoverValue=this.value,this.labelElements[this.value-1]?.focus()}getTabIndex(e){return this.readOnly||this.value!==e&&(this.value||e!==1)?-1:0}getValueFromLabelEvent(e){let t=e.currentTarget;return Number(t.getAttribute("data-value"))}getNextRatingValue(e){return e===5?1:e+1}getPreviousRatingValue(e){return e===1?5:e-1}render(){let e=this.count?.toString();return this.interactiveContainer({disabled:this.disabled,children:n`<span class=${s(h.wrapper)}>${this.labelText&&z({labelText:this.labelText,onClick:this.onLabelClick,required:this.required,tooltipText:this.messages.required})||""}<fieldset class=${s(h.fieldSet)} .disabled=${this.disabled}><legend class=${s(p.screenReaderText)}>${this.messages.rating}</legend>${this.starsMap.map(({average:t,checked:a,fraction:i,hovered:l,id:r,partial:c,selected:m,value:d,tabIndex:u})=>n`<label class=${s({[h.star]:!0,selected:m,hovered:l,average:t,partial:c})} data-value=${d??o} for=${r??o} @click=${this.handleLabelClick} @focus=${this.handleLabelFocus} @keydown=${this.handleLabelKeyDown} @pointerdown=${this.handleLabelPointerDown} @pointerover=${this.handleLabelPointerOver} tabindex=${u??o}><input aria-errormessage=${g.validationMessage} .ariaInvalid=${this.status==="invalid"} .ariaLabel=${F(this)} .ariaRequired=${this.required} .checked=${a} class=${s(p.screenReaderText)} .disabled=${this.disabled||this.readOnly} id=${r??o} name=${this.guid??o} @change=${this.handleInputChange} tabindex=-1 type=radio .value=${x(d??"")}>${A({full:m||t||l,scale:this.scale})}${c&&n`<div class=${s(h.fraction)} style=${w({width:`${i*100}%`})}>${A({full:!0,partial:!0,scale:this.scale})}</div>`||""}<span class=${s(p.screenReaderText)}>${this.messages.stars.replace("{num}",`${d}`)}</span></label>`)}${(this.count||this.average)&&this.showChip?n`<calcite-chip .label=${e} .scale=${this.scale} .value=${e}>${!!this.average&&n`<span class=${s(h.numberAverage)}>${this.average.toString()}</span>`||""}${!!this.count&&n`<span class=${s(h.numberCount)}>(${e})</span>`||""}</calcite-chip>`:null}</fieldset>${this.validationMessage&&this.status==="invalid"?O({icon:this.validationIcon,id:g.validationMessage,message:this.validationMessage,scale:this.scale,status:this.status}):null}</span>`})}};L("calcite-rating",b);export{b as Rating};
|
|
2
|
+
import{a as O}from"./BXQ56X62.js";import{a as z}from"./EK766TTO.js";import{c as E}from"./M5PUWCJO.js";import{a as F}from"./XN5GTOTE.js";import{a as N}from"./GGQA652X.js";import{a as q}from"./TW3QNIRG.js";import{a as S}from"./45UWYTX5.js";import{a as R}from"./CASNTUXN.js";import{a as T}from"./5VVWG6MS.js";import{a as C}from"./YUOWOBVQ.js";import"./VMHJHFFS.js";import{e as I}from"./KQDGRC6H.js";import"./MHUK6DQI.js";import"./RRBGCYLX.js";import{D as x,G as k,H as s,I as w,J as o,L as V,M as p,T as L,g as y,h as n,p as $}from"./RREWRPJD.js";var A=({full:v,scale:e,partial:t})=>n`<calcite-icon class=${s(t?void 0:"icon")} .icon=${v?"star-f":"star"} .scale=${e}></calcite-icon>`,h={fieldSet:"fieldset",star:"star",fraction:"fraction",numberAverage:"number--average",numberCount:"number--count",wrapper:"wrapper"},U="calcite-ratings",g={validationMessage:"validationMessage",host:v=>`${U}-${v}`},_=y`:host([disabled]){opacity:var(--calcite-opacity-disabled);cursor:default;-webkit-user-select:none;user-select:none}:host([read-only]) *,:host([disabled]) *,:host([read-only]) ::slotted(*),:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;align-items:center;inline-size:fit-content}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:var(--calcite-opacity-full)}.interaction-container{display:contents}:host([scale=s]){min-block-size:var(--calcite-space-2xl);--calcite-internal-rating-spacing: .25rem}:host([scale=m]){min-block-size:var(--calcite-space-3xl);--calcite-internal-rating-spacing: .5rem}:host([scale=l]){min-block-size:var(--calcite-space-4xl);--calcite-internal-rating-spacing: .75rem}.fieldset{margin:0;display:flex;border-width:0;padding:0;align-items:center;gap:var(--calcite-rating-spacing, var(--calcite-internal-rating-spacing))}.wrapper{display:inline-block}.star{transition-property:background-color,block-size,border-color,box-shadow,color,inset-block-end,inset-block-start,inset-inline-end,inset-inline-start,inset-size,opacity,outline-color,transform;transition-duration:var(--calcite-animation-timing);transition-timing-function:ease-in-out;position:relative;display:flex;flex-direction:column;cursor:pointer;color:var(--calcite-rating-color, var(--calcite-color-border-input))}.star:hover{color:var(--calcite-rating-color-hover, var(--calcite-color-brand-hover))}.star:active{color:var(--calcite-rating-color-press, var(--calcite-color-brand-press))}.star:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(var(--calcite-space-base) * (1 - 2 * clamp(0,var(--calcite-offset-invert-focus),1)))}.average,.fraction{color:var(--calcite-rating-average-color, var(--calcite-color-status-warning))}.hovered,.selected{color:var(--calcite-rating-color, var(--calcite-color-brand))}.fraction{transition-property:background-color,block-size,border-color,box-shadow,color,inset-block-end,inset-block-start,inset-inline-end,inset-inline-start,inset-size,opacity,outline-color,transform;transition-duration:var(--calcite-animation-timing);transition-timing-function:ease-in-out;position:absolute;pointer-events:none;inset-block-start:0;overflow:hidden;inset-inline-start:0}calcite-chip{pointer-events:none;cursor:default}.number--average{font-weight:700;color:var(--calcite-rating-average-text-color)}.number--count{color:var(--calcite-rating-count-text-color, var(--calcite-color-text-2));font-style:italic}.number--count:not(:first-child){margin-inline-start:var(--calcite-rating-spacing, var(--calcite-internal-rating-spacing))}.internal-label-alignment--center{align-items:center}.internal-label-alignment--end{align-items:end}.internal-label--container{display:flex;justify-content:space-between;color:var(--calcite-color-text-1)}.internal-label-required--indicator{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-status-danger);padding-inline:var(--calcite-theme-space-base, var(--calcite-spacing-base))}.internal-label-required--indicator:hover{cursor:help}.internal-label--text{line-height:1}:host([scale=s]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-theme-space-2xs, var(--calcite-spacing-xxs))}:host([scale=s]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-theme-space-sm, var(--calcite-spacing-sm))}:host([scale=s]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-theme-space-sm, var(--calcite-spacing-sm))}:host([scale=s]) .internal-label--text{font-size:var(--calcite-font-size--2)}:host([scale=m]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-theme-space-sm, var(--calcite-spacing-sm))}:host([scale=m]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-theme-space-sm, var(--calcite-spacing-sm))}:host([scale=m]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-theme-space-sm, var(--calcite-spacing-sm))}:host([scale=m]) .internal-label--text{font-size:var(--calcite-font-size--1)}:host([scale=l]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-theme-space-sm, var(--calcite-spacing-sm))}:host([scale=l]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-theme-space-md, var(--calcite-spacing-md))}:host([scale=l]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-theme-space-md, var(--calcite-spacing-md))}:host([scale=l]) .internal-label--text{font-size:var(--calcite-font-size-0)}.validation-container{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch}:host([scale=m]) .validation-container,:host([scale=l]) .validation-container{padding-block-start:.5rem}:host([scale=s]) .validation-container{padding-block-start:.25rem}:host([hidden]){display:none}[hidden]{display:none}`,b=class extends k{constructor(){super(),this.direction=I(),this.emit=!1,this.formSupport=E({inputType:"number",getValue:()=>this.value===0?"":this.value})(this),this.guid=g.host(R()),this.isKeyboardInteraction=!0,this.labelElements=[],this.max=5,this._value=0,this.messages=T({blocking:!0}),this.focusSetter=C()(this).setFocus,this.interactiveContainer=S(this),this.disabled=!1,this.readOnly=!1,this.required=!1,this.scale="m",this.showChip=!1,this.status="idle",this.calciteRatingChange=$({cancelable:!1}),N(this),this.listen("keydown",this.handleHostKeyDown),this.listen("pointerout",this.handleRatingPointerOut),this.listen("pointerover",this.handleRatingPointerOver)}static{this.properties={hoverValue:[16,{},{state:!0}],average:[11,{},{reflect:!0,type:Number}],count:[11,{},{reflect:!0,type:Number}],disabled:[7,{},{reflect:!0,type:Boolean}],form:[3,{},{reflect:!0}],labelText:1,messageOverrides:[0,{},{attribute:!1}],name:[3,{},{reflect:!0}],readOnly:[7,{},{reflect:!0,type:Boolean}],required:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],showChip:[7,{},{reflect:!0,type:Boolean}],status:[3,{},{reflect:!0}],validationIcon:[3,{converter:V},{reflect:!0}],validationMessage:1,validity:[32,{},{readOnly:!0,attribute:!1}],value:[11,{},{reflect:!0,type:Number}]}}static{this.formAssociated=!0}static{this.styles=[_,q]}get value(){return this._value}set value(e){let t=this._value;e!==t&&(this._value=e,this.hasUpdated&&this.handleValueUpdate(e))}async setFocus(e){return this.focusSetter(()=>this.el,e)}async load(){this.requestUpdate("value")}willUpdate(){this.starsMap=Array.from({length:this.max},(e,t)=>{let a=t+1,i=this.hoverValue??0,l=i>0,r=this.average!=null,c=this.average??0,m=!l&&r&&!this.value&&a<=c,d=a===this.value,u=r?c+1-a:0,f=l&&a<=i,M=`${this.guid}-${a}`,P=!l&&!this.value&&r&&!f&&u>0&&u<1,D=this.value>=a,K=this.getTabIndex(a);return{average:m,checked:d,fraction:u,hovered:f,id:M,partial:P,selected:D,value:a,tabIndex:K}})}loaded(){this.labelElements=Array.from(this.renderRoot.querySelectorAll("label"))}handleValueUpdate(e){this.hoverValue=e,this.emit&&this.calciteRatingChange.emit(),this.emit=!1}onLabelClick(){this.setFocus()}handleRatingPointerOver(){this.isKeyboardInteraction=!1}handleRatingPointerOut(){this.isKeyboardInteraction=!0,this.hoverValue=void 0}handleHostKeyDown(){this.isKeyboardInteraction=!0}handleLabelKeyDown(e){let t=this.getValueFromLabelEvent(e),a=e.key,i=a==" "?NaN:Number(a),l=this.direction==="rtl";if(this.emit=!0,isNaN(i))switch(a){case"Enter":case" ":this.value=!this.required&&this.value===t?0:t;break;case"ArrowLeft":case"ArrowRight":{let c=a==="ArrowLeft"===l;this.value=c?this.getNextRatingValue(t):this.getPreviousRatingValue(t),this.updateFocus(),e.preventDefault();break}case"Tab":this.hoverValue=void 0;break}else!this.required&&i>=0&&i<=this.max?this.value=i:this.required&&i>0&&i<=this.max&&(this.value=i),this.updateFocus()}handleInputChange(e){if(this.isKeyboardInteraction===!0){let t=Number(e.target.value);this.hoverValue=t,this.value=t}}handleLabelPointerOver(e){this.hoverValue=this.getValueFromLabelEvent(e)}handleLabelPointerDown(e){let t=e.currentTarget,a=this.getValueFromLabelEvent(e);this.hoverValue=a,this.emit=!0,this.value=!this.required&&this.value===a?0:a,t.focus()}handleLabelClick(e){e.preventDefault()}handleLabelFocus(e){let t=this.getValueFromLabelEvent(e);this.hoverValue=t}updateFocus(){this.hoverValue=this.value,this.labelElements[this.value-1]?.focus()}getTabIndex(e){return this.readOnly||this.value!==e&&(this.value||e!==1)?-1:0}getValueFromLabelEvent(e){let t=e.currentTarget;return Number(t.getAttribute("data-value"))}getNextRatingValue(e){return e===5?1:e+1}getPreviousRatingValue(e){return e===1?5:e-1}render(){let e=this.count?.toString();return this.interactiveContainer({disabled:this.disabled,children:n`<span class=${s(h.wrapper)}>${this.labelText&&z({labelText:this.labelText,onClick:this.onLabelClick,required:this.required,tooltipText:this.messages.required})||""}<fieldset class=${s(h.fieldSet)} .disabled=${this.disabled}><legend class=${s(p.screenReaderText)}>${this.messages.rating}</legend>${this.starsMap.map(({average:t,checked:a,fraction:i,hovered:l,id:r,partial:c,selected:m,value:d,tabIndex:u})=>n`<label class=${s({[h.star]:!0,selected:m,hovered:l,average:t,partial:c})} data-value=${d??o} for=${r??o} @click=${this.handleLabelClick} @focus=${this.handleLabelFocus} @keydown=${this.handleLabelKeyDown} @pointerdown=${this.handleLabelPointerDown} @pointerover=${this.handleLabelPointerOver} tabindex=${u??o}><input aria-errormessage=${g.validationMessage} .ariaInvalid=${this.status==="invalid"} .ariaLabel=${F(this)} .ariaRequired=${this.required} .checked=${a} class=${s(p.screenReaderText)} .disabled=${this.disabled||this.readOnly} id=${r??o} name=${this.guid??o} @change=${this.handleInputChange} tabindex=-1 type=radio .value=${x(d??"")}>${A({full:m||t||l,scale:this.scale})}${c&&n`<div class=${s(h.fraction)} style=${w({width:`${i*100}%`})}>${A({full:!0,partial:!0,scale:this.scale})}</div>`||""}<span class=${s(p.screenReaderText)}>${this.messages.stars.replace("{num}",`${d}`)}</span></label>`)}${(this.count||this.average)&&this.showChip?n`<calcite-chip .label=${e} .scale=${this.scale} .value=${e}>${!!this.average&&n`<span class=${s(h.numberAverage)}>${this.average.toString()}</span>`||""}${!!this.count&&n`<span class=${s(h.numberCount)}>(${e})</span>`||""}</calcite-chip>`:null}</fieldset>${this.validationMessage&&this.status==="invalid"?O({icon:this.validationIcon,id:g.validationMessage,message:this.validationMessage,scale:this.scale,status:this.status}):null}</span>`})}};L("calcite-rating",b);export{b as Rating};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{h as b}from"./
|
|
2
|
+
import{h as b}from"./EIHSE32P.js";import{b as y}from"./WTNYMVTD.js";import{a as p}from"./45UWYTX5.js";import{j as c}from"./FLTBH3MD.js";import{a as g}from"./JN6YLTUP.js";import{a as f}from"./YUOWOBVQ.js";import"./VMHJHFFS.js";import"./KQDGRC6H.js";import"./MHUK6DQI.js";import{m as v}from"./RRBGCYLX.js";import{G as h,H as t,K as o,T as u,g as n,h as d,p as a}from"./RREWRPJD.js";var x=n`:host([disabled]){opacity:var(--calcite-opacity-disabled);cursor:default;-webkit-user-select:none;user-select:none}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{cursor:pointer;display:flex;position:relative;outline:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:var(--calcite-opacity-full)}.interaction-container{display:contents}.day-wrapper{display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;inline-size:100%}.day{transition-property:background-color,block-size,border-color,box-shadow,color,inset-block-end,inset-block-start,inset-inline-end,inset-inline-start,inset-size,opacity,outline-color,transform;transition-duration:var(--calcite-animation-timing);transition-timing-function:ease-in-out;font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);display:flex;align-items:center;justify-content:center;inline-size:100%;position:relative;line-height:var(--calcite-font-line-height-fixed-base);block-size:var(--calcite-internal-day-size);outline-color:var(--calcite-color-transparent);background-color:var(--calcite-date-picker-day-background-color);color:var(--calcite-date-picker-day-text-color, var(--calcite-color-text-1))}.text{margin-block:var(--calcite-space-px) var(--calcite-space-none);margin-inline-start:0px}:host([scale=s]){--calcite-internal-day-size: 32px}:host([scale=s]) .day{font-size:var(--calcite-font-size-relative-sm)}:host([scale=m]){--calcite-internal-day-size: 40px}:host([scale=m]) .day{font-size:var(--calcite-font-size-relative-base)}:host([scale=l]){--calcite-internal-day-size: 44px}:host([scale=l]) .day{font-size:var(--calcite-font-size-relative-md)}:host(:not([current-month])) .day{opacity:var(--calcite-opacity-full);color:var(--calcite-color-text-3)}:host(:focus:not([disabled]):not([selected]):not([current-month])) .day{color:var(--calcite-color-text-1)}:host(:hover:not([disabled]):not([selected])) .day{background-color:var(--calcite-date-picker-day-background-color-hover, var(--calcite-theme-color-surface-3, var(--calcite-color-foreground-2)));color:var(--calcite-date-picker-day-text-color-hover, var(--calcite-color-text-1))}:host(:not([range]):not([selected]).current-day) .day{color:var(--calcite-date-picker-current-day-text-color, var(--calcite-color-brand));font-weight:var(--calcite-font-weight-bold)}:host(:focus[selected]) .day{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(var(--calcite-space-base) * (1 - 2 * clamp(0,var(--calcite-offset-invert-focus),1)));z-index:var(--calcite-z-index);box-shadow:0 0 0 2px var(--calcite-theme-color-surface-2, var(--calcite-color-foreground-1))}:host(:focus:not([disabled]):not([selected])) .day{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(-1 * var(--calcite-space-base) * (1 - 2 * clamp(0,var(--calcite-offset-invert-focus),1)))}:host(:hover:not([disabled]):not([selected])) .day{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(-1 * var(--calcite-space-base) * (1 - 2 * clamp(0,var(--calcite-offset-invert-focus),1)))}:host([selected]) .day{font-weight:var(--calcite-font-weight-medium);background-color:var(--calcite-date-picker-day-background-color-selected, var(--calcite-color-brand));color:var(--calcite-date-picker-day-text-color-selected, var(--calcite-color-text-inverse))}:host([range-hover]:not([selected])) .day{background-color:var(--calcite-date-picker-day-outside-range-background-color-hover, var(--calcite-theme-color-surface-3, var(--calcite-color-foreground-2)));color:var(--calcite-date-picker-day-outside-range-text-color-hover, var(--calcite-color-text-1))}:host([highlighted]:not([selected])) .day,:host(:hover[highlighted]:not([selected])) .day{color:var(--calcite-date-picker-day-range-text-color, var(--calcite-color-text-highlight));background-color:var(--calcite-date-picker-day-range-background-color, var(--calcite-color-surface-highlight))}:host([disabled]) .day{color:var(--calcite-color-text-2);text-decoration-line:line-through;opacity:var(--calcite-opacity-disabled)}@media(forced-colors:active){.day{border-radius:var(--calcite-corner-radius-none)}:host([selected]){outline:2px solid canvasText}:host(:hover:not([selected])) .day{border-radius:50%}:host([range][selected]) .day,:host([highlighted]) .day,:host([range-hover]:not([selected])) .day{background-color:highlight}:host([range-hover]) .day,:host([range][selected][start-of-range]) .day,:host([range][selected][end-of-range]) .day{background-color:canvas}}:host([hidden]){display:none}[hidden]{display:none}`,r={dayWrapper:"day-wrapper",day:"day",text:"text"},i=class extends h{constructor(){super(),this.focusSetter=f()(this).setFocus,this.interactiveContainer=p(this),this.active=!1,this.currentMonth=!1,this.disabled=!1,this.endOfRange=!1,this.highlighted=!1,this.range=!1,this.rangeHover=!1,this.selected=!1,this.startOfRange=!1,this.calciteInternalDayHover=a({cancelable:!1}),this.calciteInternalDaySelect=a({cancelable:!1}),this.listen("pointerover",this.pointerOverHandler),this.listen("click",this.onClick),this.listen("keydown",this.keyDownHandler)}static{this.properties={active:[7,{},{reflect:!0,type:Boolean}],currentMonth:[7,{},{reflect:!0,type:Boolean}],dateTimeFormat:[0,{},{attribute:!1}],day:[9,{},{type:Number}],disabled:[7,{},{reflect:!0,type:Boolean}],endOfRange:[7,{},{reflect:!0,type:Boolean}],highlighted:[7,{},{reflect:!0,type:Boolean}],range:[7,{},{reflect:!0,type:Boolean}],rangeHover:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],selected:[7,{},{reflect:!0,type:Boolean}],startOfRange:[7,{},{reflect:!0,type:Boolean}],value:[0,{},{attribute:!1}]}}static{this.styles=x}async setFocus(e){return this.focusSetter(()=>this.el,e)}load(){this.parentDatePickerEl=v(this.el,"calcite-date-picker")??void 0}onClick(){this.disabled||this.calciteInternalDaySelect.emit()}keyDownHandler(e){g(e.key)&&(this.disabled||this.calciteInternalDaySelect.emit(),e.preventDefault())}pointerOverHandler(){this.disabled||this.calciteInternalDayHover.emit()}render(){let e=b(this.value).replaceAll("-","");if(this.parentDatePickerEl){let{numberingSystem:l,lang:s}=this.parentDatePickerEl;c.numberFormatOptions={useGrouping:!1,...l&&{numberingSystem:l},...s&&{locale:s}}}let m=c.localize(String(this.day)),k=this.dateTimeFormat.format(this.value)??null;return this.el.ariaLabel=k,this.el.ariaSelected=y(this.active),o(this.el,"id",e),this.el.role="gridcell",o(this.el,"tabIndex",this.active&&!this.disabled?0:-1),this.interactiveContainer({disabled:this.disabled,children:d`<div aria-hidden=true class=${t(r.dayWrapper)}><span class=${t(r.day)}><span class=${t(r.text)}>${m}</span></span></div>`})}};u("calcite-date-picker-day",i);export{i as DatePickerDay};
|