@six-group/ui-library 5.0.0-rc.1 → 5.0.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/dist/cjs/index-C8rK7OAe.js +4 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/six-date.cjs.entry.js +38 -33
- package/dist/cjs/six-date.cjs.entry.js.map +1 -1
- package/dist/cjs/six-date.entry.cjs.js.map +1 -1
- package/dist/cjs/six-datepicker.cjs.entry.js +3 -3
- package/dist/cjs/six-datepicker.cjs.entry.js.map +1 -1
- package/dist/cjs/six-datepicker.entry.cjs.js.map +1 -1
- package/dist/cjs/six-range.cjs.entry.js.map +1 -1
- package/dist/cjs/six-range.entry.cjs.js.map +1 -1
- package/dist/cjs/six-rating.cjs.entry.js +126 -0
- package/dist/cjs/six-rating.cjs.entry.js.map +1 -0
- package/dist/cjs/six-rating.entry.cjs.js.map +1 -0
- package/dist/cjs/six-root.cjs.entry.js +1 -1
- package/dist/cjs/six-sidebar-item.cjs.entry.js +2 -2
- package/dist/cjs/six-sidebar.cjs.entry.js +2 -2
- package/dist/cjs/six-switch.cjs.entry.js +2 -2
- package/dist/cjs/six-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/six-switch.entry.cjs.js.map +1 -1
- package/dist/cjs/six-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/six-tab.cjs.entry.js +2 -2
- package/dist/cjs/six-tag.cjs.entry.js +2 -2
- package/dist/cjs/six-textarea.cjs.entry.js +2 -2
- package/dist/cjs/six-tile.cjs.entry.js +5 -5
- package/dist/cjs/six-timepicker.cjs.entry.js +17 -9
- package/dist/cjs/six-timepicker.cjs.entry.js.map +1 -1
- package/dist/cjs/six-timepicker.entry.cjs.js.map +1 -1
- package/dist/cjs/six-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/ui-library.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/six-date/iso-date.js +32 -0
- package/dist/collection/components/six-date/iso-date.js.map +1 -1
- package/dist/collection/components/six-date/six-date.js +7 -34
- package/dist/collection/components/six-date/six-date.js.map +1 -1
- package/dist/collection/components/six-datepicker/six-datepicker.js +4 -4
- package/dist/collection/components/six-datepicker/six-datepicker.js.map +1 -1
- package/dist/collection/components/six-rating/six-rating.css +125 -0
- package/dist/collection/components/six-rating/six-rating.js +432 -0
- package/dist/collection/components/six-rating/six-rating.js.map +1 -0
- package/dist/collection/components/six-root/six-root.js +1 -1
- package/dist/collection/components/six-sidebar/six-sidebar.js +2 -2
- package/dist/collection/components/six-sidebar-item/six-sidebar-item.js +2 -2
- package/dist/collection/components/six-switch/six-switch.js +2 -2
- package/dist/collection/components/six-tab/six-tab.js +2 -2
- package/dist/collection/components/six-tab-panel/six-tab-panel.js +1 -1
- package/dist/collection/components/six-tag/six-tag.js +2 -2
- package/dist/collection/components/six-textarea/six-textarea.js +2 -2
- package/dist/collection/components/six-tile/six-tile.js +5 -5
- package/dist/collection/components/six-timepicker/six-timepicker.js +17 -9
- package/dist/collection/components/six-timepicker/six-timepicker.js.map +1 -1
- package/dist/collection/components/six-tooltip/six-tooltip.js +2 -2
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/{p-DnLdSdN5.js → p-CAJFkiLw.js} +19 -11
- package/dist/components/p-CAJFkiLw.js.map +1 -0
- package/dist/components/{p-Cs6mMfx-.js → p-ClylOmYH.js} +4 -4
- package/dist/components/{p-Cs6mMfx-.js.map → p-ClylOmYH.js.map} +1 -1
- package/dist/components/six-date.js +38 -33
- package/dist/components/six-date.js.map +1 -1
- package/dist/components/six-datepicker.js +4 -4
- package/dist/components/six-datepicker.js.map +1 -1
- package/dist/components/six-range.js.map +1 -1
- package/dist/components/six-rating.d.ts +11 -0
- package/dist/components/six-rating.js +173 -0
- package/dist/components/six-rating.js.map +1 -0
- package/dist/components/six-root.js +1 -1
- package/dist/components/six-sidebar-item.js +2 -2
- package/dist/components/six-sidebar.js +2 -2
- package/dist/components/six-switch.js +2 -2
- package/dist/components/six-switch.js.map +1 -1
- package/dist/components/six-tab-panel.js +1 -1
- package/dist/components/six-tab.js +2 -2
- package/dist/components/six-tag.js +3 -3
- package/dist/components/six-textarea.js +2 -2
- package/dist/components/six-tile.js +6 -6
- package/dist/components/six-timepicker.js +1 -1
- package/dist/components/six-tooltip.js +1 -1
- package/dist/components.json +471 -4
- package/dist/esm/index-JoG9I7EO.js +4 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/six-date.entry.js +38 -33
- package/dist/esm/six-date.entry.js.map +1 -1
- package/dist/esm/six-datepicker.entry.js +3 -3
- package/dist/esm/six-datepicker.entry.js.map +1 -1
- package/dist/esm/six-range.entry.js.map +1 -1
- package/dist/esm/six-rating.entry.js +124 -0
- package/dist/esm/six-rating.entry.js.map +1 -0
- package/dist/esm/six-root.entry.js +1 -1
- package/dist/esm/six-sidebar-item.entry.js +2 -2
- package/dist/esm/six-sidebar.entry.js +2 -2
- package/dist/esm/six-switch.entry.js +2 -2
- package/dist/esm/six-switch.entry.js.map +1 -1
- package/dist/esm/six-tab-panel.entry.js +1 -1
- package/dist/esm/six-tab.entry.js +2 -2
- package/dist/esm/six-tag.entry.js +2 -2
- package/dist/esm/six-textarea.entry.js +2 -2
- package/dist/esm/six-tile.entry.js +5 -5
- package/dist/esm/six-timepicker.entry.js +17 -9
- package/dist/esm/six-timepicker.entry.js.map +1 -1
- package/dist/esm/six-tooltip.entry.js +2 -2
- package/dist/esm/ui-library.js +1 -1
- package/dist/types/components/six-date/iso-date.d.ts +2 -0
- package/dist/types/components/six-datepicker/six-datepicker.d.ts +1 -1
- package/dist/types/components/six-rating/six-rating.d.ts +52 -0
- package/dist/types/components.d.ts +164 -4
- package/dist/ui-library/{p-01243b2e.entry.js → p-03ca4af8.entry.js} +2 -2
- package/dist/ui-library/p-12e7a9e1.entry.js +2 -0
- package/dist/ui-library/p-12e7a9e1.entry.js.map +1 -0
- package/dist/ui-library/{p-362ff192.entry.js → p-21cbccb1.entry.js} +2 -2
- package/dist/ui-library/p-38c51fd1.entry.js +2 -0
- package/dist/ui-library/p-38c51fd1.entry.js.map +1 -0
- package/dist/ui-library/p-39668d61.entry.js +2 -0
- package/dist/ui-library/p-39668d61.entry.js.map +1 -0
- package/dist/ui-library/{p-ea61b009.entry.js → p-6c8182fa.entry.js} +2 -2
- package/dist/ui-library/{p-25ff87fe.entry.js → p-83b35622.entry.js} +2 -2
- package/dist/ui-library/{p-18e755bc.entry.js → p-c33533c4.entry.js} +2 -2
- package/dist/ui-library/p-c33533c4.entry.js.map +1 -0
- package/dist/ui-library/{p-f6423fca.entry.js → p-c8fbf085.entry.js} +2 -2
- package/dist/ui-library/p-d7c7398d.entry.js +2 -0
- package/dist/ui-library/{p-f4dd7b57.entry.js → p-d9e770ab.entry.js} +2 -2
- package/dist/ui-library/p-d9e770ab.entry.js.map +1 -0
- package/dist/ui-library/p-ea3bf68d.entry.js +2 -0
- package/dist/ui-library/p-ee980a0f.entry.js.map +1 -1
- package/dist/ui-library/{p-29d79fe3.entry.js → p-f54d3616.entry.js} +2 -2
- package/dist/ui-library/{p-285666de.entry.js → p-f6a1c20b.entry.js} +2 -2
- package/dist/ui-library/six-date.entry.esm.js.map +1 -1
- package/dist/ui-library/six-datepicker.entry.esm.js.map +1 -1
- package/dist/ui-library/six-range.entry.esm.js.map +1 -1
- package/dist/ui-library/six-rating.entry.esm.js.map +1 -0
- package/dist/ui-library/six-switch.entry.esm.js.map +1 -1
- package/dist/ui-library/six-timepicker.entry.esm.js.map +1 -1
- package/dist/ui-library/ui-library.css +1 -1
- package/dist/ui-library/ui-library.esm.js +1 -1
- package/package.json +1 -1
- package/dist/components/p-DnLdSdN5.js.map +0 -1
- package/dist/ui-library/p-18e755bc.entry.js.map +0 -1
- package/dist/ui-library/p-3dc98466.entry.js +0 -2
- package/dist/ui-library/p-3dc98466.entry.js.map +0 -1
- package/dist/ui-library/p-494546c8.entry.js +0 -2
- package/dist/ui-library/p-4f52c56f.entry.js +0 -2
- package/dist/ui-library/p-4f52c56f.entry.js.map +0 -1
- package/dist/ui-library/p-d36ec323.entry.js +0 -2
- package/dist/ui-library/p-f4dd7b57.entry.js.map +0 -1
- /package/dist/ui-library/{p-01243b2e.entry.js.map → p-03ca4af8.entry.js.map} +0 -0
- /package/dist/ui-library/{p-362ff192.entry.js.map → p-21cbccb1.entry.js.map} +0 -0
- /package/dist/ui-library/{p-ea61b009.entry.js.map → p-6c8182fa.entry.js.map} +0 -0
- /package/dist/ui-library/{p-25ff87fe.entry.js.map → p-83b35622.entry.js.map} +0 -0
- /package/dist/ui-library/{p-f6423fca.entry.js.map → p-c8fbf085.entry.js.map} +0 -0
- /package/dist/ui-library/{p-d36ec323.entry.js.map → p-d7c7398d.entry.js.map} +0 -0
- /package/dist/ui-library/{p-494546c8.entry.js.map → p-ea3bf68d.entry.js.map} +0 -0
- /package/dist/ui-library/{p-29d79fe3.entry.js.map → p-f54d3616.entry.js.map} +0 -0
- /package/dist/ui-library/{p-285666de.entry.js.map → p-f6a1c20b.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as o,h as i,H as r,g as s}from"./p-JoG9I7EO.js";import{P as e}from"./p-kHci8ddv.js";const a=':host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:border-box}.sr-only{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}:host{--max-width:20rem;--hide-delay:0s;--hide-duration:0.125s;--hide-timing-function:ease;--show-delay:0.125s;--show-duration:0.125s;--show-timing-function:ease;display:contents}.tooltip-positioner{position:fixed;z-index:var(--six-z-index-tooltip);pointer-events:none}.tooltip{max-width:var(--max-width);border-radius:var(--six-border-radius-medium);background-color:var(--six-tooltip-background-color);font-family:var(--six-font-family);font-size:var(--six-tooltip-font-size);font-weight:var(--six-tooltip-font-weight);line-height:var(--six-tooltip-line-height);color:var(--six-tooltip-color);opacity:0;padding:var(--six-spacing-xxx-small) var(--six-spacing-x-small);transform:scale(0.8);transform-origin:bottom;transition-property:opacity, transform;transition-delay:var(--hide-delay);transition-duration:var(--hide-duration);transition-timing-function:var(--hide-timing-function)}.tooltip::after{content:"";position:absolute;width:0;height:0}.tooltip-positioner[data-popper-placement^=top] .tooltip{transform-origin:bottom}.tooltip-positioner[data-popper-placement^=bottom] .tooltip{transform-origin:top}.tooltip-positioner[data-popper-placement^=left] .tooltip{transform-origin:right}.tooltip-positioner[data-popper-placement^=right] .tooltip{transform-origin:left}.tooltip-positioner.popover-visible .tooltip{opacity:1;transform:none;transition-delay:var(--show-delay);transition-duration:var(--show-duration);transition-timing-function:var(--show-timing-function)}.tooltip-positioner[data-popper-placement^=bottom] .tooltip::after{bottom:100%;left:calc(50% - var(--six-tooltip-arrow-size));border-bottom:var(--six-tooltip-arrow-size) solid var(--six-tooltip-background-color);border-left:var(--six-tooltip-arrow-size) solid transparent;border-right:var(--six-tooltip-arrow-size) solid transparent}.tooltip-positioner[data-popper-placement=bottom-start] .tooltip::after{left:var(--six-tooltip-arrow-start-end-offset)}.tooltip-positioner[data-popper-placement=bottom-end] .tooltip::after{right:var(--six-tooltip-arrow-start-end-offset);left:auto}.tooltip-positioner[data-popper-placement^=top] .tooltip::after{top:100%;left:calc(50% - var(--six-tooltip-arrow-size));border-top:var(--six-tooltip-arrow-size) solid var(--six-tooltip-background-color);border-left:var(--six-tooltip-arrow-size) solid transparent;border-right:var(--six-tooltip-arrow-size) solid transparent}.tooltip-positioner[data-popper-placement=top-start] .tooltip::after{left:var(--six-tooltip-arrow-start-end-offset)}.tooltip-positioner[data-popper-placement=top-end] .tooltip::after{right:var(--six-tooltip-arrow-start-end-offset);left:auto}.tooltip-positioner[data-popper-placement^=left] .tooltip::after{top:calc(50% - var(--six-tooltip-arrow-size));left:100%;border-left:var(--six-tooltip-arrow-size) solid var(--six-tooltip-background-color);border-top:var(--six-tooltip-arrow-size) solid transparent;border-bottom:var(--six-tooltip-arrow-size) solid transparent}.tooltip-positioner[data-popper-placement=left-start] .tooltip::after{top:var(--six-tooltip-arrow-start-end-offset)}.tooltip-positioner[data-popper-placement=left-end] .tooltip::after{top:auto;bottom:var(--six-tooltip-arrow-start-end-offset)}.tooltip-positioner[data-popper-placement^=right] .tooltip::after{top:calc(50% - var(--six-tooltip-arrow-size));right:100%;border-right:var(--six-tooltip-arrow-size) solid var(--six-tooltip-background-color);border-top:var(--six-tooltip-arrow-size) solid transparent;border-bottom:var(--six-tooltip-arrow-size) solid transparent}.tooltip-positioner[data-popper-placement=right-start] .tooltip::after{top:var(--six-tooltip-arrow-start-end-offset)}.tooltip-positioner[data-popper-placement=right-end] .tooltip::after{top:auto;bottom:var(--six-tooltip-arrow-start-end-offset)}';let p=0;const n=class{constructor(i){t(this,i);this.sixShow=o(this,"six-tooltip-show");this.sixAfterShow=o(this,"six-tooltip-after-show");this.sixHide=o(this,"six-tooltip-hide");this.sixAfterHide=o(this,"six-tooltip-after-hide");this.componentId=`tooltip-${++p}`;this.isVisible=false;this.content="";this.placement="top";this.disabled=false;this.distance=10;this.open=false;this.skidding=0;this.trigger="hover focus";this.handleBlur=()=>{if(this.hasTrigger("focus")){this.hide()}};this.handleClick=()=>{if(this.hasTrigger("click")){this.open?this.hide():this.show()}};this.handleFocus=()=>{if(this.hasTrigger("focus")){this.show()}};this.handleKeyDown=t=>{if(this.open&&t.key==="Escape"){t.stopPropagation();this.hide()}};this.handleMouseOver=()=>{if(this.hasTrigger("hover")){this.show()}};this.handleMouseOut=()=>{if(this.hasTrigger("hover")){this.hide()}};this.handleSlotChange=()=>{const t=this.target;const o=this.getTarget();if(o!==t){if(t!=null){t.removeAttribute("aria-describedby")}o.setAttribute("aria-describedby",this.componentId)}}}handleOpenChange(){this.open?this.show():this.hide()}componentDidLoad(){if(this.tooltipPositioner==null)return;this.target=this.getTarget();this.popoverHelper=new e(this.target,this.tooltipPositioner,{strategy:"fixed"});this.syncOptions();this.host.addEventListener("blur",this.handleBlur,true);this.host.addEventListener("click",this.handleClick,true);this.host.addEventListener("focus",this.handleFocus,true);this.tooltipPositioner.hidden=!this.open;if(this.open){this.show()}}componentDidUpdate(){this.syncOptions()}disconnectedCallback(){if(this.popoverHelper!=null){this.popoverHelper.destroy()}this.host.removeEventListener("blur",this.handleBlur,true);this.host.removeEventListener("click",this.handleClick,true);this.host.removeEventListener("focus",this.handleFocus,true)}async show(){var t;if(this.isVisible||this.disabled){return}const o=this.sixShow.emit();if(o.defaultPrevented){this.open=false;return}this.isVisible=true;this.open=true;(t=this.popoverHelper)===null||t===void 0?void 0:t.show()}async hide(){var t;if(!this.isVisible||this.disabled){return}const o=this.sixHide.emit();if(o.defaultPrevented){this.open=true;return}this.isVisible=false;this.open=false;(t=this.popoverHelper)===null||t===void 0?void 0:t.hide()}getTarget(){const t=[...this.host.children].find((t=>t.tagName.toLowerCase()!=="style"&&t.getAttribute("slot")!=="content"));if(t==null){throw new Error("Invalid tooltip target: no child element was found.")}return t}hasTrigger(t){const o=this.trigger.split(" ");return o.includes(t)}syncOptions(){if(this.popoverHelper==null)return;this.popoverHelper.setOptions({placement:this.placement,distance:this.distance,skidding:this.skidding,transitionElement:this.tooltip,onAfterHide:()=>this.sixAfterHide.emit(),onAfterShow:()=>this.sixAfterShow.emit()})}render(){return i(r,{key:"
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as o,h as i,H as r,g as s}from"./p-JoG9I7EO.js";import{P as e}from"./p-kHci8ddv.js";const a=':host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:border-box}.sr-only{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}:host{--max-width:20rem;--hide-delay:0s;--hide-duration:0.125s;--hide-timing-function:ease;--show-delay:0.125s;--show-duration:0.125s;--show-timing-function:ease;display:contents}.tooltip-positioner{position:fixed;z-index:var(--six-z-index-tooltip);pointer-events:none}.tooltip{max-width:var(--max-width);border-radius:var(--six-border-radius-medium);background-color:var(--six-tooltip-background-color);font-family:var(--six-font-family);font-size:var(--six-tooltip-font-size);font-weight:var(--six-tooltip-font-weight);line-height:var(--six-tooltip-line-height);color:var(--six-tooltip-color);opacity:0;padding:var(--six-spacing-xxx-small) var(--six-spacing-x-small);transform:scale(0.8);transform-origin:bottom;transition-property:opacity, transform;transition-delay:var(--hide-delay);transition-duration:var(--hide-duration);transition-timing-function:var(--hide-timing-function)}.tooltip::after{content:"";position:absolute;width:0;height:0}.tooltip-positioner[data-popper-placement^=top] .tooltip{transform-origin:bottom}.tooltip-positioner[data-popper-placement^=bottom] .tooltip{transform-origin:top}.tooltip-positioner[data-popper-placement^=left] .tooltip{transform-origin:right}.tooltip-positioner[data-popper-placement^=right] .tooltip{transform-origin:left}.tooltip-positioner.popover-visible .tooltip{opacity:1;transform:none;transition-delay:var(--show-delay);transition-duration:var(--show-duration);transition-timing-function:var(--show-timing-function)}.tooltip-positioner[data-popper-placement^=bottom] .tooltip::after{bottom:100%;left:calc(50% - var(--six-tooltip-arrow-size));border-bottom:var(--six-tooltip-arrow-size) solid var(--six-tooltip-background-color);border-left:var(--six-tooltip-arrow-size) solid transparent;border-right:var(--six-tooltip-arrow-size) solid transparent}.tooltip-positioner[data-popper-placement=bottom-start] .tooltip::after{left:var(--six-tooltip-arrow-start-end-offset)}.tooltip-positioner[data-popper-placement=bottom-end] .tooltip::after{right:var(--six-tooltip-arrow-start-end-offset);left:auto}.tooltip-positioner[data-popper-placement^=top] .tooltip::after{top:100%;left:calc(50% - var(--six-tooltip-arrow-size));border-top:var(--six-tooltip-arrow-size) solid var(--six-tooltip-background-color);border-left:var(--six-tooltip-arrow-size) solid transparent;border-right:var(--six-tooltip-arrow-size) solid transparent}.tooltip-positioner[data-popper-placement=top-start] .tooltip::after{left:var(--six-tooltip-arrow-start-end-offset)}.tooltip-positioner[data-popper-placement=top-end] .tooltip::after{right:var(--six-tooltip-arrow-start-end-offset);left:auto}.tooltip-positioner[data-popper-placement^=left] .tooltip::after{top:calc(50% - var(--six-tooltip-arrow-size));left:100%;border-left:var(--six-tooltip-arrow-size) solid var(--six-tooltip-background-color);border-top:var(--six-tooltip-arrow-size) solid transparent;border-bottom:var(--six-tooltip-arrow-size) solid transparent}.tooltip-positioner[data-popper-placement=left-start] .tooltip::after{top:var(--six-tooltip-arrow-start-end-offset)}.tooltip-positioner[data-popper-placement=left-end] .tooltip::after{top:auto;bottom:var(--six-tooltip-arrow-start-end-offset)}.tooltip-positioner[data-popper-placement^=right] .tooltip::after{top:calc(50% - var(--six-tooltip-arrow-size));right:100%;border-right:var(--six-tooltip-arrow-size) solid var(--six-tooltip-background-color);border-top:var(--six-tooltip-arrow-size) solid transparent;border-bottom:var(--six-tooltip-arrow-size) solid transparent}.tooltip-positioner[data-popper-placement=right-start] .tooltip::after{top:var(--six-tooltip-arrow-start-end-offset)}.tooltip-positioner[data-popper-placement=right-end] .tooltip::after{top:auto;bottom:var(--six-tooltip-arrow-start-end-offset)}';let p=0;const n=class{constructor(i){t(this,i);this.sixShow=o(this,"six-tooltip-show");this.sixAfterShow=o(this,"six-tooltip-after-show");this.sixHide=o(this,"six-tooltip-hide");this.sixAfterHide=o(this,"six-tooltip-after-hide");this.componentId=`tooltip-${++p}`;this.isVisible=false;this.content="";this.placement="top";this.disabled=false;this.distance=10;this.open=false;this.skidding=0;this.trigger="hover focus";this.handleBlur=()=>{if(this.hasTrigger("focus")){this.hide()}};this.handleClick=()=>{if(this.hasTrigger("click")){this.open?this.hide():this.show()}};this.handleFocus=()=>{if(this.hasTrigger("focus")){this.show()}};this.handleKeyDown=t=>{if(this.open&&t.key==="Escape"){t.stopPropagation();this.hide()}};this.handleMouseOver=()=>{if(this.hasTrigger("hover")){this.show()}};this.handleMouseOut=()=>{if(this.hasTrigger("hover")){this.hide()}};this.handleSlotChange=()=>{const t=this.target;const o=this.getTarget();if(o!==t){if(t!=null){t.removeAttribute("aria-describedby")}o.setAttribute("aria-describedby",this.componentId)}}}handleOpenChange(){this.open?this.show():this.hide()}componentDidLoad(){if(this.tooltipPositioner==null)return;this.target=this.getTarget();this.popoverHelper=new e(this.target,this.tooltipPositioner,{strategy:"fixed"});this.syncOptions();this.host.addEventListener("blur",this.handleBlur,true);this.host.addEventListener("click",this.handleClick,true);this.host.addEventListener("focus",this.handleFocus,true);this.tooltipPositioner.hidden=!this.open;if(this.open){this.show()}}componentDidUpdate(){this.syncOptions()}disconnectedCallback(){if(this.popoverHelper!=null){this.popoverHelper.destroy()}this.host.removeEventListener("blur",this.handleBlur,true);this.host.removeEventListener("click",this.handleClick,true);this.host.removeEventListener("focus",this.handleFocus,true)}async show(){var t;if(this.isVisible||this.disabled){return}const o=this.sixShow.emit();if(o.defaultPrevented){this.open=false;return}this.isVisible=true;this.open=true;(t=this.popoverHelper)===null||t===void 0?void 0:t.show()}async hide(){var t;if(!this.isVisible||this.disabled){return}const o=this.sixHide.emit();if(o.defaultPrevented){this.open=true;return}this.isVisible=false;this.open=false;(t=this.popoverHelper)===null||t===void 0?void 0:t.hide()}getTarget(){const t=[...this.host.children].find((t=>t.tagName.toLowerCase()!=="style"&&t.getAttribute("slot")!=="content"));if(t==null){throw new Error("Invalid tooltip target: no child element was found.")}return t}hasTrigger(t){const o=this.trigger.split(" ");return o.includes(t)}syncOptions(){if(this.popoverHelper==null)return;this.popoverHelper.setOptions({placement:this.placement,distance:this.distance,skidding:this.skidding,transitionElement:this.tooltip,onAfterHide:()=>this.sixAfterHide.emit(),onAfterShow:()=>this.sixAfterShow.emit()})}render(){return i(r,{key:"749a6d5edac438b4ff3bd9a34402823156417b37",onKeyDown:this.handleKeyDown,onMouseOver:this.handleMouseOver,onMouseOut:this.handleMouseOut},i("slot",{key:"f505a21b6cfa2362537b54a7c2a5d92750a688b5",onSlotchange:this.handleSlotChange}),i("div",{key:"4c38a6ff56ea7b6a121e59fd406728d9af71712e",ref:t=>this.tooltipPositioner=t,class:"tooltip-positioner"},i("div",{key:"1df2f66d1bbae1aeb864d23d91e9094ab950ff79",part:"base",ref:t=>this.tooltip=t,id:this.componentId,class:{tooltip:true,"tooltip--open":this.open},role:"tooltip","aria-hidden":this.open?"false":"true"},i("slot",{key:"cc4a2c0d99ae6f16058ac19cef27b7dd66c33bed",name:"content"},this.content))))}get host(){return s(this)}static get watchers(){return{open:["handleOpenChange"]}}};n.style=a;export{n as six_tooltip};
|
|
2
|
+
//# sourceMappingURL=p-c8fbf085.entry.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e,h as a,g as t}from"./p-JoG9I7EO.js";const i=":host{display:block;overflow:hidden;height:inherit}.six-root{display:grid;grid-template:auto 1fr auto/auto 1fr auto;height:100%}.six-root__container--padded{padding:var(--six-spacing-xxx-large)}.six-root__left-sidebar{height:100%;overflow:scroll;grid-column:1/2}.six-root__right-sidebar{height:100%;overflow:scroll;grid-column:3/4}.six-root nav{overflow:hidden}header{grid-column:1/4;position:sticky;top:0;z-index:var(--six-z-index-header);margin-right:2px}main{height:100%;display:flex;flex-direction:column;justify-content:space-between;grid-column:2/3;overflow:auto}footer{grid-column:1/4}";const o=class{constructor(a){e(this,a);this.padded=true;this.stage=null;this.version=""}render(){return a("host",{key:"574331a30ddbdff3fb37129ec8e46c873bc1832e",class:"six-root"},a("header",{key:"f70f24b925ba9a88156d46a6481f6ab3f415bdad",part:"header"},this.stage&&a("six-stage-indicator",{key:"4fe5f33c59e77fcd1cae71afa5ccdd227fbd3d74",stage:this.stage},this.version),a("slot",{key:"92fcdbb991e5593d0f5e602a3dc72b3bc95ce415",name:"header"})),a("nav",{key:"d26e8e840ae344dcda1e81879e50f45981ad0035",class:"six-root__left-sidebar",part:"left-sidebar"},a("slot",{key:"da2e4b7ea1338e68970364d279753b7dd9ce4716",name:"left-sidebar"})),a("main",{key:"13c283e1e1150c3a6f0cc76feed50889023c8bfc",part:"main"},a("div",{key:"0fd0a46e4d68dc7af4f4444de6cbd0cb68e3098a",class:{"six-root__container":true,"six-root__container--padded":this.padded},part:"container"},a("slot",{key:"5591878851514068d3ce5751af12fa86aa6449ca",name:"main"})),a("div",{key:"fe14e87f84217215d03545b5094f462981124093",class:"six-root__footer"},a("slot",{key:"44cd8020e7ba2ee5a4bfb50a8e9f46cac4c6010f",name:"footer"}))),a("nav",{key:"a26ca2c92e7e0ef955bea7796270a5d64e9c1aec",class:"six-root__right-sidebar",part:"right-sidebar"},a("slot",{key:"8d72471d1f4e06722eed5042dd8e4a5f9141b403",name:"right-sidebar"})))}get host(){return t(this)}};o.style=i;export{o as six_root};
|
|
2
|
+
//# sourceMappingURL=p-d7c7398d.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as o,h as i,g as r}from"./p-JoG9I7EO.js";import{E as s}from"./p-C4h4qpGl.js";import{F as e}from"./p-Dg9366Gk.js";import{h as l}from"./p-j3oIB5oT.js";const a=':host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:border-box}.sr-only{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control .form-control__error-text{display:none;text-align:left}.form-control--has-label .form-control__label{display:inline-block;color:var(--six-input-label-color);font-weight:var(--six-font-weight-bold);margin-bottom:var(--six-spacing-x-small)}.form-control--has-label .form-control__label__required::after{color:var(--six-color-danger-800);content:"*";transform:scale(1.1);margin-left:var(--six-spacing-xxx-small);position:absolute}.form-control--has-label.form-control--small .form-control__label{font-size:var(--six-input-label-font-size-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--six-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control_label{font-size:var(--six-input-label-font-size-large)}.form-control--has-help-text .form-control__help-text{display:block;color:var(--six-input-help-text-color);margin-top:var(--six-spacing-x-small)}.form-control--has-help-text .form-control__help-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--has-error-text .form-control__error-text{display:block;margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text .form-control__error-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text.form-control--small .form-control__error-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-error-text.form-control--medium .form-control__error-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-error-text.form-control--large .form-control__error-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--disabled .form-control__help-text{color:var(--six-input-help-text-color-disabled)}.form-control--disabled .form-control__label{color:var(--six-input-label-color-disabled)}.form-control--invalid:not(.form-control--disabled) .form-control__label{color:var(--six-input-label-color)}:host{--height:var(--six-selection-control-toggle-size);--thumb-size:calc(var(--six-selection-control-toggle-size) - 4px);--width:calc(var(--height) * 2);display:inline-block}.switch{display:inline-flex;align-items:center;font-family:var(--six-font-family);font-size:var(--six-input-font-size-medium);font-weight:var(--six-input-font-weight);color:var(--six-input-color);vertical-align:middle;cursor:pointer}.switch__control{position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--width);height:var(--height);background-color:var(--six-selection-control-color-disabled);border-radius:var(--height);transition:var(--six-transition-fast) border-color, var(--six-transition-fast) background-color}.switch__control .switch__thumb{width:var(--thumb-size);height:var(--thumb-size);background-color:var(--six-input-background-color);border-radius:50%;transform:translateX(calc(var(--width) / -2 + var(--thumb-size) / 2 - (var(--thumb-size) - var(--height)) / 2));transition:var(--six-transition-fast) transform ease, var(--six-transition-fast) background-color, var(--six-transition-fast) border-color, var(--six-transition-fast) box-shadow}.switch__control input[type=checkbox]{position:absolute;opacity:0;padding:0;margin:0;pointer-events:none}.switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover{background-color:var(--six-input-border-color-hover)}.switch--checked .switch__control{background-color:var(--six-selection-control-color)}.switch--checked .switch__control .switch__thumb{background-color:var(--six-color-white);transform:translateX(calc(var(--width) / 2 - var(--thumb-size) / 2 + (var(--thumb-size) - var(--height)) / 2))}.switch.switch--checked:not(.switch--disabled) .switch__control:hover{background-color:var(--six-input-border-color-focus)}.switch--disabled{cursor:not-allowed;color:var(--six-selection-control-color-disabled)}.switch--disabled .switch__control{background-color:var(--six-selection-control-color-disabled)}.switch--disabled.switch--checked .switch__control{background-color:var(--six-selection-control-color-disabled)}.switch__label{line-height:var(--height);margin-left:0.5em;user-select:none}';let
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as o,h as i,g as r}from"./p-JoG9I7EO.js";import{E as s}from"./p-C4h4qpGl.js";import{F as e}from"./p-Dg9366Gk.js";import{h as l}from"./p-j3oIB5oT.js";const a=':host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:border-box}.sr-only{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control .form-control__error-text{display:none;text-align:left}.form-control--has-label .form-control__label{display:inline-block;color:var(--six-input-label-color);font-weight:var(--six-font-weight-bold);margin-bottom:var(--six-spacing-x-small)}.form-control--has-label .form-control__label__required::after{color:var(--six-color-danger-800);content:"*";transform:scale(1.1);margin-left:var(--six-spacing-xxx-small);position:absolute}.form-control--has-label.form-control--small .form-control__label{font-size:var(--six-input-label-font-size-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--six-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control_label{font-size:var(--six-input-label-font-size-large)}.form-control--has-help-text .form-control__help-text{display:block;color:var(--six-input-help-text-color);margin-top:var(--six-spacing-x-small)}.form-control--has-help-text .form-control__help-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--has-error-text .form-control__error-text{display:block;margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text .form-control__error-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text.form-control--small .form-control__error-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-error-text.form-control--medium .form-control__error-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-error-text.form-control--large .form-control__error-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--disabled .form-control__help-text{color:var(--six-input-help-text-color-disabled)}.form-control--disabled .form-control__label{color:var(--six-input-label-color-disabled)}.form-control--invalid:not(.form-control--disabled) .form-control__label{color:var(--six-input-label-color)}:host{--height:var(--six-selection-control-toggle-size);--thumb-size:calc(var(--six-selection-control-toggle-size) - 4px);--width:calc(var(--height) * 2);display:inline-block}.switch{display:inline-flex;align-items:center;font-family:var(--six-font-family);font-size:var(--six-input-font-size-medium);font-weight:var(--six-input-font-weight);color:var(--six-input-color);vertical-align:middle;cursor:pointer}.switch__control{position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--width);height:var(--height);background-color:var(--six-selection-control-color-disabled);border-radius:var(--height);transition:var(--six-transition-fast) border-color, var(--six-transition-fast) background-color}.switch__control .switch__thumb{width:var(--thumb-size);height:var(--thumb-size);background-color:var(--six-input-background-color);border-radius:50%;transform:translateX(calc(var(--width) / -2 + var(--thumb-size) / 2 - (var(--thumb-size) - var(--height)) / 2));transition:var(--six-transition-fast) transform ease, var(--six-transition-fast) background-color, var(--six-transition-fast) border-color, var(--six-transition-fast) box-shadow}.switch__control input[type=checkbox]{position:absolute;opacity:0;padding:0;margin:0;pointer-events:none}.switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover{background-color:var(--six-input-border-color-hover)}.switch--checked .switch__control{background-color:var(--six-selection-control-color)}.switch--checked .switch__control .switch__thumb{background-color:var(--six-color-white);transform:translateX(calc(var(--width) / 2 - var(--thumb-size) / 2 + (var(--thumb-size) - var(--height)) / 2))}.switch.switch--checked:not(.switch--disabled) .switch__control:hover{background-color:var(--six-input-border-color-focus)}.switch--disabled{cursor:not-allowed;color:var(--six-selection-control-color-disabled)}.switch--disabled .switch__control{background-color:var(--six-selection-control-color-disabled)}.switch--disabled.switch--checked .switch__control{background-color:var(--six-selection-control-color-disabled)}.switch__label{line-height:var(--height);margin-left:0.5em;user-select:none}';let n=0;const c=class{constructor(i){t(this,i);this.sixBlur=o(this,"six-switch-blur");this.sixChange=o(this,"six-switch-change");this.sixFocus=o(this,"six-switch-focus");this.switchId=`switch-${++n}`;this.labelId=`switch-label-${n}`;this.errorTextId=`input-error-text-${n}`;this.eventListeners=new s;this.hasFocus=false;this.hasErrorTextSlot=false;this.name="";this.value="on";this.disabled=false;this.required=false;this.checked=false;this.label="";this.errorText="";this.invalid=false;this.handleSlotChange=()=>{this.hasErrorTextSlot=l(this.host,"error-text")};this.handleClick=()=>{if(this.inputElement!=null){this.checked=this.inputElement.checked;this.sixChange.emit(this.checked)}};this.handleBlur=()=>{this.hasFocus=false;this.sixBlur.emit(this.checked)};this.handleFocus=()=>{this.hasFocus=true;this.sixFocus.emit()};this.handleKeyDown=t=>{if(t.key==="ArrowLeft"){t.preventDefault();this.checked=false;this.sixChange.emit(this.checked)}if(t.key==="ArrowRight"){t.preventDefault();this.checked=true;this.sixChange.emit(this.checked)}};this.handleMouseDown=t=>{var o;t.preventDefault();(o=this.inputElement)===null||o===void 0?void 0:o.focus()}}componentWillLoad(){this.handleSlotChange()}handleCheckedChange(){if(this.inputElement!=null){this.inputElement.checked=this.checked;this.checked=this.inputElement.checked}}connectedCallback(){var t;(t=this.host.shadowRoot)===null||t===void 0?void 0:t.addEventListener("slotchange",this.handleSlotChange);this.eventListeners.forward("six-switch-change","change",this.host);this.eventListeners.forward("six-switch-blur","blur",this.host);this.eventListeners.forward("six-switch-focus","focus",this.host)}disconnectedCallback(){var t;(t=this.host.shadowRoot)===null||t===void 0?void 0:t.removeEventListener("slotchange",this.handleSlotChange);this.eventListeners.removeAll()}handleLabelChange(){this.handleSlotChange()}async setFocus(t){var o;(o=this.inputElement)===null||o===void 0?void 0:o.focus(t)}async removeFocus(){var t;(t=this.inputElement)===null||t===void 0?void 0:t.blur()}render(){return i(e,{key:"fd6c9c888316e46623e92b779c2215888783413b",inputId:this.switchId,label:this.label,labelId:this.labelId,hasLabelSlot:false,errorTextId:this.errorTextId,errorText:this.errorText,errorTextCount:this.errorTextCount,hasErrorTextSlot:this.hasErrorTextSlot,size:"medium",disabled:this.disabled,required:this.required,displayError:this.invalid},i("label",{key:"d7d5f569d8aea4f7203f7c0973cf212bd6bcfc60",part:"base",htmlFor:this.switchId,class:{switch:true,"switch--checked":this.checked,"switch--disabled":this.disabled,"switch--focused":this.hasFocus},onMouseDown:this.handleMouseDown},i("span",{key:"4043bb4abed6a44a360b5409b0e4ebd5929a719f",part:"control",class:"switch__control"},i("span",{key:"d93e868866ea81ae2c2832ddc6fdcb11c0b23679",part:"thumb",class:"switch__thumb"}),i("input",{key:"7e5cff86449295f36e85b221f8795f3df18808ae",ref:t=>this.inputElement=t,id:this.switchId,type:"checkbox",name:this.name,value:this.value,checked:this.checked,disabled:this.disabled,required:this.required,role:"switch","aria-checked":this.checked?"true":"false","aria-labelledby":this.labelId,onClick:this.handleClick,onBlur:this.handleBlur,onFocus:this.handleFocus,onKeyDown:this.handleKeyDown})),i("span",{key:"c0823f84eb3a30c2e0fdfe5acb6f1390e2b389aa",part:"label",id:this.labelId,class:"switch__label"},i("slot",{key:"aeb69e52fd37efab7ee8061d3c69bfab1c174933"}))))}get host(){return r(this)}static get watchers(){return{checked:["handleCheckedChange"],errorText:["handleLabelChange"],label:["handleLabelChange"]}}};c.style=a;export{c as six_switch};
|
|
2
|
+
//# sourceMappingURL=p-d9e770ab.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["sixSwitchCss","id","SixSwitch","constructor","hostRef","this","switchId","labelId","errorTextId","eventListeners","EventListeners","hasFocus","hasErrorTextSlot","name","value","disabled","required","checked","label","errorText","invalid","handleSlotChange","hasSlot","host","handleClick","inputElement","sixChange","emit","handleBlur","sixBlur","handleFocus","sixFocus","handleKeyDown","event","key","preventDefault","handleMouseDown","_a","focus","componentWillLoad","handleCheckedChange","connectedCallback","shadowRoot","addEventListener","forward","disconnectedCallback","removeEventListener","removeAll","handleLabelChange","setFocus","options","removeFocus","blur","render","h","FormControl","inputId","hasLabelSlot","errorTextCount","size","displayError","part","htmlFor","class","switch","onMouseDown","ref","el","type","role","onClick","onBlur","onFocus","onKeyDown"],"sources":["src/components/six-switch/six-switch.scss?tag=six-switch&encapsulation=shadow","src/components/six-switch/six-switch.tsx"],"sourcesContent":["@import '../../../src/global/component';\n@import '../../functional-components/form-control/form-control';\n\n/**\n * @prop --width: The width of the switch.\n * @prop --height: The height of the switch.\n * @prop --thumb-size: The size of the thumb.\n */\n:host {\n --height: var(--six-selection-control-toggle-size);\n --thumb-size: calc(var(--six-selection-control-toggle-size) - 4px);\n --width: calc(var(--height) * 2);\n\n display: inline-block;\n}\n\n.switch {\n display: inline-flex;\n align-items: center;\n font-family: var(--six-font-family);\n font-size: var(--six-input-font-size-medium);\n font-weight: var(--six-input-font-weight);\n color: var(--six-input-color);\n vertical-align: middle;\n cursor: pointer;\n}\n\n.switch__control {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--width);\n height: var(--height);\n background-color: var(--six-selection-control-color-disabled);\n border-radius: var(--height);\n transition:\n var(--six-transition-fast) border-color,\n var(--six-transition-fast) background-color;\n\n .switch__thumb {\n width: var(--thumb-size);\n height: var(--thumb-size);\n background-color: var(--six-input-background-color);\n border-radius: 50%;\n transform: translateX(calc(var(--width) / -2 + var(--thumb-size) / 2 - (var(--thumb-size) - var(--height)) / 2));\n transition:\n var(--six-transition-fast) transform ease,\n var(--six-transition-fast) background-color,\n var(--six-transition-fast) border-color,\n var(--six-transition-fast) box-shadow;\n }\n\n input[type='checkbox'] {\n position: absolute;\n opacity: 0;\n padding: 0;\n margin: 0;\n pointer-events: none;\n }\n}\n\n// Hover\n.switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover {\n background-color: var(--six-input-border-color-hover);\n}\n\n// Checked\n.switch--checked .switch__control {\n background-color: var(--six-selection-control-color);\n\n .switch__thumb {\n background-color: var(--six-color-white);\n transform: translateX(calc(var(--width) / 2 - var(--thumb-size) / 2 + (var(--thumb-size) - var(--height)) / 2));\n }\n}\n\n// Checked + hover\n.switch.switch--checked:not(.switch--disabled) .switch__control:hover {\n background-color: var(--six-input-border-color-focus);\n}\n\n// Disabled\n.switch--disabled {\n cursor: not-allowed;\n color: var(--six-selection-control-color-disabled);\n\n .switch__control {\n background-color: var(--six-selection-control-color-disabled);\n }\n\n &.switch--checked .switch__control {\n background-color: var(--six-selection-control-color-disabled);\n }\n}\n\n.switch__label {\n line-height: var(--height);\n margin-left: 0.5em;\n user-select: none;\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\nimport FormControl from '../../functional-components/form-control/form-control';\nimport { hasSlot } from '../../utils/slot';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The switch's label.\n * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.\n *\n * @part base - The component's base wrapper.\n * @part control - The switch control.\n * @part thumb - The switch position indicator.\n * @part label - The switch label.\n */\n\n@Component({\n tag: 'six-switch',\n styleUrl: 'six-switch.scss',\n shadow: true,\n})\nexport class SixSwitch {\n private switchId = `switch-${++id}`;\n private labelId = `switch-label-${id}`;\n private errorTextId = `input-error-text-${id}`;\n\n private inputElement?: HTMLInputElement;\n private eventListeners = new EventListeners();\n\n @Element() host!: HTMLSixSwitchElement;\n\n @State() hasFocus = false;\n @State() hasErrorTextSlot = false;\n\n /** The switch's name attribute. */\n @Prop() name = '';\n\n /** The switch's value attribute. */\n @Prop() value = 'on';\n\n /** Set to true to disable the switch. */\n @Prop() disabled = false;\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /** Set to true to draw the switch in a checked state. */\n @Prop({ mutable: true, reflect: true }) checked = false;\n\n /** The label text. */\n @Prop() label = '';\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText: string | string[] = '';\n\n /** The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1 */\n @Prop() errorTextCount?: number;\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n componentWillLoad() {\n this.handleSlotChange();\n }\n\n @Watch('checked')\n handleCheckedChange() {\n if (this.inputElement != null) {\n this.inputElement.checked = this.checked;\n this.checked = this.inputElement.checked;\n }\n }\n\n /** Emitted when the control loses focus. */\n @Event({ eventName: 'six-switch-blur' }) sixBlur!: EventEmitter<boolean>;\n\n /** Emitted when the control's checked state changes. */\n @Event({ eventName: 'six-switch-change' }) sixChange!: EventEmitter<boolean>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-switch-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n connectedCallback() {\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.forward('six-switch-change', 'change', this.host);\n this.eventListeners.forward('six-switch-blur', 'blur', this.host);\n this.eventListeners.forward('six-switch-focus', 'focus', this.host);\n }\n\n disconnectedCallback() {\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.removeAll();\n }\n\n @Watch('errorText')\n @Watch('label')\n handleLabelChange() {\n this.handleSlotChange();\n }\n\n private handleSlotChange = () => {\n this.hasErrorTextSlot = hasSlot(this.host, 'error-text');\n };\n\n /** Sets focus on the switch. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.inputElement?.focus(options);\n }\n\n /** Removes focus from the switch. */\n @Method()\n async removeFocus() {\n this.inputElement?.blur();\n }\n\n private handleClick = () => {\n if (this.inputElement != null) {\n this.checked = this.inputElement.checked;\n this.sixChange.emit(this.checked);\n }\n };\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.sixBlur.emit(this.checked);\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.sixFocus.emit();\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n this.checked = false;\n this.sixChange.emit(this.checked);\n }\n\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n this.checked = true;\n this.sixChange.emit(this.checked);\n }\n };\n\n private handleMouseDown = (event: MouseEvent) => {\n // Prevent clicks on the label from briefly blurring the input\n event.preventDefault();\n this.inputElement?.focus();\n };\n\n render() {\n return (\n <FormControl\n inputId={this.switchId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={false}\n errorTextId={this.errorTextId}\n errorText={this.errorText}\n errorTextCount={this.errorTextCount}\n hasErrorTextSlot={this.hasErrorTextSlot}\n size=\"medium\"\n disabled={this.disabled}\n required={this.required}\n displayError={this.invalid}\n >\n <label\n part=\"base\"\n htmlFor={this.switchId}\n class={{\n switch: true,\n 'switch--checked': this.checked,\n 'switch--disabled': this.disabled,\n 'switch--focused': this.hasFocus,\n }}\n onMouseDown={this.handleMouseDown}\n >\n <span part=\"control\" class=\"switch__control\">\n <span part=\"thumb\" class=\"switch__thumb\" />\n\n <input\n ref={(el) => (this.inputElement = el)}\n id={this.switchId}\n type=\"checkbox\"\n name={this.name}\n value={this.value}\n checked={this.checked}\n disabled={this.disabled}\n required={this.required}\n role=\"switch\"\n aria-checked={this.checked ? 'true' : 'false'}\n aria-labelledby={this.labelId}\n onClick={this.handleClick}\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n onKeyDown={this.handleKeyDown}\n />\n </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xB,mBAAoBZ,KAAKU,SACzB,kBAAmBV,KAAKM,UAE1BsD,YAAa5D,KAAK+B,iBAElBkB,EAAA,QAAApB,IAAA,2CAAM2B,KAAK,UAAUE,MAAM,mBACzBT,EAAA,QAAApB,IAAA,2CAAM2B,KAAK,QAAQE,MAAM,kBAEzBT,EACE,SAAApB,IAAA,2CAAAgC,IAAMC,GAAQ9D,KAAKoB,aAAe0C,EAClClE,GAAII,KAAKC,SACT8D,KAAK,WACLvD,KAAMR,KAAKQ,KACXC,MAAOT,KAAKS,MACZG,QAASZ,KAAKY,QACdF,SAAUV,KAAKU,SACfC,SAAUX,KAAKW,SACfqD,KAAK,SACS,eAAAhE,KAAKY,QAAU,OAAS,QAAO,kBAC5BZ,KAAKE,QACtB+D,QAASjE,KAAKmB,YACd+C,OAAQlE,KAAKuB,WACb4C,QAASnE,KAAKyB,YACd2C,UAAWpE,KAAK2B,iBAIpBsB,EAAA,QAAApB,IAAA,2CAAM2B,KAAK,QAAQ5D,GAAII,KAAKE,QAASwD,MAAM,iBACzCT,EAAA,QAAApB,IAAA,+C","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,h as a,H as s,g as e}from"./p-JoG9I7EO.js";const i=":host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:border-box}.sr-only{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}:host{display:block;font-family:var(--six-font-family)}.tab-panel{border:solid 1px transparent;padding:20px 20px}";let o=0;const r=class{constructor(a){t(this,a);this.componentId=`tab-panel-${++o}`;this.name="";this.active=false}render(){return a(s,{key:"b4c54fb42d68a3462abbd78dda16b1738e81dc57",id:this.host.id||this.componentId,style:{display:this.active?"block":"none"}},a("div",{key:"734645855fb3a875a6a43e46383122ddad15bbb3",part:"base",class:"tab-panel",role:"tabpanel","aria-selected":this.active?"true":"false","aria-hidden":this.active?"false":"true"},a("slot",{key:"1a789d112f5a048ac36f9a7e70208c99fb66c6c9"})))}get host(){return e(this)}};r.style=i;export{r as six_tab_panel};
|
|
2
|
+
//# sourceMappingURL=p-ea3bf68d.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sixRangeCss","id","SixRange","constructor","hostRef","this","inputId","labelId","helpTextId","errorTextId","eventListeners","EventListeners","hasFocus","hasHelpTextSlot","hasErrorTextSlot","hasLabelSlot","hasTooltip","name","value","required","helpText","disabled","label","errorText","invalid","min","max","step","tooltip","tooltipFormatter","toString","handleInput","nativeInput","update","parseFloat","requestAnimationFrame","sixChange","emit","handleBlur","sixBlur","_a","resizeObserver","unobserve","handleFocus","sixFocus","observe","handleSlotChange","hasSlot","host","handleTouchStart","setFocus","handleLabelChange","handleValueChange","connectedCallback","shadowRoot","addEventListener","componentWillLoad","componentDidLoad","ResizeObserver","disconnectedCallback","removeEventListener","removeAll","componentDidUpdate","getMinMax","syncTooltip","Number","_b","options","focus","removeFocus","blur","output","percent","Math","inputWidth","offsetWidth","tooltipWidth","thumbSize","getComputedStyle","getPropertyValue","x","style","transform","marginLeft","isFirefox","navigator","userAgent","toLowerCase","indexOf","updateValue","parsedValue","isNaN","getDefaultValue","calculateColorRunnableTrack","ceil","background","render","h","FormControl","key","size","errorTextCount","displayError","part","class","range","onTouchStart","ref","el","type","onInput","onFocus","onBlur"],"sources":["src/components/six-range/six-range.scss?tag=six-range&encapsulation=shadow","src/components/six-range/six-range.tsx"],"sourcesContent":["@import 'src/global/component';\n@import '../../functional-components/form-control/form-control';\n\n:host {\n --thumb-size: 14px;\n --tooltip-offset-y: 10px;\n --track-color: var(--six-color-web-rock-900);\n --thumb-color: var(--six-color-web-rock-900);\n --track-height: 3px;\n\n display: block;\n}\n\n.range {\n position: relative;\n\n .range__control {\n -webkit-appearance: none;\n width: 100%;\n height: var(--six-input-height-medium);\n background: transparent;\n line-height: var(--six-input-height-medium);\n vertical-align: middle;\n\n &::-webkit-slider-runnable-track {\n width: 100%;\n height: var(--track-height);\n border-radius: 3px;\n border: none;\n }\n\n &::-webkit-slider-thumb {\n border: none;\n width: var(--thumb-size);\n height: var(--thumb-size);\n border-radius: 50%;\n background-color: var(--thumb-color);\n -webkit-appearance: none;\n margin-top: calc(var(--thumb-size) / -2 + var(--track-height) / 2);\n transition:\n var(--six-transition-fast) border-color,\n var(--six-transition-fast) background-color,\n var(--six-transition-fast) color,\n var(--six-transition-fast) box-shadow,\n var(--six-transition-fast) transform;\n cursor: pointer;\n }\n\n &:not(:disabled)::-webkit-slider-thumb:hover {\n background-color: var(--thumb-color);\n }\n\n &:not(:disabled):focus::-webkit-slider-thumb {\n background-color: var(--thumb-color);\n }\n\n &:not(:disabled)::-webkit-slider-thumb:active {\n background-color: var(--thumb-color);\n cursor: grabbing;\n }\n\n // Firefox\n &::-moz-focus-outer {\n border: 0;\n }\n\n &::-moz-range-track {\n width: 100%;\n height: var(--track-height);\n background-color: var(--six-progress-track-color);\n border-radius: 3px;\n border: none;\n }\n\n &::-moz-range-progress {\n height: var(--track-height);\n border-radius: 3px;\n background-color: var(--track-color);\n border: none;\n }\n\n &::-moz-range-thumb {\n border: none;\n height: var(--thumb-size);\n width: var(--thumb-size);\n border-radius: 50%;\n background-color: var(--thumb-color);\n transition:\n var(--six-transition-fast) border-color,\n var(--six-transition-fast) background-color,\n var(--six-transition-fast) color,\n var(--six-transition-fast) box-shadow,\n var(--six-transition-fast) transform;\n cursor: pointer;\n }\n\n &:not(:disabled)::-moz-range-thumb:hover {\n background-color: var(--thumb-color);\n }\n\n &:not(:disabled):focus::-moz-range-thumb {\n background-color: var(--thumb-color);\n }\n\n &:not(:disabled)::-moz-range-thumb:active {\n background-color: var(--thumb-color);\n cursor: grabbing;\n }\n\n // States\n &:focus {\n outline: none;\n }\n\n &:disabled {\n &::-webkit-slider-thumb {\n cursor: not-allowed;\n color: var(--six-color-web-rock-300);\n border-color: var(--six-color-web-rock-300);\n background-color: var(--six-color-web-rock-300);\n }\n\n &::-moz-range-thumb {\n cursor: not-allowed;\n color: var(--six-color-web-rock-300);\n border-color: var(--six-color-web-rock-300);\n background-color: var(--six-color-web-rock-300);\n }\n }\n }\n}\n\n// Tooltip\n.range__tooltip {\n position: absolute;\n z-index: var(--six-z-index-tooltip);\n left: 2px;\n border-radius: var(--six-border-radius-medium);\n background-color: var(--six-color-web-rock-900);\n font-family: var(--six-font-family);\n font-size: var(--six-tooltip-font-size);\n font-weight: var(--six-tooltip-font-weight);\n line-height: var(--six-tooltip-line-height);\n color: var(--six-color-white);\n opacity: 0;\n padding: var(--six-spacing-xxx-small) var(--six-spacing-xx-small);\n transition: var(--six-transition-fast) opacity;\n pointer-events: none;\n\n &::after {\n content: '';\n position: absolute;\n width: 0;\n height: 0;\n left: 50%;\n margin-left: calc(-1 * var(--six-tooltip-arrow-size));\n }\n}\n\n.range--tooltip-visible .range__tooltip {\n opacity: 1;\n}\n\n// Tooltip on top\n.range--tooltip-top .range__tooltip {\n top: calc(-1 * var(--thumb-size) - var(--tooltip-offset-y));\n\n &::after {\n border-top: var(--six-tooltip-arrow-size) solid var(--six-color-web-rock-900);\n border-left: var(--six-tooltip-arrow-size) solid transparent;\n border-right: var(--six-tooltip-arrow-size) solid transparent;\n top: 100%;\n }\n}\n\n// Tooltip on bottom\n.range--tooltip-bottom .range__tooltip {\n bottom: calc(-1 * var(--thumb-size) - var(--tooltip-offset-y));\n\n &::after {\n border-bottom: var(--six-tooltip-arrow-size) solid var(--six-color-web-rock-900);\n border-left: var(--six-tooltip-arrow-size) solid transparent;\n border-right: var(--six-tooltip-arrow-size) solid transparent;\n bottom: 100%;\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport FormControl from '../../functional-components/form-control/form-control';\nimport { hasSlot } from '../../utils/slot';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot label - The input's label. Alternatively, you can use the label prop.\n * @slot help-text - Help text that describes how to use the input. Alternatively, you can use the help-text prop.\n * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.\n *\n * @part base - The component's base wrapper.\n * @part input - The native range input.\n * @part tooltip - The range tooltip.\n */\n@Component({\n tag: 'six-range',\n styleUrl: 'six-range.scss',\n shadow: true,\n})\nexport class SixRange {\n private inputId = `input-${++id}`;\n private labelId = `input-label-${id}`;\n private helpTextId = `input-help-text-${id}`;\n private errorTextId = `input-error-text-${id}`;\n private eventListeners = new EventListeners();\n private resizeObserver?: ResizeObserver;\n\n private output?: HTMLElement;\n private nativeInput?: HTMLInputElement;\n\n @Element() host!: HTMLSixRangeElement;\n\n @State() hasFocus = false;\n @State() hasHelpTextSlot = false;\n @State() hasErrorTextSlot = false;\n @State() hasLabelSlot = false;\n @State() hasTooltip = false;\n\n /** The input's name attribute. */\n @Prop() name = '';\n\n /** The input's value attribute. */\n @Prop({ mutable: true }) value = 0;\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /** The range's help text. Alternatively, you can use the help-text slot. */\n @Prop() helpText = '';\n\n /** Set to true to disable the input. */\n @Prop() disabled = false;\n\n /** The label text. */\n @Prop() label = '';\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText: string | string[] = '';\n\n /** The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1 */\n @Prop() errorTextCount?: number;\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** The input's min attribute. */\n @Prop() min = 0;\n\n /** The input's max attribute. */\n @Prop() max = 100;\n\n /** The input's step attribute. */\n @Prop() step = 1;\n\n /** The preferred placedment of the tooltip. */\n @Prop() tooltip: 'top' | 'bottom' | 'none' = 'top';\n\n /** A function used to format the tooltip's value. */\n @Prop() tooltipFormatter = (value: number) => value.toString();\n\n /** Emitted when the control's value changes. */\n @Event({ eventName: 'six-range-change' }) sixChange!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control loses focus. */\n @Event({ eventName: 'six-range-blur' }) sixBlur!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-range-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n @Watch('label')\n @Watch('errorText')\n @Watch('helpText')\n handleLabelChange() {\n this.handleSlotChange();\n }\n\n @Watch('value')\n @Watch('min')\n @Watch('max')\n handleValueChange() {\n this.update();\n }\n\n connectedCallback() {\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n }\n\n componentWillLoad() {\n this.update();\n this.handleSlotChange();\n }\n\n componentDidLoad() {\n const nativeInput = this.nativeInput;\n if (nativeInput == null) {\n return;\n }\n this.update();\n this.resizeObserver = new ResizeObserver(() => this.update());\n }\n\n disconnectedCallback() {\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.removeAll();\n }\n\n componentDidUpdate() {\n const { min, max } = this.getMinMax();\n this.syncTooltip(min, max, this.value);\n }\n\n private getMinMax() {\n const min = Number(this.min) ?? 0;\n const max = Number(this.max) ?? 0;\n return { min, max };\n }\n\n /** Sets focus on the input. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.nativeInput?.focus(options);\n }\n\n /** Removes focus from the input. */\n @Method()\n async removeFocus() {\n this.nativeInput?.blur();\n }\n\n private handleInput = () => {\n if (this.nativeInput != null) {\n this.update(parseFloat(this.nativeInput.value));\n }\n requestAnimationFrame(() => {\n this.sixChange.emit();\n });\n };\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.hasTooltip = false;\n this.sixBlur.emit();\n if (this.nativeInput != null) {\n this.resizeObserver?.unobserve(this.nativeInput);\n }\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.hasTooltip = true;\n this.sixFocus.emit();\n if (this.nativeInput != null) {\n this.resizeObserver?.observe(this.nativeInput);\n }\n };\n\n private handleSlotChange = () => {\n this.hasHelpTextSlot = hasSlot(this.host, 'help-text');\n this.hasLabelSlot = hasSlot(this.host, 'label');\n this.hasErrorTextSlot = hasSlot(this.host, 'error-text');\n };\n\n private handleTouchStart = () => {\n this.setFocus();\n };\n\n private syncTooltip(min: number, max: number, value: number) {\n if (this.tooltip !== 'none' && this.nativeInput != null && this.output != null) {\n const percent = Math.max(0, (value - min) / (max - min));\n const inputWidth = this.nativeInput.offsetWidth;\n const tooltipWidth = this.output.offsetWidth;\n const thumbSize = getComputedStyle(this.nativeInput).getPropertyValue('--thumb-size');\n const x = `calc(${inputWidth * percent}px - calc(calc(${percent} * ${thumbSize}) - calc(${thumbSize} / 2)))`;\n this.output.style.transform = `translateX(${x})`;\n this.output.style.marginLeft = `-${tooltipWidth / 2}px`;\n }\n }\n\n private isFirefox() {\n return navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n }\n\n private update(updateValue?: number) {\n if (updateValue != null) {\n this.value = updateValue;\n }\n\n const min = Number(this.min) ?? 0;\n const max = Number(this.max) ?? 0;\n let value;\n const parsedValue = parseFloat(this.value as never);\n if (isNaN(parsedValue)) {\n value = this.getDefaultValue(min, max);\n } else {\n value = parsedValue;\n }\n\n if (this.nativeInput != null) {\n // The value may have constraints, so we set the native control's\n // value and sync it back to ensure it adheres to min, max, and step\n // properly.\n this.nativeInput.value = value.toString();\n this.value = parseFloat(this.nativeInput.value);\n } else {\n this.value = value;\n }\n this.calculateColorRunnableTrack(min, max, this.value);\n this.syncTooltip(min, max, this.value);\n }\n\n /**\n * from https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/range#value\n */\n private getDefaultValue(min: number, max: number): number {\n return max < min ? min : min + (max - min) / 2;\n }\n\n /**\n * For Firefox this functionality is not needed because it is supported by standard CSS.\n */\n private calculateColorRunnableTrack(min: number, max: number, value: number) {\n if (!this.isFirefox() && this.nativeInput != null) {\n const percent = Math.ceil(((value - min) / (max - min)) * 100);\n this.nativeInput.style.background =\n '-webkit-linear-gradient(left, var(--track-color) 0%, var(--track-color) ' +\n percent +\n '%, var(--six-color-web-rock-300) ' +\n percent +\n '%)';\n }\n }\n\n render() {\n return (\n <FormControl\n inputId={this.inputId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={this.hasLabelSlot}\n helpTextId={this.helpTextId}\n helpText={this.helpText}\n hasHelpTextSlot={this.hasHelpTextSlot}\n size=\"medium\"\n errorTextId={this.errorTextId}\n errorText={this.errorText}\n hasErrorTextSlot={this.hasErrorTextSlot}\n errorTextCount={this.errorTextCount}\n disabled={this.disabled}\n required={this.required}\n displayError={this.invalid}\n >\n <div\n part=\"base\"\n class={{\n range: true,\n\n // States\n 'range--disabled': this.disabled,\n 'range--focused': this.hasFocus,\n 'range--tooltip-visible': this.hasTooltip,\n 'range--tooltip-top': this.tooltip === 'top',\n 'range--tooltip-bottom': this.tooltip === 'bottom',\n }}\n onTouchStart={this.handleTouchStart}\n >\n <input\n part=\"input\"\n ref={(el) => (this.nativeInput = el)}\n type=\"range\"\n class=\"range__control\"\n name={this.name}\n disabled={this.disabled}\n min={this.min}\n max={this.max}\n step={this.step}\n value={this.value}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n />\n {this.tooltip !== 'none' && (\n <output part=\"tooltip\" ref={(el) => (this.output = el)} class=\"range__tooltip\">\n {this.tooltipFormatter(this.value)}\n </output>\n )}\n </div>\n </FormControl>\n );\n }\n}\n"],"mappings":"qKAAA,MAAMA,EAAc,upNCMpB,IAAIC,EAAK,E,MAqBIC,EAAQ,MALrB,WAAAC,CAAAC,G,kIAMUC,KAAAC,QAAU,WAAWL,IACrBI,KAAAE,QAAU,eAAeN,IACzBI,KAAAG,WAAa,mBAAmBP,IAChCI,KAAAI,YAAc,oBAAoBR,IAClCI,KAAAK,eAAiB,IAAIC,EAQpBN,KAAQO,SAAG,MACXP,KAAeQ,gBAAG,MAClBR,KAAgBS,iBAAG,MACnBT,KAAYU,aAAG,MACfV,KAAUW,WAAG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,IAAA,2CACV7F,QAASD,KAAKC,QACdgB,MAAOjB,KAAKiB,MACZf,QAASF,KAAKE,QACdQ,aAAcV,KAAKU,aACnBP,WAAYH,KAAKG,WACjBY,SAAUf,KAAKe,SACfP,gBAAiBR,KAAKQ,gBACtBuF,KAAK,SACL3F,YAAaJ,KAAKI,YAClBc,UAAWlB,KAAKkB,UAChBT,iBAAkBT,KAAKS,iBACvBuF,eAAgBhG,KAAKgG,eACrBhF,SAAUhB,KAAKgB,SACfF,SAAUd,KAAKc,SACfmF,aAAcjG,KAAKmB,SAEnByE,EAAA,OAAAE,IAAA,2CACEI,KAAK,OACLC,MAAO,CACLC,MAAO,KAGP,kBAAmBpG,KAAKgB,SACxB,iBAAkBhB,KAAKO,SACvB,yBAA0BP,KAAKW,WAC/B,qBAAsBX,KAAKuB,UAAY,MACvC,wBAAyBvB,KAAKuB,UAAY,UAE5C8E,aAAcrG,KAAK4C,kBAEnBgD,EAAA,SAAAE,IAAA,2CACEI,KAAK,QACLI,IAAMC,GAAQvG,KAAK2B,YAAc4E,EACjCC,KAAK,QACLL,MAAM,iBACNvF,KAAMZ,KAAKY,KACXI,SAAUhB,KAAKgB,SACfI,IAAKpB,KAAKoB,IACVC,IAAKrB,KAAKqB,IACVC,KAAMtB,KAAKsB,KACXT,MAAOb,KAAKa,MACZ4F,QAASzG,KAAK0B,YACdgF,QAAS1G,KAAKsC,YACdqE,OAAQ3G,KAAKiC,aAEdjC,KAAKuB,UAAY,QAChBqE,EAAA,UAAAE,IAAA,2CAAQI,KAAK,UAAUI,IAAMC,GAAQvG,KAAKkE,OAASqC,EAAKJ,MAAM,kBAC3DnG,KAAKwB,iBAAiBxB,KAAKa,S","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["sixRangeCss","id","SixRange","constructor","hostRef","this","inputId","labelId","helpTextId","errorTextId","eventListeners","EventListeners","hasFocus","hasHelpTextSlot","hasErrorTextSlot","hasLabelSlot","hasTooltip","name","value","required","helpText","disabled","label","errorText","invalid","min","max","step","tooltip","tooltipFormatter","toString","handleInput","nativeInput","update","parseFloat","requestAnimationFrame","sixChange","emit","handleBlur","sixBlur","_a","resizeObserver","unobserve","handleFocus","sixFocus","observe","handleSlotChange","hasSlot","host","handleTouchStart","setFocus","handleLabelChange","handleValueChange","connectedCallback","shadowRoot","addEventListener","componentWillLoad","componentDidLoad","ResizeObserver","disconnectedCallback","removeEventListener","removeAll","componentDidUpdate","getMinMax","syncTooltip","Number","_b","options","focus","removeFocus","blur","output","percent","Math","inputWidth","offsetWidth","tooltipWidth","thumbSize","getComputedStyle","getPropertyValue","x","style","transform","marginLeft","isFirefox","navigator","userAgent","toLowerCase","indexOf","updateValue","parsedValue","isNaN","getDefaultValue","calculateColorRunnableTrack","ceil","background","render","h","FormControl","key","size","errorTextCount","displayError","part","class","range","onTouchStart","ref","el","type","onInput","onFocus","onBlur"],"sources":["src/components/six-range/six-range.scss?tag=six-range&encapsulation=shadow","src/components/six-range/six-range.tsx"],"sourcesContent":["@import '../../../src/global/component';\n@import '../../functional-components/form-control/form-control';\n\n:host {\n --thumb-size: 14px;\n --tooltip-offset-y: 10px;\n --track-color: var(--six-color-web-rock-900);\n --thumb-color: var(--six-color-web-rock-900);\n --track-height: 3px;\n\n display: block;\n}\n\n.range {\n position: relative;\n\n .range__control {\n -webkit-appearance: none;\n width: 100%;\n height: var(--six-input-height-medium);\n background: transparent;\n line-height: var(--six-input-height-medium);\n vertical-align: middle;\n\n &::-webkit-slider-runnable-track {\n width: 100%;\n height: var(--track-height);\n border-radius: 3px;\n border: none;\n }\n\n &::-webkit-slider-thumb {\n border: none;\n width: var(--thumb-size);\n height: var(--thumb-size);\n border-radius: 50%;\n background-color: var(--thumb-color);\n -webkit-appearance: none;\n margin-top: calc(var(--thumb-size) / -2 + var(--track-height) / 2);\n transition:\n var(--six-transition-fast) border-color,\n var(--six-transition-fast) background-color,\n var(--six-transition-fast) color,\n var(--six-transition-fast) box-shadow,\n var(--six-transition-fast) transform;\n cursor: pointer;\n }\n\n &:not(:disabled)::-webkit-slider-thumb:hover {\n background-color: var(--thumb-color);\n }\n\n &:not(:disabled):focus::-webkit-slider-thumb {\n background-color: var(--thumb-color);\n }\n\n &:not(:disabled)::-webkit-slider-thumb:active {\n background-color: var(--thumb-color);\n cursor: grabbing;\n }\n\n // Firefox\n &::-moz-focus-outer {\n border: 0;\n }\n\n &::-moz-range-track {\n width: 100%;\n height: var(--track-height);\n background-color: var(--six-progress-track-color);\n border-radius: 3px;\n border: none;\n }\n\n &::-moz-range-progress {\n height: var(--track-height);\n border-radius: 3px;\n background-color: var(--track-color);\n border: none;\n }\n\n &::-moz-range-thumb {\n border: none;\n height: var(--thumb-size);\n width: var(--thumb-size);\n border-radius: 50%;\n background-color: var(--thumb-color);\n transition:\n var(--six-transition-fast) border-color,\n var(--six-transition-fast) background-color,\n var(--six-transition-fast) color,\n var(--six-transition-fast) box-shadow,\n var(--six-transition-fast) transform;\n cursor: pointer;\n }\n\n &:not(:disabled)::-moz-range-thumb:hover {\n background-color: var(--thumb-color);\n }\n\n &:not(:disabled):focus::-moz-range-thumb {\n background-color: var(--thumb-color);\n }\n\n &:not(:disabled)::-moz-range-thumb:active {\n background-color: var(--thumb-color);\n cursor: grabbing;\n }\n\n // States\n &:focus {\n outline: none;\n }\n\n &:disabled {\n &::-webkit-slider-thumb {\n cursor: not-allowed;\n color: var(--six-color-web-rock-300);\n border-color: var(--six-color-web-rock-300);\n background-color: var(--six-color-web-rock-300);\n }\n\n &::-moz-range-thumb {\n cursor: not-allowed;\n color: var(--six-color-web-rock-300);\n border-color: var(--six-color-web-rock-300);\n background-color: var(--six-color-web-rock-300);\n }\n }\n }\n}\n\n// Tooltip\n.range__tooltip {\n position: absolute;\n z-index: var(--six-z-index-tooltip);\n left: 2px;\n border-radius: var(--six-border-radius-medium);\n background-color: var(--six-color-web-rock-900);\n font-family: var(--six-font-family);\n font-size: var(--six-tooltip-font-size);\n font-weight: var(--six-tooltip-font-weight);\n line-height: var(--six-tooltip-line-height);\n color: var(--six-color-white);\n opacity: 0;\n padding: var(--six-spacing-xxx-small) var(--six-spacing-xx-small);\n transition: var(--six-transition-fast) opacity;\n pointer-events: none;\n\n &::after {\n content: '';\n position: absolute;\n width: 0;\n height: 0;\n left: 50%;\n margin-left: calc(-1 * var(--six-tooltip-arrow-size));\n }\n}\n\n.range--tooltip-visible .range__tooltip {\n opacity: 1;\n}\n\n// Tooltip on top\n.range--tooltip-top .range__tooltip {\n top: calc(-1 * var(--thumb-size) - var(--tooltip-offset-y));\n\n &::after {\n border-top: var(--six-tooltip-arrow-size) solid var(--six-color-web-rock-900);\n border-left: var(--six-tooltip-arrow-size) solid transparent;\n border-right: var(--six-tooltip-arrow-size) solid transparent;\n top: 100%;\n }\n}\n\n// Tooltip on bottom\n.range--tooltip-bottom .range__tooltip {\n bottom: calc(-1 * var(--thumb-size) - var(--tooltip-offset-y));\n\n &::after {\n border-bottom: var(--six-tooltip-arrow-size) solid var(--six-color-web-rock-900);\n border-left: var(--six-tooltip-arrow-size) solid transparent;\n border-right: var(--six-tooltip-arrow-size) solid transparent;\n bottom: 100%;\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport FormControl from '../../functional-components/form-control/form-control';\nimport { hasSlot } from '../../utils/slot';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot label - The input's label. Alternatively, you can use the label prop.\n * @slot help-text - Help text that describes how to use the input. Alternatively, you can use the help-text prop.\n * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.\n *\n * @part base - The component's base wrapper.\n * @part input - The native range input.\n * @part tooltip - The range tooltip.\n */\n@Component({\n tag: 'six-range',\n styleUrl: 'six-range.scss',\n shadow: true,\n})\nexport class SixRange {\n private inputId = `input-${++id}`;\n private labelId = `input-label-${id}`;\n private helpTextId = `input-help-text-${id}`;\n private errorTextId = `input-error-text-${id}`;\n private eventListeners = new EventListeners();\n private resizeObserver?: ResizeObserver;\n\n private output?: HTMLElement;\n private nativeInput?: HTMLInputElement;\n\n @Element() host!: HTMLSixRangeElement;\n\n @State() hasFocus = false;\n @State() hasHelpTextSlot = false;\n @State() hasErrorTextSlot = false;\n @State() hasLabelSlot = false;\n @State() hasTooltip = false;\n\n /** The input's name attribute. */\n @Prop() name = '';\n\n /** The input's value attribute. */\n @Prop({ mutable: true }) value = 0;\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /** The range's help text. Alternatively, you can use the help-text slot. */\n @Prop() helpText = '';\n\n /** Set to true to disable the input. */\n @Prop() disabled = false;\n\n /** The label text. */\n @Prop() label = '';\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText: string | string[] = '';\n\n /** The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1 */\n @Prop() errorTextCount?: number;\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** The input's min attribute. */\n @Prop() min = 0;\n\n /** The input's max attribute. */\n @Prop() max = 100;\n\n /** The input's step attribute. */\n @Prop() step = 1;\n\n /** The preferred placedment of the tooltip. */\n @Prop() tooltip: 'top' | 'bottom' | 'none' = 'top';\n\n /** A function used to format the tooltip's value. */\n @Prop() tooltipFormatter = (value: number) => value.toString();\n\n /** Emitted when the control's value changes. */\n @Event({ eventName: 'six-range-change' }) sixChange!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control loses focus. */\n @Event({ eventName: 'six-range-blur' }) sixBlur!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-range-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n @Watch('label')\n @Watch('errorText')\n @Watch('helpText')\n handleLabelChange() {\n this.handleSlotChange();\n }\n\n @Watch('value')\n @Watch('min')\n @Watch('max')\n handleValueChange() {\n this.update();\n }\n\n connectedCallback() {\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n }\n\n componentWillLoad() {\n this.update();\n this.handleSlotChange();\n }\n\n componentDidLoad() {\n const nativeInput = this.nativeInput;\n if (nativeInput == null) {\n return;\n }\n this.update();\n this.resizeObserver = new ResizeObserver(() => this.update());\n }\n\n disconnectedCallback() {\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.removeAll();\n }\n\n componentDidUpdate() {\n const { min, max } = this.getMinMax();\n this.syncTooltip(min, max, this.value);\n }\n\n private getMinMax() {\n const min = Number(this.min) ?? 0;\n const max = Number(this.max) ?? 0;\n return { min, max };\n }\n\n /** Sets focus on the input. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.nativeInput?.focus(options);\n }\n\n /** Removes focus from the input. */\n @Method()\n async removeFocus() {\n this.nativeInput?.blur();\n }\n\n private handleInput = () => {\n if (this.nativeInput != null) {\n this.update(parseFloat(this.nativeInput.value));\n }\n requestAnimationFrame(() => {\n this.sixChange.emit();\n });\n };\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.hasTooltip = false;\n this.sixBlur.emit();\n if (this.nativeInput != null) {\n this.resizeObserver?.unobserve(this.nativeInput);\n }\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.hasTooltip = true;\n this.sixFocus.emit();\n if (this.nativeInput != null) {\n this.resizeObserver?.observe(this.nativeInput);\n }\n };\n\n private handleSlotChange = () => {\n this.hasHelpTextSlot = hasSlot(this.host, 'help-text');\n this.hasLabelSlot = hasSlot(this.host, 'label');\n this.hasErrorTextSlot = hasSlot(this.host, 'error-text');\n };\n\n private handleTouchStart = () => {\n this.setFocus();\n };\n\n private syncTooltip(min: number, max: number, value: number) {\n if (this.tooltip !== 'none' && this.nativeInput != null && this.output != null) {\n const percent = Math.max(0, (value - min) / (max - min));\n const inputWidth = this.nativeInput.offsetWidth;\n const tooltipWidth = this.output.offsetWidth;\n const thumbSize = getComputedStyle(this.nativeInput).getPropertyValue('--thumb-size');\n const x = `calc(${inputWidth * percent}px - calc(calc(${percent} * ${thumbSize}) - calc(${thumbSize} / 2)))`;\n this.output.style.transform = `translateX(${x})`;\n this.output.style.marginLeft = `-${tooltipWidth / 2}px`;\n }\n }\n\n private isFirefox() {\n return navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n }\n\n private update(updateValue?: number) {\n if (updateValue != null) {\n this.value = updateValue;\n }\n\n const min = Number(this.min) ?? 0;\n const max = Number(this.max) ?? 0;\n let value;\n const parsedValue = parseFloat(this.value as never);\n if (isNaN(parsedValue)) {\n value = this.getDefaultValue(min, max);\n } else {\n value = parsedValue;\n }\n\n if (this.nativeInput != null) {\n // The value may have constraints, so we set the native control's\n // value and sync it back to ensure it adheres to min, max, and step\n // properly.\n this.nativeInput.value = value.toString();\n this.value = parseFloat(this.nativeInput.value);\n } else {\n this.value = value;\n }\n this.calculateColorRunnableTrack(min, max, this.value);\n this.syncTooltip(min, max, this.value);\n }\n\n /**\n * from https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/range#value\n */\n private getDefaultValue(min: number, max: number): number {\n return max < min ? min : min + (max - min) / 2;\n }\n\n /**\n * For Firefox this functionality is not needed because it is supported by standard CSS.\n */\n private calculateColorRunnableTrack(min: number, max: number, value: number) {\n if (!this.isFirefox() && this.nativeInput != null) {\n const percent = Math.ceil(((value - min) / (max - min)) * 100);\n this.nativeInput.style.background =\n '-webkit-linear-gradient(left, var(--track-color) 0%, var(--track-color) ' +\n percent +\n '%, var(--six-color-web-rock-300) ' +\n percent +\n '%)';\n }\n }\n\n render() {\n return (\n <FormControl\n inputId={this.inputId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={this.hasLabelSlot}\n helpTextId={this.helpTextId}\n helpText={this.helpText}\n hasHelpTextSlot={this.hasHelpTextSlot}\n size=\"medium\"\n errorTextId={this.errorTextId}\n errorText={this.errorText}\n hasErrorTextSlot={this.hasErrorTextSlot}\n errorTextCount={this.errorTextCount}\n disabled={this.disabled}\n required={this.required}\n displayError={this.invalid}\n >\n <div\n part=\"base\"\n class={{\n range: true,\n\n // States\n 'range--disabled': this.disabled,\n 'range--focused': this.hasFocus,\n 'range--tooltip-visible': this.hasTooltip,\n 'range--tooltip-top': this.tooltip === 'top',\n 'range--tooltip-bottom': this.tooltip === 'bottom',\n }}\n onTouchStart={this.handleTouchStart}\n >\n <input\n part=\"input\"\n ref={(el) => (this.nativeInput = el)}\n type=\"range\"\n class=\"range__control\"\n name={this.name}\n disabled={this.disabled}\n min={this.min}\n max={this.max}\n step={this.step}\n value={this.value}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n />\n {this.tooltip !== 'none' && (\n <output part=\"tooltip\" ref={(el) => (this.output = el)} class=\"range__tooltip\">\n {this.tooltipFormatter(this.value)}\n </output>\n )}\n </div>\n </FormControl>\n );\n }\n}\n"],"mappings":"qKAAA,MAAMA,EAAc,upNCMpB,IAAIC,EAAK,E,MAqBIC,EAAQ,MALrB,WAAAC,CAAAC,G,kIAMUC,KAAAC,QAAU,WAAWL,IACrBI,KAAAE,QAAU,eAAeN,IACzBI,KAAAG,WAAa,mBAAmBP,IAChCI,KAAAI,YAAc,oBAAoBR,IAClCI,KAAAK,eAAiB,IAAIC,EAQpBN,KAAQO,SAAG,MACXP,KAAeQ,gBAAG,MAClBR,KAAgBS,iBAAG,MACnBT,KAAYU,aAAG,MACfV,KAAUW,WAAG,MAGdX,KAAIY,KAAG,GAGUZ,KAAKa,MAAG,EAGzBb,KAAQc,SAAG,MAGXd,KAAQe,SAAG,GAGXf,KAAQgB,SAAG,MAGXhB,KAAKiB,MAAG,GAGRjB,KAASkB,UAAsB,GAMdlB,KAAOmB,QAAG,MAG3BnB,KAAGoB,IAAG,EAGNpB,KAAGqB,IAAG,IAGNrB,KAAIsB,KAAG,EAGPtB,KAAOuB,QAA8B,MAGrCvB,KAAgBwB,iBAAIX,GAAkBA,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,SAAUd,KAAKc,SACfmF,aAAcjG,KAAKmB,SAEnByE,EAAA,OAAAE,IAAA,2CACEI,KAAK,OACLC,MAAO,CACLC,MAAO,KAGP,kBAAmBpG,KAAKgB,SACxB,iBAAkBhB,KAAKO,SACvB,yBAA0BP,KAAKW,WAC/B,qBAAsBX,KAAKuB,UAAY,MACvC,wBAAyBvB,KAAKuB,UAAY,UAE5C8E,aAAcrG,KAAK4C,kBAEnBgD,EAAA,SAAAE,IAAA,2CACEI,KAAK,QACLI,IAAMC,GAAQvG,KAAK2B,YAAc4E,EACjCC,KAAK,QACLL,MAAM,iBACNvF,KAAMZ,KAAKY,KACXI,SAAUhB,KAAKgB,SACfI,IAAKpB,KAAKoB,IACVC,IAAKrB,KAAKqB,IACVC,KAAMtB,KAAKsB,KACXT,MAAOb,KAAKa,MACZ4F,QAASzG,KAAK0B,YACdgF,QAAS1G,KAAKsC,YACdqE,OAAQ3G,KAAKiC,aAEdjC,KAAKuB,UAAY,QAChBqE,EAAA,UAAAE,IAAA,2CAAQI,KAAK,UAAUI,IAAMC,GAAQvG,KAAKkE,OAASqC,EAAKJ,MAAM,kBAC3DnG,KAAKwB,iBAAiBxB,KAAKa,S","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as a,c as i,h as r}from"./p-JoG9I7EO.js";import{a as s}from"./p-j3oIB5oT.js";import{a as t}from"./p-CKhg9ibv.js";const o=":host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:border-box}.sr-only{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}:host{display:inline-block;overflow:hidden}.tag{display:flex;align-items:center;border:solid 1px;font-family:var(--six-font-family);line-height:1;white-space:nowrap;user-select:none;cursor:default}.tag__content{text-overflow:ellipsis;overflow:hidden}.tag__clear::part(base){color:inherit;padding:0}.tag--info{color:var(--six-color-white);background-color:var(--six-color-web-rock-900);border-color:var(--six-color-web-rock-900)}.tag--success{color:var(--six-color-web-rock-900);border-color:var(--six-color-success-500);background-color:var(--six-color-success-500)}.tag--primary{color:var(--six-color-web-rock-900);border-color:var(--six-color-clay-50);background-color:var(--six-color-clay-50)}.tag--warning{color:var(--six-color-web-rock-900);border-color:var(--six-color-warning-700);background-color:var(--six-color-warning-700)}.tag--danger{color:var(--six-color-white);border-color:var(--six-color-danger-800);background-color:var(--six-color-danger-800)}.tag--action{color:var(--six-color-white);border-color:var(--six-color-action-500);background-color:var(--six-color-action-500)}.tag--small{font-size:var(--six-button-font-size-small);height:calc(var(--six-height-small) * 0.8);line-height:calc(var(--six-height-small) - var(--six-border-width) * 2);border-radius:var(--six-input-border-radius-small);padding:0 var(--six-spacing-x-small)}.tag--small .tag__clear{margin-left:var(--six-spacing-xx-small);margin-right:calc(-1 * var(--six-spacing-xxx-small))}.tag--medium{font-size:var(--six-button-font-size-medium);height:calc(var(--six-height-medium) * 0.8);line-height:calc(var(--six-height-medium) - var(--six-border-width) * 2);border-radius:var(--six-input-border-radius-medium);padding:0 var(--six-spacing-small)}.tag--medium .tag__clear{margin-left:var(--six-spacing-xx-small);margin-right:calc(-1 * var(--six-spacing-xx-small))}.tag--large{font-size:var(--six-button-font-size-large);height:calc(var(--six-height-large) * 0.8);line-height:calc(var(--six-height-large) - var(--six-border-width) * 2);border-radius:var(--six-input-border-radius-large);padding:0 var(--six-spacing-medium)}.tag--large .tag__clear{margin-left:var(--six-spacing-xx-small);margin-right:calc(-1 * var(--six-spacing-x-small))}.tag--pill{border-radius:var(--six-border-radius-pill)}";const e=class{constructor(r){a(this,r);this.sixClear=i(this,"six-tag-clear");this.type="primary";this.size="medium";this.pill=false;this.clearable=false;this.resizeObserver=new ResizeObserver(t((()=>this.updateTooltip())));this.updateTooltip=()=>{if(this.tooltipElement!=null&&this.contentSlotElement!=null&&this.contentElement!=null){this.tooltipElement.content=s(this.contentSlotElement);this.tooltipElement.disabled=!(this.contentElement.offsetWidth<this.contentElement.scrollWidth)}};this.handleClearClick=()=>{this.sixClear.emit()}}connectedCallback(){if(this.contentElement!=null){this.resizeObserver.observe(this.contentElement)}}componentDidLoad(){if(this.contentElement!=null){this.resizeObserver.observe(this.contentElement)}}disconnectedCallback(){this.resizeObserver.disconnect()}render(){return r("span",{key:"
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as a,c as i,h as r}from"./p-JoG9I7EO.js";import{a as s}from"./p-j3oIB5oT.js";import{a as t}from"./p-CKhg9ibv.js";const o=":host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:border-box}.sr-only{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}:host{display:inline-block;overflow:hidden}.tag{display:flex;align-items:center;border:solid 1px;font-family:var(--six-font-family);line-height:1;white-space:nowrap;user-select:none;cursor:default}.tag__content{text-overflow:ellipsis;overflow:hidden}.tag__clear::part(base){color:inherit;padding:0}.tag--info{color:var(--six-color-white);background-color:var(--six-color-web-rock-900);border-color:var(--six-color-web-rock-900)}.tag--success{color:var(--six-color-web-rock-900);border-color:var(--six-color-success-500);background-color:var(--six-color-success-500)}.tag--primary{color:var(--six-color-web-rock-900);border-color:var(--six-color-clay-50);background-color:var(--six-color-clay-50)}.tag--warning{color:var(--six-color-web-rock-900);border-color:var(--six-color-warning-700);background-color:var(--six-color-warning-700)}.tag--danger{color:var(--six-color-white);border-color:var(--six-color-danger-800);background-color:var(--six-color-danger-800)}.tag--action{color:var(--six-color-white);border-color:var(--six-color-action-500);background-color:var(--six-color-action-500)}.tag--small{font-size:var(--six-button-font-size-small);height:calc(var(--six-height-small) * 0.8);line-height:calc(var(--six-height-small) - var(--six-border-width) * 2);border-radius:var(--six-input-border-radius-small);padding:0 var(--six-spacing-x-small)}.tag--small .tag__clear{margin-left:var(--six-spacing-xx-small);margin-right:calc(-1 * var(--six-spacing-xxx-small))}.tag--medium{font-size:var(--six-button-font-size-medium);height:calc(var(--six-height-medium) * 0.8);line-height:calc(var(--six-height-medium) - var(--six-border-width) * 2);border-radius:var(--six-input-border-radius-medium);padding:0 var(--six-spacing-small)}.tag--medium .tag__clear{margin-left:var(--six-spacing-xx-small);margin-right:calc(-1 * var(--six-spacing-xx-small))}.tag--large{font-size:var(--six-button-font-size-large);height:calc(var(--six-height-large) * 0.8);line-height:calc(var(--six-height-large) - var(--six-border-width) * 2);border-radius:var(--six-input-border-radius-large);padding:0 var(--six-spacing-medium)}.tag--large .tag__clear{margin-left:var(--six-spacing-xx-small);margin-right:calc(-1 * var(--six-spacing-x-small))}.tag--pill{border-radius:var(--six-border-radius-pill)}";const e=class{constructor(r){a(this,r);this.sixClear=i(this,"six-tag-clear");this.type="primary";this.size="medium";this.pill=false;this.clearable=false;this.resizeObserver=new ResizeObserver(t((()=>this.updateTooltip())));this.updateTooltip=()=>{if(this.tooltipElement!=null&&this.contentSlotElement!=null&&this.contentElement!=null){this.tooltipElement.content=s(this.contentSlotElement);this.tooltipElement.disabled=!(this.contentElement.offsetWidth<this.contentElement.scrollWidth)}};this.handleClearClick=()=>{this.sixClear.emit()}}connectedCallback(){if(this.contentElement!=null){this.resizeObserver.observe(this.contentElement)}}componentDidLoad(){if(this.contentElement!=null){this.resizeObserver.observe(this.contentElement)}}disconnectedCallback(){this.resizeObserver.disconnect()}render(){return r("span",{key:"e8a2448511ebcfa91f9714c1e575679fca929310",part:"base",class:{tag:true,"tag--primary":this.type==="primary","tag--success":this.type==="success","tag--info":this.type==="info","tag--warning":this.type==="warning","tag--danger":this.type==="danger","tag--action":this.type==="action","tag--text":this.type==="text","tag--small":this.size==="small","tag--medium":this.size==="medium","tag--large":this.size==="large","tag--pill":this.pill,"tag--clear":this.clearable}},r("six-tooltip",{key:"a8bffabc14f61bff5f499cd9324cb17497a6082b",ref:a=>this.tooltipElement=a},r("span",{key:"28a60248833682018fa9f11be5d02372893645e5",ref:a=>this.contentElement=a,part:"content",class:"tag__content"},r("slot",{key:"d47d95687a69a4822575ac3219872a51f445441d",ref:a=>this.contentSlotElement=a}))),this.clearable&&r("six-icon-button",{key:"477d12d125ff90d1cc0adb2bb62bf11bc6510927",exportparts:"base:clear-button",size:"xSmall",name:"clear",class:"tag__clear",onClick:this.handleClearClick}))}};e.style=o;export{e as six_tag};
|
|
2
|
+
//# sourceMappingURL=p-f54d3616.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as i,h as e}from"./p-JoG9I7EO.js";const s=":host{display:block}a{text-decoration:none;display:block}.sidebar-item{padding:var(--six-spacing-small) var(--six-spacing-medium);color:var(--six-sidebar-color);cursor:pointer;font-family:var(--six-font-family);margin-left:var(--six-spacing-xx-small);display:flex;align-items:center}.sidebar-item:hover:not(.sidebar-item--disabled){color:var(--six-color-web-rock-600)}.sidebar-item.sidebar-item--disabled{outline:none;color:var(--six-input-color-disabled);cursor:not-allowed}.sidebar-item.sidebar-item--selected{font-weight:var(--six-font-weight-bold)}.sidebar-item:focus{outline:none}.sidebar-item:focus-visible{outline:var(--six-focus-ring);outline-offset:var(--six-focus-ring-offset)}.six-sidebar-item__icon{margin-right:var(--six-spacing-medium)}";const a=class{constructor(e){i(this,e);this.value="";this.selected=false;this.disabled=false;this.icon=""}render(){const i=this.href!=null?"a":"div";return e(i,{key:"
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as i,h as e}from"./p-JoG9I7EO.js";const s=":host{display:block}a{text-decoration:none;display:block}.sidebar-item{padding:var(--six-spacing-small) var(--six-spacing-medium);color:var(--six-sidebar-color);cursor:pointer;font-family:var(--six-font-family);margin-left:var(--six-spacing-xx-small);display:flex;align-items:center}.sidebar-item:hover:not(.sidebar-item--disabled){color:var(--six-color-web-rock-600)}.sidebar-item.sidebar-item--disabled{outline:none;color:var(--six-input-color-disabled);cursor:not-allowed}.sidebar-item.sidebar-item--selected{font-weight:var(--six-font-weight-bold)}.sidebar-item:focus{outline:none}.sidebar-item:focus-visible{outline:var(--six-focus-ring);outline-offset:var(--six-focus-ring-offset)}.six-sidebar-item__icon{margin-right:var(--six-spacing-medium)}";const a=class{constructor(e){i(this,e);this.value="";this.selected=false;this.disabled=false;this.icon=""}render(){const i=this.href!=null?"a":"div";return e(i,{key:"968d681e125a0c399973cfa9d37ac5f9c269042f",class:{"sidebar-item":true,"sidebar-item--selected":this.selected,"sidebar-item--disabled":this.disabled},role:"menuitem",href:this.href,"aria-selected":this.selected?"true":"false","aria-disabled":this.disabled?"true":"false"},this.icon&&e("six-icon",{key:"cd6ecec3465b0aeb625d3f0d0e7f8f6a8e76a25f",class:"six-sidebar-item__icon"},this.icon),e("slot",{key:"a54998cb6bc27463ab2f9402736008a8767b8358"}))}};a.style=s;export{a as six_sidebar_item};
|
|
2
|
+
//# sourceMappingURL=p-f6a1c20b.entry.js.map
|