@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.
Files changed (152) hide show
  1. package/dist/cjs/index-C8rK7OAe.js +4 -0
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/six-date.cjs.entry.js +38 -33
  4. package/dist/cjs/six-date.cjs.entry.js.map +1 -1
  5. package/dist/cjs/six-date.entry.cjs.js.map +1 -1
  6. package/dist/cjs/six-datepicker.cjs.entry.js +3 -3
  7. package/dist/cjs/six-datepicker.cjs.entry.js.map +1 -1
  8. package/dist/cjs/six-datepicker.entry.cjs.js.map +1 -1
  9. package/dist/cjs/six-range.cjs.entry.js.map +1 -1
  10. package/dist/cjs/six-range.entry.cjs.js.map +1 -1
  11. package/dist/cjs/six-rating.cjs.entry.js +126 -0
  12. package/dist/cjs/six-rating.cjs.entry.js.map +1 -0
  13. package/dist/cjs/six-rating.entry.cjs.js.map +1 -0
  14. package/dist/cjs/six-root.cjs.entry.js +1 -1
  15. package/dist/cjs/six-sidebar-item.cjs.entry.js +2 -2
  16. package/dist/cjs/six-sidebar.cjs.entry.js +2 -2
  17. package/dist/cjs/six-switch.cjs.entry.js +2 -2
  18. package/dist/cjs/six-switch.cjs.entry.js.map +1 -1
  19. package/dist/cjs/six-switch.entry.cjs.js.map +1 -1
  20. package/dist/cjs/six-tab-panel.cjs.entry.js +1 -1
  21. package/dist/cjs/six-tab.cjs.entry.js +2 -2
  22. package/dist/cjs/six-tag.cjs.entry.js +2 -2
  23. package/dist/cjs/six-textarea.cjs.entry.js +2 -2
  24. package/dist/cjs/six-tile.cjs.entry.js +5 -5
  25. package/dist/cjs/six-timepicker.cjs.entry.js +17 -9
  26. package/dist/cjs/six-timepicker.cjs.entry.js.map +1 -1
  27. package/dist/cjs/six-timepicker.entry.cjs.js.map +1 -1
  28. package/dist/cjs/six-tooltip.cjs.entry.js +2 -2
  29. package/dist/cjs/ui-library.cjs.js +1 -1
  30. package/dist/collection/collection-manifest.json +1 -0
  31. package/dist/collection/components/six-date/iso-date.js +32 -0
  32. package/dist/collection/components/six-date/iso-date.js.map +1 -1
  33. package/dist/collection/components/six-date/six-date.js +7 -34
  34. package/dist/collection/components/six-date/six-date.js.map +1 -1
  35. package/dist/collection/components/six-datepicker/six-datepicker.js +4 -4
  36. package/dist/collection/components/six-datepicker/six-datepicker.js.map +1 -1
  37. package/dist/collection/components/six-rating/six-rating.css +125 -0
  38. package/dist/collection/components/six-rating/six-rating.js +432 -0
  39. package/dist/collection/components/six-rating/six-rating.js.map +1 -0
  40. package/dist/collection/components/six-root/six-root.js +1 -1
  41. package/dist/collection/components/six-sidebar/six-sidebar.js +2 -2
  42. package/dist/collection/components/six-sidebar-item/six-sidebar-item.js +2 -2
  43. package/dist/collection/components/six-switch/six-switch.js +2 -2
  44. package/dist/collection/components/six-tab/six-tab.js +2 -2
  45. package/dist/collection/components/six-tab-panel/six-tab-panel.js +1 -1
  46. package/dist/collection/components/six-tag/six-tag.js +2 -2
  47. package/dist/collection/components/six-textarea/six-textarea.js +2 -2
  48. package/dist/collection/components/six-tile/six-tile.js +5 -5
  49. package/dist/collection/components/six-timepicker/six-timepicker.js +17 -9
  50. package/dist/collection/components/six-timepicker/six-timepicker.js.map +1 -1
  51. package/dist/collection/components/six-tooltip/six-tooltip.js +2 -2
  52. package/dist/components/index.js +2 -0
  53. package/dist/components/index.js.map +1 -1
  54. package/dist/components/{p-DnLdSdN5.js → p-CAJFkiLw.js} +19 -11
  55. package/dist/components/p-CAJFkiLw.js.map +1 -0
  56. package/dist/components/{p-Cs6mMfx-.js → p-ClylOmYH.js} +4 -4
  57. package/dist/components/{p-Cs6mMfx-.js.map → p-ClylOmYH.js.map} +1 -1
  58. package/dist/components/six-date.js +38 -33
  59. package/dist/components/six-date.js.map +1 -1
  60. package/dist/components/six-datepicker.js +4 -4
  61. package/dist/components/six-datepicker.js.map +1 -1
  62. package/dist/components/six-range.js.map +1 -1
  63. package/dist/components/six-rating.d.ts +11 -0
  64. package/dist/components/six-rating.js +173 -0
  65. package/dist/components/six-rating.js.map +1 -0
  66. package/dist/components/six-root.js +1 -1
  67. package/dist/components/six-sidebar-item.js +2 -2
  68. package/dist/components/six-sidebar.js +2 -2
  69. package/dist/components/six-switch.js +2 -2
  70. package/dist/components/six-switch.js.map +1 -1
  71. package/dist/components/six-tab-panel.js +1 -1
  72. package/dist/components/six-tab.js +2 -2
  73. package/dist/components/six-tag.js +3 -3
  74. package/dist/components/six-textarea.js +2 -2
  75. package/dist/components/six-tile.js +6 -6
  76. package/dist/components/six-timepicker.js +1 -1
  77. package/dist/components/six-tooltip.js +1 -1
  78. package/dist/components.json +471 -4
  79. package/dist/esm/index-JoG9I7EO.js +4 -0
  80. package/dist/esm/loader.js +1 -1
  81. package/dist/esm/six-date.entry.js +38 -33
  82. package/dist/esm/six-date.entry.js.map +1 -1
  83. package/dist/esm/six-datepicker.entry.js +3 -3
  84. package/dist/esm/six-datepicker.entry.js.map +1 -1
  85. package/dist/esm/six-range.entry.js.map +1 -1
  86. package/dist/esm/six-rating.entry.js +124 -0
  87. package/dist/esm/six-rating.entry.js.map +1 -0
  88. package/dist/esm/six-root.entry.js +1 -1
  89. package/dist/esm/six-sidebar-item.entry.js +2 -2
  90. package/dist/esm/six-sidebar.entry.js +2 -2
  91. package/dist/esm/six-switch.entry.js +2 -2
  92. package/dist/esm/six-switch.entry.js.map +1 -1
  93. package/dist/esm/six-tab-panel.entry.js +1 -1
  94. package/dist/esm/six-tab.entry.js +2 -2
  95. package/dist/esm/six-tag.entry.js +2 -2
  96. package/dist/esm/six-textarea.entry.js +2 -2
  97. package/dist/esm/six-tile.entry.js +5 -5
  98. package/dist/esm/six-timepicker.entry.js +17 -9
  99. package/dist/esm/six-timepicker.entry.js.map +1 -1
  100. package/dist/esm/six-tooltip.entry.js +2 -2
  101. package/dist/esm/ui-library.js +1 -1
  102. package/dist/types/components/six-date/iso-date.d.ts +2 -0
  103. package/dist/types/components/six-datepicker/six-datepicker.d.ts +1 -1
  104. package/dist/types/components/six-rating/six-rating.d.ts +52 -0
  105. package/dist/types/components.d.ts +164 -4
  106. package/dist/ui-library/{p-01243b2e.entry.js → p-03ca4af8.entry.js} +2 -2
  107. package/dist/ui-library/p-12e7a9e1.entry.js +2 -0
  108. package/dist/ui-library/p-12e7a9e1.entry.js.map +1 -0
  109. package/dist/ui-library/{p-362ff192.entry.js → p-21cbccb1.entry.js} +2 -2
  110. package/dist/ui-library/p-38c51fd1.entry.js +2 -0
  111. package/dist/ui-library/p-38c51fd1.entry.js.map +1 -0
  112. package/dist/ui-library/p-39668d61.entry.js +2 -0
  113. package/dist/ui-library/p-39668d61.entry.js.map +1 -0
  114. package/dist/ui-library/{p-ea61b009.entry.js → p-6c8182fa.entry.js} +2 -2
  115. package/dist/ui-library/{p-25ff87fe.entry.js → p-83b35622.entry.js} +2 -2
  116. package/dist/ui-library/{p-18e755bc.entry.js → p-c33533c4.entry.js} +2 -2
  117. package/dist/ui-library/p-c33533c4.entry.js.map +1 -0
  118. package/dist/ui-library/{p-f6423fca.entry.js → p-c8fbf085.entry.js} +2 -2
  119. package/dist/ui-library/p-d7c7398d.entry.js +2 -0
  120. package/dist/ui-library/{p-f4dd7b57.entry.js → p-d9e770ab.entry.js} +2 -2
  121. package/dist/ui-library/p-d9e770ab.entry.js.map +1 -0
  122. package/dist/ui-library/p-ea3bf68d.entry.js +2 -0
  123. package/dist/ui-library/p-ee980a0f.entry.js.map +1 -1
  124. package/dist/ui-library/{p-29d79fe3.entry.js → p-f54d3616.entry.js} +2 -2
  125. package/dist/ui-library/{p-285666de.entry.js → p-f6a1c20b.entry.js} +2 -2
  126. package/dist/ui-library/six-date.entry.esm.js.map +1 -1
  127. package/dist/ui-library/six-datepicker.entry.esm.js.map +1 -1
  128. package/dist/ui-library/six-range.entry.esm.js.map +1 -1
  129. package/dist/ui-library/six-rating.entry.esm.js.map +1 -0
  130. package/dist/ui-library/six-switch.entry.esm.js.map +1 -1
  131. package/dist/ui-library/six-timepicker.entry.esm.js.map +1 -1
  132. package/dist/ui-library/ui-library.css +1 -1
  133. package/dist/ui-library/ui-library.esm.js +1 -1
  134. package/package.json +1 -1
  135. package/dist/components/p-DnLdSdN5.js.map +0 -1
  136. package/dist/ui-library/p-18e755bc.entry.js.map +0 -1
  137. package/dist/ui-library/p-3dc98466.entry.js +0 -2
  138. package/dist/ui-library/p-3dc98466.entry.js.map +0 -1
  139. package/dist/ui-library/p-494546c8.entry.js +0 -2
  140. package/dist/ui-library/p-4f52c56f.entry.js +0 -2
  141. package/dist/ui-library/p-4f52c56f.entry.js.map +0 -1
  142. package/dist/ui-library/p-d36ec323.entry.js +0 -2
  143. package/dist/ui-library/p-f4dd7b57.entry.js.map +0 -1
  144. /package/dist/ui-library/{p-01243b2e.entry.js.map → p-03ca4af8.entry.js.map} +0 -0
  145. /package/dist/ui-library/{p-362ff192.entry.js.map → p-21cbccb1.entry.js.map} +0 -0
  146. /package/dist/ui-library/{p-ea61b009.entry.js.map → p-6c8182fa.entry.js.map} +0 -0
  147. /package/dist/ui-library/{p-25ff87fe.entry.js.map → p-83b35622.entry.js.map} +0 -0
  148. /package/dist/ui-library/{p-f6423fca.entry.js.map → p-c8fbf085.entry.js.map} +0 -0
  149. /package/dist/ui-library/{p-d36ec323.entry.js.map → p-d7c7398d.entry.js.map} +0 -0
  150. /package/dist/ui-library/{p-494546c8.entry.js.map → p-ea3bf68d.entry.js.map} +0 -0
  151. /package/dist/ui-library/{p-29d79fe3.entry.js.map → p-f54d3616.entry.js.map} +0 -0
  152. /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 i,h as a,H as o,g as s}from"./p-JoG9I7EO.js";const e=":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:flex}.tab{display:inline-flex;align-items:center;font-family:var(--six-font-family);font-size:var(--six-font-size-small);font-weight:var(--six-font-weight-semibold);color:var(--six-tab-color);padding:var(--six-spacing-medium) var(--six-spacing-large);white-space:nowrap;user-select:none;cursor:pointer;width:100%}.tab:focus{outline:none}.tab:focus-visible{outline:var(--six-focus-ring);outline-offset:calc(-1 * var(--six-focus-ring-width) - var(--six-focus-ring-offset))}.tab.tab--active:not(.tab--disabled){color:var(--six-tab-color-active);font-weight:var(--six-font-weight-bold)}.tab.tab--closable{padding-right:var(--six-spacing-small)}.tab.tab--disabled{color:var(--six-tab-color-disabled);cursor:not-allowed}.tab:hover:not(.tab--disabled){color:var(--six-tab-color-hover)}.tab.tab--left,.tab.tab--right{display:inline-block;text-align:left}.tab.tab--left::before,.tab.tab--right::before{display:block;font-weight:var(--six-font-weight-bold);content:attr(title);height:0;overflow:hidden;visibility:hidden}.tab__close-button{font-size:var(--six-font-size-large);margin-left:var(--six-spacing-xx-small)}.tab__close-button::part(base){padding:var(--six-spacing-xxx-small)}.tab__indicator{position:absolute}.tab__indicator.tab__indicator--active{background-color:var(--six-tab-border-color-active)}.tab--top{margin-bottom:var(--six-spacing-xxx-small)}.tab__indicator--top{width:100%;bottom:0;height:var(--six-tab-border-width)}.tab--bottom{margin-top:var(--six-spacing-xxx-small)}.tab__indicator--bottom{width:100%;top:0;height:var(--six-tab-border-width)}.tab--left{margin-right:var(--six-spacing-xxx-small)}.tab__indicator--left{height:100%;right:0;top:0;width:var(--six-tab-border-width)}.tab--right{margin-left:var(--six-spacing-xxx-small)}.tab__indicator--right{height:100%;left:0;top:0;width:var(--six-tab-border-width)}";let r=0;const b=class{constructor(a){t(this,a);this.sixClose=i(this,"six-tab-close");this.componentId=`tab-${++r}`;this.panel="";this.active=false;this.closable=false;this.disabled=false}connectedCallback(){this.handleCloseClick=this.handleCloseClick.bind(this)}async setFocus(t){var i;(i=this.tab)===null||i===void 0?void 0:i.focus(t)}async removeFocus(){var t;(t=this.tab)===null||t===void 0?void 0:t.blur()}handleCloseClick(){this.sixClose.emit()}render(){var t;const i=this.host.closest("six-tab-group");const s=(t=i===null||i===void 0?void 0:i.placement)!==null&&t!==void 0?t:"top";return a(o,{key:"6b59af3a0794c9ea26b362fa1ea1c0d7513babea",id:this.host.id||this.componentId},a("div",{key:"145b15cdb916d93ecb67a966fd558e37500db17c",part:"base",ref:t=>this.tab=t,class:{tab:true,"tab--top":s==="top","tab--bottom":s==="bottom","tab--left":s==="left","tab--right":s==="right","tab--active":this.active,"tab--closable":this.closable,"tab--disabled":this.disabled},role:"tab","aria-disabled":this.disabled?"true":"false","aria-selected":this.active?"true":"false",tabindex:this.disabled||!this.active?"-1":"0",title:this.host.innerHTML},a("slot",{key:"2a63428f882a98381746e578c98421cf7d065a16"}),this.closable&&a("six-icon-button",{key:"dc0dbb47462d86dfae7b6806b667d6af69094f31",name:"close",size:"xSmall",exportparts:"base:close-button",class:"tab__close-button",onClick:this.handleCloseClick,tabIndex:-1,"aria-hidden":"true"})),a("div",{key:"62bb67bb6a95d732e0961f349ada6f7d78a2e3a1",part:this.active?"active-tab-indicator":"",class:{tab__indicator:true,"tab__indicator--active":this.active,"tab__indicator--top":s==="top","tab__indicator--bottom":s==="bottom","tab__indicator--left":s==="left","tab__indicator--right":s==="right"}}))}get host(){return s(this)}};b.style=e;export{b as six_tab};
2
- //# sourceMappingURL=p-01243b2e.entry.js.map
1
+ import{r as t,c as i,h as a,H as o,g as s}from"./p-JoG9I7EO.js";const e=":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:flex}.tab{display:inline-flex;align-items:center;font-family:var(--six-font-family);font-size:var(--six-font-size-small);font-weight:var(--six-font-weight-semibold);color:var(--six-tab-color);padding:var(--six-spacing-medium) var(--six-spacing-large);white-space:nowrap;user-select:none;cursor:pointer;width:100%}.tab:focus{outline:none}.tab:focus-visible{outline:var(--six-focus-ring);outline-offset:calc(-1 * var(--six-focus-ring-width) - var(--six-focus-ring-offset))}.tab.tab--active:not(.tab--disabled){color:var(--six-tab-color-active);font-weight:var(--six-font-weight-bold)}.tab.tab--closable{padding-right:var(--six-spacing-small)}.tab.tab--disabled{color:var(--six-tab-color-disabled);cursor:not-allowed}.tab:hover:not(.tab--disabled){color:var(--six-tab-color-hover)}.tab.tab--left,.tab.tab--right{display:inline-block;text-align:left}.tab.tab--left::before,.tab.tab--right::before{display:block;font-weight:var(--six-font-weight-bold);content:attr(title);height:0;overflow:hidden;visibility:hidden}.tab__close-button{font-size:var(--six-font-size-large);margin-left:var(--six-spacing-xx-small)}.tab__close-button::part(base){padding:var(--six-spacing-xxx-small)}.tab__indicator{position:absolute}.tab__indicator.tab__indicator--active{background-color:var(--six-tab-border-color-active)}.tab--top{margin-bottom:var(--six-spacing-xxx-small)}.tab__indicator--top{width:100%;bottom:0;height:var(--six-tab-border-width)}.tab--bottom{margin-top:var(--six-spacing-xxx-small)}.tab__indicator--bottom{width:100%;top:0;height:var(--six-tab-border-width)}.tab--left{margin-right:var(--six-spacing-xxx-small)}.tab__indicator--left{height:100%;right:0;top:0;width:var(--six-tab-border-width)}.tab--right{margin-left:var(--six-spacing-xxx-small)}.tab__indicator--right{height:100%;left:0;top:0;width:var(--six-tab-border-width)}";let r=0;const b=class{constructor(a){t(this,a);this.sixClose=i(this,"six-tab-close");this.componentId=`tab-${++r}`;this.panel="";this.active=false;this.closable=false;this.disabled=false}connectedCallback(){this.handleCloseClick=this.handleCloseClick.bind(this)}async setFocus(t){var i;(i=this.tab)===null||i===void 0?void 0:i.focus(t)}async removeFocus(){var t;(t=this.tab)===null||t===void 0?void 0:t.blur()}handleCloseClick(){this.sixClose.emit()}render(){var t;const i=this.host.closest("six-tab-group");const s=(t=i===null||i===void 0?void 0:i.placement)!==null&&t!==void 0?t:"top";return a(o,{key:"40b4042f28816b55ef585cf24570b64a44031863",id:this.host.id||this.componentId},a("div",{key:"e4e8ba43cf2e1384a421835fe1131ea411ac7a18",part:"base",ref:t=>this.tab=t,class:{tab:true,"tab--top":s==="top","tab--bottom":s==="bottom","tab--left":s==="left","tab--right":s==="right","tab--active":this.active,"tab--closable":this.closable,"tab--disabled":this.disabled},role:"tab","aria-disabled":this.disabled?"true":"false","aria-selected":this.active?"true":"false",tabindex:this.disabled||!this.active?"-1":"0",title:this.host.innerHTML},a("slot",{key:"39b1a75c51726543e0371e2607c6aa9197483b34"}),this.closable&&a("six-icon-button",{key:"b9b2468f19b875ea58292f9ed330b49cff084d7c",name:"close",size:"xSmall",exportparts:"base:close-button",class:"tab__close-button",onClick:this.handleCloseClick,tabIndex:-1,"aria-hidden":"true"})),a("div",{key:"da5cf7175879826bfb96f52cd8aca427372e32e6",part:this.active?"active-tab-indicator":"",class:{tab__indicator:true,"tab__indicator--active":this.active,"tab__indicator--top":s==="top","tab__indicator--bottom":s==="bottom","tab__indicator--left":s==="left","tab__indicator--right":s==="right"}}))}get host(){return s(this)}};b.style=e;export{b as six_tab};
2
+ //# sourceMappingURL=p-03ca4af8.entry.js.map
@@ -0,0 +1,2 @@
1
+ import{r as i,c as t,h as s,g as e}from"./p-JoG9I7EO.js";import{I as r}from"./p-WA6V9mN8.js";import{D as n,b as o,a as h}from"./p-CKhg9ibv.js";import{E as a}from"./p-C4h4qpGl.js";import{h as c}from"./p-j3oIB5oT.js";import{a as l,m as p}from"./p-Dd6pdO8C.js";const u=()=>{const i=new Date;return{hours:i.getHours(),minutes:i.getMinutes(),seconds:i.getSeconds(),milliseconds:i.getMilliseconds(),has24Hours:true}};const m=12;const d=i=>i>m?i-m:i;const f=()=>{const i=new Date;const t=i.getHours();return{hours:d(t),minutes:i.getMinutes(),seconds:i.getSeconds(),milliseconds:i.getMilliseconds(),has24Hours:false,period:t>=m?"PM":"AM"}};const g=(i=true)=>i?u():f();const x=(i,t)=>{const s=i.split(":");const e=t.split(":");return s.length===e.length};const b=(i,t)=>{const s=i.split(":");const e=t.split(":");if(!x(i,t)){console.error(`Timestring did not match expected format.\nExpected format: ${t}\nReceived timestring: ${i}`)}const r={};s.forEach(((i,t)=>{const s=e[t];switch(s){case"HH":r.hours=Number(i);r.has24Hours=true;break;case"hh":r.hours=Number(i);r.has24Hours=false;break;case"mm":r.minutes=Number(i);break;case"ss":r.seconds=Number(i);break;case"ms":r.milliseconds=Number(i);break;case"aa":r.period=i.toUpperCase()==="PM"?"PM":"AM"}}));return r};const k=(i,t)=>{if(i==null){return""}const s=t.split(":");return s.map((t=>{switch(t){case"HH":case"hh":return String(i.hours).padStart(2,"0");case"mm":return String(i.minutes).padStart(2,"0");case"ss":return String(i.seconds).padStart(2,"0");case"ms":return String(i.milliseconds).padStart(3,"0");case"aa":return String(i.period)}})).join(":")};const v=":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)}.timepicker_clear{display:inline-flex;align-items:center;font-size:inherit;color:var(--six-input-icon-color);border:none;background:none;padding:0;transition:var(--six-transition-fast) color;cursor:pointer}.timepicker_clear:hover{color:var(--six-input-icon-color-hover)}.timepicker_clear:focus{outline:none}.timepicker_clear--right{right:0;position:absolute}.timepicker_clear--left{right:35px;position:absolute}.timepicker__container{position:relative}.timepicker__popup{display:flex;justify-content:center;min-width:min-content;background-color:white;padding:0.5em;box-shadow:0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12);user-select:none;position:absolute;z-index:var(--six-z-index-dropdown);right:0;left:0}.timepicker__popup--is-up{bottom:100%}.timepicker__popup--is-inline{position:initial;box-shadow:none;border:1px solid var(--six-color-web-rock-400)}.timepicker__separator{display:flex;align-items:center}.timepicker__item--wide{padding-left:0.5rem;padding-right:0.5rem}.input--empty .timepicker_clear{visibility:hidden}.input--hide{display:none}.prefix{cursor:pointer}.prefix--right{right:0;display:inline-flex;position:absolute;font-size:inherit;color:var(--six-input-icon-color);border:none;background:none;margin-right:var(--six-input-spacing-medium);transition:var(--six-transition-fast) color}";const _=145;const y=class{constructor(s){i(this,s);this.sixChange=t(this,"six-timepicker-change");this.sixChangeDebounced=t(this,"six-timepicker-change-debounced");this.sixClear=t(this,"six-timepicker-clear");this.eventListeners=new a;this.format="HH:mm:ss";this.separator=":";this.value="";this.open=false;this.inline=false;this.readonly=false;this.disabled=false;this.size="medium";this.required=false;this.errorText="";this.label="";this.invalid=false;this.name="";this.clearable=false;this.iconPosition="left";this.hoist=false;this.timeout=n;this.interval=o;this.debounce=n;this.isPopupContentUp=false;this.isDropDownContentUp=false;this.popupValue={};this.handlePickerChange=(i,t)=>{i.stopPropagation();if(this.popupValue==null){return}this.popupValue[t]=i.detail;const s=k(this.popupValue,this.format);this.value=s;this.sixChange.emit({changedProperty:t,value:this.popupValue,valueAsString:s})};this.handleDocumentMouseDown=i=>{const t=i.composedPath();if(!t.includes(this.host)){this.closePopup();return}};this.handleClearClick=i=>{i.stopPropagation();if(this.inputElement!=null){this.inputElement.value=""}this.value="";this.sixClear.emit();this.sixChange.emit({value:{},valueAsString:""})}}async resizeHandler(){this.calcIsPopupContentUp();this.moveOpenHoistedPopup()}async scrollHandler(){this.calcIsPopupContentUp();this.moveOpenHoistedPopup()}valueChanged(){this.updateValue()}async setFocus(i){var t;(t=this.inputElement)===null||t===void 0?void 0:t.setFocus(i)}connectedCallback(){this.eventListeners.forward("six-timepicker-change","change",this.host)}componentWillLoad(){this.updateValue();if(this.inline){this.open=true}if(this.open){this.eventListeners.add(document,"mousedown",this.handleDocumentMouseDown)}}componentDidLoad(){if(this.inputElement==null)return;const i=this.inputElement;this.eventListeners.add(this.host,"six-timepicker-change",h((i=>this.sixChangeDebounced.emit(i.detail)),this.debounce));this.eventListeners.add(i,"six-input-input",h((t=>{t.stopPropagation();if(!x(i.value,this.format)){this.value=i.value;this.sixChange.emit({value:{},valueAsString:""});return}else{this.value=i.value;this.popupValue=b(i.value,this.format);this.sixChange.emit({value:this.popupValue,valueAsString:k(this.popupValue,this.format)})}}),this.debounce))}componentDidRender(){l(this.hoist,this.popup,this.inputElement,this.wrapper,_,(i=>this.isDropDownContentUp=i))}disconnectedCallback(){this.eventListeners.removeAll()}updateValue(){if(typeof this.value!=="string"||!x(this.value,this.format)){this.value=""}else if(this.inputElement!=null){this.inputElement.value=this.value}if(this.value===""){if(this.defaultTime==null){this.popupValue=g(this.is24HourClock())}else{this.popupValue=b(this.defaultTime,this.format)}}else{this.popupValue=b(this.value,this.format)}}calcIsPopupContentUp(){if(this.inputElement==null||this.wrapper==null){return}const i=this.inputElement.getBoundingClientRect();const t=this.wrapper.getBoundingClientRect();const s=Math.max(t.height,_);const e=i.y>window.innerHeight/2;this.isPopupContentUp=e&&window.innerHeight<i.bottom+s}moveOpenHoistedPopup(){p(this.hoist,this.open,this.popup,this.inputElement,this.wrapper,_)}getSixTimeUnitPicker(i){return s("six-item-picker",{class:i.class,timeout:this.timeout,interval:this.interval,padded:true,min:i.min,max:i.max,value:this.popupValue[i.propertyName],items:i.items,type:i.type||r.NUMBER,"padding-length":i.paddingLength,"onSix-item-picker-change":t=>this.handlePickerChange(t,i.propertyName)})}getHour24Picker(){if(!this.is24HourClock()){return}return this.getSixTimeUnitPicker({min:0,max:23,propertyName:"hours"})}is24HourClock(){return this.format.includes("HH")}getHour12Picker(){if(!this.is12HourClock()){return}return this.getSixTimeUnitPicker({min:0,max:11,propertyName:"hours"})}is12HourClock(){return this.format.includes("hh")}getAmPmPicker(){if(!this.is12HourClock()){return}const i=["AM","PM"];return this.getSixTimeUnitPicker({items:i,type:r.CUSTOM,propertyName:"period"})}getMinutePicker(){if(!this.format.includes("mm")){return}return this.getSixTimeUnitPicker({min:0,max:59,propertyName:"minutes"})}getSecondsPicker(){if(!this.format.includes("ss")){return}return this.getSixTimeUnitPicker({min:0,max:59,propertyName:"seconds"})}getMillisecondsPicker(){if(!this.format.includes("ms")){return}return this.getSixTimeUnitPicker({min:0,max:999,class:"timepicker__item--wide",paddingLength:3,propertyName:"milliseconds"})}getSeparator(){return s("div",{class:"timepicker__separator"},s("span",null,this.separator))}getContent(){const i=[this.getHour24Picker(),this.getHour12Picker(),this.getMinutePicker(),this.getSecondsPicker(),this.getMillisecondsPicker()];const t=i.filter((i=>i!==undefined));return t.map(((i,s)=>{if(s===t.length-1){return[i]}return[i,this.getSeparator()]}))}openPopup(){if(!this.open&&!this.disabled){this.open=true;this.eventListeners.add(document,"mousedown",this.handleDocumentMouseDown)}}closePopup(){if(this.inline){return}this.open=false;this.eventListeners.remove(document,"mousedown",this.handleDocumentMouseDown)}renderClearable(){return this.clearable&&s("button",{slot:"suffix",class:{timepicker_clear:true,"timepicker_clear--right":this.iconPosition==="left","timepicker_clear--left":this.iconPosition==="right"},type:"button",onClick:this.handleClearClick,tabindex:"-1"},s("six-icon",{size:"small"},"clear"))}renderCustomIcon(){const i=c(this.host,"custom-icon")?s("slot",{name:"custom-icon"}):s("six-icon",{size:this.size==="large"?"medium":this.size},"watch_later");return s("span",{slot:"prefix",part:"icon",class:{prefix:true,"prefix--right":this.iconPosition==="right"}},i)}render(){return s("div",{key:"a3496612a52df399ccd8cb88e2f3564432758b74",part:"container",ref:i=>this.wrapper=i,class:"timepicker__container"},s("six-input",{key:"ca426a5b063102ea92550ed6779a46c56a663a22",ref:i=>this.inputElement=i,part:"input",onClick:()=>this.openPopup(),placeholder:this.placeholder,readonly:this.readonly,disabled:this.disabled,errorTextCount:this.errorTextCount,errorText:this.errorText,invalid:this.invalid,size:this.size,name:this.name,label:this.label,required:this.required,class:{"input--empty":this.value==="","input--hide":this.inline}},this.renderCustomIcon(),this.renderClearable(),c(this.host,"label")?s("span",{slot:"label"},s("slot",{name:"label"})):null,c(this.host,"error-text")?s("span",{slot:"error-text"},s("slot",{name:"error-text"})):null),this.open&&s("div",{key:"8c03ea793c9452af88fe41699ec58b526057d834",ref:i=>this.popup=i,part:"popup",class:{timepicker__popup:true,"timepicker__popup--is-up":this.placement==null?this.placement==="top":this.isPopupContentUp,"timepicker__popup--is-inline":this.inline}},...this.getContent(),this.getAmPmPicker()))}get host(){return e(this)}static get watchers(){return{value:["valueChanged"]}}};y.style=v;export{y as six_timepicker};
2
+ //# sourceMappingURL=p-12e7a9e1.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getCurrentTimeIn24Hours","now","Date","hours","getHours","minutes","getMinutes","seconds","getSeconds","milliseconds","getMilliseconds","has24Hours","HOURS_IN_12_HOUR_CLOCK_FORMAT","getHoursIn12HourFormat","getCurrentTimeIn12Hours","period","getCurrentTime","isValidTimeString","timeStr","format","timeStringParts","split","timeFormatParts","length","parseTimeString","timeParts","formatParts","console","error","time","forEach","timeStringPart","i","formatStringPart","Number","toUpperCase","createTimeString","map","timeFormatPart","String","padStart","join","sixTimepickerCss","MIN_POPUP_HEIGHT","SixTimepicker","constructor","hostRef","this","eventListeners","EventListeners","separator","value","open","inline","readonly","disabled","size","required","errorText","label","invalid","name","clearable","iconPosition","hoist","timeout","DEFAULT_DEBOUNCE_FAST","interval","DEFAULT_DEBOUNCE_INSANELY_FAST","debounce","isPopupContentUp","isDropDownContentUp","popupValue","handlePickerChange","event","property","stopPropagation","detail","timeString","sixChange","emit","changedProperty","valueAsString","handleDocumentMouseDown","path","composedPath","includes","host","closePopup","handleClearClick","inputElement","sixClear","resizeHandler","calcIsPopupContentUp","moveOpenHoistedPopup","scrollHandler","valueChanged","updateValue","setFocus","options","_a","connectedCallback","forward","componentWillLoad","add","document","componentDidLoad","sixChangeDebounced","componentDidRender","adjustPopupForHoisting","popup","wrapper","isUp","disconnectedCallback","removeAll","defaultTime","is24HourClock","inputBoundingRect","getBoundingClientRect","wrapperBoundingRect","minPopupHeight","Math","max","height","moreSpaceInTop","y","window","innerHeight","bottom","movePopup","getSixTimeUnitPicker","params","h","class","padded","min","propertyName","items","type","ItemPickerType","NUMBER","paddingLength","getHour24Picker","getHour12Picker","is12HourClock","getAmPmPicker","CUSTOM","getMinutePicker","getSecondsPicker","getMillisecondsPicker","getSeparator","getContent","elementsInOrder","visibleElements","filter","el","undefined","idx","openPopup","remove","renderClearable","slot","timepicker_clear","onClick","tabindex","renderCustomIcon","icon","hasSlot","part","prefix","render","key","ref","placeholder","errorTextCount","timepicker__popup","placement"],"sources":["src/utils/time.util.ts","src/components/six-timepicker/six-timepicker.scss?tag=six-timepicker&encapsulation=shadow","src/components/six-timepicker/six-timepicker.tsx"],"sourcesContent":["export type TimePeriod = 'AM' | 'PM';\n\nexport interface Time {\n hours?: number;\n minutes?: number;\n seconds?: number;\n milliseconds?: number;\n has24Hours?: boolean; // true => 24h, false => 12h\n period?: TimePeriod; // only needed for 12-hour clock\n}\n\nexport type TimeProperties = keyof Time;\n\nexport type TimeFormatChar =\n | 'HH' // 24h\n | 'hh' // 12h\n | 'mm' // minutes\n | 'ss' // seconds\n | 'ms' // milliseconds\n | 'aa'; // period (AM/PM)\n\n/*\n * Supported time formats\n */\nexport type TimeFormat =\n | 'HH:mm:ss'\n | 'hh:mm:ss:aa'\n | 'HH:mm:ss:ms'\n | 'hh:mm:ss:ms:aa'\n | 'HH:mm'\n | 'hh:mm:aa'\n | 'HH'\n | 'hh:aa'\n | 'mm'\n | 'ss'\n | 'ms';\n\nexport const getCurrentTimeIn24Hours = (): Time => {\n const now = new Date();\n return {\n hours: now.getHours(),\n minutes: now.getMinutes(),\n seconds: now.getSeconds(),\n milliseconds: now.getMilliseconds(),\n has24Hours: true,\n };\n};\n\nconst HOURS_IN_12_HOUR_CLOCK_FORMAT = 12;\n\nexport const getHoursIn12HourFormat = (hours: number) =>\n hours > HOURS_IN_12_HOUR_CLOCK_FORMAT ? hours - HOURS_IN_12_HOUR_CLOCK_FORMAT : hours;\n\nexport const getCurrentTimeIn12Hours = (): Time => {\n const now = new Date();\n const hours = now.getHours();\n return {\n hours: getHoursIn12HourFormat(hours),\n minutes: now.getMinutes(),\n seconds: now.getSeconds(),\n milliseconds: now.getMilliseconds(),\n has24Hours: false,\n period: hours >= HOURS_IN_12_HOUR_CLOCK_FORMAT ? 'PM' : 'AM',\n };\n};\n\nexport const getCurrentTime = (has24Hours = true): Time => {\n return has24Hours ? getCurrentTimeIn24Hours() : getCurrentTimeIn12Hours();\n};\n\nexport const isValidTimeString = (timeStr: string, format: TimeFormat) => {\n const timeStringParts = timeStr.split(':');\n const timeFormatParts = format.split(':');\n return timeStringParts.length === timeFormatParts.length;\n};\n\nexport const parseTimeString = (timeStr: string, format: TimeFormat): Time => {\n const timeParts = timeStr.split(':');\n const formatParts = format.split(':') as TimeFormatChar[];\n\n if (!isValidTimeString(timeStr, format)) {\n console.error(\n `Timestring did not match expected format.\\nExpected format: ${format}\\nReceived timestring: ${timeStr}`\n );\n }\n\n const time: Time = {};\n\n timeParts.forEach((timeStringPart, i) => {\n const formatStringPart: TimeFormatChar = formatParts[i];\n switch (formatStringPart) {\n case 'HH':\n time.hours = Number(timeStringPart);\n time.has24Hours = true;\n break;\n case 'hh':\n time.hours = Number(timeStringPart);\n time.has24Hours = false;\n break;\n case 'mm':\n time.minutes = Number(timeStringPart);\n break;\n case 'ss':\n time.seconds = Number(timeStringPart);\n break;\n case 'ms':\n time.milliseconds = Number(timeStringPart);\n break;\n case 'aa':\n time.period = timeStringPart.toUpperCase() === 'PM' ? 'PM' : 'AM';\n }\n });\n return time;\n};\n\nexport const createTimeString = (time: Time | undefined, format: TimeFormat): string => {\n if (time == null) {\n return '';\n }\n\n const formatParts = format.split(':') as TimeFormatChar[];\n\n return formatParts\n .map((timeFormatPart) => {\n switch (timeFormatPart) {\n case 'HH':\n case 'hh':\n return String(time.hours).padStart(2, '0');\n case 'mm':\n return String(time.minutes).padStart(2, '0');\n case 'ss':\n return String(time.seconds).padStart(2, '0');\n case 'ms':\n return String(time.milliseconds).padStart(3, '0');\n case 'aa':\n return String(time.period);\n }\n })\n .join(':');\n};\n","@import 'src/global/component';\n\n:host {\n display: block;\n font-family: var(--six-font-family);\n}\n\n.timepicker {\n &_clear {\n display: inline-flex;\n align-items: center;\n font-size: inherit;\n color: var(--six-input-icon-color);\n border: none;\n background: none;\n padding: 0;\n transition: var(--six-transition-fast) color;\n cursor: pointer;\n\n &:hover {\n color: var(--six-input-icon-color-hover);\n }\n\n &:focus {\n outline: none;\n }\n\n &--right {\n right: 0;\n position: absolute;\n }\n\n &--left {\n right: 35px;\n position: absolute;\n }\n }\n\n &__container {\n position: relative;\n }\n\n &__popup {\n display: flex;\n justify-content: center;\n min-width: min-content;\n background-color: white;\n padding: 0.5em;\n box-shadow:\n 0 2px 4px -1px rgb(0 0 0 / 20%),\n 0 4px 5px 0 rgb(0 0 0 / 14%),\n 0 1px 10px 0 rgb(0 0 0 / 12%);\n user-select: none;\n position: absolute;\n z-index: var(--six-z-index-dropdown);\n right: 0;\n left: 0;\n\n &--is-up {\n bottom: 100%;\n }\n\n &--is-inline {\n position: initial;\n box-shadow: none;\n border: 1px solid var(--six-color-web-rock-400);\n }\n }\n\n &__separator {\n display: flex;\n align-items: center;\n }\n\n &__item {\n &--wide {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n }\n }\n}\n\n.input--empty .timepicker_clear {\n visibility: hidden;\n}\n\n.input--hide {\n display: none;\n}\n\n// Icon position\n.prefix {\n cursor: pointer;\n\n &--right {\n right: 0;\n display: inline-flex;\n position: absolute;\n font-size: inherit;\n color: var(--six-input-icon-color);\n border: none;\n background: none;\n margin-right: var(--six-input-spacing-medium);\n transition: var(--six-transition-fast) color;\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport { ItemPickerType } from '../six-item-picker/types';\nimport {\n createTimeString,\n getCurrentTime,\n isValidTimeString,\n parseTimeString,\n Time,\n TimeFormat,\n TimeProperties,\n} from '../../utils/time.util';\nimport { debounce, DEFAULT_DEBOUNCE_FAST, DEFAULT_DEBOUNCE_INSANELY_FAST } from '../../utils/execution-control';\nimport { SixItemPickerChangePayload } from '../six-item-picker/six-item-picker';\nimport { EventListeners } from '../../utils/event-listeners';\nimport { hasSlot } from '../../utils/slot';\nimport { EmptyPayload } from '../../utils/types';\nimport { adjustPopupForHoisting, movePopup } from '../../utils/popup';\n\nexport interface SixTimepickerChange {\n value?: Time;\n valueAsString: string;\n changedProperty?: string;\n}\n\ninterface SixTimeUnitPickerParams {\n min?: number;\n max?: number;\n items?: string[];\n type?: ItemPickerType;\n class?: string;\n paddingLength?: number;\n propertyName: TimeProperties;\n}\n\nconst MIN_POPUP_HEIGHT = 145;\n\n/**\n * @since 2.0.0\n * @status experimental\n *\n * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.\n *\n * @part input - The input field\n * @part container - The container of whole component\n * @part popup - The popup of the timepicker component\n *\n */\n@Component({\n tag: 'six-timepicker',\n styleUrl: 'six-timepicker.scss',\n shadow: true,\n})\nexport class SixTimepicker {\n private eventListeners = new EventListeners();\n private popup?: HTMLElement;\n private wrapper?: HTMLElement;\n private inputElement?: HTMLSixInputElement;\n\n @Element() host!: HTMLSixTimepickerElement;\n\n /**\n * Define the time format. Valid formats are:\n *\n * HH:mm:ss\n * hh:mm:ss:aa\n * HH:mm:ss:ms\n * hh:mm:ss:ms:aa\n * HH:mm\n * hh:mm:aa\n * HH\n * hh:aa\n * mm\n * ss\n * ms\n *\n * where HH is the 24 hour format\n * and hh is the 12 hour format\n *\n * Please notice that when using the 12-hour-clock (hh)\n * you always need a period indicator (aa). So the time can be parsed as either am or pm\n * */\n @Prop() format: TimeFormat = 'HH:mm:ss';\n\n /**\n * Define the separator to be shown between the time unit pickers.\n * Please be aware that this property will modify the displayed separator only.\n * The separator for a timestring is always expected to be a colon (eg. '13:52:20')\n * */\n @Prop() separator = ':';\n\n /**\n * The value of the timepicker provided as a string. The string mast match the provided format (or default format)\n */\n @Prop({ mutable: true }) value = '';\n\n /** Indicates whether the timepicker dropdown is open on startup. You can use this in lieu of the show/hide methods. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n /** Indicates whether the timepicker should be shown as an inline (always open) component */\n @Prop({ reflect: true }) inline = false;\n\n /**\n * If `true` the user can only select a time via the timepicker but not directly edit the input field.\n */\n @Prop() readonly = false;\n\n /**\n * If `true` the component is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * The enforced placement of the dropdown panel.\n */\n @Prop() placement?: 'top' | 'bottom';\n\n /** Timepicker size. */\n @Prop() size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /**\n * The placeholder defines what text to be shown on the input element\n */\n @Prop() placeholder?: string;\n\n /** The input's error text. Alternatively, you can use the error-text slot. */\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 /** The input's label. Alternatively, you can use the label slot. */\n @Prop() label = '';\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 name attribute. */\n @Prop({ reflect: true }) name = '';\n\n /** Set to true to add a clear button when the input is populated. */\n @Prop() clearable = false;\n\n /** Set the position of the icon */\n @Prop() iconPosition: 'left' | 'right' = 'left';\n\n /**\n * Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n * `overflow: auto|scroll`.\n */\n @Prop() hoist = false;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger faster switching between timeunits (e.g. hours).\n */\n @Prop() timeout = DEFAULT_DEBOUNCE_FAST;\n\n /**\n * Set the amount of time, in milliseconds, to wait between switching to next timeunit (e.g. next hour) when mouse button is held pressed.\n */\n @Prop() interval = DEFAULT_DEBOUNCE_INSANELY_FAST;\n\n /**\n * The defaultTime defines the default setting for the timepicker when you open the popup. Default time must match the provided format.\n */\n @Prop() defaultTime?: string;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `six-timepicker-change-debounced` event.\n * If you want your change debounce event to not trigger when keeping the nav button pressed before, make sure debounce\n * is a bit bigger than timeout, otherwise keeping the button pressed will trigger the event twice: once you click\n * (and keep pressed) and once you release\n */\n @Prop() debounce = DEFAULT_DEBOUNCE_FAST;\n\n /**\n * Emitted when the timepicker's value changes\n */\n @Event({ eventName: 'six-timepicker-change' }) sixChange!: EventEmitter<SixTimepickerChange>;\n\n /**\n * Emitted when the timepicker's value changes, but debounced\n */\n @Event({ eventName: 'six-timepicker-change-debounced' }) sixChangeDebounced!: EventEmitter<SixTimepickerChange>;\n\n /**\n * Emitted when the clear button is activated.\n */\n @Event({ eventName: 'six-timepicker-clear' }) sixClear!: EventEmitter<EmptyPayload>;\n\n @State() isPopupContentUp = false;\n\n @State() isDropDownContentUp = false;\n\n @Listen('resize', { target: 'window' })\n async resizeHandler() {\n this.calcIsPopupContentUp();\n this.moveOpenHoistedPopup();\n }\n\n @Listen('scroll', { target: 'window' })\n async scrollHandler() {\n this.calcIsPopupContentUp();\n this.moveOpenHoistedPopup();\n }\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n this.updateValue();\n }\n\n /** Sets focus on the datepickers input. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.inputElement?.setFocus(options);\n }\n\n /*\n * Internally the six-timepicker uses a standardized representation of time, so we don't have a mess,\n * when switching between formats\n */\n @State() private popupValue: Time = {};\n\n connectedCallback() {\n this.eventListeners.forward('six-timepicker-change', 'change', this.host);\n }\n\n componentWillLoad() {\n this.updateValue();\n\n if (this.inline) {\n this.open = true;\n }\n\n if (this.open) {\n this.eventListeners.add(document, 'mousedown', this.handleDocumentMouseDown);\n }\n }\n\n componentDidLoad() {\n if (this.inputElement == null) return;\n const inputElement = this.inputElement;\n\n // emit debounced change event\n this.eventListeners.add(\n this.host,\n 'six-timepicker-change',\n debounce((event: Event) => this.sixChangeDebounced.emit((event as CustomEvent).detail), this.debounce)\n );\n\n // update value and popup value based on input-element value\n this.eventListeners.add(\n inputElement,\n 'six-input-input',\n debounce((event: Event) => {\n event.stopPropagation();\n\n // emit empty event if time string is invalid\n if (!isValidTimeString(inputElement.value, this.format)) {\n this.value = inputElement.value;\n this.sixChange.emit({\n value: {},\n valueAsString: '',\n });\n return;\n } else {\n // update value and popup value and emit the new value\n this.value = inputElement.value;\n this.popupValue = parseTimeString(inputElement.value, this.format);\n this.sixChange.emit({\n value: this.popupValue,\n valueAsString: createTimeString(this.popupValue, this.format),\n });\n }\n }, this.debounce)\n );\n }\n\n componentDidRender() {\n adjustPopupForHoisting(\n this.hoist,\n this.popup,\n this.inputElement,\n this.wrapper,\n MIN_POPUP_HEIGHT,\n (isUp) => (this.isDropDownContentUp = isUp)\n );\n }\n\n disconnectedCallback() {\n this.eventListeners.removeAll();\n }\n private updateValue() {\n // normalize value\n if (typeof this.value !== 'string' || !isValidTimeString(this.value, this.format)) {\n this.value = '';\n } else if (this.inputElement != null) {\n this.inputElement.value = this.value;\n }\n\n // update popup value\n if (this.value === '') {\n if (this.defaultTime == null) {\n this.popupValue = getCurrentTime(this.is24HourClock());\n } else {\n this.popupValue = parseTimeString(this.defaultTime, this.format);\n }\n } else {\n this.popupValue = parseTimeString(this.value, this.format);\n }\n }\n\n private calcIsPopupContentUp() {\n if (this.inputElement == null || this.wrapper == null) {\n return;\n }\n\n const inputBoundingRect = this.inputElement.getBoundingClientRect();\n const wrapperBoundingRect = this.wrapper.getBoundingClientRect();\n const minPopupHeight = Math.max(wrapperBoundingRect.height, MIN_POPUP_HEIGHT);\n\n const moreSpaceInTop = inputBoundingRect.y > window.innerHeight / 2;\n this.isPopupContentUp = moreSpaceInTop && window.innerHeight < inputBoundingRect.bottom + minPopupHeight;\n }\n\n private moveOpenHoistedPopup() {\n movePopup(this.hoist, this.open, this.popup, this.inputElement, this.wrapper, MIN_POPUP_HEIGHT);\n }\n\n private handlePickerChange = (event: CustomEvent<SixItemPickerChangePayload>, property: TimeProperties) => {\n // stop propagation, since the timepicker should not expose the events of the underlying item-picker\n event.stopPropagation();\n if (this.popupValue == null) {\n return;\n }\n\n // update the internal state\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.popupValue[property] = event.detail;\n\n const timeString = createTimeString(this.popupValue, this.format);\n\n // update the input value\n this.value = timeString;\n\n // emit change event\n this.sixChange.emit({\n changedProperty: property,\n value: this.popupValue,\n valueAsString: timeString,\n });\n };\n\n private getSixTimeUnitPicker(params: SixTimeUnitPickerParams) {\n return (\n <six-item-picker\n class={params.class}\n timeout={this.timeout}\n interval={this.interval}\n padded\n min={params.min}\n max={params.max}\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n value={this.popupValue[params.propertyName]}\n items={params.items}\n type={params.type || ItemPickerType.NUMBER}\n padding-length={params.paddingLength}\n onSix-item-picker-change={(event) => this.handlePickerChange(event, params.propertyName)}\n ></six-item-picker>\n );\n }\n\n private getHour24Picker() {\n if (!this.is24HourClock()) {\n return;\n }\n return this.getSixTimeUnitPicker({ min: 0, max: 23, propertyName: 'hours' });\n }\n\n private is24HourClock() {\n return this.format.includes('HH');\n }\n\n private getHour12Picker() {\n if (!this.is12HourClock()) {\n return;\n }\n return this.getSixTimeUnitPicker({ min: 0, max: 11, propertyName: 'hours' });\n }\n\n private is12HourClock() {\n return this.format.includes('hh');\n }\n\n private getAmPmPicker() {\n if (!this.is12HourClock()) {\n return;\n }\n const items = ['AM', 'PM'];\n return this.getSixTimeUnitPicker({\n items,\n type: ItemPickerType.CUSTOM,\n propertyName: 'period',\n });\n }\n\n private getMinutePicker() {\n if (!this.format.includes('mm')) {\n return;\n }\n\n return this.getSixTimeUnitPicker({ min: 0, max: 59, propertyName: 'minutes' });\n }\n\n private getSecondsPicker() {\n if (!this.format.includes('ss')) {\n return;\n }\n\n return this.getSixTimeUnitPicker({ min: 0, max: 59, propertyName: 'seconds' });\n }\n\n private getMillisecondsPicker() {\n if (!this.format.includes('ms')) {\n return;\n }\n\n return this.getSixTimeUnitPicker({\n min: 0,\n max: 999,\n class: 'timepicker__item--wide',\n paddingLength: 3,\n propertyName: 'milliseconds',\n });\n }\n\n private getSeparator() {\n return (\n <div class=\"timepicker__separator\">\n <span>{this.separator}</span>\n </div>\n );\n }\n\n private getContent() {\n const elementsInOrder = [\n this.getHour24Picker(),\n this.getHour12Picker(),\n this.getMinutePicker(),\n this.getSecondsPicker(),\n this.getMillisecondsPicker(),\n ];\n\n const visibleElements = elementsInOrder.filter((el) => el !== undefined);\n\n return visibleElements.map((el, idx) => {\n if (idx === visibleElements.length - 1) {\n return [el];\n }\n\n return [el, this.getSeparator()];\n });\n }\n\n private openPopup() {\n if (!this.open && !this.disabled) {\n this.open = true;\n this.eventListeners.add(document, 'mousedown', this.handleDocumentMouseDown);\n }\n }\n\n private closePopup() {\n if (this.inline) {\n return;\n }\n\n this.open = false;\n this.eventListeners.remove(document, 'mousedown', this.handleDocumentMouseDown);\n }\n\n private handleDocumentMouseDown = (event: Event) => {\n // Close when clicking outside the containing element\n const path = event.composedPath() as EventTarget[];\n if (!path.includes(this.host)) {\n this.closePopup();\n return;\n }\n };\n\n private handleClearClick = (event: MouseEvent) => {\n event.stopPropagation();\n if (this.inputElement != null) {\n this.inputElement.value = '';\n }\n this.value = '';\n this.sixClear.emit();\n this.sixChange.emit({\n value: {},\n valueAsString: '',\n });\n };\n\n private renderClearable() {\n return (\n this.clearable && (\n <button\n slot=\"suffix\"\n class={{\n timepicker_clear: true,\n 'timepicker_clear--right': this.iconPosition === 'left',\n 'timepicker_clear--left': this.iconPosition === 'right',\n }}\n type=\"button\"\n onClick={this.handleClearClick}\n tabindex=\"-1\"\n >\n <six-icon size=\"small\">clear</six-icon>\n </button>\n )\n );\n }\n\n private renderCustomIcon() {\n const icon = hasSlot(this.host, 'custom-icon') ? (\n <slot name=\"custom-icon\"></slot>\n ) : (\n <six-icon size={this.size === 'large' ? 'medium' : this.size}>watch_later</six-icon>\n );\n\n return (\n <span\n slot=\"prefix\"\n part=\"icon\"\n class={{\n prefix: true,\n 'prefix--right': this.iconPosition === 'right',\n }}\n >\n {icon}\n </span>\n );\n }\n\n render() {\n return (\n <div part=\"container\" ref={(el) => (this.wrapper = el)} class=\"timepicker__container\">\n <six-input\n ref={(el) => (this.inputElement = el)}\n part=\"input\"\n onClick={() => this.openPopup()}\n placeholder={this.placeholder}\n readonly={this.readonly}\n disabled={this.disabled}\n errorTextCount={this.errorTextCount}\n errorText={this.errorText}\n invalid={this.invalid}\n size={this.size}\n name={this.name}\n label={this.label}\n required={this.required}\n class={{\n 'input--empty': this.value === '',\n 'input--hide': this.inline,\n }}\n >\n {this.renderCustomIcon()}\n {this.renderClearable()}\n {hasSlot(this.host, 'label') ? (\n <span slot=\"label\">\n <slot name=\"label\" />\n </span>\n ) : null}\n {hasSlot(this.host, 'error-text') ? (\n <span slot=\"error-text\">\n <slot name=\"error-text\" />\n </span>\n ) : null}\n </six-input>\n {this.open && (\n <div\n ref={(el) => (this.popup = el)}\n part=\"popup\"\n class={{\n timepicker__popup: true,\n 'timepicker__popup--is-up': this.placement == null ? this.placement === 'top' : this.isPopupContentUp,\n 'timepicker__popup--is-inline': this.inline,\n }}\n >\n {...this.getContent()}\n {this.getAmPmPicker()}\n </div>\n )}\n </div>\n );\n }\n}\n"],"mappings":"kQAqCO,MAAMA,EAA0B,KACrC,MAAMC,EAAM,IAAIC,KAChB,MAAO,CACLC,MAAOF,EAAIG,WACXC,QAASJ,EAAIK,aACbC,QAASN,EAAIO,aACbC,aAAcR,EAAIS,kBAClBC,WAAY,KACb,EAGH,MAAMC,EAAgC,GAE/B,MAAMC,EAA0BV,GACrCA,EAAQS,EAAgCT,EAAQS,EAAgCT,EAE3E,MAAMW,EAA0B,KACrC,MAAMb,EAAM,IAAIC,KAChB,MAAMC,EAAQF,EAAIG,WAClB,MAAO,CACLD,MAAOU,EAAuBV,GAC9BE,QAASJ,EAAIK,aACbC,QAASN,EAAIO,aACbC,aAAcR,EAAIS,kBAClBC,WA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C,EAAKtB,MAAM,yBAC5DD,EAAA,aAAAuC,IAAA,2CACEC,IAAMjB,GAAQ5G,KAAK2C,aAAeiE,EAClCa,KAAK,QACLL,QAAS,IAAMpH,KAAK+G,YACpBe,YAAa9H,KAAK8H,YAClBvH,SAAUP,KAAKO,SACfC,SAAUR,KAAKQ,SACfuH,eAAgB/H,KAAK+H,eACrBpH,UAAWX,KAAKW,UAChBE,QAASb,KAAKa,QACdJ,KAAMT,KAAKS,KACXK,KAAMd,KAAKc,KACXF,MAAOZ,KAAKY,MACZF,SAAUV,KAAKU,SACf4E,MAAO,CACL,eAAgBtF,KAAKI,QAAU,GAC/B,cAAeJ,KAAKM,SAGrBN,KAAKsH,mBACLtH,KAAKiH,kBACLO,EAAQxH,KAAKwC,KAAM,SAClB6C,EAAM,QAAA6B,KAAK,SACT7B,EAAM,QAAAvE,KAAK,WAEX,KACH0G,EAAQxH,KAAKwC,KAAM,cAClB6C,EAAM,QAAA6B,KAAK,cACT7B,EAAM,QAAAvE,KAAK,gBAEX,MAELd,KAAKK,MACJgF,EAAA,OAAAuC,IAAA,2CACEC,IAAMjB,GAAQ5G,KAAK+D,MAAQ6C,EAC3Ba,KAAK,QACLnC,MAAO,CACL0C,kBAAmB,KACnB,2BAA4BhI,KAAKiI,WAAa,KAAOjI,KAAKiI,YAAc,MAAQjI,KAAKuB,iBACrF,+BAAgCvB,KAAKM,YAGnCN,KAAKwG,aACRxG,KAAKkG,iB","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{r as i,c as s,h as t}from"./p-JoG9I7EO.js";import{s as e}from"./p-BY6hIEFX.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:block;height:100%}.sidebar__container{height:100%;overflow:auto}.sidebar__container.sidebar--open{border-right:1px solid var(--six-color-web-rock-300)}.sidebar__container:not(.sidebar--visible){position:absolute;width:1px;height:1px;clip:rect(0 0 0 0);clip-path:inset(50%);overflow:hidden;pointer-events:none;visibility:hidden}.sidebar--left{color:var(--six-sidebar-color);background-color:var(--six-sidebar-background-color);transition:var(--six-transition-medium) margin-left;background-size:300vw 70%;background-position:bottom;background-repeat:no-repeat}.sidebar--right{transition:var(--six-transition-medium) margin-right}.sidebar--open.sidebar--left{margin-right:2px}.sidebar--open.sidebar--right{margin-left:2px}";const r=i=>{var s;return((s=i===null||i===void 0?void 0:i.tagName)===null||s===void 0?void 0:s.toLowerCase())==="six-sidebar-item-group"};const n=class{constructor(t){i(this,t);this.sixShow=s(this,"six-sidebar-show");this.sixAfterShow=s(this,"six-sidebar-after-show");this.sixHide=s(this,"six-sidebar-hide");this.sixAfterHide=s(this,"six-sidebar-after-hide");this.sixInitialFocus=s(this,"six-sidebar-initial-focus");this.willShow=false;this.willHide=false;this.isVisible=false;this.position="left";this.open=false;this.width="16rem";this.toggled=false;this.handleTransitionEnd=i=>{const s=i.target;if(i.type==="transitionend"&&s.classList.contains("sidebar__container")){this.resetTransitionVariables()}};this.closeSiblingDetailsOnShow=i=>{const s=i.target;if(this.sidebar!=null){e(s,this.sidebar)}const t=i=>{var t;let e=s;while(i(e)!=null){e=i(e);if(r(e)){const i=(t=e===null||e===void 0?void 0:e.shadowRoot)===null||t===void 0?void 0:t.querySelector("six-details");if(i!=null){i.open=false}}}};t((i=>i===null||i===void 0?void 0:i.previousElementSibling));t((i=>i===null||i===void 0?void 0:i.nextElementSibling))}}handleOpenChange(){this.open?this.show():this.hide()}componentWillLoad(){if(this.open){void this.show();this.resetTransitionVariables()}}componentDidRender(){this.setupTogglableMenuItems()}disconnectedCallback(){var i;(i=this.sidebar)===null||i===void 0?void 0:i.removeEventListener("six-details-show",this.closeSiblingDetailsOnShow)}setupTogglableMenuItems(){if(!this.toggled||this.sidebar==null)return;this.markAllMenuItemsAsSelectableEmpty();this.sidebar.addEventListener("six-details-show",this.closeSiblingDetailsOnShow)}markAllMenuItemsAsSelectableEmpty(){var i;const s=(i=this.sidebar)===null||i===void 0?void 0:i.querySelector("slot");const t=(s===null||s===void 0?void 0:s.assignedElements())||[];const e=[];while(t.length>0){const i=t.pop();if((i===null||i===void 0?void 0:i.shadowRoot)==null){continue}const s=i.shadowRoot.querySelectorAll("six-details");e.push(...s);const o=Array.from(i.children).filter(r);t.push(...o)}e.forEach((i=>i.selectableEmpty=true))}async toggle(){if(this.willShow||this.willHide){return}if(this.open){await this.hide()}else{await this.show()}}async show(){if(this.willShow){return}const i=this.sixShow.emit();if(i.defaultPrevented){this.open=false;return}this.willShow=true;this.isVisible=true;this.open=true}async hide(){if(this.willHide){return}const i=this.sixHide.emit();if(i.defaultPrevented){this.open=true;return}this.willHide=true;this.open=false}async selectItemByIndex(i){if(this.sidebar==null)return;const s=this.sidebar.querySelector("slot");const t=((s===null||s===void 0?void 0:s.assignedElements())||[]).flatMap((i=>{var s;const t=(s=i.shadowRoot)===null||s===void 0?void 0:s.querySelector("six-details");if(t==null){return[]}return[t]}));if(i<0||i>t.length-1){console.error(`Tried to access sidebar menu item by index, but provided index out of range. Provided index: ${i}`);return}await t[i].show()}async selectItemByName(i){var s,t,e;const o=(s=this.sidebar)===null||s===void 0?void 0:s.querySelector("slot");const r=o===null||o===void 0?void 0:o.assignedElements();if(r==null){return}const n=r.findIndex((s=>(s===null||s===void 0?void 0:s.name)===i));const a=(e=(t=r.at(n))===null||t===void 0?void 0:t.shadowRoot)===null||e===void 0?void 0:e.querySelector("six-details");await(a===null||a===void 0?void 0:a.show())}resetTransitionVariables(){this.isVisible=this.open;this.willShow=false;this.willHide=false;this.open?this.sixAfterShow.emit():this.sixAfterHide.emit()}render(){return t("host",{key:"38d2d55b73e862c71ef3912fac01f6abd43a3b7c",class:"six-sidebar"},t("div",{key:"b8a7a32d48016310f943b42d03f1c4a44ff5bca4",class:{sidebar__container:true,"sidebar--visible":this.isVisible,"sidebar--open":this.open,"sidebar--left":this.position==="left","sidebar--right":this.position==="right"},style:{width:this.width,[`margin-${this.position}`]:this.open?"0":`calc(1rem - ${this.width})`},ref:i=>this.sidebar=i,"aria-hidden":this.open?"false":"true",onTransitionEnd:this.handleTransitionEnd},t("slot",{key:"a13e1cd44a68fa3ad15a94ccc56ec7c09f689e4c"})))}static get watchers(){return{open:["handleOpenChange"]}}};n.style=o;export{n as six_sidebar};
2
- //# sourceMappingURL=p-362ff192.entry.js.map
1
+ import{r as i,c as s,h as t}from"./p-JoG9I7EO.js";import{s as e}from"./p-BY6hIEFX.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:block;height:100%}.sidebar__container{height:100%;overflow:auto}.sidebar__container.sidebar--open{border-right:1px solid var(--six-color-web-rock-300)}.sidebar__container:not(.sidebar--visible){position:absolute;width:1px;height:1px;clip:rect(0 0 0 0);clip-path:inset(50%);overflow:hidden;pointer-events:none;visibility:hidden}.sidebar--left{color:var(--six-sidebar-color);background-color:var(--six-sidebar-background-color);transition:var(--six-transition-medium) margin-left;background-size:300vw 70%;background-position:bottom;background-repeat:no-repeat}.sidebar--right{transition:var(--six-transition-medium) margin-right}.sidebar--open.sidebar--left{margin-right:2px}.sidebar--open.sidebar--right{margin-left:2px}";const r=i=>{var s;return((s=i===null||i===void 0?void 0:i.tagName)===null||s===void 0?void 0:s.toLowerCase())==="six-sidebar-item-group"};const n=class{constructor(t){i(this,t);this.sixShow=s(this,"six-sidebar-show");this.sixAfterShow=s(this,"six-sidebar-after-show");this.sixHide=s(this,"six-sidebar-hide");this.sixAfterHide=s(this,"six-sidebar-after-hide");this.sixInitialFocus=s(this,"six-sidebar-initial-focus");this.willShow=false;this.willHide=false;this.isVisible=false;this.position="left";this.open=false;this.width="16rem";this.toggled=false;this.handleTransitionEnd=i=>{const s=i.target;if(i.type==="transitionend"&&s.classList.contains("sidebar__container")){this.resetTransitionVariables()}};this.closeSiblingDetailsOnShow=i=>{const s=i.target;if(this.sidebar!=null){e(s,this.sidebar)}const t=i=>{var t;let e=s;while(i(e)!=null){e=i(e);if(r(e)){const i=(t=e===null||e===void 0?void 0:e.shadowRoot)===null||t===void 0?void 0:t.querySelector("six-details");if(i!=null){i.open=false}}}};t((i=>i===null||i===void 0?void 0:i.previousElementSibling));t((i=>i===null||i===void 0?void 0:i.nextElementSibling))}}handleOpenChange(){this.open?this.show():this.hide()}componentWillLoad(){if(this.open){void this.show();this.resetTransitionVariables()}}componentDidRender(){this.setupTogglableMenuItems()}disconnectedCallback(){var i;(i=this.sidebar)===null||i===void 0?void 0:i.removeEventListener("six-details-show",this.closeSiblingDetailsOnShow)}setupTogglableMenuItems(){if(!this.toggled||this.sidebar==null)return;this.markAllMenuItemsAsSelectableEmpty();this.sidebar.addEventListener("six-details-show",this.closeSiblingDetailsOnShow)}markAllMenuItemsAsSelectableEmpty(){var i;const s=(i=this.sidebar)===null||i===void 0?void 0:i.querySelector("slot");const t=(s===null||s===void 0?void 0:s.assignedElements())||[];const e=[];while(t.length>0){const i=t.pop();if((i===null||i===void 0?void 0:i.shadowRoot)==null){continue}const s=i.shadowRoot.querySelectorAll("six-details");e.push(...s);const o=Array.from(i.children).filter(r);t.push(...o)}e.forEach((i=>i.selectableEmpty=true))}async toggle(){if(this.willShow||this.willHide){return}if(this.open){await this.hide()}else{await this.show()}}async show(){if(this.willShow){return}const i=this.sixShow.emit();if(i.defaultPrevented){this.open=false;return}this.willShow=true;this.isVisible=true;this.open=true}async hide(){if(this.willHide){return}const i=this.sixHide.emit();if(i.defaultPrevented){this.open=true;return}this.willHide=true;this.open=false}async selectItemByIndex(i){if(this.sidebar==null)return;const s=this.sidebar.querySelector("slot");const t=((s===null||s===void 0?void 0:s.assignedElements())||[]).flatMap((i=>{var s;const t=(s=i.shadowRoot)===null||s===void 0?void 0:s.querySelector("six-details");if(t==null){return[]}return[t]}));if(i<0||i>t.length-1){console.error(`Tried to access sidebar menu item by index, but provided index out of range. Provided index: ${i}`);return}await t[i].show()}async selectItemByName(i){var s,t,e;const o=(s=this.sidebar)===null||s===void 0?void 0:s.querySelector("slot");const r=o===null||o===void 0?void 0:o.assignedElements();if(r==null){return}const n=r.findIndex((s=>(s===null||s===void 0?void 0:s.name)===i));const a=(e=(t=r.at(n))===null||t===void 0?void 0:t.shadowRoot)===null||e===void 0?void 0:e.querySelector("six-details");await(a===null||a===void 0?void 0:a.show())}resetTransitionVariables(){this.isVisible=this.open;this.willShow=false;this.willHide=false;this.open?this.sixAfterShow.emit():this.sixAfterHide.emit()}render(){return t("host",{key:"11810533a79d5685e6ab768f0fbc8d9594d44de4",class:"six-sidebar"},t("div",{key:"6908b34bd6df174046145e9c4813278703e0d7cf",class:{sidebar__container:true,"sidebar--visible":this.isVisible,"sidebar--open":this.open,"sidebar--left":this.position==="left","sidebar--right":this.position==="right"},style:{width:this.width,[`margin-${this.position}`]:this.open?"0":`calc(1rem - ${this.width})`},ref:i=>this.sidebar=i,"aria-hidden":this.open?"false":"true",onTransitionEnd:this.handleTransitionEnd},t("slot",{key:"31557fda47113669da4d999a54f0074b37daffc8"})))}static get watchers(){return{open:["handleOpenChange"]}}};n.style=o;export{n as six_sidebar};
2
+ //# sourceMappingURL=p-21cbccb1.entry.js.map
@@ -0,0 +1,2 @@
1
+ import{h as t,r as e,c as i,g as s}from"./p-JoG9I7EO.js";import{E as r}from"./p-C4h4qpGl.js";import{D as o,d as a,a as n}from"./p-CKhg9ibv.js";import{h}from"./p-j3oIB5oT.js";import{m as l,c as d,a as c,b as u}from"./p-Dd6pdO8C.js";const p=t=>typeof t==="string";const m=t=>t==null;const b={en:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],monthsShortGrouped:[["Jan","Feb","Mar","Apr"],["May","Jun","Jul","Aug"],["Sep","Oct","Nov","Dec"]],weekdays:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],weekdaysShort:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],weekdaysMin:["Mo","Tu","We","Th","Fr","Sa","Su"]},de:{months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez."],monthsShortGrouped:[["Jan.","Feb.","März","Apr."],["Mai","Juni","Juli","Aug."],["Sep.","Okt.","Nov.","Dez."]],weekdays:["Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sonntag"],weekdaysShort:["Mo.","Di.","Mi.","Do.","Fr.","Sa.","So."],weekdaysMin:["Mo","Di","Mi","Do","Fr","Sa","So"]},fr:{months:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],monthsShort:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],monthsShortGrouped:[["janv.","févr.","mars","avr."],["mai","juin","juil.","août"],["sept.","oct.","nov.","déc."]],weekdays:["lundi","mardi","mercredi","jeudi","vendredi","samedi","dimanche"],weekdaysShort:["lun.","mar.","mer.","jeu.","ven.","sam.","dim."],weekdaysMin:["lu","ma","me","je","ve","sa","di"]},it:{months:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],monthsShort:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],monthsShortGrouped:[["gen","feb","mar","apr"],["mag","giu","lug","ago"],["set","ott","nov","dic"]],weekdays:["lunedì","martedì","mercoledì","giovedì","venerdì","sabato","domenica"],weekdaysShort:["lun","mar","mer","gio","ven","sab","dom"],weekdaysMin:["lu","ma","me","gi","ve","sa","do"]},es:{months:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],monthsShort:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],monthsShortGrouped:[["ene","feb","mar","abr"],["may","jun","jul","ago"],["sep","oct","nov","dic"]],weekdays:["lunes","martes","miércoles","jueves","viernes","sábado","domingo"],weekdaysShort:["lun","mar","mié","jue","vie","sáb","dom"],weekdaysMin:["lu","ma","mi","ju","vi","sa","do"]}};const y=()=>new Date;const f=t=>new Date(t.getFullYear(),t.getMonth(),t.getDate());const v=t=>t instanceof Date&&!isNaN(t.getTime())&&new Date(t).toString()!=="Invalid Date";const k=t=>{if(t&&v(t)){return t.getFullYear()}throw new Error("Not a valid date")};const g=t=>{if(t&&v(t)){return t.getMonth()}throw new Error("Not a valid date")};const w=t=>{if(t&&v(t)){return t.getDate()}throw new Error("Not a valid date")};const x=t=>{if(t&&v(t)){return t.getHours()}throw new Error("Not a valid date")};const _=t=>{if(t&&v(t)){return t.getMinutes()}throw new Error("Not a valid date")};const M=t=>{if(t&&v(t)){return t.getSeconds()}throw new Error("Not a valid date")};const D=t=>{const e=[6,0,1,2,3,4,5];const i=new Date(t);i.setDate(i.getDate()-e[i.getDay()]);return i};const j=(t,e)=>(t===null||t===void 0?void 0:t.getFullYear())===(e===null||e===void 0?void 0:e.getFullYear());const S=(t,e)=>j(t,e)&&(t===null||t===void 0?void 0:t.getMonth())===(e===null||e===void 0?void 0:e.getMonth());const C=(t,e)=>S(t,e)&&(t===null||t===void 0?void 0:t.getDate())===(e===null||e===void 0?void 0:e.getDate());const O=(t,e)=>C(D(t),D(e));const z=(t,e)=>{if(!p(t)||!p(e)){return false}if(t.length<6||e.length<6){return false}const{day:i,month:s}=U(t,e);if(i>31||s>11||i<=0||s<0){return false}const r=X(t,e);if(m(r)){return false}return r.toString()!=="Invalid Date"};const F=(t,e,i)=>{if(!t){return true}if(e&&t<e){return false}if(i&&i<t){return false}return true};const J=(t,e,i,s=2)=>{const r=s-1;const o=e.charAt(t+r)===i;const a=t+r<e.length;return a&&o};const N=(t,e)=>{let i=String(t);while(i.length<e){i="0"+i}return i};const A=(t,e)=>{if(t==null){return""}let i="";for(let s=0;s<e.length;s++){switch(e.charAt(s)){case"d":if(J(s,e,"d")){i+=N(t.getDate(),2);s++}else{i+=String(t.getDate())}break;case"m":if(J(s,e,"m")){i+=N(t.getMonth()+1,2);s++}else{i+=String(t.getMonth()+1)}break;case"y":if(J(s,e,"y",4)){s+=3;i+=t.getFullYear()}else{i+=(t.getFullYear()%100<10?"0":"")+t.getFullYear()%100;s++}break;case"h":if(J(s,e,"h")){i+=N(t.getHours(),2);s++}else{i+=String(t.getHours())}break;case"M":if(J(s,e,"M")){i+=N(t.getMinutes(),2);s++}else{i+=String(t.getMinutes())}break;case"s":if(J(s,e,"s")){i+=N(t.getSeconds(),2);s++}else{i+=String(t.getSeconds())}break;default:i+=e.charAt(s)}}return i};const E=/(\[[^\[]*\])|(mm|dd|yyyy|yy|hh|MM|ss|.)/g;const G=/\d\d/;const T=/\d{4}/;const I=/[^0-9]/g;const B="year";const P="month";const L="day";const Y="hour";const H="minute";const W="second";const q={};const K=(t,e,i)=>{const s=Array.isArray(t)?t:[t];let r;if(typeof i==="string"){r=t=>{const e=parseInt(t,10);return{[i]:e}}}else{r=i}s.forEach((t=>{q[t]=[e,r]}))};K("yy",G,(t=>{const e=(new Date).getFullYear();const i=Math.floor(e/100);let s=parseInt(t,10);s=(s>68?i-1:i)*100+s;return{[B]:s}}));K("yyyy",T,B);K("mm",G,(t=>({[P]:parseInt(t,10)-1})));K("dd",G,L);K("hh",G,Y);K("MM",G,H);K("ss",G,W);const R=(t,e=new Date)=>{const i=[0,0,1,0,0,0];const s=[e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds()];let r=true;for(let e=0;e<7;e++){if(t[e]===undefined){i[e]=r?s[e]:i[e]}else{i[e]=t[e];r=false}}return i};const V=(t,e,i,s,r,o)=>{if(!(t<100&&t>=0)){return new Date(t,e,i,s,r,o)}const a=new Date(t+400,e,i,s,r,o);if(isFinite(a.getFullYear())){a.setFullYear(t)}return a};const $=(t,e)=>{const i=e.match(E);if(!i){throw new Error}const{length:s}=i;let r={};for(let e=0;e<s;e+=1){const s=i[e];const o=q[s];if(!o){const e=s.replace(/^\[|\]$/g,"");if(t.indexOf(e)===0){t=t.substr(e.length)}else{throw new Error("not match")}}else{const e=o[0];const i=o[1];const s=(e.exec(t)||[])[0];const a=i(s);r=Object.assign(Object.assign({},r),a);t=t.replace(s,"")}}return r};const Q=(t,e)=>{if(t.length===e.length){return t}const i=t.match(I)[0];return t.split(i).map((t=>t.length===1?"0"+t:t)).join(i)};const U=(t,e)=>{const i=Q(t,e);return $(i,e)};const X=(t,e)=>{try{const{backupDate:i=new Date}={};const{year:s,month:r,day:o,hour:a,minute:n,second:h,date:l}=U(t,e);if(l!=null){return l}const d=[s,r,o,a,n,h];const c=R(d,i);return V(...c)}catch(t){return new Date(NaN)}};const Z=t=>{const{firstDateOfBox:e,allowedDates:i,dateFormat:s,selectedDate:r,minDate:o,maxDate:a,pointerDate:n}=t;const h=new Date(e);const l=new Date(e);let d=[];do{let t=[];do{t=[...t,{date:new Date(l),display:A(l,s),dateString:A(l,s),label:w(l).toString(),isToday:C(l,y()),isSelected:r&&C(l,r),isDisabled:!i(l)||!F(l,o,a),isOutdated:n.month!==l.getMonth()||!F(l,o,a)}];l.setDate(l.getDate()+1)}while(O(l,h));d=[...d,t];h.setDate(h.getDate()+7)}while(S(new Date(n.year,n.month,n.day),l));return d};function tt(t,e){const i=5;return[...Array(e).keys()].map((i=>i+t-Math.floor(e/2))).reduce(((t,e,s)=>{if(s%i===0){t.push([])}t[t.length-1].push(e);return t}),[])}var et;(function(t){t["DDMMYYY_DOT"]="dd.mm.yyyy";t["YYYYMMDD_DASH"]="yyyy-mm-dd";t["DDMMYYYY_DASH"]="dd-mm-yyyy";t["DDMMYYYY_SLASH"]="dd/mm/yyyy";t["YYYYMMDD_SLASH"]="yyyy/mm/dd";t["DDMMYY_DOT"]="dd.mm.yy";t["YYMMDD_DASH"]="yy-mm-dd";t["DDMMYY_DASH"]="dd-mm-yy";t["DDMMYY_SLASH"]="dd/mm/yy";t["YYMMDD_SLASH"]="yy/mm/dd";t["DDMMYYY_DOT_TIME"]="dd.mm.yyyy hh:MM:ss";t["YYYYMMDD_DASH_TIME"]="yyyy-mm-dd hh:MM:ss";t["DDMMYYYY_DASH_TIME"]="dd-mm-yyyy hh:MM:ss";t["DDMMYYYY_SLASH_TIME"]="dd/mm/yyyy hh:MM:ss";t["YYYYMMDD_SLASH_TIME"]="yyyy/mm/dd hh:MM:ss";t["DDMMYY_DOT_TIME"]="dd.mm.yy hh:MM:ss";t["YYMMDD_DASH_TIME"]="yy-mm-dd hh:MM:ss";t["DDMMYY_DASH_TIME"]="dd-mm-yy hh:MM:ss";t["DDMMYY_SLASH_TIME"]="dd/mm/yy hh:MM:ss";t["YYMMDD_SLASH_TIME"]="yy/mm/dd hh:MM:ss"})(et||(et={}));const it=e=>{const i=e.locale;const s=t=>i.monthsShort[y().getMonth()]===t;const r=t=>{var s;return((s=e.selectedDate)===null||s===void 0?void 0:s.getMonth())===i.monthsShort.findIndex((e=>e===t))};return t("table",{class:"datepicker-table",part:"month-selection"},t("tbody",null,i.monthsShortGrouped.map((i=>t("tr",{class:"datepicker-table__row"},i.map((i=>t("td",{onClick:()=>e.onClickMonthCell(i),class:{"datepicker-table__cell":true,"datepicker-table__cell--is-today":s(i),"datepicker-table__cell--is-selected":r(i)}},i))))))))};const st=e=>t("table",{class:"datepicker-table",part:"day-selection"},t("thead",{part:"weekday-header"},e.locale.weekdaysMin.map((e=>t("th",{class:"datepicker__cell"},e)))),t("tbody",null,e.calendarGrid.map((i=>t("tr",{class:"datepicker-table__row"},i.map((i=>t("td",{"data-date":i.dateString,onClick:()=>e.onClickDateCell(i),class:{"datepicker-table__cell":true,"datepicker-table__cell--is-today":i.isToday,"datepicker-table__cell--is-selected":i.isSelected,"datepicker-table__cell--is-outdated":i.isOutdated,"datepicker-table__cell--is-disabled":i.isDisabled,"datepicker-table__cell--is-selectable":!i.isDisabled}},i.label))))))));const rt=e=>t("table",{class:"datepicker-table",part:"year-selection"},t("tbody",null,e.yearSelection.map((i=>t("tr",{class:"datepicker-table__row"},i.map((i=>{var s;return t("td",{onClick:()=>e.onClickYearCell(i),class:{"datepicker-table__cell":true,"datepicker-table__cell--is-today":y().getFullYear()===i,"datepicker-table__cell--is-selected":((s=e.selectedDate)===null||s===void 0?void 0:s.getFullYear())===i}},i)})))))));const ot=":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)}.datepicker__container{position:relative}.datepicker__popup{min-width:400px;background-color:white;padding:0.5em 0.5em 1.5em;box-shadow:0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12);user-select:none;position:absolute;z-index:var(--six-z-index-dropdown);right:0;left:0}.datepicker__popup--is-up{bottom:100%;min-height:382px}.datepicker__popup--is-inline{position:initial;box-shadow:none;border:1px solid var(--six-color-web-rock-400)}.datepicker-header{display:flex;justify-content:space-between;border-bottom:1px solid var(--six-color-web-rock-400);padding:0.5em;margin-bottom:1em}.datepicker-header svg{fill:var(--six-color-web-rock-900);stroke:none}.datepicker-header__btn{cursor:pointer;width:2.5em;height:2.5em;display:flex;vertical-align:middle;align-items:center;justify-content:center}.datepicker-header__btn:hover{background-color:var(--six-color-web-rock-100);border-radius:100%}.datepicker-header__label{display:flex}.datepicker-header__label>div{cursor:pointer;padding:0.5em;display:flex;vertical-align:middle;align-items:center;justify-content:center}.datepicker-header__label>div:hover{background-color:var(--six-color-web-rock-100)}.datepicker-table{width:100%}.datepicker-table__cell{text-align:center;width:2.5rem;height:2.5rem;cursor:pointer}.datepicker-table__cell:hover{background-color:var(--six-color-web-rock-100)}.datepicker-table__cell--is-today{border:1px solid var(--six-color-web-rock-400)}.datepicker-table__cell--is-selected{background-color:var(--six-color-red);color:var(--six-color-white)}.datepicker-table__cell--is-disabled{background-color:var(--six-color-web-rock-200);cursor:initial}.datepicker-table__cell--is-disabled:hover{background-color:var(--six-color-web-rock-200)}.datepicker-table__cell--is-outdated{color:var(--six-color-web-rock-400)}.datepicker-clear{display:inline-flex;align-items:center;font-size:inherit;color:var(--six-input-icon-color);border:none;background:none;padding:0;transition:var(--six-transition-fast) color;cursor:pointer}.datepicker-clear:hover{color:var(--six-input-icon-color-hover)}.datepicker-clear:focus{outline:none}.datepicker-clear--right{right:0;position:absolute}.datepicker-clear--left{right:35px;position:absolute}.input--empty .datepicker-clear{visibility:hidden}.prefix{cursor:pointer}.prefix--right{right:0;display:inline-flex;position:absolute;font-size:inherit;color:var(--six-input-icon-color);border:none;background:none;margin-right:var(--six-input-spacing-medium);transition:var(--six-transition-fast) color}six-timepicker::part(popup){border:none;padding:0.5em 0.5em 0;min-height:0}";const at=25;const nt=400;var ht;(function(t){t["DAY"]="day";t["MONTH"]="month";t["YEAR"]="year"})(ht||(ht={}));const lt=class{constructor(t){e(this,t);this.sixSelect=i(this,"six-datepicker-select");this.sixClear=i(this,"six-datepicker-clear");this.sixBlur=i(this,"six-datepicker-blur");this.eventListeners=new r;this.pointerDate=lt.getCurrentDateAsPointer();this.selectionMode=ht.DAY;this.isDropDownContentUp=false;this.type="date";this.locale="en";this.open=false;this.inline=false;this.readonly=false;this.disabled=false;this.allowedDates=()=>true;this.closeOnSelect=this.type==="date";this.size="medium";this.required=false;this.label="";this.errorText="";this.invalid=false;this.dateFormat=et.DDMMYYY_DOT;this.debounce=o;this.name="";this.clearable=false;this.iconPosition="left";this.hoist=false;this.previousUnit=()=>{if(this.selectionMode===ht.DAY){this.previousMonth()}else if(this.selectionMode===ht.MONTH){this.previousYear()}else if(this.selectionMode===ht.YEAR){this.previousYearGroup()}};this.nextUnit=()=>{if(this.selectionMode===ht.DAY){this.nextMonth()}else if(this.selectionMode===ht.MONTH){this.nextYear()}else if(this.selectionMode===ht.YEAR){this.nextYearGroup()}};this.handleDocumentKeyDown=t=>{var e;const i=t;if(this.open&&i.key==="Escape"){i.stopPropagation();this.closePopup();void((e=this.inputElement)===null||e===void 0?void 0:e.setFocus())}if(i.key==="Tab"){this.closePopup()}};this.handleDocumentMouseDown=t=>{const e=t.composedPath();if(!e.includes(this.container)){this.closePopup();return}};this.handleClearClick=async t=>{t.stopPropagation();await this.select(undefined);this.sixClear.emit()};this.onTimepickerChange=t=>{const e=t.detail.value;const i=new Date;if(this.selectedDate!=null){i.setFullYear(this.selectedDate.getFullYear(),this.selectedDate.getMonth(),this.selectedDate.getDate())}if(e!=null){const t=e.hours;const s=e.minutes;const r=e.seconds;if(t!=null){i.setHours(t,s,r)}}this.updateValue(i);this.updatePointerDates()};this.onClickDateCell=t=>{if(!t.isDisabled){void this.select(t.dateString)}};this.onClickMonthCell=t=>{const e=b[this.locale].monthsShort.findIndex((e=>e===t));this.pointerDate=Object.assign(Object.assign({},this.pointerDate),{month:e});this.selectionMode=ht.DAY};this.onClickYearCell=t=>{this.pointerDate=Object.assign(Object.assign({},this.pointerDate),{year:t});this.selectionMode=ht.DAY};this.handleInputChange=t=>{if(this.inputElement==null){return}t.stopPropagation();const e=this.inputElement.value;if(!z(e,this.dateFormat)){return}const i=X(e,this.dateFormat);if(i===undefined){return}this.updateIfChanged(i);const s=e.replace(/[^\d]/g,"");if(s.length>=6){const t=X(e,this.dateFormat);const i=A(t,this.dateFormat);if(z(i,this.dateFormat)){this.selectedDate=X(i,this.dateFormat);this.updatePointerDates();this.updateValue(this.selectedDate)}}};this.handleOnBlur=t=>{var e,i,s;t.stopPropagation();if(((e=this.inputElement)===null||e===void 0?void 0:e.value)===""&&v(this.value)){this.value=undefined;this.sixSelect.emit(this.value)}const r=X((i=this.inputElement)===null||i===void 0?void 0:i.value,this.dateFormat);if(v(r)&&((s=this.value)===null||s===void 0?void 0:s.getTime())!==(r===null||r===void 0?void 0:r.getTime())){this.value=r}if(this.inputElement!=null){this.inputElement.value=A(this.value,this.dateFormat)}this.sixBlur.emit(this.value)}}debounceChanged(){this.sixSelect=a(this.sixSelect,this.debounce)}valueChanged(){if(this.value!=null&&!v(this.value)){console.warn("invalid date value: ",this.value);this.value=undefined;this.sixSelect.emit(this.value)}this.selectedDate=this.value;this.updatePointerDates()}async resizeHandler(){this.updateDropdownDirection();this.moveOpenHoistedPopup();this.adjustPopupPosition()}async scrollHandler(){this.updateDropdownDirection();this.moveOpenHoistedPopup()}moveOpenHoistedPopup(){l(this.hoist,this.open,this.popup,this.inputElement,this.wrapper,nt)}get container(){return this.containingElement||this.host}get firstDateOfBox(){const t=new Date(this.pointerDate.year,this.pointerDate.month,1);return D(t)}async setFocus(t){var e;(e=this.inputElement)===null||e===void 0?void 0:e.setFocus(t)}get calendarGrid(){return Z({firstDateOfBox:this.firstDateOfBox,allowedDates:this.allowedDates,dateFormat:this.dateFormat,selectedDate:this.selectedDate,minDate:this.min,maxDate:this.max,pointerDate:this.pointerDate})}updateDropdownDirection(){if(this.inputElement==null||this.wrapper==null){return}this.isDropDownContentUp=d(this.inputElement,this.wrapper,nt)}getMonthStringForIndex(t){return b[this.locale].months[t]}previousYear(){this.pointerDate=Object.assign(Object.assign({},this.pointerDate),{year:this.pointerDate.year-1})}previousYearGroup(){this.pointerDate=Object.assign(Object.assign({},this.pointerDate),{year:this.pointerDate.year-at})}previousMonth(){if(this.pointerDate.month===0){this.pointerDate={year:this.pointerDate.year-1,month:11,day:1,hours:0,minutes:0,seconds:0}}else{this.pointerDate={year:this.pointerDate.year,month:this.pointerDate.month-1,day:1,hours:0,minutes:0,seconds:0}}}nextMonth(){if(this.pointerDate.month===11){this.pointerDate={year:this.pointerDate.year+1,month:0,day:1,hours:0,minutes:0,seconds:0}}else{this.pointerDate={year:this.pointerDate.year,month:this.pointerDate.month+1,day:1,hours:0,minutes:0,seconds:0}}}nextYear(){this.pointerDate=Object.assign(Object.assign({},this.pointerDate),{year:this.pointerDate.year+1})}nextYearGroup(){this.pointerDate=Object.assign(Object.assign({},this.pointerDate),{year:this.pointerDate.year+at})}openCalendar(){if(!this.open&&!this.disabled){this.open=true;this.setupEventListenersForOpenPopup()}}setupEventListenersForOpenPopup(){this.eventListeners.add(document,"keydown",this.handleDocumentKeyDown);this.eventListeners.add(document,"mousedown",this.handleDocumentMouseDown)}closePopup(){if(this.inline){return}this.open=false;this.eventListeners.remove(document,"keydown",this.handleDocumentKeyDown);this.eventListeners.remove(document,"mousedown",this.handleDocumentMouseDown);this.selectionMode=ht.DAY}updatePointerDates(){const t=this.getPointerDate();if(this.differsFromPointerDate(t)){this.pointerDate={year:k(t),month:g(t),day:w(t),hours:x(t),minutes:_(t),seconds:M(t)}}}differsFromPointerDate(t){return this.pointerDate.day!==w(t)||this.pointerDate.month!==g(t)||this.pointerDate.year!==k(t)||this.pointerDate.hours!==x(t)||this.pointerDate.minutes!==_(t)||this.pointerDate.seconds!==M(t)}getPointerDate(){if(this.selectedDate!==undefined&&this.selectedDate!==null){return this.selectedDate}if(this.defaultDate==null){return this.type==="date"?f(y()):y()}else{return X(this.defaultDate,this.dateFormat)}}updateValue(t){this.updateIfChanged(t)}updateIfChanged(t){var e;if(((e=this.value)===null||e===void 0?void 0:e.getTime())===(t===null||t===void 0?void 0:t.getTime())){return}this.value=t;this.sixSelect.emit(this.value)}async select(t){if(t==null){this.updateValue(undefined)}else{const e=X(t,this.dateFormat);e===null||e===void 0?void 0:e.setHours(this.pointerDate.hours,this.pointerDate.minutes,this.pointerDate.seconds);this.updateValue(e)}this.updatePointerDates();if(this.closeOnSelect){this.closePopup()}}componentWillLoad(){this.selectedDate=this.value;this.updatePointerDates();this.updateValue(this.value);if(this.inline){this.open=true}if(this.open){this.setupEventListenersForOpenPopup()}}componentDidLoad(){if(this.inputElement!=null){this.eventListeners.add(this.inputElement,"six-input-input",n(this.handleInputChange,this.debounce));this.eventListeners.add(this.inputElement,"six-input-blur",this.handleOnBlur)}}componentDidRender(){this.adjustPopupPosition()}renderHeader(){return t("header",{class:"datepicker-header",part:"header"},t("div",{class:"datepicker-header__btn prev",onClick:this.previousUnit},t("svg",{viewBox:"0 5 13 13",width:"14",height:"23"},t("path",{d:"M11.67 3.87L9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z"}))),t("div",{class:"datepicker-header__label"},this.selectionMode===ht.DAY&&t("div",{onClick:()=>this.selectionMode=ht.MONTH},t("span",{class:"datepicker-header__label-month"},this.getMonthStringForIndex(this.pointerDate.month)),t("span",null,t("svg",{viewBox:"-3 -4 24 24",width:"20",height:"20"},t("polyline",{points:"6 9 12 15 18 9"})))),this.selectionMode!==ht.YEAR&&t("div",{onClick:()=>this.selectionMode=ht.YEAR},t("span",{class:"datepicker-header__label-year"},this.pointerDate.year),t("span",null,t("svg",{viewBox:"-3 -4 24 24",width:"20",height:"20"},t("polyline",{points:"6 9 12 15 18 9"})))),this.selectionMode===ht.YEAR&&t("div",null,this.pointerDate.year-Math.floor(at/2)," –"," ",this.pointerDate.year+Math.floor(at/2))),t("div",{class:"datepicker-header__btn next",onClick:this.nextUnit},t("svg",{viewBox:"5 5 13 13",width:"14",height:"23"},t("path",{d:"M5.88 4.12L13.76 12l-7.88 7.88L8 22l10-10L8 2z"}))))}renderBody(){switch(this.selectionMode){case ht.DAY:return t(st,{locale:b[this.locale],calendarGrid:this.calendarGrid,onClickDateCell:this.onClickDateCell});case ht.MONTH:return t(it,{locale:b[this.locale],selectedDate:this.selectedDate,onClickMonthCell:this.onClickMonthCell});case ht.YEAR:return t(rt,{selectedDate:this.selectedDate,yearSelection:tt(this.pointerDate.year,at),onClickYearCell:this.onClickYearCell})}}renderCustomIcon(){const e=h(this.host,"custom-icon")?t("slot",{name:"custom-icon"}):t("six-icon",{size:this.size==="large"?"medium":this.size},"today");return t("span",{slot:"prefix",part:"icon",class:{prefix:true,"prefix--right":this.iconPosition==="right"}},e)}renderClearable(){return this.clearable&&t("button",{slot:"suffix",class:{"datepicker-clear":true,"datepicker-clear--right":this.iconPosition==="left","datepicker-clear--left":this.iconPosition==="right"},type:"button",onClick:this.handleClearClick,tabindex:"-1"},t("six-icon",{size:"small"},"clear"))}render(){var e,i,s;this.adjustPopupPosition();return t("div",{key:"93ace26fe1c49f134681e47d198dcbb2a75cdb87",ref:t=>this.wrapper=t,class:"datepicker__container"},t("six-input",{key:"d823eebd5cb0a257902c6265298cf4ac5f155cc5",part:"base",value:A(this.value,this.dateFormat),ref:t=>this.inputElement=t,placeholder:this.placeholder,readonly:this.readonly,disabled:this.disabled,name:this.name,label:this.label,required:this.required,errorText:this.errorText,errorTextCount:this.errorTextCount,invalid:this.invalid,onClick:()=>this.openCalendar(),size:this.size,class:{"input--empty":this.value==null}},this.renderCustomIcon(),this.renderClearable(),h(this.host,"label")?t("span",{slot:"label"},t("slot",{name:"label"})):null,h(this.host,"error-text")?t("span",{slot:"error-text"},t("slot",{name:"error-text"})):null),this.open&&t("div",{key:"2a8e648342d25bf1685705137cecaa2d9ed7d482",part:"popup",ref:t=>this.popup=t,class:{datepicker__popup:true,"datepicker__popup--is-up":this.placement!=null?this.placement==="top":this.isDropDownContentUp,"datepicker__popup--is-inline":this.inline}},this.renderHeader(),this.renderBody(),this.type==="date-time"&&t("six-timepicker",{key:"710a9c6b161dc6b1c1791a550d120d468f4f97d1",debounce:this.debounce,inline:true,"onSix-timepicker-change-debounced":t=>this.onTimepickerChange(t),value:((e=this.selectedDate)===null||e===void 0?void 0:e.getHours())+":"+((i=this.selectedDate)===null||i===void 0?void 0:i.getMinutes())+":"+((s=this.selectedDate)===null||s===void 0?void 0:s.getSeconds())}),t("div",{key:"8bb2e6b2b81caf1ba06038a426b59d8fbdfe51d0",class:"datepicker__footer"},t("slot",{key:"67fbcbfc24055d03cba4b7372f65932b83453c39"}))))}adjustPopupPosition(){c(this.hoist,this.popup,this.inputElement,this.wrapper,nt,(t=>this.isDropDownContentUp=t));u(this.popup)}connectedCallback(){this.eventListeners.forward("six-datepicker-select","change",this.host);this.eventListeners.forward("six-datepicker-blur","blur",this.host)}disconnectedCallback(){this.eventListeners.removeAll()}static getCurrentDateAsPointer(){return{year:k(y()),month:g(y()),day:w(y()),hours:x(y()),minutes:_(y()),seconds:M(y())}}get host(){return s(this)}static get watchers(){return{debounce:["debounceChanged"],value:["valueChanged"]}}};lt.style=ot;export{lt as six_datepicker};
2
+ //# sourceMappingURL=p-38c51fd1.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isString","value","isNil","i18nDate","en","months","monthsShort","monthsShortGrouped","weekdays","weekdaysShort","weekdaysMin","de","fr","it","es","now","Date","removeTime","date","getFullYear","getMonth","getDate","isValidDate","isNaN","getTime","toString","year","Error","month","day","hours","getHours","minutes","getMinutes","seconds","getSeconds","getFirstDayOfTheWeek","weekdayDiff","setDate","getDay","isSameYear","a","b","isSameMonth","isSameDay","isSameWeek","isValidDateString","datestring","format","length","getDateParts","toDate","isInRange","minDate","maxDate","lookAhead","iFormat","match","increment","followingCharacterMatches","charAt","hasProperLength","formatNumber","len","num","String","formatDate","output","FORMATTING_TOKENS","TWO_NUMERICS_REGEX","FOUR_NUMERICS_REGEX","NON_NUMERIC_REGEX","YEAR","MONTH","DAY","HOUR","MINUTE","SECOND","parseFlags","addParseFlag","token","regex","callback","tokens","Array","isArray","func","input","parseInt","forEach","key","cent","Math","floor","getFullInputArray","backupDate","result","backupArr","useBackup","i","undefined","createDate","hour","minute","second","isFinite","setFullYear","makeParser","dateString","mark","parseTo","word","replace","indexOf","substr","parser","exec","obj","Object","assign","getCleanDateString","dirtyDateString","separator","split","map","s","join","inputArray","e","NaN","createCalendarGrid","calendarGridArguments","firstDateOfBox","allowedDates","dateFormat","selectedDate","pointerDate","weekDatePointer","dayDatePointer","calendar","row","display","label","isToday","isSelected","isDisabled","isOutdated","rangeAround","number","range","itemsPerGroup","keys","n","reduce","curr","item","index","push","SixDateFormats","MonthSelection","monthSelectionParams","locale","isSelectedMonth","_a","findIndex","m","h","class","part","onClick","onClickMonthCell","DaySelection","daySelectionParams","weekday","calendarGrid","cell","onClickDateCell","YearSelection","yearSelectionParams","yearSelection","onClickYearCell","sixDatepickerCss","NUMBER_OF_YEARS_SHOWN","MIN_POPUP_HEIGHT","SelectionMode","SixDatepicker","constructor","hostRef","this","eventListeners","EventListeners","getCurrentDateAsPointer","selectionMode","isDropDownContentUp","type","open","inline","readonly","disabled","closeOnSelect","size","required","errorText","invalid","DDMMYYY_DOT","debounce","DEFAULT_DEBOUNCE_FAST","name","clearable","iconPosition","hoist","previousUnit","previousMonth","previousYear","previousYearGroup","nextUnit","nextMonth","nextYear","nextYearGroup","handleDocumentKeyDown","event","keyboardEvent","stopPropagation","closePopup","inputElement","setFocus","handleDocumentMouseDown","path","composedPath","includes","container","handleClearClick","async","select","sixClear","emit","onTimepickerChange","sixTimepickerChange","time","detail","newDate","setHours","updateValue","updatePointerDates","selectedMonth","monthShort","handleInputChange","inputValue","inputValueDate","updateIfChanged","datesOnly","dateAsString","handleOnBlur","sixSelect","currentDate","_b","_c","sixBlur","debounceChanged","debounceEvent","valueChanged","console","warn","resizeHandler","updateDropdownDirection","moveOpenHoistedPopup","adjustPopupPosition","scrollHandler","movePopup","popup","wrapper","containingElement","host","options","min","max","calcIsDropDownContentUp","getMonthStringForIndex","openCalendar","setupEventListenersForOpenPopup","add","document","remove","getPointerDate","differsFromPointerDate","defaultDate","componentWillLoad","componentDidLoad","componentDidRender","renderHeader","viewBox","width","height","d","points","renderBody","renderCustomIcon","icon","hasSlot","slot","prefix","renderClearable","tabindex","render","ref","el","placeholder","errorTextCount","datepicker__popup","placement","adjustPopupForHoisting","isUp","adjustPopupForSmallScreens","connectedCallback","forward","disconnectedCallback","removeAll"],"sources":["src/utils/type-check.ts","src/utils/date-util.ts","src/components/six-datepicker/six-date-formats.tsx","src/components/six-datepicker/components/month-selection.tsx","src/components/six-datepicker/components/day-selection.tsx","src/components/six-datepicker/components/year-selection.tsx","src/components/six-datepicker/six-datepicker.scss?tag=six-datepicker&encapsulation=shadow","src/components/six-datepicker/six-datepicker.tsx"],"sourcesContent":["export const isString = (value: unknown): value is string => typeof value === 'string';\n\n// only use '==' instead of '===' to also catch undefined and void\nexport const isNil = (value: unknown): value is undefined | null => value == null;\n\nexport const isDate = (value: unknown): value is Date => value instanceof Date;\n","/* eslint-disable */\n// @ts-nocheck\n\nimport { isDate, isNil, isString } from './type-check';\nimport { SixDateFormats } from '../components/six-datepicker/six-date-formats';\nimport { CalendarCell } from '../components/six-datepicker/six-datepicker';\n\nexport type DateLocale = typeof i18nDate.en;\nexport const i18nDate = {\n en: {\n months: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n ],\n monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n monthsShortGrouped: [\n ['Jan', 'Feb', 'Mar', 'Apr'],\n ['May', 'Jun', 'Jul', 'Aug'],\n ['Sep', 'Oct', 'Nov', 'Dec'],\n ],\n weekdays: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],\n weekdaysShort: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],\n weekdaysMin: ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'],\n },\n de: {\n months: [\n 'Januar',\n 'Februar',\n 'März',\n 'April',\n 'Mai',\n 'Juni',\n 'Juli',\n 'August',\n 'September',\n 'Oktober',\n 'November',\n 'Dezember',\n ],\n monthsShort: ['Jan.', 'Feb.', 'März', 'Apr.', 'Mai', 'Juni', 'Juli', 'Aug.', 'Sep.', 'Okt.', 'Nov.', 'Dez.'],\n monthsShortGrouped: [\n ['Jan.', 'Feb.', 'März', 'Apr.'],\n ['Mai', 'Juni', 'Juli', 'Aug.'],\n ['Sep.', 'Okt.', 'Nov.', 'Dez.'],\n ],\n weekdays: ['Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag', 'Sonntag'],\n weekdaysShort: ['Mo.', 'Di.', 'Mi.', 'Do.', 'Fr.', 'Sa.', 'So.'],\n weekdaysMin: ['Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', 'So'],\n },\n fr: {\n months: [\n 'janvier',\n 'février',\n 'mars',\n 'avril',\n 'mai',\n 'juin',\n 'juillet',\n 'août',\n 'septembre',\n 'octobre',\n 'novembre',\n 'décembre',\n ],\n monthsShort: ['janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'],\n monthsShortGrouped: [\n ['janv.', 'févr.', 'mars', 'avr.'],\n ['mai', 'juin', 'juil.', 'août'],\n ['sept.', 'oct.', 'nov.', 'déc.'],\n ],\n weekdays: ['lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi', 'dimanche'],\n weekdaysShort: ['lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.', 'dim.'],\n weekdaysMin: ['lu', 'ma', 'me', 'je', 've', 'sa', 'di'],\n },\n it: {\n months: [\n 'gennaio',\n 'febbraio',\n 'marzo',\n 'aprile',\n 'maggio',\n 'giugno',\n 'luglio',\n 'agosto',\n 'settembre',\n 'ottobre',\n 'novembre',\n 'dicembre',\n ],\n monthsShort: ['gen', 'feb', 'mar', 'apr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov', 'dic'],\n monthsShortGrouped: [\n ['gen', 'feb', 'mar', 'apr'],\n ['mag', 'giu', 'lug', 'ago'],\n ['set', 'ott', 'nov', 'dic'],\n ],\n weekdays: ['lunedì', 'martedì', 'mercoledì', 'giovedì', 'venerdì', 'sabato', 'domenica'],\n weekdaysShort: ['lun', 'mar', 'mer', 'gio', 'ven', 'sab', 'dom'],\n weekdaysMin: ['lu', 'ma', 'me', 'gi', 've', 'sa', 'do'],\n },\n es: {\n months: [\n 'enero',\n 'febrero',\n 'marzo',\n 'abril',\n 'mayo',\n 'junio',\n 'julio',\n 'agosto',\n 'septiembre',\n 'octubre',\n 'noviembre',\n 'diciembre',\n ],\n monthsShort: ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic'],\n monthsShortGrouped: [\n ['ene', 'feb', 'mar', 'abr'],\n ['may', 'jun', 'jul', 'ago'],\n ['sep', 'oct', 'nov', 'dic'],\n ],\n weekdays: ['lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado', 'domingo'],\n weekdaysShort: ['lun', 'mar', 'mié', 'jue', 'vie', 'sáb', 'dom'],\n weekdaysMin: ['lu', 'ma', 'mi', 'ju', 'vi', 'sa', 'do'],\n },\n};\n\n/**\n * Returns a JS Date instance of the exact moment\n *\n * ```typescript\n * const date = now()\n * // Wed Mar 10 2021 20:30:32 GMT+0100 (Central European Standard Time)\n * ```\n */\nexport const now = () => new Date();\n\nexport const removeTime = (date: Date) => new Date(date.getFullYear(), date.getMonth(), date.getDate());\n\nexport const pad = (value: number) => String(value).padStart(2, '0');\n\n/**\n * Returns `true` if the given date is valid\n */\nexport const isValidDate = (value: unknown): boolean => {\n return value instanceof Date && !isNaN(value.getTime()) && new Date(value).toString() !== 'Invalid Date';\n};\n\n/**\n * Returns the year number of the given date\n *\n * ```typescript\n * year(new Date(2020, 0, 1)) // 2020\n * ```\n */\nexport const year = (date: Date | undefined): number => {\n if (date && isValidDate(date)) {\n return date.getFullYear();\n }\n throw new Error('Not a valid date');\n};\n\n/**\n * Returns the month number of the given date\n *\n * ```typescript\n * month(new Date(2020, 0, 1)) // 0\n * ```\n */\nexport const month = (date: Date | undefined): number => {\n if (date && isValidDate(date)) {\n return date.getMonth();\n }\n throw new Error('Not a valid date');\n};\n\n/**\n * Returns the day number of the given date\n *\n * ```typescript\n * day(new Date(2020, 0, 1)) // 1\n * ```\n */\nexport const day = (date: Date | undefined): number => {\n if (date && isValidDate(date)) {\n return date.getDate();\n }\n throw new Error('Not a valid date');\n};\n\n/**\n * Returns the hours of the given date\n */\nexport const hours = (date: Date | undefined): number => {\n if (date && isValidDate(date)) {\n return date.getHours();\n }\n throw new Error('Not a valid date');\n};\n\n/**\n * Returns the minutes of the given date\n */\nexport const minutes = (date: Date | undefined): number => {\n if (date && isValidDate(date)) {\n return date.getMinutes();\n }\n throw new Error('Not a valid date');\n};\n\n/**\n * Returns the seconds of the given date\n */\nexport const seconds = (date: Date | undefined): number => {\n if (date && isValidDate(date)) {\n return date.getSeconds();\n }\n throw new Error('Not a valid date');\n};\n\n/**\n * Returns the first day of the week of the given date.\n */\nexport const getFirstDayOfTheWeek = (date: Date) => {\n const weekdayDiff = [6, 0, 1, 2, 3, 4, 5];\n const day = new Date(date);\n day.setDate(day.getDate() - weekdayDiff[day.getDay()]);\n return day;\n};\n\n/**\n * Returns `true` when the year of the dates are the same\n */\nexport const isSameYear = (a: Date | undefined, b: Date | undefined) => a?.getFullYear() === b?.getFullYear();\n\n/**\n * Returns `true` when the month of the dates are the same\n */\nexport const isSameMonth = (a: Date | undefined, b: Date | undefined) =>\n isSameYear(a, b) && a?.getMonth() === b?.getMonth();\n\n/**\n * Returns `true` when the day of the dates are the same\n */\nexport const isSameDay = (a: Date | undefined, b: Date | undefined) =>\n isSameMonth(a, b) && a?.getDate() === b?.getDate();\n\n/**\n * Returns `true` when the week of the dates are the same\n */\nexport const isSameWeek = (a: Date, b: Date) => isSameDay(getFirstDayOfTheWeek(a), getFirstDayOfTheWeek(b));\n\nconst localDatetime = (date: Date) => new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));\n\n/**\n * Returns the ISO string `yyyy-mm-dd` of the given date\n *\n * ```typescript\n * isoString(new Date(2020, 0, 13)) // '2020-01-13'\n * ```\n */\nexport const isoString = (date: Date | undefined): string => {\n if (isNil(date) || Date.toString() === 'Invalid Date') {\n return '';\n }\n\n return `${year(date)}-${pad(month(date) + 1)}-${pad(day(date))}`;\n};\n\n/**\n * Returns the ISO string `yyyy-mm-dd` of the given parameters year, month and day\n *\n * ```typescript\n * newDateString(2020, 0, 13) // '2020-01-13'\n * or\n * newDateString(new Date(2020, 0, 13)) // '2020-01-13'\n * ```\n */\nexport const newDateString = (yearOrDate: Date | number, month?: number, day?: number): string => {\n let date;\n if (isDate(yearOrDate)) {\n date = localDatetime(yearOrDate);\n } else {\n date = new Date(Date.UTC(yearOrDate, (month as number) - 1, day as number));\n }\n\n return isoString(date);\n};\n\n/**\n * Returns `true` if the given datestring is valid\n */\nexport const isValidDateString = (datestring: string | undefined, format: string) => {\n if (!isString(datestring) || !isString(format)) {\n return false;\n }\n\n if (datestring.length < 6 || format.length < 6) {\n return false;\n }\n\n const { day, month } = getDateParts(datestring, format);\n\n if (day > 31 || month > 11 || day <= 0 || month < 0) {\n return false;\n }\n\n const date = toDate(datestring, format);\n\n if (isNil(date)) {\n return false;\n }\n\n return date.toString() !== 'Invalid Date';\n};\n\n/**\n * Returns `true` when the given date is not smaller than the minDate and not bigger than the maxDate.\n *\n * ```typescript\n * isInRange(new Date(2020, 1, 1), new Date(2020, 0, 1), new Date(2020, 2, 1)) // true\n * ```\n */\nexport const isInRange = (date: Date | undefined, minDate: Date | undefined, maxDate: Date | undefined): boolean => {\n if (!date) {\n return true;\n }\n\n if (minDate && date < minDate) {\n return false;\n }\n\n if (maxDate && maxDate < date) {\n return false;\n }\n\n return true;\n};\n\nconst validateTwoDates = (\n first: any,\n second: Date | string | undefined,\n validateFn: (irst: Date, second: Date) => boolean\n) => {\n if (isNil(first) && isNil(second)) {\n return false;\n }\n\n const _first: Date = new Date(first as string | Date);\n const _second: Date = new Date(second as string | Date);\n\n if (!isValidDate(_first) || !isValidDate(_second)) {\n return false;\n }\n\n return validateFn(_first, _second);\n};\n\n/**\n * Returns `true` when the given date is not smaller than the before date.\n *\n * ```typescript\n * isBefore(new Date(2020, 1, 1), new Date(2020, 3, 1)) // true\n * ```\n */\nexport const isBefore = (date: any, beforeDate: Date | string | undefined): boolean =>\n validateTwoDates(date, beforeDate, (first, second) => first < second);\n\n/**\n * Returns `true` when the given date is not smaller than the before date.\n *\n * ```typescript\n * isAfter(new Date(2020, 5, 1), new Date(2020, 3, 1)) // true\n * ```\n */\nexport const isAfter = (date: any, afterDate: Date | string | undefined): boolean =>\n validateTwoDates(date, afterDate, (first, second) => first > second);\n\n/**\n * Increases the year of a date and retunrs the result\n *\n * ```typescript\n * increaseYear(new Date(2020, 0, 1), 1) // 2021\n * ```\n */\nexport const increaseYear = (date: Date, years: number): number => year(date) + years;\n\n/**\n * Decreases the year of a date and retunrs the result\n *\n * ```typescript\n * decreaseYear(new Date(2020, 0, 1), 1) // 2019\n * ```\n */\nexport const decreaseYear = (date: Date, years: number): number => year(date) - years;\n\nconst lookAhead = (iFormat: number, format: string, match: string, length = 2) => {\n const increment = length - 1;\n const followingCharacterMatches = format.charAt(iFormat + increment) === match;\n const hasProperLength = iFormat + increment < format.length;\n return hasProperLength && followingCharacterMatches;\n};\n\nconst formatNumber = (value, len) => {\n let num = String(value);\n\n while (num.length < len) {\n num = '0' + num;\n }\n\n return num;\n};\n\nexport const formatDate = (date: Date | undefined | null, format: string): string => {\n if (date == null) {\n return '';\n }\n\n let output = '';\n\n for (let iFormat = 0; iFormat < format.length; iFormat++) {\n switch (format.charAt(iFormat)) {\n case 'd':\n if (lookAhead(iFormat, format, 'd')) {\n output += formatNumber(date.getDate(), 2);\n iFormat++;\n } else {\n output += String(date.getDate());\n }\n break;\n case 'm':\n if (lookAhead(iFormat, format, 'm')) {\n output += formatNumber(date.getMonth() + 1, 2);\n iFormat++;\n } else {\n output += String(date.getMonth() + 1);\n }\n break;\n case 'y':\n if (lookAhead(iFormat, format, 'y', 4)) {\n iFormat += 3;\n output += date.getFullYear();\n } else {\n output += (date.getFullYear() % 100 < 10 ? '0' : '') + (date.getFullYear() % 100);\n iFormat++;\n }\n break;\n case 'h':\n if (lookAhead(iFormat, format, 'h')) {\n output += formatNumber(date.getHours(), 2);\n iFormat++;\n } else {\n output += String(date.getHours());\n }\n break;\n case 'M':\n if (lookAhead(iFormat, format, 'M')) {\n output += formatNumber(date.getMinutes(), 2);\n iFormat++;\n } else {\n output += String(date.getMinutes());\n }\n break;\n case 's':\n if (lookAhead(iFormat, format, 's')) {\n output += formatNumber(date.getSeconds(), 2);\n iFormat++;\n } else {\n output += String(date.getSeconds());\n }\n break;\n default:\n output += format.charAt(iFormat);\n }\n }\n return output;\n};\n\nconst daylightSavingAdjust = (date): Date => {\n if (!date) {\n return null;\n }\n\n date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);\n\n return date;\n};\n\nconst getDaysCountInMonth = (month: number, year: number) =>\n 32 - daylightSavingAdjust(new Date(year, month, 32)).getDate();\n\nexport const parseDate = (value: any, format: string, locale: string): Date => {\n if (format == null || value == null) {\n throw 'Invalid arguments';\n }\n\n value = typeof value === 'object' ? value.toString() : value + '';\n if (value === '') {\n return null;\n }\n\n let iFormat;\n let dim;\n let extra;\n let iValue = 0;\n let shortYearCutoff = 100;\n let year = -1;\n let month = -1;\n let day = -1;\n let doy = -1;\n let literal = false;\n let date: Date;\n let lookAhead = (match: string, len = 2) => {\n const increment = len - 1;\n let matches = iFormat + increment < format.length && format.charAt(iFormat + increment) === match;\n if (matches) {\n iFormat += increment;\n }\n return matches;\n };\n let getNumber = (match, len = 2) => {\n let isDoubled = lookAhead(match, len),\n size = match === '@' ? 14 : match === '!' ? 20 : match === 'y' && isDoubled ? 4 : match === 'o' ? 3 : 2,\n minSize = match === 'y' ? size : 1,\n digits = new RegExp('^\\\\d{' + minSize + ',' + size + '}'),\n num = value.substring(iValue).match(digits);\n if (!num) {\n throw 'Missing number at position ' + iValue;\n }\n iValue += num[0].length;\n return parseInt(num[0], 10);\n };\n let getName = (match, shortNames, longNames) => {\n let index = -1;\n let arr = lookAhead(match) ? longNames : shortNames;\n let names = [];\n\n for (let i = 0; i < arr.length; i++) {\n names.push([i, arr[i]]);\n }\n names.sort((a, b) => {\n return -(a[1].length - b[1].length);\n });\n\n for (let i = 0; i < names.length; i++) {\n let name = names[i][1];\n if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {\n index = names[i][0];\n iValue += name.length;\n break;\n }\n }\n\n if (index !== -1) {\n return index + 1;\n } else {\n throw 'Unknown name at position ' + iValue;\n }\n };\n let checkLiteral = () => {\n if (value.charAt(iValue) !== format.charAt(iFormat)) {\n throw 'Unexpected literal at position ' + iValue;\n }\n iValue++;\n };\n\n for (iFormat = 0; iFormat < format.length; iFormat++) {\n if (literal) {\n if (format.charAt(iFormat) === \"'\" && !lookAhead(\"'\")) {\n literal = false;\n } else {\n checkLiteral();\n }\n } else {\n switch (format.charAt(iFormat)) {\n case 'd':\n day = getNumber('d');\n break;\n case 'D':\n getName('D', i18nDate[locale].weekdaysShort, i18nDate[locale].weekdays);\n break;\n case 'm':\n month = getNumber('m');\n break;\n case 'M':\n month = getName('M', i18nDate[locale].monthsShort, i18nDate[locale].months);\n break;\n case 'y':\n year = getNumber('y', 4);\n break;\n default:\n checkLiteral();\n }\n }\n }\n\n if (iValue < value.length) {\n extra = value.substr(iValue);\n if (!/^\\s+/.test(extra)) {\n throw 'Extra/unparsed characters found in date: ' + extra;\n }\n }\n\n if (year === -1) {\n year = new Date().getFullYear();\n } else if (year < 100) {\n year += new Date().getFullYear() - (new Date().getFullYear() % 100) + (year <= shortYearCutoff ? 0 : -100);\n }\n\n if (doy > -1) {\n month = 1;\n day = doy;\n do {\n dim = getDaysCountInMonth(year, month - 1);\n if (day <= dim) {\n break;\n }\n month++;\n day -= dim;\n } while (true);\n }\n\n date = daylightSavingAdjust(new Date(year, month - 1, day));\n if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {\n throw 'Invalid date'; // E.g. 31/02/00\n }\n\n return date;\n};\n\nconst FORMATTING_TOKENS = /(\\[[^\\[]*\\])|(mm|dd|yyyy|yy|hh|MM|ss|.)/g;\n\nconst TWO_NUMERICS_REGEX = /\\d\\d/; // 00 - 99\nconst FOUR_NUMERICS_REGEX = /\\d{4}/; // 0000 - 9999\nconst NON_NUMERIC_REGEX = /[^0-9]/g;\n\nconst YEAR = 'year';\nconst MONTH = 'month';\nconst DAY = 'day';\nconst HOUR = 'hour';\nconst MINUTE = 'minute';\nconst SECOND = 'second';\n\ninterface ParseFlagMark {\n year: number;\n month: number;\n day: number;\n hour: number;\n minute: number;\n second: number;\n date: Date;\n}\n\ntype ParseFlagCallBackReturn = any;\n\ntype ParseFlagRegExp = RegExp | ((locale: any) => RegExp);\ntype ParseFlagCallBack = (input: string) => ParseFlagCallBackReturn;\n\ninterface ParseFlag {\n [key: string]: [ParseFlagRegExp, ParseFlagCallBack];\n}\n\nconst parseFlags: ParseFlag = {};\n\nconst addParseFlag = (token: string | string[], regex: ParseFlagRegExp, callback) => {\n const tokens = Array.isArray(token) ? token : [token];\n let func: ParseFlagCallBack;\n if (typeof callback === 'string') {\n func = (input) => {\n const value = parseInt(input, 10);\n return { [callback]: value };\n };\n } else {\n func = callback;\n }\n tokens.forEach((key) => {\n parseFlags[key] = [regex, func];\n });\n};\n\naddParseFlag('yy', TWO_NUMERICS_REGEX, (input) => {\n const year = new Date().getFullYear();\n const cent = Math.floor(year / 100);\n let value = parseInt(input, 10);\n value = (value > 68 ? cent - 1 : cent) * 100 + value;\n return { [YEAR]: value };\n});\naddParseFlag('yyyy', FOUR_NUMERICS_REGEX, YEAR);\naddParseFlag('mm', TWO_NUMERICS_REGEX, (input) => ({ [MONTH]: parseInt(input, 10) - 1 }));\naddParseFlag('dd', TWO_NUMERICS_REGEX, DAY);\naddParseFlag('hh', TWO_NUMERICS_REGEX, HOUR);\naddParseFlag('MM', TWO_NUMERICS_REGEX, MINUTE);\naddParseFlag('ss', TWO_NUMERICS_REGEX, SECOND);\n\ntype DateArgs = [number, number, number, number, number, number];\n\nconst getFullInputArray = (input: Array<number | undefined>, backupDate = new Date()) => {\n const result: DateArgs = [0, 0, 1, 0, 0, 0];\n const backupArr = [\n backupDate.getFullYear(),\n backupDate.getMonth(),\n backupDate.getDate(),\n backupDate.getHours(),\n backupDate.getMinutes(),\n backupDate.getSeconds(),\n ];\n\n let useBackup = true;\n for (let i = 0; i < 7; i++) {\n if (input[i] === undefined) {\n result[i] = useBackup ? backupArr[i] : result[i];\n } else {\n result[i] = input[i]!;\n useBackup = false;\n }\n }\n return result;\n};\n\nconst createDate = (year: number, month: number, day: number, hour: number, minute: number, second: number): Date => {\n if (!(year < 100 && year >= 0)) {\n return new Date(year, month, day, hour, minute, second);\n }\n\n const date = new Date(year + 400, month, day, hour, minute, second);\n if (isFinite(date.getFullYear())) {\n date.setFullYear(year);\n }\n return date;\n};\n\nconst makeParser = (dateString: string, format: string) => {\n const tokens = format.match(FORMATTING_TOKENS);\n if (!tokens) {\n throw new Error();\n }\n const { length } = tokens;\n let mark: Partial<ParseFlagMark> = {};\n for (let i = 0; i < length; i += 1) {\n const token = tokens[i];\n const parseTo = parseFlags[token];\n if (!parseTo) {\n const word = token.replace(/^\\[|\\]$/g, '');\n if (dateString.indexOf(word) === 0) {\n dateString = dateString.substr(word.length);\n } else {\n throw new Error('not match');\n }\n } else {\n const regex = parseTo[0] as RegExp;\n const parser = parseTo[1];\n const value = (regex.exec(dateString) || [])[0];\n const obj = parser(value);\n mark = { ...mark, ...obj };\n dateString = dateString.replace(value, '');\n }\n }\n return mark;\n};\n\nconst getCleanDateString = (dirtyDateString: string, format: string) => {\n if (dirtyDateString.length === format.length) {\n return dirtyDateString;\n }\n\n const separator = dirtyDateString.match(NON_NUMERIC_REGEX)[0];\n\n // pad signle digits to follow supported dateformats\n return dirtyDateString\n .split(separator)\n .map((s) => (s.length === 1 ? '0' + s : s))\n .join(separator);\n};\n\nconst getDateParts: (dirtyDateString: string, format: string) => Partial<ParseFlagMark> = (\n dirtyDateString: string,\n format: string\n) => {\n const dateString = getCleanDateString(dirtyDateString, format);\n\n return makeParser(dateString, format);\n};\n\nexport const toDate = (dirtyDateString: string | undefined, format: string): Date | undefined => {\n try {\n const { backupDate = new Date() } = {};\n const { year, month, day, hour, minute, second, date } = getDateParts(dirtyDateString, format);\n if (date != null) {\n return date;\n }\n const inputArray = [year, month, day, hour, minute, second];\n const result = getFullInputArray(inputArray, backupDate);\n return createDate(...result);\n } catch (e) {\n return new Date(NaN);\n }\n};\n\nexport interface PointerDate {\n year: number;\n month: number;\n day: number;\n hours: number;\n minutes: number;\n seconds: number;\n}\n\nexport interface CalendarGridArgs {\n firstDateOfBox: Date;\n minDate?: Date;\n maxDate?: Date;\n dateFormat: SixDateFormats;\n pointerDate: { month: number; year: number; day: number };\n allowedDates: (date: Date) => boolean;\n locale: 'en' | 'de' | 'fr' | 'it' | 'es';\n selectedDate?: Date;\n}\n\nexport const createCalendarGrid: (calendarGridArguments: CalendarGridArgs) => CalendarCell[][] = (\n calendarGridArguments: CalendarGridArgs\n) => {\n const { firstDateOfBox, allowedDates, dateFormat, selectedDate, minDate, maxDate, pointerDate } =\n calendarGridArguments;\n\n const weekDatePointer = new Date(firstDateOfBox);\n const dayDatePointer = new Date(firstDateOfBox);\n\n let calendar: CalendarCell[][] = [];\n\n do {\n let row: CalendarCell[] = [];\n do {\n row = [\n ...row,\n {\n date: new Date(dayDatePointer),\n display: formatDate(dayDatePointer, dateFormat),\n dateString: formatDate(dayDatePointer, dateFormat),\n label: day(dayDatePointer).toString(),\n isToday: isSameDay(dayDatePointer, now()),\n isSelected: selectedDate && isSameDay(dayDatePointer, selectedDate),\n isDisabled: !allowedDates(dayDatePointer) || !isInRange(dayDatePointer, minDate, maxDate),\n isOutdated: pointerDate.month !== dayDatePointer.getMonth() || !isInRange(dayDatePointer, minDate, maxDate),\n },\n ];\n dayDatePointer.setDate(dayDatePointer.getDate() + 1);\n } while (isSameWeek(dayDatePointer, weekDatePointer));\n calendar = [...calendar, row];\n weekDatePointer.setDate(weekDatePointer.getDate() + 7);\n } while (isSameMonth(new Date(pointerDate.year, pointerDate.month, pointerDate.day), dayDatePointer));\n return calendar;\n};\n\n/**\n * Returns a range of numbers around the given number grouped into buckets of 5.\n * @param number the given number around which you want to get the other numbers\n * @param range range of numbers to include in the result\n */\nexport function rangeAround(number: number, range: number): number[][] {\n const itemsPerGroup = 5;\n return [...Array(range).keys()]\n .map((n) => n + number - Math.floor(range / 2))\n .reduce((curr, item, index) => {\n if (index % itemsPerGroup === 0) {\n curr.push([]);\n }\n curr[curr.length - 1].push(item);\n return curr;\n }, [] as number[][]);\n}\n","// eslint-disable-next-line @stencil-community/ban-exported-const-enums\nexport enum SixDateFormats {\n DDMMYYY_DOT = 'dd.mm.yyyy',\n YYYYMMDD_DASH = 'yyyy-mm-dd',\n DDMMYYYY_DASH = 'dd-mm-yyyy',\n DDMMYYYY_SLASH = 'dd/mm/yyyy',\n YYYYMMDD_SLASH = 'yyyy/mm/dd',\n DDMMYY_DOT = 'dd.mm.yy',\n YYMMDD_DASH = 'yy-mm-dd',\n DDMMYY_DASH = 'dd-mm-yy',\n DDMMYY_SLASH = 'dd/mm/yy',\n YYMMDD_SLASH = 'yy/mm/dd',\n\n DDMMYYY_DOT_TIME = 'dd.mm.yyyy hh:MM:ss',\n YYYYMMDD_DASH_TIME = 'yyyy-mm-dd hh:MM:ss',\n DDMMYYYY_DASH_TIME = 'dd-mm-yyyy hh:MM:ss',\n DDMMYYYY_SLASH_TIME = 'dd/mm/yyyy hh:MM:ss',\n YYYYMMDD_SLASH_TIME = 'yyyy/mm/dd hh:MM:ss',\n DDMMYY_DOT_TIME = 'dd.mm.yy hh:MM:ss',\n YYMMDD_DASH_TIME = 'yy-mm-dd hh:MM:ss',\n DDMMYY_DASH_TIME = 'dd-mm-yy hh:MM:ss',\n DDMMYY_SLASH_TIME = 'dd/mm/yy hh:MM:ss',\n YYMMDD_SLASH_TIME = 'yy/mm/dd hh:MM:ss',\n}\n","import { h } from '@stencil/core';\nimport { DateLocale, now } from '../../../utils/date-util';\n\ninterface MonthSelectionParams {\n locale: DateLocale;\n selectedDate?: Date;\n onClickMonthCell: (month: string) => void;\n}\nexport const MonthSelection = (monthSelectionParams: MonthSelectionParams) => {\n const locale = monthSelectionParams.locale;\n const isToday = (value: string) => locale.monthsShort[now().getMonth()] === value;\n\n const isSelectedMonth = (value: string) =>\n monthSelectionParams.selectedDate?.getMonth() === locale.monthsShort.findIndex((m) => m === value);\n\n return (\n <table class=\"datepicker-table\" part=\"month-selection\">\n <tbody>\n {locale.monthsShortGrouped.map((row: string[]) => (\n <tr class=\"datepicker-table__row\">\n {row.map((month) => (\n <td\n onClick={() => monthSelectionParams.onClickMonthCell(month)}\n class={{\n 'datepicker-table__cell': true,\n 'datepicker-table__cell--is-today': isToday(month),\n 'datepicker-table__cell--is-selected': isSelectedMonth(month),\n }}\n >\n {month}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n );\n};\n","import { h } from '@stencil/core';\nimport { DateLocale } from '../../../utils/date-util';\nimport { CalendarCell } from '../six-datepicker';\n\ninterface DaySelectionParams {\n locale: DateLocale;\n calendarGrid: CalendarCell[][];\n onClickDateCell: (cell: CalendarCell) => void;\n}\nexport const DaySelection = (daySelectionParams: DaySelectionParams) => {\n return (\n <table class=\"datepicker-table\" part=\"day-selection\">\n <thead part=\"weekday-header\">\n {daySelectionParams.locale.weekdaysMin.map((weekday) => (\n <th class=\"datepicker__cell\">{weekday}</th>\n ))}\n </thead>\n <tbody>\n {daySelectionParams.calendarGrid.map((row) => (\n <tr class=\"datepicker-table__row\">\n {row.map((cell) => (\n <td\n data-date={cell.dateString}\n onClick={() => daySelectionParams.onClickDateCell(cell)}\n class={{\n 'datepicker-table__cell': true,\n 'datepicker-table__cell--is-today': cell.isToday,\n 'datepicker-table__cell--is-selected': cell.isSelected,\n 'datepicker-table__cell--is-outdated': cell.isOutdated,\n 'datepicker-table__cell--is-disabled': cell.isDisabled,\n 'datepicker-table__cell--is-selectable': !cell.isDisabled,\n }}\n >\n {cell.label}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n );\n};\n","import { now } from '../../../utils/date-util';\nimport { h } from '@stencil/core';\n\ninterface YearSelectionParams {\n selectedDate?: Date;\n yearSelection: number[][];\n onClickYearCell: (year: number) => void;\n}\nexport const YearSelection = (yearSelectionParams: YearSelectionParams) => {\n return (\n <table class=\"datepicker-table\" part=\"year-selection\">\n <tbody>\n {yearSelectionParams.yearSelection.map((row) => (\n <tr class=\"datepicker-table__row\">\n {row.map((year) => (\n <td\n onClick={() => yearSelectionParams.onClickYearCell(year)}\n class={{\n 'datepicker-table__cell': true,\n 'datepicker-table__cell--is-today': now().getFullYear() === year,\n 'datepicker-table__cell--is-selected': yearSelectionParams.selectedDate?.getFullYear() === year,\n }}\n >\n {year}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n );\n};\n","@import 'src/global/component';\n\n:host {\n display: block;\n font-family: var(--six-font-family);\n}\n\n.datepicker {\n &__container {\n position: relative;\n }\n\n &__popup {\n min-width: 400px;\n background-color: white;\n padding: 0.5em 0.5em 1.5em;\n box-shadow:\n 0 2px 4px -1px rgb(0 0 0 / 20%),\n 0 4px 5px 0 rgb(0 0 0 / 14%),\n 0 1px 10px 0 rgb(0 0 0 / 12%);\n user-select: none;\n position: absolute;\n z-index: var(--six-z-index-dropdown);\n right: 0;\n left: 0;\n\n &--is-up {\n bottom: 100%;\n // fix problem where you would need to jump around with the cursor when switching months and\n // its a dropup since not all months have the same height\n min-height: 382px;\n }\n\n &--is-inline {\n position: initial;\n box-shadow: none;\n border: 1px solid var(--six-color-web-rock-400);\n }\n }\n}\n\n.datepicker-header {\n display: flex;\n justify-content: space-between;\n border-bottom: 1px solid var(--six-color-web-rock-400);\n padding: 0.5em;\n margin-bottom: 1em;\n\n & svg {\n fill: var(--six-color-web-rock-900);\n stroke: none;\n }\n\n &__btn {\n cursor: pointer;\n width: 2.5em;\n height: 2.5em;\n display: flex;\n vertical-align: middle;\n align-items: center;\n justify-content: center;\n\n &:hover {\n background-color: var(--six-color-web-rock-100);\n border-radius: 100%;\n }\n }\n\n &__label {\n display: flex;\n\n & > div {\n cursor: pointer;\n padding: 0.5em;\n display: flex;\n vertical-align: middle;\n align-items: center;\n justify-content: center;\n\n &:hover {\n background-color: var(--six-color-web-rock-100);\n }\n }\n }\n}\n\n.datepicker-table {\n width: 100%;\n\n &__cell {\n text-align: center;\n width: 2.5rem;\n height: 2.5rem;\n cursor: pointer;\n\n &:hover {\n background-color: var(--six-color-web-rock-100);\n }\n\n &--is-today {\n border: 1px solid var(--six-color-web-rock-400);\n }\n\n &--is-selected {\n background-color: var(--six-color-red);\n color: var(--six-color-white);\n }\n\n &--is-disabled {\n background-color: var(--six-color-web-rock-200);\n cursor: initial;\n\n &:hover {\n background-color: var(--six-color-web-rock-200);\n }\n }\n\n &--is-outdated {\n color: var(--six-color-web-rock-400);\n }\n }\n}\n\n// Clearable\n.datepicker-clear {\n display: inline-flex;\n align-items: center;\n font-size: inherit;\n color: var(--six-input-icon-color);\n border: none;\n background: none;\n padding: 0;\n transition: var(--six-transition-fast) color;\n cursor: pointer;\n\n &:hover {\n color: var(--six-input-icon-color-hover);\n }\n\n &:focus {\n outline: none;\n }\n\n &--right {\n right: 0;\n position: absolute;\n }\n\n &--left {\n right: 35px;\n position: absolute;\n }\n}\n\n.input--empty .datepicker-clear {\n visibility: hidden;\n}\n\n// Icon position\n.prefix {\n cursor: pointer;\n\n &--right {\n right: 0;\n display: inline-flex;\n position: absolute;\n font-size: inherit;\n color: var(--six-input-icon-color);\n border: none;\n background: none;\n margin-right: var(--six-input-spacing-medium);\n transition: var(--six-transition-fast) color;\n }\n}\n\n// time-picker\nsix-timepicker::part(popup) {\n border: none;\n padding: 0.5em 0.5em 0;\n min-height: 0;\n}\n","import { Component, Element, Event, EventEmitter, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport {\n createCalendarGrid,\n day,\n formatDate,\n getFirstDayOfTheWeek,\n hours,\n i18nDate,\n isValidDate,\n isValidDateString,\n minutes,\n month,\n now,\n PointerDate,\n rangeAround,\n removeTime,\n seconds,\n toDate,\n year,\n} from '../../utils/date-util';\nimport { EventListeners } from '../../utils/event-listeners';\nimport { debounce, debounceEvent, DEFAULT_DEBOUNCE_FAST } from '../../utils/execution-control';\nimport { hasSlot } from '../../utils/slot';\nimport { EmptyPayload } from '../../utils/types';\nimport { SixDateFormats } from './six-date-formats';\nimport { MonthSelection } from './components/month-selection';\nimport { DaySelection } from './components/day-selection';\nimport { YearSelection } from './components/year-selection';\nimport { SixTimepickerChange } from '../six-timepicker/six-timepicker';\nimport {\n adjustPopupForHoisting,\n adjustPopupForSmallScreens,\n calcIsDropDownContentUp,\n movePopup,\n} from '../../utils/popup';\n\nconst NUMBER_OF_YEARS_SHOWN = 25;\n\nconst MIN_POPUP_HEIGHT = 400;\n\nexport type SixDatepickerSelectPayload = Date | undefined | null;\n\nexport interface CalendarCell {\n date: Date;\n dateString: string;\n display: string;\n isDisabled: boolean;\n isOutdated: boolean;\n isSelected: boolean;\n isToday: boolean;\n label: string;\n}\n\nenum SelectionMode {\n DAY = 'day',\n MONTH = 'month',\n YEAR = 'year',\n}\n\n/**\n * @since 1.0\n * @status deprecated. Use six-date instead.\n *\n * @slot - Used to define a footer for the date picker.\n * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.\n */\n@Component({\n tag: 'six-datepicker',\n styleUrl: 'six-datepicker.scss',\n shadow: true,\n})\nexport class SixDatepicker {\n private eventListeners = new EventListeners();\n private inputElement?: HTMLSixInputElement;\n private popup?: HTMLElement;\n private wrapper?: HTMLElement;\n private selectedDate?: Date;\n\n @Element() host!: HTMLSixDatepickerElement;\n\n @State() private pointerDate = SixDatepicker.getCurrentDateAsPointer();\n @State() selectionMode: SelectionMode = SelectionMode.DAY;\n @State() isDropDownContentUp = false;\n\n /**\n * Set the type.\n */\n @Prop() type: 'date' | 'date-time' = 'date';\n\n /**\n * The language used to render the weekdays and months.\n */\n @Prop() locale: 'en' | 'de' | 'fr' | 'it' | 'es' = 'en';\n\n /** Indicates whether or not the calendar dropdown is open on startup. You can use this in lieu of the show/hide methods. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n /** Indicates whether or not the calendar should be shown as an inline (always open) component */\n @Prop({ reflect: true }) inline = false;\n\n /**\n * If `true` the user can only select a date via the component in the popup, but not directly edit the input field.\n */\n @Prop() readonly = false;\n\n /**\n * If `true` the component is disabled.\n */\n @Prop() disabled = false;\n\n /**\n * Callback to determine which date in the datepicker should be selectable.\n * the callback function will get a datestring as an argument, e.g. '2021-07-04'\n *\n * Usage e.g.:\n * const datepicker = document.getElementById('allowed-date-picker');\n * datepicker.allowedDates = datestring => parseInt(datestring.split('-')[2], 10) % 2 === 0;\n */\n @Prop() allowedDates: (date: Date) => boolean = () => true;\n\n /**\n * The minimum datetime allowed. Value must be a date object\n */\n @Prop() min?: Date;\n\n /**\n * The maximum datetime allowed. Value must be a date object\n */\n @Prop() max?: Date;\n\n /**\n * Closes the datepicker dropdown after selection\n */\n @Prop() closeOnSelect = this.type === 'date';\n\n /**\n * The enforced placement of the dropdown panel.\n */\n @Prop() placement?: 'top' | 'bottom';\n\n /** Datepicker size. */\n @Prop() size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /**\n * The date to defines where the datepicker popup starts. The prop accepts ISO 8601 date strings (YYYY-MM-DD).\n */\n @Prop() defaultDate?: string;\n\n /**\n * The placeholder defines what text to be shown on the input element\n */\n @Prop() placeholder?: string;\n\n /**\n * The value of the form field, which accepts a date object.\n */\n @Prop({ mutable: true }) value?: Date;\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 dropdown will close when the user interacts outside of this element (e.g. clicking). */\n @Prop() containingElement?: HTMLElement;\n\n /** Define the dateFormat. Valid formats are:\n * 'dd.mm.yyyy'\n * 'yyyy-mm-dd'\n * 'dd-mm-yyyy'\n * 'dd/mm/yyyy'\n * 'yyyy/mm/dd'\n * 'dd.mm.yy'\n * 'yy-mm-dd'\n * 'dd-mm-yy'\n * 'dd/mm/yy'\n * 'yy/mm/dd'\n * */\n @Prop() dateFormat: SixDateFormats = SixDateFormats.DDMMYYY_DOT;\n\n /**\n * Set the amount of time, in milliseconds, to wait to trigger the `dateChange` event after each keystroke.\n */\n @Prop() debounce = DEFAULT_DEBOUNCE_FAST;\n\n /** The input's name attribute. */\n @Prop({ reflect: true }) name = '';\n\n /** Set to true to add a clear button when the input is populated. */\n @Prop() clearable = false;\n\n /** Set the position of the icon */\n @Prop() iconPosition: 'left' | 'right' = 'left';\n\n /**\n * Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n * `overflow: auto|scroll`.\n */\n @Prop() hoist = false;\n\n @Watch('debounce')\n protected debounceChanged() {\n this.sixSelect = debounceEvent(this.sixSelect, this.debounce);\n }\n\n /**\n * Update the native input element when the value changes\n */\n @Watch('value')\n protected valueChanged() {\n if (this.value != null && !isValidDate(this.value)) {\n console.warn('invalid date value: ', this.value);\n this.value = undefined;\n this.sixSelect.emit(this.value);\n }\n this.selectedDate = this.value;\n this.updatePointerDates();\n }\n\n /**\n * Emitted when a option got selected.\n */\n @Event({ eventName: 'six-datepicker-select' }) sixSelect!: EventEmitter<SixDatepickerSelectPayload>;\n\n /**\n * Emitted when the clear button is activated.\n */\n @Event({ eventName: 'six-datepicker-clear' }) sixClear!: EventEmitter<EmptyPayload>;\n\n /**\n * Emitted when a option got selected.\n */\n @Event({ eventName: 'six-datepicker-blur' }) sixBlur!: EventEmitter<SixDatepickerSelectPayload>;\n\n @Listen('resize', { target: 'window' })\n async resizeHandler() {\n this.updateDropdownDirection();\n this.moveOpenHoistedPopup();\n this.adjustPopupPosition();\n }\n\n @Listen('scroll', { target: 'window' })\n async scrollHandler() {\n this.updateDropdownDirection();\n this.moveOpenHoistedPopup();\n }\n\n private moveOpenHoistedPopup() {\n movePopup(this.hoist, this.open, this.popup, this.inputElement, this.wrapper, MIN_POPUP_HEIGHT);\n }\n\n get container() {\n return this.containingElement || this.host;\n }\n\n get firstDateOfBox(): Date {\n const date = new Date(this.pointerDate.year, this.pointerDate.month, 1);\n return getFirstDayOfTheWeek(date);\n }\n\n /** Sets focus on the datepickers input. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.inputElement?.setFocus(options);\n }\n\n get calendarGrid() {\n return createCalendarGrid({\n firstDateOfBox: this.firstDateOfBox,\n allowedDates: this.allowedDates,\n dateFormat: this.dateFormat,\n locale: this.locale,\n selectedDate: this.selectedDate,\n minDate: this.min,\n maxDate: this.max,\n pointerDate: this.pointerDate,\n });\n }\n\n private updateDropdownDirection() {\n if (this.inputElement == null || this.wrapper == null) {\n return;\n }\n this.isDropDownContentUp = calcIsDropDownContentUp(this.inputElement, this.wrapper, MIN_POPUP_HEIGHT);\n }\n\n private getMonthStringForIndex(index: number) {\n return i18nDate[this.locale].months[index];\n }\n\n private previousUnit = () => {\n if (this.selectionMode === SelectionMode.DAY) {\n this.previousMonth();\n } else if (this.selectionMode === SelectionMode.MONTH) {\n this.previousYear();\n } else if (this.selectionMode === SelectionMode.YEAR) {\n this.previousYearGroup();\n }\n };\n\n private previousYear() {\n this.pointerDate = { ...this.pointerDate, year: this.pointerDate.year - 1 };\n }\n\n private previousYearGroup() {\n this.pointerDate = { ...this.pointerDate, year: this.pointerDate.year - NUMBER_OF_YEARS_SHOWN };\n }\n\n private previousMonth() {\n if (this.pointerDate.month === 0) {\n this.pointerDate = { year: this.pointerDate.year - 1, month: 11, day: 1, hours: 0, minutes: 0, seconds: 0 };\n } else {\n this.pointerDate = {\n year: this.pointerDate.year,\n month: this.pointerDate.month - 1,\n day: 1,\n hours: 0,\n minutes: 0,\n seconds: 0,\n };\n }\n }\n\n private nextUnit = () => {\n if (this.selectionMode === SelectionMode.DAY) {\n this.nextMonth();\n } else if (this.selectionMode === SelectionMode.MONTH) {\n this.nextYear();\n } else if (this.selectionMode === SelectionMode.YEAR) {\n this.nextYearGroup();\n }\n };\n\n private nextMonth() {\n if (this.pointerDate.month === 11) {\n this.pointerDate = { year: this.pointerDate.year + 1, month: 0, day: 1, hours: 0, minutes: 0, seconds: 0 };\n } else {\n this.pointerDate = {\n year: this.pointerDate.year,\n month: this.pointerDate.month + 1,\n day: 1,\n hours: 0,\n minutes: 0,\n seconds: 0,\n };\n }\n }\n\n private nextYear() {\n this.pointerDate = { ...this.pointerDate, year: this.pointerDate.year + 1 };\n }\n\n private nextYearGroup() {\n this.pointerDate = { ...this.pointerDate, year: this.pointerDate.year + NUMBER_OF_YEARS_SHOWN };\n }\n\n private openCalendar() {\n if (!this.open && !this.disabled) {\n this.open = true;\n this.setupEventListenersForOpenPopup();\n }\n }\n\n private setupEventListenersForOpenPopup() {\n this.eventListeners.add(document, 'keydown', this.handleDocumentKeyDown);\n this.eventListeners.add(document, 'mousedown', this.handleDocumentMouseDown);\n }\n\n private handleDocumentKeyDown = (event: Event) => {\n const keyboardEvent = event as KeyboardEvent;\n // Close when escape is pressed\n if (this.open && keyboardEvent.key === 'Escape') {\n keyboardEvent.stopPropagation();\n this.closePopup();\n void this.inputElement?.setFocus();\n }\n\n // Handle tabbing\n if (keyboardEvent.key === 'Tab') {\n this.closePopup();\n }\n };\n\n private handleDocumentMouseDown = (event: Event) => {\n // Close when clicking outside the containing element\n const path = event.composedPath() as EventTarget[];\n if (!path.includes(this.container)) {\n this.closePopup();\n return;\n }\n };\n\n private handleClearClick = async (event: MouseEvent) => {\n event.stopPropagation();\n await this.select(undefined);\n this.sixClear.emit();\n };\n\n private closePopup() {\n if (this.inline) {\n return;\n }\n\n this.open = false;\n this.eventListeners.remove(document, 'keydown', this.handleDocumentKeyDown);\n this.eventListeners.remove(document, 'mousedown', this.handleDocumentMouseDown);\n this.selectionMode = SelectionMode.DAY;\n }\n\n private updatePointerDates() {\n const date = this.getPointerDate();\n if (this.differsFromPointerDate(date)) {\n this.pointerDate = {\n year: year(date),\n month: month(date),\n day: day(date),\n hours: hours(date),\n minutes: minutes(date),\n seconds: seconds(date),\n };\n }\n }\n\n private differsFromPointerDate(date?: Date): boolean {\n return (\n this.pointerDate.day !== day(date) ||\n this.pointerDate.month !== month(date) ||\n this.pointerDate.year !== year(date) ||\n this.pointerDate.hours !== hours(date) ||\n this.pointerDate.minutes !== minutes(date) ||\n this.pointerDate.seconds !== seconds(date)\n );\n }\n\n private getPointerDate(): Date | undefined {\n if (this.selectedDate !== undefined && this.selectedDate !== null) {\n return this.selectedDate;\n }\n if (this.defaultDate == null) {\n return this.type === 'date' ? removeTime(now()) : now();\n } else {\n return toDate(this.defaultDate, this.dateFormat);\n }\n }\n\n private updateValue(newDate?: Date) {\n this.updateIfChanged(newDate);\n }\n\n private updateIfChanged(newDate?: Date) {\n if (this.value?.getTime() === newDate?.getTime()) {\n return;\n }\n this.value = newDate;\n this.sixSelect.emit(this.value);\n }\n\n /**\n * Selects an option\n */\n @Method()\n async select(datestring?: string) {\n if (datestring == null) {\n this.updateValue(undefined);\n } else {\n const newDate = toDate(datestring, this.dateFormat);\n newDate?.setHours(this.pointerDate.hours, this.pointerDate.minutes, this.pointerDate.seconds);\n this.updateValue(newDate);\n }\n\n this.updatePointerDates();\n\n if (this.closeOnSelect) {\n this.closePopup();\n }\n }\n\n private onTimepickerChange = (sixTimepickerChange: CustomEvent<SixTimepickerChange>) => {\n const time = sixTimepickerChange.detail.value;\n const newDate = new Date();\n\n if (this.selectedDate != null) {\n newDate.setFullYear(this.selectedDate.getFullYear(), this.selectedDate.getMonth(), this.selectedDate.getDate());\n }\n\n if (time != null) {\n const hours = time.hours;\n const minutes = time.minutes;\n const seconds = time.seconds;\n if (hours != null) {\n newDate.setHours(hours, minutes, seconds);\n }\n }\n\n this.updateValue(newDate);\n this.updatePointerDates();\n };\n\n private onClickDateCell = (cell: CalendarCell) => {\n if (!cell.isDisabled) {\n void this.select(cell.dateString);\n }\n };\n\n private onClickMonthCell = (selectedMonth: string) => {\n const month = i18nDate[this.locale].monthsShort.findIndex((monthShort) => monthShort === selectedMonth);\n this.pointerDate = { ...this.pointerDate, month };\n this.selectionMode = SelectionMode.DAY;\n };\n\n private onClickYearCell = (year: number) => {\n this.pointerDate = { ...this.pointerDate, year };\n this.selectionMode = SelectionMode.DAY;\n };\n\n private handleInputChange = (event: Event) => {\n if (this.inputElement == null) {\n return;\n }\n event.stopPropagation();\n\n const inputValue = this.inputElement.value;\n if (!isValidDateString(inputValue, this.dateFormat)) {\n return;\n }\n\n const inputValueDate = toDate(inputValue, this.dateFormat);\n\n if (inputValueDate === undefined) {\n return;\n }\n\n this.updateIfChanged(inputValueDate);\n const datesOnly = inputValue.replace(/[^\\d]/g, '');\n if (datesOnly.length >= 6) {\n const date = toDate(inputValue, this.dateFormat);\n const dateAsString = formatDate(date, this.dateFormat);\n if (isValidDateString(dateAsString, this.dateFormat)) {\n this.selectedDate = toDate(dateAsString, this.dateFormat);\n this.updatePointerDates();\n this.updateValue(this.selectedDate);\n }\n }\n };\n\n private handleOnBlur = (event: Event) => {\n event.stopPropagation();\n\n // clear the value if the user deleted the date\n if (this.inputElement?.value === '' && isValidDate(this.value)) {\n this.value = undefined;\n this.sixSelect.emit(this.value);\n }\n\n const currentDate = toDate(this.inputElement?.value, this.dateFormat);\n if (isValidDate(currentDate) && this.value?.getTime() !== currentDate?.getTime()) {\n // Set the value if the input field's value has changed. This can happen if the blur occurs\n // before the change event had a chance to fire due to its debouncing.\n this.value = currentDate;\n }\n if (this.inputElement != null) {\n this.inputElement.value = formatDate(this.value, this.dateFormat);\n }\n this.sixBlur.emit(this.value);\n };\n\n componentWillLoad() {\n this.selectedDate = this.value;\n this.updatePointerDates();\n this.updateValue(this.value);\n\n if (this.inline) {\n this.open = true;\n }\n\n if (this.open) {\n this.setupEventListenersForOpenPopup();\n }\n }\n\n componentDidLoad() {\n if (this.inputElement != null) {\n this.eventListeners.add(this.inputElement, 'six-input-input', debounce(this.handleInputChange, this.debounce));\n this.eventListeners.add(this.inputElement, 'six-input-blur', this.handleOnBlur);\n }\n }\n\n componentDidRender() {\n this.adjustPopupPosition();\n }\n\n private renderHeader() {\n return (\n <header class=\"datepicker-header\" part=\"header\">\n <div class=\"datepicker-header__btn prev\" onClick={this.previousUnit}>\n <svg viewBox=\"0 5 13 13\" width=\"14\" height=\"23\">\n <path d=\"M11.67 3.87L9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z\" />\n </svg>\n </div>\n\n <div class=\"datepicker-header__label\">\n {this.selectionMode === SelectionMode.DAY && (\n <div onClick={() => (this.selectionMode = SelectionMode.MONTH)}>\n <span class=\"datepicker-header__label-month\">{this.getMonthStringForIndex(this.pointerDate.month)}</span>\n <span>\n <svg viewBox=\"-3 -4 24 24\" width=\"20\" height=\"20\">\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </span>\n </div>\n )}\n\n {this.selectionMode !== SelectionMode.YEAR && (\n <div onClick={() => (this.selectionMode = SelectionMode.YEAR)}>\n <span class=\"datepicker-header__label-year\">{this.pointerDate.year}</span>\n <span>\n <svg viewBox=\"-3 -4 24 24\" width=\"20\" height=\"20\">\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </span>\n </div>\n )}\n\n {this.selectionMode === SelectionMode.YEAR && (\n <div>\n {this.pointerDate.year - Math.floor(NUMBER_OF_YEARS_SHOWN / 2)} –{' '}\n {this.pointerDate.year + Math.floor(NUMBER_OF_YEARS_SHOWN / 2)}\n </div>\n )}\n </div>\n\n <div class=\"datepicker-header__btn next\" onClick={this.nextUnit}>\n <svg viewBox=\"5 5 13 13\" width=\"14\" height=\"23\">\n <path d=\"M5.88 4.12L13.76 12l-7.88 7.88L8 22l10-10L8 2z\" />\n </svg>\n </div>\n </header>\n );\n }\n\n private renderBody() {\n switch (this.selectionMode) {\n case SelectionMode.DAY:\n return (\n <DaySelection\n locale={i18nDate[this.locale]}\n calendarGrid={this.calendarGrid}\n onClickDateCell={this.onClickDateCell}\n />\n );\n case SelectionMode.MONTH:\n return (\n <MonthSelection\n locale={i18nDate[this.locale]}\n selectedDate={this.selectedDate}\n onClickMonthCell={this.onClickMonthCell}\n />\n );\n case SelectionMode.YEAR:\n return (\n <YearSelection\n selectedDate={this.selectedDate}\n yearSelection={rangeAround(this.pointerDate.year, NUMBER_OF_YEARS_SHOWN)}\n onClickYearCell={this.onClickYearCell}\n />\n );\n }\n }\n\n private renderCustomIcon() {\n const icon = hasSlot(this.host, 'custom-icon') ? (\n <slot name=\"custom-icon\"></slot>\n ) : (\n <six-icon size={this.size === 'large' ? 'medium' : this.size}>today</six-icon>\n );\n\n return (\n <span\n slot=\"prefix\"\n part=\"icon\"\n class={{\n prefix: true,\n 'prefix--right': this.iconPosition === 'right',\n }}\n >\n {icon}\n </span>\n );\n }\n\n private renderClearable() {\n return (\n this.clearable && (\n <button\n slot=\"suffix\"\n class={{\n 'datepicker-clear': true,\n 'datepicker-clear--right': this.iconPosition === 'left',\n 'datepicker-clear--left': this.iconPosition === 'right',\n }}\n type=\"button\"\n onClick={this.handleClearClick}\n tabindex=\"-1\"\n >\n <six-icon size=\"small\">clear</six-icon>\n </button>\n )\n );\n }\n\n render() {\n this.adjustPopupPosition();\n\n return (\n <div ref={(el) => (this.wrapper = el)} class=\"datepicker__container\">\n <six-input\n part=\"base\"\n value={formatDate(this.value, this.dateFormat)}\n ref={(el) => (this.inputElement = el)}\n placeholder={this.placeholder}\n readonly={this.readonly}\n disabled={this.disabled}\n name={this.name}\n label={this.label}\n required={this.required}\n errorText={this.errorText}\n errorTextCount={this.errorTextCount}\n invalid={this.invalid}\n onClick={() => this.openCalendar()}\n size={this.size}\n class={{ 'input--empty': this.value == null }}\n >\n {this.renderCustomIcon()}\n {this.renderClearable()}\n {hasSlot(this.host, 'label') ? (\n <span slot=\"label\">\n <slot name=\"label\" />\n </span>\n ) : null}\n {hasSlot(this.host, 'error-text') ? (\n <span slot=\"error-text\">\n <slot name=\"error-text\"></slot>\n </span>\n ) : null}\n </six-input>\n {this.open && (\n <div\n part=\"popup\"\n ref={(el) => (this.popup = el)}\n class={{\n datepicker__popup: true,\n 'datepicker__popup--is-up': this.placement != null ? this.placement === 'top' : this.isDropDownContentUp,\n 'datepicker__popup--is-inline': this.inline,\n }}\n >\n {this.renderHeader()}\n {this.renderBody()}\n {this.type === 'date-time' && (\n <six-timepicker\n debounce={this.debounce}\n inline={true}\n onSix-timepicker-change-debounced={(event) => this.onTimepickerChange(event)}\n value={\n this.selectedDate?.getHours() +\n ':' +\n this.selectedDate?.getMinutes() +\n ':' +\n this.selectedDate?.getSeconds()\n }\n ></six-timepicker>\n )}\n <div class=\"datepicker__footer\">\n <slot />\n </div>\n </div>\n )}\n </div>\n );\n }\n\n private adjustPopupPosition() {\n adjustPopupForHoisting(\n this.hoist,\n this.popup,\n this.inputElement,\n this.wrapper,\n MIN_POPUP_HEIGHT,\n (isUp) => (this.isDropDownContentUp = isUp)\n );\n adjustPopupForSmallScreens(this.popup);\n }\n\n connectedCallback() {\n this.eventListeners.forward('six-datepicker-select', 'change', this.host);\n this.eventListeners.forward('six-datepicker-blur', 'blur', this.host);\n }\n\n disconnectedCallback() {\n this.eventListeners.removeAll();\n }\n\n private static getCurrentDateAsPointer(): PointerDate {\n return {\n year: year(now()),\n month: month(now()),\n day: day(now()),\n hours: hours(now()),\n minutes: minutes(now()),\n seconds: seconds(now()),\n };\n }\n}\n"],"mappings":"uOAAO,MAAMA,EAAYC,UAA2CA,IAAU,SAGvE,MAAMC,EAASD,GAA8CA,GAAS,KCKtE,MAAME,EAAW,CACtBC,GAAI,CACFC,OAAQ,CACN,UACA,WACA,QACA,QACA,MACA,OACA,OACA,SACA,YACA,UACA,WACA,YAEFC,YAAa,CAAC,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,MAAO,OAC3FC,mBAAoB,CAClB,CAAC,MAAO,MAAO,MAAO,OACtB,CAAC,MAAO,MAAO,MAAO,OACtB,CAAC,MAA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ASA,EAAQnB,K","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{r as t,c as r,h as o,g as i}from"./p-JoG9I7EO.js";import{F as s}from"./p-Dg9366Gk.js";import{h as e}from"./p-j3oIB5oT.js";const l=':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{--six-rating-color:var(--six-color-web-rock-500);--six-rating-color-active:var(--six-color-warning-700);--six-rating-color-disabled-opacity:0.4;display:block}.six-rating{display:inline-flex;flex-direction:row;user-select:none;cursor:pointer}.six-rating--readonly{cursor:unset}.six-rating--disabled{cursor:not-allowed;opacity:var(--six-rating-color-disabled-opacity)}.six-rating__star{color:var(--six-rating-color)}.six-rating__star--filled{color:var(--six-rating-color-active)}';const a=class{constructor(o){t(this,o);this.sixBlur=r(this,"six-rating-blur");this.sixChange=r(this,"six-rating-change");this.sixFocus=r(this,"six-rating-focus");this.name="";this.value=0;this.disabled=false;this.required=false;this.label="";this.errorText="";this.invalid=false;this.max=5;this.size="medium";this.readonly=false;this.helpText="";this.hasFocus=false;this.hasLabelSlot=false;this.hasErrorSlot=false;this.hoveredValue=this.value;this.ratingId=`rating-${++a.id}`;this.labelId=`rating-label-${a.id}`;this.errorTextId=`input-error-text-${a.id}`;this.handleSlotChange=()=>{this.hasLabelSlot=e(this.el,"label");this.hasErrorSlot=e(this.el,"error-text")};this.handleBlur=()=>{this.hasFocus=false;this.sixBlur.emit(this.value)};this.handleFocus=()=>{this.hasFocus=true;this.sixFocus.emit()};this.handleKeyDown=t=>{if(t.key==="ArrowLeft"){t.preventDefault();if(this.hoveredValue>0){this.hoveredValue=this.hoveredValue-1;this.value=this.hoveredValue}}if(t.key==="ArrowRight"){t.preventDefault();if(this.hoveredValue<this.max){this.hoveredValue=this.hoveredValue+1}}}}handleValueChange(){this.sixChange.emit(this.value)}connectedCallback(){var t;(t=this.el.shadowRoot)===null||t===void 0?void 0:t.addEventListener("slotchange",this.handleSlotChange)}disconnectedCallback(){var t;(t=this.el.shadowRoot)===null||t===void 0?void 0:t.removeEventListener("slotchange",this.handleSlotChange)}renderStars(){return Array.from({length:this.max},((t,r)=>{const i=t=>{if(this.readonly||this.disabled){return}switch(t.type){case"mouseover":this.hoveredValue=r+1;break;case"mouseout":this.hoveredValue=this.value;break;case"click":this.value=this.hoveredValue;break}};return o("six-icon",{class:{"six-rating__star":true,"six-rating__star--filled":r<this.hoveredValue},filled:true,size:this.size,onMouseOver:i,onMouseOut:i,onClick:i},"star_rate")}))}render(){return o(s,{key:"ca3de959a1ffb915f0102ca6baa4a43c799d67ec",inputId:this.ratingId,label:this.label,labelId:this.labelId,hasLabelSlot:this.hasLabelSlot,errorTextId:this.errorTextId,errorText:this.errorText,errorTextCount:this.errorTextCount,helpText:this.helpText,hasErrorTextSlot:this.hasErrorSlot,size:"medium",disabled:this.disabled,required:this.required,displayError:this.invalid},o("div",{key:"ef452485f9c3615f4caeaefce7f7034d7f64119f",part:"base",class:{"six-rating":true,"six-rating--readonly":this.readonly,"six-rating--disabled":this.disabled},role:"slider","aria-label":this.label,"aria-disabled":this.disabled?"true":"false","aria-readonly":this.readonly?"true":"false","aria-valuenow":this.value,"aria-valuemin":0,"aria-valuemax":this.max,tabindex:this.disabled?"-1":"0",onBlur:this.handleBlur,onFocus:this.handleFocus,onKeyDown:this.handleKeyDown},this.renderStars(),o("input",{key:"187ec03d83c3b29fc5917a9abab324d40930b8f4",part:"input",id:this.ratingId,type:"hidden",max:this.max,min:0,name:this.name,value:this.value,disabled:this.disabled,required:this.required,role:"slider","aria-labelledby":this.labelId})))}get el(){return i(this)}static get watchers(){return{value:["handleValueChange"]}}};a.id=0;a.style=l;export{a as six_rating};
2
+ //# sourceMappingURL=p-39668d61.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["sixRatingCss","SixRating","constructor","hostRef","this","name","value","disabled","required","label","errorText","invalid","max","size","readonly","helpText","hasFocus","hasLabelSlot","hasErrorSlot","hoveredValue","ratingId","id","labelId","errorTextId","handleSlotChange","hasSlot","el","handleBlur","sixBlur","emit","handleFocus","sixFocus","handleKeyDown","event","key","preventDefault","handleValueChange","sixChange","connectedCallback","_a","shadowRoot","addEventListener","disconnectedCallback","removeEventListener","renderStars","Array","from","length","_","i","handleEvent","type","h","class","filled","onMouseOver","onMouseOut","onClick","render","FormControl","inputId","errorTextCount","hasErrorTextSlot","displayError","part","role","tabindex","onBlur","onFocus","onKeyDown","min"],"sources":["src/components/six-rating/six-rating.scss?tag=six-rating&encapsulation=shadow","src/components/six-rating/six-rating.tsx"],"sourcesContent":["@import '../../../src/global/component';\n@import '../../functional-components/form-control/form-control';\n\n:host {\n --six-rating-color: var(--six-color-web-rock-500);\n --six-rating-color-active: var(--six-color-warning-700);\n --six-rating-color-disabled-opacity: 0.4;\n\n display: block;\n}\n\n.six-rating {\n display: inline-flex;\n flex-direction: row;\n user-select: none;\n cursor: pointer;\n\n &--readonly {\n cursor: unset;\n }\n\n &--disabled {\n cursor: not-allowed;\n opacity: var(--six-rating-color-disabled-opacity);\n }\n\n &__star {\n color: var(--six-rating-color);\n\n &--filled {\n color: var(--six-rating-color-active);\n }\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Prop, State, Watch } from '@stencil/core';\nimport FormControl from '../../functional-components/form-control/form-control';\nimport { EmptyPayload } from '../../utils/types';\nimport { hasSlot } from '../../utils/slot';\n\n@Component({\n tag: 'six-rating',\n styleUrl: 'six-rating.scss',\n shadow: true,\n})\nexport class SixRating {\n @Element() el!: HTMLSixRatingElement;\n\n /** The rating's name attribute. */\n @Prop() name = '';\n\n /** The rating's value attribute. */\n @Prop({ mutable: true }) value: number = 0;\n\n /** Set to true to disable the rating. */\n @Prop() disabled = false;\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /** The label text. */\n @Prop() label: string = '';\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 /** Maximum number of stars. Default is 5 */\n @Prop() max: number = 5;\n\n /** Size of the stars */\n @Prop({ reflect: true }) size: 'xSmall' | 'small' | 'medium' | 'large' | 'xLarge' | 'xxLarge' | 'xxxLarge' = 'medium';\n\n /** If its readonly */\n @Prop() readonly: boolean = false;\n\n /** The rating's help text. Alternatively, you can use the help-text slot. */\n @Prop() helpText = '';\n\n /** Emitted when the control loses focus. */\n @Event({ eventName: 'six-rating-blur' }) sixBlur!: EventEmitter<number>;\n\n /** Emitted when the control's checked state changes. */\n @Event({ eventName: 'six-rating-change' }) sixChange!: EventEmitter<number>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-rating-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n // --\n\n @State() hasFocus = false;\n @State() hasLabelSlot = false;\n @State() hasErrorSlot = false;\n @State() hoveredValue = this.value;\n\n private static id: number = 0;\n\n private ratingId = `rating-${++SixRating.id}`;\n private labelId = `rating-label-${SixRating.id}`;\n private errorTextId = `input-error-text-${SixRating.id}`;\n\n @Watch('value')\n handleValueChange() {\n this.sixChange.emit(this.value);\n }\n\n connectedCallback() {\n this.el.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n }\n\n disconnectedCallback() {\n this.el.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n }\n\n private handleSlotChange = () => {\n this.hasLabelSlot = hasSlot(this.el, 'label');\n this.hasErrorSlot = hasSlot(this.el, 'error-text');\n };\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.sixBlur.emit(this.value);\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 if (this.hoveredValue > 0) {\n this.hoveredValue = this.hoveredValue - 1;\n this.value = this.hoveredValue;\n }\n }\n\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n if (this.hoveredValue < this.max) {\n this.hoveredValue = this.hoveredValue + 1;\n }\n }\n };\n\n private renderStars() {\n return Array.from({ length: this.max }, (_, i) => {\n const handleEvent = (event: Event) => {\n if (this.readonly || this.disabled) {\n return;\n }\n switch (event.type) {\n case 'mouseover':\n this.hoveredValue = i + 1;\n break;\n case 'mouseout':\n this.hoveredValue = this.value;\n break;\n case 'click':\n this.value = this.hoveredValue;\n break;\n }\n };\n\n return (\n <six-icon\n class={{\n 'six-rating__star': true,\n 'six-rating__star--filled': i < this.hoveredValue,\n }}\n filled\n size={this.size}\n onMouseOver={handleEvent}\n onMouseOut={handleEvent}\n onClick={handleEvent}\n >\n star_rate\n </six-icon>\n );\n });\n }\n\n render() {\n return (\n <FormControl\n inputId={this.ratingId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={this.hasLabelSlot}\n errorTextId={this.errorTextId}\n errorText={this.errorText}\n errorTextCount={this.errorTextCount}\n helpText={this.helpText}\n hasErrorTextSlot={this.hasErrorSlot}\n size=\"medium\"\n disabled={this.disabled}\n required={this.required}\n displayError={this.invalid}\n >\n <div\n part=\"base\"\n class={{\n 'six-rating': true,\n 'six-rating--readonly': this.readonly,\n 'six-rating--disabled': this.disabled,\n }}\n role=\"slider\"\n aria-label={this.label}\n aria-disabled={this.disabled ? 'true' : 'false'}\n aria-readonly={this.readonly ? 'true' : 'false'}\n aria-valuenow={this.value}\n aria-valuemin={0}\n aria-valuemax={this.max}\n tabindex={this.disabled ? '-1' : '0'}\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n onKeyDown={this.handleKeyDown}\n >\n {this.renderStars()}\n\n <input\n part=\"input\"\n id={this.ratingId}\n type=\"hidden\"\n max={this.max}\n min={0}\n name={this.name}\n value={this.value}\n disabled={this.disabled}\n required={this.required}\n role=\"slider\"\n aria-labelledby={this.labelId}\n />\n </div>\n </FormControl>\n );\n }\n}\n"],"mappings":"iIAAA,MAAMA,EAAe,kkG,MCURC,EAAS,MALtB,WAAAC,CAAAC,G,qIASUC,KAAIC,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B,WACbyC,QAAShE,KAAK0B,YACduC,UAAWjE,KAAK4B,eAEf5B,KAAKwC,cAENQ,EACE,SAAAlB,IAAA,2CAAA8B,KAAK,QACL3C,GAAIjB,KAAKgB,SACT+B,KAAK,SACLvC,IAAKR,KAAKQ,IACV0D,IAAK,EACLjE,KAAMD,KAAKC,KACXC,MAAOF,KAAKE,MACZC,SAAUH,KAAKG,SACfC,SAAUJ,KAAKI,SACfyD,KAAK,SACY,kBAAA7D,KAAKkB,W,qFAzIjBrB,EAAEoB,GAAW,E","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{r as t,c as e,h as r,g as o}from"./p-JoG9I7EO.js";import{F as a}from"./p-Dg9366Gk.js";import{h as i}from"./p-j3oIB5oT.js";import{E as s}from"./p-C4h4qpGl.js";const l=':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:100%;display:block}.textarea{display:flex;align-items:center;position:relative;width:100%;font-family:var(--six-font-family);font-weight:var(--six-input-font-weight);line-height:var(--six-line-height-normal);letter-spacing:var(--six-input-letter-spacing);background-color:var(--six-input-background-color);border:solid var(--six-border-width) var(--six-input-border-color);vertical-align:middle;transition:var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;cursor:text}.textarea:hover:not(.textarea--disabled){background-color:var(--six-input-background-color-hover);border-color:var(--six-input-border-color-hover)}.textarea:hover:not(.textarea--disabled) .textarea__control{color:var(--six-input-color-hover)}.textarea.textarea--focused:not(.textarea--disabled){background-color:var(--six-input-background-color-focus);box-shadow:var(--six-input-focus-shadow);border-color:var(--six-input-border-color-focus);color:var(--six-input-color-focus)}.textarea.textarea--focused:not(.textarea--disabled) .textarea__control{color:var(--six-input-color-focus)}.textarea.textarea--disabled{background-color:var(--six-input-background-color-disabled);border-color:var(--six-input-border-color-disabled);cursor:not-allowed}.textarea.textarea--disabled .textarea__control{color:var(--six-input-color-disabled)}.textarea.textarea--disabled .textarea__control::placeholder{color:var(--six-input-placeholder-color-disabled)}.textarea__control{flex:1 1 auto;height:calc(var(--height) - 2 * var(--six-border-width));font-family:inherit;font-size:inherit;font-weight:inherit;line-height:1.4;color:var(--sl-input-color);border:none;background:none;box-shadow:none;cursor:inherit;-webkit-appearance:none}.textarea__control::-webkit-search-decoration,.textarea__control::-webkit-search-cancel-button,.textarea__control::-webkit-search-results-button,.textarea__control::-webkit-search-results-decoration{-webkit-appearance:none}.textarea__control::placeholder{color:var(--six-input-placeholder-color);user-select:none}.textarea__control:focus{outline:none}.textarea--invalid:not(.textarea--disabled):not(.textarea--focused){border-color:var(--six-input-border-color-danger)}.textarea--small{border-radius:var(--six-input-border-radius-small);font-size:var(--six-input-font-size-small)}.textarea--small .textarea__control{padding:0.5em var(--six-input-spacing-small)}.textarea--medium{border-radius:var(--six-input-border-radius-medium);font-size:var(--six-input-font-size-medium)}.textarea--medium .textarea__control{padding:0.5em var(--six-input-spacing-medium)}.textarea--large{border-radius:var(--six-input-border-radius-large);font-size:var(--six-input-font-size-large)}.textarea--large .textarea__control{padding:0.5em var(--six-input-spacing-large)}.textarea--resize-none .textarea__control{resize:none}.textarea--resize-vertical .textarea__control{resize:vertical}.textarea--resize-auto .textarea__control{height:auto;resize:none}';let n=0;const h=class{constructor(r){t(this,r);this.sixChange=e(this,"six-textarea-change");this.sixInput=e(this,"six-textarea-input");this.sixFocus=e(this,"six-textarea-focus");this.sixBlur=e(this,"six-textarea-blur");this.inputId=`textarea-${++n}`;this.labelId=`textarea-label-${n}`;this.helpTextId=`textarea-help-text-${n}`;this.errorTextId=`input-error-text-${n}`;this.eventListeners=new s;this.resizeObserver=new ResizeObserver((()=>this.setTextareaHeight()));this.hasFocus=false;this.hasHelpTextSlot=false;this.hasLabelSlot=false;this.hasErrorTextSlot=false;this.size="medium";this.name="";this.value="";this.helpText="";this.rows=4;this.resize="vertical";this.disabled=false;this.readonly=false;this.required=false;this.label="";this.errorText="";this.invalid=false;this.autocapitalize="off";this.autocorrect="off";this.autocomplete="off";this.autofocus=false;this.spellcheck=false;this.handleChange=()=>{if(this.nativeTextarea!=null){this.value=this.nativeTextarea.value;this.sixChange.emit()}};this.handleInput=()=>{if(this.nativeTextarea!=null){this.value=this.nativeTextarea.value;this.setTextareaHeight();this.sixInput.emit()}};this.handleBlur=()=>{this.hasFocus=false;this.sixBlur.emit()};this.handleFocus=()=>{this.hasFocus=true;this.sixFocus.emit()};this.handleSlotChange=()=>{this.hasLabelSlot=i(this.host,"label");this.hasHelpTextSlot=i(this.host,"help-text");this.hasErrorTextSlot=i(this.host,"error-text")}}handleLabelChange(){this.handleSlotChange()}handleRowsChange(){this.setTextareaHeight()}handleValueChange(){this.value=this.getValue();if(this.nativeTextarea!=null){if(this.nativeTextarea.value!==this.value){this.nativeTextarea.value=this.value}}}connectedCallback(){var t;(t=this.host.shadowRoot)===null||t===void 0?void 0:t.addEventListener("slotchange",this.handleSlotChange);this.eventListeners.forward("six-textarea-input","input",this.host);this.eventListeners.forward("six-textarea-change","change",this.host);this.eventListeners.forward("six-textarea-focus","focus",this.host);this.eventListeners.forward("six-textarea-blur","blur",this.host)}componentWillLoad(){this.handleSlotChange()}componentDidLoad(){this.setTextareaHeight();if(this.nativeTextarea!=null){this.resizeObserver.observe(this.nativeTextarea)}}disconnectedCallback(){var t;if(this.nativeTextarea!=null){this.resizeObserver.unobserve(this.nativeTextarea)}(t=this.host.shadowRoot)===null||t===void 0?void 0:t.removeEventListener("slotchange",this.handleSlotChange);this.eventListeners.removeAll()}async setFocus(t){var e;(e=this.nativeTextarea)===null||e===void 0?void 0:e.focus(t)}async removeFocus(){var t;(t=this.nativeTextarea)===null||t===void 0?void 0:t.blur()}async select(){var t;return(t=this.nativeTextarea)===null||t===void 0?void 0:t.select()}async setSelectionRange(t,e,r="none"){var o;return(o=this.nativeTextarea)===null||o===void 0?void 0:o.setSelectionRange(t,e,r)}async setRangeText(t,e,r,o="preserve"){if(this.nativeTextarea==null)return;this.nativeTextarea.setRangeText(t,e,r,o);if(this.getValue()!==this.nativeTextarea.value){this.value=this.nativeTextarea.value;this.setTextareaHeight();this.sixChange.emit();this.sixInput.emit()}}setTextareaHeight(){if(this.nativeTextarea==null)return;if(this.resize==="auto"){this.nativeTextarea.style.height="auto";this.nativeTextarea.style.height=this.nativeTextarea.scrollHeight+"px"}else{this.nativeTextarea.style.height=undefined}}getValue(){var t;return((t=this.value)!==null&&t!==void 0?t:"").toString()}render(){return r(a,{key:"e535cb9819c9f78361b451b106349d44aa13bc25",inputId:this.inputId,label:this.label,labelId:this.labelId,hasLabelSlot:this.hasLabelSlot,helpTextId:this.helpTextId,helpText:this.helpText,hasHelpTextSlot:this.hasHelpTextSlot,errorTextId:this.errorTextId,errorText:this.errorText,errorTextCount:this.errorTextCount,hasErrorTextSlot:this.hasErrorTextSlot,size:this.size,disabled:this.disabled,required:this.required,displayError:this.invalid},r("div",{key:"5cf703bd10753ce53474c724839745a24769f843",part:"base",class:{textarea:true,"textarea--small":this.size==="small","textarea--medium":this.size==="medium","textarea--large":this.size==="large","textarea--disabled":this.disabled,"textarea--focused":this.hasFocus,"textarea--empty":this.getValue().length===0,"textarea--invalid":this.invalid,"textarea--resize-none":this.resize==="none","textarea--resize-vertical":this.resize==="vertical","textarea--resize-auto":this.resize==="auto"}},r("textarea",{key:"1a1fc11b8ae91f3c404670a05ea0cc9e0598fa80",part:"textarea",ref:t=>this.nativeTextarea=t,id:this.inputId,class:"textarea__control",name:this.name,placeholder:this.placeholder,disabled:this.disabled,readOnly:this.readonly,rows:this.rows,minLength:this.minlength,maxLength:this.maxlength,value:this.getValue(),autoCapitalize:this.autocapitalize,autoCorrect:this.autocorrect,autoFocus:this.autofocus,spellcheck:this.spellcheck,required:this.required,inputMode:this.inputmode,"aria-labelledby":this.labelId,onChange:this.handleChange,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur})))}get host(){return o(this)}static get watchers(){return{helpText:["handleLabelChange"],errorText:["handleLabelChange"],label:["handleLabelChange"],rows:["handleRowsChange"],value:["handleValueChange"]}}};h.style=l;export{h as six_textarea};
2
- //# sourceMappingURL=p-ea61b009.entry.js.map
1
+ import{r as t,c as e,h as r,g as o}from"./p-JoG9I7EO.js";import{F as i}from"./p-Dg9366Gk.js";import{h as a}from"./p-j3oIB5oT.js";import{E as s}from"./p-C4h4qpGl.js";const l=':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:100%;display:block}.textarea{display:flex;align-items:center;position:relative;width:100%;font-family:var(--six-font-family);font-weight:var(--six-input-font-weight);line-height:var(--six-line-height-normal);letter-spacing:var(--six-input-letter-spacing);background-color:var(--six-input-background-color);border:solid var(--six-border-width) var(--six-input-border-color);vertical-align:middle;transition:var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;cursor:text}.textarea:hover:not(.textarea--disabled){background-color:var(--six-input-background-color-hover);border-color:var(--six-input-border-color-hover)}.textarea:hover:not(.textarea--disabled) .textarea__control{color:var(--six-input-color-hover)}.textarea.textarea--focused:not(.textarea--disabled){background-color:var(--six-input-background-color-focus);box-shadow:var(--six-input-focus-shadow);border-color:var(--six-input-border-color-focus);color:var(--six-input-color-focus)}.textarea.textarea--focused:not(.textarea--disabled) .textarea__control{color:var(--six-input-color-focus)}.textarea.textarea--disabled{background-color:var(--six-input-background-color-disabled);border-color:var(--six-input-border-color-disabled);cursor:not-allowed}.textarea.textarea--disabled .textarea__control{color:var(--six-input-color-disabled)}.textarea.textarea--disabled .textarea__control::placeholder{color:var(--six-input-placeholder-color-disabled)}.textarea__control{flex:1 1 auto;height:calc(var(--height) - 2 * var(--six-border-width));font-family:inherit;font-size:inherit;font-weight:inherit;line-height:1.4;color:var(--sl-input-color);border:none;background:none;box-shadow:none;cursor:inherit;-webkit-appearance:none}.textarea__control::-webkit-search-decoration,.textarea__control::-webkit-search-cancel-button,.textarea__control::-webkit-search-results-button,.textarea__control::-webkit-search-results-decoration{-webkit-appearance:none}.textarea__control::placeholder{color:var(--six-input-placeholder-color);user-select:none}.textarea__control:focus{outline:none}.textarea--invalid:not(.textarea--disabled):not(.textarea--focused){border-color:var(--six-input-border-color-danger)}.textarea--small{border-radius:var(--six-input-border-radius-small);font-size:var(--six-input-font-size-small)}.textarea--small .textarea__control{padding:0.5em var(--six-input-spacing-small)}.textarea--medium{border-radius:var(--six-input-border-radius-medium);font-size:var(--six-input-font-size-medium)}.textarea--medium .textarea__control{padding:0.5em var(--six-input-spacing-medium)}.textarea--large{border-radius:var(--six-input-border-radius-large);font-size:var(--six-input-font-size-large)}.textarea--large .textarea__control{padding:0.5em var(--six-input-spacing-large)}.textarea--resize-none .textarea__control{resize:none}.textarea--resize-vertical .textarea__control{resize:vertical}.textarea--resize-auto .textarea__control{height:auto;resize:none}';let n=0;const h=class{constructor(r){t(this,r);this.sixChange=e(this,"six-textarea-change");this.sixInput=e(this,"six-textarea-input");this.sixFocus=e(this,"six-textarea-focus");this.sixBlur=e(this,"six-textarea-blur");this.inputId=`textarea-${++n}`;this.labelId=`textarea-label-${n}`;this.helpTextId=`textarea-help-text-${n}`;this.errorTextId=`input-error-text-${n}`;this.eventListeners=new s;this.resizeObserver=new ResizeObserver((()=>this.setTextareaHeight()));this.hasFocus=false;this.hasHelpTextSlot=false;this.hasLabelSlot=false;this.hasErrorTextSlot=false;this.size="medium";this.name="";this.value="";this.helpText="";this.rows=4;this.resize="vertical";this.disabled=false;this.readonly=false;this.required=false;this.label="";this.errorText="";this.invalid=false;this.autocapitalize="off";this.autocorrect="off";this.autocomplete="off";this.autofocus=false;this.spellcheck=false;this.handleChange=()=>{if(this.nativeTextarea!=null){this.value=this.nativeTextarea.value;this.sixChange.emit()}};this.handleInput=()=>{if(this.nativeTextarea!=null){this.value=this.nativeTextarea.value;this.setTextareaHeight();this.sixInput.emit()}};this.handleBlur=()=>{this.hasFocus=false;this.sixBlur.emit()};this.handleFocus=()=>{this.hasFocus=true;this.sixFocus.emit()};this.handleSlotChange=()=>{this.hasLabelSlot=a(this.host,"label");this.hasHelpTextSlot=a(this.host,"help-text");this.hasErrorTextSlot=a(this.host,"error-text")}}handleLabelChange(){this.handleSlotChange()}handleRowsChange(){this.setTextareaHeight()}handleValueChange(){this.value=this.getValue();if(this.nativeTextarea!=null){if(this.nativeTextarea.value!==this.value){this.nativeTextarea.value=this.value}}}connectedCallback(){var t;(t=this.host.shadowRoot)===null||t===void 0?void 0:t.addEventListener("slotchange",this.handleSlotChange);this.eventListeners.forward("six-textarea-input","input",this.host);this.eventListeners.forward("six-textarea-change","change",this.host);this.eventListeners.forward("six-textarea-focus","focus",this.host);this.eventListeners.forward("six-textarea-blur","blur",this.host)}componentWillLoad(){this.handleSlotChange()}componentDidLoad(){this.setTextareaHeight();if(this.nativeTextarea!=null){this.resizeObserver.observe(this.nativeTextarea)}}disconnectedCallback(){var t;if(this.nativeTextarea!=null){this.resizeObserver.unobserve(this.nativeTextarea)}(t=this.host.shadowRoot)===null||t===void 0?void 0:t.removeEventListener("slotchange",this.handleSlotChange);this.eventListeners.removeAll()}async setFocus(t){var e;(e=this.nativeTextarea)===null||e===void 0?void 0:e.focus(t)}async removeFocus(){var t;(t=this.nativeTextarea)===null||t===void 0?void 0:t.blur()}async select(){var t;return(t=this.nativeTextarea)===null||t===void 0?void 0:t.select()}async setSelectionRange(t,e,r="none"){var o;return(o=this.nativeTextarea)===null||o===void 0?void 0:o.setSelectionRange(t,e,r)}async setRangeText(t,e,r,o="preserve"){if(this.nativeTextarea==null)return;this.nativeTextarea.setRangeText(t,e,r,o);if(this.getValue()!==this.nativeTextarea.value){this.value=this.nativeTextarea.value;this.setTextareaHeight();this.sixChange.emit();this.sixInput.emit()}}setTextareaHeight(){if(this.nativeTextarea==null)return;if(this.resize==="auto"){this.nativeTextarea.style.height="auto";this.nativeTextarea.style.height=this.nativeTextarea.scrollHeight+"px"}else{this.nativeTextarea.style.height=undefined}}getValue(){var t;return((t=this.value)!==null&&t!==void 0?t:"").toString()}render(){return r(i,{key:"82dacccbeabf732b3d49738f0b5b9d725938014d",inputId:this.inputId,label:this.label,labelId:this.labelId,hasLabelSlot:this.hasLabelSlot,helpTextId:this.helpTextId,helpText:this.helpText,hasHelpTextSlot:this.hasHelpTextSlot,errorTextId:this.errorTextId,errorText:this.errorText,errorTextCount:this.errorTextCount,hasErrorTextSlot:this.hasErrorTextSlot,size:this.size,disabled:this.disabled,required:this.required,displayError:this.invalid},r("div",{key:"88ddaeed09431fd06608350652de1280e729d44d",part:"base",class:{textarea:true,"textarea--small":this.size==="small","textarea--medium":this.size==="medium","textarea--large":this.size==="large","textarea--disabled":this.disabled,"textarea--focused":this.hasFocus,"textarea--empty":this.getValue().length===0,"textarea--invalid":this.invalid,"textarea--resize-none":this.resize==="none","textarea--resize-vertical":this.resize==="vertical","textarea--resize-auto":this.resize==="auto"}},r("textarea",{key:"59838f0a6a739c7f6ed950f7ec73c228571e201a",part:"textarea",ref:t=>this.nativeTextarea=t,id:this.inputId,class:"textarea__control",name:this.name,placeholder:this.placeholder,disabled:this.disabled,readOnly:this.readonly,rows:this.rows,minLength:this.minlength,maxLength:this.maxlength,value:this.getValue(),autoCapitalize:this.autocapitalize,autoCorrect:this.autocorrect,autoFocus:this.autofocus,spellcheck:this.spellcheck,required:this.required,inputMode:this.inputmode,"aria-labelledby":this.labelId,onChange:this.handleChange,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur})))}get host(){return o(this)}static get watchers(){return{helpText:["handleLabelChange"],errorText:["handleLabelChange"],label:["handleLabelChange"],rows:["handleRowsChange"],value:["handleValueChange"]}}};h.style=l;export{h as six_textarea};
2
+ //# sourceMappingURL=p-6c8182fa.entry.js.map