@luzmo/lucero 2.0.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/components/index.cjs +1 -1
- package/components/index.js +10 -9
- package/components/options/index.cjs +1 -1
- package/components/options/index.js +2 -2
- package/components/options/options.d.ts +7 -0
- package/components/{options-Dh4FJuAu.cjs → options-Bd6Uly5_.cjs} +7 -4
- package/components/{options-BqFBNoKA.js → options-CpaaBaxn.js} +23 -15
- package/components/select/index.cjs +1 -1
- package/components/select/index.js +1 -1
- package/components/select/select.d.ts +4 -0
- package/components/{select-CFtAPE-U.js → select-BbFG38ag.js} +95 -80
- package/components/select-D5fQgPPj.cjs +158 -0
- package/components/split-view/index.cjs +18 -0
- package/components/split-view/index.d.ts +7 -0
- package/components/split-view/index.js +25 -0
- package/components/split-view/split-view-model.d.ts +12 -0
- package/components/split-view/split-view.d.ts +106 -0
- package/components/split-view-5uMSU_b7.cjs +43 -0
- package/components/split-view-FxpiSCem.js +359 -0
- package/custom-elements.json +1 -1
- package/index.d.ts +1 -0
- package/package.json +7 -1
- package/components/select-JFwtVyhG.cjs +0 -158
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/*! * Lucero - The design system for Luzmo.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2025 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
|
|
6
|
+
* This license allows users with a current active Luzmo account to use Lucero.
|
|
7
|
+
* This license terminates automatically if a user no longer has an active Luzmo account.
|
|
8
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
9
|
+
*
|
|
10
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
+
* SOFTWARE.
|
|
17
|
+
* */
|
|
18
|
+
const e=require("./decorate-Dq34MBGe.cjs"),t=require("./sized-mixin-BT7cv-fT.cjs"),n=require("./focusable-B6h03pAe.cjs");require("./icon-CSqR-OOO.cjs");const r=require("./dependency-manger-BSaHw9ju.cjs"),i=require("./strategies-BwNbUXYS.cjs"),a=require("./pending-state-a527YMWV.cjs");require("./overlay-CPZvL0Ic.cjs"),require("./progress-circle/index.cjs"),require("./tooltip-Sm0pruxL.cjs"),require("./popover/index.cjs");const o=require("./options-Bd6Uly5_.cjs");let s=require("lit"),c=require("lit/decorators.js"),l=require("@luzmo/icons"),u=require("lit/directives/if-defined.js"),d=require("lit/directives/class-map.js");var f=(e,t)=>{let n=getComputedStyle(e).getPropertyValue(t);for(;!n&&e.parentElement;)e=e.parentElement,n=getComputedStyle(e).getPropertyValue(t);return n.trim()},p=`:host{font-family:var(--luzmo-select-font-family,var(--select-font-family));font-size:var(--luzmo-select-font-size,var(--select-font-size))}#button{cursor:pointer;-webkit-user-select:none;user-select:none;font-family:var(--luzmo-button-font-family,var(--luzmo-font-family));-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:var(--luzmo-button-line-height,var(--luzmo-line-height,1.3));text-transform:none;vertical-align:top;-webkit-appearance:button;transition:background var(--luzmo-button-animation-duration,var(--luzmo-animation-duration)) ease-out, border-color var(--luzmo-button-animation-duration,var(--luzmo-animation-duration)) ease-out, color var(--luzmo-button-animation-duration,var(--luzmo-animation-duration)) ease-out, box-shadow var(--luzmo-button-animation-duration,var(--luzmo-animation-duration)) ease-out;justify-content:center;align-items:center;margin:0;-webkit-text-decoration:none;text-decoration:none;display:inline-flex;position:relative;overflow:visible}#button::-moz-focus-inner{border-style:none;padding:0}#button:focus{outline:none}#icon{font-size:var(--luzmo-select-font-size,var(--select-font-size));margin-inline-end:var(--luzmo-select-spacing-text-to-icon,var(--select-spacing-text-to-icon))}@media (forced-colors:active){:host{--highcontrast-select-focus-indicator-color:Highlight;--highcontrast-select-border-color-default:ButtonBorder;--highcontrast-select-border-color-hover:Highlight;--highcontrast-select-border-color-disabled:GrayText;--highcontrast-select-content-color-default:ButtonText;--highcontrast-select-content-color-disabled:GrayText;--highcontrast-select-background-color:ButtonFace}#button:focus-visible{--highcontrast-select-border-color-hover:ButtonText}#button .label,#button:after{forced-color-adjust:none}}#button{box-sizing:border-box;max-inline-size:100%;min-inline-size:calc(var(--select-minimum-width-multiplier) * var(--luzmo-select-button-block-size,var(--select-button-block-size)));block-size:var(--luzmo-select-button-block-size,var(--select-button-block-size));border-width:var(--luzmo-select-button-border-width,var(--select-button-border-width));border-radius:var(--luzmo-select-button-border-radius,var(--select-button-border-radius));box-shadow:var(--luzmo-select-button-box-shadow,var(--select-button-box-shadow));transition:background-color var(--luzmo-select-animation-duration,var(--select-animation-duration)), box-shadow var(--luzmo-select-animation-duration,var(--select-animation-duration)), border-color var(--luzmo-select-animation-duration,var(--select-animation-duration)) ease-in-out;color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-default,var(--select-font-color-default)));background-color:var(--highcontrast-select-background-color,var(--luzmo-select-background-color-default,var(--select-background-color-default)));border-style:solid;border-color:var(--highcontrast-select-border-color-default,var(--luzmo-select-border-color-default,var(--select-border-color-default)));margin-block-start:var(--luzmo-select-spacing-label-to-select,var(--select-spacing-label-to-select));padding-block:0;padding-inline-start:var(--luzmo-select-inline-edge-to-content,var(--select-inline-edge-to-content));padding-inline-end:var(--luzmo-select-spacing-edge-to-disclosure-icon,var(--select-spacing-edge-to-disclosure-icon));display:flex}#button:after{pointer-events:none;content:"";block-size:calc(100% + var(--luzmo-select-focus-indicator-gap,var(--select-focus-indicator-gap)) * 2 + var(--luzmo-select-button-border-width,var(--select-button-border-width)) * 2);inline-size:calc(100% + var(--luzmo-select-focus-indicator-gap,var(--select-focus-indicator-gap)) * 2 + var(--luzmo-select-button-border-width,var(--select-button-border-width)) * 2);border-style:solid;border-width:var(--luzmo-select-focus-indicator-width,var(--select-focus-indicator-width));border-radius:calc(var(--luzmo-select-button-border-radius,var(--select-button-border-radius)) + var(--luzmo-select-focus-indicator-gap,var(--select-focus-indicator-gap)) + var(--luzmo-select-button-border-width,var(--select-button-border-width)));border-color:#0000;margin-block-start:calc((var(--luzmo-select-focus-indicator-gap,var(--select-focus-indicator-gap)) + var(--luzmo-select-focus-indicator-width,var(--select-focus-indicator-width)) + var(--luzmo-select-button-border-width,var(--select-button-border-width))) * -1);margin-inline-start:calc((var(--luzmo-select-focus-indicator-gap,var(--select-focus-indicator-gap)) + var(--luzmo-select-focus-indicator-width,var(--select-focus-indicator-width)) + var(--luzmo-select-button-border-width,var(--select-button-border-width))) * -1);position:absolute;inset-block:0;inset-inline:0}#button:active{background-color:var(--highcontrast-select-background-color,var(--luzmo-select-background-color-active,var(--select-background-color-active)));border-color:var(--highcontrast-select-border-color-default,var(--luzmo-select-border-active,var(--select-border-color-active)))}#button:active:after{border-color:#0000}#button.placeholder:active .label{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-active,var(--select-font-color-active)))}#button:focus-visible{background-color:var(--highcontrast-select-background-color,var(--luzmo-select-background-color-key-focus,var(--select-background-color-key-focus)));border-color:var(--highcontrast-select-border-color-default,var(--luzmo-select-border-color-key-focus,var(--select-border-color-key-focus)));color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-key-focus,var(--select-font-color-key-focus)));outline:none}#button:focus-visible:after{border-color:var(--highcontrast-select-focus-indicator-color,var(--luzmo-select-focus-indicator-color,var(--select-focus-indicator-color)))}#button.placeholder:focus-visible{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-key-focus,var(--select-font-color-key-focus)))}#button:focus-visible .disclosure-icon,#button:focus-visible .clear-icon{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-icon-color-key-focus,var(--select-icon-color-key-focus)))}:host([open]) #button:not(:disabled,.is-disabled){color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-default-open,var(--select-font-color-default-open)));background-color:var(--highcontrast-select-background-color,var(--luzmo-select-background-color-default-open,var(--select-background-color-default-open)));border-color:var(--highcontrast-select-border-color-default,var(--luzmo-select-border-default-open,var(--select-border-color-default-open)))}:host([open]) #button:not(:disabled,.is-disabled) .disclosure-icon,:host([open]) #button:not(:disabled,.is-disabled) .clear-icon{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-icon-color-default-open,var(--select-icon-color-default-open)))}:host([invalid]) #button:not(:disabled,.is-disabled){border-color:var(--highcontrast-select-border-color-default,var(--luzmo-select-border-color-error-default,var(--select-border-color-error-default)))}:host([invalid]) #button:not(:disabled,.is-disabled) .validation-icon{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-icon-color-error,var(--select-icon-color-error)))}:host([invalid]) #button:not(:disabled,.is-disabled):active{border-color:var(--highcontrast-select-border-color-default,var(--luzmo-select-border-color-error-active,var(--select-border-color-error-active)))}:host([invalid][open]) #button:not(:disabled,.is-disabled){border-color:var(--highcontrast-select-border-color-default,var(--luzmo-select-border-color-error-default-open,var(--select-border-color-error-default-open)))}:host([invalid]) #button:not(:disabled,.is-disabled):focus-visible{border-color:var(--highcontrast-select-border-color-default,var(--luzmo-select-border-color-error-key-focus,var(--select-border-color-error-key-focus)))}:host([pending]) #button .disclosure-icon,:host([pending]) #button .clear-icon{color:var(--highcontrast-select-content-color-disabled,var(--luzmo-select-icon-color-disabled,var(--select-icon-color-disabled)))}.icon{flex-shrink:0}.label{white-space:nowrap;font-size:var(--luzmo-select-font-size,var(--select-font-size));line-height:var(--luzmo-select-button-line-height,var(--select-button-line-height));font-weight:var(--luzmo-select-font-weight,var(--select-font-weight));text-overflow:ellipsis;text-align:start;flex:auto;overflow:hidden}.label.placeholder{font-weight:var(--luzmo-select-placeholder-font-weight,var(--select-font-weight));font-style:var(--luzmo-select-placeholder-font-style,var(--select-placeholder-font-style));transition:color var(--luzmo-select-animation-duration,var(--select-animation-duration)) ease-in-out;color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-default,var(--select-font-color-default)))}.label.placeholder:active{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-active,var(--select-font-color-active)))}.clear-icon,.disclosure-icon{vertical-align:top;transition:color var(--luzmo-select-animation-duration,var(--select-animation-duration)) ease-out;color:var(--highcontrast-select-content-color-default,var(--luzmo-select-icon-color-default,var(--select-icon-color-default)));flex-shrink:0;display:inline-block;position:relative}.disclosure-icon{margin-inline-start:var(--luzmo-select-spacing-icon-to-disclosure-icon,var(--select-spacing-icon-to-disclosure-icon))}.clear-icon{margin-inline-start:var(--luzmo-select-spacing-icon-to-clear-icon,var(--select-spacing-icon-to-clear-icon))}.disclosure-icon:active{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-icon-color-active,var(--select-icon-color-active)))}luzmo-progress-circle,.validation-icon{margin-inline-start:var(--luzmo-select-spacing-text-to-icon,var(--select-spacing-text-to-icon))}.icon-container{height:100%;font-size:var(--luzmo-select-disclosure-icon-size,var(--select-disclosure-icon-size));align-items:center;display:flex;position:relative}.icon-container.disclosure-icon{margin-inline-end:0}.label~.disclosure-icon,.label~.clear-icon{margin-inline-start:var(--luzmo-select-spacing-text-to-icon,var(--select-spacing-text-to-icon))}:host([quiet]) #button{inline-size:auto;min-inline-size:0;padding-inline:var(--luzmo-select-inline-edge-to-content-quiet,var(--select-inline-edge-to-content-quiet));color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-default,var(--select-font-color-default)));background-color:initial;background-color:var(--highcontrast-select-background-color,transparent);box-shadow:none;border:none;border-radius:0;margin-block-start:calc(var(--luzmo-select-spacing-label-to-select-quiet,var(--select-spacing-label-to-select-quiet)) + 1px)}:host([quiet]) #button.label-inline{margin-block-start:0}:host([quiet]) #button .disclosure-icon{margin-inline-end:var(--luzmo-select-spacing-edge-to-disclosure-icon-quiet,var(--select-spacing-edge-to-disclosure-icon-quiet))}:host([quiet]) #button:after{border:none;block-size:auto;inline-size:auto}@media (hover:hover){#button:hover{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-hover,var(--select-font-color-hover)));background-color:var(--highcontrast-select-background-color,var(--luzmo-select-background-color-hover,var(--select-background-color-hover)));border-color:var(--highcontrast-select-border-color-hover,var(--luzmo-select-border-color-hover,var(--select-border-color-hover)))}#button:hover .disclosure-icon,#button:hover .clear-icon{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-icon-color-hover,var(--select-icon-color-hover)))}#button:hover .clear-icon:hover{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-clear-icon-color-hover,var(--select-icon-color-focus)))}:host([open]):not([quiet]) #button:not(:disabled,.is-disabled):hover{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-hover-open,var(--select-font-color-hover-open)));background-color:var(--highcontrast-select-background-color,var(--luzmo-select-background-color-hover-open,var(--select-background-color-hover-open)));border-color:var(--highcontrast-select-border-color-hover,var(--luzmo-select-border-color-hover-open,var(--select-border-color-hover-open)))}:host([open]) #button:not(:disabled,.is-disabled):hover .disclosure-icon,:host([open]) #button:not(:disabled,.is-disabled):hover .clear-icon{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-icon-color-hover-open,var(--select-icon-color-hover-open)))}:host([invalid]) #button:not(:disabled,.is-disabled):hover{border-color:var(--highcontrast-select-border-color-hover,var(--luzmo-select-border-color-error-hover,var(--select-border-color-error-hover)))}:host([invalid][open]) #button:not(:disabled,.is-disabled):hover{border-color:var(--highcontrast-select-border-color-hover,var(--luzmo-select-border-color-error-hover-open,var(--select-border-color-error-hover-open)))}.label.placeholder:hover{color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-hover,var(--select-font-color-hover)))}:host([quiet]) #button:hover{background-color:initial;background-color:var(--highcontrast-select-background-color,transparent)!important}}:host([quiet]) #button:focus-visible{background-color:initial;background-color:var(--highcontrast-select-background-color,transparent)}:host([quiet]) #button:focus-visible:after{box-shadow:0 var(--luzmo-select-focus-indicator-width,var(--select-focus-indicator-width)) 0 0 var(--highcontrast-select-focus-indicator-color,var(--luzmo-select-focus-indicator-color,var(--select-focus-indicator-color)));margin:calc((var(--luzmo-select-focus-indicator-gap,var(--select-focus-indicator-gap)) + var(--luzmo-select-button-border-width,var(--select-button-border-width))) * -1) 0;border:none;border-radius:0}:host([quiet][open]) #button,:host([quiet][disabled]) #button#button,:host([quiet]) #button#button:disabled,:host([quiet]) #button:active{background-color:initial;background-color:var(--highcontrast-select-background-color,transparent)}.label-inline{vertical-align:top;display:inline-flex}:host([disabled]) #button,#button:disabled{cursor:default;background-color:var(--highcontrast-select-background-color,var(--luzmo-select-background-color-disabled,var(--select-background-color-disabled)));border-color:#0000;border-color:var(--highcontrast-select-border-color-disabled,transparent);color:var(--highcontrast-select-content-color-disabled,var(--luzmo-select-font-color-disabled,var(--select-font-color-disabled)))}:host([disabled]) #button .icon,:host([disabled]) #button .disclosure-icon,:host([disabled]) #button .clear-icon,:host([disabled]) #button .validation-icon,#button:disabled .icon,#button:disabled .disclosure-icon,#button:disabled .clear-icon,#button:disabled .validation-icon{color:var(--highcontrast-select-content-color-disabled,var(--luzmo-select-icon-color-disabled,var(--select-icon-color-disabled)))}:host([disabled]) #button .label.placeholder,#button:disabled .label.placeholder{color:var(--highcontrast-select-content-color-disabled,var(--luzmo-select-font-color-disabled,var(--select-font-color-disabled)))}#popover{max-width:var(--luzmo-select-popover-max-width,var(--select-popover-max-width));min-width:var(--luzmo-select-popover-min-width,var(--select-popover-min-width));width:var(--luzmo-select-popover-width,var(--select-popover-width))}#popover.search-on{padding:0 0 var(--luzmo-popover-content-area-spacing-vertical,var(--popover-content-area-spacing-vertical)) 0!important}#search-container{border-bottom:var(--luzmo-select-search-container-border-bottom-width,var(--select-search-container-border-bottom-width)) solid var(--luzmo-select-search-container-border-bottom-color,var(--select-search-container-border-bottom-color));flex:none;display:flex;position:relative}#search-icon{left:var(--luzmo-select-inline-edge-to-content,var(--select-inline-edge-to-content));color:var(--luzmo-select-search-icon-color,var(--select-search-icon-color));font-size:var(--luzmo-select-search-icon-height,var(--select-search-icon-height));width:var(--luzmo-select-search-icon-width,var(--select-search-icon-width));text-align:center;pointer-events:none;justify-content:center;align-items:center;display:flex;position:absolute;top:0;bottom:0}#search:focus-within+#search-icon,#search:focus+#search-icon{color:var(--luzmo-select-search-icon-color-focus,var(--select-search-icon-color-focus))}#search{box-sizing:border-box;border-top-left-radius:var(--luzmo-popover-border-radius,var(--popover-border-radius));border-top-right-radius:var(--luzmo-popover-border-radius,var(--popover-border-radius));background-color:var(--luzmo-select-search-background-color,var(--select-search-background-color));width:100%;color:var(--luzmo-select-search-color,var(--select-search-color));height:var(--luzmo-select-button-block-size,var(--select-button-block-size));line-height:var(--luzmo-select-button-block-size,var(--select-button-block-size));padding-left:calc(var(--luzmo-select-inline-edge-to-content,var(--select-inline-edge-to-content)) + var(--luzmo-select-spacing-search-icon-to-text,var(--select-spacing-search-icon-to-text)) + var(--luzmo-select-search-icon-width,var(--select-search-icon-width)));padding-right:var(--luzmo-select-inline-edge-to-content,var(--select-inline-edge-to-content));font-size:var(--luzmo-select-font-size,var(--select-font-size));font-family:var(--luzmo-select-font-family,var(--select-font-family));line-height:var(--luzmo-select-button-line-height,var(--select-button-line-height));font-weight:var(--luzmo-select-font-weight,var(--select-font-weight));border:var(--luzmo-select-search-input-border-bottom-width,var(--select-search-input-border-bottom-width)) solid var(--luzmo-select-search-input-border-bottom-color,var(--select-search-input-border-bottom-color));outline:none}#no-results{color:var(--luzmo-select-no-results-color,var(--select-no-results-color));font-style:var(--luzmo-select-no-results-font-style,var(--select-no-results-font-style));height:var(--luzmo-select-no-results-height,var(--select-no-results-height));padding-inline:var(--luzmo-select-no-results-spacing-edge-to-text,var(--select-no-results-spacing-edge-to-text));align-items:center;display:flex}:host{--select-popover-max-width:300px;--select-popover-min-width:160px;--select-font-family:var(--luzmo-font-family);--select-font-size:var(--luzmo-font-size);--select-font-weight:var(--luzmo-font-weight);--select-spacing-search-icon-to-text:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--select-search-icon-height:var(--luzmo-font-size);--select-search-icon-width:var(--luzmo-font-size);--select-search-icon-color:var(--luzmo-disabled-color);--select-search-icon-color-focus:var(--luzmo-font-color);--select-search-color:var(--luzmo-font-color);--select-search-background-color:var(--luzmo-background-color);--select-search-container-border-bottom-width:var(--luzmo-border-width);--select-search-container-border-bottom-color:var(--luzmo-border-color);--select-search-input-border-bottom-width:var(--luzmo-border-width);--select-search-input-border-bottom-color:transparent;--select-background-color-default:var(--luzmo-background-color);--select-background-color-default-open:var(--luzmo-background-color-hover);--select-background-color-active:var(--luzmo-background-color-down);--select-background-color-hover:var(--luzmo-background-color-hover);--select-background-color-hover-open:var(--luzmo-background-color-down);--select-background-color-key-focus:var(--luzmo-background-color-down);--select-border-color-default:var(--luzmo-border-color);--select-border-color-default-open:var(--luzmo-border-color-hover);--select-border-color-hover:var(--luzmo-border-color);--select-border-color-hover-open:var(--luzmo-border-color-hover);--select-border-color-active:var(--luzmo-border-color);--select-border-color-key-focus:var(--luzmo-border-color);--select-button-border-width:var(--luzmo-border-width);--select-placeholder-font-style:var(--luzmo-font-style);--select-button-line-height:var(--luzmo-line-height);--select-button-box-shadow:0px 1px 3px 0px var(--luzmo-shadow-color);--select-button-block-size:var(--luzmo-component-height);--select-button-border-radius:var(--luzmo-border-radius);--select-button-border-radius-reset:0;--select-inline-edge-to-content:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--select-spacing-text-to-icon:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--select-spacing-text-to-icon-inline-end:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--select-spacing-icon-to-disclosure-icon:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--select-spacing-icon-to-clear-icon:var(--select-spacing-icon-to-disclosure-icon);--select-inline-edge-to-content-quiet:0px;--select-spacing-label-to-select:0px;--select-spacing-label-to-select-quiet:calc(-1 * var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--select-spacing-edge-to-disclosure-icon:calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--select-spacing-edge-to-disclosure-icon-quiet:0px;--select-animation-duration:var(--luzmo-animation-duration);--select-font-color-default:var(--luzmo-font-color);--select-font-color-default-open:var(--luzmo-font-color-hover);--select-font-color-hover:var(--luzmo-font-color-hover);--select-font-color-hover-open:var(--luzmo-font-color-down);--select-font-color-active:var(--luzmo-font-color-focus);--select-font-color-key-focus:var(--luzmo-font-color-focus);--select-icon-color-default:var(--luzmo-font-color);--select-icon-color-default-open:var(--luzmo-font-color-hover);--select-icon-color-hover:var(--luzmo-font-color-hover);--select-icon-color-hover-open:var(--luzmo-font-color-hover);--select-icon-color-active:var(--luzmo-font-color-focus);--select-icon-color-key-focus:var(--luzmo-font-color-focus);--select-border-color-error-default:var(--luzmo-negative-color);--select-border-color-error-default-open:var(--luzmo-negative-color-down);--select-border-color-error-hover:var(--luzmo-negative-color-hover);--select-border-color-error-hover-open:var(--luzmo-negative-color-down);--select-border-color-error-active:var(--luzmo-negative-color-down);--select-border-color-error-key-focus:var(--luzmo-negative-color-focus);--select-icon-color-error:var(--luzmo-negative-color);--select-background-color-disabled:var(--luzmo-background-color-disabled);--select-font-color-disabled:var(--luzmo-disabled-color);--select-icon-color-disabled:var(--luzmo-disabled-color);--select-focus-indicator-gap:var(--luzmo-indicator-gap);--select-focus-indicator-width:var(--luzmo-indicator-width);--select-focus-indicator-color:var(--luzmo-indicator-color);--select-disclosure-icon-size:var(--luzmo-font-size-s);--select-no-results-height:var(--select-button-block-size);--select-no-results-color:var(--select-font-color-disabled);--select-no-results-font-style:italic;--select-no-results-spacing-edge-to-text:var(--select-inline-edge-to-content)}:host([size=s]){--select-button-block-size:var(--luzmo-component-height-s);--select-font-size:var(--luzmo-font-size-s);--select-search-icon-height:var(--luzmo-font-size-s);--select-search-icon-width:var(--luzmo-font-size-s);--select-popover-max-width:280px;--select-popover-min-width:140px;--select-spacing-search-icon-to-text:var(--luzmo-spacing-3);--select-inline-edge-to-content:var(--luzmo-spacing-3);--select-spacing-text-to-icon:var(--luzmo-spacing-3);--select-spacing-text-to-icon-inline-end:var(--luzmo-spacing-3);--select-spacing-icon-to-disclosure-icon:var(--luzmo-spacing-3);--select-spacing-label-to-select-quiet:calc(-1 * var(--luzmo-spacing-3));--select-spacing-edge-to-disclosure-icon:var(--luzmo-spacing-3);--select-disclosure-icon-size:var(--luzmo-font-size-s)}:host([size=l]){--select-button-block-size:var(--luzmo-component-height-l);--select-font-size:var(--luzmo-font-size-l);--select-search-icon-height:var(--luzmo-font-size-l);--select-search-icon-width:var(--luzmo-font-size-l);--select-popover-max-width:360px;--select-popover-min-width:220px;--select-spacing-search-icon-to-text:var(--luzmo-spacing-4);--select-inline-edge-to-content:var(--luzmo-spacing-4);--select-spacing-text-to-icon:var(--luzmo-spacing-4);--select-spacing-text-to-icon-inline-end:var(--luzmo-spacing-4);--select-spacing-icon-to-disclosure-icon:var(--luzmo-spacing-4);--select-spacing-label-to-select-quiet:calc(-1 * var(--luzmo-spacing-4));--select-spacing-edge-to-disclosure-icon:var(--luzmo-spacing-4);--select-disclosure-icon-size:var(--luzmo-font-size)}:host([size=xl]){--select-button-block-size:var(--luzmo-component-height-xl);--select-font-size:var(--luzmo-font-size-xl);--select-search-icon-height:var(--luzmo-font-size-xl);--select-search-icon-width:var(--luzmo-font-size-xl);--select-popover-max-width:400px;--select-popover-min-width:260px;--select-spacing-search-icon-to-text:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--select-inline-edge-to-content:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--select-spacing-text-to-icon:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--select-spacing-text-to-icon-inline-end:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--select-spacing-icon-to-disclosure-icon:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--select-spacing-label-to-select-quiet:calc(-1 * var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--select-spacing-edge-to-disclosure-icon:calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--select-disclosure-icon-size:var(--luzmo-font-size-l)}:host([variant=highlight]) ::slotted(luzmo-option[selected]){--option-highlight-label-content-color:var(--luzmo-primary-inverse-color);--option-label-icon-color-default:var(--luzmo-primary-inverse-color);--menu-checkmark-display:var(--menu-checkmark-display-hidden);background-color:var(--luzmo-option-highlight-label-background-color,var(--option-highlight-label-background-color,var(--luzmo-border-color)));padding-inline-start:var(--luzmo-option-label-inline-edge-to-content,var(--option-label-inline-edge-to-content))}:host{vertical-align:top;max-inline-size:100%;inline-size:var(--luzmo-select-inline-size,var(--select-inline-size));min-inline-size:calc(var(--select-minimum-width-multiplier) * var(--luzmo-select-block-size,var(--select-block-size)));display:inline-flex}:host([quiet]){width:auto;min-width:0}:host([disabled]){pointer-events:none}#button{width:100%;min-width:100%;max-width:100%}#icon:not([hidden]){display:inline-flex}:host([readonly]) #button{user-select:inherit}.validation-icon{flex-shrink:0}luzmo-overlay{pointer-events:none}luzmo-options{pointer-events:initial}:host>#no-results,:host>luzmo-options{display:none}:host([focused]:not([quiet])) #button #label.placeholder{color:var(--select-placeholder-text-color-key-focus,var(--alias-placeholder-text-color-hover))}.visually-hidden{clip:rect(0, 0, 0, 0);clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0 -1px -1px 0;padding:0;position:absolute;overflow:hidden}luzmo-overlay:not(:defined){display:none}#button.remove-focus-ring-safari-hack:focus-visible{background-color:var(--highcontrast-select-background-color,var(--luzmo-select-background-color-default,var(--select-background-color-default)));border-color:var(--highcontrast-select-border-color-default,var(--luzmo-select-border-color-default,var(--select-border-color-default)));color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-default,var(--select-font-color-default)))}#button.remove-focus-ring-safari-hack:after{border:none}#button.remove-focus-ring-safari-hack:focus-visible:after{box-shadow:none}#button.remove-focus-ring-safari-hack:active{background-color:var(--highcontrast-select-background-color,var(--luzmo-select-background-color-default,var(--select-background-color-default)));border-color:var(--highcontrast-select-border-color-default,var(--luzmo-select-border-color-default,var(--select-border-color-default)));color:var(--highcontrast-select-content-color-default,var(--luzmo-select-font-color-default,var(--select-font-color-default)))}`,m=()=>s.html`
|
|
19
|
+
<div class="disclosure-icon icon">
|
|
20
|
+
${(0,l.luzmoIcon)(l.luzmoAngleDown,{className:`indicator`})}
|
|
21
|
+
</div>
|
|
22
|
+
`,h=()=>s.html`
|
|
23
|
+
<div class="icon-container validation-icon icon">
|
|
24
|
+
${(0,l.luzmoIcon)(l.luzmoAlert)}
|
|
25
|
+
</div>
|
|
26
|
+
`,g=()=>s.html`
|
|
27
|
+
<div class="icon-container search-icon icon" id="search-icon">
|
|
28
|
+
${(0,l.luzmoIcon)(l.luzmoSearch)}
|
|
29
|
+
</div>
|
|
30
|
+
`,_=`select-option-menu`,v=class extends t.n(n.t,{noDefaultSize:!0}){static get styles(){return[(0,s.unsafeCSS)(p)]}get selfManageFocusElement(){return this._selfManageFocusElement}constructor(){super(),this.disabled=!1,this.focused=!1,this.variant=`checkmarks`,this.emphasized=!1,this.invalid=!1,this.search=`auto`,this.noWrap=!1,this.retrieving=!1,this.pending=!1,this.clearable=!1,this.hideDropdownIcon=!1,this.pendingLabel=`Pending`,this.searchLabel=`Search`,this.noResultsLabel=`No results`,this.noDataLabel=`No data`,this.multipleLabelTemplate=`Selected {count} items`,this.label=`Select`,this.open=!1,this.readonly=!1,this.placement=`bottom-end`,this.quiet=!1,this.value=[],this.options=[],this.selects=`multiple`,this.dependencyManager=new r.t(this),this.isMobile=new i.i(this,i.n),this.listRole=`listbox`,this.itemRole=`option`,this.hasRenderedOverlay=!1,this._selfManageFocusElement=!1,this.selectionPromise=Promise.resolve(),this.enterKeydownOn=null,this._selectedOptions=[],this.handleSlottableRequest=e=>{},this.renderAngleIcon=()=>m(),this.renderAlertIcon=()=>h(),this._popoverDependencyRegistered=!1,this.handleEnterKeydown=e=>{if(e.code===`Enter`){if(this.enterKeydownOn){e.preventDefault();return}this.enterKeydownOn=e.target,this.addEventListener(`keyup`,e=>{e.code===`Enter`&&(this.enterKeydownOn=null)},{once:!0})}},this.clearValue=e=>{e.preventDefault(),e.stopPropagation(),this.value=[],this.strategy&&(this.strategy.preventNextToggle=`no`),this.open=!1,this.strategy&&(this.strategy.open=!1),this.dispatchEvent(new CustomEvent(`change`,{bubbles:!0,cancelable:!0,composed:!0,detail:{value:this.value??[]}}))},this.handleEscape=e=>{e.code===`Escape`&&this.open&&(e.stopPropagation(),e.preventDefault(),this.toggle(!1))},this.handleKeydown=e=>{let{code:t}=e;if(t===`Escape`){this.handleEscape(e);return}if([`Delete`,`Backspace`].includes(t)){this.clearValue(e);return}if(this.focused=!0,!(!t.startsWith(`Arrow`)||this.readonly||this.pending)){if(t===`ArrowUp`||t===`ArrowDown`){this.toggle(!0),e.preventDefault();return}if(e.preventDefault(),this.selects===`single`){let e=t===`ArrowRight`?1:-1,n=this.options.findIndex(e=>e?.value?.toString()===this.value?.[0]?.toString()),r=(this.options.length+n+e)%this.options.length,i=this.options.length;for(;(this.options?.[r]?.disabled||o.r(this.options?.[r]))&&i;)--i,r=(this.options.length+r+e)%this.options.length;let a=this.options[r];if(a?.disabled||o.r(a))return;this.value=[a.value??null],this.dispatchEvent(new CustomEvent(`change`,{bubbles:!0,cancelable:!0,composed:!0,detail:{value:this.value??[]}}))}}},this.pendingStateController=new a.t(this)}get focusElement(){return this.open?this.search===`on`||this.search===`auto`&&this.options?.length>20?this.searchInput:this.optionsMenu:this.button}forceFocusVisible(){this.disabled||(this.focused=!0)}click(){this.disabled||this.toggle()}handleButtonBlur(){this.focused=!1}focus(e){super.focus(e),!this.disabled&&this.focusElement&&(this.focused=this.hasVisibleFocusInTree())}handleHelperFocus(){this.focused=!0,this.button.focus()}handleChange(e){let t=e?.detail?.value??[];JSON.stringify(this.value)!==JSON.stringify(t)&&(this.value=t),this.strategy&&(this.strategy.preventNextToggle=`no`),e.stopPropagation(),(!e.cancelable||this.selects===`single`)&&(this.open=!1,this.strategy&&(this.strategy.open=!1)),e.preventDefault(),this.dispatchEvent(new CustomEvent(`change`,{bubbles:!0,cancelable:!0,composed:!0,detail:{value:this.value??[]}}))}handleButtonFocus(e){this.strategy?.handleButtonFocus(e)}toggle(e){this.readonly||this.pending||(this.open=e===void 0?!this.open:e,this.strategy&&(this.strategy.open=this.open),this._selfManageFocusElement=this.open)}close(){this.readonly||this.strategy&&(this.open=!1,this.strategy.open=!1)}bindEvents(){this.strategy?.abort(),this.strategy=new i.t.desktop(this.button,this),this.strategy?.overlay&&(this.strategy.overlay.type=`auto`,this.strategy.overlay.placement=this.placement)}connectedCallback(){super.connectedCallback(),this.ensurePopoverDependency()}disconnectedCallback(){this.close(),this.strategy?.releaseDescription(),super.disconnectedCallback()}handleTooltipSlotchange(e){this.tooltipEl=e.target.assignedElements()[0]}get labelTemplate(){let e=this._selectedOptions?.length===1&&this._selectedOptions[0]?.icon,t=s.html`<div
|
|
31
|
+
id="icon"
|
|
32
|
+
?hidden=${typeof this.icons==`string`||this.value?.length>1||!e}
|
|
33
|
+
>
|
|
34
|
+
${e?(0,l.luzmoIcon)(this._selectedOptions[0].icon):s.nothing}
|
|
35
|
+
</div>`,n=e=>e.replaceAll(/{([^}]+)}/g,(e,t)=>t===`count`?String(this.value?.length):e),r={"visually-hidden":this.icons===`only`&&this.value?.length>0,placeholder:!this.value?.length,label:!0},i;i=this.value?.length?this.value.length===1?s.html`<span
|
|
36
|
+
>${this._selectedOptions?.[0]?.shortLabel??this._selectedOptions?.[0]?.label??this.value?.[0]}</span
|
|
37
|
+
>`:s.html`<span
|
|
38
|
+
>${n(this.multipleLabelTemplate)}</span
|
|
39
|
+
>`:s.html`
|
|
40
|
+
<slot name="label" id="label">
|
|
41
|
+
<span aria-hidden="true"> ${this.label} </span>
|
|
42
|
+
</slot>
|
|
43
|
+
`;let a=this.value?.length?s.html`
|
|
44
|
+
<div aria-hidden="true" class="visually-hidden" id="applied-label">
|
|
45
|
+
${this.label}
|
|
46
|
+
<slot name="label"></slot>
|
|
47
|
+
</div>
|
|
48
|
+
`:s.html` <span hidden id="applied-label">${this.label}</span> `;return[s.html`
|
|
49
|
+
${this.value?.length===1?t:s.nothing}
|
|
50
|
+
<div
|
|
51
|
+
id=${(0,u.ifDefined)(this.value?.length?`label`:void 0)}
|
|
52
|
+
class=${(0,d.classMap)(r)}
|
|
53
|
+
>
|
|
54
|
+
${i}
|
|
55
|
+
</div>
|
|
56
|
+
${a}
|
|
57
|
+
${this.invalid&&!this.pending?s.html` ${this.renderAlertIcon()} `:s.nothing}
|
|
58
|
+
${this.pendingStateController.renderPendingState()}
|
|
59
|
+
${this.clearable&&!this.readonly&&this.value?.length>0?s.html`
|
|
60
|
+
<div class="icon-container clear-icon icon" @click=${this.clearValue}>
|
|
61
|
+
${(0,l.luzmoIcon)(l.luzmoClose14)}
|
|
62
|
+
</div>
|
|
63
|
+
`:s.nothing}
|
|
64
|
+
${this.readonly||this.hideDropdownIcon?s.nothing:this.renderAngleIcon()}
|
|
65
|
+
<slot
|
|
66
|
+
aria-hidden="true"
|
|
67
|
+
name="tooltip"
|
|
68
|
+
id="tooltip"
|
|
69
|
+
@slotchange=${this.handleTooltipSlotchange}
|
|
70
|
+
></slot>
|
|
71
|
+
`]}update(e){e.has(`disabled`)&&this.disabled&&this.strategy&&(this.open=!1,this.strategy.open=!1),e.has(`pending`)&&this.pending&&this.strategy&&(this.open=!1,this.strategy.open=!1),super.update(e)}bindButtonKeydownListener(){this.button.addEventListener(`keydown`,this.handleKeydown)}willUpdate(e){let t=e.has(`open`),n=e.has(`value`),r=e.has(`options`),i=e.has(`selects`),a=e.get(`open`);i&&this.selects===`single`&&this.value?.length>1&&(console.warn(`luzmo-select is being set to a single value given the selects property changed to 'single'`),this.value=this.value.slice(0,1)),t&&a===!1&&this.open&&this.searchString&&(this.searchString=``),(n||r)&&this.setSelectedOptionsFromValue()}updated(e){super.updated(e);let t=e.has(`options`),n=e.has(`open`),r=e.has(`placement`);if(n&&(this.strategy.open=this.open,this.open===!1&&this.optionsMenu.scrollToTop()),t){let e=this.options?.length??0;for(let t of this.options??[])t.children?.length&&(e+=t.children.length);if(e>25){let e=(e,t=e.label)=>(t?.length??0)+(e.children?.length?0:e.shortcut?.length??0),t=this.options[0];for(let n of this.options)e(n)>e(t)&&(t=n);for(let n of this.options)if(n.children?.length)for(let r of n.children){let i=`${n.label} (${r.label})`;e(r,i)>e(t)&&(t={...r,label:i})}this._estimatePopoverWidth(t)}else this.style.removeProperty(`--select-popover-width`)}this.strategy?.overlay&&(this.strategy.overlay.type!==`auto`&&(this.strategy.overlay.type=`auto`),(r||this.strategy.overlay.type===`auto`)&&(this.strategy.overlay.placement=this.placement))}firstUpdated(e){super.firstUpdated(e),this.bindButtonKeydownListener(),this.bindEvents()}_getCssVarInPixels(e){let t=f(this,e),n;if(t.endsWith(`rem`)){let e=Number.parseFloat(getComputedStyle(document.documentElement).fontSize);n=Number.parseFloat(t)*e}else if(t.endsWith(`em`)){let e=Number.parseFloat(getComputedStyle(this).fontSize);n=Number.parseFloat(t)*e}else n=Number.parseFloat(t);return n>=0?n:void 0}_estimatePopoverWidth(e){let t=this._getCssVarInPixels(`--luzmo-select-font-size`)??this._getCssVarInPixels(`--select-font-size`),n=this._getCssVarInPixels(`--luzmo-select-popover-min-width`)??this._getCssVarInPixels(`--select-popover-min-width`),r=this._getCssVarInPixels(`--luzmo-spacing-5`),i=document.createElement(`luzmo-options`);i.style.setProperty(`--luzmo-select-font-size`,`${t}px`),i.options=[e],i.value=[e.value??null],i.variant=this.variant,i.size=this.size,i.style.position=`absolute`,i.style.left=`-9999px`,i.style.top=`-9999px`,i.style.opacity=`0`,i.style.width=`auto`,document.body.append(i),i.updateComplete.then(()=>{let e=i.offsetWidth+(r??0);return e>(n??0)?this.style.setProperty(`--select-popover-width`,`${e}px`):this.style.removeProperty(`--select-popover-width`),i.remove(),e}).catch(e=>{console.error(e),i.remove()})}get dismissHelper(){return s.html`
|
|
72
|
+
<div class="visually-hidden">
|
|
73
|
+
<button
|
|
74
|
+
tabindex="-1"
|
|
75
|
+
aria-label="Dismiss"
|
|
76
|
+
@click=${this.close}
|
|
77
|
+
></button>
|
|
78
|
+
</div>
|
|
79
|
+
`}render(){return this.tooltipEl&&(this.tooltipEl.disabled=this.open),s.html`
|
|
80
|
+
<span
|
|
81
|
+
id="focus-helper"
|
|
82
|
+
tabindex=${this.focused||this.open?`-1`:`0`}
|
|
83
|
+
@focus=${this.handleHelperFocus}
|
|
84
|
+
aria-describedby=${_}
|
|
85
|
+
></span>
|
|
86
|
+
<button
|
|
87
|
+
aria-controls=${(0,u.ifDefined)(this.open?`menu`:void 0)}
|
|
88
|
+
aria-describedby="tooltip"
|
|
89
|
+
aria-expanded=${this.open?`true`:`false`}
|
|
90
|
+
aria-haspopup="true"
|
|
91
|
+
aria-labelledby="loader icon label applied-label"
|
|
92
|
+
id="button"
|
|
93
|
+
class=${(0,u.ifDefined)(this.labelAlignment?`label-${this.labelAlignment}`:void 0)}
|
|
94
|
+
@blur=${this.handleButtonBlur}
|
|
95
|
+
@keydown=${{handleEvent:this.handleEnterKeydown,capture:!0}}
|
|
96
|
+
?disabled=${this.disabled}
|
|
97
|
+
tabindex="-1"
|
|
98
|
+
>
|
|
99
|
+
${this.labelTemplate}
|
|
100
|
+
</button>
|
|
101
|
+
${this.renderMenu} ${this.renderDescriptionSlot}
|
|
102
|
+
`}get renderDescriptionSlot(){return s.html`
|
|
103
|
+
<div id=${_}>
|
|
104
|
+
<slot name="description"></slot>
|
|
105
|
+
</div>
|
|
106
|
+
`}setSelectedOptionsFromValue(){let e=[];for(let t of this.options){let n=t?.value;!t.children?.length&&this.value?.includes(n??null)&&e.push(t);for(let n of t.children??[]){let r=n?.value;this.value?.includes(r??null)&&e.push({...n,label:`${t.label} (${n.label})`})}}this._selectedOptions=e}renderSearchInput(){return s.html`
|
|
107
|
+
<div id="search-container">
|
|
108
|
+
<input
|
|
109
|
+
type="text"
|
|
110
|
+
id="search"
|
|
111
|
+
.placeholder=${this.searchLabel}
|
|
112
|
+
@input=${this.handleSearchInput}
|
|
113
|
+
@keydown=${this.handleSearchKeydown}
|
|
114
|
+
.value=${this.searchString??``}
|
|
115
|
+
.aria-label=${this.searchLabel}
|
|
116
|
+
autocomplete="off"
|
|
117
|
+
tabindex="0"
|
|
118
|
+
role="searchbox"
|
|
119
|
+
/>
|
|
120
|
+
${g()}
|
|
121
|
+
</div>
|
|
122
|
+
`}filterOptions(){let e=this.searchString?.toLowerCase()??``,t=this.options.filter(t=>o.r(t)?!0:!!(typeof t==`string`?t:t?.label)?.toString()?.toLowerCase()?.includes(e));if(!e)return t;let n=t.filter((e,n)=>{if(!o.r(e))return!0;for(let e of t.slice(n+1)){if(e?.header)return!1;if(!o.r(e))return!0}return!1});return n.filter((e,t)=>!e?.divider||t>0&&!n[t-1]?.divider)}get renderMenu(){let e=this.filterOptions(),t=e.some(e=>!o.r(e)),n=s.html`
|
|
123
|
+
<luzmo-options
|
|
124
|
+
.variant=${this.variant}
|
|
125
|
+
aria-labelledby="applied-label"
|
|
126
|
+
id="menu"
|
|
127
|
+
?emphasized=${this.emphasized}
|
|
128
|
+
.selects=${this.selects??`multiple`}
|
|
129
|
+
.options=${e}
|
|
130
|
+
.value=${this.value}
|
|
131
|
+
.optionIconRenderer=${this.optionIconRenderer}
|
|
132
|
+
?pending=${this.retrieving}
|
|
133
|
+
?no-wrap=${this.noWrap}
|
|
134
|
+
@change=${this.handleChange}
|
|
135
|
+
@keydown=${{handleEvent:this.handleEnterKeydown,capture:!0}}
|
|
136
|
+
@luzmo-scrolled=${this.handleScrolled}
|
|
137
|
+
@luzmo-exceeded-top=${this.handleExceededTop}
|
|
138
|
+
role=${this.listRole}
|
|
139
|
+
size=${this.size}
|
|
140
|
+
tabindex="0"
|
|
141
|
+
>
|
|
142
|
+
</luzmo-options>
|
|
143
|
+
${!t&&!this.retrieving&&!this.pending?s.html`<div id="no-results">
|
|
144
|
+
${this.searchString?this.noResultsLabel:this.noDataLabel}
|
|
145
|
+
</div>`:s.nothing}
|
|
146
|
+
`;return this.hasRenderedOverlay=this.hasRenderedOverlay||this.focused||this.open,this.hasRenderedOverlay?(this.dependencyManager.loaded&&this.dependencyManager.add(`luzmo-overlay`),this.renderOverlay(n)):n}renderOverlay(e){return this.strategy?.overlay===void 0?e:((0,s.render)(this.renderContainer(e),this.strategy?.overlay,{host:this}),this.strategy?.overlay)}ensurePopoverDependency(){this._popoverDependencyRegistered||(this._popoverDependencyRegistered=!0,this.dependencyManager.add(`luzmo-popover`))}renderContainer(e){let t=this.search===`on`||this.searchString&&this.searchString?.length>0||this.search===`auto`&&this.options?.length>20,n=s.html`
|
|
147
|
+
${t?this.renderSearchInput():s.nothing} ${this.dismissHelper} ${e} ${this.dismissHelper}
|
|
148
|
+
`;return s.html`
|
|
149
|
+
<luzmo-popover
|
|
150
|
+
class=${(0,u.ifDefined)(t?`search-on`:void 0)}
|
|
151
|
+
id="popover"
|
|
152
|
+
size=${this.size}
|
|
153
|
+
role="presentation"
|
|
154
|
+
placement=${this.placement}
|
|
155
|
+
>
|
|
156
|
+
${n}
|
|
157
|
+
</luzmo-popover>
|
|
158
|
+
`}async getUpdateComplete(){let e=await super.getUpdateComplete();return await this.selectionPromise,this.overlayElement&&await this.overlayElement.updateComplete,e}handleScrolled(e){e.stopPropagation(),e.preventDefault(),this.dispatchEvent(new CustomEvent(`luzmo-scrolled`,{bubbles:!0,composed:!0,cancelable:!0,detail:{first:e?.detail?.first,last:e?.detail?.last}}))}handleExceededTop(e){e.preventDefault(),e.stopPropagation(),this.searchInput?this.searchInput.focus():this.toggle(!1)}handleSearchInput(e){let t=e.target.value;t!==this.searchString&&(this.searchString=t,this.dispatchEvent(new CustomEvent(`luzmo-search`,{bubbles:!0,composed:!0,cancelable:!0,detail:{string:this.searchString}})))}handleSearchKeydown(e){if(e.code===`Escape`){this.searchString?this.searchString=``:this.handleEscape(e);return}if(e.code===`ArrowDown`){this.optionsMenu.focus(),e.preventDefault(),e.stopPropagation();return}else if(e.code===`ArrowUp`){this.toggle(!1);return}}};e.t([(0,c.query)(`#button`)],v.prototype,`button`,void 0),e.t([(0,c.property)({type:Boolean,reflect:!0})],v.prototype,`disabled`,void 0),e.t([(0,c.property)({type:Boolean,reflect:!0})],v.prototype,`focused`,void 0),e.t([(0,c.property)({type:String,reflect:!0})],v.prototype,`icons`,void 0),e.t([(0,c.property)({type:String,reflect:!0})],v.prototype,`variant`,void 0),e.t([(0,c.property)({type:Boolean,reflect:!0})],v.prototype,`emphasized`,void 0),e.t([(0,c.property)({type:Boolean,reflect:!0})],v.prototype,`invalid`,void 0),e.t([(0,c.property)({type:String,reflect:!0})],v.prototype,`search`,void 0),e.t([(0,c.property)({type:Boolean,reflect:!0,attribute:`no-wrap`})],v.prototype,`noWrap`,void 0),e.t([(0,c.property)({type:Boolean,reflect:!0})],v.prototype,`retrieving`,void 0),e.t([(0,c.property)({type:Boolean,reflect:!0})],v.prototype,`pending`,void 0),e.t([(0,c.property)({type:Boolean,reflect:!0})],v.prototype,`clearable`,void 0),e.t([(0,c.property)({type:Boolean,reflect:!0,attribute:`hide-dropdown-icon`})],v.prototype,`hideDropdownIcon`,void 0),e.t([(0,c.property)({type:String,attribute:`pending-label`})],v.prototype,`pendingLabel`,void 0),e.t([(0,c.property)({type:String,attribute:`search-label`})],v.prototype,`searchLabel`,void 0),e.t([(0,c.property)({type:String,attribute:`no-results-label`})],v.prototype,`noResultsLabel`,void 0),e.t([(0,c.property)({type:String,attribute:`no-data-label`})],v.prototype,`noDataLabel`,void 0),e.t([(0,c.property)({type:String,attribute:`multiple-label-template`,reflect:!0})],v.prototype,`multipleLabelTemplate`,void 0),e.t([(0,c.property)({type:String,reflect:!0})],v.prototype,`label`,void 0),e.t([(0,c.property)({type:Boolean,reflect:!0})],v.prototype,`open`,void 0),e.t([(0,c.property)({type:Boolean,reflect:!0})],v.prototype,`readonly`,void 0),e.t([(0,c.state)()],v.prototype,`labelAlignment`,void 0),e.t([(0,c.state)()],v.prototype,`displayLabelContent`,void 0),e.t([(0,c.state)()],v.prototype,`searchString`,void 0),e.t([(0,c.query)(`luzmo-options`)],v.prototype,`optionsMenu`,void 0),e.t([(0,c.query)(`#search`)],v.prototype,`searchInput`,void 0),e.t([(0,c.query)(`luzmo-overlay`)],v.prototype,`overlayElement`,void 0),e.t([(0,c.property)({type:String,reflect:!0})],v.prototype,`placement`,void 0),e.t([(0,c.property)({type:Boolean,reflect:!0})],v.prototype,`quiet`,void 0),e.t([(0,c.property)({type:Array,hasChanged(e,t){return JSON.stringify(e??[])!==JSON.stringify(t??[])},converter:{fromAttribute:e=>{if(!e||e===``)return[];try{return JSON.parse(e)}catch{return[]}},toAttribute:e=>JSON.stringify(e)}})],v.prototype,`value`,void 0),e.t([(0,c.property)({type:Array,hasChanged(e,t){return JSON.stringify(e??[])!==JSON.stringify(t??[])}})],v.prototype,`options`,void 0),e.t([(0,c.property)({attribute:!1})],v.prototype,`optionIconRenderer`,void 0),e.t([(0,c.property)({type:String,reflect:!0})],v.prototype,`selects`,void 0),customElements.get(`luzmo-select`)||customElements.define(`luzmo-select`,v),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return v}});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*! * Lucero - The design system for Luzmo.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2025 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
|
|
6
|
+
* This license allows users with a current active Luzmo account to use Lucero.
|
|
7
|
+
* This license terminates automatically if a user no longer has an active Luzmo account.
|
|
8
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
9
|
+
*
|
|
10
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
+
* SOFTWARE.
|
|
17
|
+
* */
|
|
18
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../split-view-5uMSU_b7.cjs");exports.LuzmoSplitView=e.t;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*! * Lucero - The design system for Luzmo.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2025 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
|
|
6
|
+
* This license allows users with a current active Luzmo account to use Lucero.
|
|
7
|
+
* This license terminates automatically if a user no longer has an active Luzmo account.
|
|
8
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
9
|
+
*
|
|
10
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
+
* SOFTWARE.
|
|
17
|
+
* */
|
|
18
|
+
(() => {
|
|
19
|
+
if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
|
|
20
|
+
let e = document.createElement("style");
|
|
21
|
+
e.setAttribute("data-luzmo-vars", ""), e.textContent = "html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: color-mix(in oklch, var(--luzmo-border-color-full), black 25%);--luzmo-border-color-full-down: color-mix(in oklch, var(--luzmo-border-color-full), black 45%);--luzmo-border-color-full-focus: color-mix(in oklch, var(--luzmo-border-color-full), black 25%);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-border-width: 1px;--luzmo-shadow-color-rgb: 0, 0, 0;--luzmo-shadow-opacity: 0.1;--luzmo-shadow-color: rgba( var(--luzmo-shadow-color-rgb), var(--luzmo-shadow-opacity) );--luzmo-font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-disabled: var(--luzmo-disabled-color);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: color-mix(in oklch, var(--luzmo-font-color), black 8%);--luzmo-font-color-down: color-mix(in oklch, var(--luzmo-font-color), black 20%);--luzmo-font-color-focus: color-mix(in oklch, var(--luzmo-font-color), black 8%);--luzmo-primary: #4434ff;--luzmo-primary-hover: color-mix(in oklch, var(--luzmo-primary), black 8%);--luzmo-primary-down: color-mix(in oklch, var(--luzmo-primary), black 20%);--luzmo-primary-focus: color-mix(in oklch, var(--luzmo-primary), black 8%);--luzmo-primary-inverse-color: #ffffff;--luzmo-accent-on-subtle-color: var(--luzmo-primary);--luzmo-primary-rgb: 68, 52, 255;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: color-mix(in oklch, color-mix(in oklch, var(--luzmo-background-color), var(--luzmo-primary) 5%), black 1.5%);--luzmo-background-color-down: color-mix(in oklch, color-mix(in oklch, var(--luzmo-background-color), var(--luzmo-primary) 7%), black 1%);--luzmo-background-color-focus: color-mix(in oklch, color-mix(in oklch, var(--luzmo-background-color), var(--luzmo-primary) 5%), black 1.5%);--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: color-mix(in oklch, var(--luzmo-background-color-highlight), black 10%);--luzmo-background-color-highlight-down: color-mix(in oklch, var(--luzmo-background-color-highlight), black 20%);--luzmo-background-color-highlight-focus: color-mix(in oklch, var(--luzmo-background-color-highlight), black 10%);--luzmo-secondary: #d000d0;--luzmo-secondary-hover: color-mix(in oklch, var(--luzmo-secondary), black 8%);--luzmo-secondary-down: color-mix(in oklch, var(--luzmo-secondary), black 20%);--luzmo-secondary-focus: color-mix(in oklch, var(--luzmo-secondary), black 8%);--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 208, 0, 208;--luzmo-scrollbar-size: 6px;--luzmo-scrollbar-thumb-background: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-scrollbar-thumb-border-radius: var(--luzmo-border-radius-s);--luzmo-scrollbar-thumb-hover-background: rgba( var(--luzmo-border-color-rgb), 0.4 );--luzmo-scrollbar-track-background: transparent;--luzmo-scrollbar-track-border-radius: var(--luzmo-border-radius-s);--luzmo-scrollbar-width: thin;--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: color-mix(in oklch, var(--luzmo-negative-color), black 8%);--luzmo-negative-color-down: color-mix(in oklch, var(--luzmo-negative-color), black 20%);--luzmo-negative-color-focus: color-mix(in oklch, var(--luzmo-negative-color), black 8%);--luzmo-negative-on-subtle-color: var(--luzmo-negative-color);--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-negative-inverse-color: #ffffff;--luzmo-positive-color: rgb(18, 133, 90);--luzmo-positive-color-hover: color-mix(in oklch, var(--luzmo-positive-color), black 8%);--luzmo-positive-color-down: color-mix(in oklch, var(--luzmo-positive-color), black 20%);--luzmo-positive-color-focus: color-mix(in oklch, var(--luzmo-positive-color), black 8%);--luzmo-positive-on-subtle-color: color-mix( in oklch, var(--luzmo-positive-color), var(--luzmo-font-color) 11% );--luzmo-positive-color-rgb: 18, 133, 90;--luzmo-positive-inverse-color: #ffffff;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: color-mix(in oklch, var(--luzmo-selected-color), black 25%);--luzmo-selected-color-down: color-mix(in oklch, var(--luzmo-selected-color), black 45%);--luzmo-selected-color-focus: color-mix(in oklch, var(--luzmo-selected-color), black 25%);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: color-mix(in oklch, var(--luzmo-selected-color-hard), black 25%);--luzmo-selected-color-hard-down: color-mix(in oklch, var(--luzmo-selected-color-hard), black 45%);--luzmo-selected-color-hard-focus: color-mix(in oklch, var(--luzmo-selected-color-hard), black 25%);--luzmo-neutral-on-subtle-color: var(--luzmo-selected-color-hard);--luzmo-informative-color: #1670dd;--luzmo-informative-color-hover: color-mix(in oklch, var(--luzmo-informative-color), black 8%);--luzmo-informative-color-down: color-mix(in oklch, var(--luzmo-informative-color), black 20%);--luzmo-informative-color-focus: var(--luzmo-informative-color-hover);--luzmo-informative-on-subtle-color: color-mix( in oklch, var(--luzmo-informative-color), var(--luzmo-font-color) 9% );--luzmo-informative-color-rgb: 22, 112, 221;--luzmo-informative-inverse-color: #ffffff;--luzmo-notice-color: rgb(229, 127, 0);--luzmo-notice-color-hover: color-mix(in oklch, var(--luzmo-notice-color), black 8%);--luzmo-notice-color-down: color-mix(in oklch, var(--luzmo-notice-color), black 20%);--luzmo-notice-color-focus: var(--luzmo-notice-color-hover);--luzmo-notice-on-subtle-color: color-mix( in oklch, var(--luzmo-notice-color), var(--luzmo-font-color) 40% );--luzmo-notice-inverse-color: var(--luzmo-selected-color-hard);--luzmo-seafoam-color: rgb(0, 140, 140);--luzmo-indigo-color: rgb(68, 52, 255);--luzmo-purple-color: rgb(112, 48, 210);--luzmo-fuchsia-color: rgb(205, 30, 170);--luzmo-magenta-color: rgb(203, 36, 98);--luzmo-yellow-color: rgb(228, 208, 0);--luzmo-gray-color: rgb(110, 110, 110);--luzmo-red-color: rgb(202, 34, 28);--luzmo-orange-color: rgb(218, 123, 17);--luzmo-chartreuse-color: rgb(85, 135, 0);--luzmo-celery-color: rgb(48, 134, 22);--luzmo-green-color: rgb(18, 133, 90);--luzmo-cyan-color: rgb(0, 134, 180);--luzmo-blue-color: rgb(22, 112, 221);--luzmo-disabled-color: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 10px;--luzmo-icon-size-xs: 12px;--luzmo-icon-size-s: 14px;--luzmo-icon-size-m: 16px;--luzmo-icon-size-l: 18px;--luzmo-icon-size-xl: 20px;--luzmo-icon-size-xxl: 32px}html.dark,html.dark-theme,:where(.dark-theme){--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.2);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.35);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-rgb: 255, 255, 255;--luzmo-border-color-full: #4c4c57;--luzmo-border-color-full-hover: color-mix(in oklch, var(--luzmo-border-color-full), white 20%);--luzmo-border-color-full-down: color-mix(in oklch, var(--luzmo-border-color-full), white 35%);--luzmo-border-color-full-focus: color-mix(in oklch, var(--luzmo-border-color-full), white 20%);--luzmo-border-color-disabled: #333;--luzmo-shadow-opacity: 0.35;--luzmo-shadow-color: rgba( var(--luzmo-shadow-color-rgb), var(--luzmo-shadow-opacity) );--luzmo-font-color: #ced4da;--luzmo-font-color-extra-dimmed: #72787f;--luzmo-font-color-hover: color-mix(in oklch, var(--luzmo-font-color), white 8%);--luzmo-font-color-down: color-mix(in oklch, var(--luzmo-font-color), white 20%);--luzmo-font-color-focus: color-mix(in oklch, var(--luzmo-font-color), white 8%);--luzmo-primary: #7b90ff;--luzmo-primary-hover: color-mix(in oklch, var(--luzmo-primary), white 12%);--luzmo-primary-down: color-mix(in oklch, var(--luzmo-primary), white 24%);--luzmo-primary-focus: color-mix(in oklch, var(--luzmo-primary), white 12%);--luzmo-accent-on-subtle-color: color-mix( in oklch, var(--luzmo-primary), var(--luzmo-font-color) 1% );--luzmo-background-color: #262626;--luzmo-background-color-rgb: 0, 0, 0;--luzmo-background-color-disabled: #939ea8;--luzmo-background-color-hover: color-mix(in oklch, color-mix(in oklch, var(--luzmo-background-color), var(--luzmo-primary) 3%), white 14%);--luzmo-background-color-down: color-mix(in oklch, color-mix(in oklch, var(--luzmo-background-color), var(--luzmo-primary) 3%), white 25%);--luzmo-background-color-focus: color-mix(in oklch, color-mix(in oklch, var(--luzmo-background-color), var(--luzmo-primary) 3%), white 14%);--luzmo-background-color-highlight: rgb(72, 72, 72);--luzmo-background-color-highlight-disabled: #313131;--luzmo-background-color-highlight-hover: color-mix(in oklch, var(--luzmo-background-color-highlight), white 20%);--luzmo-background-color-highlight-down: color-mix(in oklch, var(--luzmo-background-color-highlight), white 35%);--luzmo-background-color-highlight-focus: color-mix(in oklch, var(--luzmo-background-color-highlight), white 20%);--luzmo-primary-inverse-color: var(--luzmo-background-color);--luzmo-indicator-color: var(--luzmo-primary);--luzmo-primary-rgb: 94, 113, 208;--luzmo-secondary: #ebff00;--luzmo-secondary-inverse-color: #333;--luzmo-secondary-rgb: 200, 219, 0;--luzmo-negative-color: #f76d74;--luzmo-negative-color-hover: color-mix(in oklch, var(--luzmo-negative-color), white 12%);--luzmo-negative-color-down: color-mix(in oklch, var(--luzmo-negative-color), white 24%);--luzmo-negative-color-focus: color-mix(in oklch, var(--luzmo-negative-color), white 12%);--luzmo-negative-on-subtle-color: color-mix( in oklch, var(--luzmo-negative-color), var(--luzmo-font-color) 40% );--luzmo-negative-color-rgb: 247, 109, 116;--luzmo-negative-inverse-color: var(--luzmo-background-color);--luzmo-positive-color: #39a875;--luzmo-positive-color-hover: color-mix(in oklch, var(--luzmo-positive-color), white 12%);--luzmo-positive-color-down: color-mix(in oklch, var(--luzmo-positive-color), white 24%);--luzmo-positive-color-focus: color-mix(in oklch, var(--luzmo-positive-color), white 12%);--luzmo-positive-on-subtle-color: color-mix( in oklch, var(--luzmo-positive-color), var(--luzmo-font-color) 35% );--luzmo-positive-color-rgb: 57, 168, 117;--luzmo-positive-inverse-color: var(--luzmo-background-color);--luzmo-selected-color: #afafaf;--luzmo-selected-color-hover: color-mix(in oklch, var(--luzmo-selected-color), white 20%);--luzmo-selected-color-down: color-mix(in oklch, var(--luzmo-selected-color), white 35%);--luzmo-selected-color-focus: color-mix(in oklch, var(--luzmo-selected-color), white 20%);--luzmo-selected-color-hard: #e9e9e9;--luzmo-selected-color-hard-hover: color-mix(in oklch, var(--luzmo-selected-color-hard), white 20%);--luzmo-selected-color-hard-down: color-mix(in oklch, var(--luzmo-selected-color-hard), white 35%);--luzmo-selected-color-hard-focus: color-mix(in oklch, var(--luzmo-selected-color-hard), white 20%);--luzmo-neutral-on-subtle-color: var(--luzmo-selected-color-hard);--luzmo-informative-color: #5c94ff;--luzmo-informative-color-hover: color-mix(in oklch, var(--luzmo-informative-color), white 12%);--luzmo-informative-color-down: color-mix(in oklch, var(--luzmo-informative-color), white 24%);--luzmo-informative-color-focus: var(--luzmo-informative-color-hover);--luzmo-informative-on-subtle-color: color-mix( in oklch, var(--luzmo-informative-color), var(--luzmo-font-color) 36% );--luzmo-informative-color-rgb: 92, 148, 255;--luzmo-informative-inverse-color: var(--luzmo-background-color);--luzmo-notice-color-hover: color-mix(in oklch, var(--luzmo-notice-color), white 12%);--luzmo-notice-color-down: color-mix(in oklch, var(--luzmo-notice-color), white 24%);--luzmo-notice-color-focus: var(--luzmo-notice-color-hover);--luzmo-notice-on-subtle-color: var(--luzmo-notice-color);--luzmo-notice-inverse-color: var(--luzmo-background-color);--luzmo-disabled-color: #75797b}", document.head.appendChild(e);
|
|
22
|
+
}
|
|
23
|
+
})();
|
|
24
|
+
import { t as e } from "../split-view-FxpiSCem.js";
|
|
25
|
+
export { e as LuzmoSplitView };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type SplitViewBounds = {
|
|
2
|
+
min: number;
|
|
3
|
+
max: number;
|
|
4
|
+
};
|
|
5
|
+
export type SplitViewConstraints = {
|
|
6
|
+
primaryMin: number;
|
|
7
|
+
primaryMax: number;
|
|
8
|
+
secondaryMin: number;
|
|
9
|
+
secondaryMax: number;
|
|
10
|
+
};
|
|
11
|
+
export declare function calculateSplitViewBounds(viewSize: number, constraints: SplitViewConstraints): SplitViewBounds;
|
|
12
|
+
export declare function clampSplitViewPosition(value: number, bounds: SplitViewBounds): number;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { CSSResultArray, PropertyValues, TemplateResult } from 'lit';
|
|
2
|
+
import { Focusable } from '../../utils/focusable';
|
|
3
|
+
/**
|
|
4
|
+
* Divides two panes with an optionally interactive separator.
|
|
5
|
+
*
|
|
6
|
+
* @element luzmo-split-view
|
|
7
|
+
* @slot - The first two elements are rendered as panes.
|
|
8
|
+
* @attr primary-min - Minimum primary pane size in pixels.
|
|
9
|
+
* @attr primary-max - Maximum primary pane size in pixels.
|
|
10
|
+
* @attr secondary-min - Minimum secondary pane size in pixels.
|
|
11
|
+
* @attr secondary-max - Maximum secondary pane size in pixels.
|
|
12
|
+
* @attr primary-size - Initial primary pane size in pixels, percent, or `auto`.
|
|
13
|
+
* @attr splitter-pos - Current primary pane size in pixels.
|
|
14
|
+
* @fires input - The splitter position changes during interaction.
|
|
15
|
+
* @fires change - A splitter position change is committed.
|
|
16
|
+
* @cssprop --luzmo-split-view-divider-color - Divider color.
|
|
17
|
+
* @cssprop --luzmo-split-view-divider-color-hover - Hovered divider color.
|
|
18
|
+
* @cssprop --luzmo-split-view-divider-color-active - Active divider color.
|
|
19
|
+
* @cssprop --luzmo-split-view-divider-thickness - Visible divider thickness.
|
|
20
|
+
* @cssprop --luzmo-split-view-focus-color - Focus indicator color.
|
|
21
|
+
*/
|
|
22
|
+
export declare class LuzmoSplitView extends Focusable {
|
|
23
|
+
static get styles(): CSSResultArray;
|
|
24
|
+
/** Stacks panes vertically instead of side by side. */
|
|
25
|
+
vertical: boolean;
|
|
26
|
+
/** Enables pointer and keyboard resizing. */
|
|
27
|
+
set resizable(value: boolean);
|
|
28
|
+
get resizable(): boolean;
|
|
29
|
+
/** Allows either pane to collapse at its edge. */
|
|
30
|
+
collapsible: boolean;
|
|
31
|
+
/** Accessible name for the separator. */
|
|
32
|
+
label: string;
|
|
33
|
+
/** Minimum primary pane size in pixels. */
|
|
34
|
+
set primaryMin(value: number);
|
|
35
|
+
get primaryMin(): number;
|
|
36
|
+
/** Maximum primary pane size in pixels. */
|
|
37
|
+
set primaryMax(value: number);
|
|
38
|
+
get primaryMax(): number;
|
|
39
|
+
/** Minimum secondary pane size in pixels. */
|
|
40
|
+
set secondaryMin(value: number);
|
|
41
|
+
get secondaryMin(): number;
|
|
42
|
+
/** Maximum secondary pane size in pixels. */
|
|
43
|
+
set secondaryMax(value: number);
|
|
44
|
+
get secondaryMax(): number;
|
|
45
|
+
/** Initial primary pane size in pixels, percentage, or `auto`. */
|
|
46
|
+
primarySize: string;
|
|
47
|
+
/** Current primary pane size in pixels. */
|
|
48
|
+
set splitterPos(value: number);
|
|
49
|
+
get splitterPos(): number;
|
|
50
|
+
private _paneSlot?;
|
|
51
|
+
private _separator?;
|
|
52
|
+
private _primaryMin;
|
|
53
|
+
private _primaryMax;
|
|
54
|
+
private _secondaryMin;
|
|
55
|
+
private _secondaryMax;
|
|
56
|
+
private _resizable;
|
|
57
|
+
private _splitterPos;
|
|
58
|
+
private _viewSize;
|
|
59
|
+
private _minPos;
|
|
60
|
+
private _maxPos;
|
|
61
|
+
private _enoughChildren;
|
|
62
|
+
private _positionInitialized;
|
|
63
|
+
private _initialSplitterPosSupplied;
|
|
64
|
+
private _activePanes;
|
|
65
|
+
private _restorePositionOnReconnect;
|
|
66
|
+
private _paneInlineStyles;
|
|
67
|
+
private _controlledElement?;
|
|
68
|
+
private _controlledElementGeneratedId?;
|
|
69
|
+
private _resizeObserver?;
|
|
70
|
+
private _dragStartPosition?;
|
|
71
|
+
private _dragPointerId?;
|
|
72
|
+
private _dragChanged;
|
|
73
|
+
private _capturedPointer?;
|
|
74
|
+
private _lastExpandedPosition?;
|
|
75
|
+
get focusElement(): HTMLElement;
|
|
76
|
+
connectedCallback(): void;
|
|
77
|
+
disconnectedCallback(): void;
|
|
78
|
+
private _normalizeBound;
|
|
79
|
+
private _measureView;
|
|
80
|
+
private _calculateBounds;
|
|
81
|
+
private _clampPosition;
|
|
82
|
+
private _resolveInitialPosition;
|
|
83
|
+
private _applyPaneSizes;
|
|
84
|
+
private _restorePaneStyles;
|
|
85
|
+
private _setActivePanes;
|
|
86
|
+
private _recalculate;
|
|
87
|
+
private _syncAriaControls;
|
|
88
|
+
private _clearControlledElementId;
|
|
89
|
+
private handleSlotChange;
|
|
90
|
+
private _dispatchValueEvent;
|
|
91
|
+
private _setPosition;
|
|
92
|
+
private handleKeydown;
|
|
93
|
+
private _capturePointer;
|
|
94
|
+
private _releasePointer;
|
|
95
|
+
private handlePointerDown;
|
|
96
|
+
private _pointerPosition;
|
|
97
|
+
private handlePointerMove;
|
|
98
|
+
private _finishDrag;
|
|
99
|
+
private handlePointerUp;
|
|
100
|
+
private _cancelDrag;
|
|
101
|
+
private handlePointerCancel;
|
|
102
|
+
protected render(): TemplateResult;
|
|
103
|
+
private _positionAsPercentage;
|
|
104
|
+
protected willUpdate(changes: PropertyValues): void;
|
|
105
|
+
protected updated(changes: PropertyValues): void;
|
|
106
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*! * Lucero - The design system for Luzmo.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2025 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
|
|
6
|
+
* This license allows users with a current active Luzmo account to use Lucero.
|
|
7
|
+
* This license terminates automatically if a user no longer has an active Luzmo account.
|
|
8
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
9
|
+
*
|
|
10
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
+
* SOFTWARE.
|
|
17
|
+
* */
|
|
18
|
+
const e=require("./decorate-Dq34MBGe.cjs"),t=require("./focusable-B6h03pAe.cjs");let n=require("lit"),r=require("lit/decorators.js");function i(e,t){let n=Math.max(0,t.primaryMin,e-t.secondaryMax),r=Math.min(e,t.primaryMax,e-t.secondaryMin);if(n<=r)return{min:n,max:r};let i=Math.min(e,Math.max(0,e/2));return{min:i,max:i}}function a(e,t){return Math.min(t.max,Math.max(t.min,e))}var o=`:host{min-block-size:0;min-inline-size:0;display:flex;position:relative}:host([vertical]){flex-direction:column}slot{display:contents}::slotted(*){min-block-size:0;min-inline-size:0}::slotted(:nth-child(n+3)){display:none!important}.separator{cursor:col-resize;block-size:100%;inline-size:var(--split-view-target-size);touch-action:none;z-index:1;outline:none;justify-content:center;align-items:center;display:flex;position:absolute;inset-block-start:0;inset-inline-start:calc(var(--splitter-position,0) * 1px - var(--split-view-target-size) / 2)}:host([vertical]) .separator{block-size:var(--split-view-target-size);cursor:row-resize;inline-size:100%;inset-block-start:calc(var(--splitter-position,0) * 1px - var(--split-view-target-size) / 2);inset-inline-start:0}.separator .divider{background-color:var(--luzmo-split-view-divider-color,var(--split-view-divider-color));block-size:100%;inline-size:var(--luzmo-split-view-divider-thickness,var(--split-view-divider-thickness));pointer-events:none}.separator .handle{background-color:var(--luzmo-split-view-divider-color,var(--split-view-handle-color));block-size:var(--split-view-handle-length);border-radius:var(--split-view-handle-radius);inline-size:var(--split-view-handle-thickness);pointer-events:none;display:none;position:absolute}:host([resizable]) .separator .handle{display:block}:host([vertical]) .separator .divider{block-size:var(--luzmo-split-view-divider-thickness,var(--split-view-divider-thickness));inline-size:100%}:host([vertical]) .separator .handle{block-size:var(--split-view-handle-thickness);inline-size:var(--split-view-handle-length)}:host(:not([vertical])) .separator.start-edge{inset-inline-start:0}:host(:not([vertical])) .separator.end-edge{inset-inline-start:calc(100% - var(--split-view-target-size))}:host(:not([vertical])) .separator.start-edge .divider,:host(:not([vertical])) .separator.end-edge .divider,:host([vertical]) .separator.start-edge .divider,:host([vertical]) .separator.end-edge .divider{position:absolute}:host(:not([vertical])) .separator.start-edge .divider{inset-inline-start:0}:host(:not([vertical])) .separator.start-edge .handle{inset-inline-start:calc(var(--split-view-focus-width) + var(--split-view-focus-offset))}:host(:not([vertical])) .separator.end-edge .divider{inset-inline-end:0}:host(:not([vertical])) .separator.end-edge .handle{inset-inline-end:calc(var(--split-view-focus-width) + var(--split-view-focus-offset))}:host([vertical]) .separator.start-edge{inset-block-start:0}:host([vertical]) .separator.end-edge{inset-block-start:calc(100% - var(--split-view-target-size))}:host([vertical]) .separator.start-edge .divider{inset-block-start:0}:host([vertical]) .separator.start-edge .handle{inset-block-start:calc(var(--split-view-focus-width) + var(--split-view-focus-offset))}:host([vertical]) .separator.end-edge .divider{inset-block-end:0}:host([vertical]) .separator.end-edge .handle{inset-block-end:calc(var(--split-view-focus-width) + var(--split-view-focus-offset))}:host([resizable]:not([disabled])) .separator:hover .divider,:host([resizable]:not([disabled])) .separator:hover .handle{background-color:var(--luzmo-split-view-divider-color-hover,var(--split-view-divider-color-hover))}:host([dragging]) .separator .divider,:host([dragging]) .separator .handle{background-color:var(--luzmo-split-view-divider-color-active,var(--split-view-divider-color-active))}.separator:focus-visible .divider{background-color:var(--luzmo-split-view-focus-color,var(--split-view-focus-color))}.separator:focus-visible .handle{outline:var(--split-view-focus-width) solid var(--luzmo-split-view-focus-color,var(--split-view-focus-color));outline-offset:var(--split-view-focus-offset)}:host(:not([resizable])) .separator,:host([disabled]) .separator{cursor:default}@media (forced-colors:active){:host{--highcontrast-split-view-divider-color:CanvasText;--highcontrast-split-view-focus-color:Highlight}.separator .divider,.separator .handle{background-color:var(--highcontrast-split-view-divider-color,var(--luzmo-split-view-divider-color,var(--split-view-divider-color)))}:host([resizable]:not([disabled])) .separator:hover .divider,:host([resizable]:not([disabled])) .separator:hover .handle,:host([dragging]) .separator .divider,:host([dragging]) .separator .handle{background-color:highlight}.separator:focus-visible .divider{background-color:var(--highcontrast-split-view-focus-color,var(--luzmo-split-view-focus-color,var(--split-view-focus-color)))}.separator:focus-visible .handle{outline-color:var(--highcontrast-split-view-focus-color,var(--luzmo-split-view-focus-color,var(--split-view-focus-color)))}}:host{--split-view-divider-color:var(--luzmo-border-color-full);--split-view-divider-color-hover:var(--luzmo-primary-hover);--split-view-divider-color-active:var(--luzmo-primary-down);--split-view-divider-thickness:var(--luzmo-border-width);--split-view-focus-color:var(--luzmo-primary-focus);--split-view-target-size:var(--luzmo-component-height-xs);--split-view-focus-offset:var(--luzmo-border-width);--split-view-focus-width:var(--luzmo-indicator-width,1px);--split-view-handle-color:var(--luzmo-font-color-extra-dimmed);--split-view-handle-length:var(--luzmo-component-height);--split-view-handle-thickness:var(--luzmo-spacing-2);--split-view-handle-radius:var(--luzmo-border-radius-full)}`,s=3840,c=10,l=50,u=50,d=0,f=class extends t.t{constructor(...e){super(...e),this.vertical=!1,this.collapsible=!1,this.label=`Resize panels`,this.primarySize=`50%`,this._primaryMin=0,this._primaryMax=s,this._secondaryMin=0,this._secondaryMax=s,this._resizable=!1,this._splitterPos=0,this._viewSize=0,this._minPos=0,this._maxPos=0,this._enoughChildren=!1,this._positionInitialized=!1,this._initialSplitterPosSupplied=!1,this._activePanes=[],this._restorePositionOnReconnect=!1,this._paneInlineStyles=new Map,this._dragChanged=!1}static get styles(){let e=super.styles;return[...Array.isArray(e)?e:e?[e]:[],(0,n.unsafeCSS)(o)]}set resizable(e){let t=!!e;if(t===this._resizable)return;let n=this._resizable;this._resizable=t,t||this._cancelDrag(),this.requestUpdate(`resizable`,n)}get resizable(){return this._resizable}set primaryMin(e){let t=this._normalizeBound(e,0);if(t===this._primaryMin)return;let n=this._primaryMin;this._primaryMin=t,this.requestUpdate(`primaryMin`,n)}get primaryMin(){return this._primaryMin}set primaryMax(e){let t=this._normalizeBound(e,s);if(t===this._primaryMax)return;let n=this._primaryMax;this._primaryMax=t,this.requestUpdate(`primaryMax`,n)}get primaryMax(){return this._primaryMax}set secondaryMin(e){let t=this._normalizeBound(e,0);if(t===this._secondaryMin)return;let n=this._secondaryMin;this._secondaryMin=t,this.requestUpdate(`secondaryMin`,n)}get secondaryMin(){return this._secondaryMin}set secondaryMax(e){let t=this._normalizeBound(e,s);if(t===this._secondaryMax)return;let n=this._secondaryMax;this._secondaryMax=t,this.requestUpdate(`secondaryMax`,n)}get secondaryMax(){return this._secondaryMax}set splitterPos(e){this._positionInitialized||(this._initialSplitterPosSupplied=!0);let t=Number.isFinite(e)?e:0,n=this.collapsible&&(t===0||t===this._viewSize),r=this._positionInitialized&&!n?this._clampPosition(t):t;if(r===this._splitterPos)return;let i=this._splitterPos;this._splitterPos=r,this.requestUpdate(`splitterPos`,i)}get splitterPos(){return this._splitterPos}get focusElement(){return this._separator??this}connectedCallback(){this._positionInitialized||(this._initialSplitterPosSupplied=this._initialSplitterPosSupplied||this.hasAttribute(`splitter-pos`)),super.connectedCallback(),typeof ResizeObserver<`u`&&(this._resizeObserver??=new ResizeObserver(()=>{this._recalculate(!1)}),this._resizeObserver.observe(this)),this.updateComplete.then(()=>{this.isConnected&&this.handleSlotChange()})}disconnectedCallback(){this._cancelDrag(!1),this._resizeObserver?.disconnect(),this._restorePaneStyles(),this._activePanes=[],this._restorePositionOnReconnect=!0,this._clearControlledElementId(),this._controlledElement=void 0,super.disconnectedCallback()}_normalizeBound(e,t){return Number.isFinite(e)&&e>=0?e:t}_measureView(){let e=this.getBoundingClientRect();return this.vertical?e.height:e.width}_calculateBounds(){this._viewSize=this._measureView();let e=i(this._viewSize,{primaryMin:this.primaryMin,primaryMax:this.primaryMax,secondaryMin:this.secondaryMin,secondaryMax:this.secondaryMax});this._minPos=e.min,this._maxPos=e.max}_clampPosition(e){return a(e,{min:this._minPos,max:this._maxPos})}_resolveInitialPosition(){let e=this.primarySize.trim();if(/^\d+(?:\.\d+)?(?:px)?$/.test(e))return Number.parseFloat(e);if(/^\d+(?:\.\d+)?%$/.test(e))return Number.parseFloat(e)/100*this._viewSize;if(e===`auto`&&this._controlledElement){let e=Number.parseFloat(this._controlledElement.style.getPropertyValue(this.vertical?`block-size`:`inline-size`));if(Number.isFinite(e)&&e>0)return e;let t=Number.parseFloat(getComputedStyle(this._controlledElement).getPropertyValue(this.vertical?`height`:`width`));if(Number.isFinite(t)&&t>0)return t;let n=this._controlledElement.getBoundingClientRect(),r=this.vertical?n.height:n.width;if(Number.isFinite(r)&&r>0)return r}return this._viewSize/2}_applyPaneSizes(){let[e,t]=this._activePanes,n=Math.round(this.splitterPos),r=Math.round(this._viewSize);e&&(e.style.flex=`0 0 ${n}px`,e.style.display=r>0&&n<=0?`none`:this._paneInlineStyles.get(e)?.display??``),t&&(t.style.flex=`1 1 0`,t.style.display=r>0&&n>=r?`none`:this._paneInlineStyles.get(t)?.display??``)}_restorePaneStyles(){for(let[e,t]of this._paneInlineStyles)e.style.display=t.display,e.style.flex=t.flex;this._paneInlineStyles.clear()}_setActivePanes(e){let t=e.slice(0,2),n=t.length!==this._activePanes.length||t.some((e,t)=>e!==this._activePanes[t]);if(n&&(this._restorePaneStyles(),this._activePanes=t),n||this._paneInlineStyles.size===0)for(let e of t)this._paneInlineStyles.set(e,{display:e.style.display,flex:e.style.flex});return n}_recalculate(e){if(!this.isConnected||!this._enoughChildren)return;let t=this._viewSize,n=this._positionInitialized&&this.collapsible&&this.splitterPos===0,r=this._positionInitialized&&this.collapsible&&t>0&&this.splitterPos===t;this._calculateBounds();let i;this._positionInitialized?i=e?this._resolveInitialPosition():n?0:r?this._viewSize:this._clampPosition(this.splitterPos):(i=this._initialSplitterPosSupplied?this.splitterPos:this._resolveInitialPosition(),this._positionInitialized=!0),this.splitterPos=i,this._applyPaneSizes()}_syncAriaControls(){!this._separator||!this._controlledElement||(this._separator.ariaControlsElements=[this._controlledElement])}_clearControlledElementId(){this._controlledElement&&this._controlledElement.id===this._controlledElementGeneratedId&&this._controlledElement.removeAttribute(`id`),this._controlledElementGeneratedId=void 0}handleSlotChange(){let e=this._paneSlot?.assignedElements()??[],t=this._setActivePanes(e),n=e[0];n!==this._controlledElement&&(this._clearControlledElementId(),this._controlledElement=n),this._controlledElement&&!this._controlledElement.id&&(d+=1,this._controlledElementGeneratedId=`luzmo-split-view-pane-${d}`,this._controlledElement.id=this._controlledElementGeneratedId);let r=this._enoughChildren,i=e.length>=2;if(i!==this._enoughChildren&&(this._enoughChildren=i,this.requestUpdate()),i){let e=!r||t&&!this._restorePositionOnReconnect;this._restorePositionOnReconnect=!1,this.updateComplete.then(()=>{this._recalculate(e),this._syncAriaControls()})}}_dispatchValueEvent(e){this.dispatchEvent(new Event(e,{bubbles:!0,composed:!0}))}_setPosition(e,t={}){let n=this._clampPosition(e);return this.collapsible&&t.collapse&&(e<=0&&(n=0),e>=this._viewSize&&(n=this._viewSize)),n===this.splitterPos?!1:(this.splitterPos>0&&this.splitterPos<this._viewSize&&(this._lastExpandedPosition=this.splitterPos),this.splitterPos=n,this._applyPaneSizes(),(t.emit??!0)&&this._dispatchValueEvent(`input`),!0)}handleKeydown(e){if(!this.resizable||this.disabled)return;let t;switch(e.key){case`ArrowLeft`:this.vertical||(t=this.splitterPos+(this.isLTR?-10:c));break;case`ArrowRight`:this.vertical||(t=this.splitterPos+(this.isLTR?c:-10));break;case`ArrowUp`:this.vertical&&(t=this.splitterPos-c);break;case`ArrowDown`:this.vertical&&(t=this.splitterPos+c);break;case`PageUp`:t=this.splitterPos+(this.vertical?-50:l);break;case`PageDown`:t=this.splitterPos+(this.vertical?l:-50);break;case`Home`:t=this.collapsible?0:this._minPos;break;case`End`:t=this.collapsible?this._viewSize:this._maxPos;break;case`Enter`:if(!this.collapsible)return;t=this.splitterPos===0?this._lastExpandedPosition??this._viewSize/2:0;break;default:return}t!==void 0&&(e.preventDefault(),this._setPosition(t,{collapse:!0})&&this._dispatchValueEvent(`change`))}_capturePointer(e,t){try{e.setPointerCapture(t),this._capturedPointer={target:e,pointerId:t}}catch{this._capturedPointer=void 0}}_releasePointer(){let e=this._capturedPointer;this._capturedPointer=void 0,e?.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}handlePointerDown(e){!this.resizable||this.disabled||e.button!==0||this._dragStartPosition!==void 0||(this._dragPointerId=e.pointerId,this._dragStartPosition=this.splitterPos,this._dragChanged=!1,this.toggleAttribute(`dragging`,!0),this._capturePointer(e.currentTarget,e.pointerId))}_pointerPosition(e){let t=this.getBoundingClientRect();return this.vertical?e.clientY-t.top:this.isLTR?e.clientX-t.left:t.right-e.clientX}handlePointerMove(e){if(this._dragPointerId!==e.pointerId||this._dragStartPosition===void 0||!this.resizable||this.disabled)return;let t=this._pointerPosition(e);this.collapsible&&t<this._minPos-u&&(t=0),this.collapsible&&t>this._maxPos+u&&(t=this._viewSize),this._setPosition(t,{collapse:!0})&&(this._dragChanged=!0)}_finishDrag(){this._dragPointerId=void 0,this._releasePointer(),this._dragStartPosition=void 0,this._dragChanged=!1,this.toggleAttribute(`dragging`,!1)}handlePointerUp(e){if(this._dragPointerId!==e.pointerId||this._dragStartPosition===void 0)return;let t=this._dragChanged;this._finishDrag(),t&&this._dispatchValueEvent(`change`)}_cancelDrag(e=!0){if(this._dragStartPosition===void 0)return;let t=this._dragStartPosition,n=this._dragChanged;this._finishDrag(),e&&n&&this._setPosition(t,{collapse:!0})}handlePointerCancel(e){this._dragPointerId===e.pointerId&&this._cancelDrag()}render(){return n.html`
|
|
19
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
20
|
+
${this._enoughChildren?n.html`
|
|
21
|
+
<div
|
|
22
|
+
class="separator ${this.splitterPos<=0?`start-edge`:this._viewSize>0&&this.splitterPos>=this._viewSize?`end-edge`:``}"
|
|
23
|
+
role="separator"
|
|
24
|
+
aria-label=${this.label}
|
|
25
|
+
aria-disabled=${this.resizable?this.disabled?`true`:`false`:n.nothing}
|
|
26
|
+
aria-orientation=${this.vertical?`horizontal`:`vertical`}
|
|
27
|
+
aria-valuemin=${this.resizable?this._positionAsPercentage(this.collapsible?0:this._minPos):n.nothing}
|
|
28
|
+
aria-valuemax=${this.resizable?this._positionAsPercentage(this.collapsible?this._viewSize:this._maxPos):n.nothing}
|
|
29
|
+
aria-valuenow=${this.resizable?this._positionAsPercentage(this.splitterPos):n.nothing}
|
|
30
|
+
tabindex=${this.resizable?this.disabled?`-1`:`0`:n.nothing}
|
|
31
|
+
style=${`--splitter-position: ${this.splitterPos}`}
|
|
32
|
+
@keydown=${this.handleKeydown}
|
|
33
|
+
@pointerdown=${this.handlePointerDown}
|
|
34
|
+
@pointermove=${this.handlePointerMove}
|
|
35
|
+
@pointerup=${this.handlePointerUp}
|
|
36
|
+
@pointercancel=${this.handlePointerCancel}
|
|
37
|
+
@lostpointercapture=${this.handlePointerCancel}
|
|
38
|
+
>
|
|
39
|
+
<span class="divider" aria-hidden="true"></span>
|
|
40
|
+
<span class="handle" aria-hidden="true"></span>
|
|
41
|
+
</div>
|
|
42
|
+
`:n.nothing}
|
|
43
|
+
`}_positionAsPercentage(e){return String(this._viewSize>0?Math.round(e/this._viewSize*100):0)}willUpdate(e){super.willUpdate(e),(e.has(`vertical`)||e.has(`primaryMin`)||e.has(`primaryMax`)||e.has(`secondaryMin`)||e.has(`secondaryMax`)||e.has(`collapsible`))&&this._recalculate(!1),e.has(`primarySize`)&&this._recalculate(!0)}updated(e){super.updated(e),e.has(`splitterPos`)&&this._applyPaneSizes(),this._syncAriaControls(),e.has(`disabled`)&&this.disabled&&this._cancelDrag()}};e.t([(0,r.property)({type:Boolean,reflect:!0})],f.prototype,`vertical`,void 0),e.t([(0,r.property)({type:Boolean,reflect:!0})],f.prototype,`resizable`,null),e.t([(0,r.property)({type:Boolean,reflect:!0})],f.prototype,`collapsible`,void 0),e.t([(0,r.property)({type:String,reflect:!0})],f.prototype,`label`,void 0),e.t([(0,r.property)({type:Number,reflect:!0,attribute:`primary-min`})],f.prototype,`primaryMin`,null),e.t([(0,r.property)({type:Number,reflect:!0,attribute:`primary-max`})],f.prototype,`primaryMax`,null),e.t([(0,r.property)({type:Number,reflect:!0,attribute:`secondary-min`})],f.prototype,`secondaryMin`,null),e.t([(0,r.property)({type:Number,reflect:!0,attribute:`secondary-max`})],f.prototype,`secondaryMax`,null),e.t([(0,r.property)({type:String,reflect:!0,attribute:`primary-size`})],f.prototype,`primarySize`,void 0),e.t([(0,r.property)({type:Number,reflect:!0,attribute:`splitter-pos`})],f.prototype,`splitterPos`,null),e.t([(0,r.query)(`slot`)],f.prototype,`_paneSlot`,void 0),e.t([(0,r.query)(`[role="separator"]`)],f.prototype,`_separator`,void 0),typeof customElements<`u`&&!customElements.get(`luzmo-split-view`)&&customElements.define(`luzmo-split-view`,f),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
|