@ukic/canary-web-components 2.0.0-canary.24 → 2.0.0-canary.26

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/{helpers-85c5ca15.js → helpers-6817cfbb.js} +20 -31
  3. package/dist/cjs/helpers-6817cfbb.js.map +1 -0
  4. package/dist/cjs/ic-accordion.cjs.entry.js +1 -1
  5. package/dist/cjs/ic-accordion.cjs.entry.js.map +1 -1
  6. package/dist/cjs/ic-alert.cjs.entry.js +9 -4
  7. package/dist/cjs/ic-alert.cjs.entry.js.map +1 -1
  8. package/dist/cjs/ic-badge.cjs.entry.js +2 -2
  9. package/dist/cjs/ic-badge.cjs.entry.js.map +1 -1
  10. package/dist/cjs/ic-card-horizontal.cjs.entry.js +1 -1
  11. package/dist/cjs/ic-data-table-title-bar.cjs.entry.js +1 -1
  12. package/dist/cjs/ic-data-table.cjs.entry.js +200 -51
  13. package/dist/cjs/ic-data-table.cjs.entry.js.map +1 -1
  14. package/dist/cjs/ic-date-input.cjs.entry.js +3 -2
  15. package/dist/cjs/ic-date-input.cjs.entry.js.map +1 -1
  16. package/dist/cjs/ic-date-picker.cjs.entry.js +3 -1
  17. package/dist/cjs/ic-date-picker.cjs.entry.js.map +1 -1
  18. package/dist/cjs/ic-dialog.cjs.entry.js.map +1 -1
  19. package/dist/cjs/ic-empty-state_2.cjs.entry.js +1 -1
  20. package/dist/cjs/ic-menu-with-multi.cjs.entry.js +1 -1
  21. package/dist/cjs/ic-pagination_4.cjs.entry.js +2 -1
  22. package/dist/cjs/ic-pagination_4.cjs.entry.js.map +1 -1
  23. package/dist/cjs/ic-select-with-multi.cjs.entry.js +1 -1
  24. package/dist/cjs/ic-toast-region.cjs.entry.js +6 -0
  25. package/dist/cjs/ic-toast-region.cjs.entry.js.map +1 -1
  26. package/dist/cjs/ic-tree-item.cjs.entry.js +1 -1
  27. package/dist/cjs/ic-tree-view.cjs.entry.js +1 -1
  28. package/dist/cjs/loader.cjs.js +1 -1
  29. package/dist/collection/components/ic-data-table/ic-data-table.css +31 -7
  30. package/dist/collection/components/ic-data-table/ic-data-table.js +298 -56
  31. package/dist/collection/components/ic-data-table/ic-data-table.js.map +1 -1
  32. package/dist/collection/components/ic-data-table/ic-data-table.types.js.map +1 -1
  33. package/dist/collection/components/ic-data-table/story-data.js +143 -54
  34. package/dist/collection/components/ic-data-table/story-data.js.map +1 -1
  35. package/dist/collection/components/ic-date-input/ic-date-input.js +20 -1
  36. package/dist/collection/components/ic-date-input/ic-date-input.js.map +1 -1
  37. package/dist/collection/components/ic-date-input/test/basic/ic-date-input.spec.js +9 -0
  38. package/dist/collection/components/ic-date-input/test/basic/ic-date-input.spec.js.map +1 -1
  39. package/dist/collection/components/ic-date-picker/ic-date-picker.js +20 -0
  40. package/dist/collection/components/ic-date-picker/ic-date-picker.js.map +1 -1
  41. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker.spec.js +10 -0
  42. package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker.spec.js.map +1 -1
  43. package/dist/collection/utils/helpers.js +22 -0
  44. package/dist/collection/utils/helpers.js.map +1 -1
  45. package/dist/components/helpers2.js +18 -29
  46. package/dist/components/helpers2.js.map +1 -1
  47. package/dist/components/ic-accordion.js +1 -1
  48. package/dist/components/ic-accordion.js.map +1 -1
  49. package/dist/components/ic-alert2.js +11 -5
  50. package/dist/components/ic-alert2.js.map +1 -1
  51. package/dist/components/ic-badge.js +2 -2
  52. package/dist/components/ic-badge.js.map +1 -1
  53. package/dist/components/ic-data-table.js +207 -52
  54. package/dist/components/ic-data-table.js.map +1 -1
  55. package/dist/components/ic-date-input2.js +3 -1
  56. package/dist/components/ic-date-input2.js.map +1 -1
  57. package/dist/components/ic-date-picker.js +3 -0
  58. package/dist/components/ic-date-picker.js.map +1 -1
  59. package/dist/components/ic-dialog.js.map +1 -1
  60. package/dist/components/ic-text-field2.js +3 -1
  61. package/dist/components/ic-text-field2.js.map +1 -1
  62. package/dist/components/ic-toast-region.js +6 -0
  63. package/dist/components/ic-toast-region.js.map +1 -1
  64. package/dist/core/core.esm.js +1 -1
  65. package/dist/core/core.esm.js.map +1 -1
  66. package/dist/core/{p-13993bf3.entry.js → p-01bc462e.entry.js} +2 -2
  67. package/dist/core/p-01bc462e.entry.js.map +1 -0
  68. package/dist/core/{p-401d0c66.entry.js → p-20997691.entry.js} +2 -2
  69. package/dist/core/p-297e99cf.js +2 -0
  70. package/dist/core/p-297e99cf.js.map +1 -0
  71. package/dist/core/p-40e5fa80.entry.js +2 -0
  72. package/dist/core/p-40e5fa80.entry.js.map +1 -0
  73. package/dist/core/p-673a4a62.entry.js.map +1 -1
  74. package/dist/core/p-6af080d3.entry.js +2 -0
  75. package/dist/core/p-6af080d3.entry.js.map +1 -0
  76. package/dist/core/p-74abc3bb.entry.js +2 -0
  77. package/dist/core/p-74abc3bb.entry.js.map +1 -0
  78. package/dist/core/{p-4309460f.entry.js → p-80d6a6b5.entry.js} +2 -2
  79. package/dist/core/{p-06732eaf.entry.js → p-92f701e7.entry.js} +2 -2
  80. package/dist/core/{p-ec9edecf.entry.js → p-989310a8.entry.js} +2 -2
  81. package/dist/core/p-989310a8.entry.js.map +1 -0
  82. package/dist/core/{p-ede631c5.entry.js → p-9b34989b.entry.js} +2 -2
  83. package/dist/core/p-bd1f8741.entry.js +2 -0
  84. package/dist/core/p-bd1f8741.entry.js.map +1 -0
  85. package/dist/core/{p-57043b1e.entry.js → p-c6bdbe69.entry.js} +2 -2
  86. package/dist/core/{p-a052bb95.entry.js → p-c98ce508.entry.js} +2 -2
  87. package/dist/core/{p-b29e96b5.entry.js → p-d362992d.entry.js} +2 -2
  88. package/dist/core/{p-b97eba08.entry.js → p-ee8a3de6.entry.js} +2 -2
  89. package/dist/core/p-ee8a3de6.entry.js.map +1 -0
  90. package/dist/core/p-f5fbfbc9.entry.js +2 -0
  91. package/dist/core/p-f5fbfbc9.entry.js.map +1 -0
  92. package/dist/esm/core.js +1 -1
  93. package/dist/esm/{helpers-f543bc77.js → helpers-5bd2012a.js} +19 -30
  94. package/dist/esm/helpers-5bd2012a.js.map +1 -0
  95. package/dist/esm/ic-accordion.entry.js +1 -1
  96. package/dist/esm/ic-accordion.entry.js.map +1 -1
  97. package/dist/esm/ic-alert.entry.js +10 -5
  98. package/dist/esm/ic-alert.entry.js.map +1 -1
  99. package/dist/esm/ic-badge.entry.js +2 -2
  100. package/dist/esm/ic-badge.entry.js.map +1 -1
  101. package/dist/esm/ic-card-horizontal.entry.js +1 -1
  102. package/dist/esm/ic-data-table-title-bar.entry.js +1 -1
  103. package/dist/esm/ic-data-table.entry.js +201 -52
  104. package/dist/esm/ic-data-table.entry.js.map +1 -1
  105. package/dist/esm/ic-date-input.entry.js +3 -2
  106. package/dist/esm/ic-date-input.entry.js.map +1 -1
  107. package/dist/esm/ic-date-picker.entry.js +3 -1
  108. package/dist/esm/ic-date-picker.entry.js.map +1 -1
  109. package/dist/esm/ic-dialog.entry.js.map +1 -1
  110. package/dist/esm/ic-empty-state_2.entry.js +1 -1
  111. package/dist/esm/ic-menu-with-multi.entry.js +1 -1
  112. package/dist/esm/ic-pagination_4.entry.js +2 -1
  113. package/dist/esm/ic-pagination_4.entry.js.map +1 -1
  114. package/dist/esm/ic-select-with-multi.entry.js +1 -1
  115. package/dist/esm/ic-toast-region.entry.js +6 -0
  116. package/dist/esm/ic-toast-region.entry.js.map +1 -1
  117. package/dist/esm/ic-tree-item.entry.js +1 -1
  118. package/dist/esm/ic-tree-view.entry.js +1 -1
  119. package/dist/esm/loader.js +1 -1
  120. package/dist/types/components/ic-data-table/ic-data-table.d.ts +32 -9
  121. package/dist/types/components/ic-data-table/ic-data-table.types.d.ts +12 -4
  122. package/dist/types/components/ic-data-table/story-data.d.ts +69 -8
  123. package/dist/types/components/ic-date-input/ic-date-input.d.ts +4 -0
  124. package/dist/types/components/ic-date-picker/ic-date-picker.d.ts +4 -0
  125. package/dist/types/components.d.ts +62 -6
  126. package/dist/types/interface.d.ts +1 -0
  127. package/dist/types/utils/helpers.d.ts +6 -0
  128. package/hydrate/index.js +267 -103
  129. package/package.json +6 -6
  130. package/dist/cjs/helpers-85c5ca15.js.map +0 -1
  131. package/dist/collection/components/ic-select-with-multi/test/a11y/ic-select.test.a11y.js +0 -146
  132. package/dist/collection/components/ic-select-with-multi/test/a11y/ic-select.test.a11y.js.map +0 -1
  133. package/dist/collection/components/ic-select-with-multi/test/basic/ic-select.e2e.js +0 -2040
  134. package/dist/collection/components/ic-select-with-multi/test/basic/ic-select.e2e.js.map +0 -1
  135. package/dist/core/p-13993bf3.entry.js.map +0 -1
  136. package/dist/core/p-1f9cb805.entry.js +0 -2
  137. package/dist/core/p-1f9cb805.entry.js.map +0 -1
  138. package/dist/core/p-3f2723aa.entry.js +0 -2
  139. package/dist/core/p-3f2723aa.entry.js.map +0 -1
  140. package/dist/core/p-59993f36.entry.js +0 -2
  141. package/dist/core/p-59993f36.entry.js.map +0 -1
  142. package/dist/core/p-91cf89c8.entry.js +0 -2
  143. package/dist/core/p-91cf89c8.entry.js.map +0 -1
  144. package/dist/core/p-9777ebb1.entry.js +0 -2
  145. package/dist/core/p-9777ebb1.entry.js.map +0 -1
  146. package/dist/core/p-adbe0d89.js +0 -2
  147. package/dist/core/p-adbe0d89.js.map +0 -1
  148. package/dist/core/p-b97eba08.entry.js.map +0 -1
  149. package/dist/core/p-ec9edecf.entry.js.map +0 -1
  150. package/dist/esm/helpers-f543bc77.js.map +0 -1
  151. package/dist/types/components/ic-select-with-multi/test/a11y/ic-select.test.a11y.d.ts +0 -1
  152. /package/dist/core/{p-401d0c66.entry.js.map → p-20997691.entry.js.map} +0 -0
  153. /package/dist/core/{p-4309460f.entry.js.map → p-80d6a6b5.entry.js.map} +0 -0
  154. /package/dist/core/{p-06732eaf.entry.js.map → p-92f701e7.entry.js.map} +0 -0
  155. /package/dist/core/{p-ede631c5.entry.js.map → p-9b34989b.entry.js.map} +0 -0
  156. /package/dist/core/{p-57043b1e.entry.js.map → p-c6bdbe69.entry.js.map} +0 -0
  157. /package/dist/core/{p-a052bb95.entry.js.map → p-c98ce508.entry.js.map} +0 -0
  158. /package/dist/core/{p-b29e96b5.entry.js.map → p-d362992d.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{r as e,f as t,h as i,g as a}from"./p-8455d1bb.js";import{c as r,r as o,i as s,o as d,g as c,I as n}from"./p-adbe0d89.js";const l='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:flex;--card-max-width:548px;--image-size:114px;--message-max-lines:2}.card.small{--card-max-width:360px}.card.large{--card-max-width:720px;--image-size:142px;--message-max-lines:3}.card.extra-large{--card-max-width:1130px;--image-size:186px;--message-max-lines:5}a{text-decoration:none !important;color:var(--ic-architectural-black) !important}button{border:none;background-color:transparent;outline:var(--ic-hc-focus-outline);padding:0}.card,.card.clickable{display:flex;flex-direction:row;border:var(--ic-border-default);border-radius:var(--ic-border-radius);box-sizing:border-box;text-align:left;color:var(--ic-architectural-black);transition:var(--ic-easing-transition-fast);position:relative;max-width:var(--card-max-width);height:-moz-fit-content;height:fit-content;width:var(--card-horizontal-width, -moz-fit-content);width:var(--card-horizontal-width, fit-content)}.dark.card,.dark.card.clickable{border:var(--ic-border-width) solid var(--ic-architectural-700)}.card.clickable:hover{background-color:var(--ic-action-default-bg-hover);border:var(--ic-border-hover);cursor:pointer}.card.clickable:focus,.card.clickable.focussed{background-color:var(--ic-action-default-bg-hover);box-shadow:var(--ic-border-focus);outline:var(--ic-hc-focus-outline);border:var(--ic-border-pressed)}.card.clickable:active{background-color:var(--ic-action-default-bg-active);box-shadow:var(--ic-border-focus)}.card.disabled{border:var(--ic-border-disabled)}.card-header{display:flex;align-items:center}.icon{display:flex;align-items:center;padding-right:var(--ic-space-xs)}.card.disabled ::slotted(svg){fill:var(--ic-color-tertiary-text)}.card.clickable .card-title{color:var(--ic-hyperlink);text-decoration:underline;text-decoration-thickness:var(--ic-space-1px)}.card.clickable:hover .card-title,.card.clickable:focus .card-title,.card.clickable.focussed .card-title{display:inline-block;border-bottom:0.25rem solid !important;margin-bottom:-0.25rem !important;text-decoration:none}.card.clickable:active .card-title{text-decoration:none}.card.disabled .card-title{text-decoration:underline;text-decoration-thickness:var(--ic-space-1px);text-decoration-color:var(--ic-color-tertiary-text);color:var(--ic-color-tertiary-text)}.card-message{margin-top:var(--ic-space-xxxs);align-items:left}.card.disabled .card-message{color:var(--ic-color-tertiary-text)}.image{display:flex;height:var(--image-size);width:var(--image-size);border-radius:var(--ic-border-radius)}.card-content{display:flex;flex-direction:column;padding:var(--ic-space-md)}.card .card-title ::slotted([slot="heading"]),.card .card-title ic-typography p{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:calc(var(--card-max-width) - var(--ic-space-xl))}.card.with-icon .card-title ::slotted([slot="heading"]),.card.with-icon .card-title ic-typography p{max-width:calc(var(--card-max-width) - (2 * var(--ic-space-xl)))}.card.with-image .card-title ::slotted([slot="heading"]),.card.with-image .card-title ic-typography p{max-width:calc(\n var(--card-max-width) - var(--image-size) - var(--ic-space-xl)\n )}.card.with-image.with-icon .card-title ::slotted([slot="heading"]),.card.with-image.with-icon .card-title ic-typography p{max-width:calc(\n var(--card-max-width) - var(--image-size) - (2 * var(--ic-space-xl))\n )}.card .card-message ::slotted([slot="message"]),.card .card-message ic-typography{display:-webkit-box;-webkit-box-orient:vertical;line-clamp:var(--message-max-lines, initial);-webkit-line-clamp:var(--message-max-lines, initial);overflow:hidden}@media (forced-colors: active){.card ::slotted(svg){fill:currentcolor}.card.disabled ::slotted(svg){fill:GrayText !important}.card.disabled{border-color:GrayText !important}.card.disabled .card-message,.card.disabled .card-title{color:GrayText}}';const h=class{constructor(i){e(this,i);this.hostMutationObserver=null;this.hostMutationCallback=e=>{if(e.some((({type:e,addedNodes:t,removedNodes:i})=>e==="childList"?r(t,i,"image"):false))){t(this)}};this.parentFocussed=()=>{this.isFocussed=true};this.parentBlurred=()=>{this.isFocussed=false};this.appearance="default";this.isFocussed=false;this.parentEl=null;this.parentIsAnchorTag=false;this.clickable=false;this.disabled=false;this.heading=undefined;this.href=undefined;this.hreflang="";this.message="";this.referrerpolicy=undefined;this.rel=undefined;this.size="medium";this.target=undefined}disconnectedCallback(){var e;if(this.parentIsAnchorTag){this.parentEl.removeEventListener("focus",this.parentFocussed);this.parentEl.removeEventListener("blur",this.parentBlurred)}(e=this.hostMutationObserver)===null||e===void 0?void 0:e.disconnect()}componentWillLoad(){this.parentEl=this.el.parentElement;if(this.parentEl.tagName==="A"){this.clickable=true;this.parentIsAnchorTag=true;this.parentEl.classList.add("ic-card-wrapper-link");this.parentEl.addEventListener("focus",this.parentFocussed);this.parentEl.addEventListener("blur",this.parentBlurred)}o(this.disabled,this.el)}componentDidLoad(){!s(this.el,"heading")&&d([{prop:this.heading,propName:"heading"}],"Card");this.updateTheme();this.hostMutationObserver=new MutationObserver(this.hostMutationCallback);this.hostMutationObserver.observe(this.el,{childList:true})}handleHostClick(e){if(this.disabled){e.stopImmediatePropagation()}}themeChangeHandler(e){const t=e.detail;this.updateTheme(t.mode)}async setFocus(){if(this.el.shadowRoot.querySelector("a")){this.el.shadowRoot.querySelector("a").focus()}else if(this.el.shadowRoot.querySelector("button")){this.el.shadowRoot.querySelector("button").focus()}}updateTheme(e=null){const t=c(this.el,e||null);if(t!==n.Default){this.appearance=t}}render(){const{clickable:e,disabled:t,heading:a,message:r,href:o,hreflang:d,referrerpolicy:c,rel:l,target:h,parentIsAnchorTag:b,isFocussed:m,size:p}=this;const u=b?"div":e?this.href===undefined?"button":"a":"div";const g=u=="a"&&{href:o,hrefLang:d,referrerPolicy:c,rel:l,target:h};return i(u,Object.assign({class:{["card"]:true,["clickable"]:e&&!t,["disabled"]:t,["focussed"]:m,["dark"]:this.appearance===n.Dark,[`${p}`]:true,["with-icon"]:s(this.el,"icon"),["with-image"]:s(this.el,"image")},tabindex:e&&!b?0:null,"aria-disabled":t?"true":null,disabled:t?true:null},g),s(this.el,"image")&&i("div",{class:{["image"]:true}},i("slot",{name:"image"})),i("div",{class:"card-content"},i("div",{class:"card-header"},s(this.el,"icon")&&i("div",{class:"icon"},i("slot",{name:"icon"})),i("div",{class:"card-title"},i("slot",{name:"heading"},i("ic-typography",{variant:"h4"},i("p",null,a))))),(r||s(this.el,"message"))&&i("div",{class:{["card-message"]:true}},r&&i("ic-typography",{variant:"body"},r),s(this.el,"message")&&i("slot",{name:"message"}))),s(this.el,"badge")&&i("slot",{name:"badge"}))}get el(){return a(this)}};h.style=l;export{h as ic_card_horizontal};
2
- //# sourceMappingURL=p-ede631c5.entry.js.map
1
+ import{r as e,f as t,h as i,g as a}from"./p-8455d1bb.js";import{c as r,r as o,i as s,o as c,g as d,I as n}from"./p-297e99cf.js";const l='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:flex;--card-max-width:548px;--image-size:114px;--message-max-lines:2}.card.small{--card-max-width:360px}.card.large{--card-max-width:720px;--image-size:142px;--message-max-lines:3}.card.extra-large{--card-max-width:1130px;--image-size:186px;--message-max-lines:5}a{text-decoration:none !important;color:var(--ic-architectural-black) !important}button{border:none;background-color:transparent;outline:var(--ic-hc-focus-outline);padding:0}.card,.card.clickable{display:flex;flex-direction:row;border:var(--ic-border-default);border-radius:var(--ic-border-radius);box-sizing:border-box;text-align:left;color:var(--ic-architectural-black);transition:var(--ic-easing-transition-fast);position:relative;max-width:var(--card-max-width);height:-moz-fit-content;height:fit-content;width:var(--card-horizontal-width, -moz-fit-content);width:var(--card-horizontal-width, fit-content)}.dark.card,.dark.card.clickable{border:var(--ic-border-width) solid var(--ic-architectural-700)}.card.clickable:hover{background-color:var(--ic-action-default-bg-hover);border:var(--ic-border-hover);cursor:pointer}.card.clickable:focus,.card.clickable.focussed{background-color:var(--ic-action-default-bg-hover);box-shadow:var(--ic-border-focus);outline:var(--ic-hc-focus-outline);border:var(--ic-border-pressed)}.card.clickable:active{background-color:var(--ic-action-default-bg-active);box-shadow:var(--ic-border-focus)}.card.disabled{border:var(--ic-border-disabled)}.card-header{display:flex;align-items:center}.icon{display:flex;align-items:center;padding-right:var(--ic-space-xs)}.card.disabled ::slotted(svg){fill:var(--ic-color-tertiary-text)}.card.clickable .card-title{color:var(--ic-hyperlink);text-decoration:underline;text-decoration-thickness:var(--ic-space-1px)}.card.clickable:hover .card-title,.card.clickable:focus .card-title,.card.clickable.focussed .card-title{display:inline-block;border-bottom:0.25rem solid !important;margin-bottom:-0.25rem !important;text-decoration:none}.card.clickable:active .card-title{text-decoration:none}.card.disabled .card-title{text-decoration:underline;text-decoration-thickness:var(--ic-space-1px);text-decoration-color:var(--ic-color-tertiary-text);color:var(--ic-color-tertiary-text)}.card-message{margin-top:var(--ic-space-xxxs);align-items:left}.card.disabled .card-message{color:var(--ic-color-tertiary-text)}.image{display:flex;height:var(--image-size);width:var(--image-size);border-radius:var(--ic-border-radius)}.card-content{display:flex;flex-direction:column;padding:var(--ic-space-md)}.card .card-title ::slotted([slot="heading"]),.card .card-title ic-typography p{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:calc(var(--card-max-width) - var(--ic-space-xl))}.card.with-icon .card-title ::slotted([slot="heading"]),.card.with-icon .card-title ic-typography p{max-width:calc(var(--card-max-width) - (2 * var(--ic-space-xl)))}.card.with-image .card-title ::slotted([slot="heading"]),.card.with-image .card-title ic-typography p{max-width:calc(\n var(--card-max-width) - var(--image-size) - var(--ic-space-xl)\n )}.card.with-image.with-icon .card-title ::slotted([slot="heading"]),.card.with-image.with-icon .card-title ic-typography p{max-width:calc(\n var(--card-max-width) - var(--image-size) - (2 * var(--ic-space-xl))\n )}.card .card-message ::slotted([slot="message"]),.card .card-message ic-typography{display:-webkit-box;-webkit-box-orient:vertical;line-clamp:var(--message-max-lines, initial);-webkit-line-clamp:var(--message-max-lines, initial);overflow:hidden}@media (forced-colors: active){.card ::slotted(svg){fill:currentcolor}.card.disabled ::slotted(svg){fill:GrayText !important}.card.disabled{border-color:GrayText !important}.card.disabled .card-message,.card.disabled .card-title{color:GrayText}}';const h=class{constructor(i){e(this,i);this.hostMutationObserver=null;this.hostMutationCallback=e=>{if(e.some((({type:e,addedNodes:t,removedNodes:i})=>e==="childList"?r(t,i,"image"):false))){t(this)}};this.parentFocussed=()=>{this.isFocussed=true};this.parentBlurred=()=>{this.isFocussed=false};this.appearance="default";this.isFocussed=false;this.parentEl=null;this.parentIsAnchorTag=false;this.clickable=false;this.disabled=false;this.heading=undefined;this.href=undefined;this.hreflang="";this.message="";this.referrerpolicy=undefined;this.rel=undefined;this.size="medium";this.target=undefined}disconnectedCallback(){var e;if(this.parentIsAnchorTag){this.parentEl.removeEventListener("focus",this.parentFocussed);this.parentEl.removeEventListener("blur",this.parentBlurred)}(e=this.hostMutationObserver)===null||e===void 0?void 0:e.disconnect()}componentWillLoad(){this.parentEl=this.el.parentElement;if(this.parentEl.tagName==="A"){this.clickable=true;this.parentIsAnchorTag=true;this.parentEl.classList.add("ic-card-wrapper-link");this.parentEl.addEventListener("focus",this.parentFocussed);this.parentEl.addEventListener("blur",this.parentBlurred)}o(this.disabled,this.el)}componentDidLoad(){!s(this.el,"heading")&&c([{prop:this.heading,propName:"heading"}],"Card");this.updateTheme();this.hostMutationObserver=new MutationObserver(this.hostMutationCallback);this.hostMutationObserver.observe(this.el,{childList:true})}handleHostClick(e){if(this.disabled){e.stopImmediatePropagation()}}themeChangeHandler(e){const t=e.detail;this.updateTheme(t.mode)}async setFocus(){if(this.el.shadowRoot.querySelector("a")){this.el.shadowRoot.querySelector("a").focus()}else if(this.el.shadowRoot.querySelector("button")){this.el.shadowRoot.querySelector("button").focus()}}updateTheme(e=null){const t=d(this.el,e||null);if(t!==n.Default){this.appearance=t}}render(){const{clickable:e,disabled:t,heading:a,message:r,href:o,hreflang:c,referrerpolicy:d,rel:l,target:h,parentIsAnchorTag:b,isFocussed:m,size:p}=this;const u=b?"div":e?this.href===undefined?"button":"a":"div";const g=u=="a"&&{href:o,hrefLang:c,referrerPolicy:d,rel:l,target:h};return i(u,Object.assign({class:{["card"]:true,["clickable"]:e&&!t,["disabled"]:t,["focussed"]:m,["dark"]:this.appearance===n.Dark,[`${p}`]:true,["with-icon"]:s(this.el,"icon"),["with-image"]:s(this.el,"image")},tabindex:e&&!b?0:null,"aria-disabled":t?"true":null,disabled:t?true:null},g),s(this.el,"image")&&i("div",{class:{["image"]:true}},i("slot",{name:"image"})),i("div",{class:"card-content"},i("div",{class:"card-header"},s(this.el,"icon")&&i("div",{class:"icon"},i("slot",{name:"icon"})),i("div",{class:"card-title"},i("slot",{name:"heading"},i("ic-typography",{variant:"h4"},i("p",null,a))))),(r||s(this.el,"message"))&&i("div",{class:{["card-message"]:true}},r&&i("ic-typography",{variant:"body"},r),s(this.el,"message")&&i("slot",{name:"message"}))),s(this.el,"badge")&&i("slot",{name:"badge"}))}get el(){return a(this)}};h.style=l;export{h as ic_card_horizontal};
2
+ //# sourceMappingURL=p-9b34989b.entry.js.map
@@ -0,0 +1,2 @@
1
+ import{r as t,c as i,h as s,H as e,g as h}from"./p-8455d1bb.js";import{a,s as n,v as r,n as o,t as l,o as c,B as d,z as u,u as f,I as p,e as b,f as m}from"./p-297e99cf.js";import{b as v,i as w,j as g,s as y,h as k,k as x}from"./p-33dd24eb.js";const $=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M15.8327 5.34199L14.6577 4.16699L9.99935 8.82533L5.34102 4.16699L4.16602 5.34199L8.82435 10.0003L4.16602 14.6587L5.34102 15.8337L9.99935 11.1753L14.6577 15.8337L15.8327 14.6587L11.1743 10.0003L15.8327 5.34199Z" fill="currentColor"/>\n</svg>\n`;const D=`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">\n <path d="M16.6667 2.50004H15.8334V0.833374H14.1667V2.50004H5.83342V0.833374H4.16675V2.50004H3.33341C2.41675 2.50004 1.66675 3.25004 1.66675 4.16671V17.5C1.66675 18.4167 2.41675 19.1667 3.33341 19.1667H16.6667C17.5834 19.1667 18.3334 18.4167 18.3334 17.5V4.16671C18.3334 3.25004 17.5834 2.50004 16.6667 2.50004ZM16.6667 17.5H3.33341V6.66671H16.6667V17.5Z" fill="currentColor"/>\n</svg>`;const Y='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}input{border:0;height:100%;padding:0;outline:none;background:none;-moz-appearance:textfield;-webkit-appearance:textfield;appearance:textfield}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none}ic-input-component-container{cursor:text}ic-input-component-container,ic-input-component-container:hover{color:var(--ic-color-tertiary-text)}ic-input-component-container .focus-indicator{padding:var(--ic-space-xxxs) var(--ic-space-xs);align-items:center}.day-input{width:1.438rem}.month-input{width:1.813rem}.year-input,.year-input.fit-to-value{width:2.313rem}.fit-to-value{width:1.25rem}.sr-only{position:absolute;left:-9999px}.input-container{width:100%;display:flex;justify-content:space-between;align-items:center;position:relative}.action-buttons{display:flex;align-items:center}.show-calendar-button-wrapper{display:flex;justify-content:center;align-items:center}.clear-button,.calendar-button{border-radius:var(--ic-border-radius);transition:box-shadow var(--ic-easing-transition),\n border-radius var(--ic-easing-transition);margin:0}.clear-button.hidden{display:none}.clear-button:focus,.calendar-button:focus,.clear-button:active,.calendar-button:active{background-color:var(--ic-focus-blue) !important;box-shadow:inset 0 0 0 0.125rem var(--ic-focus-glow) !important;border-radius:0.25rem}.clear-button:focus,.calendar-button:focus,.clear-button:active *,.calendar-button:active *{fill:var(--ic-architectural-white)}.divider{margin:0 var(--ic-space-xxs);width:var(--ic-space-1px);background-color:var(--ic-architectural-400);border-radius:var(--ic-space-1px)}.divider.small{height:var(--ic-space-md)}.divider.default{height:calc(var(--ic-space-sm) + var(--ic-space-xs))}.divider.large{height:var(--ic-space-lg)}';let z=0;const M=class{constructor(e){t(this,e);this.calendarButtonClicked=i(this,"calendarButtonClicked",7);this.icBlur=i(this,"icBlur",7);this.icChange=i(this,"icChange",7);this.icFocus=i(this,"icFocus",7);this.ARIA_INVALID="aria-invalid";this.ARIA_LABEL="aria-label";this.ARIA_LABELLED_BY="aria-labelledby";this.EVENT_OBJECT_STRING="[object Event]";this.FIT_TO_VALUE="fit-to-value";this.initialValue=this.value;this.INPUT_EVENT_OBJECT_STRING="[object InputEvent]";this.inputsInOrder=[];this.isAfterMax=false;this.isBeforeMin=false;this.isDateSetFromKeyboardEvent=false;this.isDisabledDate=false;this.isValidDay=true;this.isValidMonth=true;this.isValidDate=true;this.isZuluTime=false;this.KEYBOARD_EVENT_OBJECT_STRING="[object KeyboardEvent]";this.MAX_DAY=31;this.MAX_MONTH=12;this.previousEmittedDate=undefined;this.previousSelectedDate=null;this.selectedDate=null;this.setInputPasteValue=(t,i)=>{const s=t;s.value=i;s.classList.add(this.FIT_TO_VALUE)};this.checkSingleCopiedValueIsValid=(t,i)=>{let s=false;const e=Number(i);switch(t){case this.dayInputEl:s=e>=1&&e<=this.MAX_DAY;break;case this.monthInputEl:s=e>=1&&e<=this.MAX_MONTH;break;case this.yearInputEl:s=true;break;default:s=false;break}return s};this.isKeyboardOrEvent=t=>Object.prototype.toString.call(t)===this.EVENT_OBJECT_STRING||Object.prototype.toString.call(t)===this.KEYBOARD_EVENT_OBJECT_STRING;this.setDateValidity=()=>{if(!a(this.day)){this.isValidDay=+this.day>this.MAX_DAY?false:true}else{this.isValidDay=true}if(!a(this.month)){this.isValidMonth=+this.month>this.MAX_MONTH?false:true}else{this.isValidMonth=true}};this.handleInput=t=>{const i=t;const s=t.target;if(s!==this.yearInputEl){if(i.inputType!=="deleteContentBackward"&&!this.preventAutoFormatting){if(s.value.length===1&&(s===this.dayInputEl&&+s.value>=4||s===this.monthInputEl&&+s.value>=2)&&+s.value<=9){this.setInputValue(s);this.notifyScreenReader(s,t);this.moveToNextInput(s)}if(s.value.length===2){if(+s.value===0){s.value="01"}this.setInputValue(s);this.setPreventInput(s,true);this.notifyScreenReader(s,t);this.moveToNextInput(s)}else{this.setPreventInput(s,false)}}else if(this.preventAutoFormatting){if(s.value.length===2&&!this.isKeyboardOrEvent(t)){this.setInputValue(s);this.setPreventInput(s,true);this.moveToNextInput(s)}else{this.setInputValue(s)}}if(s.value.length!==2){this.setPreventInput(s,false)}}else{if(s.value.length===4){this.setInputValue(s);if(Object.prototype.toString.call(t)!==this.EVENT_OBJECT_STRING){this.moveToNextInput(s)}this.setPreventInput(s,true)}else{this.setInputValue(s,true);this.setPreventInput(s,false)}}this.setFitToValueStyling(s);if(s.value.length===0){this.setInputValue(s,true);this.setValidationMessage()}this.notifyScreenReader(s,t)};this.handleKeyDown=(t,i)=>{const s=t.target;const e=t.key.toLowerCase();const h=/-?\d*\.?\d+(e[-+]?\d+)?|[/-]|arrowup|arrowdown|arrowleft|arrowright|shift|tab|backspace|delete/;if(!h.test(e)&&!((t.ctrlKey||t.metaKey)&&(e==="v"||e==="c"))){t.preventDefault()}switch(e){case"/":case"-":case".":t.preventDefault();this.setPasteInvalidText();this.moveToNextInput(s);break;case"arrowright":case"arrowleft":t.preventDefault();this.handleLeftRightArrowKeyPress(s,e);break;case"arrowup":case"arrowdown":this.preventAutoFormatting=true;this.handleUpDownArrowKeyPress(s,t);break}this.preventInput(t,i);this.isDateSetFromKeyboardEvent=true};this.handleFocus=t=>{const i=t.target;i.select()};this.handleBlur=t=>{const i=t.target;this.setPasteInvalidText();this.autocompleteInput(i)};this.handleLeftRightArrowKeyPress=(t,i)=>{if(i==="arrowright"){this.moveToNextInput(t)}else{this.moveToPreviousInput(t)}this.setPasteInvalidText()};this.notifyScreenReaderSelectedDate=()=>{const t=n(b);const i=n(m);this.selectedDateInfoEl.textContent=`Selected date: ${t[this.selectedDate.getDay()]}, ${this.selectedDate.getDate()} ${i[this.selectedDate.getMonth()]} ${this.selectedDate.getFullYear()}`};this.handleUpDownArrowKeyPress=(t,i)=>{const s=t===this.yearInputEl?0:1;let e;switch(t){case this.dayInputEl:e=this.MAX_DAY;break;case this.monthInputEl:e=this.MAX_MONTH;break;case this.yearInputEl:e=9999}if(t===null||t===void 0?void 0:t.value){if(i.key==="ArrowUp"){if(+t.value===e){i.preventDefault();t.value=`0${s}`}else{t.value=+t.value+1<10?`0${+t.value+1}`:(+t.value+1).toString()}this.notifyScreenReader(t,i)}if(i.key==="ArrowDown"){if(+t.value===s){i.preventDefault();t.value=e.toString()}else{t.value=+t.value-1<10?`0${+t.value-1}`:(+t.value-1).toString()}this.notifyScreenReader(t,i)}}else{if(i.key==="ArrowDown"){i.preventDefault();if(t===this.yearInputEl){t.value=(new Date).getFullYear().toString()}else{t.value=e.toString()}this.notifyScreenReader(t,i)}else if(i.key==="ArrowUp"){i.preventDefault();if(t===this.yearInputEl){t.value=(new Date).getFullYear().toString()}else{t.value=`0${s}`}this.notifyScreenReader(t,i)}}this.setInputValue(t);this.setFitToValueStyling(t)};this.handleDateChange=t=>{if(t||!v(this.selectedDate,this.previousSelectedDate)){if(this.value){this.inputsInOrder.forEach((t=>{t.classList.add(this.FIT_TO_VALUE)}))}if(this.day&&this.month&&this.year&&this.invalidDateText===""){this.setValueAndEmitChange(this.selectedDate);this.notifyScreenReaderSelectedDate()}else if(!(this.selectedDate===null&&this.previousSelectedDate===null)){this.setValueAndEmitChange(null);this.selectedDateInfoEl.textContent=""}this.previousSelectedDate=this.selectedDate;if(!this.isDateSetFromKeyboardEvent){this.updateInputValues(this.day,this.month,this.year)}}};this.slicePastedDate=(t,i)=>i.length>t?i.slice(0,t):i;this.isPastedStringDateValid=t=>{if(/\d+-\d+-\d+$/.test(t)||/\d+\/\d+\/\d+/.test(t)||/\d+\.\d+\.\d+/.test(t)){return true}if(/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}(?::[0-9]{2}(?:\.\d+)?)?Z/.test(t)){this.isZuluTime=true;return true}return false};this.handlePaste=t=>{t.preventDefault();const i=t.clipboardData.getData("Text");const s=this.isPastedStringDateValid(i);this.setPastedValueAndValidation(s,i,t)};this.setDate=t=>{if(t===null||t===""||t===undefined){this.day=null;this.month=null;this.year=null;this.inputsInOrder.forEach((t=>{t.classList.remove(this.FIT_TO_VALUE);this.setPreventInput(t,false)}));this.handleDateChange(true)}else{if(w(t)){let i;if(typeof t==="string"){i=new Date(+t)}else{i=t}this.day=g(i.getDate());this.month=g(i.getMonth()+1);this.year=i.getFullYear().toString()}else if(typeof t==="string"){const i=y(t,this.dateFormat);this.year=i[0];this.month=i[1];this.day=i[2]}}this.setValidationMessage()};this.formatMinMax=t=>{let i;const s=g(t.getDate());const e=g(t.getMonth()+1);const h=t.getFullYear();switch(this.dateFormat){case"DD/MM/YYYY":i=`${s}/${e}/${h}`;break;case"MM/DD/YYYY":i=`${e}/${s}/${h}`;break;case"YYYY/MM/DD":i=`${h}/${e}/${s}`;break}return i};this.updateInputValues=(t,i,s)=>{this.dayInputEl.value=t;this.monthInputEl.value=i;this.yearInputEl.value=s};this.setInputValue=(t,i=false)=>{const s=i?"":t.value;switch(t){case this.dayInputEl:this.day=s;break;case this.monthInputEl:this.month=s;break;case this.yearInputEl:if(this.year!==s){this.year=s}}this.setValidationMessage()};this.setValidationMessage=()=>{this.setDateValidity();if(!a(this.day)&&!a(this.month)&&!a(this.year)){this.selectedDate=this.convertToDate(this.year,this.month,this.day);this.isValidDate=+this.selectedDate!==0&&this.selectedDate.getDate()==+this.day;this.isDisabledDate=this.isSelectedDateDisabled();if(!this.isValidDate||this.isDisabledDate){this.inputsInOrder.forEach((t=>t.setAttribute(this.ARIA_INVALID,"true")))}else{this.inputsInOrder.forEach((t=>t.removeAttribute(this.ARIA_INVALID)))}}else{this.selectedDate=null}if(!(this.isValidDay&&this.isValidMonth&&this.isValidDate)){this.invalidDateText=this.invalidDateMessage}else if(this.isDisabledDate&&this.selectedDate!==null){if(this.isBeforeMin){if(this.disablePast){this.invalidDateText=this.disablePastMessage}else{this.invalidDateText=`Please enter a date after ${this.formatMinMax(this.minDate)}.`}}else if(this.isAfterMax){if(this.disableFuture){this.invalidDateText=this.disableFutureMessage}else{this.invalidDateText=`Please enter a date before ${this.formatMinMax(this.maxDate)}.`}}else if(this.disableDays.length!==0){this.invalidDateText=this.disableDaysMessage}else{if(this.disablePast){this.invalidDateText=this.disablePastMessage}if(this.disableFuture){this.invalidDateText=this.disableFutureMessage}}}else{this.invalidDateText=""}};this.setInputsInOrder=()=>{const t=this.el.shadowRoot.querySelectorAll("input");t.forEach((t=>this.inputsInOrder.push(t)))};this.setAriaLabelledBy=()=>{var t;if(this.disabled&&!a((t=this.inputCompContainerEl)===null||t===void 0?void 0:t.getAttribute(this.ARIA_LABELLED_BY))){this.removeAriaLabelledBy();return}if(this.disabled){return}const i=this.el.shadowRoot.querySelector("label");const s=`${this.inputId}-label`;if(i!==null&&i!==undefined){i.id=s;const t=!a(this.validationStatus)&&!a(this.validationText)||!a(this.invalidDateText);const e=`${s} ${this.screenReaderInfoId} ${r(this.inputId,this.helperText!==""&&this.helperText!==this.defaultHelperText,t)} ${this.selectedDate?this.selectedDateInfoId:""} ${this.assistiveHintId}`;this.inputCompContainerEl.setAttribute(this.ARIA_LABELLED_BY,e)}};this.setPreventInput=(t,i)=>{switch(t){case this.dayInputEl:this.preventDayInput=i;break;case this.monthInputEl:this.preventMonthInput=i;break;case this.yearInputEl:this.preventYearInput=i}};this.getInputFromDatePart=t=>{const i=s("input",{class:"day-input",id:"day-input",ref:t=>this.dayInputEl=t,"aria-label":"day",placeholder:"DD",disabled:this.disabled,onPaste:this.handlePaste,inputmode:"number",pattern:"[0-9]*",onKeyDown:t=>this.handleKeyDown(t,this.preventDayInput)});const e=s("input",{id:"month-input",class:"month-input",ref:t=>this.monthInputEl=t,"aria-label":"month",placeholder:"MM",disabled:this.disabled,onPaste:this.handlePaste,inputmode:"number",pattern:"[0-9]*",onKeyDown:t=>this.handleKeyDown(t,this.preventMonthInput)});const h=s("input",{id:"year-input",class:"year-input",ref:t=>this.yearInputEl=t,"aria-label":"year",placeholder:"YYYY",maxLength:4,disabled:this.disabled,onPaste:this.handlePaste,inputmode:"number",pattern:"[0-9]*",onKeyDown:t=>this.handleKeyDown(t,this.preventYearInput)});let a;switch(t){case"D":a=i;break;case"M":a=e;break;case"Y":a=h}return a};this.getInputsInOrder=()=>{const t=this.dateFormat.split("/");const i=[];t.forEach((t=>{i.push(this.getInputFromDatePart(t.substring(0,1)))}));return i};this.getDescOfInputsOrder=()=>{let t;switch(this.dateFormat){case"DD/MM/YYYY":t="day, month, and year";break;case"MM/DD/YYYY":t="month, day, and year";break;case"YYYY/MM/DD":t="year, month, and day"}return t};this.getScreenReaderInfo=t=>{let i="";if(this.required){i+="required"}if(t===u.Error){i+=" invalid data"}return i===""?"":i+", "};this.preventInput=(t,i)=>{const s=t.key;const e=t.target;let h;if(e){h=e.value.substring(e.selectionStart,e.selectionEnd)}if(s==="e"||s==="."||s==="-"||t.key>="0"&&t.key<="9"&&i&&!h){t.preventDefault()}};this.isSelectedDateDisabled=()=>{const t=new Date;this.isAfterMax=false;this.isBeforeMin=false;let i=false;const s=this.selectedDate.toDateString()!==t.toDateString();if(this.minDate&&this.selectedDate<this.minDate&&s){this.isBeforeMin=true;i=true}if(this.maxDate&&this.selectedDate>this.maxDate&&s){this.isAfterMax=true;i=true}if(this.disableDays.includes(this.selectedDate.getDay())){i=true}if((this.disablePast&&this.selectedDate<t||this.disableFuture&&this.selectedDate>t)&&s){i=true}return i};this.moveToNextInput=t=>{const i=this.inputsInOrder.findIndex((i=>i===t));const s=this.inputsInOrder[i+1];this.preventAutoFormatting=false;if(s){s.focus()}};this.moveToPreviousInput=t=>{const i=this.inputsInOrder.findIndex((i=>i===t));this.preventAutoFormatting=false;if(this.inputsInOrder[i-1]){this.inputsInOrder[i-1].focus()}};this.autocompleteInput=t=>{if(t===this.yearInputEl){this.autocompleteYear()}else{const i=t.value;if(i.length===1){if(+i===0){t.value="01"}else{t.value=`0${i}`}}}if(t.value){this.setInputValue(t)}};this.autocompleteYear=()=>{const t=this.yearInputEl.value;const i=["2","0","0"];let s="";if(t){i.forEach(((i,e)=>{if(t.length+e<=3){s+=i}}));this.yearInputEl.value=`${s}${t}`}};this.convertToDate=(t,i,s)=>{if(!a(t)&&!a(i)&&!a(s)){return new Date(+t,+i-1,+s)}else{return null}};this.handleHostBlur=()=>{this.removeLabelledBy=false;this.icBlur.emit({value:this.selectedDate})};this.handleHostFocus=()=>{var t;if((t=this.el.shadowRoot.activeElement)===null||t===void 0?void 0:t.id.match(/(day|month|year)-input$/)){this.removeLabelledBy=false}else{this.removeLabelledBy=true}this.icFocus.emit({value:this.selectedDate})};this.handleFormReset=()=>{this.setDate(this.initialValue);this.setValidationMessage();this.handleDateChange(false)};this.getAriaLabel=t=>t.getAttribute(this.ARIA_LABEL);this.notifyScreenReaderArrowKeys=t=>{const i=this.el.shadowRoot.querySelector("#live-region");let s="";const e=this.getAriaLabel(t);if(i&&t.value){if(t===this.monthInputEl&&!!m[+t.value-1]){s=`${t.value} - ${m[+t.value-1]}, ${e}`}if(t===this.dayInputEl||t===this.yearInputEl){s=`${t.value}, ${e}`}i.textContent=s}};this.notifyScreenReaderInput=(t,i)=>{let s="";const e=this.getAriaLabel(t);if(t===this.dayInputEl||t===this.monthInputEl){if(t.value.length===2){if(t===this.monthInputEl&&!!m[+t.value-1]&&this.isValidMonth){s=`${t.value} - ${m[+t.value-1]}, ${e}`}if(t===this.dayInputEl&&this.isValidDay){s=`${t.value}, ${e}`}}else{s=""}}else{if(t.value.length===4){s=`${t.value}, ${e}`}else{s=""}}i.textContent=s};this.setFitToValueStyling=t=>{if(t.value){t.classList.add(this.FIT_TO_VALUE)}else{t.classList.remove(this.FIT_TO_VALUE)}};this.setAriaInvalid=(t,i,s,e)=>{if(this.inputsInOrder.length){this.inputsInOrder.forEach((t=>{t.removeAttribute(this.ARIA_INVALID)}));if(!t){this.dayInputEl.setAttribute(this.ARIA_INVALID,"true")}if(!i){this.monthInputEl.setAttribute(this.ARIA_INVALID,"true")}if(!s||e){this.inputsInOrder.forEach((t=>{t.setAttribute(this.ARIA_INVALID,"true")}))}}};this.handleClear=()=>{this.inputsInOrder.forEach((t=>{t.classList.remove(this.FIT_TO_VALUE);this.setInputValue(t,true);this.setPreventInput(t,false)}));this.isDateSetFromKeyboardEvent=false;this.setValidationMessage();this.handleDateChange(true);this.inputsInOrder[0].focus()};this.handleCalendarOpen=t=>{var i,s;t.stopImmediatePropagation();(i=this.calendarButtonEl)===null||i===void 0?void 0:i.shadowRoot.querySelector("ic-tooltip").displayTooltip(false);this.calendarButtonClicked.emit({value:this.selectedDate});(s=this.calendarButtonEl)===null||s===void 0?void 0:s.shadowRoot.querySelector("ic-tooltip").displayTooltip(false);this.isDateSetFromKeyboardEvent=false};this.setValueAndEmitChange=t=>{if(!v(new Date(this.value),t)){this.emitIcChange(t);this.value=t}};this.handleCalendarFocus=()=>{this.calendarFocused=true};this.handleCalendarBlur=()=>{this.calendarFocused=false};this.handleClearFocus=()=>{this.removeLabelledBy=true;this.clearButtonFocused=true};this.handleClearBlur=t=>{var i;this.clearButtonFocused=false;if((i=t.relatedTarget)===null||i===void 0?void 0:i.id.match(/(day|year)-input$/)){this.removeLabelledBy=false;return}this.removeLabelledBy=true};this.emitIcChange=t=>{if(!(t===null&&this.previousEmittedDate===null)&&!v(t,this.previousEmittedDate)){this.previousEmittedDate=t;this.icChange.emit({value:t})}};this.day="";this.invalidDateText=undefined;this.maxDate=undefined;this.minDate=undefined;this.month="";this.year="";this.calendarFocused=false;this.clearButtonFocused=false;this.removeLabelledBy=false;this.dateFormat="DD/MM/YYYY";this.disabled=false;this.disableDays=[];this.disableDaysMessage="The date you have selected is on a day of the week that is not allowed. Please select another date.";this.disableFuture=false;this.disableFutureMessage="Dates in the future are not allowed. Please select a date in the past.";this.disablePast=false;this.disablePastMessage="Dates in the past are not allowed. Please select a date in the future.";this.helperText=undefined;this.hideHelperText=false;this.inputId=`ic-date-input-${z++}`;this.invalidDateMessage="Please enter a valid date.";this.label=undefined;this.max="";this.min="";this.name=this.inputId;this.required=false;this.showCalendarButton=false;this.showClearButton=true;this.size="default";this.value="";this.validationStatus="";this.validationText=""}watchDisableFutureHandler(){this.watchMaxHandler()}watchDisablePastHandler(){this.watchMinHandler()}watchMaxHandler(){if(this.disableFuture){this.maxDate=new Date}else{this.maxDate=k(this.max,this.dateFormat)}}watchMinHandler(){if(this.disablePast){this.minDate=new Date}else{this.minDate=k(this.min,this.dateFormat)}}watchRequiredHandler(){const t=this.el.shadowRoot.querySelector("label");if(this.required){const i=document.createElement("span");i.setAttribute("id","asterisk-span");i.setAttribute("aria-hidden","true");i.textContent=" *";t===null||t===void 0?void 0:t.appendChild(i)}else{const t=this.el.shadowRoot.querySelector("#asterisk-span");if(t){t.remove()}}}disconnectedCallback(){o(this.el,this.handleFormReset)}componentWillLoad(){this.defaultHelperText=`Use format ${this.dateFormat}`;if(a(this.helperText))this.helperText=this.defaultHelperText;this.watchMinHandler();this.watchMaxHandler();if(this.value){this.setDate(this.value);this.previousEmittedDate=this.selectedDate}else{this.previousEmittedDate=null}this.screenReaderInfoId=`${this.inputId}-screen-reader-info`;this.assistiveHintId=`${this.inputId}-assistive-hint`;this.selectedDateInfoId=`${this.inputId}-selected-date-info`;l(this.el,this.handleFormReset)}componentDidLoad(){this.setInputsInOrder();c([{prop:this.label,propName:"label"}],"Date Input");if(this.value){this.updateInputValues(this.day,this.month,this.year);this.inputsInOrder.forEach((t=>{t.classList.add(this.FIT_TO_VALUE)}))}this.setAriaInvalid(this.isValidDay,this.isValidMonth,this.isValidDate,this.isDisabledDate);if(this.value){this.notifyScreenReaderSelectedDate()}this.inputsInOrder.forEach((t=>{t.addEventListener("input",this.handleInput);t.addEventListener("focus",this.handleFocus);t.addEventListener("blur",this.handleBlur)}));this.watchRequiredHandler()}componentWillUpdate(){if(a(this.helperText))this.helperText=this.defaultHelperText;if(!this.isDateSetFromKeyboardEvent)this.setDate(this.value);this.setAriaInvalid(this.isValidDay,this.isValidMonth,this.isValidDate,this.isDisabledDate);this.handleDateChange(false);this.isDateSetFromKeyboardEvent=false}componentDidRender(){if(this.removeLabelledBy){this.removeAriaLabelledBy();return}this.setAriaLabelledBy()}async getDate(){return this.selectedDate}async setCalendarFocus(){if(this.calendarButtonEl){this.calendarButtonEl.focus()}}async setDisableDays(t){this.disableDays=t}async triggerIcChange(t){this.emitIcChange(t)}removeAriaLabelledBy(){this.inputCompContainerEl.removeAttribute(this.ARIA_LABELLED_BY)}setPastedValueAndValidation(t,i,s){switch(true){case t:{const t=this.isZuluTime?x(i):i;const s=t.split(/-|\/|\./);this.inputsInOrder.forEach(((t,i)=>{t.classList.add(this.FIT_TO_VALUE);if(this.isZuluTime){this.pasteZuluDateTime(s,i)}else{let e;if(t===this.dayInputEl||t===this.monthInputEl){e=this.slicePastedDate(2,s[i])}else{e=this.slicePastedDate(4,s[i])}t.value=e;this.setInputValue(t);this.autocompleteInput(t)}}));this.isZuluTime=false;break}case(i.length===1||i.length===2||i.length===4)&&d(i):if(this.checkSingleCopiedValueIsValid(s.target,i)){this.setInputPasteValue(s.target,i);this.setInputValue(s.target)}else{this.displayPastedValidation(s)}break;case i.length===3&&d(i):if(s.target!==this.yearInputEl){this.displayPastedValidation(s)}else{this.setInputPasteValue(s.target,i);this.setInputValue(s.target)}break;case i.length>=5&&d(i):this.displayPastedValidation(s)}}pasteZuluDateTime(t,i){if(i===0){const s=this.slicePastedDate(4,t[i]);this.yearInputEl.value=s;this.setInputValue(this.yearInputEl)}else if(i===1){const s=this.slicePastedDate(2,t[i]);this.monthInputEl.value=s;this.setInputValue(this.monthInputEl)}else{const s=this.slicePastedDate(2,t[i]);this.dayInputEl.value=s;this.setInputValue(this.dayInputEl)}}displayPastedValidation(t){var i;if(((i=this.invalidDateText)===null||i===void 0?void 0:i.length)>0){this.previousInvalidDateTest=this.invalidDateText}this.invalidDateText=`Please paste a valid ${this.getAriaLabel(t.target)}`;this.validationStatus=u.Error;this.isPasteValidationDisplayed=true}setPasteInvalidText(){var t;if(this.isPasteValidationDisplayed){this.invalidDateText=(t=this.previousInvalidDateTest)!==null&&t!==void 0?t:"";this.isPasteValidationDisplayed=false;this.isDateSetFromKeyboardEvent=true}}notifyScreenReader(t,i){const s=this.el.shadowRoot.querySelector("#live-region");if(s){if(this.isKeyboardOrEvent(i)){this.notifyScreenReaderArrowKeys(t)}else if(Object.prototype.toString.call(i)===this.INPUT_EVENT_OBJECT_STRING){this.notifyScreenReaderInput(t,s)}}}render(){const{inputId:t,label:i,disabled:h,helperText:n,hideHelperText:r,showClearButton:o,showCalendarButton:l,size:c}=this;const d=!a(this.validationStatus)&&!a(this.validationText);const b=d?this.validationStatus:!a(this.invalidDateText)?u.Error:"";const m=`Type or use the up and down arrow keys to change the values for the ${this.getDescOfInputsOrder()}.`;f(true,this.el,this.name,this.convertToDate(this.year,this.month,this.day),this.disabled);return s(e,{onBlur:this.handleHostBlur,onFocus:this.handleHostFocus},s("ic-input-container",{disabled:h},s("ic-input-label",{for:t,label:i,helperText:!r?n:null,disabled:h}),s("span",{id:this.screenReaderInfoId,class:"sr-only","aria-hidden":"true"},this.getScreenReaderInfo(b),r&&`${n}\n`,`${this.defaultHelperText}.`),s("span",{id:this.assistiveHintId,class:"sr-only","aria-hidden":"true"},m),s("span",{id:"live-region","aria-live":"assertive",class:"sr-only"}),s("ic-input-component-container",{id:t,ref:t=>this.inputCompContainerEl=t,disabled:h,validationStatus:b,size:c,role:"group"},s("div",{class:"input-container"},s("div",{class:"date-inputs"},this.getInputsInOrder()[0],"/",this.getInputsInOrder()[1],"/",this.getInputsInOrder()[2]),s("div",{class:"action-buttons"},o&&s("ic-button",{id:"clear-button","aria-label":"Clear input",class:{["clear-button"]:true,["hidden"]:a(this.day)&&a(this.month)&&a(this.year)},disabled:this.disabled,innerHTML:$,onClick:this.handleClear,onFocus:this.handleClearFocus,onBlur:this.handleClearBlur,variant:"icon",appearance:this.clearButtonFocused?p.Light:p.Dark,size:c}),l&&s("div",{class:"show-calendar-button-wrapper"},s("div",{class:{divider:true,[c]:true}}),s("ic-button",{id:"calendar-button",ref:t=>this.calendarButtonEl=t,"aria-label":"Display calendar","aria-haspopup":"dialog",class:"calendar-button",disabled:this.disabled,innerHTML:D,onClick:this.handleCalendarOpen,variant:"icon",size:c,onFocus:this.handleCalendarFocus,onBlur:this.handleCalendarBlur,appearance:this.calendarFocused?p.Light:p.Default}))))),s("span",{id:this.selectedDateInfoId,class:"sr-only","aria-live":"polite"},s("span",{ref:t=>this.selectedDateInfoEl=t,role:"status"})),(d||!a(this.invalidDateText))&&s("ic-input-validation",{status:b,message:d?this.validationText:this.invalidDateText,for:t})))}static get delegatesFocus(){return true}get el(){return h(this)}static get watchers(){return{disableFuture:["watchDisableFutureHandler"],disablePast:["watchDisablePastHandler"],max:["watchMaxHandler"],min:["watchMinHandler"],required:["watchRequiredHandler"]}}};M.style=Y;export{M as ic_date_input};
2
+ //# sourceMappingURL=p-bd1f8741.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["icDateInputCss","inputIds","DateInput","this","ARIA_INVALID","ARIA_LABEL","ARIA_LABELLED_BY","EVENT_OBJECT_STRING","FIT_TO_VALUE","initialValue","value","INPUT_EVENT_OBJECT_STRING","inputsInOrder","isAfterMax","isBeforeMin","isDateSetFromKeyboardEvent","isDisabledDate","isValidDay","isValidMonth","isValidDate","isZuluTime","KEYBOARD_EVENT_OBJECT_STRING","MAX_DAY","MAX_MONTH","previousEmittedDate","undefined","previousSelectedDate","selectedDate","setInputPasteValue","input","pastedValue","inputEl","classList","add","checkSingleCopiedValueIsValid","isValid","Number","dayInputEl","monthInputEl","yearInputEl","isKeyboardOrEvent","event","Object","prototype","toString","call","setDateValidity","isEmptyString","day","month","handleInput","inputEvent","target","inputType","preventAutoFormatting","length","setInputValue","notifyScreenReader","moveToNextInput","setPreventInput","setFitToValueStyling","setValidationMessage","handleKeyDown","isInputPrevented","eventKey","key","toLowerCase","regex","test","ctrlKey","metaKey","preventDefault","setPasteInvalidText","handleLeftRightArrowKeyPress","handleUpDownArrowKeyPress","preventInput","handleFocus","select","handleBlur","autocompleteInput","moveToPreviousInput","notifyScreenReaderSelectedDate","dayNames","stringEnumToArray","IcDayNames","months","IcDateInputMonths","selectedDateInfoEl","textContent","getDay","getDate","getMonth","getFullYear","minValue","maxValue","Date","handleDateChange","force","dateMatches","forEach","year","invalidDateText","setValueAndEmitChange","updateInputValues","slicePastedDate","valueLength","datePart","slice","isPastedStringDateValid","handlePaste","clipboardData","getData","setPastedValueAndValidation","setDate","date","remove","isDateOrEpoch","newDate","convertToDoubleDigits","defaultDateArray","splitStringDate","dateFormat","formatMinMax","formattedDate","clear","newValue","convertToDate","isSelectedDateDisabled","setAttribute","removeAttribute","invalidDateMessage","disablePast","disablePastMessage","minDate","disableFuture","disableFutureMessage","maxDate","disableDays","disableDaysMessage","setInputsInOrder","inputs","el","shadowRoot","querySelectorAll","push","setAriaLabelledBy","disabled","_a","inputCompContainerEl","getAttribute","removeAriaLabelledBy","labelEl","querySelector","labelId","inputId","id","hasValidation","validationStatus","validationText","labelledBy","screenReaderInfoId","getInputDescribedByText","helperText","defaultHelperText","selectedDateInfoId","assistiveHintId","isPrevented","preventDayInput","preventMonthInput","preventYearInput","getInputFromDatePart","dayInput","h","class","ref","placeholder","onPaste","inputmode","pattern","onKeyDown","monthInput","yearInput","maxLength","getInputsInOrder","dateParts","split","part","substring","getDescOfInputsOrder","description","getScreenReaderInfo","inputDescriptors","required","IcInformationStatus","Error","selectedString","selectionStart","selectionEnd","currentDate","isNotToday","toDateString","includes","currentInput","currentInputPos","findIndex","nextInput","focus","autocompleteYear","inputValue","yearNumbers","autocompletedInput","number","index","handleHostBlur","removeLabelledBy","icBlur","emit","handleHostFocus","activeElement","match","icFocus","handleFormReset","getAriaLabel","notifyScreenReaderArrowKeys","liveRegion","announcement","ariaLabel","notifyScreenReaderInput","setAriaInvalid","validDay","validMonth","validDate","disabledDate","handleClear","handleCalendarOpen","ev","stopImmediatePropagation","calendarButtonEl","displayTooltip","calendarButtonClicked","_b","emitIcChange","handleCalendarFocus","calendarFocused","handleCalendarBlur","handleClearFocus","clearButtonFocused","handleClearBlur","relatedTarget","d","icChange","watchDisableFutureHandler","watchMaxHandler","watchDisablePastHandler","watchMinHandler","createDate","max","min","watchRequiredHandler","asteriskSpan","document","createElement","appendChild","disconnectedCallback","removeFormResetListener","componentWillLoad","addFormResetListener","componentDidLoad","onComponentRequiredPropUndefined","prop","label","propName","addEventListener","componentWillUpdate","componentDidRender","setCalendarFocus","setDisableDays","days","triggerIcChange","nextParsedValue","extractDateFromZuluDateTime","pasteZuluDateTime","dateValue","isNumeric","displayPastedValidation","previousInvalidDateTest","isPasteValidationDisplayed","render","hideHelperText","showClearButton","showCalendarButton","size","hasCustomValidation","assistiveHint","renderHiddenInput","name","Host","onBlur","onFocus","for","role","innerHTML","Clear","onClick","variant","appearance","IcThemeForegroundEnum","Light","Dark","divider","Calendar","Default","status","message"],"sources":["src/components/ic-date-input/ic-date-input.css?tag=ic-date-input&encapsulation=shadow","src/components/ic-date-input/ic-date-input.tsx"],"sourcesContent":["@import \"../../../dist/core/normalize.css\";\n\ninput {\n border: 0;\n height: 100%;\n padding: 0;\n outline: none;\n background: none;\n -moz-appearance: textfield;\n appearance: textfield;\n}\n\ninput::-webkit-outer-spin-button,\ninput::-webkit-inner-spin-button {\n -webkit-appearance: none;\n}\n\nic-input-component-container {\n cursor: text;\n}\n\nic-input-component-container,\nic-input-component-container:hover {\n color: var(--ic-color-tertiary-text);\n}\n\nic-input-component-container .focus-indicator {\n padding: var(--ic-space-xxxs) var(--ic-space-xs);\n align-items: center;\n}\n\n.day-input {\n width: 1.438rem;\n}\n\n.month-input {\n width: 1.813rem;\n}\n\n.year-input,\n.year-input.fit-to-value {\n width: 2.313rem;\n}\n\n.fit-to-value {\n width: 1.25rem;\n}\n\n.sr-only {\n position: absolute;\n left: -9999px;\n}\n\n.input-container {\n width: 100%;\n display: flex;\n justify-content: space-between;\n align-items: center;\n position: relative;\n}\n\n.action-buttons {\n display: flex;\n align-items: center;\n}\n\n.show-calendar-button-wrapper {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.clear-button,\n.calendar-button {\n border-radius: var(--ic-border-radius);\n transition: box-shadow var(--ic-easing-transition),\n border-radius var(--ic-easing-transition);\n margin: 0;\n}\n\n.clear-button.hidden {\n display: none;\n}\n\n.clear-button:focus,\n.calendar-button:focus,\n.clear-button:active,\n.calendar-button:active {\n background-color: var(--ic-focus-blue) !important;\n box-shadow: inset 0 0 0 0.125rem var(--ic-focus-glow) !important;\n border-radius: 0.25rem;\n}\n\n.clear-button:focus,\n.calendar-button:focus,\n.clear-button:active *,\n.calendar-button:active * {\n fill: var(--ic-architectural-white);\n}\n\n.divider {\n margin: 0 var(--ic-space-xxs);\n width: var(--ic-space-1px);\n background-color: var(--ic-architectural-400);\n border-radius: var(--ic-space-1px);\n}\n\n.divider.small {\n height: var(--ic-space-md);\n}\n\n.divider.default {\n height: calc(var(--ic-space-sm) + var(--ic-space-xs));\n}\n\n.divider.large {\n height: var(--ic-space-lg);\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Prop,\n State,\n Host,\n Method,\n Watch,\n} from \"@stencil/core\";\nimport {\n IcInformationStatus,\n IcInformationStatusOrEmpty,\n IcSizes,\n IcThemeForegroundEnum,\n IcDateFormat,\n IcDateInputMonths,\n IcDayNames,\n IcWeekDays,\n} from \"../../utils/types\";\nimport {\n convertToDoubleDigits,\n createDate,\n dateMatches,\n extractDateFromZuluDateTime,\n isDateOrEpoch,\n splitStringDate,\n} from \"../../utils/date-helpers\";\nimport {\n addFormResetListener,\n getInputDescribedByText,\n isEmptyString,\n isNumeric,\n onComponentRequiredPropUndefined,\n removeFormResetListener,\n renderHiddenInput,\n stringEnumToArray,\n} from \"../../utils/helpers\";\nimport Clear from \"../../assets/clear-icon.svg\";\nimport Calendar from \"../../assets/calendar.svg\";\n\nlet inputIds = 0;\n\n@Component({\n tag: \"ic-date-input\",\n styleUrl: \"ic-date-input.css\",\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class DateInput {\n private ARIA_INVALID = \"aria-invalid\";\n private ARIA_LABEL = \"aria-label\";\n private ARIA_LABELLED_BY = \"aria-labelledby\";\n private assistiveHintId: string;\n private calendarButtonEl: HTMLIcButtonElement;\n private dayInputEl: HTMLInputElement;\n private defaultHelperText: string;\n private EVENT_OBJECT_STRING = \"[object Event]\";\n private FIT_TO_VALUE = \"fit-to-value\";\n\n private initialValue = this.value;\n private inputCompContainerEl: HTMLIcInputComponentContainerElement;\n private INPUT_EVENT_OBJECT_STRING = \"[object InputEvent]\";\n private inputsInOrder: HTMLInputElement[] = [];\n\n private isAfterMax: boolean = false;\n private isBeforeMin: boolean = false;\n private isDateSetFromKeyboardEvent: boolean = false;\n private isDisabledDate: boolean = false;\n private isPasteValidationDisplayed: boolean;\n private isValidDay: boolean = true;\n private isValidMonth: boolean = true;\n private isValidDate: boolean = true;\n private isZuluTime: boolean = false;\n\n private KEYBOARD_EVENT_OBJECT_STRING = \"[object KeyboardEvent]\";\n private MAX_DAY = 31;\n private MAX_MONTH = 12;\n private monthInputEl: HTMLInputElement;\n\n private preventAutoFormatting: boolean;\n private preventDayInput: boolean;\n private preventMonthInput: boolean;\n private preventYearInput: boolean;\n\n private previousInvalidDateTest: string;\n private previousEmittedDate: Date = undefined;\n private previousSelectedDate: Date = null;\n\n private selectedDate: Date = null;\n private selectedDateInfoEl: HTMLSpanElement;\n private screenReaderInfoId: string;\n private selectedDateInfoId: string;\n\n private yearInputEl: HTMLInputElement;\n\n @Element() el: HTMLIcDateInputElement;\n\n @State() day: string = \"\";\n @State() invalidDateText: string;\n @State() maxDate: Date;\n @State() minDate: Date;\n @State() month: string = \"\";\n @State() year: string = \"\";\n @State() calendarFocused: boolean = false;\n @State() clearButtonFocused: boolean = false;\n @State() removeLabelledBy: boolean = false;\n\n /**\n * The format in which the date will be displayed.\n */\n // eslint-disable-next-line sonarjs/no-duplicate-string\n @Prop() dateFormat?: IcDateFormat = \"DD/MM/YYYY\";\n\n /**\n * If `true`, the disabled state will be set.\n */\n @Prop() disabled?: boolean = false;\n\n /**\n * The days of the week to disable.\n */\n @Prop({ mutable: true }) disableDays?: IcWeekDays[] = [];\n\n /**\n * The text to display as the validation message when `disableDays` is set and a disabled date is entered.\n */\n @Prop() disableDaysMessage?: string =\n \"The date you have selected is on a day of the week that is not allowed. Please select another date.\";\n\n /**\n * If `true`, dates in the future are not allowed. A validation message will appear if a date in the future is entered.\n */\n @Prop() disableFuture?: boolean = false;\n\n @Watch(\"disableFuture\")\n watchDisableFutureHandler(): void {\n this.watchMaxHandler();\n }\n\n /**\n * The text to display as the validation message when `disableFuture` is true and a date in the future is entered.\n */\n @Prop() disableFutureMessage?: string =\n \"Dates in the future are not allowed. Please select a date in the past.\";\n\n /**\n * If `true`, dates in the past are not allowed. A validation message will appear if a date in the past is entered.\n */\n @Prop() disablePast?: boolean = false;\n\n @Watch(\"disablePast\")\n watchDisablePastHandler(): void {\n this.watchMinHandler();\n }\n\n /**\n * The text to display as the validation message when `disablePast` is true and a date in the past is entered.\n */\n @Prop() disablePastMessage?: string =\n \"Dates in the past are not allowed. Please select a date in the future.\";\n\n /**\n * The helper text that will be displayed for additional field guidance. This will default to the text \"Use format\" along with the `dateFormat` value.\n */\n @Prop({ mutable: true }) helperText?: string;\n\n /**\n * If `true`, the helper text will be visually hidden, but still read out by screenreaders.\n */\n @Prop() hideHelperText: boolean = false;\n\n /**\n * The ID for the input.\n */\n @Prop() inputId?: string = `ic-date-input-${inputIds++}`;\n\n /**\n * The text to display as the validation message when an invalid date is entered.\n */\n @Prop() invalidDateMessage?: string = \"Please enter a valid date.\";\n\n /**\n * The label for the date input.\n */\n @Prop() label!: string;\n\n /**\n * The latest date that will be allowed. The value can be in any format supported as `dateFormat`, in ISO 8601 date string format (`yyyy-mm-dd`) or as a JavaScript `Date` object.\n * The value of this prop is ignored if `disableFuture` is set to `true`.\n */\n @Prop() max?: string | Date = \"\";\n\n @Watch(\"max\")\n watchMaxHandler(): void {\n if (this.disableFuture) {\n this.maxDate = new Date();\n } else {\n this.maxDate = createDate(this.max, this.dateFormat);\n }\n }\n\n /**\n * The earliest date that will be allowed. The value can be in any format supported as `dateFormat`, in ISO 8601 date string format (`yyyy-mm-dd`) or as a JavaScript `Date` object.\n * The value of this prop is ignored if `disablePast` is set to `true`.\n */\n @Prop() min?: string | Date = \"\";\n\n @Watch(\"min\")\n watchMinHandler(): void {\n if (this.disablePast) {\n this.minDate = new Date();\n } else {\n this.minDate = createDate(this.min, this.dateFormat);\n }\n }\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * If `true`, the input will require a value.\n */\n @Prop() required?: boolean = false;\n\n @Watch(\"required\")\n watchRequiredHandler(): void {\n // Prevent asterisk being read out after the label by screen reader (by applying aria-hidden)\n // Needed because label is included in 'aria-labelledby' instead of using 'aria-label'\n const labelEl = this.el.shadowRoot.querySelector(\"label\");\n if (this.required) {\n const asteriskSpan = document.createElement(\"span\");\n asteriskSpan.setAttribute(\"id\", \"asterisk-span\");\n asteriskSpan.setAttribute(\"aria-hidden\", \"true\");\n asteriskSpan.textContent = \" *\";\n labelEl?.appendChild(asteriskSpan);\n } else {\n const asteriskSpan = this.el.shadowRoot.querySelector(\"#asterisk-span\");\n if (asteriskSpan) {\n asteriskSpan.remove();\n }\n }\n }\n\n /**\n * @internal If `true`, a button which displays the calendar view when clicked will be displayed.\n */\n @Prop() showCalendarButton?: boolean = false;\n\n /**\n * If `true`, a button which clears the date input when clicked will be displayed.\n */\n @Prop() showClearButton?: boolean = true;\n\n /**\n * The size of the date input to be displayed.\n */\n @Prop() size?: IcSizes = \"default\";\n\n /**\n * The value of the date input. The value can be in any format supported as `dateFormat`, in ISO 8601 date string format (`yyyy-mm-dd`) or as a JavaScript `Date` object.\n */\n @Prop({ mutable: true }) value?: string | Date | null | undefined = \"\";\n\n /**\n * The validation status - e.g. 'error' | 'warning' | 'success'. This will override the built-in date validation.\n */\n @Prop({ mutable: true }) validationStatus?: IcInformationStatusOrEmpty = \"\";\n\n /**\n * The text to display as the validation message. This will override the built-in date validation.\n */\n @Prop() validationText?: string = \"\";\n\n /**\n * @internal Emitted when the calendar is opened.\n */\n @Event() calendarButtonClicked: EventEmitter<{ value: Date }>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() icBlur: EventEmitter<{ value: Date }>;\n\n /**\n * Emitted when the value has changed.\n */\n @Event() icChange: EventEmitter<{ value: Date }>;\n\n /**\n * Emitted when the input gains focus.\n */\n @Event() icFocus: EventEmitter<{ value: Date }>;\n\n disconnectedCallback(): void {\n removeFormResetListener(this.el, this.handleFormReset);\n }\n\n componentWillLoad(): void {\n this.defaultHelperText = `Use format ${this.dateFormat}`;\n\n if (isEmptyString(this.helperText))\n this.helperText = this.defaultHelperText;\n\n this.watchMinHandler();\n this.watchMaxHandler();\n\n if (this.value) {\n this.setDate(this.value);\n this.previousEmittedDate = this.selectedDate;\n } else {\n this.previousEmittedDate = null;\n }\n\n this.screenReaderInfoId = `${this.inputId}-screen-reader-info`;\n this.assistiveHintId = `${this.inputId}-assistive-hint`;\n this.selectedDateInfoId = `${this.inputId}-selected-date-info`;\n\n addFormResetListener(this.el, this.handleFormReset);\n }\n\n componentDidLoad(): void {\n this.setInputsInOrder();\n\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Date Input\"\n );\n\n if (this.value) {\n this.updateInputValues(this.day, this.month, this.year);\n this.inputsInOrder.forEach((input) => {\n input.classList.add(this.FIT_TO_VALUE);\n });\n }\n\n this.setAriaInvalid(\n this.isValidDay,\n this.isValidMonth,\n this.isValidDate,\n this.isDisabledDate\n );\n\n if (this.value) {\n this.notifyScreenReaderSelectedDate();\n }\n\n this.inputsInOrder.forEach((input) => {\n input.addEventListener(\"input\", this.handleInput);\n input.addEventListener(\"focus\", this.handleFocus);\n input.addEventListener(\"blur\", this.handleBlur);\n });\n\n this.watchRequiredHandler();\n }\n\n componentWillUpdate(): void {\n if (isEmptyString(this.helperText))\n this.helperText = this.defaultHelperText;\n\n if (!this.isDateSetFromKeyboardEvent) this.setDate(this.value);\n\n this.setAriaInvalid(\n this.isValidDay,\n this.isValidMonth,\n this.isValidDate,\n this.isDisabledDate\n );\n this.handleDateChange(false);\n this.isDateSetFromKeyboardEvent = false;\n }\n\n componentDidRender(): void {\n if (this.removeLabelledBy) {\n this.removeAriaLabelledBy();\n return;\n }\n\n this.setAriaLabelledBy();\n }\n\n /**\n * Returns the value as a Date object\n * @returns Date\n */\n @Method()\n async getDate(): Promise<Date> {\n return this.selectedDate;\n }\n\n /**\n * @internal Sets focus on the calendar button.\n */\n @Method()\n async setCalendarFocus(): Promise<void> {\n if (this.calendarButtonEl) {\n this.calendarButtonEl.focus();\n }\n }\n\n /**\n * @internal Used to pass disabledDays from parent component.\n */\n @Method()\n async setDisableDays(days: IcWeekDays[]): Promise<void> {\n this.disableDays = days;\n }\n\n /**\n * @internal Used to enable other components to invoke an IcChange event from the input.\n */\n @Method()\n async triggerIcChange(d: Date): Promise<void> {\n this.emitIcChange(d);\n }\n\n private setInputPasteValue = (input: EventTarget, pastedValue: string) => {\n const inputEl = input as HTMLInputElement;\n\n inputEl.value = pastedValue;\n inputEl.classList.add(this.FIT_TO_VALUE);\n };\n\n private checkSingleCopiedValueIsValid = (\n input: EventTarget,\n pastedValue: string\n ) => {\n let isValid = false;\n const value = Number(pastedValue);\n\n switch (input) {\n case this.dayInputEl:\n isValid = value >= 1 && value <= this.MAX_DAY;\n break;\n case this.monthInputEl:\n isValid = value >= 1 && value <= this.MAX_MONTH;\n break;\n case this.yearInputEl:\n isValid = true;\n break;\n default:\n isValid = false;\n break;\n }\n\n return isValid;\n };\n\n /**\n * Using Object.prototype.string to determine type if event from user\n * @param event - event object used to differentiate keyboard, generic or input event\n * @returns boolean\n */\n private isKeyboardOrEvent = (event: Event) => {\n return (\n Object.prototype.toString.call(event) === this.EVENT_OBJECT_STRING ||\n Object.prototype.toString.call(event) ===\n this.KEYBOARD_EVENT_OBJECT_STRING\n );\n };\n\n private setDateValidity = () => {\n if (!isEmptyString(this.day)) {\n this.isValidDay = +this.day > this.MAX_DAY ? false : true;\n } else {\n this.isValidDay = true;\n }\n\n if (!isEmptyString(this.month)) {\n this.isValidMonth = +this.month > this.MAX_MONTH ? false : true;\n } else {\n this.isValidMonth = true;\n }\n };\n\n private handleInput = (event: Event) => {\n const inputEvent = event as InputEvent;\n const input = event.target as HTMLInputElement;\n\n if (input !== this.yearInputEl) {\n // Only auto-format if input event is not a character being deleted\n // and not as user is changing value using up / down keys\n if (\n inputEvent.inputType !== \"deleteContentBackward\" &&\n !this.preventAutoFormatting\n ) {\n if (\n input.value.length === 1 &&\n ((input === this.dayInputEl && +input.value >= 4) ||\n (input === this.monthInputEl && +input.value >= 2)) &&\n +input.value <= 9\n ) {\n this.setInputValue(input);\n this.notifyScreenReader(input, event);\n this.moveToNextInput(input);\n }\n\n if (input.value.length === 2) {\n if (+input.value === 0) {\n input.value = \"01\";\n }\n this.setInputValue(input);\n this.setPreventInput(input, true);\n this.notifyScreenReader(input, event);\n this.moveToNextInput(input);\n } else {\n this.setPreventInput(input, false);\n }\n } else if (this.preventAutoFormatting) {\n /**\n * Using arrow keys prevents auto formatting so need to deal with\n * switching from arrow keys to inputting numbers\n **/\n if (input.value.length === 2 && !this.isKeyboardOrEvent(event)) {\n this.setInputValue(input);\n this.setPreventInput(input, true);\n this.moveToNextInput(input);\n } else {\n this.setInputValue(input);\n }\n }\n\n if (input.value.length !== 2) {\n this.setPreventInput(input, false);\n }\n } else {\n if (input.value.length === 4) {\n this.setInputValue(input);\n if (\n Object.prototype.toString.call(event) !== this.EVENT_OBJECT_STRING\n ) {\n this.moveToNextInput(input);\n }\n this.setPreventInput(input, true);\n } else {\n this.setInputValue(input, true);\n this.setPreventInput(input, false);\n }\n }\n\n // Add / remove class to make input width match size of value i.e. 2 digits' width for day / month, 4 for year\n this.setFitToValueStyling(input);\n\n if (input.value.length === 0) {\n this.setInputValue(input, true);\n this.setValidationMessage();\n }\n\n this.notifyScreenReader(input, event);\n };\n\n private handleKeyDown = (event: KeyboardEvent, isInputPrevented: boolean) => {\n const input = event.target as HTMLInputElement;\n\n const eventKey = event.key.toLowerCase();\n // Regex required due to FF allowing all characters as values for number text field.\n const regex =\n /-?\\d*\\.?\\d+(e[-+]?\\d+)?|[/-]|arrowup|arrowdown|arrowleft|arrowright|shift|tab|backspace|delete/;\n if (\n !regex.test(eventKey) &&\n !(\n (event.ctrlKey || event.metaKey) &&\n (eventKey === \"v\" || eventKey === \"c\")\n )\n ) {\n event.preventDefault();\n }\n\n switch (eventKey) {\n case \"/\":\n case \"-\":\n case \".\":\n event.preventDefault();\n this.setPasteInvalidText();\n this.moveToNextInput(input);\n break;\n case \"arrowright\":\n case \"arrowleft\":\n event.preventDefault();\n this.handleLeftRightArrowKeyPress(input, eventKey);\n break;\n case \"arrowup\":\n case \"arrowdown\":\n this.preventAutoFormatting = true;\n this.handleUpDownArrowKeyPress(input, event);\n break;\n default:\n break;\n }\n\n this.preventInput(event, isInputPrevented);\n this.isDateSetFromKeyboardEvent = true;\n };\n\n private handleFocus = (event: FocusEvent) => {\n // Highlight / select all characters in input for easy replacement\n const input = event.target as HTMLInputElement;\n\n input.select();\n };\n\n private handleBlur = (event: FocusEvent) => {\n const input = event.target as HTMLInputElement;\n\n this.setPasteInvalidText();\n this.autocompleteInput(input);\n };\n\n private handleLeftRightArrowKeyPress = (\n input: HTMLInputElement,\n key: string\n ) => {\n if (key === \"arrowright\") {\n this.moveToNextInput(input);\n } else {\n this.moveToPreviousInput(input);\n }\n\n this.setPasteInvalidText();\n };\n\n private notifyScreenReaderSelectedDate = () => {\n const dayNames = stringEnumToArray(IcDayNames);\n const months = stringEnumToArray(IcDateInputMonths);\n\n this.selectedDateInfoEl.textContent = `Selected date: ${\n dayNames[this.selectedDate.getDay()]\n }, ${this.selectedDate.getDate()} ${\n months[this.selectedDate.getMonth()]\n } ${this.selectedDate.getFullYear()}`;\n };\n\n private handleUpDownArrowKeyPress = (\n input: HTMLInputElement,\n event: KeyboardEvent\n ) => {\n const minValue = input === this.yearInputEl ? 0 : 1;\n\n let maxValue;\n\n switch (input) {\n case this.dayInputEl:\n maxValue = this.MAX_DAY;\n break;\n case this.monthInputEl:\n maxValue = this.MAX_MONTH;\n break;\n case this.yearInputEl:\n maxValue = 9999;\n }\n\n // Make value loop round when min / max reached\n if (input?.value) {\n if (event.key === \"ArrowUp\") {\n if (+input.value === maxValue) {\n event.preventDefault();\n input.value = `0${minValue}`;\n } else {\n input.value =\n +input.value + 1 < 10\n ? `0${+input.value + 1}`\n : (+input.value + 1).toString();\n }\n this.notifyScreenReader(input, event);\n }\n\n if (event.key === \"ArrowDown\") {\n if (+input.value === minValue) {\n event.preventDefault();\n input.value = maxValue.toString();\n } else {\n input.value =\n +input.value - 1 < 10\n ? `0${+input.value - 1}`\n : (+input.value - 1).toString();\n }\n this.notifyScreenReader(input, event);\n }\n } else {\n if (event.key === \"ArrowDown\") {\n event.preventDefault();\n if (input === this.yearInputEl) {\n input.value = new Date().getFullYear().toString();\n } else {\n input.value = maxValue.toString();\n }\n this.notifyScreenReader(input, event);\n } else if (event.key === \"ArrowUp\") {\n event.preventDefault();\n if (input === this.yearInputEl) {\n input.value = new Date().getFullYear().toString();\n } else {\n input.value = `0${minValue}`;\n }\n this.notifyScreenReader(input, event);\n }\n }\n\n this.setInputValue(input);\n this.setFitToValueStyling(input);\n };\n\n private handleDateChange = (force: boolean) => {\n // Prevent icChange being emitted when each individual input is changed\n // This method is used within componentWillUpdate instead of using @Watch('value');\n if (force || !dateMatches(this.selectedDate, this.previousSelectedDate)) {\n if (this.value) {\n this.inputsInOrder.forEach((input) => {\n input.classList.add(this.FIT_TO_VALUE);\n });\n }\n if (this.day && this.month && this.year && this.invalidDateText === \"\") {\n this.setValueAndEmitChange(this.selectedDate);\n this.notifyScreenReaderSelectedDate();\n } else if (\n !(this.selectedDate === null && this.previousSelectedDate === null)\n ) {\n this.setValueAndEmitChange(null);\n this.selectedDateInfoEl.textContent = \"\";\n }\n this.previousSelectedDate = this.selectedDate;\n\n if (!this.isDateSetFromKeyboardEvent) {\n this.updateInputValues(this.day, this.month, this.year);\n }\n }\n };\n\n private slicePastedDate = (valueLength: number, datePart: string): string => {\n return datePart.length > valueLength\n ? datePart.slice(0, valueLength)\n : datePart;\n };\n\n private isPastedStringDateValid = (value: string) => {\n if (\n /\\d+-\\d+-\\d+$/.test(value) ||\n /\\d+\\/\\d+\\/\\d+/.test(value) ||\n /\\d+\\.\\d+\\.\\d+/.test(value)\n ) {\n return true;\n }\n\n if (\n /[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}(?::[0-9]{2}(?:\\.\\d+)?)?Z/.test(\n value\n )\n ) {\n this.isZuluTime = true;\n return true;\n }\n\n return false;\n };\n\n // Set value of each input to value of pasted date part\n // Allows formats separated by '-' or '/'\n private handlePaste = (event: ClipboardEvent) => {\n event.preventDefault();\n\n const pastedValue = event.clipboardData.getData(\"Text\");\n const isValidDate = this.isPastedStringDateValid(pastedValue);\n\n this.setPastedValueAndValidation(isValidDate, pastedValue, event);\n };\n\n private setDate = (date: string | Date) => {\n if (date === null || date === \"\" || date === undefined) {\n this.day = null;\n this.month = null;\n this.year = null;\n this.inputsInOrder.forEach((input) => {\n input.classList.remove(this.FIT_TO_VALUE);\n this.setPreventInput(input, false);\n });\n this.handleDateChange(true);\n } else {\n if (isDateOrEpoch(date)) {\n let newDate;\n if (typeof date === \"string\") {\n // Checking if epoch date time\n newDate = new Date(+date);\n } else {\n newDate = date;\n }\n\n this.day = convertToDoubleDigits(newDate.getDate());\n this.month = convertToDoubleDigits(newDate.getMonth() + 1);\n this.year = newDate.getFullYear().toString();\n } else if (typeof date === \"string\") {\n const defaultDateArray = splitStringDate(date, this.dateFormat);\n this.year = defaultDateArray[0];\n this.month = defaultDateArray[1];\n this.day = defaultDateArray[2];\n }\n }\n\n this.setValidationMessage();\n };\n\n private formatMinMax = (date: Date) => {\n let formattedDate;\n\n const day = convertToDoubleDigits(date.getDate());\n const month = convertToDoubleDigits(date.getMonth() + 1);\n const year = date.getFullYear();\n\n switch (this.dateFormat) {\n case \"DD/MM/YYYY\":\n formattedDate = `${day}/${month}/${year}`;\n break;\n case \"MM/DD/YYYY\":\n formattedDate = `${month}/${day}/${year}`;\n break;\n case \"YYYY/MM/DD\":\n formattedDate = `${year}/${month}/${day}`;\n break;\n default:\n break;\n }\n return formattedDate;\n };\n private updateInputValues = (day: string, month: string, year: string) => {\n this.dayInputEl.value = day;\n this.monthInputEl.value = month;\n this.yearInputEl.value = year;\n };\n\n // Set value in state based on input\n private setInputValue = (input: HTMLInputElement, clear = false) => {\n const newValue = clear ? \"\" : input.value;\n\n switch (input) {\n case this.dayInputEl:\n this.day = newValue;\n break;\n case this.monthInputEl:\n this.month = newValue;\n break;\n case this.yearInputEl:\n if (this.year !== newValue) {\n this.year = newValue;\n }\n }\n\n this.setValidationMessage();\n };\n\n private setValidationMessage = () => {\n this.setDateValidity();\n\n if (\n !isEmptyString(this.day) &&\n !isEmptyString(this.month) &&\n !isEmptyString(this.year)\n ) {\n // Check whether date actually exists\n // (used https://www.hectane.com/blog/javascript-date-validation-with-leap-year)\n this.selectedDate = this.convertToDate(this.year, this.month, this.day);\n this.isValidDate =\n +this.selectedDate !== 0 && this.selectedDate.getDate() == +this.day;\n this.isDisabledDate = this.isSelectedDateDisabled();\n\n if (!this.isValidDate || this.isDisabledDate) {\n this.inputsInOrder.forEach((input) =>\n input.setAttribute(this.ARIA_INVALID, \"true\")\n );\n } else {\n this.inputsInOrder.forEach((input) =>\n input.removeAttribute(this.ARIA_INVALID)\n );\n }\n } else {\n this.selectedDate = null;\n }\n\n if (!(this.isValidDay && this.isValidMonth && this.isValidDate)) {\n this.invalidDateText = this.invalidDateMessage;\n } else if (this.isDisabledDate && this.selectedDate !== null) {\n if (this.isBeforeMin) {\n if (this.disablePast) {\n this.invalidDateText = this.disablePastMessage;\n } else {\n this.invalidDateText = `Please enter a date after ${this.formatMinMax(\n this.minDate\n )}.`;\n }\n } else if (this.isAfterMax) {\n if (this.disableFuture) {\n this.invalidDateText = this.disableFutureMessage;\n } else {\n this.invalidDateText = `Please enter a date before ${this.formatMinMax(\n this.maxDate\n )}.`;\n }\n } else if (this.disableDays.length !== 0) {\n this.invalidDateText = this.disableDaysMessage;\n } else {\n if (this.disablePast) {\n this.invalidDateText = this.disablePastMessage;\n }\n if (this.disableFuture) {\n this.invalidDateText = this.disableFutureMessage;\n }\n }\n } else {\n this.invalidDateText = \"\";\n }\n };\n\n // Set refs to the input elements in the order they are displayed (based on the dateFormat)\n private setInputsInOrder = () => {\n const inputs = this.el.shadowRoot.querySelectorAll(\"input\");\n inputs.forEach((input) => this.inputsInOrder.push(input));\n };\n\n // Includes text usually added using aria-describedby\n // (which doesn't work on input component container)\n private setAriaLabelledBy = () => {\n if (\n this.disabled &&\n !isEmptyString(\n this.inputCompContainerEl?.getAttribute(this.ARIA_LABELLED_BY)\n )\n ) {\n this.removeAriaLabelledBy();\n return;\n }\n\n if (this.disabled) {\n return;\n }\n\n const labelEl = this.el.shadowRoot.querySelector(\"label\");\n const labelId = `${this.inputId}-label`;\n\n if (labelEl !== null && labelEl !== undefined) {\n labelEl.id = labelId;\n\n const hasValidation =\n (!isEmptyString(this.validationStatus) &&\n !isEmptyString(this.validationText)) ||\n !isEmptyString(this.invalidDateText);\n\n const labelledBy = `${labelId} ${\n this.screenReaderInfoId\n } ${getInputDescribedByText(\n this.inputId,\n this.helperText !== \"\" && this.helperText !== this.defaultHelperText,\n hasValidation\n )} ${this.selectedDate ? this.selectedDateInfoId : \"\"} ${\n this.assistiveHintId\n }`;\n this.inputCompContainerEl.setAttribute(this.ARIA_LABELLED_BY, labelledBy);\n }\n };\n\n // Sets boolean for each input, used to limit the number of characters within each field (2 for day / month, 4 for year)\n private setPreventInput = (input: HTMLInputElement, isPrevented: boolean) => {\n switch (input) {\n case this.dayInputEl:\n this.preventDayInput = isPrevented;\n break;\n case this.monthInputEl:\n this.preventMonthInput = isPrevented;\n break;\n case this.yearInputEl:\n this.preventYearInput = isPrevented;\n }\n };\n\n // Get input based on letter representing each date part (\"D\", \"M\" or \"Y\")\n // (retrieved from dateFormat)\n private getInputFromDatePart = (datePart: string) => {\n const dayInput = (\n <input\n class=\"day-input\"\n id=\"day-input\"\n ref={(el) => (this.dayInputEl = el)}\n aria-label=\"day\"\n placeholder=\"DD\"\n disabled={this.disabled}\n onPaste={this.handlePaste}\n inputmode=\"number\"\n pattern=\"[0-9]*\"\n onKeyDown={(event) => this.handleKeyDown(event, this.preventDayInput)}\n ></input>\n );\n\n const monthInput = (\n <input\n id=\"month-input\"\n class=\"month-input\"\n ref={(el) => (this.monthInputEl = el)}\n aria-label=\"month\"\n placeholder=\"MM\"\n disabled={this.disabled}\n onPaste={this.handlePaste}\n inputmode=\"number\"\n pattern=\"[0-9]*\"\n onKeyDown={(event) => this.handleKeyDown(event, this.preventMonthInput)}\n ></input>\n );\n\n const yearInput = (\n <input\n id=\"year-input\"\n class=\"year-input\"\n ref={(el) => (this.yearInputEl = el)}\n aria-label=\"year\"\n placeholder=\"YYYY\"\n maxLength={4}\n disabled={this.disabled}\n onPaste={this.handlePaste}\n inputmode=\"number\"\n pattern=\"[0-9]*\"\n onKeyDown={(event) => this.handleKeyDown(event, this.preventYearInput)}\n ></input>\n );\n\n let input;\n\n switch (datePart) {\n case \"D\":\n input = dayInput;\n break;\n case \"M\":\n input = monthInput;\n break;\n case \"Y\":\n input = yearInput;\n }\n\n return input;\n };\n\n // Get input elements in order of chosen date format\n private getInputsInOrder = () => {\n const dateParts = this.dateFormat.split(\"/\");\n\n const inputsInOrder: HTMLInputElement[] = [];\n\n dateParts.forEach((part: string) => {\n inputsInOrder.push(this.getInputFromDatePart(part.substring(0, 1)));\n });\n\n return inputsInOrder;\n };\n\n // To add to the end of assistive hint to make it clearer that each date part has its own input\n // that can be changed individually\n private getDescOfInputsOrder = () => {\n let description;\n\n switch (this.dateFormat) {\n case \"DD/MM/YYYY\":\n description = \"day, month, and year\";\n break;\n case \"MM/DD/YYYY\":\n description = \"month, day, and year\";\n break;\n case \"YYYY/MM/DD\":\n description = \"year, month, and day\";\n }\n\n return description;\n };\n\n // Add 'required' or 'invalid data' to span used in aria-labelledby\n // Many ARIA attributes aren't read out by screen reader when on the input component container\n private getScreenReaderInfo = (validationStatus: string) => {\n let inputDescriptors = \"\";\n\n if (this.required) {\n inputDescriptors += \"required\";\n }\n\n if (validationStatus === IcInformationStatus.Error) {\n inputDescriptors += \" invalid data\";\n }\n\n return inputDescriptors === \"\" ? \"\" : inputDescriptors + \", \";\n };\n\n // Prevent non-number characters being entered\n // ('e' or '.' - which are usually allowed in <input type=\"number\">)\n // And limit the number of characters within each field (2 for day / month, 4 for year)\n // (because 'maxlength' doesn't work on <input type=\"number\">)\n private preventInput = (event: KeyboardEvent, isInputPrevented: boolean) => {\n const key = event.key;\n const input = event.target as HTMLInputElement;\n let selectedString;\n\n if (input) {\n selectedString = input.value.substring(\n input.selectionStart,\n input.selectionEnd\n );\n }\n\n if (\n key === \"e\" ||\n key === \".\" ||\n key === \"-\" ||\n (event.key >= \"0\" &&\n event.key <= \"9\" &&\n isInputPrevented &&\n !selectedString)\n ) {\n event.preventDefault();\n }\n };\n\n // Get whether date has been disabled using disableFuture or disablePast prop, but always allow current day\n // Consider using dateClamp and inDateRange\n private isSelectedDateDisabled = () => {\n const currentDate = new Date();\n this.isAfterMax = false;\n this.isBeforeMin = false;\n\n let disabled = false;\n const isNotToday =\n this.selectedDate.toDateString() !== currentDate.toDateString();\n\n if (this.minDate && this.selectedDate < this.minDate && isNotToday) {\n this.isBeforeMin = true;\n disabled = true;\n }\n\n if (this.maxDate && this.selectedDate > this.maxDate && isNotToday) {\n this.isAfterMax = true;\n disabled = true;\n }\n\n if (this.disableDays.includes(this.selectedDate.getDay())) {\n disabled = true;\n }\n\n if (\n ((this.disablePast && this.selectedDate < currentDate) ||\n (this.disableFuture && this.selectedDate > currentDate)) &&\n isNotToday\n ) {\n disabled = true;\n }\n\n return disabled;\n };\n\n private moveToNextInput = (currentInput: HTMLInputElement) => {\n const currentInputPos = this.inputsInOrder.findIndex(\n (input) => input === currentInput\n );\n const nextInput = this.inputsInOrder[currentInputPos + 1];\n\n this.preventAutoFormatting = false;\n\n if (nextInput) {\n nextInput.focus();\n }\n };\n\n private moveToPreviousInput = (currentInput: HTMLInputElement) => {\n const currentInputPos = this.inputsInOrder.findIndex(\n (input) => input === currentInput\n );\n\n this.preventAutoFormatting = false;\n\n if (this.inputsInOrder[currentInputPos - 1]) {\n this.inputsInOrder[currentInputPos - 1].focus();\n }\n };\n\n private autocompleteInput = (input: HTMLInputElement) => {\n if (input === this.yearInputEl) {\n this.autocompleteYear();\n } else {\n const inputValue = input.value;\n\n // Autocomplete input as 2 characters (leading zero) when only 1 character entered (for day and month)\n if (inputValue.length === 1) {\n if (+inputValue === 0) {\n input.value = \"01\";\n } else {\n input.value = `0${inputValue}`;\n }\n }\n }\n\n if (input.value) {\n this.setInputValue(input);\n }\n };\n\n // Autocomplete year as current millennium when fewer than 4 characters entered\n private autocompleteYear = () => {\n const inputValue = this.yearInputEl.value;\n const yearNumbers = [\"2\", \"0\", \"0\"];\n\n let autocompletedInput = \"\";\n\n if (inputValue) {\n yearNumbers.forEach((number, index) => {\n if (inputValue.length + index <= 3) {\n autocompletedInput += number;\n }\n });\n\n this.yearInputEl.value = `${autocompletedInput}${inputValue}`;\n }\n };\n\n private convertToDate = (\n year: string,\n month: string,\n day: string\n ): Date | null => {\n if (!isEmptyString(year) && !isEmptyString(month) && !isEmptyString(day)) {\n return new Date(+year, +month - 1, +day);\n } else {\n return null;\n }\n };\n\n private handleHostBlur = () => {\n this.removeLabelledBy = false;\n this.icBlur.emit({ value: this.selectedDate });\n };\n\n private handleHostFocus = () => {\n if (this.el.shadowRoot.activeElement?.id.match(/(day|month|year)-input$/)) {\n this.removeLabelledBy = false;\n } else {\n this.removeLabelledBy = true;\n }\n this.icFocus.emit({ value: this.selectedDate });\n };\n\n private handleFormReset = () => {\n // Get the initial value and populate day, month and year again.\n this.setDate(this.initialValue);\n this.setValidationMessage();\n this.handleDateChange(false);\n };\n\n private getAriaLabel = (input: HTMLInputElement): string => {\n return input.getAttribute(this.ARIA_LABEL);\n };\n\n private notifyScreenReaderArrowKeys = (input: HTMLInputElement) => {\n const liveRegion = this.el.shadowRoot.querySelector(\"#live-region\");\n let announcement = \"\";\n const ariaLabel = this.getAriaLabel(input);\n\n if (liveRegion && input.value) {\n if (\n input === this.monthInputEl &&\n !!IcDateInputMonths[+input.value - 1]\n ) {\n announcement = `${input.value} - ${\n IcDateInputMonths[+input.value - 1]\n }, ${ariaLabel}`;\n }\n\n if (input === this.dayInputEl || input === this.yearInputEl) {\n announcement = `${input.value}, ${ariaLabel}`;\n }\n\n liveRegion.textContent = announcement;\n }\n };\n\n private removeAriaLabelledBy() {\n this.inputCompContainerEl.removeAttribute(this.ARIA_LABELLED_BY);\n }\n\n private setPastedValueAndValidation(\n isValidDate: boolean,\n pastedValue: string,\n event: ClipboardEvent\n ) {\n switch (true) {\n case isValidDate: {\n const nextParsedValue = this.isZuluTime\n ? extractDateFromZuluDateTime(pastedValue)\n : pastedValue;\n const dateParts = nextParsedValue.split(/-|\\/|\\./);\n this.inputsInOrder.forEach((input, index) => {\n input.classList.add(this.FIT_TO_VALUE);\n\n if (this.isZuluTime) {\n this.pasteZuluDateTime(dateParts, index);\n } else {\n let dateValue;\n\n if (input === this.dayInputEl || input === this.monthInputEl) {\n dateValue = this.slicePastedDate(2, dateParts[index]);\n } else {\n dateValue = this.slicePastedDate(4, dateParts[index]);\n }\n\n input.value = dateValue;\n\n this.setInputValue(input);\n this.autocompleteInput(input);\n }\n });\n this.isZuluTime = false;\n break;\n }\n\n case (pastedValue.length === 1 ||\n pastedValue.length === 2 ||\n pastedValue.length === 4) &&\n isNumeric(pastedValue):\n if (this.checkSingleCopiedValueIsValid(event.target, pastedValue)) {\n // Check if copied value can be pasted into input\n this.setInputPasteValue(event.target, pastedValue);\n this.setInputValue(event.target as HTMLInputElement);\n } else {\n this.displayPastedValidation(event);\n }\n break;\n\n case pastedValue.length === 3 && isNumeric(pastedValue):\n if (event.target !== this.yearInputEl) {\n this.displayPastedValidation(event);\n } else {\n this.setInputPasteValue(event.target, pastedValue);\n this.setInputValue(event.target as HTMLInputElement);\n }\n break;\n\n case pastedValue.length >= 5 && isNumeric(pastedValue):\n this.displayPastedValidation(event);\n }\n }\n\n private pasteZuluDateTime(dateParts: string[], index: number) {\n // ['YYYY', 'MM', 'DD']\n if (index === 0) {\n const dateValue = this.slicePastedDate(4, dateParts[index]);\n this.yearInputEl.value = dateValue;\n this.setInputValue(this.yearInputEl);\n } else if (index === 1) {\n // The month value is the second item in the array\n const dateValue = this.slicePastedDate(2, dateParts[index]);\n this.monthInputEl.value = dateValue;\n this.setInputValue(this.monthInputEl);\n } else {\n const dateValue = this.slicePastedDate(2, dateParts[index]);\n this.dayInputEl.value = dateValue;\n this.setInputValue(this.dayInputEl);\n }\n }\n\n private displayPastedValidation(event: ClipboardEvent) {\n if (this.invalidDateText?.length > 0) {\n this.previousInvalidDateTest = this.invalidDateText;\n }\n\n this.invalidDateText = `Please paste a valid ${this.getAriaLabel(\n event.target as HTMLInputElement\n )}`;\n\n this.validationStatus = IcInformationStatus.Error;\n this.isPasteValidationDisplayed = true;\n }\n\n private setPasteInvalidText() {\n if (this.isPasteValidationDisplayed) {\n this.invalidDateText = this.previousInvalidDateTest ?? \"\";\n this.isPasteValidationDisplayed = false;\n\n // This is to prevent setDate from triggering within componentWillUpdate\n this.isDateSetFromKeyboardEvent = true;\n }\n }\n\n private notifyScreenReader(input: HTMLInputElement, event: Event) {\n const liveRegion = this.el.shadowRoot.querySelector(\"#live-region\");\n\n if (liveRegion) {\n if (this.isKeyboardOrEvent(event)) {\n this.notifyScreenReaderArrowKeys(input);\n } else if (\n Object.prototype.toString.call(event) === this.INPUT_EVENT_OBJECT_STRING\n ) {\n this.notifyScreenReaderInput(input, liveRegion as HTMLElement);\n }\n }\n }\n\n private notifyScreenReaderInput = (\n input: HTMLInputElement,\n liveRegion: HTMLElement\n ) => {\n let announcement = \"\";\n const ariaLabel = this.getAriaLabel(input);\n\n if (input === this.dayInputEl || input === this.monthInputEl) {\n if (input.value.length === 2) {\n if (\n input === this.monthInputEl &&\n !!IcDateInputMonths[+input.value - 1] &&\n this.isValidMonth\n ) {\n announcement = `${input.value} - ${\n IcDateInputMonths[+input.value - 1]\n }, ${ariaLabel}`;\n }\n\n if (input === this.dayInputEl && this.isValidDay) {\n announcement = `${input.value}, ${ariaLabel}`;\n }\n } else {\n announcement = \"\";\n }\n } else {\n if (input.value.length === 4) {\n announcement = `${input.value}, ${ariaLabel}`;\n } else {\n announcement = \"\";\n }\n }\n liveRegion.textContent = announcement;\n };\n\n private setFitToValueStyling = (input: HTMLInputElement) => {\n if (input.value) {\n input.classList.add(this.FIT_TO_VALUE);\n } else {\n input.classList.remove(this.FIT_TO_VALUE);\n }\n };\n\n private setAriaInvalid = (\n validDay: boolean,\n validMonth: boolean,\n validDate: boolean,\n disabledDate: boolean\n ) => {\n if (this.inputsInOrder.length) {\n this.inputsInOrder.forEach((input) => {\n input.removeAttribute(this.ARIA_INVALID);\n });\n\n if (!validDay) {\n this.dayInputEl.setAttribute(this.ARIA_INVALID, \"true\");\n }\n\n if (!validMonth) {\n this.monthInputEl.setAttribute(this.ARIA_INVALID, \"true\");\n }\n\n if (!validDate || disabledDate) {\n this.inputsInOrder.forEach((input) => {\n input.setAttribute(this.ARIA_INVALID, \"true\");\n });\n }\n }\n };\n\n private handleClear = () => {\n this.inputsInOrder.forEach((input) => {\n input.classList.remove(this.FIT_TO_VALUE);\n this.setInputValue(input, true);\n this.setPreventInput(input, false);\n });\n this.isDateSetFromKeyboardEvent = false;\n this.setValidationMessage();\n this.handleDateChange(true);\n\n this.inputsInOrder[0].focus();\n };\n\n private handleCalendarOpen = (ev: MouseEvent) => {\n ev.stopImmediatePropagation();\n this.calendarButtonEl?.shadowRoot\n .querySelector(\"ic-tooltip\")\n .displayTooltip(false);\n this.calendarButtonClicked.emit({ value: this.selectedDate });\n this.calendarButtonEl?.shadowRoot\n .querySelector(\"ic-tooltip\")\n .displayTooltip(false);\n this.isDateSetFromKeyboardEvent = false;\n };\n\n private setValueAndEmitChange = (value: Date) => {\n if (!dateMatches(new Date(this.value), value)) {\n this.emitIcChange(value);\n this.value = value;\n }\n };\n\n private handleCalendarFocus = () => {\n this.calendarFocused = true;\n };\n\n private handleCalendarBlur = () => {\n this.calendarFocused = false;\n };\n\n private handleClearFocus = () => {\n this.removeLabelledBy = true;\n this.clearButtonFocused = true;\n };\n\n private handleClearBlur = (ev: FocusEvent) => {\n this.clearButtonFocused = false;\n if ((ev.relatedTarget as HTMLElement)?.id.match(/(day|year)-input$/)) {\n this.removeLabelledBy = false;\n return;\n }\n\n this.removeLabelledBy = true;\n };\n\n private emitIcChange = (d: Date) => {\n if (\n !(d === null && this.previousEmittedDate === null) &&\n !dateMatches(d, this.previousEmittedDate)\n ) {\n this.previousEmittedDate = d;\n this.icChange.emit({ value: d });\n }\n };\n\n render() {\n const {\n inputId,\n label,\n disabled,\n helperText,\n hideHelperText,\n showClearButton,\n showCalendarButton,\n size,\n } = this;\n\n const hasCustomValidation =\n !isEmptyString(this.validationStatus) &&\n !isEmptyString(this.validationText);\n\n const validationStatus = hasCustomValidation\n ? this.validationStatus\n : !isEmptyString(this.invalidDateText)\n ? IcInformationStatus.Error\n : \"\";\n\n const assistiveHint = `Type or use the up and down arrow keys to change the values for the ${this.getDescOfInputsOrder()}.`;\n\n renderHiddenInput(\n true,\n this.el,\n this.name,\n this.convertToDate(this.year, this.month, this.day),\n this.disabled\n );\n\n return (\n <Host onBlur={this.handleHostBlur} onFocus={this.handleHostFocus}>\n <ic-input-container disabled={disabled}>\n <ic-input-label\n for={inputId}\n label={label}\n helperText={!hideHelperText ? helperText : null}\n disabled={disabled}\n ></ic-input-label>\n <span id={this.screenReaderInfoId} class=\"sr-only\" aria-hidden=\"true\">\n {this.getScreenReaderInfo(validationStatus)}\n {hideHelperText && `${helperText}\\n`}\n {`${this.defaultHelperText}.`}\n </span>\n <span id={this.assistiveHintId} class=\"sr-only\" aria-hidden=\"true\">\n {assistiveHint}\n </span>\n <span id=\"live-region\" aria-live=\"assertive\" class=\"sr-only\"></span>\n <ic-input-component-container\n id={inputId}\n ref={(el: HTMLIcInputComponentContainerElement) =>\n (this.inputCompContainerEl = el)\n }\n disabled={disabled}\n validationStatus={validationStatus}\n size={size}\n role=\"group\"\n >\n <div class=\"input-container\">\n <div class=\"date-inputs\">\n {this.getInputsInOrder()[0]}/{this.getInputsInOrder()[1]}/\n {this.getInputsInOrder()[2]}\n </div>\n <div class=\"action-buttons\">\n {showClearButton && (\n <ic-button\n id=\"clear-button\"\n aria-label=\"Clear input\"\n class={{\n [\"clear-button\"]: true,\n [\"hidden\"]:\n isEmptyString(this.day) &&\n isEmptyString(this.month) &&\n isEmptyString(this.year),\n }}\n disabled={this.disabled}\n innerHTML={Clear}\n onClick={this.handleClear}\n onFocus={this.handleClearFocus}\n onBlur={this.handleClearBlur}\n variant=\"icon\"\n appearance={\n this.clearButtonFocused\n ? IcThemeForegroundEnum.Light\n : IcThemeForegroundEnum.Dark\n }\n size={size}\n ></ic-button>\n )}\n {showCalendarButton && (\n <div class=\"show-calendar-button-wrapper\">\n <div class={{ divider: true, [size]: true }}></div>\n <ic-button\n id=\"calendar-button\"\n ref={(el: HTMLIcButtonElement) =>\n (this.calendarButtonEl = el)\n }\n aria-label=\"Display calendar\"\n aria-haspopup=\"dialog\"\n class=\"calendar-button\"\n disabled={this.disabled}\n innerHTML={Calendar}\n onClick={this.handleCalendarOpen}\n variant=\"icon\"\n size={size}\n onFocus={this.handleCalendarFocus}\n onBlur={this.handleCalendarBlur}\n appearance={\n this.calendarFocused\n ? IcThemeForegroundEnum.Light\n : IcThemeForegroundEnum.Default\n }\n ></ic-button>\n </div>\n )}\n </div>\n </div>\n </ic-input-component-container>\n <span id={this.selectedDateInfoId} class=\"sr-only\" aria-live=\"polite\">\n <span\n ref={(el) => (this.selectedDateInfoEl = el)}\n role=\"status\"\n ></span>\n </span>\n {(hasCustomValidation || !isEmptyString(this.invalidDateText)) && (\n <ic-input-validation\n status={validationStatus}\n message={\n hasCustomValidation ? this.validationText : this.invalidDateText\n }\n for={inputId}\n ></ic-input-validation>\n )}\n </ic-input-container>\n </Host>\n );\n }\n}\n"],"mappings":"4kCAAA,MAAMA,EAAiB,gkIC2CvB,IAAIC,EAAW,E,MASFC,EAAS,M,yLACZC,KAAAC,aAAe,eACfD,KAAAE,WAAa,aACbF,KAAAG,iBAAmB,kBAKnBH,KAAAI,oBAAsB,iBACtBJ,KAAAK,aAAe,eAEfL,KAAAM,aAAeN,KAAKO,MAEpBP,KAAAQ,0BAA4B,sBAC5BR,KAAAS,cAAoC,GAEpCT,KAAAU,WAAsB,MACtBV,KAAAW,YAAuB,MACvBX,KAAAY,2BAAsC,MACtCZ,KAAAa,eAA0B,MAE1Bb,KAAAc,WAAsB,KACtBd,KAAAe,aAAwB,KACxBf,KAAAgB,YAAuB,KACvBhB,KAAAiB,WAAsB,MAEtBjB,KAAAkB,6BAA+B,yBAC/BlB,KAAAmB,QAAU,GACVnB,KAAAoB,UAAY,GASZpB,KAAAqB,oBAA4BC,UAC5BtB,KAAAuB,qBAA6B,KAE7BvB,KAAAwB,aAAqB,KAyUrBxB,KAAAyB,mBAAqB,CAACC,EAAoBC,KAChD,MAAMC,EAAUF,EAEhBE,EAAQrB,MAAQoB,EAChBC,EAAQC,UAAUC,IAAI9B,KAAKK,aAAa,EAGlCL,KAAA+B,8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KAAK6C,MACnBD,EAAc5C,KAAK8C,QACnBF,EAAc5C,KAAKiG,OAEvB8C,SAAU/I,KAAK+I,SACf2J,UAAWC,EACXC,QAAS5S,KAAKsO,YACdiE,QAASvS,KAAKkP,iBACdoD,OAAQtS,KAAKoP,gBACbyD,QAAQ,OACRC,WACE9S,KAAKmP,mBACD4D,EAAsBC,MACtBD,EAAsBE,KAE5BjB,KAAMA,IAGTD,GACCtH,EAAA,OAAKC,MAAM,gCACTD,EAAA,OAAKC,MAAO,CAAEwI,QAAS,KAAMlB,CAACA,GAAO,QACrCvH,EAAA,aACEjB,GAAG,kBACHmB,IAAMjC,GACH1I,KAAK0O,iBAAmBhG,EAAG,aAEnB,mBAAkB,gBACf,SACdgC,MAAM,kBACN3B,SAAU/I,KAAK+I,SACf2J,UAAWS,EACXP,QAAS5S,KAAKuO,mBACdsE,QAAQ,OACRb,KAAMA,EACNO,QAASvS,KAAK+O,oBACduD,OAAQtS,KAAKiP,mBACb6D,WACE9S,KAAKgP,gBACD+D,EAAsBC,MACtBD,EAAsBK,cAQxC3I,EAAA,QAAMjB,GAAIxJ,KAAKiK,mBAAoBS,MAAM,UAAS,YAAW,UAC3DD,EAAA,QACEE,IAAMjC,GAAQ1I,KAAKoF,mBAAqBsD,EACxC+J,KAAK,aAGPR,IAAwBrP,EAAc5C,KAAKkG,mBAC3CuE,EAAA,uBACE4I,OAAQ3J,EACR4J,QACErB,EAAsBjS,KAAK2J,eAAiB3J,KAAKkG,gBAEnDsM,IAAKjJ,K"}
@@ -1,2 +1,2 @@
1
- import{r as t,c as i,h as s,H as e,g as h}from"./p-8455d1bb.js";import{k as a,l as n,m as l,n as o,q as r,r as c,t as d,o as u,u as p,v as f,w as b,I as v,x as m,y as g,z as w}from"./p-adbe0d89.js";const x=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n<path d="M7 9.5L12 14.5L17 9.5H7Z" fill="currentColor" />\n</svg>\n`;const y=`<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">\n<path d="M12.6666 4.27334L11.7266 3.33334L7.99998 7.06001L4.27331 3.33334L3.33331 4.27334L7.05998 8.00001L3.33331 11.7267L4.27331 12.6667L7.99998 8.94001L11.7266 12.6667L12.6666 11.7267L8.93998 8.00001L12.6666 4.27334Z" fill="currentColor" />\n</svg>\n`;const k='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block;position:relative;--menu-max-height:100px}:host(.full-width){width:100%}ic-input-component-container:hover{--border-color:var(--ic-action-dark-hover)}ic-input-component-container:active{--border-color:var(--ic-action-dark-active);color:var(--ic-action-dark-active)}ic-input-component-container.menu-open{--border-color:var(--ic-architectural-400);color:var(--ic-action-dark)}ic-input-validation .status-icon,ic-input-validation .statustext{visibility:visible}ic-input-validation.menu-open .status-icon,ic-input-validation.menu-open .statustext{visibility:hidden;transition:visibility 0s}ic-input-label{margin-bottom:var(--ic-space-xs) !important}select{border:0;border-radius:var(--ic-border-radius);background-color:var(--ic-architectural-white);color:var(--ic-color-primary-text);line-height:1.5rem;letter-spacing:0.005rem;width:100%;height:100%;padding-left:0.375rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-repeat:no-repeat;background-position:right 0.375rem center;background-image:url("data:image/svg+xml;utf8,<svg fill=\'black\' height=\'24\' viewBox=\'0 0 24 24\' width=\'24\' xmlns=\'http://www.w3.org/2000/svg\'><path d=\'M7 10l5 5 5-5z\'/><path d=\'M0 0h24v24H0z\' fill=\'none\'/></svg>")}select option,.select-option-selected{color:var(--ic-color-primary-text)}select:disabled{color:var(--ic-architectural-200);background-image:url("data:image/svg+xml;utf8,<svg fill=\'grey\' height=\'24\' viewBox=\'0 0 24 24\' width=\'24\' xmlns=\'http://www.w3.org/2000/svg\'><path d=\'M7 10l5 5 5-5z\'/><path d=\'M0 0h24v24H0z\' fill=\'none\'/></svg>")}select:focus{border:0;outline:0}select:not([disabled]){cursor:pointer}.select-container{width:100%;display:flex;align-items:center;position:relative}.select-input{width:100%;height:100%;padding:0 0.375rem;display:flex;cursor:pointer;align-items:center;justify-content:space-between;background:none;border:none}.select-input:focus{outline:var(--ic-hc-focus-outline)}:host(:not(.disabled)) ic-input-component-container:hover .select-input{background-color:var(--ic-architectural-white)}.select-input[disabled]{pointer-events:none}:host(.searchable) .select-input{cursor:auto}.select-input.with-clear-button{padding-right:0}.value-text{max-width:calc(100% - (var(--ic-space-lg) + var(--ic-space-xxs)));box-sizing:border-box}.value-text.with-clear-button{padding-right:calc(var(--ic-space-xl) + var(--ic-space-xs))}.value-text p{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;margin-bottom:0 !important}.searchable-select-container{align-items:center;display:flex;width:100%;position:relative}.expand-icon{height:var(--ic-space-lg);padding-left:var(--ic-space-xxs);color:var(--ic-action-dark)}.expand-icon>svg{display:inline-block;width:var(--ic-space-lg);height:var(--ic-space-lg)}:host(.disabled) .expand-icon,:host(.disabled) .expand-icon>svg>path{color:var(--ic-architectural-200)}:host(.searchable) .expand-icon{padding-left:0;height:2.25rem}:host(.searchable) .expand-icon>svg{height:2.25rem;padding:0 0.375rem}:host(.searchable:not(.disabled)) .expand-icon>svg{cursor:pointer}.expand-icon-open{color:var(--ic-action-dark)}.expand-icon-open,:host(.searchable) .expand-icon-open{transform:rotateX(180deg)}:host(.disabled) .value-text,.placeholder{color:var(--ic-color-tertiary-text)}.select-input-end{display:flex;align-items:center}.clear-button-container{display:flex}.divider{width:var(--ic-space-1px);background-color:var(--ic-architectural-400);margin:var(--ic-space-xxs) 0;border-radius:var(--ic-space-1px);height:var(--ic-space-lg)}:host(.small) .divider{height:var(--ic-space-md)}:host(.large) .divider{height:var(--ic-space-xl)}.clear-button{position:absolute;right:calc(var(--ic-space-xl) + var(--ic-space-xxs));border-radius:var(--ic-border-radius);transition:box-shadow var(--ic-easing-transition),\n border-radius var(--ic-easing-transition)}.clear-button:focus{background-color:var(--ic-focus-blue);box-shadow:inset 0 0 0 0.125rem var(--ic-focus-glow);border-radius:0.25rem}.clear-button:focus *{fill:white}.clear-button.searchable{position:static}.searchable-select-results-status,.multi-select-selected-count{border:0;clip:rect(0, 0, 0, 0, 0);height:var(--ic-space-1px);overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:var(--ic-space-1px)}';let z=0;const L=class{constructor(s){t(this,s);this.icBlur=i(this,"icBlur",7);this.icChange=i(this,"icChange",7);this.icClear=i(this,"icClear",7);this.icFocus=i(this,"icFocus",7);this.icInput=i(this,"icInput",7);this.icOptionSelect=i(this,"icOptionSelect",7);this.icOptionDeselect=i(this,"icOptionDeselect",7);this.icRetryLoad=i(this,"icRetryLoad",7);this.hasSetDefaultValue=false;this.inheritedAttributes={};this.initialOptionsEmpty=false;this.inputId=`ic-select-input-${z++}`;this.menuId=`${this.inputId}-menu`;this.searchableMenuItemSelected=false;this.ungroupedOptions=[];this.handleRetry=t=>{var i;if(t.detail.keyPressed)(i=this.searchableSelectElement)===null||i===void 0?void 0:i.focus();this.blurredBecauseButtonPressed=true;this.retryButtonClick=true;this.hasSetDefaultValue=true;this.icRetryLoad.emit({value:this.hiddenInputValue})};this.emitIcChange=t=>{if(!this.searchable){if(this.multiple&&!Array.isArray(t)&&t!==null){this.handleMultipleSelectChange(t)}else{this.value=t}}clearTimeout(this.debounceIcChange);this.debounceIcChange=window.setTimeout((()=>{const i=this.multiple?this.value:t;this.icChange.emit({value:i})}),this.currDebounce)};this.emitImmediateIcChange=t=>{this.value=t;clearTimeout(this.debounceIcChange);this.icChange.emit({value:t})};this.deduplicateOptions=t=>{const i=[];const s=[];let e;t.forEach((t=>{if(t.children){e=[];t.children.forEach((t=>{if(i.includes(t.value)){console.warn(`ic-select with label ${this.label} was populated with duplicate option (value: ${t.value}) which has been removed.`)}else{i.push(t.value);e.push(t)}}));const h=Object.assign(Object.assign({},t),{children:e});s.push(h)}else{if(i.includes(t.value)){console.warn(`ic-select with label ${this.label} was populated with duplicate option (value: ${t.value}) which has been removed.`)}else{i.push(t.value);s.push(t)}}}));return s};this.setOptionsValuesFromLabels=()=>{if(this.options.length>0&&this.options.map){this.options.map((t=>{if(!t.value){t.value=t.label}}))}};this.setUngroupedOptions=t=>{this.ungroupedOptions=t.detail.options};this.setTextColor=()=>{if(this.nativeSelectElement.selectedIndex===0){this.nativeSelectElement.className="placeholder"}else{this.nativeSelectElement.className="select-option-selected"}};this.setMenuChange=t=>{if(this.open!==t){this.open=t}};this.getLabelFromValue=t=>a(t,this.uniqueOptions);this.getMultipleOptionsString=t=>{const i=t===null||t===void 0?void 0:t.map((t=>this.getLabelFromValue(t)));return i===null||i===void 0?void 0:i.join(", ")};this.getFilteredChildMenuOptions=t=>{let i=t.children;if(this.searchable){i=n(t.children,this.includeDescriptionsInSearch,this.searchableSelectInputValue,this.searchMatchPosition)}else{i=n(t.children,false,this.pressedCharacters,"start")}const s=Object.assign({},t);s.children=i;return s};this.getValueSortedByOptions=t=>{const i=t;const s=this.ungroupedOptions.map((t=>t.value));i.sort(((t,i)=>s.indexOf(t)-s.indexOf(i)));return i};this.handleNativeSelectChange=()=>{this.icOptionSelect.emit({value:this.nativeSelectElement.value});this.emitImmediateIcChange(this.nativeSelectElement.value);this.setTextColor()};this.handleCustomSelectChange=t=>{var i;const s=t.detail.value;if(this.searchable&&t.detail.label===this.emptyOptionListText){this.searchableSelectElement.focus();return}if(this.searchable){this.value=s;this.searchableMenuItemSelected=true;if(this.value===this.currValue){this.searchableSelectInputValue=this.getLabelFromValue(this.value)}this.inputValueToFilter=null;this.hiddenInputValue=this.getValueFromLabel(this.searchableSelectInputValue)}if(this.multiple&&((i=this.value)===null||i===void 0?void 0:i.includes(s))){this.icOptionDeselect.emit({value:s})}else{this.icOptionSelect.emit({value:s})}this.ariaActiveDescendant=t.detail.optionId;this.emitIcChange(s)};this.handleMultipleSelectChange=t=>{if(this.value){let i=this.value.slice();if(this.value.includes(t)){const s=i.indexOf(t);i.splice(s,1)}else{i.push(t);i=this.getValueSortedByOptions(i)}this.value=i.length===0?null:i}else{const i=[];i.push(t);this.value=i}};this.handleSelectAllChange=t=>{const i=t.detail.select;const s=this.ungroupedOptions.filter((t=>!t.disabled));const e=s.map((t=>t.value));let h;if(i){let t;if(this.value){t=e.filter((t=>this.value&&!this.value.includes(t)))}else{t=e}t.forEach((t=>this.icOptionSelect.emit({value:t})));h=e}else{this.value.forEach((t=>this.icOptionDeselect.emit({value:t})));h=null}this.emitIcChange(h)};this.handleMenuChange=t=>{this.open=t.detail.open;this.pressedCharacters="";this.searchable&&this.handleFocusIndicatorDisplay()};this.handleMenuKeyPress=t=>{t.cancelBubble=true;if(!this.multiple){this.handleCharacterKeyDown(t.detail.key)}};this.handleFocusIndicatorDisplay=()=>{const t=this.el.shadowRoot.querySelector(".focus-indicator");if(this.open){t.classList.add("focus-indicator-enabled")}else{t.classList.remove("focus-indicator-enabled")}};this.handleMouseDown=t=>{if(!this.open){t.preventDefault()}};this.isExternalFiltering=()=>this.searchable&&this.disableFilter;this.handleClick=t=>{var i;if(!this.open){if(this.isExternalFiltering()){this.menu.options=this.filteredOptions}else if(!this.hasTimedOut&&!this.loading&&!((i=this.noOptions)===null||i===void 0?void 0:i.length)&&(!this.searchable||this.searchableMenuItemSelected)){this.noOptions=null;this.menu.options=this.uniqueOptions}}if(t.detail!==0){this.menu.handleClickOpen()}};this.handleExpandIconMouseDown=t=>{if(!this.disabled){t.preventDefault();this.searchableSelectElement.focus();this.handleClick(t)}};this.handleClear=t=>{t.stopPropagation();this.hasTimedOut=false;clearTimeout(this.timeoutTimer);this.noOptions=null;this.emitImmediateIcChange(null);this.icClear.emit();if(this.searchable){this.searchableSelectElement.value=null;this.searchableSelectInputValue=null;this.filteredOptions=this.uniqueOptions;this.hiddenInputValue=null;this.searchableSelectElement.focus()}else{this.customSelectElement.focus()}};this.handleCharacterKeyDown=t=>{if(this.open&&t===" "&&this.pressedCharacters.length===0&&!this.hasTimedOut&&!this.loading){this.setMenuChange(false)}if(t.length===1&&!this.searchable){window.clearTimeout(this.characterKeyPressTimer);this.characterKeyPressTimer=window.setTimeout((()=>this.pressedCharacters=""),1e3);if(!(t===" "&&!this.pressedCharacters)){this.pressedCharacters+=t;this.handleFilter();if(!this.noOptions){this.emitImmediateIcChange(this.filteredOptions[0].value)}}}else{this.pressedCharacters=""}};this.handleNativeSelectKeyDown=t=>{if(t.key!=="Escape"&&t.key!=="Tab"||this.open){t.cancelBubble=true}this.handleCharacterKeyDown(t.key)};this.handleKeyDown=t=>{if(t.key!=="Escape"&&t.key!=="Tab"||this.open){t.cancelBubble=true}const i=t.key==="ArrowDown"||t.key==="ArrowUp";if(!this.open){if(this.isExternalFiltering()&&(t.key==="Enter"||i)){this.menu.options=this.filteredOptions}else{if(!this.hasTimedOut){this.noOptions=null;this.menu.options=this.uniqueOptions}}}if(this.open&&t.key==="Enter"){this.setMenuChange(false)}else{if(!(i&&this.noOptions!==null)){if(!(t.key===" "&&this.pressedCharacters.length>0)){this.menu.handleKeyboardOpen(t)}if(!this.multiple){this.handleCharacterKeyDown(t.key)}}}};this.handleClearButtonFocus=()=>{this.clearButtonFocused=true};this.handleClearButtonBlur=t=>{var i;const s=(i=this.menu)===null||i===void 0?void 0:i.querySelector("#retry-button");if(!(this.searchableSelectElement&&t.relatedTarget===this.searchableSelectElement)&&!(s&&t.relatedTarget===s)){this.setMenuChange(false);this.handleFocusIndicatorDisplay()}this.clearButtonFocused=false};this.handleFilter=()=>{var t;const i=this.deduplicateOptions(this.searchable?[...this.uniqueOptions]:this.ungroupedOptions);let s=false;let e=[];i.map((t=>{if(t.children)s=true}));let h;if(this.searchable){h=n(i,this.includeDescriptionsInSearch,this.inputValueToFilter,this.searchMatchPosition);this.searchableMenuItemSelected=false}else{h=n(i,false,this.pressedCharacters,"start")}if(!s&&((t=h[0])===null||t===void 0?void 0:t.label)!==this.emptyOptionListText){e=h}else if(s){i.map((t=>{if(this.includeGroupTitlesInSearch){if(h.indexOf(t)!==-1){e.push(t)}else{e.push(this.getFilteredChildMenuOptions(t))}}else{e.push(this.getFilteredChildMenuOptions(t))}}))}let a=false;if(s){a=true;e.map((t=>{if(t.children.length>0){a=false}}))}if(e.length>0&&!a){this.noOptions=null;this.filteredOptions=e}else{this.noOptions=[{label:this.emptyOptionListText,value:""}];this.filteredOptions=this.noOptions}};this.triggerLoading=()=>{this.hasTimedOut=false;this.noOptions=[{label:this.loadingLabel,value:"",loading:true}];if(this.filteredOptions!==this.noOptions&&this.searchable){this.filteredOptions=this.noOptions}else if(this.uniqueOptions!==this.noOptions&&!this.searchable){this.uniqueOptions=this.noOptions}if(this.timeout){this.timeoutTimer=window.setTimeout((()=>{this.loading=false;this.hasTimedOut=true;this.noOptions=[{label:this.loadingErrorLabel,value:"",timedOut:true}];this.filteredOptions=this.noOptions;if(!this.searchable)this.uniqueOptions=this.noOptions}),this.timeout)}};this.getValueFromLabel=t=>{var i;return(i=this.uniqueOptions.find((i=>i.label===t)))===null||i===void 0?void 0:i.value};this.handleSearchableSelectInput=t=>{this.searchableSelectInputValue=t.target.value;this.icInput.emit({value:this.searchableSelectInputValue});this.emitIcChange(this.searchableSelectInputValue);this.hiddenInputValue=this.searchableSelectInputValue;this.inputValueToFilter=this.searchableSelectInputValue;this.setMenuChange(true);if(!this.disableFilter){this.handleFilter();this.debounceAriaLiveUpdate()}};this.updateSearchableSelectResultAriaLive=()=>{const t=this.el.shadowRoot.querySelector(".searchable-select-results-status");if(t){if(this.noOptions!==null){t.innerText=this.emptyOptionListText}else{t.innerText=""}}};this.updateMultiSelectedCountAriaLive=()=>{var t;const i=this.el.shadowRoot.querySelector(".multi-select-selected-count");const s=`${(t=this.currValue)===null||t===void 0?void 0:t.length} of ${l(this.options)} selected`;if(i&&i.innerText!==s){i.innerText=s}};this.getDefaultValue=t=>this.getLabelFromValue(t)||t||null;this.setDefaultValue=()=>{if(!this.hasSetDefaultValue&&this.currValue){this.searchableSelectInputValue=this.searchable&&this.getDefaultValue(this.currValue);this.initialValue=this.currValue;this.hasSetDefaultValue=true}};this.onFocus=()=>{this.icFocus.emit()};this.onBlur=t=>{var i;const s=t.relatedTarget;if(s!==null&&s.tagName==="UL"&&s.className.includes("menu")){return}const e=(i=this.menu)===null||i===void 0?void 0:i.querySelector("#retry-button");const h=this.searchable&&t.relatedTarget!==this.menu&&!Array.from(this.menu.querySelectorAll("[role='option']")).includes(t.relatedTarget)&&!(this.clearButton&&t.relatedTarget===this.clearButton)&&!(e&&t.relatedTarget===e);if(h){if(!this.retryButtonClick){this.setMenuChange(false)}this.handleFocusIndicatorDisplay()}this.retryButtonClick=false;this.icBlur.emit()};this.onTimeoutBlur=t=>{if(t.detail.ev.relatedTarget!==this.searchableSelectElement&&!this.blurredBecauseButtonPressed){this.setMenuChange(false);this.handleFocusIndicatorDisplay();this.icBlur.emit()}this.blurredBecauseButtonPressed=false};this.handleFormReset=()=>{this.value=this.initialValue;if(this.searchable){this.searchableSelectInputValue=this.getDefaultValue(this.value);this.hiddenInputValue=this.value}};this.ariaActiveDescendant=undefined;this.clearButtonFocused=false;this.debounceIcChange=undefined;this.hiddenInputValue=undefined;this.noOptions=null;this.open=false;this.pressedCharacters="";this.searchableSelectInputValue=null;this.charactersUntilSuggestions=0;this.disabled=false;this.disableFilter=false;this.emptyOptionListText="No results found";this.form=undefined;this.formaction=undefined;this.formenctype=undefined;this.formmethod=undefined;this.formnovalidate=undefined;this.formtarget=undefined;this.fullWidth=false;this.helperText="";this.hideLabel=false;this.includeDescriptionsInSearch=false;this.includeGroupTitlesInSearch=false;this.label=undefined;this.loadingErrorLabel="Loading Error";this.loadingLabel="Loading...";this.multiple=false;this.name=this.inputId;this.placeholder="Select an option";this.readonly=false;this.required=false;this.searchable=false;this.searchMatchPosition="anywhere";this.selectOnEnter=false;this.showClearButton=false;this.size="default";this.small=false;this.timeout=undefined;this.validationStatus="";this.validationText="";this.loading=false;this.options=[];this.filteredOptions=this.options;this.uniqueOptions=this.options;this.debounce=0;this.currDebounce=this.debounce;this.value=undefined;this.initialValue=this.value;this.inputValueToFilter=this.value;this.currValue=this.value}loadingHandler(t){t&&this.triggerLoading()}watchOptionsHandler(){if(!this.hasTimedOut&&this.options!==this.noOptions){this.loading=false;clearTimeout(this.timeoutTimer);if(this.isExternalFiltering()){if(this.options.length>0){this.setOptionsValuesFromLabels();this.noOptions=null;this.uniqueOptions=this.deduplicateOptions(this.options);this.filteredOptions=this.uniqueOptions}else{this.noOptions=[{label:this.emptyOptionListText,value:""}];this.uniqueOptions=this.noOptions;this.filteredOptions=this.noOptions}this.updateSearchableSelectResultAriaLive();this.setDefaultValue()}else{this.setOptionsValuesFromLabels();this.uniqueOptions=this.deduplicateOptions(this.options);this.filteredOptions=this.uniqueOptions;if(this.initialOptionsEmpty){this.setDefaultValue();this.initialOptionsEmpty=false}}}else{if(!this.searchable)this.options=this.noOptions}}debounceChangedHandler(t){this.updateOnChangeDebounce(t)}valueChangedHandler(){if(this.value!==this.currValue){if(this.value&&this.multiple){this.currValue=this.getValueSortedByOptions(this.value);this.updateMultiSelectedCountAriaLive()}else{this.currValue=this.value}}if(this.searchable){this.searchableSelectInputValue=this.getLabelFromValue(this.currValue)||this.currValue}}disconnectedCallback(){o(this.el,this.handleFormReset)}componentWillLoad(){this.inheritedAttributes=r(this.el,[...g,"tabindex","title"]);c(this.disabled,this.el);this.setOptionsValuesFromLabels();d(this.el,this.handleFormReset);if(!this.options.length){this.initialOptionsEmpty=true;this.noOptions=[{label:this.emptyOptionListText,value:""}];this.uniqueOptions=this.noOptions;this.filteredOptions=this.noOptions}else{this.setDefaultValue();this.uniqueOptions=this.deduplicateOptions(this.options)}}componentDidLoad(){u([{prop:this.label,propName:"label"}],"Select");if(this.loading){this.triggerLoading()}this.hiddenInputValue=this.searchable&&this.currValue}componentDidRender(){if(this.nativeSelectElement&&!this.disabled){this.setTextColor()}}async setFocus(){if(this.nativeSelectElement){this.nativeSelectElement.focus()}else if(this.customSelectElement){this.customSelectElement.focus()}else if(this.searchableSelectElement){this.searchableSelectElement.focus()}}updateOnChangeDebounce(t){if(this.currDebounce!==t){this.currDebounce=t}}debounceAriaLiveUpdate(){clearTimeout(this.debounceAria);window.setTimeout((()=>{this.updateSearchableSelectResultAriaLive()}),800)}render(){const{size:t,small:i,disabled:h,fullWidth:a,helperText:n,hideLabel:o,label:r,menuId:c,multiple:d,name:u,options:g,placeholder:k,readonly:z,required:L,searchable:C,showClearButton:M,validationStatus:T,validationText:H,currValue:B}=this;p(true,this.el,u,this.searchable?this.hiddenInputValue:B,h);const O=T===w.Error?"true":"false";const $=f(this.inputId,n!=="",m(this.validationStatus,this.disabled)).trim();const D=`${B===null||B===void 0?void 0:B.length} of ${l(this.options)} selected`;return s(e,{class:{disabled:h,searchable:C,small:i,[t]:t!=="default","full-width":a},onBlur:this.onBlur},s("ic-input-container",{readonly:z},!o&&s("ic-input-label",{for:this.inputId,label:r,helperText:n,required:L,disabled:h,readonly:z}),s("ic-input-component-container",{ref:t=>this.anchorEl=t,class:{"menu-open":this.open},small:i,size:t,fullWidth:a,disabled:h,readonly:z,validationStatus:T},z?s("ic-typography",null,s("p",null,d?this.getMultipleOptionsString(B):this.getLabelFromValue(B))):b()&&!d?s("select",Object.assign({ref:t=>this.nativeSelectElement=t,disabled:h,onChange:this.handleNativeSelectChange,required:L,id:this.inputId,"aria-label":r,"aria-describedby":$,"aria-invalid":O,onBlur:this.onBlur,onFocus:this.onFocus,onKeyDown:this.handleNativeSelectKeyDown,form:this.form},this.inheritedAttributes),s("option",{value:"",selected:true,disabled:!M},k),g.map((t=>{if(t.children){return s("optgroup",{label:t.label},t.children.map((t=>s("option",{value:t.value,disabled:t.disabled,selected:t.value===B},t.label))))}else{return s("option",{value:t.value,disabled:t.disabled,selected:t.value===B},t.label)}}))):C?s("div",{class:"searchable-select-container"},s("input",{class:{"select-input":true,"with-clear-button":!!this.searchableSelectInputValue},role:"combobox",autocomplete:"off","aria-label":r,"aria-describedby":$,"aria-activedescendant":this.ariaActiveDescendant,"aria-autocomplete":"list","aria-expanded":this.open?"true":"false","aria-invalid":O,"aria-required":L?"true":"false","aria-controls":c,ref:t=>this.searchableSelectElement=t,id:this.inputId,value:this.searchableSelectInputValue,placeholder:k,disabled:h,onInput:this.handleSearchableSelectInput,onClick:this.handleClick,onKeyDown:this.handleKeyDown,onFocus:this.onFocus,onBlur:this.onBlur,form:this.form,formaction:this.formaction,formenctype:this.formenctype,formmethod:this.formmethod,formnovalidate:this.formnovalidate,formtarget:this.formtarget}),this.searchableSelectInputValue&&(M||C)&&s("div",{class:"clear-button-container"},s("ic-button",{id:"clear-button",ref:t=>this.clearButton=t,"aria-label":this.searchableSelectInputValue&&B===null?"Clear input":"Clear selection",class:"clear-button",innerHTML:y,onClick:this.handleClear,onFocus:this.handleClearButtonFocus,onBlur:this.handleClearButtonBlur,size:t,variant:"icon",appearance:this.clearButtonFocused?v.Light:v.Dark}),s("div",{class:"divider"})),s("span",{onMouseDown:this.handleExpandIconMouseDown,class:{"expand-icon":true,"expand-icon-open":this.open},innerHTML:x,"aria-hidden":"true"}),s("div",{"aria-live":"polite",role:"status",class:"searchable-select-results-status"})):s("div",{class:"select-container"},s("button",{class:"select-input",ref:t=>this.customSelectElement=t,id:this.inputId,"aria-label":`${r}, ${(d&&B?`${D}, ${this.getMultipleOptionsString(B)}`:this.getLabelFromValue(B))||k}${L?", required":""}`,"aria-describedby":$,"aria-invalid":O,"aria-haspopup":"listbox","aria-expanded":this.open?"true":"false","aria-owns":c,"aria-controls":c,disabled:h,onBlur:this.onBlur,onFocus:this.onFocus,onClick:this.handleClick,onMouseDown:this.handleMouseDown,onKeyDown:this.handleKeyDown},s("ic-typography",{variant:"body",class:{"value-text":true,"with-clear-button":B&&M,placeholder:!this.value||d&&this.value.length<1}},s("p",null,(d?this.getMultipleOptionsString(B):this.getLabelFromValue(B))||k)),s("div",{class:"select-input-end"},B&&M&&s("div",{class:"divider"}),s("span",{class:{"expand-icon":true,"expand-icon-open":this.open},innerHTML:x,"aria-hidden":"true"}))),B&&M&&s("ic-button",{id:"clear-button","aria-label":"Clear selection",class:"clear-button",innerHTML:y,onClick:this.handleClear,onFocus:this.handleClearButtonFocus,onBlur:this.handleClearButtonBlur,size:t,variant:"icon",appearance:this.clearButtonFocused?v.Light:v.Dark}))),(!b()||d)&&s("ic-menu-with-multi",{class:{"no-results":this.loading||this.hasTimedOut||this.noOptions!==null&&this.noOptions[0]&&this.noOptions[0].label===this.emptyOptionListText},ref:t=>this.menu=t,inputEl:C?this.searchableSelectElement:this.customSelectElement,inputLabel:r,anchorEl:this.anchorEl,small:i,size:t,menuId:c,open:this.open,options:C?this.filteredOptions:this.uniqueOptions,value:d?B:B,fullWidth:a,selectOnEnter:this.selectOnEnter,onMenuStateChange:this.handleMenuChange,onMenuOptionSelect:this.handleCustomSelectChange,onMenuOptionSelectAll:this.handleSelectAllChange,onMenuKeyPress:this.handleMenuKeyPress,onUngroupedOptionsSet:this.setUngroupedOptions,onRetryButtonClicked:this.handleRetry,parentEl:this.el,onTimeoutBlur:this.onTimeoutBlur,activationType:this.searchable||d||this.selectOnEnter?"manual":"automatic",closeOnSelect:!d}),this.multiple&&s("div",{"aria-live":"polite",role:"status",class:"multi-select-selected-count"}),m(this.validationStatus,this.disabled)&&s("ic-input-validation",{class:{"menu-open":this.open},ariaLiveMode:"polite",status:T,message:H,for:this.inputId})))}static get delegatesFocus(){return true}get el(){return h(this)}static get watchers(){return{loading:["loadingHandler"],options:["watchOptionsHandler"],debounce:["debounceChangedHandler"],value:["valueChangedHandler"]}}};L.style=k;export{L as ic_select_with_multi};
2
- //# sourceMappingURL=p-57043b1e.entry.js.map
1
+ import{r as t,c as i,h as s,H as e,g as h}from"./p-8455d1bb.js";import{k as a,l as n,m as l,n as o,q as r,r as c,t as d,o as u,u as p,v as f,w as b,I as v,x as m,y as g,z as w}from"./p-297e99cf.js";const x=`<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n<path d="M7 9.5L12 14.5L17 9.5H7Z" fill="currentColor" />\n</svg>\n`;const y=`<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">\n<path d="M12.6666 4.27334L11.7266 3.33334L7.99998 7.06001L4.27331 3.33334L3.33331 4.27334L7.05998 8.00001L3.33331 11.7267L4.27331 12.6667L7.99998 8.94001L11.7266 12.6667L12.6666 11.7267L8.93998 8.00001L12.6666 4.27334Z" fill="currentColor" />\n</svg>\n`;const k='/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0;}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px;}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block;position:relative;--menu-max-height:100px}:host(.full-width){width:100%}ic-input-component-container:hover{--border-color:var(--ic-action-dark-hover)}ic-input-component-container:active{--border-color:var(--ic-action-dark-active);color:var(--ic-action-dark-active)}ic-input-component-container.menu-open{--border-color:var(--ic-architectural-400);color:var(--ic-action-dark)}ic-input-validation .status-icon,ic-input-validation .statustext{visibility:visible}ic-input-validation.menu-open .status-icon,ic-input-validation.menu-open .statustext{visibility:hidden;transition:visibility 0s}ic-input-label{margin-bottom:var(--ic-space-xs) !important}select{border:0;border-radius:var(--ic-border-radius);background-color:var(--ic-architectural-white);color:var(--ic-color-primary-text);line-height:1.5rem;letter-spacing:0.005rem;width:100%;height:100%;padding-left:0.375rem;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-repeat:no-repeat;background-position:right 0.375rem center;background-image:url("data:image/svg+xml;utf8,<svg fill=\'black\' height=\'24\' viewBox=\'0 0 24 24\' width=\'24\' xmlns=\'http://www.w3.org/2000/svg\'><path d=\'M7 10l5 5 5-5z\'/><path d=\'M0 0h24v24H0z\' fill=\'none\'/></svg>")}select option,.select-option-selected{color:var(--ic-color-primary-text)}select:disabled{color:var(--ic-architectural-200);background-image:url("data:image/svg+xml;utf8,<svg fill=\'grey\' height=\'24\' viewBox=\'0 0 24 24\' width=\'24\' xmlns=\'http://www.w3.org/2000/svg\'><path d=\'M7 10l5 5 5-5z\'/><path d=\'M0 0h24v24H0z\' fill=\'none\'/></svg>")}select:focus{border:0;outline:0}select:not([disabled]){cursor:pointer}.select-container{width:100%;display:flex;align-items:center;position:relative}.select-input{width:100%;height:100%;padding:0 0.375rem;display:flex;cursor:pointer;align-items:center;justify-content:space-between;background:none;border:none}.select-input:focus{outline:var(--ic-hc-focus-outline)}:host(:not(.disabled)) ic-input-component-container:hover .select-input{background-color:var(--ic-architectural-white)}.select-input[disabled]{pointer-events:none}:host(.searchable) .select-input{cursor:auto}.select-input.with-clear-button{padding-right:0}.value-text{max-width:calc(100% - (var(--ic-space-lg) + var(--ic-space-xxs)));box-sizing:border-box}.value-text.with-clear-button{padding-right:calc(var(--ic-space-xl) + var(--ic-space-xs))}.value-text p{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;margin-bottom:0 !important}.searchable-select-container{align-items:center;display:flex;width:100%;position:relative}.expand-icon{height:var(--ic-space-lg);padding-left:var(--ic-space-xxs);color:var(--ic-action-dark)}.expand-icon>svg{display:inline-block;width:var(--ic-space-lg);height:var(--ic-space-lg)}:host(.disabled) .expand-icon,:host(.disabled) .expand-icon>svg>path{color:var(--ic-architectural-200)}:host(.searchable) .expand-icon{padding-left:0;height:2.25rem}:host(.searchable) .expand-icon>svg{height:2.25rem;padding:0 0.375rem}:host(.searchable:not(.disabled)) .expand-icon>svg{cursor:pointer}.expand-icon-open{color:var(--ic-action-dark)}.expand-icon-open,:host(.searchable) .expand-icon-open{transform:rotateX(180deg)}:host(.disabled) .value-text,.placeholder{color:var(--ic-color-tertiary-text)}.select-input-end{display:flex;align-items:center}.clear-button-container{display:flex}.divider{width:var(--ic-space-1px);background-color:var(--ic-architectural-400);margin:var(--ic-space-xxs) 0;border-radius:var(--ic-space-1px);height:var(--ic-space-lg)}:host(.small) .divider{height:var(--ic-space-md)}:host(.large) .divider{height:var(--ic-space-xl)}.clear-button{position:absolute;right:calc(var(--ic-space-xl) + var(--ic-space-xxs));border-radius:var(--ic-border-radius);transition:box-shadow var(--ic-easing-transition),\n border-radius var(--ic-easing-transition)}.clear-button:focus{background-color:var(--ic-focus-blue);box-shadow:inset 0 0 0 0.125rem var(--ic-focus-glow);border-radius:0.25rem}.clear-button:focus *{fill:white}.clear-button.searchable{position:static}.searchable-select-results-status,.multi-select-selected-count{border:0;clip:rect(0, 0, 0, 0, 0);height:var(--ic-space-1px);overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:var(--ic-space-1px)}';let z=0;const L=class{constructor(s){t(this,s);this.icBlur=i(this,"icBlur",7);this.icChange=i(this,"icChange",7);this.icClear=i(this,"icClear",7);this.icFocus=i(this,"icFocus",7);this.icInput=i(this,"icInput",7);this.icOptionSelect=i(this,"icOptionSelect",7);this.icOptionDeselect=i(this,"icOptionDeselect",7);this.icRetryLoad=i(this,"icRetryLoad",7);this.hasSetDefaultValue=false;this.inheritedAttributes={};this.initialOptionsEmpty=false;this.inputId=`ic-select-input-${z++}`;this.menuId=`${this.inputId}-menu`;this.searchableMenuItemSelected=false;this.ungroupedOptions=[];this.handleRetry=t=>{var i;if(t.detail.keyPressed)(i=this.searchableSelectElement)===null||i===void 0?void 0:i.focus();this.blurredBecauseButtonPressed=true;this.retryButtonClick=true;this.hasSetDefaultValue=true;this.icRetryLoad.emit({value:this.hiddenInputValue})};this.emitIcChange=t=>{if(!this.searchable){if(this.multiple&&!Array.isArray(t)&&t!==null){this.handleMultipleSelectChange(t)}else{this.value=t}}clearTimeout(this.debounceIcChange);this.debounceIcChange=window.setTimeout((()=>{const i=this.multiple?this.value:t;this.icChange.emit({value:i})}),this.currDebounce)};this.emitImmediateIcChange=t=>{this.value=t;clearTimeout(this.debounceIcChange);this.icChange.emit({value:t})};this.deduplicateOptions=t=>{const i=[];const s=[];let e;t.forEach((t=>{if(t.children){e=[];t.children.forEach((t=>{if(i.includes(t.value)){console.warn(`ic-select with label ${this.label} was populated with duplicate option (value: ${t.value}) which has been removed.`)}else{i.push(t.value);e.push(t)}}));const h=Object.assign(Object.assign({},t),{children:e});s.push(h)}else{if(i.includes(t.value)){console.warn(`ic-select with label ${this.label} was populated with duplicate option (value: ${t.value}) which has been removed.`)}else{i.push(t.value);s.push(t)}}}));return s};this.setOptionsValuesFromLabels=()=>{if(this.options.length>0&&this.options.map){this.options.map((t=>{if(!t.value){t.value=t.label}}))}};this.setUngroupedOptions=t=>{this.ungroupedOptions=t.detail.options};this.setTextColor=()=>{if(this.nativeSelectElement.selectedIndex===0){this.nativeSelectElement.className="placeholder"}else{this.nativeSelectElement.className="select-option-selected"}};this.setMenuChange=t=>{if(this.open!==t){this.open=t}};this.getLabelFromValue=t=>a(t,this.uniqueOptions);this.getMultipleOptionsString=t=>{const i=t===null||t===void 0?void 0:t.map((t=>this.getLabelFromValue(t)));return i===null||i===void 0?void 0:i.join(", ")};this.getFilteredChildMenuOptions=t=>{let i=t.children;if(this.searchable){i=n(t.children,this.includeDescriptionsInSearch,this.searchableSelectInputValue,this.searchMatchPosition)}else{i=n(t.children,false,this.pressedCharacters,"start")}const s=Object.assign({},t);s.children=i;return s};this.getValueSortedByOptions=t=>{const i=t;const s=this.ungroupedOptions.map((t=>t.value));i.sort(((t,i)=>s.indexOf(t)-s.indexOf(i)));return i};this.handleNativeSelectChange=()=>{this.icOptionSelect.emit({value:this.nativeSelectElement.value});this.emitImmediateIcChange(this.nativeSelectElement.value);this.setTextColor()};this.handleCustomSelectChange=t=>{var i;const s=t.detail.value;if(this.searchable&&t.detail.label===this.emptyOptionListText){this.searchableSelectElement.focus();return}if(this.searchable){this.value=s;this.searchableMenuItemSelected=true;if(this.value===this.currValue){this.searchableSelectInputValue=this.getLabelFromValue(this.value)}this.inputValueToFilter=null;this.hiddenInputValue=this.getValueFromLabel(this.searchableSelectInputValue)}if(this.multiple&&((i=this.value)===null||i===void 0?void 0:i.includes(s))){this.icOptionDeselect.emit({value:s})}else{this.icOptionSelect.emit({value:s})}this.ariaActiveDescendant=t.detail.optionId;this.emitIcChange(s)};this.handleMultipleSelectChange=t=>{if(this.value){let i=this.value.slice();if(this.value.includes(t)){const s=i.indexOf(t);i.splice(s,1)}else{i.push(t);i=this.getValueSortedByOptions(i)}this.value=i.length===0?null:i}else{const i=[];i.push(t);this.value=i}};this.handleSelectAllChange=t=>{const i=t.detail.select;const s=this.ungroupedOptions.filter((t=>!t.disabled));const e=s.map((t=>t.value));let h;if(i){let t;if(this.value){t=e.filter((t=>this.value&&!this.value.includes(t)))}else{t=e}t.forEach((t=>this.icOptionSelect.emit({value:t})));h=e}else{this.value.forEach((t=>this.icOptionDeselect.emit({value:t})));h=null}this.emitIcChange(h)};this.handleMenuChange=t=>{this.open=t.detail.open;this.pressedCharacters="";this.searchable&&this.handleFocusIndicatorDisplay()};this.handleMenuKeyPress=t=>{t.cancelBubble=true;if(!this.multiple){this.handleCharacterKeyDown(t.detail.key)}};this.handleFocusIndicatorDisplay=()=>{const t=this.el.shadowRoot.querySelector(".focus-indicator");if(this.open){t.classList.add("focus-indicator-enabled")}else{t.classList.remove("focus-indicator-enabled")}};this.handleMouseDown=t=>{if(!this.open){t.preventDefault()}};this.isExternalFiltering=()=>this.searchable&&this.disableFilter;this.handleClick=t=>{var i;if(!this.open){if(this.isExternalFiltering()){this.menu.options=this.filteredOptions}else if(!this.hasTimedOut&&!this.loading&&!((i=this.noOptions)===null||i===void 0?void 0:i.length)&&(!this.searchable||this.searchableMenuItemSelected)){this.noOptions=null;this.menu.options=this.uniqueOptions}}if(t.detail!==0){this.menu.handleClickOpen()}};this.handleExpandIconMouseDown=t=>{if(!this.disabled){t.preventDefault();this.searchableSelectElement.focus();this.handleClick(t)}};this.handleClear=t=>{t.stopPropagation();this.hasTimedOut=false;clearTimeout(this.timeoutTimer);this.noOptions=null;this.emitImmediateIcChange(null);this.icClear.emit();if(this.searchable){this.searchableSelectElement.value=null;this.searchableSelectInputValue=null;this.filteredOptions=this.uniqueOptions;this.hiddenInputValue=null;this.searchableSelectElement.focus()}else{this.customSelectElement.focus()}};this.handleCharacterKeyDown=t=>{if(this.open&&t===" "&&this.pressedCharacters.length===0&&!this.hasTimedOut&&!this.loading){this.setMenuChange(false)}if(t.length===1&&!this.searchable){window.clearTimeout(this.characterKeyPressTimer);this.characterKeyPressTimer=window.setTimeout((()=>this.pressedCharacters=""),1e3);if(!(t===" "&&!this.pressedCharacters)){this.pressedCharacters+=t;this.handleFilter();if(!this.noOptions){this.emitImmediateIcChange(this.filteredOptions[0].value)}}}else{this.pressedCharacters=""}};this.handleNativeSelectKeyDown=t=>{if(t.key!=="Escape"&&t.key!=="Tab"||this.open){t.cancelBubble=true}this.handleCharacterKeyDown(t.key)};this.handleKeyDown=t=>{if(t.key!=="Escape"&&t.key!=="Tab"||this.open){t.cancelBubble=true}const i=t.key==="ArrowDown"||t.key==="ArrowUp";if(!this.open){if(this.isExternalFiltering()&&(t.key==="Enter"||i)){this.menu.options=this.filteredOptions}else{if(!this.hasTimedOut){this.noOptions=null;this.menu.options=this.uniqueOptions}}}if(this.open&&t.key==="Enter"){this.setMenuChange(false)}else{if(!(i&&this.noOptions!==null)){if(!(t.key===" "&&this.pressedCharacters.length>0)){this.menu.handleKeyboardOpen(t)}if(!this.multiple){this.handleCharacterKeyDown(t.key)}}}};this.handleClearButtonFocus=()=>{this.clearButtonFocused=true};this.handleClearButtonBlur=t=>{var i;const s=(i=this.menu)===null||i===void 0?void 0:i.querySelector("#retry-button");if(!(this.searchableSelectElement&&t.relatedTarget===this.searchableSelectElement)&&!(s&&t.relatedTarget===s)){this.setMenuChange(false);this.handleFocusIndicatorDisplay()}this.clearButtonFocused=false};this.handleFilter=()=>{var t;const i=this.deduplicateOptions(this.searchable?[...this.uniqueOptions]:this.ungroupedOptions);let s=false;let e=[];i.map((t=>{if(t.children)s=true}));let h;if(this.searchable){h=n(i,this.includeDescriptionsInSearch,this.inputValueToFilter,this.searchMatchPosition);this.searchableMenuItemSelected=false}else{h=n(i,false,this.pressedCharacters,"start")}if(!s&&((t=h[0])===null||t===void 0?void 0:t.label)!==this.emptyOptionListText){e=h}else if(s){i.map((t=>{if(this.includeGroupTitlesInSearch){if(h.indexOf(t)!==-1){e.push(t)}else{e.push(this.getFilteredChildMenuOptions(t))}}else{e.push(this.getFilteredChildMenuOptions(t))}}))}let a=false;if(s){a=true;e.map((t=>{if(t.children.length>0){a=false}}))}if(e.length>0&&!a){this.noOptions=null;this.filteredOptions=e}else{this.noOptions=[{label:this.emptyOptionListText,value:""}];this.filteredOptions=this.noOptions}};this.triggerLoading=()=>{this.hasTimedOut=false;this.noOptions=[{label:this.loadingLabel,value:"",loading:true}];if(this.filteredOptions!==this.noOptions&&this.searchable){this.filteredOptions=this.noOptions}else if(this.uniqueOptions!==this.noOptions&&!this.searchable){this.uniqueOptions=this.noOptions}if(this.timeout){this.timeoutTimer=window.setTimeout((()=>{this.loading=false;this.hasTimedOut=true;this.noOptions=[{label:this.loadingErrorLabel,value:"",timedOut:true}];this.filteredOptions=this.noOptions;if(!this.searchable)this.uniqueOptions=this.noOptions}),this.timeout)}};this.getValueFromLabel=t=>{var i;return(i=this.uniqueOptions.find((i=>i.label===t)))===null||i===void 0?void 0:i.value};this.handleSearchableSelectInput=t=>{this.searchableSelectInputValue=t.target.value;this.icInput.emit({value:this.searchableSelectInputValue});this.emitIcChange(this.searchableSelectInputValue);this.hiddenInputValue=this.searchableSelectInputValue;this.inputValueToFilter=this.searchableSelectInputValue;this.setMenuChange(true);if(!this.disableFilter){this.handleFilter();this.debounceAriaLiveUpdate()}};this.updateSearchableSelectResultAriaLive=()=>{const t=this.el.shadowRoot.querySelector(".searchable-select-results-status");if(t){if(this.noOptions!==null){t.innerText=this.emptyOptionListText}else{t.innerText=""}}};this.updateMultiSelectedCountAriaLive=()=>{var t;const i=this.el.shadowRoot.querySelector(".multi-select-selected-count");const s=`${(t=this.currValue)===null||t===void 0?void 0:t.length} of ${l(this.options)} selected`;if(i&&i.innerText!==s){i.innerText=s}};this.getDefaultValue=t=>this.getLabelFromValue(t)||t||null;this.setDefaultValue=()=>{if(!this.hasSetDefaultValue&&this.currValue){this.searchableSelectInputValue=this.searchable&&this.getDefaultValue(this.currValue);this.initialValue=this.currValue;this.hasSetDefaultValue=true}};this.onFocus=()=>{this.icFocus.emit()};this.onBlur=t=>{var i;const s=t.relatedTarget;if(s!==null&&s.tagName==="UL"&&s.className.includes("menu")){return}const e=(i=this.menu)===null||i===void 0?void 0:i.querySelector("#retry-button");const h=this.searchable&&t.relatedTarget!==this.menu&&!Array.from(this.menu.querySelectorAll("[role='option']")).includes(t.relatedTarget)&&!(this.clearButton&&t.relatedTarget===this.clearButton)&&!(e&&t.relatedTarget===e);if(h){if(!this.retryButtonClick){this.setMenuChange(false)}this.handleFocusIndicatorDisplay()}this.retryButtonClick=false;this.icBlur.emit()};this.onTimeoutBlur=t=>{if(t.detail.ev.relatedTarget!==this.searchableSelectElement&&!this.blurredBecauseButtonPressed){this.setMenuChange(false);this.handleFocusIndicatorDisplay();this.icBlur.emit()}this.blurredBecauseButtonPressed=false};this.handleFormReset=()=>{this.value=this.initialValue;if(this.searchable){this.searchableSelectInputValue=this.getDefaultValue(this.value);this.hiddenInputValue=this.value}};this.ariaActiveDescendant=undefined;this.clearButtonFocused=false;this.debounceIcChange=undefined;this.hiddenInputValue=undefined;this.noOptions=null;this.open=false;this.pressedCharacters="";this.searchableSelectInputValue=null;this.charactersUntilSuggestions=0;this.disabled=false;this.disableFilter=false;this.emptyOptionListText="No results found";this.form=undefined;this.formaction=undefined;this.formenctype=undefined;this.formmethod=undefined;this.formnovalidate=undefined;this.formtarget=undefined;this.fullWidth=false;this.helperText="";this.hideLabel=false;this.includeDescriptionsInSearch=false;this.includeGroupTitlesInSearch=false;this.label=undefined;this.loadingErrorLabel="Loading Error";this.loadingLabel="Loading...";this.multiple=false;this.name=this.inputId;this.placeholder="Select an option";this.readonly=false;this.required=false;this.searchable=false;this.searchMatchPosition="anywhere";this.selectOnEnter=false;this.showClearButton=false;this.size="default";this.small=false;this.timeout=undefined;this.validationStatus="";this.validationText="";this.loading=false;this.options=[];this.filteredOptions=this.options;this.uniqueOptions=this.options;this.debounce=0;this.currDebounce=this.debounce;this.value=undefined;this.initialValue=this.value;this.inputValueToFilter=this.value;this.currValue=this.value}loadingHandler(t){t&&this.triggerLoading()}watchOptionsHandler(){if(!this.hasTimedOut&&this.options!==this.noOptions){this.loading=false;clearTimeout(this.timeoutTimer);if(this.isExternalFiltering()){if(this.options.length>0){this.setOptionsValuesFromLabels();this.noOptions=null;this.uniqueOptions=this.deduplicateOptions(this.options);this.filteredOptions=this.uniqueOptions}else{this.noOptions=[{label:this.emptyOptionListText,value:""}];this.uniqueOptions=this.noOptions;this.filteredOptions=this.noOptions}this.updateSearchableSelectResultAriaLive();this.setDefaultValue()}else{this.setOptionsValuesFromLabels();this.uniqueOptions=this.deduplicateOptions(this.options);this.filteredOptions=this.uniqueOptions;if(this.initialOptionsEmpty){this.setDefaultValue();this.initialOptionsEmpty=false}}}else{if(!this.searchable)this.options=this.noOptions}}debounceChangedHandler(t){this.updateOnChangeDebounce(t)}valueChangedHandler(){if(this.value!==this.currValue){if(this.value&&this.multiple){this.currValue=this.getValueSortedByOptions(this.value);this.updateMultiSelectedCountAriaLive()}else{this.currValue=this.value}}if(this.searchable){this.searchableSelectInputValue=this.getLabelFromValue(this.currValue)||this.currValue}}disconnectedCallback(){o(this.el,this.handleFormReset)}componentWillLoad(){this.inheritedAttributes=r(this.el,[...g,"tabindex","title"]);c(this.disabled,this.el);this.setOptionsValuesFromLabels();d(this.el,this.handleFormReset);if(!this.options.length){this.initialOptionsEmpty=true;this.noOptions=[{label:this.emptyOptionListText,value:""}];this.uniqueOptions=this.noOptions;this.filteredOptions=this.noOptions}else{this.setDefaultValue();this.uniqueOptions=this.deduplicateOptions(this.options)}}componentDidLoad(){u([{prop:this.label,propName:"label"}],"Select");if(this.loading){this.triggerLoading()}this.hiddenInputValue=this.searchable&&this.currValue}componentDidRender(){if(this.nativeSelectElement&&!this.disabled){this.setTextColor()}}async setFocus(){if(this.nativeSelectElement){this.nativeSelectElement.focus()}else if(this.customSelectElement){this.customSelectElement.focus()}else if(this.searchableSelectElement){this.searchableSelectElement.focus()}}updateOnChangeDebounce(t){if(this.currDebounce!==t){this.currDebounce=t}}debounceAriaLiveUpdate(){clearTimeout(this.debounceAria);window.setTimeout((()=>{this.updateSearchableSelectResultAriaLive()}),800)}render(){const{size:t,small:i,disabled:h,fullWidth:a,helperText:n,hideLabel:o,label:r,menuId:c,multiple:d,name:u,options:g,placeholder:k,readonly:z,required:L,searchable:C,showClearButton:M,validationStatus:T,validationText:H,currValue:B}=this;p(true,this.el,u,this.searchable?this.hiddenInputValue:B,h);const O=T===w.Error?"true":"false";const $=f(this.inputId,n!=="",m(this.validationStatus,this.disabled)).trim();const D=`${B===null||B===void 0?void 0:B.length} of ${l(this.options)} selected`;return s(e,{class:{disabled:h,searchable:C,small:i,[t]:t!=="default","full-width":a},onBlur:this.onBlur},s("ic-input-container",{readonly:z},!o&&s("ic-input-label",{for:this.inputId,label:r,helperText:n,required:L,disabled:h,readonly:z}),s("ic-input-component-container",{ref:t=>this.anchorEl=t,class:{"menu-open":this.open},small:i,size:t,fullWidth:a,disabled:h,readonly:z,validationStatus:T},z?s("ic-typography",null,s("p",null,d?this.getMultipleOptionsString(B):this.getLabelFromValue(B))):b()&&!d?s("select",Object.assign({ref:t=>this.nativeSelectElement=t,disabled:h,onChange:this.handleNativeSelectChange,required:L,id:this.inputId,"aria-label":r,"aria-describedby":$,"aria-invalid":O,onBlur:this.onBlur,onFocus:this.onFocus,onKeyDown:this.handleNativeSelectKeyDown,form:this.form},this.inheritedAttributes),s("option",{value:"",selected:true,disabled:!M},k),g.map((t=>{if(t.children){return s("optgroup",{label:t.label},t.children.map((t=>s("option",{value:t.value,disabled:t.disabled,selected:t.value===B},t.label))))}else{return s("option",{value:t.value,disabled:t.disabled,selected:t.value===B},t.label)}}))):C?s("div",{class:"searchable-select-container"},s("input",{class:{"select-input":true,"with-clear-button":!!this.searchableSelectInputValue},role:"combobox",autocomplete:"off","aria-label":r,"aria-describedby":$,"aria-activedescendant":this.ariaActiveDescendant,"aria-autocomplete":"list","aria-expanded":this.open?"true":"false","aria-invalid":O,"aria-required":L?"true":"false","aria-controls":c,ref:t=>this.searchableSelectElement=t,id:this.inputId,value:this.searchableSelectInputValue,placeholder:k,disabled:h,onInput:this.handleSearchableSelectInput,onClick:this.handleClick,onKeyDown:this.handleKeyDown,onFocus:this.onFocus,onBlur:this.onBlur,form:this.form,formaction:this.formaction,formenctype:this.formenctype,formmethod:this.formmethod,formnovalidate:this.formnovalidate,formtarget:this.formtarget}),this.searchableSelectInputValue&&(M||C)&&s("div",{class:"clear-button-container"},s("ic-button",{id:"clear-button",ref:t=>this.clearButton=t,"aria-label":this.searchableSelectInputValue&&B===null?"Clear input":"Clear selection",class:"clear-button",innerHTML:y,onClick:this.handleClear,onFocus:this.handleClearButtonFocus,onBlur:this.handleClearButtonBlur,size:t,variant:"icon",appearance:this.clearButtonFocused?v.Light:v.Dark}),s("div",{class:"divider"})),s("span",{onMouseDown:this.handleExpandIconMouseDown,class:{"expand-icon":true,"expand-icon-open":this.open},innerHTML:x,"aria-hidden":"true"}),s("div",{"aria-live":"polite",role:"status",class:"searchable-select-results-status"})):s("div",{class:"select-container"},s("button",{class:"select-input",ref:t=>this.customSelectElement=t,id:this.inputId,"aria-label":`${r}, ${(d&&B?`${D}, ${this.getMultipleOptionsString(B)}`:this.getLabelFromValue(B))||k}${L?", required":""}`,"aria-describedby":$,"aria-invalid":O,"aria-haspopup":"listbox","aria-expanded":this.open?"true":"false","aria-owns":c,"aria-controls":c,disabled:h,onBlur:this.onBlur,onFocus:this.onFocus,onClick:this.handleClick,onMouseDown:this.handleMouseDown,onKeyDown:this.handleKeyDown},s("ic-typography",{variant:"body",class:{"value-text":true,"with-clear-button":B&&M,placeholder:!this.value||d&&this.value.length<1}},s("p",null,(d?this.getMultipleOptionsString(B):this.getLabelFromValue(B))||k)),s("div",{class:"select-input-end"},B&&M&&s("div",{class:"divider"}),s("span",{class:{"expand-icon":true,"expand-icon-open":this.open},innerHTML:x,"aria-hidden":"true"}))),B&&M&&s("ic-button",{id:"clear-button","aria-label":"Clear selection",class:"clear-button",innerHTML:y,onClick:this.handleClear,onFocus:this.handleClearButtonFocus,onBlur:this.handleClearButtonBlur,size:t,variant:"icon",appearance:this.clearButtonFocused?v.Light:v.Dark}))),(!b()||d)&&s("ic-menu-with-multi",{class:{"no-results":this.loading||this.hasTimedOut||this.noOptions!==null&&this.noOptions[0]&&this.noOptions[0].label===this.emptyOptionListText},ref:t=>this.menu=t,inputEl:C?this.searchableSelectElement:this.customSelectElement,inputLabel:r,anchorEl:this.anchorEl,small:i,size:t,menuId:c,open:this.open,options:C?this.filteredOptions:this.uniqueOptions,value:d?B:B,fullWidth:a,selectOnEnter:this.selectOnEnter,onMenuStateChange:this.handleMenuChange,onMenuOptionSelect:this.handleCustomSelectChange,onMenuOptionSelectAll:this.handleSelectAllChange,onMenuKeyPress:this.handleMenuKeyPress,onUngroupedOptionsSet:this.setUngroupedOptions,onRetryButtonClicked:this.handleRetry,parentEl:this.el,onTimeoutBlur:this.onTimeoutBlur,activationType:this.searchable||d||this.selectOnEnter?"manual":"automatic",closeOnSelect:!d}),this.multiple&&s("div",{"aria-live":"polite",role:"status",class:"multi-select-selected-count"}),m(this.validationStatus,this.disabled)&&s("ic-input-validation",{class:{"menu-open":this.open},ariaLiveMode:"polite",status:T,message:H,for:this.inputId})))}static get delegatesFocus(){return true}get el(){return h(this)}static get watchers(){return{loading:["loadingHandler"],options:["watchOptionsHandler"],debounce:["debounceChangedHandler"],value:["valueChangedHandler"]}}};L.style=k;export{L as ic_select_with_multi};
2
+ //# sourceMappingURL=p-c6bdbe69.entry.js.map
@@ -1,2 +1,2 @@
1
- import{r as t,f as i,h as e,H as a,g as s,c as n}from"./p-8455d1bb.js";import{j as l,i as h,a as o}from"./p-8128572e.js";import{C as r,D as c}from"./p-adbe0d89.js";import"./p-fd186591.js";const p=":host{gap:var(--ic-space-xs);padding:var(--ic-space-xs)}:host,.action-area{display:flex;flex-direction:column}.action-area{gap:var(--ic-space-md)}:host ::slotted(svg),:host ::slotted(img){border-radius:var(--ic-space-xxs)}:host(.right),:host(.right) .action-area{align-items:flex-end;text-align:right}:host(.center),:host(.center) .action-area{align-items:center;text-align:center}:host(.image-default) ::slotted(svg),:host(.image-default) ::slotted(img){height:calc(3 * var(--ic-space-lg)) !important;width:calc(3 * var(--ic-space-lg)) !important}:host(.image-small) ::slotted(svg),:host(.image-small) ::slotted(img){height:var(--ic-space-xxl) !important;width:var(--ic-space-xxl) !important}:host(.image-large) ::slotted(svg),:host(.image-large) ::slotted(img){height:calc(4 * var(--ic-space-xl)) !important;width:calc(4 * var(--ic-space-xl)) !important}";const g=class{constructor(e){t(this,e);this.hostMutationObserver=null;this.hostMutationCallback=t=>{if(t.some((({type:t,addedNodes:i,removedNodes:e})=>t==="childList"?l(i,e,["image","actions"]):false))){i(this)}};this.aligned="left";this.body=undefined;this.bodyMaxLines=undefined;this.heading=undefined;this.imageSize="default";this.subheading=undefined}disconnectedCallback(){var t;(t=this.hostMutationObserver)===null||t===void 0?void 0:t.disconnect()}componentDidLoad(){!h(this.el,"heading")&&o([{prop:this.heading,propName:"heading"}],"Empty State");this.hostMutationObserver=new MutationObserver(this.hostMutationCallback);this.hostMutationObserver.observe(this.el,{childList:true})}render(){const{aligned:t,body:i,bodyMaxLines:s,heading:n,imageSize:l,subheading:o}=this;return e(a,{class:{[`${t}`]:true,[`image-${l}`]:h(this.el,"image")}},h(this.el,"image")&&e("slot",{name:"image"}),e("div",null,e("slot",{name:"heading"},e("ic-typography",{variant:"h4"},n)),e("slot",{name:"subheading"},e("ic-typography",{variant:"subtitle-small"},o)),e("slot",{name:"body"},e("ic-typography",{maxLines:s},i))),h(this.el,"actions")&&e("div",{class:"action-area"},e("slot",{name:"actions"})))}get el(){return s(this)}};g.style=p;const d=":host(){display:block}.pagination-bar{height:3.5rem;display:flex;align-items:center;justify-content:flex-end;gap:var(--ic-space-xl);padding:var(--ic-space-xs) var(--ic-space-md);box-sizing:border-box}.pagination-bar-left{justify-content:flex-start}.item-controls{display:flex;align-items:center;gap:var(--ic-space-xl)}.pagination-bar-space-between .item-controls{margin-right:auto}.items-per-page-holder{display:flex;align-items:center;gap:var(--ic-space-xs)}.items-per-page-input{--input-width:5rem}.pagination-controls{display:flex;align-items:center;gap:var(--ic-space-xl)}.pagination-controls-wrap{flex-direction:column;align-items:flex-end;gap:var(--ic-space-xs)}.pagination-bar-space-between .pagination-controls{margin-left:auto}.go-to-page-holder{display:flex;align-items:center;gap:var(--ic-space-xs)}.go-to-page-input{--input-width:var(--ic-space-xl)}.go-to-page-button{--min-width:var(--ic-space-xl)}.pagination-text-default,.pagination-text-dark,.pagination-text-light{white-space:nowrap}.pagination-text-light{color:var(--ic-color-white-text)}@media screen and (max-width: 768px){.pagination-bar{flex-direction:column;align-items:flex-end;height:-moz-fit-content;height:fit-content;gap:var(--ic-space-xs)}.pagination-bar-left{align-items:flex-start}}@media screen and (max-width: 320px){.item-controls,.pagination-controls{flex-direction:column;align-items:flex-end;gap:var(--ic-space-xs)}.pagination-bar-left .item-controls,.pagination-bar-left .pagination-controls,.pagination-bar-space-between .item-controls,.pagination-bar-space-between .pagination-controls{align-items:flex-start}}";const m=class{constructor(i){t(this,i);this.icPageChange=n(this,"icPageChange",7);this.icItemsPerPageChange=n(this,"icItemsPerPageChange",7);this.PAGE_INPUT_FIELD_ID="go-to-page-input";this.INVALID_PAGE_ERROR="Please enter a valid page";this.resizeObserver=null;this.changeItemsPerPage=()=>{this.setItemsPerPage(Number(this.pageDropdownEl.value))};this.changePage=t=>{this.currentPage=t;this.lowerBound=t!==1?(t-1)*this.itemsPerPage+1:t;this.setUpperBound()};this.focusElFromLabel=t=>{var i;(i=this.paginationBarEl.querySelector(t))===null||i===void 0?void 0:i.setFocus()};this.goToPage=()=>{const t=this.pageInputEl;const i=Number(t.value);if(i<=this.totalPages&&i>0){this.changePage(i);this.paginationEl.setCurrentPage(i);this.currentPage=i;t.value="";this.icPageChange.emit({value:i});this.pageInputTooltipEl.displayTooltip(false,false);t.validationStatus=""}else{this.setInputError(t,this.INVALID_PAGE_ERROR)}};this.goToPageLabelClickHandler=()=>{this.focusElFromLabel("ic-text-field")};this.handleBlur=()=>{const t=this.pageInputEl;if(Number(t.value)<=this.totalPages&&Number(t.value)>0||t.value===""){t.validationStatus=""}this.pageInputTooltipEl.displayTooltip(false,false)};this.handleFocus=()=>{if(this.pageInputEl.validationStatus==="error"){this.pageInputTooltipEl.displayTooltip(true,true)}};this.handleInputChange=()=>{const t=parseInt(this.pageInputEl.value);if(t>this.totalPages||t<=0){this.setInputError(this.pageInputEl,this.INVALID_PAGE_ERROR);this.pageInputTooltipEl.displayTooltip(true,true)}};this.handleKeydown=t=>{if(t.key==="Enter"){if(this.pageInputEl.validationStatus==="error"){this.pageInputTooltipEl.displayTooltip(true,true)}else{this.goToPage()}}else{this.pageInputTooltipEl.displayTooltip(false,false);this.pageInputEl.validationStatus=""}};this.handleKeyUp=t=>{if(Number.isNaN(parseInt(this.pageInputEl.value))&&t.key!=="Backspace"&&t.key!=="Enter"&&t.key!=="Tab"&&t.key!=="Shift"){this.setInputError(this.pageInputEl,"Please enter a number",false);this.pageInputTooltipEl.displayTooltip(true,false)}};this.itemsPerPageLabelClickHandler=()=>{this.focusElFromLabel("ic-select")};this.paginationShouldWrap=()=>{if(this.type==="simple"){this.paginationWrapped=this.paginationEl.clientHeight>63}};this.runResizeObserver=()=>{this.resizeObserver=new ResizeObserver((()=>{const{clientWidth:t}=this.paginationBarEl;if(t-this.paginationWidth>50||t-this.paginationWidth<-50){this.paginationWidth=t;this.paginationShouldWrap()}}));this.resizeObserver.observe(this.paginationBarEl)};this.setInputError=(t,i,e=true)=>{this.inputError=i;t.validationStatus="error";if(e)t.setFocus()};this.setItemsPerPage=t=>{if(this.itemsPerPage!==t){this.itemsPerPage=t;this.itemsPerPageString=t.toString();this.icItemsPerPageChange.emit({value:this.itemsPerPage})}this.totalPages=this.totalItems>this.itemsPerPage?Math.ceil(this.totalItems/this.itemsPerPage):1;this.setUpperBound();if(this.currentPage>this.totalPages){this.paginationEl.setCurrentPage(this.totalPages);this.currentPage=this.totalPages}this.icPageChange.emit({value:this.currentPage})};this.setPaginationBarContent=()=>{var t;const i=((t=this.itemsPerPageOptions)===null||t===void 0?void 0:t.slice(0,3))||(this.totalItems<=100?[{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"}]:[{label:"25",value:"25"},{label:"100",value:"100"},{label:"1000",value:"1000"}]);i.push({label:"All",value:String(this.totalItems)});this.displayedItemsPerPageOptions=i.filter((({value:t})=>this.totalItems>=Number(t)));let e=0;const a=this.displayedItemsPerPageOptions.some((({value:t})=>{e=Number(t);return this.itemsPerPage<=e}));this.setItemsPerPage(a||!a&&this.itemsPerPage>e?e:this.itemsPerPage)};this.setUpperBound=()=>{this.upperBound=Math.min(this.lowerBound+this.itemsPerPage-1,this.totalItems)};this.capitalizedItemLabel=undefined;this.capitalizedPageLabel=undefined;this.currentPage=1;this.displayedItemsPerPageOptions=undefined;this.inputError="Please enter a valid page";this.itemsPerPage=0;this.itemsPerPageString="0";this.lowerBound=1;this.lowerCaseItemLabel=undefined;this.lowerCasePageLabel=undefined;this.paginationWidth=undefined;this.paginationWrapped=false;this.totalPages=undefined;this.upperBound=undefined;this.alignment="right";this.appearance="default";this.itemLabel="Item";this.itemsPerPageOptions=undefined;this.type="simple";this.rangeLabelType="page";this.pageLabel="Page";this.showGoToPageControl=false;this.hideRangeLabel=false;this.showItemsPerPageControl=false;this.totalItems=undefined}watchItemLabelHandler(){this.capitalizedItemLabel=r(this.itemLabel);this.lowerCaseItemLabel=this.itemLabel.toLowerCase()}watchItemsPerPageOptionsHandler(t,i){if(JSON.stringify(t)===JSON.stringify(i))return;this.setPaginationBarContent()}watchPageLabelHandler(){this.capitalizedPageLabel=r(this.pageLabel);this.lowerCasePageLabel=this.pageLabel.toLowerCase()}watchTotalItemsHandler(){this.setPaginationBarContent()}disconnectedCallback(){var t;(t=this.resizeObserver)===null||t===void 0?void 0:t.disconnect()}componentWillLoad(){this.watchPageLabelHandler();this.watchItemLabelHandler();this.setPaginationBarContent()}componentDidLoad(){var t,i;this.paginationWidth=this.paginationBarEl.clientWidth;c(this.runResizeObserver);const e=(t=this.el.shadowRoot)===null||t===void 0?void 0:t.querySelector(`.${this.PAGE_INPUT_FIELD_ID}`);if(e){const t=(i=e===null||e===void 0?void 0:e.shadowRoot)===null||i===void 0?void 0:i.querySelector("input");if(t){t.style.textAlign="center";t.style.padding="0"}}this.paginationShouldWrap()}pageChangeHandler(t){const i=t.detail.value;this.changePage(i)}render(){const{appearance:t,alignment:i,displayedItemsPerPageOptions:a,PAGE_INPUT_FIELD_ID:s,type:n,rangeLabelType:l,hideRangeLabel:h,showItemsPerPageControl:o,showGoToPageControl:r,pageLabel:c,capitalizedPageLabel:p,lowerCasePageLabel:g,capitalizedItemLabel:d,lowerCaseItemLabel:m,totalPages:u,currentPage:f,itemsPerPageString:b}=this;return e("div",{class:{["pagination-bar"]:true,[`pagination-bar-${i}`]:true},ref:t=>this.paginationBarEl=t},(!h||o)&&e("div",{class:"item-controls"},o&&e("div",{class:"items-per-page-holder"},e("ic-typography",{class:{[`pagination-text-${t}`]:true,["items-per-page-control-label"]:true},variant:"label",onClick:this.itemsPerPageLabelClickHandler},d,"s per ",g),e("ic-select",{small:true,label:"items-per-page-input",class:"items-per-page-input",hideLabel:true,options:a,value:b,onIcChange:this.changeItemsPerPage,ref:t=>this.pageDropdownEl=t})),!h&&(l==="data"?e("ic-typography",{class:{[`pagination-text-${t}`]:true,["item-pagination-label"]:true},variant:"label","aria-live":"polite"},this.upperBound===0&&`0 ${m}s`,this.upperBound>0&&`${this.lowerBound} - ${this.upperBound} of ${this.totalItems} ${m}${this.totalItems>1?"s":""}`):e("ic-typography",{class:{[`pagination-text-${t}`]:true,["page-pagination-label"]:true},variant:"label","aria-live":"polite"},p," ",f," of ",u))),e("div",{class:{["pagination-controls"]:true,["pagination-controls-wrap"]:this.paginationWrapped}},e("div",{class:"pagination-holder"},e("ic-pagination",{appearance:t,type:n,pages:u,label:c,ref:t=>this.paginationEl=t})),r&&e("div",{class:"go-to-page-holder"},e("ic-typography",{class:{[`pagination-text-${t}`]:true},variant:"label",onClick:this.goToPageLabelClickHandler},"Go to ",g),e("ic-tooltip",{label:this.inputError,target:`#${s}`,disableHover:true,disableClick:true,ref:t=>this.pageInputTooltipEl=t},e("ic-text-field",{type:"number",size:"small",label:s,class:s,id:s,hideLabel:true,onKeyDown:this.handleKeydown,onKeyUp:this.handleKeyUp,onInput:this.handleInputChange,max:u,min:"1",validationInlineInternal:true,onBlur:this.handleBlur,onFocus:this.handleFocus,ref:t=>this.pageInputEl=t})),e("ic-button",{appearance:t,variant:"secondary",onClick:this.goToPage,size:"small",class:"go-to-page-button"},"Go"))))}get el(){return s(this)}static get watchers(){return{itemLabel:["watchItemLabelHandler"],itemsPerPageOptions:["watchItemsPerPageOptionsHandler"],pageLabel:["watchPageLabelHandler"],totalItems:["watchTotalItemsHandler"]}}};m.style=d;export{g as ic_empty_state,m as ic_pagination_bar};
2
- //# sourceMappingURL=p-a052bb95.entry.js.map
1
+ import{r as t,f as i,h as e,H as a,g as s,c as n}from"./p-8455d1bb.js";import{j as l,i as h,a as o}from"./p-8128572e.js";import{C as r,D as c}from"./p-297e99cf.js";import"./p-fd186591.js";const p=":host{gap:var(--ic-space-xs);padding:var(--ic-space-xs)}:host,.action-area{display:flex;flex-direction:column}.action-area{gap:var(--ic-space-md)}:host ::slotted(svg),:host ::slotted(img){border-radius:var(--ic-space-xxs)}:host(.right),:host(.right) .action-area{align-items:flex-end;text-align:right}:host(.center),:host(.center) .action-area{align-items:center;text-align:center}:host(.image-default) ::slotted(svg),:host(.image-default) ::slotted(img){height:calc(3 * var(--ic-space-lg)) !important;width:calc(3 * var(--ic-space-lg)) !important}:host(.image-small) ::slotted(svg),:host(.image-small) ::slotted(img){height:var(--ic-space-xxl) !important;width:var(--ic-space-xxl) !important}:host(.image-large) ::slotted(svg),:host(.image-large) ::slotted(img){height:calc(4 * var(--ic-space-xl)) !important;width:calc(4 * var(--ic-space-xl)) !important}";const g=class{constructor(e){t(this,e);this.hostMutationObserver=null;this.hostMutationCallback=t=>{if(t.some((({type:t,addedNodes:i,removedNodes:e})=>t==="childList"?l(i,e,["image","actions"]):false))){i(this)}};this.aligned="left";this.body=undefined;this.bodyMaxLines=undefined;this.heading=undefined;this.imageSize="default";this.subheading=undefined}disconnectedCallback(){var t;(t=this.hostMutationObserver)===null||t===void 0?void 0:t.disconnect()}componentDidLoad(){!h(this.el,"heading")&&o([{prop:this.heading,propName:"heading"}],"Empty State");this.hostMutationObserver=new MutationObserver(this.hostMutationCallback);this.hostMutationObserver.observe(this.el,{childList:true})}render(){const{aligned:t,body:i,bodyMaxLines:s,heading:n,imageSize:l,subheading:o}=this;return e(a,{class:{[`${t}`]:true,[`image-${l}`]:h(this.el,"image")}},h(this.el,"image")&&e("slot",{name:"image"}),e("div",null,e("slot",{name:"heading"},e("ic-typography",{variant:"h4"},n)),e("slot",{name:"subheading"},e("ic-typography",{variant:"subtitle-small"},o)),e("slot",{name:"body"},e("ic-typography",{maxLines:s},i))),h(this.el,"actions")&&e("div",{class:"action-area"},e("slot",{name:"actions"})))}get el(){return s(this)}};g.style=p;const d=":host(){display:block}.pagination-bar{height:3.5rem;display:flex;align-items:center;justify-content:flex-end;gap:var(--ic-space-xl);padding:var(--ic-space-xs) var(--ic-space-md);box-sizing:border-box}.pagination-bar-left{justify-content:flex-start}.item-controls{display:flex;align-items:center;gap:var(--ic-space-xl)}.pagination-bar-space-between .item-controls{margin-right:auto}.items-per-page-holder{display:flex;align-items:center;gap:var(--ic-space-xs)}.items-per-page-input{--input-width:5rem}.pagination-controls{display:flex;align-items:center;gap:var(--ic-space-xl)}.pagination-controls-wrap{flex-direction:column;align-items:flex-end;gap:var(--ic-space-xs)}.pagination-bar-space-between .pagination-controls{margin-left:auto}.go-to-page-holder{display:flex;align-items:center;gap:var(--ic-space-xs)}.go-to-page-input{--input-width:var(--ic-space-xl)}.go-to-page-button{--min-width:var(--ic-space-xl)}.pagination-text-default,.pagination-text-dark,.pagination-text-light{white-space:nowrap}.pagination-text-light{color:var(--ic-color-white-text)}@media screen and (max-width: 768px){.pagination-bar{flex-direction:column;align-items:flex-end;height:-moz-fit-content;height:fit-content;gap:var(--ic-space-xs)}.pagination-bar-left{align-items:flex-start}}@media screen and (max-width: 320px){.item-controls,.pagination-controls{flex-direction:column;align-items:flex-end;gap:var(--ic-space-xs)}.pagination-bar-left .item-controls,.pagination-bar-left .pagination-controls,.pagination-bar-space-between .item-controls,.pagination-bar-space-between .pagination-controls{align-items:flex-start}}";const m=class{constructor(i){t(this,i);this.icPageChange=n(this,"icPageChange",7);this.icItemsPerPageChange=n(this,"icItemsPerPageChange",7);this.PAGE_INPUT_FIELD_ID="go-to-page-input";this.INVALID_PAGE_ERROR="Please enter a valid page";this.resizeObserver=null;this.changeItemsPerPage=()=>{this.setItemsPerPage(Number(this.pageDropdownEl.value))};this.changePage=t=>{this.currentPage=t;this.lowerBound=t!==1?(t-1)*this.itemsPerPage+1:t;this.setUpperBound()};this.focusElFromLabel=t=>{var i;(i=this.paginationBarEl.querySelector(t))===null||i===void 0?void 0:i.setFocus()};this.goToPage=()=>{const t=this.pageInputEl;const i=Number(t.value);if(i<=this.totalPages&&i>0){this.changePage(i);this.paginationEl.setCurrentPage(i);this.currentPage=i;t.value="";this.icPageChange.emit({value:i});this.pageInputTooltipEl.displayTooltip(false,false);t.validationStatus=""}else{this.setInputError(t,this.INVALID_PAGE_ERROR)}};this.goToPageLabelClickHandler=()=>{this.focusElFromLabel("ic-text-field")};this.handleBlur=()=>{const t=this.pageInputEl;if(Number(t.value)<=this.totalPages&&Number(t.value)>0||t.value===""){t.validationStatus=""}this.pageInputTooltipEl.displayTooltip(false,false)};this.handleFocus=()=>{if(this.pageInputEl.validationStatus==="error"){this.pageInputTooltipEl.displayTooltip(true,true)}};this.handleInputChange=()=>{const t=parseInt(this.pageInputEl.value);if(t>this.totalPages||t<=0){this.setInputError(this.pageInputEl,this.INVALID_PAGE_ERROR);this.pageInputTooltipEl.displayTooltip(true,true)}};this.handleKeydown=t=>{if(t.key==="Enter"){if(this.pageInputEl.validationStatus==="error"){this.pageInputTooltipEl.displayTooltip(true,true)}else{this.goToPage()}}else{this.pageInputTooltipEl.displayTooltip(false,false);this.pageInputEl.validationStatus=""}};this.handleKeyUp=t=>{if(Number.isNaN(parseInt(this.pageInputEl.value))&&t.key!=="Backspace"&&t.key!=="Enter"&&t.key!=="Tab"&&t.key!=="Shift"){this.setInputError(this.pageInputEl,"Please enter a number",false);this.pageInputTooltipEl.displayTooltip(true,false)}};this.itemsPerPageLabelClickHandler=()=>{this.focusElFromLabel("ic-select")};this.paginationShouldWrap=()=>{if(this.type==="simple"){this.paginationWrapped=this.paginationEl.clientHeight>63}};this.runResizeObserver=()=>{this.resizeObserver=new ResizeObserver((()=>{const{clientWidth:t}=this.paginationBarEl;if(t-this.paginationWidth>50||t-this.paginationWidth<-50){this.paginationWidth=t;this.paginationShouldWrap()}}));this.resizeObserver.observe(this.paginationBarEl)};this.setInputError=(t,i,e=true)=>{this.inputError=i;t.validationStatus="error";if(e)t.setFocus()};this.setItemsPerPage=t=>{if(this.itemsPerPage!==t){this.itemsPerPage=t;this.itemsPerPageString=t.toString();this.icItemsPerPageChange.emit({value:this.itemsPerPage})}this.totalPages=this.totalItems>this.itemsPerPage?Math.ceil(this.totalItems/this.itemsPerPage):1;this.setUpperBound();if(this.currentPage>this.totalPages){this.paginationEl.setCurrentPage(this.totalPages);this.currentPage=this.totalPages}this.icPageChange.emit({value:this.currentPage})};this.setPaginationBarContent=()=>{var t;const i=((t=this.itemsPerPageOptions)===null||t===void 0?void 0:t.slice(0,3))||(this.totalItems<=100?[{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"}]:[{label:"25",value:"25"},{label:"100",value:"100"},{label:"1000",value:"1000"}]);i.push({label:"All",value:String(this.totalItems)});this.displayedItemsPerPageOptions=i.filter((({value:t})=>this.totalItems>=Number(t)));let e=0;const a=this.displayedItemsPerPageOptions.some((({value:t})=>{e=Number(t);return this.itemsPerPage<=e}));this.setItemsPerPage(a||!a&&this.itemsPerPage>e?e:this.itemsPerPage)};this.setUpperBound=()=>{this.upperBound=Math.min(this.lowerBound+this.itemsPerPage-1,this.totalItems)};this.capitalizedItemLabel=undefined;this.capitalizedPageLabel=undefined;this.currentPage=1;this.displayedItemsPerPageOptions=undefined;this.inputError="Please enter a valid page";this.itemsPerPage=0;this.itemsPerPageString="0";this.lowerBound=1;this.lowerCaseItemLabel=undefined;this.lowerCasePageLabel=undefined;this.paginationWidth=undefined;this.paginationWrapped=false;this.totalPages=undefined;this.upperBound=undefined;this.alignment="right";this.appearance="default";this.itemLabel="Item";this.itemsPerPageOptions=undefined;this.type="simple";this.rangeLabelType="page";this.pageLabel="Page";this.showGoToPageControl=false;this.hideRangeLabel=false;this.showItemsPerPageControl=false;this.totalItems=undefined}watchItemLabelHandler(){this.capitalizedItemLabel=r(this.itemLabel);this.lowerCaseItemLabel=this.itemLabel.toLowerCase()}watchItemsPerPageOptionsHandler(t,i){if(JSON.stringify(t)===JSON.stringify(i))return;this.setPaginationBarContent()}watchPageLabelHandler(){this.capitalizedPageLabel=r(this.pageLabel);this.lowerCasePageLabel=this.pageLabel.toLowerCase()}watchTotalItemsHandler(){this.setPaginationBarContent()}disconnectedCallback(){var t;(t=this.resizeObserver)===null||t===void 0?void 0:t.disconnect()}componentWillLoad(){this.watchPageLabelHandler();this.watchItemLabelHandler();this.setPaginationBarContent()}componentDidLoad(){var t,i;this.paginationWidth=this.paginationBarEl.clientWidth;c(this.runResizeObserver);const e=(t=this.el.shadowRoot)===null||t===void 0?void 0:t.querySelector(`.${this.PAGE_INPUT_FIELD_ID}`);if(e){const t=(i=e===null||e===void 0?void 0:e.shadowRoot)===null||i===void 0?void 0:i.querySelector("input");if(t){t.style.textAlign="center";t.style.padding="0"}}this.paginationShouldWrap()}pageChangeHandler(t){const i=t.detail.value;this.changePage(i)}render(){const{appearance:t,alignment:i,displayedItemsPerPageOptions:a,PAGE_INPUT_FIELD_ID:s,type:n,rangeLabelType:l,hideRangeLabel:h,showItemsPerPageControl:o,showGoToPageControl:r,pageLabel:c,capitalizedPageLabel:p,lowerCasePageLabel:g,capitalizedItemLabel:d,lowerCaseItemLabel:m,totalPages:u,currentPage:f,itemsPerPageString:v}=this;return e("div",{class:{["pagination-bar"]:true,[`pagination-bar-${i}`]:true},ref:t=>this.paginationBarEl=t},(!h||o)&&e("div",{class:"item-controls"},o&&e("div",{class:"items-per-page-holder"},e("ic-typography",{class:{[`pagination-text-${t}`]:true,["items-per-page-control-label"]:true},variant:"label",onClick:this.itemsPerPageLabelClickHandler},d,"s per ",g),e("ic-select",{small:true,label:"items-per-page-input",class:"items-per-page-input",hideLabel:true,options:a,value:v,onIcChange:this.changeItemsPerPage,ref:t=>this.pageDropdownEl=t})),!h&&(l==="data"?e("ic-typography",{class:{[`pagination-text-${t}`]:true,["item-pagination-label"]:true},variant:"label","aria-live":"polite"},this.upperBound===0&&`0 ${m}s`,this.upperBound>0&&`${this.lowerBound} - ${this.upperBound} of ${this.totalItems} ${m}${this.totalItems>1?"s":""}`):e("ic-typography",{class:{[`pagination-text-${t}`]:true,["page-pagination-label"]:true},variant:"label","aria-live":"polite"},p," ",f," of ",u))),e("div",{class:{["pagination-controls"]:true,["pagination-controls-wrap"]:this.paginationWrapped}},e("div",{class:"pagination-holder"},e("ic-pagination",{appearance:t,type:n,pages:u,label:c,ref:t=>this.paginationEl=t})),r&&e("div",{class:"go-to-page-holder"},e("ic-typography",{class:{[`pagination-text-${t}`]:true},variant:"label",onClick:this.goToPageLabelClickHandler},"Go to ",g),e("ic-tooltip",{label:this.inputError,target:`#${s}`,disableHover:true,disableClick:true,ref:t=>this.pageInputTooltipEl=t},e("ic-text-field",{type:"number",size:"small",label:s,class:s,id:s,hideLabel:true,onKeyDown:this.handleKeydown,onKeyUp:this.handleKeyUp,onInput:this.handleInputChange,max:u,min:"1",validationInlineInternal:true,onBlur:this.handleBlur,onFocus:this.handleFocus,ref:t=>this.pageInputEl=t})),e("ic-button",{appearance:t,variant:"secondary",onClick:this.goToPage,size:"small",class:"go-to-page-button"},"Go"))))}get el(){return s(this)}static get watchers(){return{itemLabel:["watchItemLabelHandler"],itemsPerPageOptions:["watchItemsPerPageOptionsHandler"],pageLabel:["watchPageLabelHandler"],totalItems:["watchTotalItemsHandler"]}}};m.style=d;export{g as ic_empty_state,m as ic_pagination_bar};
2
+ //# sourceMappingURL=p-c98ce508.entry.js.map